tekivex-ui 2.1.0 → 2.3.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 (71) hide show
  1. package/dist/index.cjs +75 -14
  2. package/dist/index.d.ts +34 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +11013 -4880
  5. package/dist/src/components/TkxAffix.d.ts +10 -0
  6. package/dist/src/components/TkxAffix.d.ts.map +1 -0
  7. package/dist/src/components/TkxAnchor.d.ts +14 -0
  8. package/dist/src/components/TkxAnchor.d.ts.map +1 -0
  9. package/dist/src/components/TkxCascader.d.ts +16 -0
  10. package/dist/src/components/TkxCascader.d.ts.map +1 -0
  11. package/dist/src/components/TkxConfigProvider.d.ts +100 -0
  12. package/dist/src/components/TkxConfigProvider.d.ts.map +1 -0
  13. package/dist/src/components/TkxDataGrid.d.ts +5 -1
  14. package/dist/src/components/TkxDataGrid.d.ts.map +1 -1
  15. package/dist/src/components/TkxEmpty.d.ts +870 -0
  16. package/dist/src/components/TkxEmpty.d.ts.map +1 -0
  17. package/dist/src/components/TkxForm.d.ts +54 -0
  18. package/dist/src/components/TkxForm.d.ts.map +1 -0
  19. package/dist/src/components/TkxLayout.d.ts +87 -0
  20. package/dist/src/components/TkxLayout.d.ts.map +1 -0
  21. package/dist/src/components/TkxList.d.ts +24 -0
  22. package/dist/src/components/TkxList.d.ts.map +1 -0
  23. package/dist/src/components/TkxMentions.d.ts +15 -0
  24. package/dist/src/components/TkxMentions.d.ts.map +1 -0
  25. package/dist/src/components/TkxQRCode.d.ts +11 -0
  26. package/dist/src/components/TkxQRCode.d.ts.map +1 -0
  27. package/dist/src/components/TkxResult.d.ts +11 -0
  28. package/dist/src/components/TkxResult.d.ts.map +1 -0
  29. package/dist/src/components/TkxSegmented.d.ts +16 -0
  30. package/dist/src/components/TkxSegmented.d.ts.map +1 -0
  31. package/dist/src/components/TkxSelect.d.ts +5 -1
  32. package/dist/src/components/TkxSelect.d.ts.map +1 -1
  33. package/dist/src/components/TkxSpin.d.ts +15 -0
  34. package/dist/src/components/TkxSpin.d.ts.map +1 -0
  35. package/dist/src/components/TkxStatistic.d.ts +1746 -0
  36. package/dist/src/components/TkxStatistic.d.ts.map +1 -0
  37. package/dist/src/components/TkxTour.d.ts +15 -0
  38. package/dist/src/components/TkxTour.d.ts.map +1 -0
  39. package/dist/src/components/TkxTypography.d.ts +2614 -0
  40. package/dist/src/components/TkxTypography.d.ts.map +1 -0
  41. package/dist/src/components/TkxWatermark.d.ts +12 -0
  42. package/dist/src/components/TkxWatermark.d.ts.map +1 -0
  43. package/dist/src/components/index.d.ts +17 -0
  44. package/dist/src/components/index.d.ts.map +1 -1
  45. package/dist/src/engine/tkx.d.ts +38 -0
  46. package/dist/src/engine/tkx.d.ts.map +1 -1
  47. package/dist/src/themes/index.d.ts +108 -0
  48. package/dist/src/themes/index.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/src/components/TkxAffix.tsx +138 -0
  51. package/src/components/TkxAnchor.tsx +193 -0
  52. package/src/components/TkxCascader.tsx +276 -0
  53. package/src/components/TkxConfigProvider.tsx +458 -0
  54. package/src/components/TkxDataGrid.tsx +65 -2
  55. package/src/components/TkxEmpty.tsx +219 -0
  56. package/src/components/TkxForm.tsx +607 -0
  57. package/src/components/TkxLayout.tsx +647 -0
  58. package/src/components/TkxList.tsx +242 -0
  59. package/src/components/TkxMentions.tsx +210 -0
  60. package/src/components/TkxQRCode.tsx +174 -0
  61. package/src/components/TkxResult.tsx +128 -0
  62. package/src/components/TkxSegmented.tsx +169 -0
  63. package/src/components/TkxSelect.tsx +209 -6
  64. package/src/components/TkxSpin.tsx +261 -0
  65. package/src/components/TkxStatistic.tsx +261 -0
  66. package/src/components/TkxTour.tsx +239 -0
  67. package/src/components/TkxTypography.tsx +263 -0
  68. package/src/components/TkxWatermark.tsx +143 -0
  69. package/src/components/index.ts +17 -0
  70. package/src/engine/tkx.ts +62 -0
  71. package/src/themes/index.ts +149 -0
package/dist/index.cjs CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),t=require("react/jsx-runtime"),Be=require("react-dom"),lo=2166136261,co=16777619;function tt(e){let r=lo;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,co)>>>0;return r.toString(16).padStart(8,"0")}class qr{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 qr(512);function Zr(e,r){const n=st.get(e);if(n!==void 0)return n;const i=r();return st.set(e,i),i}const Gr=[];let Yt=!1;const ft=[];let ir=0,ot=0;function uo(){const e=Gr.splice(0),r=performance.now();for(const i of e)try{i()}catch{}const n=performance.now()-r;ir+=n,ot++,ft.push({duration:n,timestamp:Date.now()}),ft.length>100&&ft.shift()}function Jr(e){Gr.push(e),Yt||(Yt=!0,queueMicrotask(()=>{uo(),Yt=!1}))}function fo(e){const r=e!==void 0?ft.slice(-e):ft.slice();return{avgRenderTime:ot===0?0:ir/ot,cacheHitRate:st.cacheHitRate,renderCount:ot,recent:r}}function po(e){e!==void 0?st.invalidate(e):st.invalidate()}const xo={hash:tt,memoize:Zr,batchUpdate:Jr,invalidate:po,get avgRenderTime(){return ot===0?0:ir/ot},get cacheHitRate(){return st.cacheHitRate},getMetrics:fo},Et=new Map;function Qr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function ho(e){return"tkx-"+tt(e)}function en(e){const r=ho(e);return Et.has(r)||Et.set(r,e),r}function tn(e,...r){const n=e.reduce((s,a,l)=>s+a+(r[l]!==void 0?String(r[l]):""),"");return{className:en(n.trim()),styles:n.trim()}}function rn(e){const r=Object.entries(e).map(([i,s])=>`${Qr(i)}: ${s};`).join(" ");return{className:en(r),styles:r}}const mo={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function nn(e,r){return`@media (min-width: ${mo[e]}) { ${r} }`}function on(e,r){const n=Object.entries(r).map(([i,s])=>{const a=Object.entries(s).map(([l,d])=>`${Qr(l)}: ${d};`).join(" ");return`${i} { ${a} }`}).join(" ");return`@keyframes ${e} { ${n} }`}function ar(e,r){return r!==void 0?`--tkx-${e}: ${r};`:`var(--tkx-${e})`}function lr(){return Array.from(Et.entries()).map(([e,r])=>`.${e} { ${r} }`).join(`
2
- `)}function go(){Et.clear()}function sn(){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=lr()}const bo={css:tn,fromObject:rn,responsive:nn,keyframes:on,cssVar:ar,extractCSS:lr,injectStyles:sn,resetStyles:go};function yo(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 vr(e){const[r,n,i]=yo(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=vr(e),i=vr(r),s=Math.max(n,i),a=Math.min(n,i);return(s+.05)/(a+.05)}function zt(e,r,n=!1){return it(e,r)>=(n?3:4.5)}function an(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 ln(){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 vo=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function cr(e){let r=null,n=null;function i(){return Array.from(e.querySelectorAll(vo)).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 cn(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 ko(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 dr(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ur(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function wo(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 jo={contrastRatio:it,meetsAA:zt,meetsAAA:an,getAccessibleForeground:Ue,createAnnouncer:ln,createFocusTrap:cr,handleTabsKeyboard:cn,handleMenuKeyboard:ko,prefersReducedMotion:dr,prefersHighContrast:ur,announce:wo},fr={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},So={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},$o=/^#[0-9a-fA-F]{3,8}$/;function Mo(e,r){const n={...e,...r};for(const[i,s]of Object.entries(n))if(!$o.test(s))throw new Error(`Invalid hex color for theme token '${i}': ${s}`);return zt(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)`),zt(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 pr=c.createContext(fr);function Co({theme:e=fr,children:r}){return c.useEffect(()=>{const n=Object.entries(e).map(([s,a])=>ar(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(pr.Provider,{value:e},r)}function ee(){return c.useContext(pr)}const To={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;"};function B(e){return String(e).replace(/[<>&'"]/g,r=>To[r]??r)}function xr(e){const r={};for(const n of Object.keys(e))r[n]=dn(e[n]);return r}function dn(e){return typeof e=="string"?B(e):Array.isArray(e)?e.map(dn):e!==null&&typeof e=="object"&&!Io(e)?xr(e):e}function Io(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function At(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 un=new Map;function Eo(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 un.set(e,i),i}function zo(e,r){const n=un.get(e);return(n==null?void 0:n.permissions[r])===!0}let Je=[];function fn(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 pn(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 xn(){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 No={sanitize:B,sanitizeProps:xr,validateProps:At,createCSP:Eo,hasPermission:zo,audit:fn,getAuditLog:pn,verifyAuditIntegrity:xn};function ye(){const[e,r]=c.useState(()=>typeof window>"u"?!1:dr());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 Ro(){const[e,r]=c.useState(()=>typeof window>"u"?!1:ur());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 Dt(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=cr(r.current);return n.activate(),()=>n.deactivate()},[e]),r}function hr(){const e=c.useRef(null);return c.useEffect(()=>{if(!(typeof document>"u"))return e.current=ln(),()=>{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||typeof document>"u")return;const i=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[r])}function hn(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"},kr={...he,screen:"100vh"},We={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},$t={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},wr={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"},Ao={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"]},Do={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Lo={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"},Fo={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},Mt={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Po=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)])),mn=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Bo={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ae(e){const r=e.match(/^\[(.+)]$/);return r?r[1]:null}function Pe(e){if(mn.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 Wo(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 S=f&&g!=="0"?`-${g}`:g;return{"margin-left":S,"margin-right":S}}}if(o=e.match(/^-?my-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const S=f&&g!=="0"?`-${g}`:g;return{"margin-top":S,"margin-bottom":S}}}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]??We[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=kr[f]??We[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=kr[o[1]]??ae(o[1]);if(f)return{"max-height":f}}if(o=e.match(/^size-(.+)$/)){const f=he[o[1]]??We[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]=Ao[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":Do[o[1]]??o[1]};if(o=e.match(/^leading-(.+)$/)){const f=Lo[o[1]]??ae(o[1]);if(f)return{"line-height":f}}if(o=e.match(/^tracking-(.+)$/)){const f=Fo[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("/"),S=Pe(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:S,opacity:String(F)}}return{color:S}}}if(o=e.match(/^bg-(.+)$/)){const[f,g]=o[1].split("/"),S=Pe(f);return g?{"background-color":S,opacity:String(parseInt(g)/100)}:f==="none"?{background:"none"}:{"background-color":S}}if(o=e.match(/^border-color-(.+)$/))return{"border-color":Pe(o[1])};if(o=e.match(/^fill-(.+)$/))return{fill:Pe(o[1])};if(o=e.match(/^stroke-(.+)$/))return{stroke:Pe(o[1])};if(o=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Pe(o[1])};if(o=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Pe(o[1])};if(o=e.match(/^accent-(.+)$/))return{"accent-color":Pe(o[1])};if(o=e.match(/^caret-(.+)$/))return{"caret-color":Pe(o[1])};if(o=e.match(/^outline-color-(.+)$/))return{"outline-color":Pe(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].*)$/))&&mn.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":$t[""]};if(o=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":$t[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=$t[o[2]??""]??$t[""];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":wr[""]};if(o=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":wr[o[1]]};if(o=e.match(/^opacity-(\d+)$/)){const f=Po[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 y={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(y[e])return{"background-position":y[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(${Mt[""]})`};if(o=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${Mt[o[1]]})`};if(e==="blur")return{filter:`blur(${Mt[""]})`};if(o=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${Mt[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 v={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(v[e])return{position:v[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]]??We[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]]??We[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]]??We[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]]??We[o[1]]??ae(o[1]);if(g)return{left:f&&g!=="0"?`-${g}`:g}}const $={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=$[o[1]]??ae(o[1]);if(f)return{"z-index":f}}const w={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(w[e])return{overflow:w[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]]??We[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]]??We[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 M={"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(M[e])return{"transform-origin":M[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 j={"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(j[e])return{"transition-timing-function":j[e]};const k={"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(k[e])return{animation:k[e]};const Y={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return Y[e]?{"object-fit":Y[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 Ho(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 jr(e,r){for(const[n,i]of Object.entries(r))e[n]=i}function _t(e){return Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}const Nt=new Map;let He=null;function Vo(){return(!He||!He.isConnected)&&(He=document.getElementById("tkx-atomic"),He||(He=document.createElement("style"),He.id="tkx-atomic",document.head.appendChild(He))),He}function Oo(e,r){if(!Nt.has(e)&&(Nt.set(e,r),typeof document<"u")){const n=Vo();n.textContent+=r+`
3
- `}}function gn(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(...gn(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=gn(e);if(r.length===0)return"";const n={base:{},variants:{}};for(const u of r){const{variant:x,utility:o}=Ho(u),m=Wo(o);m&&(x?(n.variants[x]||(n.variants[x]={}),jr(n.variants[x],m)):jr(n.base,m))}const i=[],s=_t(n.base),a=[s,...Object.entries(n.variants).map(([u,x])=>`${u}{${_t(x)}}`)].join("|"),l=tt(a),d=`tkx-${l}`;s&&i.push(`.${d}{${s}}`);for(const[u,x]of Object.entries(n.variants)){const o=_t(x);if(o)if(u.startsWith("@")){const m=u.slice(1),p=Bo[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&&Oo(l,i.join("")),d}const Yo=b;function _o(){return Array.from(Nt.values()).join(`
4
- `)}function Uo(){Nt.clear(),He=null}function ue(...e){return e.filter(Boolean).join(" ")}const Ko={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Xo={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Sr={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},qo={sm:14,md:16,lg:18,xl:20};function Zo({size:e}){const r=qo[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 bn=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},y)=>{const z=ee(),v=ye(),$=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"?B(o):o,M=s?B(s):void 0,N=e==="solid"?{backgroundColor:C,color:I,border:"none",boxShadow:u&&!v?`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",Ko[r],Xo[r],Sr[r],e!=="link"&&Sr[r],d&&"w-full",$?"cursor-not-allowed opacity-60":"cursor-pointer",!v&&"transition-all duration-200","focus-visible:focus-ring");return t.jsx("button",{ref:y,"aria-busy":i,"aria-disabled":$,disabled:$,className:ue(T,m),style:{...N,...p},...h,children:i?t.jsxs(t.Fragment,{children:[t.jsx(Zo,{size:r}),M??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})]})})});bn.displayName="TkxButton";const Go={none:"",sm:"p-3",md:"p-5",lg:"p-7"},yn=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=ye(),p=s??(n?"button":"div"),h={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],y=b("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",Go[i],(r||n)&&!m&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return t.jsx(p,{ref:x,className:ue("tkx-card",y,l),style:{color:o.text,...h,...d},...u,children:a})});yn.displayName="TkxCard";function Jo({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 Qo({children:e,className:r,...n}){return t.jsx("div",{className:ue(b(""),r),...n,children:e})}function es({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 vn=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(),y=c.useId(),z=r??y,v=`${z}-hint`,$=`${z}-error`,w=l||!!n,C=[i&&v,w&&$].filter(Boolean).join(" ")||void 0,I=B(e),R=n?B(n):void 0,M=i?B(i):void 0,N=w?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":w,"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})]}),M&&!R&&t.jsx("span",{id:v,className:b("text-xs"),style:{color:h.textMuted},children:M}),R&&t.jsxs("span",{id:$,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]})]})});vn.displayName="TkxInput";const ts={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]"},rs={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},kn=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]),y=typeof a=="string"?B(a):a;return n?t.jsx("span",{ref:x,"aria-label":typeof a=="string"?B(a):void 0,className:ue(b("inline-block rounded-full",rs[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",ts[r],i&&"animate-pulse"),l),style:{backgroundColor:s?"transparent":p,color:s?p:h,border:s?`1px solid ${p}`:"none",...d},...u,children:y})});kn.displayName="TkxBadge";const ns={sm:"4px",md:"8px",lg:"12px"},os={sm:32,md:48,lg:64},wn=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=ye(),p=a??o.primary,h=e===void 0,y=e!==void 0?Math.min(100,Math.max(0,e)):0;if(e!==void 0){const{errors:v}=At({value:e},{value:{type:"number",min:0,max:100}});v.length>0&&console.warn("[TkxProgress]",v.join(", "))}if(r==="circular"){const v=os[n],$=n==="sm"?3:n==="md"?4:5,w=(v-$*2)/2,C=2*Math.PI*w,I=h?0:C-y/100*C;return t.jsxs("div",{ref:x,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:y,"aria-label":i??(h?"Loading":`${y}%`),className:ue(b("inline-flex flex-col items-center gap-1"),l),style:d,...u,children:[t.jsxs("svg",{width:v,height:v,viewBox:`0 0 ${v} ${v}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:v/2,cy:v/2,r:w,fill:"none",stroke:o.border,strokeWidth:$}),t.jsx("circle",{cx:v/2,cy:v/2,r:w,fill:"none",stroke:p,strokeWidth:$,strokeLinecap:"round",strokeDasharray:C,strokeDashoffset:I,transform:`rotate(-90 ${v/2} ${v/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:[y,"%"]})]})}const z=ns[n];return t.jsxs("div",{ref:x,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:y,"aria-label":i??(h?"Loading":`${y}%`),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:[y,"%"]})]}),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%":`${y}%`,transition:m?"none":"width 300ms ease",animation:h&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});wn.displayName="TkxProgress";const ss={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}},jn=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=ye(),p=c.useId();At({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:h,th:y,td:z,gap:v}=ss[i],$=e?h-z-v:v,w=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:y,borderRadius:y,backgroundColor:w},...u,children:t.jsx("span",{"aria-hidden":"true",className:b("absolute rounded-full"),style:{top:"50%",left:$,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"}})})]})});jn.displayName="TkxToggle";const is={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 as({variant:e,title:r,children:n,dismissible:i,onDismiss:s,icon:a,style:l,className:d}){const u=ee(),x=hr(),o=r?B(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??is[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 ls={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let tr=0;function cs(){++tr===1&&(document.body.style.overflow="hidden")}function $r(){--tr<=0&&(tr=0,document.body.style.overflow="")}function ds({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=Dt(e),m=ye(),p=hr(),h=B(n),y=i==="full";return Lt(r,a&&e),c.useEffect(()=>(e?(cs(),p(h,"polite")):$r(),()=>{e&&$r()}),[e,h,p]),!e||typeof document>"u"?null:Be.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000] flex",y?"items-stretch":"items-center justify-center",y?"":"p-4"),children:[t.jsx("div",{"aria-hidden":"true",onClick:s?r:void 0,className:b("absolute inset-0",!m&&"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",!m&&"animate-slide-up",y?"":"rounded-xl"),style:{backgroundColor:u.surface,border:`1px solid ${u.border}`,width:ls[i],maxWidth:"100%",maxHeight:y?"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:h}),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 Sn=c.createContext(null);function $n(){const e=c.useContext(Sn);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function us({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(Sn.Provider,{value:{activeIndex:o,setActiveIndex:m,baseId:x,tabCount:s},children:t.jsx("div",{className:l,style:a,children:i})})}function fs({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 ps({index:e,children:r,disabled:n=!1,className:i,style:s}){const a=ee(),{activeIndex:l,setActiveIndex:d,baseId:u,tabCount:x}=$n(),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=>cn(p,e,x,h=>{var y;d(h),(y=document.getElementById(`${u}-tab-${h}`))==null||y.focus()}),children:r})}function xs({children:e,className:r,...n}){return t.jsx("div",{className:r,...n,children:e})}function hs({index:e,children:r,style:n,className:i}){const{activeIndex:s,baseId:a}=$n();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 ms={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 gs({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=ye(),m=B(e),p=Ue(s.surfaceAlt,[s.text,"#ffffff","#000000"]);function h(){x.current=setTimeout(()=>l(!0),i)}function y(){x.current&&clearTimeout(x.current),l(!1)}Lt(y,a),hn(d,y);const z=c.cloneElement(r,{"aria-describedby":a?u:void 0,onMouseEnter:v=>{var $,w;(w=($=r.props).onMouseEnter)==null||w.call($,v),h()},onMouseLeave:v=>{var $,w;(w=($=r.props).onMouseLeave)==null||w.call($,v),y()},onFocus:v=>{var $,w;(w=($=r.props).onFocus)==null||w.call($,v),h()},onBlur:v=>{var $,w;(w=($=r.props).onBlur)==null||w.call($,v),y()}});return t.jsxs("span",{ref:d,className:b("relative inline-flex"),children:[z,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",!o&&"animate-fade-in"),style:{backgroundColor:s.surfaceAlt,color:p,border:`1px solid ${s.border}`,boxShadow:`0 4px 12px ${s.bg}40`,maxWidth:280,...ms[n]},children:m})]})}function Mr({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 mr=c.forwardRef(({variant:e="rectangular",width:r,height:n,lines:i,animation:s="pulse",className:a,style:l,...d},u)=>{const x=ee(),m=ye()?!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(Mr,{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(Mr,{variant:e,width:r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border})})});mr.displayName="TkxSkeleton";const bs={xs:24,sm:32,md:40,lg:56,xl:72},ys={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Mn=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=bs[i],y=s==="circle",z=o.surfaceAlt,v=Ue(z,[o.text,o.textMuted]),$=e&&!m,w=!$&&n,C=Math.max(8,h*.22),I=b("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),R=b("block object-cover",y?"rounded-full":"rounded-lg"),M=b("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return t.jsxs("div",{ref:x,className:ue(I,l),style:{width:h,height:h,...d},...u,children:[$?t.jsx("img",{src:B(e),alt:B(r),onError:()=>p(!0),className:R,style:{width:h,height:h}}):t.jsx("div",{role:"img","aria-label":B(r),className:M,style:{width:h,height:h,backgroundColor:z,color:v,fontSize:h*.38},children:w?B(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:ys[a],border:`2px solid ${o.bg}`}})]})});Mn.displayName="TkxAvatar";function vs({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 ks({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,y]=c.useState("asc"),z=c.useMemo(()=>!m||!i?r:[...r].sort((w,C)=>{const I=w[m],R=C[m];let M=0;return typeof I=="string"&&typeof R=="string"?M=I.localeCompare(R):typeof I=="number"&&typeof R=="number"&&(M=I-R),h==="asc"?M:-M}),[r,m,h,i]);function v(w){m===w?y(C=>C==="asc"?"desc":"asc"):(p(w),y("asc"))}function $(w){return m!==w?"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:B(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(w=>{const C=i&&w.sortable!==!1,I=$(w.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:w.width},onClick:()=>C&&v(w.key),onKeyDown:R=>{C&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(w.key))},tabIndex:C?0:void 0,children:t.jsxs("span",{className:b("inline-flex items-center gap-1.5"),children:[B(w.header),C&&t.jsx(vs,{dir:I})]})},String(w.key))})})}),t.jsx("tbody",{children:a?Array.from({length:5},(w,C)=>t.jsx("tr",{children:e.map(I=>t.jsx("td",{className:b("px-4 py-3"),children:t.jsx(mr,{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((w,C)=>t.jsx("tr",{style:{backgroundColor:x&&C%2===1?o.surfaceAlt:"transparent",borderBottom:`1px solid ${o.border}`},children:e.map(I=>{const R=w[I.key],M=I.render?I.render(R,w):typeof R=="string"?B(R):String(R??"");return t.jsx("td",{className:b("px-4 py-3"),style:{color:o.text},children:M},String(I.key))})},C))})]})})}const Cn=c.forwardRef(({orientation:e="horizontal",label:r,variant:n="solid",className:i,style:s,...a},l)=>{const d=ee(),u=r?B(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})});Cn.displayName="TkxDivider";const ws={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 Cr(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function js(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 Ss({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 Tn({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:y,renderOption:z,maxMenuHeight:v=280,id:$,className:w,style:C}){const I=ee(),R=c.useId(),M=$??R,N=`${M}-listbox`,T=`${M}-hint`,j=`${M}-error`,k=r!==void 0,[Y,f]=c.useState(Cr(n)),g=k?Cr(r):Y,[S,F]=c.useState(!1),[D,V]=c.useState(""),[E,P]=c.useState(-1),[W,O]=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=ws[s],me=l||!!x,X=m&&D?e.filter(U=>U.label.toLowerCase().includes(D.toLowerCase())):e,Z=X.filter(U=>!U.disabled),ve=X.reduce((U,le)=>{const se=le.group??"";return U[se]||(U[se]=[]),U[se].push(le),U},{}),we=c.useCallback(U=>{var se;let le;o?le=g.includes(U)?g.filter(Se=>Se!==U):[...g,U]:le=[U],k||f(le),y==null||y(o?le:le[0]??""),o||(F(!1),V(""),P(-1),(se=G.current)==null||se.focus())},[k,o,y,g]),de=c.useCallback((U,le)=>{le.stopPropagation();const se=g.filter(Se=>Se!==U);k||f(se),y==null||y(o?se:se[0]??"")},[k,o,y,g]),ge=c.useCallback(U=>{U.stopPropagation(),k||f([]),y==null||y(o?[]:"")},[k,o,y]),J=c.useCallback(()=>{!G.current||!S||O(js(G.current,v))},[S,v]);c.useEffect(()=>{if(S)return J(),window.addEventListener("scroll",J,!0),window.addEventListener("resize",J),()=>{window.removeEventListener("scroll",J,!0),window.removeEventListener("resize",J)}},[S,J]),c.useEffect(()=>{if(!S)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)},[S]),c.useEffect(()=>{S&&m&&setTimeout(()=>{var U;return(U=ne.current)==null?void 0:U.focus()},0)},[S,m]),c.useEffect(()=>{var le;if(!S||E<0)return;const U=(le=xe.current)==null?void 0:le.querySelector(`[data-idx="${E}"]`);U==null||U.scrollIntoView({block:"nearest"})},[E,S]);const ie=U=>{switch(U.key){case"Enter":case" ":U.preventDefault(),S?E>=0&&Z[E]&&we(Z[E].value):te();break;case"Escape":U.preventDefault(),F(!1),V("");break;case"ArrowDown":U.preventDefault(),S?P(le=>Math.min(le+1,Z.length-1)):te();break;case"ArrowUp":U.preventDefault(),S?P(le=>Math.max(le-1,0)):te();break;case"Home":U.preventDefault(),S&&P(0);break;case"End":U.preventDefault(),S&&P(Z.length-1);break;default:U.key.length===1&&!U.ctrlKey&&!U.metaKey&&(S||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(),P(se=>Math.min(se+1,Z.length-1));break;case"ArrowUp":U.preventDefault(),P(se=>Math.max(se-1,0));break;case"Home":U.preventDefault(),P(0);break;case"End":U.preventDefault(),P(Z.length-1);break;case"Enter":U.preventDefault(),E>=0&&Z[E]&&we(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&&P(se),Q.current=setTimeout(()=>H(""),800)}function te(){if(a||h)return;F(!0);const U=Z.findIndex(le=>g.includes(le.value));P(U>=0?U:0)}const be=me?I.danger:S?I.primary:I.border,$e=E>=0&&Z[E]?`${M}-opt-${Z[E].value}`:void 0,Me=[u&&T,me&&j].filter(Boolean).join(" ")||void 0,Te=g.map(U=>e.find(le=>le.value===U)).filter(Boolean),Ke=S&&W?Be.createPortal(t.jsxs("div",{ref:pe,role:"listbox",id:N,"aria-label":d?B(d):"Options","aria-multiselectable":o,style:{position:"absolute",top:W.top,left:W.left,width:W.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:W.width,maxHeight:v,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:D,onChange:U=>{V(U.target.value),P(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:v-(m?48:0)},children:[Object.entries(ve).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:B(U)}),le.map(se=>{const Se=Z.indexOf(se),Ae=Se===E,De=g.includes(se.value),at=z?z(se,De):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:B(se.label)})]}),se.description&&t.jsx("span",{style:{fontSize:"12px",color:I.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(se.description)})]});return t.jsxs("div",{id:`${M}-opt-${se.value}`,"data-idx":Se>=0?Se:void 0,role:"option","aria-selected":De,"aria-disabled":se.disabled||void 0,onClick:()=>!se.disabled&&we(se.value),onMouseEnter:()=>!se.disabled&&Se>=0&&P(Se),style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:se.disabled?I.textMuted:I.text,backgroundColor:Ae?`${I.primary}22`:De?`${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",touchAction:"manipulation"},children:[at,De&&!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"),w),style:C,children:[d&&t.jsx("label",{htmlFor:M,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:I.text,userSelect:"none"},children:B(d)}),t.jsx("div",{style:{position:"relative",width:"100%",opacity:a?.55:1},children:t.jsxs("button",{ref:G,id:M,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":N,"aria-activedescendant":$e,"aria-invalid":me||void 0,"aria-describedby":Me,"aria-multiselectable":o,disabled:a,onClick:()=>S?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",touchAction:"manipulation"},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:B(U.label)}),t.jsx("span",{role:"button","aria-label":`Remove ${B(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?B(U.label):""]})})():t.jsx("span",{style:{opacity:.6},children:B(i)})}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:I.textMuted},children:[h&&t.jsx(Ss,{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:S?"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:B(u)}),me&&x&&t.jsxs("span",{id:j,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"})}),B(x)]}),Ke]})}Tn.displayName="TkxSelect";const $s={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},In=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,...y},z)=>{const v=ee(),$=ye(),w=c.useId(),C=h??w,I=`${C}-hint`,R=`${C}-error`,M=c.useRef(null),[N,T]=c.useState(!1),j=$s[a],k=n||!!i,f={primary:v.primary,success:v.success,danger:v.danger,warning:v.warning}[l]??v.primary,g=d!==void 0?d:void 0;c.useEffect(()=>{const O=(z==null?void 0:z.current)??M.current;O&&(O.indeterminate=s)},[s,z]);const S=s||(g??!1),F=S?f:v.surface,D=k?v.danger:S?f:v.border,V=Ue(f),E=N?{outline:`2px solid ${f}`,outlineOffset:"2px"}:{},P=[r&&I,k&&R].filter(Boolean).join(" ")||void 0,W=!$&&S?{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:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),t=require("react/jsx-runtime"),Ne=require("react-dom"),ss=2166136261,is=16777619;function ht(e){let r=ss;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,is)>>>0;return r.toString(16).padStart(8,"0")}class Tn{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 wt=new Tn(512);function En(e,r){const n=wt.get(e);if(n!==void 0)return n;const o=r();return wt.set(e,o),o}const In=[];let Jt=!1;const Et=[];let hr=0,kt=0;function as(){const e=In.splice(0),r=performance.now();for(const o of e)try{o()}catch{}const n=performance.now()-r;hr+=n,kt++,Et.push({duration:n,timestamp:Date.now()}),Et.length>100&&Et.shift()}function Nn(e){In.push(e),Jt||(Jt=!0,queueMicrotask(()=>{as(),Jt=!1}))}function ls(e){const r=e!==void 0?Et.slice(-e):Et.slice();return{avgRenderTime:kt===0?0:hr/kt,cacheHitRate:wt.cacheHitRate,renderCount:kt,recent:r}}function cs(e){e!==void 0?wt.invalidate(e):wt.invalidate()}const ds={hash:ht,memoize:En,batchUpdate:Nn,invalidate:cs,get avgRenderTime(){return kt===0?0:hr/kt},get cacheHitRate(){return wt.cacheHitRate},getMetrics:ls},Vt=new Map;function zn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function us(e){return"tkx-"+ht(e)}function Ln(e){const r=us(e);return Vt.has(r)||Vt.set(r,e),r}function An(e,...r){const n=e.reduce((i,l,c)=>i+l+(r[c]!==void 0?String(r[c]):""),"");return{className:Ln(n.trim()),styles:n.trim()}}function Rn(e){const r=Object.entries(e).map(([o,i])=>`${zn(o)}: ${i};`).join(" ");return{className:Ln(r),styles:r}}const fs={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function Dn(e,r){return`@media (min-width: ${fs[e]}) { ${r} }`}function Bn(e,r){const n=Object.entries(r).map(([o,i])=>{const l=Object.entries(i).map(([c,d])=>`${zn(c)}: ${d};`).join(" ");return`${o} { ${l} }`}).join(" ");return`@keyframes ${e} { ${n} }`}function mr(e,r){return r!==void 0?`--tkx-${e}: ${r};`:`var(--tkx-${e})`}function gr(){return Array.from(Vt.entries()).map(([e,r])=>`.${e} { ${r} }`).join(`
2
+ `)}function ps(){Vt.clear()}function Wn(){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=gr()}const xs={css:An,fromObject:Rn,responsive:Dn,keyframes:Bn,cssVar:mr,extractCSS:gr,injectStyles:Wn,resetStyles:ps};function hs(e){const r=e.replace("#",""),n=r.length===3?r.split("").map(c=>c+c).join(""):r,o=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16);return[o,i,l]}function Ir(e){const[r,n,o]=hs(e).map(i=>{const l=i/255;return l<=.03928?l/12.92:((l+.055)/1.055)**2.4});return .2126*r+.7152*n+.0722*o}function jt(e,r){const n=Ir(e),o=Ir(r),i=Math.max(n,o),l=Math.min(n,o);return(i+.05)/(l+.05)}function Ot(e,r,n=!1){return jt(e,r)>=(n?3:4.5)}function Fn(e,r,n=!1){return jt(e,r)>=(n?4.5:7)}function at(e,r){const o=r??["#ffffff","#000000"];return o.reduce((i,l)=>jt(l,e)>jt(i,e)?l:i,o[0])}function Pn(){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,o="polite"){const i=o==="assertive"?r:e;i.textContent="",setTimeout(()=>{i.textContent=n},0)},destroy(){e.remove(),r.remove()}}}const ms=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function br(e){let r=null,n=null;function o(){return Array.from(e.querySelectorAll(ms)).filter(i=>!i.closest("[hidden]")&&!i.closest('[aria-hidden="true"]'))}return{activate(){r=document.activeElement;const i=o();i.length>0&&i[0].focus(),n=l=>{if(l.key!=="Tab")return;const c=o();if(c.length===0)return;const d=c[0],u=c[c.length-1];l.shiftKey?document.activeElement===d&&(l.preventDefault(),u.focus()):document.activeElement===u&&(l.preventDefault(),d.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),r instanceof HTMLElement&&r.focus(),r=null,n=null}}}function Hn(e,r,n,o){let i=r;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),i=r===0?n-1:r-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),i=r===n-1?0:r+1;break;case"Home":e.preventDefault(),i=0;break;case"End":e.preventDefault(),i=n-1;break;case"Enter":case" ":e.preventDefault(),o(r);return;default:return}o(i)}function gs(e,r,n,o,i){let l=r;switch(e.key){case"ArrowUp":e.preventDefault(),l=r===0?n-1:r-1;break;case"ArrowDown":e.preventDefault(),l=r===n-1?0:r+1;break;case"Home":e.preventDefault(),l=0;break;case"End":e.preventDefault(),l=n-1;break;case"Enter":case" ":e.preventDefault(),o(r);return;case"Escape":e.preventDefault(),i==null||i();return;default:return}o(l)}function yr(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function vr(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function bs(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 ys={contrastRatio:jt,meetsAA:Ot,meetsAAA:Fn,getAccessibleForeground:at,createAnnouncer:Pn,createFocusTrap:br,handleTabsKeyboard:Hn,handleMenuKeyboard:gs,prefersReducedMotion:yr,prefersHighContrast:vr,announce:bs},kr={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},vs={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},ks=/^#[0-9a-fA-F]{3,8}$/;function ws(e,r){const n={...e,...r};for(const[o,i]of Object.entries(n))if(!ks.test(i))throw new Error(`Invalid hex color for theme token '${o}': ${i}`);return Ot(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)`),Ot(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 wr=a.createContext(kr);function js({theme:e=kr,children:r}){return a.useEffect(()=>{const n=Object.entries(e).map(([i,l])=>mr(i,l)).join(" ");let o=document.getElementById("tkx-theme");o||(o=document.createElement("style"),o.id="tkx-theme",document.head.appendChild(o)),o.textContent=`:root { ${n} }`},[e]),a.createElement(wr.Provider,{value:e},r)}function U(){return a.useContext(wr)}function Ss(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16)/255,o=parseInt(r.slice(2,4),16)/255,i=parseInt(r.slice(4,6),16)/255,l=Math.max(n,o,i),c=Math.min(n,o,i);let d=0,u=0;const f=(l+c)/2;if(l!==c){const s=l-c;switch(u=f>.5?s/(2-l-c):s/(l+c),l){case n:d=((o-i)/s+(o<i?6:0))/6;break;case o:d=((i-n)/s+2)/6;break;case i:d=((n-o)/s+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(f*100)]}function Ke(e,r,n){r/=100,n/=100;const o=r*Math.min(n,1-n),i=l=>{const c=(l+e/30)%12,d=n-o*Math.max(Math.min(c-3,9-c,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function $s(e){const[r,n]=Ss(e);return{50:Ke(r,Math.min(n,30),96),100:Ke(r,Math.min(n,40),90),200:Ke(r,Math.min(n,50),80),300:Ke(r,n,70),400:Ke(r,n,60),500:e,600:Ke(r,n,45),700:Ke(r,n,35),800:Ke(r,n,25),900:Ke(r,n,15)}}const Ms={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1.15"}},Cs={0:"0px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",4:"16px",5:"20px",6:"24px",8:"32px",10:"40px",12:"48px",16:"64px",20:"80px",24:"96px"},Ts={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Es={none:"none",xs:"0 1px 2px 0 rgba(0,0,0,0.05)",sm:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)"},Is={hide:-1,base:0,dropdown:1e3,sticky:1100,fixed:1200,overlay:1300,modal:1400,popover:1500,tooltip:1600,toast:1700,max:9999},Ns={none:"0",sm:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px",full:"9999px"},zs={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;"};function R(e){return String(e).replace(/[<>&'"]/g,r=>zs[r]??r)}function jr(e){const r={};for(const n of Object.keys(e))r[n]=Vn(e[n]);return r}function Vn(e){return typeof e=="string"?R(e):Array.isArray(e)?e.map(Vn):e!==null&&typeof e=="object"&&!Ls(e)?jr(e):e}function Ls(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function Ut(e,r){const n=[];for(const[o,i]of Object.entries(r)){const l=e[o],c=l==null;if(i.required&&c){n.push(`prop '${o}' is required`);continue}if(!c){if(typeof l!==i.type){n.push(`prop '${o}' must be of type ${i.type}, got ${typeof l}`);continue}i.type==="number"&&typeof l=="number"&&(i.min!==void 0&&l<i.min&&n.push(`prop '${o}' must be >= ${i.min}`),i.max!==void 0&&l>i.max&&n.push(`prop '${o}' must be <= ${i.max}`)),i.type==="string"&&typeof l=="string"&&i.pattern&&!i.pattern.test(l)&&n.push(`prop '${o}' does not match pattern ${i.pattern}`),i.enum&&!i.enum.includes(l)&&n.push(`prop '${o}' must be one of: ${i.enum.join(", ")}`)}}return{valid:n.length===0,errors:n}}const On=new Map;function As(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'"]},o={componentId:e,permissions:r,directives:n};return On.set(e,o),o}function Rs(e,r){const n=On.get(e);return(n==null?void 0:n.permissions[r])===!0}let ft=[];function _n(e,r,n){const o=ht(JSON.stringify(n??{})),i=ft.length>0?ft[ft.length-1].chainHash:"00000000",l=ht(i+o+r+e),c=Object.freeze({timestamp:Date.now(),component:r,action:e,propsHash:o,chainHash:l});return ft=Object.freeze([...ft,c]),c}function Yn(e){let r=ft;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 Un(){let e="00000000";for(const r of ft){if(ht(e+r.propsHash+r.component+r.action)!==r.chainHash)return!1;e=r.chainHash}return!0}const Ds={sanitize:R,sanitizeProps:jr,validateProps:Ut,createCSP:As,hasPermission:Rs,audit:_n,getAuditLog:Yn,verifyAuditIntegrity:Un};function te(){const[e,r]=a.useState(()=>typeof window>"u"?!1:yr());return a.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}function Bs(){const[e,r]=a.useState(()=>typeof window>"u"?!1:vr());return a.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(forced-colors: active)"),o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}function Kt(e){const r=a.useRef(null);return a.useEffect(()=>{if(!e||!r.current)return;const n=br(r.current);return n.activate(),()=>n.deactivate()},[e]),r}function Sr(){const e=a.useRef(null);return a.useEffect(()=>{if(!(typeof document>"u"))return e.current=Pn(),()=>{var r;(r=e.current)==null||r.destroy()}},[]),a.useCallback((r,n="polite")=>{var o;(o=e.current)==null||o.announce(r,n)},[])}function lt(e,r=!0){const n=a.useRef(e);n.current=e,a.useEffect(()=>{if(!r||typeof document>"u")return;const o=i=>{i.key==="Escape"&&n.current()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r])}function Kn(e,r){const n=a.useRef(r);n.current=r,a.useEffect(()=>{const o=i=>{!e.current||e.current.contains(i.target)||n.current()};return document.addEventListener("pointerdown",o),()=>document.removeEventListener("pointerdown",o)},[e])}const we={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"},Nr={...we,screen:"100vh"},Xe={"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%"},Dt={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},zr={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"},Ws={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"]},Fs={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Ps={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"},Hs={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},Bt={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vs=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"]),Os={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ce(e){const r=e.match(/^\[(.+)]$/);return r?r[1]:null}function Ye(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=ce(e);return r||e}function _s(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 o={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(o[e])return{"flex-direction":o[e]};const i={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(i[e])return{"flex-wrap":i[e]};const l={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(l[e])return{flex:l[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 c={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(c[e])return{"align-items":c[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 f={"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(f[e])return{"align-content":f[e]};let s;if(s=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":s[1]==="none"?"none":s[1]==="subgrid"?"subgrid":`repeat(${s[1]},minmax(0,1fr))`};if(s=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":s[1]==="none"?"none":s[1]==="subgrid"?"subgrid":`repeat(${s[1]},minmax(0,1fr))`};if(s=e.match(/^col-span-(full|\d+)$/))return{"grid-column":s[1]==="full"?"1 / -1":`span ${s[1]} / span ${s[1]}`};if(s=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":s[1]};if(s=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":s[1]};if(s=e.match(/^row-span-(full|\d+)$/))return{"grid-row":s[1]==="full"?"1 / -1":`span ${s[1]} / span ${s[1]}`};if(s=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":s[1]};if(s=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":s[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(s=e.match(/^p-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{padding:C}}if(s=e.match(/^px-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-left":C,"padding-right":C}}if(s=e.match(/^py-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-top":C,"padding-bottom":C}}if(s=e.match(/^pt-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-top":C}}if(s=e.match(/^pr-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-right":C}}if(s=e.match(/^pb-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-bottom":C}}if(s=e.match(/^pl-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-left":C}}if(s=e.match(/^-?m-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{margin:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?mx-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k){const A=C&&k!=="0"?`-${k}`:k;return{"margin-left":A,"margin-right":A}}}if(s=e.match(/^-?my-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k){const A=C&&k!=="0"?`-${k}`:k;return{"margin-top":A,"margin-bottom":A}}}if(s=e.match(/^-?mt-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-top":C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?mr-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-right":C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?mb-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-bottom":C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?ml-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-left":C&&k!=="0"?`-${k}`:k}}if(e==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(e==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(s=e.match(/^gap-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{gap:C}}if(s=e.match(/^gap-x-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"column-gap":C}}if(s=e.match(/^gap-y-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"row-gap":C}}if(s=e.match(/^w-(.+)$/)){const C=s[1],k=we[C]??Xe[C]??ce(C);if(k)return{width:k}}if(s=e.match(/^min-w-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"min-width":C}}if(s=e.match(/^max-w-(.+)$/)){const k={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"}[s[1]]??we[s[1]]??ce(s[1]);if(k)return{"max-width":k}}if(s=e.match(/^h-(.+)$/)){const C=s[1],k=Nr[C]??Xe[C]??ce(C);if(k)return{height:k}}if(s=e.match(/^min-h-(.+)$/)){const k={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[s[1]]??we[s[1]]??ce(s[1]);if(k)return{"min-height":k}}if(s=e.match(/^max-h-(.+)$/)){const C=Nr[s[1]]??ce(s[1]);if(C)return{"max-height":C}}if(s=e.match(/^size-(.+)$/)){const C=we[s[1]]??Xe[s[1]]??ce(s[1]);if(C)return{width:C,height:C}}if(s=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[C,k]=Ws[s[1]]??["1rem","1.5rem"];return{"font-size":C,"line-height":k}}if(s=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":Fs[s[1]]??s[1]};if(s=e.match(/^leading-(.+)$/)){const C=Ps[s[1]]??ce(s[1]);if(C)return{"line-height":C}}if(s=e.match(/^tracking-(.+)$/)){const C=Hs[s[1]]??ce(s[1]);if(C)return{"letter-spacing":C}}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(s=e.match(/^indent-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"text-indent":C}}if(s=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":s[1],"-webkit-box-orient":"vertical"};if(s=e.match(/^text-(.+)$/)){const[C,k]=s[1].split("/"),A=Ye(C);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(C)){if(k){const D=parseInt(k)/100;return{color:A,opacity:String(D)}}return{color:A}}}if(s=e.match(/^bg-(.+)$/)){const[C,k]=s[1].split("/"),A=Ye(C);return k?{"background-color":A,opacity:String(parseInt(k)/100)}:C==="none"?{background:"none"}:{"background-color":A}}if(s=e.match(/^border-color-(.+)$/))return{"border-color":Ye(s[1])};if(s=e.match(/^fill-(.+)$/))return{fill:Ye(s[1])};if(s=e.match(/^stroke-(.+)$/))return{stroke:Ye(s[1])};if(s=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Ye(s[1])};if(s=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Ye(s[1])};if(s=e.match(/^accent-(.+)$/))return{"accent-color":Ye(s[1])};if(s=e.match(/^caret-(.+)$/))return{"caret-color":Ye(s[1])};if(s=e.match(/^outline-color-(.+)$/))return{"outline-color":Ye(s[1])};if(e==="border")return{"border-width":"1px"};if(s=e.match(/^border-(\d+)$/))return{"border-width":`${s[1]}px`};if(e==="border-t")return{"border-top-width":"1px"};if(s=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${s[1]}px`};if(e==="border-r")return{"border-right-width":"1px"};if(s=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${s[1]}px`};if(e==="border-b")return{"border-bottom-width":"1px"};if(s=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${s[1]}px`};if(e==="border-l")return{"border-left-width":"1px"};if(s=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${s[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((s=e.match(/^border-([a-zA-Z].*)$/))&&Xn.has(s[1]))return{"border-color":`var(--tkx-${s[1]})`};if(s=e.match(/^border-\[(.+)]$/))return{"border-color":s[1]};if(e==="border-0")return{"border-width":"0"};if(e==="rounded")return{"border-radius":Dt[""]};if(s=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":Dt[s[1]]??ce(s[1])??s[1]};if(s=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const C=s[1],k=Dt[s[2]??""]??Dt[""];return{t:{"border-top-left-radius":k,"border-top-right-radius":k},r:{"border-top-right-radius":k,"border-bottom-right-radius":k},b:{"border-bottom-left-radius":k,"border-bottom-right-radius":k},l:{"border-top-left-radius":k,"border-bottom-left-radius":k},tl:{"border-top-left-radius":k},tr:{"border-top-right-radius":k},br:{"border-bottom-right-radius":k},bl:{"border-bottom-left-radius":k}}[C]??{}}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((s=e.match(/^ring-(\d+)$/))&&p[s[1]])return{"box-shadow":`0 0 0 ${p[s[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(e==="ring-inset")return{"--tkx-ring-offset":"inset"};if(s=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${s[1]}px`,"box-shadow":`0 0 0 ${s[1]}px var(--tkx-bg)`};if(e==="shadow")return{"box-shadow":zr[""]};if(s=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":zr[s[1]]};if(s=e.match(/^opacity-(\d+)$/)){const C=Vs[s[1]];if(C!==void 0)return{opacity:C}}if(e==="bg-none")return{background:"none"};const x={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(x[e])return{"background-size":x[e]};const y={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(y[e])return{"background-position":y[e]};const v={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(v[e])return{"background-repeat":v[e]};if(e==="backdrop-blur")return{"backdrop-filter":`blur(${Bt[""]})`};if(s=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${Bt[s[1]]})`};if(e==="blur")return{filter:`blur(${Bt[""]})`};if(s=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${Bt[s[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 b={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(b[e])return{position:b[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(s=e.match(/^-?top-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{top:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?right-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{right:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?bottom-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{bottom:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?left-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{left:C&&k!=="0"?`-${k}`:k}}const g={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(s=e.match(/^z-(.+)$/)){const C=g[s[1]]??ce(s[1]);if(C)return{"z-index":C}}const w={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(w[e])return{overflow:w[e]};if(s=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${s[1]}`]:s[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 S={"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(S[e])return{cursor:S[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 M={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(s=e.match(/^scale-(.+)$/)){const C=M[s[1]]??ce(s[1]);if(C)return{transform:`scale(${C})`}}if(s=e.match(/^scale-x-(.+)$/)){const C=M[s[1]]??ce(s[1]);if(C)return{transform:`scaleX(${C})`}}if(s=e.match(/^scale-y-(.+)$/)){const C=M[s[1]]??ce(s[1]);if(C)return{transform:`scaleY(${C})`}}const N={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(s=e.match(/^-?rotate-(.+)$/)){const C=e.startsWith("-"),k=N[s[1]]??ce(s[1]);if(k)return{transform:C?`rotate(-${k})`:`rotate(${k})`}}if(s=e.match(/^-?translate-x-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{transform:`translateX(${C&&k!=="0"?`-${k}`:k})`}}if(s=e.match(/^-?translate-y-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{transform:`translateY(${C&&k!=="0"?`-${k}`:k})`}}if(s=e.match(/^-?skew-x-(.+)$/)){const C=e.startsWith("-"),k=ce(s[1])??`${s[1]}deg`;return{transform:C?`skewX(-${k})`:`skewX(${k})`}}if(s=e.match(/^-?skew-y-(.+)$/)){const C=e.startsWith("-"),k=ce(s[1])??`${s[1]}deg`;return{transform:C?`skewY(-${k})`:`skewY(${k})`}}const j={"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(j[e])return{"transform-origin":j[e]};const L={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(L[e])return{"transition-property":L[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const I={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(s=e.match(/^duration-(.+)$/)){const C=I[s[1]]??ce(s[1]);if(C)return{"transition-duration":C}}if(s=e.match(/^delay-(.+)$/)){const C=I[s[1]]??ce(s[1]);if(C)return{"transition-delay":C}}const T={"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(T[e])return{"transition-timing-function":T[e]};const $={"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($[e])return{animation:$[e]};const z={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};if(z[e])return{"object-fit":z[e]};if(e==="aspect-square")return{"aspect-ratio":"1 / 1"};if(e==="aspect-video")return{"aspect-ratio":"16 / 9"};if(e==="aspect-auto")return{"aspect-ratio":"auto"};if(s=e.match(/^aspect-\[(.+)]$/))return{"aspect-ratio":s[1]};if(e==="list-none")return{"list-style-type":"none"};if(e==="list-disc")return{"list-style-type":"disc"};if(e==="list-decimal")return{"list-style-type":"decimal"};if(e==="list-inside")return{"list-style-position":"inside"};if(e==="list-outside")return{"list-style-position":"outside"};if(s=e.match(/^columns-(\d+)$/))return{columns:s[1]};if(e==="resize")return{resize:"both"};if(e==="resize-none")return{resize:"none"};if(e==="resize-x")return{resize:"horizontal"};if(e==="resize-y")return{resize:"vertical"};if(e==="sr-only")return{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"};if(e==="not-sr-only")return{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"};if(e==="focus-ring")return{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"};if(e==="appearance-none")return{appearance:"none"};if(e==="outline-none")return{outline:"none"};if(e==="outline")return{outline:"2px solid currentColor","outline-offset":"2px"};if(e==="float-left")return{float:"left"};if(e==="float-right")return{float:"right"};if(e==="float-none")return{float:"none"};if(e==="clear-both")return{clear:"both"};if(e==="isolate")return{isolation:"isolate"};if(e==="isolation-auto")return{isolation:"auto"};if(s=e.match(/^will-change-(.+)$/))return{"will-change":s[1]};if(e==="touch-manipulation")return{"touch-action":"manipulation"};if(e==="touch-none")return{"touch-action":"none"};if(e==="touch-pan-x")return{"touch-action":"pan-x"};if(e==="touch-pan-y")return{"touch-action":"pan-y"};if(e==="scroll-smooth")return{"scroll-behavior":"smooth"};if(e==="scroll-auto")return{"scroll-behavior":"auto"};if(s=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))return{[s[1]]:s[2]};const E=Zn(e);return E||null}function Ys(e){let r=0,n=-1;for(let o=0;o<e.length;o++)if(e[o]==="[")r++;else if(e[o]==="]")r--;else if(e[o]===":"&&r===0){n=o;break}return n===-1?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function Lr(e,r){for(const[n,o]of Object.entries(r))e[n]=o}function Qt(e){return Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}const _t=new Map;let qe=null;function Us(){return(!qe||!qe.isConnected)&&(qe=document.getElementById("tkx-atomic"),qe||(qe=document.createElement("style"),qe.id="tkx-atomic",document.head.appendChild(qe))),qe}function Ks(e,r){if(!_t.has(e)&&(_t.set(e,r),typeof document<"u")){const n=Us();n.textContent+=r+`
3
+ `}}function qn(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(...qn(n));else if(typeof n=="object")for(const[o,i]of Object.entries(n))i&&r.push(o)}return r}function h(...e){const r=qn(e);if(r.length===0)return"";const n={base:{},variants:{}};for(const u of r){const{variant:f,utility:s}=Ys(u),m=_s(s);m&&(f?(n.variants[f]||(n.variants[f]={}),Lr(n.variants[f],m)):Lr(n.base,m))}const o=[],i=Qt(n.base),l=[i,...Object.entries(n.variants).map(([u,f])=>`${u}{${Qt(f)}}`)].join("|"),c=ht(l),d=`tkx-${c}`;i&&o.push(`.${d}{${i}}`);for(const[u,f]of Object.entries(n.variants)){const s=Qt(f);if(s)if(u.startsWith("@")){const m=u.slice(1),p=Os[m];p&&o.push(`@media(min-width:${p}){.${d}{${s}}}`)}else if(u==="motion-safe")o.push(`@media(prefers-reduced-motion:no-preference){.${d}{${s}}}`);else if(u==="motion-reduce")o.push(`@media(prefers-reduced-motion:reduce){.${d}{${s}}}`);else if(u==="contrast-more")o.push(`@media(prefers-contrast:more){.${d}{${s}}}`);else if(u==="forced-colors")o.push(`@media(forced-colors:active){.${d}{${s}}}`);else if(u==="dark")o.push(`@media(prefers-color-scheme:dark){.${d}{${s}}}`);else if(u==="print")o.push(`@media print{.${d}{${s}}}`);else if(u==="group-hover")o.push(`.group:hover .${d}{${s}}`);else if(u==="group-focus")o.push(`.group:focus-within .${d}{${s}}`);else if(u==="peer-hover")o.push(`.peer:hover~.${d}{${s}}`);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}`;o.push(`.${d}${p}{${s}}`)}}return o.length>0&&Ks(c,o.join("")),d}const Xs=h;function qs(){return Array.from(_t.values()).join(`
4
+ `)}function Zs(){_t.clear(),qe=null}function ae(...e){return e.filter(Boolean).join(" ")}const Xt=new Map;function Gs(e){Xt.set(e.name,e.utilities)}function Js(e){Xt.delete(e)}function Qs(){return Array.from(Xt.keys())}function Zn(e){for(const r of Xt.values())if(r[e])return r[e];return null}const ei={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},ti={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Ar={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},ri={sm:14,md:16,lg:18,xl:20};function ni({size:e}){const r=ri[e];return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:h("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 Gn=a.forwardRef(({variant:e="solid",size:r="md",colorScheme:n="primary",isLoading:o=!1,loadingText:i,leftIcon:l,rightIcon:c,isFullWidth:d=!1,glow:u=!1,disabled:f,children:s,className:m,style:p,...x},y)=>{const v=U(),b=te(),g=f||o,S={primary:v.primary,secondary:v.secondary,danger:v.danger,warning:v.warning,success:v.success}[n],M=at(S,["#ffffff","#000000",v.bg]),N=typeof s=="string"?R(s):s,j=i?R(i):void 0,L=e==="solid"?{backgroundColor:S,color:M,border:"none",boxShadow:u&&!b?`0 0 20px ${S}55`:void 0}:e==="outline"?{backgroundColor:"transparent",color:S,border:`2px solid ${S}`}:e==="ghost"?{backgroundColor:"transparent",color:S,border:"none"}:{backgroundColor:"transparent",color:S,border:"none",textDecoration:"underline"},I=h("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",ei[r],ti[r],Ar[r],e!=="link"&&Ar[r],d&&"w-full",g?"cursor-not-allowed opacity-60":"cursor-pointer",!b&&"transition-all duration-200","focus-visible:focus-ring");return t.jsx("button",{ref:y,"aria-busy":o,"aria-disabled":g,disabled:g,className:ae(I,m),style:{...L,...p},...x,children:o?t.jsxs(t.Fragment,{children:[t.jsx(ni,{size:r}),j??N]}):t.jsxs(t.Fragment,{children:[l&&t.jsx("span",{"aria-hidden":"true",children:l}),N,c&&t.jsx("span",{"aria-hidden":"true",children:c})]})})});Gn.displayName="TkxButton";const oi={none:"",sm:"p-3",md:"p-5",lg:"p-7"},Jn=a.forwardRef(({variant:e="default",isHoverable:r,isClickable:n,padding:o="md",as:i,children:l,className:c,style:d,...u},f)=>{const s=U(),m=te(),p=i??(n?"button":"div"),x={default:{backgroundColor:s.surface,border:`1px solid ${s.border}`},glass:{backgroundColor:`${s.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${s.border}55`,boxShadow:`0 4px 24px ${s.bg}40`},quantum:{backgroundColor:s.surfaceAlt,border:`1px solid ${s.primary}33`,boxShadow:`0 0 24px ${s.primary}18`},elevated:{backgroundColor:s.surface,boxShadow:`0 4px 20px ${s.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${s.border}`}}[e],y=h("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",oi[o],(r||n)&&!m&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return t.jsx(p,{ref:f,className:ae("tkx-card",y,c),style:{color:s.text,...x,...d},...u,children:l})});Jn.displayName="TkxCard";function si({title:e,subtitle:r,action:n,children:o,className:i,...l}){const c=U();return t.jsxs("div",{className:ae(h("flex justify-between items-start mb-4"),i),...l,children:[t.jsxs("div",{className:h("flex-1 min-w-0"),children:[e&&t.jsx("h3",{className:h("text-base font-semibold m-0"),style:{color:c.text},children:e}),r&&t.jsx("p",{className:h("text-sm mt-1 mb-0"),style:{color:c.textMuted},children:r}),o]}),n&&t.jsx("div",{className:h("ml-3 shrink-0"),children:n})]})}function ii({children:e,className:r,...n}){return t.jsx("div",{className:ae(h(""),r),...n,children:e})}function ai({children:e,className:r,style:n,...o}){const i=U();return t.jsx("div",{className:ae(h("flex items-center justify-end gap-2 mt-4 pt-4"),r),style:{borderTop:`1px solid ${i.border}`,...n},...o,children:e})}const Qn=a.forwardRef(({label:e,id:r,error:n,hint:o,leftAddon:i,rightAddon:l,isInvalid:c,isRequired:d,disabled:u,className:f,style:s,...m},p)=>{const x=U(),y=a.useId(),v=r??y,b=`${v}-hint`,g=`${v}-error`,w=c||!!n,S=[o&&b,w&&g].filter(Boolean).join(" ")||void 0,M=R(e),N=n?R(n):void 0,j=o?R(o):void 0,L=w?x.danger:x.border;return t.jsxs("div",{className:ae(h("flex flex-col gap-1 w-full"),f),style:s,children:[t.jsxs("label",{htmlFor:v,className:h("text-sm font-medium font-sans"),style:{color:x.text},children:[M,d&&t.jsx("span",{"aria-hidden":"true",className:h("ml-1"),style:{color:x.danger},children:"*"})]}),t.jsxs("div",{className:h("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${L}`,backgroundColor:x.surface},children:[i&&t.jsx("div",{className:h("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:x.surfaceAlt,color:x.textMuted,borderRight:`1px solid ${x.border}`},children:i}),t.jsx("input",{ref:p,id:v,"aria-invalid":w,"aria-required":d,"aria-describedby":S,disabled:u,className:ae(h("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:x.text},...m}),l&&t.jsx("div",{className:h("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:x.surfaceAlt,color:x.textMuted,borderLeft:`1px solid ${x.border}`},children:l})]}),j&&!N&&t.jsx("span",{id:b,className:h("text-xs"),style:{color:x.textMuted},children:j}),N&&t.jsxs("span",{id:g,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:x.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"})}),N]})]})});Qn.displayName="TkxInput";const li={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]"},ci={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},eo=a.forwardRef(({variant:e="default",size:r="md",dot:n=!1,pulse:o=!1,outlined:i=!1,children:l,className:c,style:d,...u},f)=>{const s=U(),p={default:s.border,primary:s.primary,secondary:s.secondary,danger:s.danger,warning:s.warning,success:s.success,info:s.info}[e],x=at(p,["#ffffff","#000000",s.bg]),y=typeof l=="string"?R(l):l;return n?t.jsx("span",{ref:f,"aria-label":typeof l=="string"?R(l):void 0,className:ae(h("inline-block rounded-full",ci[r],o&&"animate-pulse"),c),style:{backgroundColor:p,...d},...u}):t.jsx("span",{ref:f,className:ae(h("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",li[r],o&&"animate-pulse"),c),style:{backgroundColor:i?"transparent":p,color:i?p:x,border:i?`1px solid ${p}`:"none",...d},...u,children:y})});eo.displayName="TkxBadge";const di={sm:"4px",md:"8px",lg:"12px"},ui={sm:32,md:48,lg:64},to=a.forwardRef(({value:e,variant:r="linear",size:n="md",label:o,showValue:i,color:l,className:c,style:d,...u},f)=>{const s=U(),m=te(),p=l??s.primary,x=e===void 0,y=e!==void 0?Math.min(100,Math.max(0,e)):0;if(e!==void 0){const{errors:b}=Ut({value:e},{value:{type:"number",min:0,max:100}});b.length>0&&console.warn("[TkxProgress]",b.join(", "))}if(r==="circular"){const b=ui[n],g=n==="sm"?3:n==="md"?4:5,w=(b-g*2)/2,S=2*Math.PI*w,M=x?0:S-y/100*S;return t.jsxs("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:y,"aria-label":o??(x?"Loading":`${y}%`),className:ae(h("inline-flex flex-col items-center gap-1"),c),style:d,...u,children:[t.jsxs("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:b/2,cy:b/2,r:w,fill:"none",stroke:s.border,strokeWidth:g}),t.jsx("circle",{cx:b/2,cy:b/2,r:w,fill:"none",stroke:p,strokeWidth:g,strokeLinecap:"round",strokeDasharray:S,strokeDashoffset:M,transform:`rotate(-90 ${b/2} ${b/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:x&&!m?"tkx-spin 1s linear infinite":void 0}})]}),i&&!x&&t.jsxs("span",{className:h("text-xs"),style:{color:s.textMuted},children:[y,"%"]})]})}const v=di[n];return t.jsxs("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:y,"aria-label":o??(x?"Loading":`${y}%`),className:ae(h("flex flex-col gap-1 w-full"),c),style:d,...u,children:[o&&t.jsxs("div",{className:h("flex justify-between text-sm"),style:{color:s.text},children:[t.jsx("span",{children:o}),i&&!x&&t.jsxs("span",{children:[y,"%"]})]}),t.jsx("div",{className:h("w-full overflow-hidden"),style:{height:v,borderRadius:v,backgroundColor:s.border},children:t.jsx("div",{style:{height:"100%",borderRadius:v,backgroundColor:p,width:x?"40%":`${y}%`,transition:m?"none":"width 300ms ease",animation:x&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});to.displayName="TkxProgress";const fi={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}},ro=a.forwardRef(({checked:e,onChange:r,label:n,size:o="md",hideLabel:i,disabled:l,className:c,style:d,...u},f)=>{const s=U(),m=te(),p=a.useId();Ut({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:x,th:y,td:v,gap:b}=fi[o],g=e?x-v-b:b,w=e?s.primary:s.border;return t.jsxs("div",{className:ae(h("inline-flex items-center gap-2",l?"opacity-50":""),c),style:d,children:[!i&&t.jsx("label",{htmlFor:p,className:h("text-sm font-sans",l?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:s.text},children:n}),t.jsx("button",{ref:f,id:p,role:"switch","aria-checked":e,"aria-label":i?n:void 0,disabled:l,onClick:()=>!l&&r(!e),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&!l&&(S.preventDefault(),r(!e))},className:ae(h("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",l?"cursor-not-allowed":"cursor-pointer",!m&&"transition-colors duration-200")),style:{width:x,height:y,borderRadius:y,backgroundColor:w},...u,children:t.jsx("span",{"aria-hidden":"true",className:h("absolute rounded-full"),style:{top:"50%",left:g,width:v,height:v,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:m?"none":"left 200ms ease"}})})]})});ro.displayName="TkxToggle";const pi={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 xi({variant:e,title:r,children:n,dismissible:o,onDismiss:i,icon:l,style:c,className:d}){const u=U(),f=Sr(),s=r?R(r):void 0;a.useEffect(()=>{s&&f(s,e==="danger"||e==="warning"?"assertive":"polite")},[s,e,f]);const p={info:u.info,success:u.success,warning:u.warning,danger:u.danger}[e],x=e==="danger"||e==="warning"?"alert":"status";return t.jsxs("div",{role:x,className:h("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,...c},children:[t.jsx("span",{className:h("shrink-0 mt-[1px]"),style:{color:p},children:l??pi[e]}),t.jsxs("div",{className:h("flex-1 min-w-0"),children:[s&&t.jsx("p",{className:h("m-0 font-semibold text-sm mb-1"),children:s}),t.jsx("div",{className:h("text-sm leading-relaxed"),children:n})]}),o&&i&&t.jsx("button",{"aria-label":"Dismiss alert",onClick:i,className:h("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 hi={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let cr=0;function mi(){++cr===1&&(document.body.style.overflow="hidden")}function Rr(){--cr<=0&&(cr=0,document.body.style.overflow="")}function gi({isOpen:e,onClose:r,title:n,size:o="md",closeOnOverlayClick:i=!0,closeOnEscape:l=!0,children:c,footer:d}){const u=U(),f=a.useId(),s=Kt(e),m=te(),p=Sr(),x=R(n),y=o==="full";return lt(r,l&&e),a.useEffect(()=>(e?(mi(),p(x,"polite")):Rr(),()=>{e&&Rr()}),[e,x,p]),!e||typeof document>"u"?null:Ne.createPortal(t.jsxs("div",{role:"presentation",className:h("fixed inset-0 z-[9000] flex",y?"items-stretch":"items-center justify-center",y?"":"p-4"),children:[t.jsx("div",{"aria-hidden":"true",onClick:i?r:void 0,className:h("absolute inset-0",!m&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":f,className:h("relative z-10 flex flex-col overflow-hidden",!m&&"animate-slide-up",y?"":"rounded-xl"),style:{backgroundColor:u.surface,border:`1px solid ${u.border}`,width:hi[o],maxWidth:"100%",maxHeight:y?"100vh":"90vh",boxShadow:`0 20px 60px ${u.bg}80`},children:[t.jsxs("div",{className:h("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${u.border}`},children:[t.jsx("h2",{id:f,className:h("m-0 text-lg font-semibold font-sans"),style:{color:u.text},children:x}),t.jsx("button",{onClick:r,"aria-label":"Close dialog",className:h("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:h("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:u.text},children:c}),d&&t.jsx("div",{className:h("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${u.border}`},children:d})]})]}),document.body)}const no=a.createContext(null);function oo(){const e=a.useContext(no);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function bi({defaultIndex:e=0,activeIndex:r,onChange:n,children:o,tabCount:i=0,style:l,className:c}){const[d,u]=a.useState(e),f=a.useId(),s=r!==void 0?r:d,m=p=>{r===void 0&&u(p),n==null||n(p)};return t.jsx(no.Provider,{value:{activeIndex:s,setActiveIndex:m,baseId:f,tabCount:i},children:t.jsx("div",{className:c,style:l,children:o})})}function yi({children:e,className:r,style:n,...o}){const i=U();return t.jsx("div",{role:"tablist",className:ae(h("flex gap-1"),r),style:{borderBottom:`2px solid ${i.border}`,...n},...o,children:e})}function vi({index:e,children:r,disabled:n=!1,className:o,style:i}){const l=U(),{activeIndex:c,setActiveIndex:d,baseId:u,tabCount:f}=oo(),s=a.useRef(null),m=c===e;return t.jsx("button",{ref:s,role:"tab",id:`${u}-tab-${e}`,"aria-controls":`${u}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:n,className:ae(h("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":""),o),style:{color:m?l.primary:l.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${l.primary}`:"2px solid transparent",marginBottom:"-2px",...i},onClick:()=>!n&&d(e),onKeyDown:p=>Hn(p,e,f,x=>{var y;d(x),(y=document.getElementById(`${u}-tab-${x}`))==null||y.focus()}),children:r})}function ki({children:e,className:r,...n}){return t.jsx("div",{className:r,...n,children:e})}function wi({index:e,children:r,style:n,className:o}){const{activeIndex:i,baseId:l}=oo();return i!==e?null:t.jsx("div",{role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:ae(h("pt-4"),o),style:n,children:r})}const ji={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 Si({content:e,children:r,placement:n="top",delay:o=300}){const i=U(),[l,c]=a.useState(!1),d=a.useRef(null),u=a.useId(),f=a.useRef(null),s=te(),m=R(e),p=at(i.surfaceAlt,[i.text,"#ffffff","#000000"]);function x(){f.current=setTimeout(()=>c(!0),o)}function y(){f.current&&clearTimeout(f.current),c(!1)}lt(y,l),Kn(d,y);const v=a.cloneElement(r,{"aria-describedby":l?u:void 0,onMouseEnter:b=>{var g,w;(w=(g=r.props).onMouseEnter)==null||w.call(g,b),x()},onMouseLeave:b=>{var g,w;(w=(g=r.props).onMouseLeave)==null||w.call(g,b),y()},onFocus:b=>{var g,w;(w=(g=r.props).onFocus)==null||w.call(g,b),x()},onBlur:b=>{var g,w;(w=(g=r.props).onBlur)==null||w.call(g,b),y()}});return t.jsxs("span",{ref:d,className:h("relative inline-flex"),children:[v,l&&t.jsx("span",{id:u,role:"tooltip",className:h("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!s&&"animate-fade-in"),style:{backgroundColor:i.surfaceAlt,color:p,border:`1px solid ${i.border}`,boxShadow:`0 4px 12px ${i.bg}40`,maxWidth:280,...ji[n]},children:m})]})}function Dr({variant:e,width:r,height:n,animation:o,bgColor:i,accentColor:l}){const c=r!==void 0?typeof r=="number"?`${r}px`:r:"100%",u=n!==void 0?typeof n=="number"?`${n}px`:n:{text:"1em",circular:c,rectangular:"80px"}[e],f=h(e==="circular"?"rounded-full":e==="text"?"rounded":"rounded-lg"),s=o==="pulse"?h("animate-pulse"):o==="wave"?h("animate-shimmer"):"",m=o==="wave"?{background:`linear-gradient(90deg,${i} 25%,${l} 50%,${i} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:i};return t.jsx("div",{className:ae(f,s),style:{width:c,height:u,...m}})}const qt=a.forwardRef(({variant:e="rectangular",width:r,height:n,lines:o,animation:i="pulse",className:l,style:c,...d},u)=>{const f=U(),m=te()?!1:i;return e==="text"&&o&&o>1?t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:ae(h("flex flex-col gap-2"),l),style:c,...d,children:Array.from({length:o},(p,x)=>t.jsx(Dr,{variant:"text",width:x===o-1?"75%":r,height:n,animation:m,bgColor:f.surfaceAlt,accentColor:f.border},x))}):t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:l,style:c,...d,children:t.jsx(Dr,{variant:e,width:r,height:n,animation:m,bgColor:f.surfaceAlt,accentColor:f.border})})});qt.displayName="TkxSkeleton";const $i={xs:24,sm:32,md:40,lg:56,xl:72},Mi={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},so=a.forwardRef(({src:e,alt:r,initials:n,size:o="md",shape:i="circle",status:l,className:c,style:d,...u},f)=>{const s=U(),[m,p]=a.useState(!1),x=$i[o],y=i==="circle",v=s.surfaceAlt,b=at(v,[s.text,s.textMuted]),g=e&&!m,w=!g&&n,S=Math.max(8,x*.22),M=h("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),N=h("block object-cover",y?"rounded-full":"rounded-lg"),j=h("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return t.jsxs("div",{ref:f,className:ae(M,c),style:{width:x,height:x,...d},...u,children:[g?t.jsx("img",{src:R(e),alt:R(r),onError:()=>p(!0),className:N,style:{width:x,height:x}}):t.jsx("div",{role:"img","aria-label":R(r),className:j,style:{width:x,height:x,backgroundColor:v,color:b,fontSize:x*.38},children:w?R(n).slice(0,2).toUpperCase():t.jsxs("svg",{width:x*.5,height:x*.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"})]})}),l&&t.jsx("span",{"aria-label":`Status: ${l}`,className:h("absolute bottom-0 right-0 rounded-full"),style:{width:S,height:S,backgroundColor:Mi[l],border:`2px solid ${s.bg}`}})]})});so.displayName="TkxAvatar";function Ci({dir:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:h("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 Ti({columns:e,data:r,caption:n,sortable:o,stickyHeader:i,isLoading:l,emptyState:c,style:d,className:u,striped:f}){const s=U(),[m,p]=a.useState(null),[x,y]=a.useState("asc"),v=a.useMemo(()=>!m||!o?r:[...r].sort((w,S)=>{const M=w[m],N=S[m];let j=0;return typeof M=="string"&&typeof N=="string"?j=M.localeCompare(N):typeof M=="number"&&typeof N=="number"&&(j=M-N),x==="asc"?j:-j}),[r,m,x,o]);function b(w){m===w?y(S=>S==="asc"?"desc":"asc"):(p(w),y("asc"))}function g(w){return m!==w?"none":x}return t.jsx("div",{className:h("w-full overflow-x-auto rounded-lg",u??""),style:{border:`1px solid ${s.border}`,...d},children:t.jsxs("table",{className:h("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:s.text},children:[n&&t.jsx("caption",{className:h("text-sm text-left p-2"),style:{color:s.textMuted},children:R(n)}),t.jsx("thead",{style:i?{position:"sticky",top:0,backgroundColor:s.surfaceAlt,zIndex:1}:{backgroundColor:s.surfaceAlt},children:t.jsx("tr",{children:e.map(w=>{const S=o&&w.sortable!==!1,M=g(w.key);return t.jsx("th",{scope:"col","aria-sort":S?M==="none"?"none":M==="asc"?"ascending":"descending":void 0,className:h("px-4 py-3 text-left font-semibold whitespace-nowrap",S?"cursor-pointer select-none focus-visible:focus-ring":""),style:{color:s.textMuted,borderBottom:`2px solid ${s.border}`,width:w.width},onClick:()=>S&&b(w.key),onKeyDown:N=>{S&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),b(w.key))},tabIndex:S?0:void 0,children:t.jsxs("span",{className:h("inline-flex items-center gap-1.5"),children:[R(w.header),S&&t.jsx(Ci,{dir:M})]})},String(w.key))})})}),t.jsx("tbody",{children:l?Array.from({length:5},(w,S)=>t.jsx("tr",{children:e.map(M=>t.jsx("td",{className:h("px-4 py-3"),children:t.jsx(qt,{variant:"text",height:"16px"})},String(M.key)))},S)):v.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:h("px-4 py-8 text-center"),style:{color:s.textMuted},children:c??"No data available"})}):v.map((w,S)=>t.jsx("tr",{style:{backgroundColor:f&&S%2===1?s.surfaceAlt:"transparent",borderBottom:`1px solid ${s.border}`},children:e.map(M=>{const N=w[M.key],j=M.render?M.render(N,w):typeof N=="string"?R(N):String(N??"");return t.jsx("td",{className:h("px-4 py-3"),style:{color:s.text},children:j},String(M.key))})},S))})]})})}const io=a.forwardRef(({orientation:e="horizontal",label:r,variant:n="solid",className:o,style:i,...l},c)=>{const d=U(),u=r?R(r):void 0,f=e==="vertical",s=f?"borderLeft":"borderTop",m=`1px ${n} ${d.border}`;return u?t.jsxs("div",{role:"separator","aria-orientation":e,className:ae(h("flex items-center gap-3 text-xs"),o),style:{color:d.textMuted,...i},...l,children:[t.jsx("hr",{className:h("flex-1 m-0 border-none"),style:{[s]:m}}),t.jsx("span",{children:u}),t.jsx("hr",{className:h("flex-1 m-0 border-none"),style:{[s]:m}})]}):t.jsx("hr",{ref:c,role:"separator","aria-orientation":e,className:ae(h(f?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),o),style:{[s]:m,...i},...l})});io.displayName="TkxDivider";const Ei={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 Br(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Ii(e,r){const n=e.getBoundingClientRect(),o=window.innerHeight,i=6,l=o-n.bottom-i,c=n.top-i,d=l>=Math.min(r,200)||l>=c?"below":"above";return{top:d==="below"?n.bottom+window.scrollY+i:n.top+window.scrollY-i-Math.min(r,280),left:n.left+window.scrollX,width:n.width,placement:d}}function Ni({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 ao({options:e,value:r,defaultValue:n,placeholder:o="Select an option…",size:i="md",isDisabled:l=!1,isInvalid:c=!1,label:d,hint:u,errorMessage:f,multiple:s=!1,searchable:m=!1,clearable:p=!1,isLoading:x=!1,onChange:y,renderOption:v,maxMenuHeight:b=280,virtualScroll:g,optionHeight:w=36,id:S,className:M,style:N}){const j=U(),L=a.useId(),I=S??L,T=`${I}-listbox`,$=`${I}-hint`,z=`${I}-error`,E=r!==void 0,[C,k]=a.useState(Br(n)),A=E?Br(r):C,[D,O]=a.useState(!1),[W,H]=a.useState(""),[B,P]=a.useState(-1),[F,V]=a.useState(null),[Q,re]=a.useState(""),ie=a.useRef(null),fe=a.useRef(null),xe=a.useRef(null),ve=a.useRef(null),ge=a.useRef(null),X=Ei[i],se=c||!!f,he=a.useRef(null),[Se,de]=a.useState(0),[be,ne]=a.useState(0),q=a.useCallback(()=>{he.current&&de(he.current.scrollTop)},[]);a.useEffect(()=>{if(!D){de(0);return}const _=he.current;if(!_)return;ne(_.clientHeight);const oe=new ResizeObserver(()=>{ne(_.clientHeight)});return oe.observe(_),()=>oe.disconnect()},[D]);const K=m&&W?e.filter(_=>_.label.toLowerCase().includes(W.toLowerCase())):e,G=K.filter(_=>!_.disabled),ee=K.some(_=>!!_.group),ke=(g!==void 0?g:K.length>=100)&&!ee,Me=8,je=K.length*w,ze=ke?Math.max(0,Math.floor(Se/w)-Me):0,Te=ke?Math.min(K.length,Math.ceil((Se+be)/w)+Me):K.length,Pe=ke?K.slice(ze,Te):K,Ge=ze*w,Je=K.reduce((_,oe)=>{const le=oe.group??"";return _[le]||(_[le]=[]),_[le].push(oe),_},{}),Be=a.useCallback(_=>{var le;let oe;s?oe=A.includes(_)?A.filter(ye=>ye!==_):[...A,_]:oe=[_],E||k(oe),y==null||y(s?oe:oe[0]??""),s||(O(!1),H(""),P(-1),(le=fe.current)==null||le.focus())},[E,s,y,A]),Qe=a.useCallback((_,oe)=>{oe.stopPropagation();const le=A.filter(ye=>ye!==_);E||k(le),y==null||y(s?le:le[0]??"")},[E,s,y,A]),et=a.useCallback(_=>{_.stopPropagation(),E||k([]),y==null||y(s?[]:"")},[E,s,y]),He=a.useCallback(()=>{!fe.current||!D||V(Ii(fe.current,b))},[D,b]);a.useEffect(()=>{if(D)return He(),window.addEventListener("scroll",He,!0),window.addEventListener("resize",He),()=>{window.removeEventListener("scroll",He,!0),window.removeEventListener("resize",He)}},[D,He]),a.useEffect(()=>{if(!D)return;const _=oe=>{var ye,We;const le=oe.target;(ye=fe.current)!=null&&ye.contains(le)||(We=ve.current)!=null&&We.contains(le)||(O(!1),H(""))};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[D]),a.useEffect(()=>{D&&m&&setTimeout(()=>{var _;return(_=xe.current)==null?void 0:_.focus()},0)},[D,m]),a.useEffect(()=>{var _;if(!(!D||B<0))if(ke&&he.current){const oe=B*w,le=oe+w,ye=he.current;oe<ye.scrollTop?ye.scrollTop=oe:le>ye.scrollTop+ye.clientHeight&&(ye.scrollTop=le-ye.clientHeight)}else{const oe=(_=ge.current)==null?void 0:_.querySelector(`[data-idx="${B}"]`);oe==null||oe.scrollIntoView({block:"nearest"})}},[B,D,ke,w]);const tt=_=>{switch(_.key){case"Enter":case" ":_.preventDefault(),D?B>=0&&G[B]&&Be(G[B].value):Ve();break;case"Escape":_.preventDefault(),O(!1),H("");break;case"ArrowDown":_.preventDefault(),D?P(oe=>Math.min(oe+1,G.length-1)):Ve();break;case"ArrowUp":_.preventDefault(),D?P(oe=>Math.max(oe-1,0)):Ve();break;case"Home":_.preventDefault(),D&&P(0);break;case"End":_.preventDefault(),D&&P(G.length-1);break;default:_.key.length===1&&!_.ctrlKey&&!_.metaKey&&(D||Ve(),gt(_.key))}},mt=_=>{var oe;switch(_.key){case"Escape":_.preventDefault(),O(!1),H(""),(oe=fe.current)==null||oe.focus();break;case"ArrowDown":_.preventDefault(),P(le=>Math.min(le+1,G.length-1));break;case"ArrowUp":_.preventDefault(),P(le=>Math.max(le-1,0));break;case"Home":_.preventDefault(),P(0);break;case"End":_.preventDefault(),P(G.length-1);break;case"Enter":_.preventDefault(),B>=0&&G[B]&&Be(G[B].value);break}};function gt(_){ie.current&&clearTimeout(ie.current);const oe=Q+_.toLowerCase();re(oe);const le=G.findIndex(ye=>ye.label.toLowerCase().startsWith(oe));le>=0&&P(le),ie.current=setTimeout(()=>re(""),800)}function Ve(){if(l||x)return;O(!0);const _=G.findIndex(oe=>A.includes(oe.value));P(_>=0?_:0)}const Oe=se?j.danger:D?j.primary:j.border,Ue=B>=0&&G[B]?`${I}-opt-${G[B].value}`:void 0,rt=[u&&$,se&&z].filter(Boolean).join(" ")||void 0,bt=A.map(_=>e.find(oe=>oe.value===_)).filter(Boolean),St=D&&F?Ne.createPortal(t.jsxs("div",{ref:ve,role:"listbox",id:T,"aria-label":d?R(d):"Options","aria-multiselectable":s,style:{position:"absolute",top:F.top,left:F.left,width:F.width,zIndex:9999,backgroundColor:j.surface,border:`1.5px solid ${j.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:F.width,maxHeight:b,display:"flex",flexDirection:"column"},children:[m&&t.jsxs("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${j.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:j.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:xe,type:"text",value:W,onChange:_=>{H(_.target.value),P(0)},onKeyDown:mt,placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:j.text,fontSize:X.fontSize,fontFamily:"inherit",width:"100%"}})]}),t.jsx("div",{ref:_=>{ge.current=_,he.current=_},onScroll:ke?q:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:b-(m?48:0)},children:ke?t.jsxs("div",{style:{height:je,position:"relative"},children:[t.jsx("div",{style:{position:"absolute",top:Ge,left:0,right:0},children:Pe.map(_=>{const oe=G.indexOf(_),le=oe===B,ye=A.includes(_.value),We=v?v(_,ye):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[_.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:_.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(_.label)})]}),_.description&&t.jsx("span",{style:{fontSize:"12px",color:j.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(_.description)})]});return t.jsxs("div",{id:`${I}-opt-${_.value}`,"data-idx":oe>=0?oe:void 0,role:"option","aria-selected":ye,"aria-disabled":_.disabled||void 0,onClick:()=>!_.disabled&&Be(_.value),onMouseEnter:()=>!_.disabled&&oe>=0&&P(oe),style:{height:w,boxSizing:"border-box",padding:`0 ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:_.disabled?j.textMuted:j.text,backgroundColor:le?`${j.primary}22`:ye?`${j.primary}12`:"transparent",cursor:_.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:_.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[We,ye&&!v&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:j.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},_.value)})}),K.length===0&&t.jsx("div",{style:{padding:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:j.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:x?"Loading…":"No options found"})]}):t.jsxs(t.Fragment,{children:[Object.entries(Je).map(([_,oe])=>t.jsxs("div",{children:[_&&t.jsx("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:j.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:j.surface,zIndex:1,borderBottom:`1px solid ${j.border}`},children:R(_)}),oe.map(le=>{const ye=G.indexOf(le),We=ye===B,nt=A.includes(le.value),vt=v?v(le,nt):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[le.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:le.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(le.label)})]}),le.description&&t.jsx("span",{style:{fontSize:"12px",color:j.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(le.description)})]});return t.jsxs("div",{id:`${I}-opt-${le.value}`,"data-idx":ye>=0?ye:void 0,role:"option","aria-selected":nt,"aria-disabled":le.disabled||void 0,onClick:()=>!le.disabled&&Be(le.value),onMouseEnter:()=>!le.disabled&&ye>=0&&P(ye),style:{padding:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:le.disabled?j.textMuted:j.text,backgroundColor:We?`${j.primary}22`:nt?`${j.primary}12`:"transparent",cursor:le.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:le.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[vt,nt&&!v&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:j.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},le.value)})]},_)),K.length===0&&t.jsx("div",{style:{padding:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:j.textMuted,textAlign:"center"},children:x?"Loading…":"No options found"})]})})]}),document.body):null,yt=p&&A.length>0&&!l&&!x;return t.jsxs("div",{className:ae(h("flex flex-col gap-1 w-full"),M),style:N,children:[d&&t.jsx("label",{htmlFor:I,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:j.text,userSelect:"none"},children:R(d)}),t.jsx("div",{style:{position:"relative",width:"100%",opacity:l?.55:1},children:t.jsxs("button",{ref:fe,id:I,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":D,"aria-controls":T,"aria-activedescendant":Ue,"aria-invalid":se||void 0,"aria-describedby":rt,"aria-multiselectable":s,disabled:l,onClick:()=>D?O(!1):Ve(),onKeyDown:tt,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:s&&A.length>0?`4px ${X.px}`:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",backgroundColor:j.surface,color:A.length>0?j.text:j.textMuted,border:`1.5px solid ${Oe}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:l?"not-allowed":"pointer",outline:"none",minHeight:i==="sm"?34:i==="lg"?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:s&&bt.length>0?bt.map(_=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${X.tagPy} ${X.tagPx}`,fontSize:`calc(${X.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${j.primary}22`,color:j.primary,borderRadius:6,border:`1px solid ${j.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:R(_.label)}),t.jsx("span",{role:"button","aria-label":`Remove ${R(_.label)}`,tabIndex:-1,onClick:oe=>Qe(_.value,oe),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"})})})]},_.value)):!s&&A.length>0?(()=>{const _=e.find(oe=>oe.value===A[0]);return t.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[(_==null?void 0:_.icon)&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:_.icon}),_?R(_.label):""]})})():t.jsx("span",{style:{opacity:.6},children:R(o)})}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:j.textMuted},children:[x&&t.jsx(Ni,{size:X.iconSize,color:j.primary}),yt&&!x&&t.jsx("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:et,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:_=>_.currentTarget.style.opacity="1",onMouseLeave:_=>_.currentTarget.style.opacity="0.7",children:t.jsx("svg",{width:X.iconSize,height:X.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:X.iconSize,height:X.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:D?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:t.jsx("path",{d:"M6 9l6 6 6-6"})})]})]})}),u&&!se&&t.jsx("span",{id:$,style:{fontSize:"12px",color:j.textMuted,fontFamily:"inherit"},children:R(u)}),se&&f&&t.jsxs("span",{id:z,role:"alert",style:{fontSize:"12px",color:j.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"})}),R(f)]}),St]})}ao.displayName="TkxSelect";const zi={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},lo=a.forwardRef(({label:e,hint:r,isInvalid:n,errorMessage:o,isIndeterminate:i=!1,size:l="md",colorScheme:c="primary",checked:d,defaultChecked:u,onChange:f,disabled:s,className:m,style:p,id:x,...y},v)=>{const b=U(),g=te(),w=a.useId(),S=x??w,M=`${S}-hint`,N=`${S}-error`,j=a.useRef(null),[L,I]=a.useState(!1),T=zi[l],$=n||!!o,E={primary:b.primary,success:b.success,danger:b.danger,warning:b.warning}[c]??b.primary,C=d!==void 0?d:void 0;a.useEffect(()=>{const P=(v==null?void 0:v.current)??j.current;P&&(P.indeterminate=i)},[i,v]);const k=i||(C??!1),A=k?E:b.surface,D=$?b.danger:k?E:b.border,O=at(E),W=L?{outline:`2px solid ${E}`,outlineOffset:"2px"}:{},H=[r&&M,$&&N].filter(Boolean).join(" ")||void 0,B=!g&&k?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return t.jsxs("div",{className:ae(h("flex flex-col gap-1"),m),style:{opacity:s?.5:1,...p},children:[t.jsx("style",{children:`
5
5
  @keyframes tkx-check-scale-in {
6
6
  from { transform: scale(0.4); opacity: 0; }
7
7
  to { transform: scale(1); opacity: 1; }
8
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:O=>{M.current=O,typeof z=="function"?z(O):z&&(z.current=O)},id:C,type:"checkbox",checked:d,defaultChecked:u,onChange:x,disabled:o,"aria-invalid":k,"aria-describedby":P,onFocus:O=>{O.target.matches(":focus-visible")&&T(!0)},onBlur:()=>T(!1),className:b("sr-only"),...y}),t.jsx("span",{"aria-hidden":"true",style:{width:j.box,height:j.box,minWidth:j.box,borderRadius:"4px",border:`2px solid ${D}`,backgroundColor:F,display:"flex",alignItems:"center",justifyContent:"center",transition:$?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...E},children:s?t.jsx("span",{"aria-hidden":"true",style:{display:"block",width:j.box*.5,height:2,backgroundColor:V,borderRadius:"1px",...W}}):S?t.jsx("svg",{width:j.box*.6,height:j.box*.6,viewBox:"0 0 24 24",fill:"none",stroke:V,strokeWidth:j.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:W,children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&t.jsx("span",{style:{fontSize:j.fontSize,color:v.text,lineHeight:1.4},children:typeof e=="string"?B(e):e})]}),r&&!k&&t.jsx("span",{id:I,className:b("text-xs ml-7"),style:{color:v.textMuted,marginLeft:j.box+8},children:B(r)}),k&&i&&t.jsxs("span",{id:R,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:v.danger,marginLeft:j.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"})}),B(i)]})]})});In.displayName="TkxCheckbox";const En=c.createContext(null);function Ms(){return c.useContext(En)}const Cs={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},zn=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 y=ee(),z=ye(),v=c.useId(),$=m??v,w=Ms(),C=w?w.value===String(s??""):a??!1,I=d??(w==null?void 0:w.isDisabled)??!1,R=u??(w==null?void 0:w.name)??"",M=()=>{I||(w?w.onChange(String(s??"")):l==null||l({target:{value:String(s??"")}}))},N=Cs[n],j={primary:y.primary,success:y.success,danger:y.danger}[i]??y.primary;Ue(j);const k=C?j:y.border,Y=y.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:`
9
+ `}),t.jsxs("label",{htmlFor:S,className:h("flex items-center gap-2 select-none"),style:{cursor:s?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:P=>{j.current=P,typeof v=="function"?v(P):v&&(v.current=P)},id:S,type:"checkbox",checked:d,defaultChecked:u,onChange:f,disabled:s,"aria-invalid":$,"aria-describedby":H,onFocus:P=>{P.target.matches(":focus-visible")&&I(!0)},onBlur:()=>I(!1),className:h("sr-only"),...y}),t.jsx("span",{"aria-hidden":"true",style:{width:T.box,height:T.box,minWidth:T.box,borderRadius:"4px",border:`2px solid ${D}`,backgroundColor:A,display:"flex",alignItems:"center",justifyContent:"center",transition:g?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...W},children:i?t.jsx("span",{"aria-hidden":"true",style:{display:"block",width:T.box*.5,height:2,backgroundColor:O,borderRadius:"1px",...B}}):k?t.jsx("svg",{width:T.box*.6,height:T.box*.6,viewBox:"0 0 24 24",fill:"none",stroke:O,strokeWidth:T.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:B,children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&t.jsx("span",{style:{fontSize:T.fontSize,color:b.text,lineHeight:1.4},children:typeof e=="string"?R(e):e})]}),r&&!$&&t.jsx("span",{id:M,className:h("text-xs ml-7"),style:{color:b.textMuted,marginLeft:T.box+8},children:R(r)}),$&&o&&t.jsxs("span",{id:N,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:b.danger,marginLeft:T.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"})}),R(o)]})]})});lo.displayName="TkxCheckbox";const co=a.createContext(null);function Li(){return a.useContext(co)}const Ai={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},uo=a.forwardRef(({label:e,hint:r,size:n="md",colorScheme:o="primary",value:i,checked:l,onChange:c,disabled:d,name:u,className:f,style:s,id:m,...p},x)=>{const y=U(),v=te(),b=a.useId(),g=m??b,w=Li(),S=w?w.value===String(i??""):l??!1,M=d??(w==null?void 0:w.isDisabled)??!1,N=u??(w==null?void 0:w.name)??"",j=()=>{M||(w?w.onChange(String(i??"")):c==null||c({target:{value:String(i??"")}}))},L=Ai[n],T={primary:y.primary,success:y.success,danger:y.danger}[o]??y.primary;at(T);const $=S?T:y.border,z=y.surface;return t.jsxs("div",{className:ae(h("flex flex-col gap-0.5"),f),style:{opacity:M?.5:1,...s},children:[t.jsx("style",{children:`
10
10
  @keyframes tkx-radio-dot-in {
11
11
  from { transform: scale(0) translate(-50%, -50%); opacity: 0; }
12
12
  to { transform: scale(1) translate(-50%, -50%); opacity: 1; }
13
13
  }
14
- `}),t.jsxs("label",{htmlFor:$,className:b("flex items-center gap-2 select-none"),style:{cursor:I?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:h,id:$,type:"radio",name:R,value:s,checked:C,onChange:M,disabled:I,"aria-invalid":w==null?void 0:w.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 ${k}`,backgroundColor:Y,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:j,transform:"translate(-50%, -50%)",transformOrigin:"center",...z?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&t.jsx("span",{style:{fontSize:N.fontSize,color:y.text,lineHeight:1.4},children:typeof e=="string"?B(e):e})]}),r&&t.jsx("span",{className:b("text-xs"),style:{color:y.textMuted,marginLeft:N.outer+8},children:B(r)})]})});zn.displayName="TkxRadio";function Ts({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,y]=c.useState(n),z=r!==void 0,v=z?r:h,$=C=>{z||y(C),i==null||i(C)},w=d||!!u;return t.jsx(En.Provider,{value:{name:e,value:v,onChange:$,isDisabled:l,isInvalid:d},children:t.jsxs("div",{role:"radiogroup","aria-label":s?B(s):void 0,"aria-describedby":w?p:void 0,"aria-invalid":w,children:[s&&t.jsx("div",{className:b("text-sm font-medium font-sans mb-2"),style:{color:o.text},children:B(s)}),t.jsx("div",{className:b(a==="horizontal"?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:x}),w&&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"})}),B(u)]})]})})}const Nn=5;let et=[],Ne=[];const rr=new Set,pt=new Map;function gr(){const e=[...Ne];rr.forEach(r=>r(e))}function Rn(e,r){r!==0&&pt.set(e,setTimeout(()=>br(e),r))}function br(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<Nn){const n=et.shift();Ne=[...Ne,n],Rn(n.id,n.duration??4e3)}gr()}function Is(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<Nn?(Ne=[...Ne,n],Rn(r,n.duration)):et=[...et,n],gr(),r}function Es(){pt.forEach(e=>clearTimeout(e)),pt.clear(),Ne=[],et=[],gr()}function zs(){const e=c.useCallback(i=>Is(i),[]),r=c.useCallback(i=>br(i),[]),n=c.useCallback(()=>Es(),[]);return{toast:e,dismiss:r,dismissAll:n}}const Ns={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"})})},Rs={"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 As(e,r){return r?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function Ds({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?B(e.title):void 0,m=e.description?B(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,...As(r,i)},children:[t.jsx("span",{className:b("shrink-0 mt-[2px]"),style:{color:u},children:Ns[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:B(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 Ls({position:e="top-right"}){const[r,n]=c.useState([...Ne]),i=ye();c.useEffect(()=>{n([...Ne]);const u=x=>n([...x]);return rr.add(u),()=>{rr.delete(u)}},[]);const s=e.startsWith("bottom"),a=Rs[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=`
14
+ `}),t.jsxs("label",{htmlFor:g,className:h("flex items-center gap-2 select-none"),style:{cursor:M?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:x,id:g,type:"radio",name:N,value:i,checked:S,onChange:j,disabled:M,"aria-invalid":w==null?void 0:w.isInvalid,className:h("sr-only"),...p}),t.jsx("span",{"aria-hidden":"true",style:{position:"relative",width:L.outer,height:L.outer,minWidth:L.outer,borderRadius:"50%",border:`2px solid ${$}`,backgroundColor:z,display:"inline-block",boxSizing:"border-box",transition:v?"none":"border-color 120ms"},children:S&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:L.inner,height:L.inner,borderRadius:"50%",backgroundColor:T,transform:"translate(-50%, -50%)",transformOrigin:"center",...v?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&t.jsx("span",{style:{fontSize:L.fontSize,color:y.text,lineHeight:1.4},children:typeof e=="string"?R(e):e})]}),r&&t.jsx("span",{className:h("text-xs"),style:{color:y.textMuted,marginLeft:L.outer+8},children:R(r)})]})});uo.displayName="TkxRadio";function Ri({name:e,value:r,defaultValue:n="",onChange:o,label:i,orientation:l="vertical",isDisabled:c=!1,isInvalid:d=!1,errorMessage:u,children:f}){const s=U(),p=`${a.useId()}-error`,[x,y]=a.useState(n),v=r!==void 0,b=v?r:x,g=S=>{v||y(S),o==null||o(S)},w=d||!!u;return t.jsx(co.Provider,{value:{name:e,value:b,onChange:g,isDisabled:c,isInvalid:d},children:t.jsxs("div",{role:"radiogroup","aria-label":i?R(i):void 0,"aria-describedby":w?p:void 0,"aria-invalid":w,children:[i&&t.jsx("div",{className:h("text-sm font-medium font-sans mb-2"),style:{color:s.text},children:R(i)}),t.jsx("div",{className:h(l==="horizontal"?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:f}),w&&u&&t.jsxs("span",{id:p,role:"alert",className:h("text-xs flex items-center gap-1 mt-1"),style:{color:s.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(u)]})]})})}const fo=5;let xt=[],Re=[];const dr=new Set,It=new Map;function $r(){const e=[...Re];dr.forEach(r=>r(e))}function po(e,r){r!==0&&It.set(e,setTimeout(()=>Mr(e),r))}function Mr(e){clearTimeout(It.get(e)),It.delete(e);const r=Re.some(n=>n.id===e);if(Re=Re.filter(n=>n.id!==e),xt=xt.filter(n=>n.id!==e),r&&xt.length>0&&Re.length<fo){const n=xt.shift();Re=[...Re,n],po(n.id,n.duration??4e3)}$r()}function Di(e){const r=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:r,duration:e.duration??4e3};return Re.length<fo?(Re=[...Re,n],po(r,n.duration)):xt=[...xt,n],$r(),r}function Bi(){It.forEach(e=>clearTimeout(e)),It.clear(),Re=[],xt=[],$r()}function Wi(){const e=a.useCallback(o=>Di(o),[]),r=a.useCallback(o=>Mr(o),[]),n=a.useCallback(()=>Bi(),[]);return{toast:e,dismiss:r,dismissAll:n}}const Fi={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"})})},Pi={"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 Hi(e,r){return r?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function Vi({toast:e,position:r,onDismiss:n,reduced:o}){const i=U(),l=a.useId(),c={default:i.textMuted,success:i.success,danger:i.danger,warning:i.warning,info:i.info},d=e.variant??"default",u=c[d],f=d==="danger",s=e.title?R(e.title):void 0,m=e.description?R(e.description):void 0;return t.jsxs("div",{role:f?"alert":"status","aria-live":f?"assertive":"polite","aria-atomic":"true","aria-labelledby":s?l:void 0,className:h("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:i.surface,border:`1px solid ${u}55`,boxShadow:`0 8px 24px ${i.bg}cc`,color:i.text,...Hi(r,o)},children:[t.jsx("span",{className:h("shrink-0 mt-[2px]"),style:{color:u},children:Fi[d]}),t.jsxs("div",{className:h("flex-1 min-w-0"),children:[s&&t.jsx("p",{id:l,className:h("m-0 font-semibold text-sm leading-snug"),children:s}),m&&t.jsx("p",{className:h("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:i.textMuted},children:m}),e.action&&t.jsx("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:h("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:u},children:R(e.action.label)})]}),t.jsx("button",{"aria-label":"Dismiss notification",onClick:()=>n(e.id),className:h("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:i.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 Oi({position:e="top-right"}){const[r,n]=a.useState([...Re]),o=te();a.useEffect(()=>{n([...Re]);const u=f=>n([...f]);return dr.add(u),()=>{dr.delete(u)}},[]);const i=e.startsWith("bottom"),l=Pi[e],c=a.useRef(!1);if(a.useEffect(()=>{if(!(c.current||typeof document>"u")&&(c.current=!0,!document.getElementById("tkx-toast-kf"))){const u=document.createElement("style");u.id="tkx-toast-kf",u.textContent=`
15
15
  @keyframes tkx-toast-slide-down {
16
16
  from { opacity: 0; transform: translateY(-16px); }
17
17
  to { opacity: 1; transform: translateY(0); }
@@ -20,21 +20,21 @@
20
20
  from { opacity: 0; transform: translateY(16px); }
21
21
  to { opacity: 1; transform: translateY(0); }
22
22
  }
23
- `,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=s?[...r].reverse():r;return Be.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(Ds,{toast:u,position:e,onDismiss:br,reduced:i})},u.id))}),document.body)}const Fs={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 Tr({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 Ps({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 An({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=ye(),y=c.useId(),z=i!==void 0,v=k=>k?Array.isArray(k)?new Set(k):new Set([k]):new Set,[$,w]=c.useState(()=>v(n)),C=z?v(i):$,I=c.useCallback((k,Y)=>{if(Y)return;let f;if(z){const S=v(i);f=new Set(S),f.has(k)?f.delete(k):(r||f.clear(),f.add(k))}else{w(S=>{f=new Set(S),f.has(k)?f.delete(k):(r||f.clear(),f.add(k));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=Fs[l],M=()=>{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=(k,Y,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=k=>a==="ghost"||a==="flush"?k?`${p.primary}10`:`${p.surfaceAlt}80`:k?`${p.primary}0d`:`${p.surfaceAlt}60`,j=a==="separated";return t.jsx("div",{className:b(o??""),style:{...M(),display:j?"flex":void 0,flexDirection:j?"column":void 0,gap:j?"8px":void 0,...m},children:e.map((k,Y)=>{const f=C.has(k.id),g=Y===e.length-1,S=`${y}-trigger-${k.id}`,F=`${y}-panel-${k.id}`;return t.jsxs("div",{className:k.className,style:N(Y,f,g),children:[t.jsxs("button",{id:S,type:"button",role:"button","aria-expanded":f,"aria-controls":F,disabled:k.disabled,onClick:()=>I(k.id,k.disabled),style:{width:"100%",display:"flex",alignItems:k.subtitle?"flex-start":"center",gap:"8px",padding:R.triggerPadding,border:"none",background:"transparent",cursor:k.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:R.fontSize,fontWeight:500,color:k.disabled?p.textMuted:p.text,opacity:k.disabled?.5:1,transition:h?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:D=>{k.disabled||(D.currentTarget.style.backgroundColor=T(f))},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=f?`${p.primary}0d`:"transparent"},onFocus:D=>{k.disabled||(D.currentTarget.style.outline=`2px solid ${p.primary}`,D.currentTarget.style.outlineOffset="2px")},onBlur:D=>{D.currentTarget.style.outline="none"},children:[k.icon&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:p.primary,marginTop:k.subtitle?"1px":void 0},children:k.icon}),d==="left"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?p.primary:p.textMuted,marginTop:k.subtitle?"1px":void 0},children:t.jsx(Tr,{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:k.title}),k.subtitle&&t.jsx("span",{style:{display:"block",fontSize:R.subtitleSize,color:p.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:k.subtitle})]}),k.badge&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:k.badge}),d==="right"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?p.primary:p.textMuted,marginTop:k.subtitle?"1px":void 0},children:t.jsx(Tr,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?p.primary:p.textMuted})})]}),t.jsx(Ps,{isOpen:f,reduced:h,id:F,triggerId:S,children:t.jsx("div",{style:{padding:R.contentPadding,fontSize:R.fontSize,lineHeight:1.6,color:p.textMuted,fontFamily:"inherit"},children:k.content})})]},k.id)})})}An.displayName="TkxAccordion";const Bs={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let nr=0;function Ws(){++nr===1&&(document.body.style.overflow="hidden")}function Ir(){--nr<=0&&(nr=0,document.body.style.overflow="")}function Hs(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function Vs(e,r){const n=Bs[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 Er(){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 Os({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=ye(),m=c.useId(),p=Dt(e);if(Lt(r,u&&e),c.useEffect(()=>(e?Ws():Ir(),()=>{e&&Ir()}),[e]),typeof document>"u")return null;const h=Vs(n,i),y=Hs(n),z=o?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",v=typeof s=="string"?B(s):s;return Be.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)":y,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:v}),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(Er,{})})]}),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(Er,{})})}),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 Ys=["Su","Mo","Tu","We","Th","Fr","Sa"],zr=["January","February","March","April","May","June","July","August","September","October","November","December"],_s=["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 Us(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 Nr(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 Ks(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 Rr(e,r){return new Date(e,r+1,0).getDate()}function Xs(e,r){const n=new Date(e,r,1).getDay(),i=Rr(e,r),s=[],a=Rr(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 Ut(e){return Math.floor(e/10)*10}function qs(){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 Zs(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 Ar({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 Dr({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:y}){const z=Xs(e,r);return t.jsxs("div",{children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:Ys.map(v=>t.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:h.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:v},v))}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:z.map((v,$)=>{const w=v.getMonth()===r,C=Re(v,n),I=v.getDay()===0||v.getDay()===6,R=x(v),M=i==="single"&&s!=null&&Re(v,s),N=i==="multiple"&&l.some(O=>Re(O,v)),T=i==="range"&&Nr(v,a[0],null),j=i==="range"&&Nr(v,null,a[1]),k=T||j,Y=i==="range"&&a[0]&&!a[1]&&d?d:a[1],f=i==="range"&&Us(v,a[0],Y),g=i==="range"&&a[0]&&!a[1]&&d&&Re(v,d),S=M||N||k,F=u!=null&&Re(v,u);let D="transparent",V=w?I?`${h.text}cc`:h.text:`${h.textMuted}60`,E="none",P=400;S||g?(D=h.primary,V=h.bg,P=600):f&&(D=`${h.primary}18`),C&&!S&&(E=`2px solid ${h.primary}`,P=600),R&&(V=`${h.textMuted}50`),F&&!S&&(E=`2px solid ${h.secondary}`);const W=v.toLocaleDateString(y,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return t.jsx("button",{type:"button","aria-label":W,"aria-pressed":S,"aria-disabled":R,disabled:R,onClick:()=>!R&&o(v),onMouseEnter:()=>m(v),onMouseLeave:()=>m(null),onFocus:()=>p(v),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:V,border:E,fontSize:"13px",fontWeight:P,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:v.getDate()},$)})})]})}function Dn({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:y=!1,customPresets:z,label:v,placeholder:$="MM/DD/YYYY",hint:w,isDisabled:C=!1,isInvalid:I=!1,errorMessage:R,numberOfMonths:M=1,id:N,className:T,style:j}){const k=ee(),Y=c.useId(),f=N??Y,g=ye(),S=ze(new Date),F=e!==void 0,[D,V]=c.useState(null),E=F?e??null:D,P=n!==void 0,[W,O]=c.useState([null,null]),A=P?n:W,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,ve]=c.useState(null),we=E??A[0]??S,[de,ge]=c.useState(we.getFullYear()),[J,ie]=c.useState(we.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,De]=c.useState({top:0,left:0,flipUp:!1}),[,at]=c.useReducer(_=>_+1,0),rt=c.useRef(null),ht=c.useRef(null),mt=c.useRef(null),gt=y?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 Oe=c.useCallback(()=>{rt.current&&De(Zs(rt.current,gt))},[gt]);c.useEffect(()=>{if(Me)return Oe(),window.addEventListener("scroll",Oe,!0),window.addEventListener("resize",Oe),()=>{window.removeEventListener("scroll",Oe,!0),window.removeEventListener("resize",Oe)}},[Me,Oe]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce,je;(ce=rt.current)!=null&&ce.contains(K.target)||(je=ht.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=mt.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?ve(_):(F||V(_),r==null||r(_),Ee(_e(_,o)),Te(!1));else if(l==="range")if(pe==="start"){const K=[_,null];X(K),P||O(K),i==null||i(K),xe("end")}else{const K=me[0]??A[0],ce=K&&_<K?[_,K]:[K,_];X(ce),oe?xe("start"):(P||O(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,P,H,r,i,a,pe,me,A,ne,oe,o]),Pt=c.useCallback(()=>{if(l==="single"){const _=Z??E;F||V(_),r==null||r(_)}else l==="range"&&(P||O(me),i==null||i(me));Te(!1),xe("start")},[l,Z,me,E,F,P,r,i]),Bt=c.useCallback(()=>{ve(null),X([null,null]),xe("start"),Te(!1)},[]),bt=()=>{J===0?(ie(11),ge(_=>_-1)):ie(_=>_-1),q("day")},yt=()=>{J===11?(ie(0),ge(_=>_+1)):ie(_=>_+1),q("day")},Wt=()=>ge(_=>_-1),Ht=()=>ge(_=>_+1),vt=()=>ge(_=>_-10),kt=()=>ge(_=>_+10),Vt=_=>{if(Ee(_),l==="single"){const K=Ks(_);K&&!Xe(K)&&(F||V(K),r==null||r(K),ge(K.getFullYear()),ie(K.getMonth()))}},wt=_=>{if(_.stopPropagation(),l==="single")F||V(null),r==null||r(null),Ee("");else if(l==="range"){const K=[null,null];P||O(K),i==null||i(K),X(K),Ee(""),xe("start")}else l==="multiple"&&(H||G([]),a==null||a([]),Ee(""))},Ot=_=>{if(re!=="day")return;const K=U??E??S;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())))},L=()=>{ge(S.getFullYear()),ie(S.getMonth()),q("day"),nt(S)},fe=z??qs(),ke=_=>{const[K,ce]=_.getValue(),je=[K,ce];X(je),P||O(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,Ye=M>=2,lt=v?B(v):void 0,ct=w?B(w):void 0,dt=R?B(R):void 0,jt=B($),St=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],oo=I?k.danger:Me?k.primary:k.border,so=Array.from({length:24},(_,K)=>K),io=Array.from({length:60},(_,K)=>K),ao=t.jsxs("div",{ref:ht,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Ot,style:{position:"absolute",top:Ae.top,left:Ae.left,zIndex:9999,backgroundColor:k.surface,border:`1px solid ${k.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:Ye?"580px":"300px",maxWidth:Ye&&y?"780px":Ye?"620px":y?"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:[y&&l==="range"&&t.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${k.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:k.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:()=>ke(_),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:je?`${k.primary}20`:"transparent",color:je?k.primary:k.text,fontWeight:je?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:ut=>{je||(ut.currentTarget.style.backgroundColor=`${k.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"?bt():re==="month"?Wt():vt()},style:{border:"none",background:"transparent",cursor:"pointer",color:k.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:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:zr[J]}),t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),Ye&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{color:k.textMuted,fontSize:"14px"},children:"–"}),t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:k.text},children:[zr[Ce]," ",qe]})]})]}),re==="month"&&t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),re==="year"&&t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:k.text},children:[Ut(de),"–",Ut(de)+9]})]}),t.jsx("button",{type:"button","aria-label":re==="day"?"Next month":re==="month"?"Next year":"Next decade",onClick:()=>{re==="day"?yt():re==="month"?Ht():kt()},style:{border:"none",background:"transparent",cursor:"pointer",color:k.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(Dr,{year:de,month:J,today:S,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:Xe,onSelectDate:nt,onHoverDate:Se,onSetFocused:le,theme:k,locale:o}),Ye&&t.jsx(Dr,{year:qe,month:Ce,today:S,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:Xe,onSelectDate:nt,onHoverDate:Se,onSetFocused:le,theme:k,locale:o})]}),re==="month"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:_s.map((_,K)=>{const ce=K===J,je=K===S.getMonth()&&de===S.getFullYear();return t.jsx("button",{type:"button",onClick:()=>{ie(K),q("day")},style:{padding:"10px",borderRadius:"8px",border:je&&!ce?`2px solid ${k.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:ce?600:400,backgroundColor:ce?k.primary:"transparent",color:ce?k.bg:k.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=Ut(de)-1+K,je=ce===de,ut=ce===S.getFullYear(),yr=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 ${k.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:je?600:400,backgroundColor:je?k.primary:"transparent",color:je?k.bg:yr?k.textMuted:k.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:yr?.5:1},children:ce},ce)})}),m&&re==="day"&&t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[t.jsx(Ar,{values:so,selected:$e.h,onSelect:_=>{p||be(K=>({...K,h:_})),h==null||h({...$e,h:_})},label:"Hour",theme:k}),t.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:k.textMuted},children:":"}),t.jsx(Ar,{values:io,selected:$e.m,onSelect:_=>{p||be(K=>({...K,m:_})),h==null||h({...$e,m:_})},label:"Min",theme:k})]}),l==="multiple"&&re==="day"&&ne.length>0&&t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"8px",fontSize:"12px",color:k.textMuted,textAlign:"center"},children:[ne.length," date",ne.length!==1?"s":""," selected"]}),t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:oe?"space-between":"flex-start",gap:"8px"},children:[t.jsx("button",{type:"button",onClick:L,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:k.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:Bt,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${k.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:k.text,fontFamily:"inherit"},children:"Cancel"}),t.jsx("button",{type:"button",onClick:Pt,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:k.primary,color:k.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return t.jsxs("div",{className:T,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...j},children:[lt&&t.jsx("label",{htmlFor:f,style:{fontSize:"13px",fontWeight:500,color:k.text,marginBottom:"2px"},children:lt}),t.jsxs("div",{ref:rt,style:{display:"flex",alignItems:"center",border:`1.5px solid ${oo}`,borderRadius:"8px",backgroundColor:k.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:k.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:mt,id:f,type:"text",value:Ke,placeholder:jt,disabled:C,"aria-invalid":I,"aria-haspopup":"dialog","aria-expanded":Me,readOnly:l==="range"||l==="multiple",onChange:_=>Vt(_.target.value),onFocus:()=>{C||Te(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:k.text,cursor:l!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),St&&!C&&t.jsx("button",{type:"button","aria-label":"Clear selection",onClick:wt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:k.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:k.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:k.textMuted},children:ct}),I&&dt&&t.jsx("span",{role:"alert",style:{fontSize:"12px",color:k.danger},children:dt}),Me&&typeof document<"u"&&Be.createPortal(ao,document.body)]})}Dn.displayName="TkxDatePicker";const Gs={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 or(e,r,n){return Math.round((e-r)/n)*n+r}function Ve(e,r,n){return(e-r)/(n-r)*100}function Kt({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,y]=c.useState(!1),[z,v]=c.useState(!1),[$,w]=c.useState(!1),C=j=>{s||(j.key==="ArrowRight"||j.key==="ArrowUp"?(j.preventDefault(),m(Qe(or(e+i,r,i),r,n))):j.key==="ArrowLeft"||j.key==="ArrowDown"?(j.preventDefault(),m(Qe(or(e-i,r,i),r,n))):j.key==="Home"?(j.preventDefault(),m(r)):j.key==="End"&&(j.preventDefault(),m(n)))},I=o==="vertical",R=Ve(e,r,n),M=u==="always"||u==="hover"&&($||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:[M&&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:()=>y(!0),onBlur:()=>y(!1),onPointerEnter:()=>w(!0),onPointerLeave:()=>w(!1),onPointerDown:j=>{s||(v(!0),j.target.setPointerCapture(j.pointerId))},onPointerUp:()=>{v(!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 Ln({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:y="primary",size:z="md",marks:v,orientation:$="horizontal",showTooltip:w=!1,formatValue:C,onChangeEnd:I,onRangeChangeEnd:R,gradient:M=!1}){const N=ee(),T=c.useId(),j=ye(),k=e!==void 0,[Y,f]=c.useState(r),g=k?e:Y,S=i!==void 0,[F,D]=c.useState([a,l]),V=S?i:F,E=c.useRef(null),P=c.useRef(g);P.current=g;const W=c.useRef(V);W.current=V;const O={primary:N.primary,success:N.success,danger:N.danger,warning:N.warning}[y],A=Gs[z],H=$==="vertical",Q=w===!0?"hover":w===!1?!1:w,G=C??(J=>String(J)),ne=O+"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(or(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)k||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];S||D($e),s==null||s($e)}},[h,u,k,S,pe,n,s,V]),oe=J=>{k||f(J),n==null||n(J)},me=J=>{const ie=[Qe(J,a,V[1]),V[1]];S||D(ie),s==null||s(ie)},X=J=>{const ie=[V[0],Qe(J,V[0],l)];S||D(ie),s==null||s(ie)},Z=u?Ve(V[0],a,l):0,ve=Ve(u?V[1]:g,a,l),we=m?Array.from({length:p},(J,ie)=>a+ie/(p-1)*(l-a)):[],de=x?B(x):void 0,ge=j?"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",touchAction:"none"},children:[t.jsx("div",{style:{position:"absolute",...H?{left:0,bottom:`${Z}%`,height:`${ve-Z}%`,width:"100%"}:{top:0,left:`${Z}%`,width:`${ve-Z}%`,height:"100%"},borderRadius:9999,...h?{backgroundColor:N.textMuted}:M?{background:H?`linear-gradient(to top, ${ne}, ${O})`:`linear-gradient(to right, ${ne}, ${O})`}:{backgroundColor:O},transition:ge}}),we.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(Kt,{value:V[0],min:a,max:V[1],step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} start`,tooltipMode:Q,formatValue:G,orientation:$,onChange:me,onChangeEnd:R?()=>R(W.current):void 0}),t.jsx(Kt,{value:V[1],min:V[0],max:l,step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} end`,tooltipMode:Q,formatValue:G,orientation:$,onChange:X,onChangeEnd:R?()=>R(W.current):void 0})]}):t.jsx(Kt,{value:g,min:a,max:l,step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:de??"Slider",tooltipMode:Q,formatValue:G,orientation:$,onChange:oe,onChangeEnd:I?()=>I(P.current):void 0})]}),v&&v.length>0&&t.jsx("div",{style:{position:H?"absolute":"relative",...H?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:v.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:B(J.label)},ie))})]}),m&&!v&&!H&&t.jsx("div",{style:{position:"relative",height:"1rem"},children:we.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))})]})}Ln.displayName="TkxSlider";const Js={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 Qs(e,r,n,i){if(r<=1)return[1];const s=(y,z)=>Array.from({length:Math.max(0,z-y+1)},(v,$)=>y+$),a=Math.max(e-n,1),l=Math.min(e+n,r);if(!i){const y=[];return a>1&&y.push("..."),y.push(...s(a,l)),l<r&&y.push("..."),y}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 y of m)typeof y=="number"?p.has(y)||(p.add(y),h.push(y)):h.push(y);return h}function Fn({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(),y=n!==void 0,[z,v]=c.useState(i),$=y?n:z,[w,C]=c.useState(r),I=r,R=Math.max(1,Math.ceil(e/I)),M=S=>{const F=Math.min(Math.max(S,1),R);F!==$&&(y||v(F),s==null||s(F))},N=S=>{C(S),u==null||u(S),M(1)},T=Qs($,R,a,l),j=Js[o],k=Math.min(($-1)*I+1,e),Y=Math.min($*I,e),f=(S,F)=>{const D={height:j.height,minWidth:j.minWidth,paddingLeft:j.px,paddingRight:j.px,fontSize:j.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 S?{...D,backgroundColor:p.primary,color:p.bg,fontWeight:600,boxShadow:`0 0 0 2px ${p.primary}44`}:m==="default"?{...D,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`}:m==="outline"?{...D,backgroundColor:"transparent",color:p.text,border:`1px solid ${p.border}`}:{...D,backgroundColor:"transparent",color:p.text}},g=({d:S})=>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:S})});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:j.fontSize},children:B(`Showing ${k}–${Y} 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:$===1,onClick:()=>M(1),style:f(!1,$===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:$===1,onClick:()=>M($-1),style:f(!1,$===1),children:t.jsx(g,{d:"15 18 9 12 15 6"})}),T.map((S,F)=>{if(typeof S=="string")return t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:j.minWidth,height:j.height,fontSize:j.fontSize,color:p.textMuted,userSelect:"none"},children:"…"},`${S}-${F}`);const V=S,E=V===$;return t.jsx("button",{type:"button","aria-label":`Page ${V}`,"aria-current":E?"page":void 0,onClick:()=>M(V),style:f(E,!1),children:V},V)}),t.jsx("button",{type:"button","aria-label":"Next page",disabled:$===R,onClick:()=>M($+1),style:f(!1,$===R),children:t.jsx(g,{d:"9 18 15 12 9 6"})}),l&&t.jsxs("button",{type:"button","aria-label":"Last page",disabled:$===R,onClick:()=>M(R),style:f(!1,$===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:j.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),t.jsx("select",{id:h,value:w,onChange:S=>N(Number(S.target.value)),style:{height:j.height,paddingLeft:j.px,paddingRight:j.px,fontSize:j.fontSize,borderRadius:"8px",border:`1px solid ${p.border}`,backgroundColor:p.surface,color:p.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:x.map(S=>t.jsx("option",{value:S,children:S},S))})]})]})]})}Fn.displayName="TkxPagination";const ei={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},ti={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function ri({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 ni({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(),y=ye(),[z,v]=c.useState(!1),[$,w]=c.useState(!1),[C,I]=c.useState(!1),R=c.useRef(null),M=B(e),N=r?B(r):"",T=d?B(d):"",j=ti[l];c.useEffect(()=>{var H;(H=R.current)!=null&&H.complete&&v(!0)},[]);const k=c.useCallback(()=>v(!0),[]),Y=c.useCallback(()=>w(!0),[]),f=c.useCallback(()=>{x&&!$&&I(!0)},[x,$]),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 S=i==="skeleton"&&!z&&!$,F=S&&!y?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},D=$?null:t.jsx("img",{ref:R,src:M,alt:N||void 0,role:N?void 0:"img","aria-label":N?void 0:"Image",loading:u?"lazy":void 0,onLoad:k,onError:Y,onClick:x?f:void 0,className:ue(b("block w-full h-full"),x&&!$?b("cursor-pointer"):""),style:{objectFit:s,borderRadius:j,opacity:z?1:0,transition:y?"none":"opacity 200ms ease",position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0},...p}),V=$?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:j,color:h.textMuted,minHeight:"80px"},children:[t.jsx(ri,{color:h.textMuted,size:32}),t.jsx("span",{className:b("text-xs"),style:{color:h.textMuted},children:"Failed to load"})]}):null,E=S?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:j,backgroundColor:h.surfaceAlt,...F}}):null,P=a==="auto"?t.jsxs("div",{className:b("relative w-full"),style:{borderRadius:j},children:[E,D,V]}):t.jsxs("div",{className:b("relative w-full overflow-hidden"),style:{paddingBottom:ei[a],borderRadius:j},children:[E,D,V]}),W=T?t.jsxs("figure",{className:b("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:j},children:[P,t.jsx("figcaption",{className:b("text-sm text-center"),style:{color:h.textMuted},children:T})]}):P,O=t.jsx("div",{className:ue(b("inline-block w-full"),o),style:m,children:W}),A=C&&typeof document<"u"?Be.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:M,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:[O,A]})}function Lr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function oi({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 si=0;function ii(){return`tkx-file-${++si}`}function ai({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=ye(),y=c.useId(),z=c.useRef(null),[v,$]=c.useState(!1),[w,C]=c.useState([]);c.useEffect(()=>()=>{w.forEach(E=>{E.objectUrl&&URL.revokeObjectURL(E.objectUrl)})},[]);const I=c.useCallback(E=>{let P=0;const W=setInterval(()=>{P+=Math.floor(Math.random()*20)+10,P>=100&&(P=100,clearInterval(W)),C(O=>O.map(A=>A.id===E?{...A,progress:P}:A))},100)},[]),R=c.useCallback(E=>{if(n&&E.size>n)return`"${B(E.name)}" exceeds max size of ${Lr(n)}`;if(e&&!e.split(",").map(O=>O.trim()).some(O=>O.startsWith(".")?E.name.toLowerCase().endsWith(O.toLowerCase()):O.endsWith("/*")?E.type.startsWith(O.slice(0,-1)):E.type===O))return`"${B(E.name)}" is not an accepted file type`},[e,n]),M=c.useCallback(E=>{const P=i?i-w.length:1/0;if(P<=0){a==null||a(`Maximum of ${i} file${i===1?"":"s"} allowed`);return}const O=E.slice(0,P).map(A=>{const H=R(A),Q=x&&A.type.startsWith("image/")&&!H?URL.createObjectURL(A):void 0;return{file:A,id:ii(),objectUrl:Q,progress:0,error:H}});C(A=>{const H=r?[...A,...O]:O,Q=H.filter(G=>!G.error).map(G=>G.file);return s==null||s(Q),H}),O.forEach(A=>{A.error&&(a==null||a(A.error))}),O.forEach(A=>{A.error||I(A.id)})},[w.length,i,r,s,a,x,I,R]),N=c.useCallback(E=>{const P=Array.from(E.target.files??[]);P.length&&M(P),E.target.value=""},[M]),T=c.useCallback(E=>{if(E.preventDefault(),$(!1),u)return;const P=Array.from(E.dataTransfer.files);P.length&&M(P)},[u,M]),j=c.useCallback(E=>{E.preventDefault(),u||$(!0)},[u]),k=c.useCallback(()=>$(!1),[]),Y=c.useCallback(E=>{C(P=>{const W=P.find(A=>A.id===E);W!=null&&W.objectUrl&&URL.revokeObjectURL(W.objectUrl);const O=P.filter(A=>A.id!==E);return s==null||s(O.filter(A=>!A.error).map(A=>A.file)),O})},[s]),f=c.useCallback(()=>{var E;u||(E=z.current)==null||E.click()},[u]),g=v?p.primary:p.border,S=B(l),F=d?B(d):"",D=t.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":S,"aria-describedby":d?y:void 0,"aria-disabled":u,onClick:f,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},onDrop:o?T:void 0,onDragOver:o?j:void 0,onDragLeave:o?k: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:v?`${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:v?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:v?"Drop files here":S}),F&&t.jsx("p",{id:y,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?y: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"})]}),S,d&&t.jsx("span",{id:y,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"?D:V,w.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:w.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:B(E.file.name),className:b("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):t.jsx("span",{style:{flexShrink:0},children:t.jsx(oi,{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:B(E.file.name)}),t.jsxs("span",{className:b("text-xs"),style:{color:p.textMuted},children:[Lr(E.file.size),E.error&&` — ${E.error}`]})]}),t.jsx("button",{type:"button","aria-label":`Remove ${B(E.file.name)}`,onClick:()=>Y(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 li={sm:16,md:24,lg:32,xl:40};function ci({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 di({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 ui({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 fi({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(di,{...l}):e==="circle"?t.jsx(ui,{...l}):t.jsx(ci,{...l})}function Fr(e,r,n){return Math.min(n,Math.max(r,e))}function pi(e,r){return r===1?Math.round(e):Math.round(e*2)/2}function Pr(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 xi({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(),y=ye(),z=c.useId(),v=e!==void 0,[$,w]=c.useState(r),[C,I]=c.useState(null),R=c.useRef(null),M=v?e??0:$,N=C??M,j={warning:h.warning,primary:h.primary,danger:h.danger}[o]??h.warning,k=li[a],Y=!l&&!d,f=c.useCallback(E=>{v||w(E),n==null||n(E)},[v,n]),g=c.useCallback((E,P)=>{Y&&I(Pr(E,P,s))},[Y,s]),S=c.useCallback(()=>{Y&&I(null)},[Y]),F=c.useCallback((E,P)=>{if(!Y)return;const W=Pr(E,P,s);f(W===M?0:W)},[Y,s,M,f]),D=c.useCallback(E=>{if(!Y)return;const P=s;let W=M;if(E.key==="ArrowRight"||E.key==="ArrowUp")E.preventDefault(),W=Fr(M+P,0,i);else if(E.key==="ArrowLeft"||E.key==="ArrowDown")E.preventDefault(),W=Fr(M-P,0,i);else if(E.key==="Home")E.preventDefault(),W=0;else if(E.key==="End")E.preventDefault(),W=i;else return;W=pi(W,s),f(W)},[Y,M,i,s,f]),V=u?B(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:Y?0:-1,onKeyDown:D,onMouseLeave:S,className:b("flex items-center gap-0.5 outline-none"),style:{cursor:Y?"pointer":"default"},children:Array.from({length:i},(E,P)=>{const W=P+1,O=P+.5,A=N>=W,H=!A&&s===.5&&N>=O,Q=`${z}-${P}`;return t.jsx("span",{role:"radio","aria-checked":s===.5&&M===O||M===W,"aria-label":s===.5?`${O} star${O!==1?"s":""} / ${W} star${W!==1?"s":""}`:`${W} star${W!==1?"s":""}`,tabIndex:-1,onMouseMove:G=>g(G,P),onClick:G=>F(G,P),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:C!==null&&N>=O&&Y?"scale(1.15)":"scale(1)"},children:t.jsx(fi,{type:A||H?p:m,size:k,filled:A,halfFilled:H,color:A||H?j:h.border,uid:H?Q:void 0})},P)})}),x&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:h.textMuted},"aria-live":"polite","aria-atomic":"true",children:[M%1===0?M.toFixed(0):M.toFixed(1)," / ",i]})]})}let Br=!1;function hi(){if(Br||typeof document>"u")return;Br=!0;const e=document.createElement("style");e.textContent=`
23
+ `,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=i?[...r].reverse():r;return Ne.createPortal(t.jsx("div",{"aria-label":"Notifications",className:h("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(u=>t.jsx("div",{className:h("pointer-events-auto"),children:t.jsx(Vi,{toast:u,position:e,onDismiss:Mr,reduced:o})},u.id))}),document.body)}const _i={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 Wr({open:e,reduced:r,iconStyle:n,size:o,color:i}){const l=r?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return n==="chevron"?t.jsx("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:l,flexShrink:0},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):n==="plus"?t.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:l,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:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:l,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 Yi({isOpen:e,reduced:r,children:n,id:o,triggerId:i}){const l=a.useRef(null),c=a.useRef(null),d=a.useRef(e),u=a.useRef(!1);a.useEffect(()=>{const s=l.current;s&&(e?(s.style.height="auto",s.style.overflow="visible"):(s.style.height="0px",s.style.overflow="hidden"))},[]),a.useEffect(()=>{if(d.current===e)return;d.current=e;const s=l.current,m=c.current;if(!(!s||!m)){if(r){s.style.height=e?"auto":"0px",s.style.overflow=e?"visible":"hidden";return}if(u.current){const p=s.getBoundingClientRect().height;s.style.transition="none",s.style.height=`${p}px`,s.offsetHeight}u.current=!0,s.style.overflow="hidden",e?(s.style.height="0px",s.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{s.style.height=`${m.scrollHeight}px`})})):(s.style.height=`${m.scrollHeight}px`,s.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{s.style.height="0px"})}))}},[e,r]);const f=s=>{if(s.propertyName!=="height")return;u.current=!1;const m=l.current;m&&(e?(m.style.height="auto",m.style.overflow="visible"):m.style.overflow="hidden")};return t.jsx("div",{ref:l,id:o,role:"region","aria-labelledby":i,onTransitionEnd:f,style:{willChange:"height"},children:t.jsx("div",{ref:c,children:n})})}function xo({items:e,multiple:r=!1,defaultOpen:n,value:o,onChange:i,variant:l="default",size:c="md",iconPosition:d="right",iconStyle:u="chevron",flush:f=!1,className:s,style:m}){const p=U(),x=te(),y=a.useId(),v=o!==void 0,b=$=>$?Array.isArray($)?new Set($):new Set([$]):new Set,[g,w]=a.useState(()=>b(n)),S=v?b(o):g,M=a.useCallback(($,z)=>{if(z)return;let E;if(v){const k=b(o);E=new Set(k),E.has($)?E.delete($):(r||E.clear(),E.add($))}else{w(k=>{E=new Set(k),E.has($)?E.delete($):(r||E.clear(),E.add($));const A=[...E];return i==null||i(r?A:A[0]??""),E});return}const C=[...E];i==null||i(r?C:C[0]??"")},[r,i,v,o]),N=_i[c],j=()=>{if(f)return{};switch(l){case"bordered":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden"};case"separated":return{};case"ghost":case"flush":return{};default:return{}}},L=($,z,E)=>{if(f)return{};switch(l){case"default":return{borderBottom:E?"none":`1px solid ${p.border}`};case"bordered":return{borderBottom:E?"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{}}},I=$=>l==="ghost"||l==="flush"?$?`${p.primary}10`:`${p.surfaceAlt}80`:$?`${p.primary}0d`:`${p.surfaceAlt}60`,T=l==="separated";return t.jsx("div",{className:h(s??""),style:{...j(),display:T?"flex":void 0,flexDirection:T?"column":void 0,gap:T?"8px":void 0,...m},children:e.map(($,z)=>{const E=S.has($.id),C=z===e.length-1,k=`${y}-trigger-${$.id}`,A=`${y}-panel-${$.id}`;return t.jsxs("div",{className:$.className,style:L(z,E,C),children:[t.jsxs("button",{id:k,type:"button",role:"button","aria-expanded":E,"aria-controls":A,disabled:$.disabled,onClick:()=>M($.id,$.disabled),style:{width:"100%",display:"flex",alignItems:$.subtitle?"flex-start":"center",gap:"8px",padding:N.triggerPadding,border:"none",background:"transparent",cursor:$.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:N.fontSize,fontWeight:500,color:$.disabled?p.textMuted:p.text,opacity:$.disabled?.5:1,transition:x?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:D=>{$.disabled||(D.currentTarget.style.backgroundColor=I(E))},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=E?`${p.primary}0d`:"transparent"},onFocus:D=>{$.disabled||(D.currentTarget.style.outline=`2px solid ${p.primary}`,D.currentTarget.style.outlineOffset="2px")},onBlur:D=>{D.currentTarget.style.outline="none"},children:[$.icon&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:p.primary,marginTop:$.subtitle?"1px":void 0},children:$.icon}),d==="left"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:E?p.primary:p.textMuted,marginTop:$.subtitle?"1px":void 0},children:t.jsx(Wr,{open:E,reduced:x,iconStyle:u,size:N.iconSize,color:E?p.primary:p.textMuted})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",lineHeight:1.4},children:$.title}),$.subtitle&&t.jsx("span",{style:{display:"block",fontSize:N.subtitleSize,color:p.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:$.subtitle})]}),$.badge&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:$.badge}),d==="right"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:E?p.primary:p.textMuted,marginTop:$.subtitle?"1px":void 0},children:t.jsx(Wr,{open:E,reduced:x,iconStyle:u,size:N.iconSize,color:E?p.primary:p.textMuted})})]}),t.jsx(Yi,{isOpen:E,reduced:x,id:A,triggerId:k,children:t.jsx("div",{style:{padding:N.contentPadding,fontSize:N.fontSize,lineHeight:1.6,color:p.textMuted,fontFamily:"inherit"},children:$.content})})]},$.id)})})}xo.displayName="TkxAccordion";const Ui={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let ur=0;function Ki(){++ur===1&&(document.body.style.overflow="hidden")}function Fr(){--ur<=0&&(ur=0,document.body.style.overflow="")}function Xi(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function qi(e,r){const n=Ui[r],o=e==="left"||e==="right",i={position:"absolute"};return o?{...i,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...i,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}function Pr(){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 Zi({isOpen:e,onClose:r,placement:n="right",size:o="md",title:i,children:l,footer:c,closeOnOverlayClick:d=!0,closeOnEsc:u=!0}){const f=U(),s=te(),m=a.useId(),p=Kt(e);if(lt(r,u&&e),a.useEffect(()=>(e?Ki():Fr(),()=>{e&&Fr()}),[e]),typeof document>"u")return null;const x=qi(n,o),y=Xi(n),v=s?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",b=typeof i=="string"?R(i):i;return Ne.createPortal(t.jsxs("div",{role:"presentation",className:h("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:h("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:s?"none":"opacity 280ms ease",cursor:d?"pointer":"default"}}),t.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":i?m:void 0,className:h("absolute flex flex-col font-sans"),style:{...x,backgroundColor:f.surface,borderLeft:n==="right"?`1px solid ${f.border}`:void 0,borderRight:n==="left"?`1px solid ${f.border}`:void 0,borderTop:n==="bottom"?`1px solid ${f.border}`:void 0,borderBottom:n==="top"?`1px solid ${f.border}`:void 0,boxShadow:`0 20px 60px ${f.bg}99`,transform:e?"translate(0,0)":y,opacity:e?1:0,transition:v,willChange:"transform"},children:[i!==void 0&&t.jsxs("div",{className:h("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${f.border}`},children:[t.jsx("h2",{id:m,className:h("m-0 text-base font-semibold leading-snug"),style:{color:f.text},children:b}),t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:h("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:f.textMuted},children:t.jsx(Pr,{})})]}),i===void 0&&t.jsx("div",{className:h("flex justify-end px-3 pt-3 shrink-0"),children:t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:h("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:f.textMuted},children:t.jsx(Pr,{})})}),t.jsx("div",{className:h("flex-1 overflow-y-auto px-5 py-4"),style:{color:f.text},children:l}),c&&t.jsx("div",{className:h("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${f.border}`},children:c})]})]}),document.body)}const Gi=["Su","Mo","Tu","We","Th","Fr","Sa"],Hr=["January","February","March","April","May","June","July","August","September","October","November","December"],Ji=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function De(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Le(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Qi(e,r,n){if(!r||!n)return!1;const o=Le(e).getTime(),i=Le(r).getTime(),l=Le(n).getTime(),c=Math.min(i,l),d=Math.max(i,l);return o>c&&o<d}function Vr(e,r,n){return!!(r&&De(e,r)||n&&De(e,n))}function st(e,r="en-US"){return e?e.toLocaleDateString(r,{month:"2-digit",day:"2-digit",year:"numeric"}):""}function ea(e){const r=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!r)return null;const[,n,o,i]=r.map(Number);if(n<1||n>12||o<1||o>31)return null;const l=new Date(i,n-1,o);return l.getMonth()!==n-1?null:l}function Or(e,r){return new Date(e,r+1,0).getDate()}function ta(e,r){const n=new Date(e,r,1).getDay(),o=Or(e,r),i=[],l=Or(e,r-1);for(let d=n-1;d>=0;d--)i.push(new Date(e,r-1,l-d));for(let d=1;d<=o;d++)i.push(new Date(e,r,d));let c=1;for(;i.length<42;)i.push(new Date(e,r+1,c++));return i}function er(e){return Math.floor(e/10)*10}function ra(){return[{label:"Today",getValue:()=>{const e=Le(new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=Le(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=Le(new Date),r=new Date(e);return r.setDate(r.getDate()-6),[r,e]}},{label:"Last 30 days",getValue:()=>{const e=Le(new Date),r=new Date(e);return r.setDate(r.getDate()-29),[r,e]}},{label:"Last 90 days",getValue:()=>{const e=Le(new Date),r=new Date(e);return r.setDate(r.getDate()-89),[r,e]}},{label:"This week",getValue:()=>{const e=Le(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=Le(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,o=r===0?e.getFullYear()-1:e.getFullYear();return[new Date(o,n*3,1),new Date(o,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 na(e,r){const n=e.getBoundingClientRect(),o=window.innerHeight,i=window.scrollY,l=window.scrollX,d=o-n.bottom<r+8&&n.top>r+8;return{top:d?i+n.top-r-4:i+n.bottom+4,left:l+n.left,flipUp:d}}function _r({values:e,selected:r,onSelect:n,label:o,theme:i,format:l}){const c=a.useRef([]),d=a.useRef(null);a.useEffect(()=>{const f=c.current[r];f&&d.current&&f.scrollIntoView({block:"nearest"})},[r]);const u=l??(f=>String(f).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:i.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),t.jsx("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${i.border}`,borderRadius:"8px",padding:"4px"},children:e.map(f=>{const s=f===r;return t.jsx("button",{ref:m=>{c.current[f]=m},type:"button",onClick:()=>n(f),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:s?600:400,backgroundColor:s?i.primary:"transparent",color:s?i.bg:i.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:u(f)},f)})})]})}function Yr({year:e,month:r,today:n,mode:o,selectedDate:i,selectedRange:l,multiDates:c,hoverDate:d,focusedDate:u,isDateDisabled:f,onSelectDate:s,onHoverDate:m,onSetFocused:p,theme:x,locale:y}){const v=ta(e,r);return t.jsxs("div",{children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:Gi.map(b=>t.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:x.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:b},b))}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:v.map((b,g)=>{const w=b.getMonth()===r,S=De(b,n),M=b.getDay()===0||b.getDay()===6,N=f(b),j=o==="single"&&i!=null&&De(b,i),L=o==="multiple"&&c.some(P=>De(P,b)),I=o==="range"&&Vr(b,l[0],null),T=o==="range"&&Vr(b,null,l[1]),$=I||T,z=o==="range"&&l[0]&&!l[1]&&d?d:l[1],E=o==="range"&&Qi(b,l[0],z),C=o==="range"&&l[0]&&!l[1]&&d&&De(b,d),k=j||L||$,A=u!=null&&De(b,u);let D="transparent",O=w?M?`${x.text}cc`:x.text:`${x.textMuted}60`,W="none",H=400;k||C?(D=x.primary,O=x.bg,H=600):E&&(D=`${x.primary}18`),S&&!k&&(W=`2px solid ${x.primary}`,H=600),N&&(O=`${x.textMuted}50`),A&&!k&&(W=`2px solid ${x.secondary}`);const B=b.toLocaleDateString(y,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return t.jsx("button",{type:"button","aria-label":B,"aria-pressed":k,"aria-disabled":N,disabled:N,onClick:()=>!N&&s(b),onMouseEnter:()=>m(b),onMouseLeave:()=>m(null),onFocus:()=>p(b),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:O,border:W,fontSize:"13px",fontWeight:H,cursor:N?"not-allowed":"pointer",opacity:N?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:N?"line-through":"none",transition:"background-color 80ms ease"},children:b.getDate()},g)})})]})}function ho({value:e,onChange:r,rangeValue:n,onRangeChange:o,multiValue:i,onMultiChange:l,mode:c="single",minDate:d,maxDate:u,disabledDates:f,locale:s="en-US",showTime:m=!1,timeValue:p,onTimeChange:x,showPresets:y=!1,customPresets:v,label:b,placeholder:g="MM/DD/YYYY",hint:w,isDisabled:S=!1,isInvalid:M=!1,errorMessage:N,numberOfMonths:j=1,id:L,className:I,style:T}){const $=U(),z=a.useId(),E=L??z,C=te(),k=Le(new Date),A=e!==void 0,[D,O]=a.useState(null),W=A?e??null:D,H=n!==void 0,[B,P]=a.useState([null,null]),F=H?n:B,V=i!==void 0,[Q,re]=a.useState([]),ie=V?i:Q,[fe,xe]=a.useState("start"),ve=c==="range"||c==="single"&&m,[ge,X]=a.useState([null,null]),[se,he]=a.useState(null),Se=W??F[0]??k,[de,be]=a.useState(Se.getFullYear()),[ne,q]=a.useState(Se.getMonth()),[K,G]=a.useState("day"),[ee,ue]=a.useState({h:0,m:0}),ke=p??ee,[Me,je]=a.useState(!1),[ze,Te]=a.useState(()=>{if(c==="single")return st(W,s);if(c==="range"){const[Z,J]=F;if(Z&&J)return`${st(Z,s)} – ${st(J,s)}`}return""}),[Pe,Ge]=a.useState(null),[Je,Be]=a.useState(null),[Qe,et]=a.useState({top:0,left:0,flipUp:!1}),[,He]=a.useReducer(Z=>Z+1,0),tt=a.useRef(null),mt=a.useRef(null),gt=a.useRef(null),Ve=y?420:m?480:360;a.useEffect(()=>{if(c==="single")Te(st(W,s));else if(c==="range"){const[Z,J]=F;Te(Z&&J?`${st(Z,s)} – ${st(J,s)}`:Z?st(Z,s):"")}else c==="multiple"&&Te(ie.length>0?`${ie.length} date${ie.length!==1?"s":""} selected`:"")},[W,F,ie,c,s]);const Oe=a.useCallback(()=>{tt.current&&et(na(tt.current,Ve))},[Ve]);a.useEffect(()=>{if(Me)return Oe(),window.addEventListener("scroll",Oe,!0),window.addEventListener("resize",Oe),()=>{window.removeEventListener("scroll",Oe,!0),window.removeEventListener("resize",Oe)}},[Me,Oe]),a.useEffect(()=>{if(!Me)return;const Z=J=>{var pe,Ce;(pe=tt.current)!=null&&pe.contains(J.target)||(Ce=mt.current)!=null&&Ce.contains(J.target)||je(!1)};return document.addEventListener("pointerdown",Z),()=>document.removeEventListener("pointerdown",Z)},[Me]),a.useEffect(()=>{if(!Me)return;const Z=J=>{var pe;J.key==="Escape"&&(je(!1),(pe=gt.current)==null||pe.focus())};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[Me]);const Ue=a.useCallback(Z=>d&&Le(Z)<Le(d)||u&&Le(Z)>Le(u)?!0:f?typeof f=="function"?f(Z):f.some(J=>De(J,Z)):!1,[d,u,f]),rt=a.useCallback(Z=>{if(!Ue(Z)){if(c==="single")ve?he(Z):(A||O(Z),r==null||r(Z),Te(st(Z,s)),je(!1));else if(c==="range")if(fe==="start"){const J=[Z,null];X(J),H||P(J),o==null||o(J),xe("end")}else{const J=ge[0]??F[0],pe=J&&Z<J?[Z,J]:[J,Z];X(pe),ve?xe("start"):(H||P(pe),o==null||o(pe),xe("start"),je(!1))}else if(c==="multiple"){const pe=ie.some(Ce=>De(Ce,Z))?ie.filter(Ce=>!De(Ce,Z)):[...ie,Z];V||re(pe),l==null||l(pe)}He()}},[c,Ue,A,H,V,r,o,l,fe,ge,F,ie,ve,s]),bt=a.useCallback(()=>{if(c==="single"){const Z=se??W;A||O(Z),r==null||r(Z)}else c==="range"&&(H||P(ge),o==null||o(ge));je(!1),xe("start")},[c,se,ge,W,A,H,r,o]),St=a.useCallback(()=>{he(null),X([null,null]),xe("start"),je(!1)},[]),yt=()=>{ne===0?(q(11),be(Z=>Z-1)):q(Z=>Z-1),G("day")},_=()=>{ne===11?(q(0),be(Z=>Z+1)):q(Z=>Z+1),G("day")},oe=()=>be(Z=>Z-1),le=()=>be(Z=>Z+1),ye=()=>be(Z=>Z-10),We=()=>be(Z=>Z+10),nt=Z=>{if(Te(Z),c==="single"){const J=ea(Z);J&&!Ue(J)&&(A||O(J),r==null||r(J),be(J.getFullYear()),q(J.getMonth()))}},vt=Z=>{if(Z.stopPropagation(),c==="single")A||O(null),r==null||r(null),Te("");else if(c==="range"){const J=[null,null];H||P(J),o==null||o(J),X(J),Te(""),xe("start")}else c==="multiple"&&(V||re([]),l==null||l([]),Te(""))},Gt=Z=>{if(K!=="day")return;const J=Pe??W??k;let pe=null;if(Z.key==="ArrowRight")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()+1);else if(Z.key==="ArrowLeft")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()-1);else if(Z.key==="ArrowDown")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()+7);else if(Z.key==="ArrowUp")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()-7);else if(Z.key==="Enter"&&Pe){rt(Pe);return}pe&&(Z.preventDefault(),Ge(pe),(pe.getMonth()!==ne||pe.getFullYear()!==de)&&(q(pe.getMonth()),be(pe.getFullYear())))},Y=()=>{be(k.getFullYear()),q(k.getMonth()),G("day"),rt(k)},me=v??ra(),$e=Z=>{const[J,pe]=Z.getValue(),Ce=[J,pe];X(Ce),H||P(Ce),o==null||o(Ce),be(J.getFullYear()),q(J.getMonth()),xe("start"),ve||je(!1)},Ee=ne===11?0:ne+1,ct=ne===11?de+1:de,ot=j>=2,$t=b?R(b):void 0,Mt=w?R(w):void 0,Ct=N?R(N):void 0,At=R(g),Rt=c==="single"&&W!=null||c==="range"&&(F[0]!=null||F[1]!=null)||c==="multiple"&&ie.length>0,_e=c==="range"?ve?ge:F:[null,null],ts=M?$.danger:Me?$.primary:$.border,rs=Array.from({length:24},(Z,J)=>J),ns=Array.from({length:60},(Z,J)=>J),os=t.jsxs("div",{ref:mt,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Gt,style:{position:"absolute",top:Qe.top,left:Qe.left,zIndex:9999,backgroundColor:$.surface,border:`1px solid ${$.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:ot?"580px":"300px",maxWidth:ot&&y?"780px":ot?"620px":y?"520px":"300px",opacity:Me?1:0,transform:Me?"translateY(0) scale(1)":Qe.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:C?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[y&&c==="range"&&t.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${$.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:$.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),me.map(Z=>{const[J,pe]=Z.getValue(),Ce=_e[0]&&_e[1]&&De(_e[0],J)&&De(_e[1],pe);return t.jsx("button",{type:"button",onClick:()=>$e(Z),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:Ce?`${$.primary}20`:"transparent",color:Ce?$.primary:$.text,fontWeight:Ce?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:Tt=>{Ce||(Tt.currentTarget.style.backgroundColor=`${$.surfaceAlt}`)},onMouseLeave:Tt=>{Ce||(Tt.currentTarget.style.backgroundColor="transparent")},children:Z.label},Z.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":K==="day"?"Previous month":K==="month"?"Previous year":"Previous decade",onClick:()=>{K==="day"?yt():K==="month"?oe():ye()},style:{border:"none",background:"transparent",cursor:"pointer",color:$.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:[K==="day"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>G("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:$.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:Hr[ne]}),t.jsx("button",{type:"button",onClick:()=>G("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:$.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),ot&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{color:$.textMuted,fontSize:"14px"},children:"–"}),t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:$.text},children:[Hr[Ee]," ",ct]})]})]}),K==="month"&&t.jsx("button",{type:"button",onClick:()=>G("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:$.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),K==="year"&&t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:$.text},children:[er(de),"–",er(de)+9]})]}),t.jsx("button",{type:"button","aria-label":K==="day"?"Next month":K==="month"?"Next year":"Next decade",onClick:()=>{K==="day"?_():K==="month"?le():We()},style:{border:"none",background:"transparent",cursor:"pointer",color:$.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"})})})]}),K==="day"&&t.jsxs("div",{style:{display:"flex",gap:"20px"},children:[t.jsx(Yr,{year:de,month:ne,today:k,mode:c,selectedDate:W,selectedRange:_e,multiDates:ie,hoverDate:Je,focusedDate:Pe,isDateDisabled:Ue,onSelectDate:rt,onHoverDate:Be,onSetFocused:Ge,theme:$,locale:s}),ot&&t.jsx(Yr,{year:ct,month:Ee,today:k,mode:c,selectedDate:W,selectedRange:_e,multiDates:ie,hoverDate:Je,focusedDate:Pe,isDateDisabled:Ue,onSelectDate:rt,onHoverDate:Be,onSetFocused:Ge,theme:$,locale:s})]}),K==="month"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:Ji.map((Z,J)=>{const pe=J===ne,Ce=J===k.getMonth()&&de===k.getFullYear();return t.jsx("button",{type:"button",onClick:()=>{q(J),G("day")},style:{padding:"10px",borderRadius:"8px",border:Ce&&!pe?`2px solid ${$.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:pe?600:400,backgroundColor:pe?$.primary:"transparent",color:pe?$.bg:$.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:Z},Z)})}),K==="year"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(Z,J)=>{const pe=er(de)-1+J,Ce=pe===de,Tt=pe===k.getFullYear(),Er=J===0||J===11;return t.jsx("button",{type:"button",onClick:()=>{be(pe),G("month")},style:{padding:"10px 6px",borderRadius:"8px",border:Tt&&!Ce?`2px solid ${$.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:Ce?600:400,backgroundColor:Ce?$.primary:"transparent",color:Ce?$.bg:Er?$.textMuted:$.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:Er?.5:1},children:pe},pe)})}),m&&K==="day"&&t.jsxs("div",{style:{borderTop:`1px solid ${$.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[t.jsx(_r,{values:rs,selected:ke.h,onSelect:Z=>{p||ue(J=>({...J,h:Z})),x==null||x({...ke,h:Z})},label:"Hour",theme:$}),t.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:$.textMuted},children:":"}),t.jsx(_r,{values:ns,selected:ke.m,onSelect:Z=>{p||ue(J=>({...J,m:Z})),x==null||x({...ke,m:Z})},label:"Min",theme:$})]}),c==="multiple"&&K==="day"&&ie.length>0&&t.jsxs("div",{style:{borderTop:`1px solid ${$.border}`,paddingTop:"8px",fontSize:"12px",color:$.textMuted,textAlign:"center"},children:[ie.length," date",ie.length!==1?"s":""," selected"]}),t.jsxs("div",{style:{borderTop:`1px solid ${$.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:ve?"space-between":"flex-start",gap:"8px"},children:[t.jsx("button",{type:"button",onClick:Y,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:$.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),ve&&t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsx("button",{type:"button",onClick:St,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${$.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:$.text,fontFamily:"inherit"},children:"Cancel"}),t.jsx("button",{type:"button",onClick:bt,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:$.primary,color:$.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return t.jsxs("div",{className:I,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...T},children:[$t&&t.jsx("label",{htmlFor:E,style:{fontSize:"13px",fontWeight:500,color:$.text,marginBottom:"2px"},children:$t}),t.jsxs("div",{ref:tt,style:{display:"flex",alignItems:"center",border:`1.5px solid ${ts}`,borderRadius:"8px",backgroundColor:$.surface,overflow:"hidden",transition:C?"none":"border-color 120ms ease",opacity:S?.5:1},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:$.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:gt,id:E,type:"text",value:ze,placeholder:At,disabled:S,"aria-invalid":M,"aria-haspopup":"dialog","aria-expanded":Me,readOnly:c==="range"||c==="multiple",onChange:Z=>nt(Z.target.value),onFocus:()=>{S||je(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:$.text,cursor:c!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Rt&&!S&&t.jsx("button",{type:"button","aria-label":"Clear selection",onClick:vt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:$.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:S,onClick:()=>{S||je(Z=>!Z)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:S?"not-allowed":"pointer",color:$.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:C?"none":"transform 160ms ease"},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),Mt&&!M&&t.jsx("span",{style:{fontSize:"12px",color:$.textMuted},children:Mt}),M&&Ct&&t.jsx("span",{role:"alert",style:{fontSize:"12px",color:$.danger},children:Ct}),Me&&typeof document<"u"&&Ne.createPortal(os,document.body)]})}ho.displayName="TkxDatePicker";const oa={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function pt(e,r,n){return Math.min(Math.max(e,r),n)}function fr(e,r,n){return Math.round((e-r)/n)*n+r}function Ze(e,r,n){return(e-r)/(n-r)*100}function tr({value:e,min:r,max:n,step:o,isDisabled:i,trackColor:l,thumbSize:c,ariaLabel:d,tooltipMode:u,formatValue:f,orientation:s,onChange:m,onChangeEnd:p}){const[x,y]=a.useState(!1),[v,b]=a.useState(!1),[g,w]=a.useState(!1),S=T=>{i||(T.key==="ArrowRight"||T.key==="ArrowUp"?(T.preventDefault(),m(pt(fr(e+o,r,o),r,n))):T.key==="ArrowLeft"||T.key==="ArrowDown"?(T.preventDefault(),m(pt(fr(e-o,r,o),r,n))):T.key==="Home"?(T.preventDefault(),m(r)):T.key==="End"&&(T.preventDefault(),m(n)))},M=s==="vertical",N=Ze(e,r,n),j=u==="always"||u==="hover"&&(g||v||x),L=M?{position:"absolute",bottom:`${N}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${c/2}px`,zIndex:2,cursor:i?"not-allowed":"grab"}:{position:"absolute",left:`${N}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${c/2}px`,zIndex:2,cursor:i?"not-allowed":"grab"},I=M?{position:"absolute",left:c+6,top:"50%",transform:"translateY(-50%)",backgroundColor:l,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:c+6,left:"50%",transform:"translateX(-50%)",backgroundColor:l,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return t.jsxs("div",{style:L,children:[j&&t.jsx("div",{style:I,children:f(e)}),t.jsx("div",{role:"slider",tabIndex:i?-1:0,"aria-label":d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":i,"aria-orientation":s,onKeyDown:S,onFocus:()=>y(!0),onBlur:()=>y(!1),onPointerEnter:()=>w(!0),onPointerLeave:()=>w(!1),onPointerDown:T=>{i||(b(!0),T.target.setPointerCapture(T.pointerId))},onPointerUp:()=>{b(!1),p==null||p()},style:{width:c,height:c,borderRadius:"50%",backgroundColor:i?"#888":l,border:"3px solid #fff",boxShadow:x?`0 0 0 3px ${l}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function mo({value:e,defaultValue:r=0,onChange:n,rangeValue:o,onRangeChange:i,min:l=0,max:c=100,step:d=1,isRange:u=!1,label:f,showValue:s=!1,showTicks:m=!1,tickCount:p=5,isDisabled:x=!1,colorScheme:y="primary",size:v="md",marks:b,orientation:g="horizontal",showTooltip:w=!1,formatValue:S,onChangeEnd:M,onRangeChangeEnd:N,gradient:j=!1}){const L=U(),I=a.useId(),T=te(),$=e!==void 0,[z,E]=a.useState(r),C=$?e:z,k=o!==void 0,[A,D]=a.useState([l,c]),O=k?o:A,W=a.useRef(null),H=a.useRef(C);H.current=C;const B=a.useRef(O);B.current=O;const P={primary:L.primary,success:L.success,danger:L.danger,warning:L.warning}[y],F=oa[v],V=g==="vertical",Q=w===!0?"hover":w===!1?!1:w,re=S??(ne=>String(ne)),ie=P+"66",fe=a.useCallback((ne,q)=>{const K=W.current;if(!K)return l;const G=K.getBoundingClientRect();let ee;V?ee=pt((G.bottom-(q??0))/G.height,0,1):ee=pt((ne-G.left)/G.width,0,1);const ue=ee*(c-l)+l;return pt(fr(ue,l,d),l,c)},[l,c,d,V]),xe=a.useCallback(ne=>{if(x)return;const q=fe(ne.clientX,ne.clientY);if(!u)$||E(q),n==null||n(q);else{const[K,G]=O,ee=Math.abs(q-K),ue=Math.abs(q-G),ke=ee<=ue?[q,G]:[K,q];k||D(ke),i==null||i(ke)}},[x,u,$,k,fe,n,i,O]),ve=ne=>{$||E(ne),n==null||n(ne)},ge=ne=>{const q=[pt(ne,l,O[1]),O[1]];k||D(q),i==null||i(q)},X=ne=>{const q=[O[0],pt(ne,O[0],c)];k||D(q),i==null||i(q)},se=u?Ze(O[0],l,c):0,he=Ze(u?O[1]:C,l,c),Se=m?Array.from({length:p},(ne,q)=>l+q/(p-1)*(c-l)):[],de=f?R(f):void 0,be=T?"none":"background 150ms ease";return t.jsxs("div",{className:h("flex flex-col gap-2"),style:{opacity:x?.55:1,...V?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(de||s)&&t.jsxs("div",{className:h("flex items-center justify-between"),children:[de&&t.jsx("label",{htmlFor:I,className:h("text-sm font-medium"),style:{color:L.text,fontSize:F.fontSize},children:de}),s&&!u&&t.jsx("span",{className:h("text-sm tabular-nums"),style:{color:L.textMuted,fontSize:F.fontSize},children:re(C)}),s&&u&&t.jsxs("span",{className:h("text-sm tabular-nums"),style:{color:L.textMuted,fontSize:F.fontSize},children:[re(O[0])," – ",re(O[1])]})]}),t.jsxs("div",{style:{position:"relative",...V?{paddingLeft:F.thumb/2,paddingRight:F.thumb/2,flex:1}:{paddingTop:F.thumb/2,paddingBottom:F.thumb/2}},children:[t.jsxs("div",{ref:W,onPointerDown:xe,style:{position:"relative",...V?{width:F.track,height:"100%"}:{height:F.track},borderRadius:9999,backgroundColor:L.border,cursor:x?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[t.jsx("div",{style:{position:"absolute",...V?{left:0,bottom:`${se}%`,height:`${he-se}%`,width:"100%"}:{top:0,left:`${se}%`,width:`${he-se}%`,height:"100%"},borderRadius:9999,...x?{backgroundColor:L.textMuted}:j?{background:V?`linear-gradient(to top, ${ie}, ${P})`:`linear-gradient(to right, ${ie}, ${P})`}:{backgroundColor:P},transition:be}}),Se.map((ne,q)=>t.jsx("div",{style:{position:"absolute",...V?{bottom:`${Ze(ne,l,c)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:F.track+4}:{left:`${Ze(ne,l,c)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:F.track+4},backgroundColor:L.surface,borderRadius:9999,pointerEvents:"none"}},q)),u?t.jsxs(t.Fragment,{children:[t.jsx(tr,{value:O[0],min:l,max:O[1],step:d,isDisabled:x,trackColor:P,trackHeight:F.track,thumbSize:F.thumb,ariaLabel:`${de??"Range"} start`,tooltipMode:Q,formatValue:re,orientation:g,onChange:ge,onChangeEnd:N?()=>N(B.current):void 0}),t.jsx(tr,{value:O[1],min:O[0],max:c,step:d,isDisabled:x,trackColor:P,trackHeight:F.track,thumbSize:F.thumb,ariaLabel:`${de??"Range"} end`,tooltipMode:Q,formatValue:re,orientation:g,onChange:X,onChangeEnd:N?()=>N(B.current):void 0})]}):t.jsx(tr,{value:C,min:l,max:c,step:d,isDisabled:x,trackColor:P,trackHeight:F.track,thumbSize:F.thumb,ariaLabel:de??"Slider",tooltipMode:Q,formatValue:re,orientation:g,onChange:ve,onChangeEnd:M?()=>M(H.current):void 0})]}),b&&b.length>0&&t.jsx("div",{style:{position:V?"absolute":"relative",...V?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:b.map((ne,q)=>t.jsx("div",{style:{position:"absolute",...V?{bottom:`${Ze(ne.value,l,c)}%`,transform:"translateY(50%)",left:0}:{left:`${Ze(ne.value,l,c)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:L.textMuted,whiteSpace:"nowrap"},children:R(ne.label)},q))})]}),m&&!b&&!V&&t.jsx("div",{style:{position:"relative",height:"1rem"},children:Se.map((ne,q)=>t.jsx("span",{style:{position:"absolute",left:`${Ze(ne,l,c)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:L.textMuted},children:re(Math.round(ne))},q))})]})}mo.displayName="TkxSlider";const sa={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 ia(e,r,n,o){if(r<=1)return[1];const i=(y,v)=>Array.from({length:Math.max(0,v-y+1)},(b,g)=>y+g),l=Math.max(e-n,1),c=Math.min(e+n,r);if(!o){const y=[];return l>1&&y.push("..."),y.push(...i(l,c)),c<r&&y.push("..."),y}const d=1,u=r,f=l>d+2,s=c<u-2,m=[];m.push(1),f?m.push("left-ellipsis"):m.push(...i(2,l-1)),m.push(...i(Math.max(l,2),Math.min(c,r-1))),s?m.push("right-ellipsis"):m.push(...i(c+1,r-1)),r>1&&m.push(r);const p=new Set,x=[];for(const y of m)typeof y=="number"?p.has(y)||(p.add(y),x.push(y)):x.push(y);return x}function go({total:e,pageSize:r=10,page:n,defaultPage:o=1,onChange:i,siblingCount:l=1,showEdges:c=!0,showPageSize:d=!1,onPageSizeChange:u,pageSizeOptions:f=[10,25,50,100],size:s="md",variant:m="default"}){const p=U(),x=a.useId(),y=n!==void 0,[v,b]=a.useState(o),g=y?n:v,[w,S]=a.useState(r),M=r,N=Math.max(1,Math.ceil(e/M)),j=k=>{const A=Math.min(Math.max(k,1),N);A!==g&&(y||b(A),i==null||i(A))},L=k=>{S(k),u==null||u(k),j(1)},I=ia(g,N,l,c),T=sa[s],$=Math.min((g-1)*M+1,e),z=Math.min(g*M,e),E=(k,A)=>{const D={height:T.height,minWidth:T.minWidth,paddingLeft:T.px,paddingRight:T.px,fontSize:T.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:A?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:A?.4:1};return k?{...D,backgroundColor:p.primary,color:p.bg,fontWeight:600,boxShadow:`0 0 0 2px ${p.primary}44`}:m==="default"?{...D,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`}:m==="outline"?{...D,backgroundColor:"transparent",color:p.text,border:`1px solid ${p.border}`}:{...D,backgroundColor:"transparent",color:p.text}},C=({d:k})=>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:k})});return t.jsxs("nav",{"aria-label":"Pagination",className:h("flex flex-col gap-2"),children:[e>0&&t.jsx("p",{className:h("text-sm"),style:{color:p.textMuted,fontSize:T.fontSize},children:R(`Showing ${$}–${z} of ${e} items`)}),t.jsxs("div",{className:h("flex items-center gap-1 flex-wrap"),children:[c&&t.jsxs("button",{type:"button","aria-label":"First page",disabled:g===1,onClick:()=>j(1),style:E(!1,g===1),children:[t.jsx(C,{d:"15 18 9 12 15 6"}),t.jsx(C,{d:"20 18 14 12 20 6"})]}),t.jsx("button",{type:"button","aria-label":"Previous page",disabled:g===1,onClick:()=>j(g-1),style:E(!1,g===1),children:t.jsx(C,{d:"15 18 9 12 15 6"})}),I.map((k,A)=>{if(typeof k=="string")return t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:T.minWidth,height:T.height,fontSize:T.fontSize,color:p.textMuted,userSelect:"none"},children:"…"},`${k}-${A}`);const O=k,W=O===g;return t.jsx("button",{type:"button","aria-label":`Page ${O}`,"aria-current":W?"page":void 0,onClick:()=>j(O),style:E(W,!1),children:O},O)}),t.jsx("button",{type:"button","aria-label":"Next page",disabled:g===N,onClick:()=>j(g+1),style:E(!1,g===N),children:t.jsx(C,{d:"9 18 15 12 9 6"})}),c&&t.jsxs("button",{type:"button","aria-label":"Last page",disabled:g===N,onClick:()=>j(N),style:E(!1,g===N),children:[t.jsx(C,{d:"4 18 10 12 4 6"}),t.jsx(C,{d:"14 18 20 12 14 6"})]}),d&&t.jsxs("div",{className:h("flex items-center gap-2 ml-2"),children:[t.jsx("label",{htmlFor:x,className:h("text-sm"),style:{color:p.textMuted,fontSize:T.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),t.jsx("select",{id:x,value:w,onChange:k=>L(Number(k.target.value)),style:{height:T.height,paddingLeft:T.px,paddingRight:T.px,fontSize:T.fontSize,borderRadius:"8px",border:`1px solid ${p.border}`,backgroundColor:p.surface,color:p.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:f.map(k=>t.jsx("option",{value:k,children:k},k))})]})]})]})}go.displayName="TkxPagination";const aa={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},la={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function ca({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 da({src:e,alt:r,fallback:n,placeholder:o="skeleton",fit:i="cover",ratio:l="auto",radius:c="none",caption:d,lazy:u=!1,preview:f=!1,className:s,style:m,...p}){const x=U(),y=te(),[v,b]=a.useState(!1),[g,w]=a.useState(!1),[S,M]=a.useState(!1),N=a.useRef(null),j=R(e),L=r?R(r):"",I=d?R(d):"",T=la[c];a.useEffect(()=>{var V;(V=N.current)!=null&&V.complete&&b(!0)},[]);const $=a.useCallback(()=>b(!0),[]),z=a.useCallback(()=>w(!0),[]),E=a.useCallback(()=>{f&&!g&&M(!0)},[f,g]),C=a.useCallback(()=>M(!1),[]);a.useEffect(()=>{if(!S)return;const V=Q=>{Q.key==="Escape"&&C()};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[S,C]);const k=o==="skeleton"&&!v&&!g,A=k&&!y?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},D=g?null:t.jsx("img",{ref:N,src:j,alt:L||void 0,role:L?void 0:"img","aria-label":L?void 0:"Image",loading:u?"lazy":void 0,onLoad:$,onError:z,onClick:f?E:void 0,className:ae(h("block w-full h-full"),f&&!g?h("cursor-pointer"):""),style:{objectFit:i,borderRadius:T,opacity:v?1:0,transition:y?"none":"opacity 200ms ease",position:l==="auto"?void 0:"absolute",inset:l==="auto"?void 0:0},...p}),O=g?n?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{role:"img","aria-label":L||"Image failed to load",className:h("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:x.surfaceAlt,borderRadius:T,color:x.textMuted,minHeight:"80px"},children:[t.jsx(ca,{color:x.textMuted,size:32}),t.jsx("span",{className:h("text-xs"),style:{color:x.textMuted},children:"Failed to load"})]}):null,W=k?t.jsx("div",{"aria-hidden":"true",style:{position:l==="auto"?void 0:"absolute",inset:l==="auto"?void 0:0,width:"100%",height:l==="auto"?"100%":void 0,minHeight:l==="auto"?"80px":void 0,borderRadius:T,backgroundColor:x.surfaceAlt,...A}}):null,H=l==="auto"?t.jsxs("div",{className:h("relative w-full"),style:{borderRadius:T},children:[W,D,O]}):t.jsxs("div",{className:h("relative w-full overflow-hidden"),style:{paddingBottom:aa[l],borderRadius:T},children:[W,D,O]}),B=I?t.jsxs("figure",{className:h("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:T},children:[H,t.jsx("figcaption",{className:h("text-sm text-center"),style:{color:x.textMuted},children:I})]}):H,P=t.jsx("div",{className:ae(h("inline-block w-full"),s),style:m,children:B}),F=S&&typeof document<"u"?Ne.createPortal(t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":L||"Image preview",className:h("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:C,children:[t.jsx("div",{"aria-hidden":"true",className:h("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),t.jsx("img",{src:j,alt:L||"Full-size preview",onClick:V=>V.stopPropagation(),className:h("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:C,className:h("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:[P,F]})}function Ur(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ua({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 fa=0;function pa(){return`tkx-file-${++fa}`}function xa({accept:e,multiple:r=!1,maxSize:n,maxFiles:o,onChange:i,onError:l,label:c="Upload files",hint:d,isDisabled:u=!1,preview:f=!0,dragDrop:s=!0,variant:m="dropzone"}){const p=U(),x=te(),y=a.useId(),v=a.useRef(null),[b,g]=a.useState(!1),[w,S]=a.useState([]);a.useEffect(()=>()=>{w.forEach(W=>{W.objectUrl&&URL.revokeObjectURL(W.objectUrl)})},[]);const M=a.useCallback(W=>{let H=0;const B=setInterval(()=>{H+=Math.floor(Math.random()*20)+10,H>=100&&(H=100,clearInterval(B)),S(P=>P.map(F=>F.id===W?{...F,progress:H}:F))},100)},[]),N=a.useCallback(W=>{if(n&&W.size>n)return`"${R(W.name)}" exceeds max size of ${Ur(n)}`;if(e&&!e.split(",").map(P=>P.trim()).some(P=>P.startsWith(".")?W.name.toLowerCase().endsWith(P.toLowerCase()):P.endsWith("/*")?W.type.startsWith(P.slice(0,-1)):W.type===P))return`"${R(W.name)}" is not an accepted file type`},[e,n]),j=a.useCallback(W=>{const H=o?o-w.length:1/0;if(H<=0){l==null||l(`Maximum of ${o} file${o===1?"":"s"} allowed`);return}const P=W.slice(0,H).map(F=>{const V=N(F),Q=f&&F.type.startsWith("image/")&&!V?URL.createObjectURL(F):void 0;return{file:F,id:pa(),objectUrl:Q,progress:0,error:V}});S(F=>{const V=r?[...F,...P]:P,Q=V.filter(re=>!re.error).map(re=>re.file);return i==null||i(Q),V}),P.forEach(F=>{F.error&&(l==null||l(F.error))}),P.forEach(F=>{F.error||M(F.id)})},[w.length,o,r,i,l,f,M,N]),L=a.useCallback(W=>{const H=Array.from(W.target.files??[]);H.length&&j(H),W.target.value=""},[j]),I=a.useCallback(W=>{if(W.preventDefault(),g(!1),u)return;const H=Array.from(W.dataTransfer.files);H.length&&j(H)},[u,j]),T=a.useCallback(W=>{W.preventDefault(),u||g(!0)},[u]),$=a.useCallback(()=>g(!1),[]),z=a.useCallback(W=>{S(H=>{const B=H.find(F=>F.id===W);B!=null&&B.objectUrl&&URL.revokeObjectURL(B.objectUrl);const P=H.filter(F=>F.id!==W);return i==null||i(P.filter(F=>!F.error).map(F=>F.file)),P})},[i]),E=a.useCallback(()=>{var W;u||(W=v.current)==null||W.click()},[u]),C=b?p.primary:p.border,k=R(c),A=d?R(d):"",D=t.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":k,"aria-describedby":d?y:void 0,"aria-disabled":u,onClick:E,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),E())},onDrop:s?I:void 0,onDragOver:s?T:void 0,onDragLeave:s?$:void 0,className:h("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${C}`,backgroundColor:b?`${p.primary}10`:p.surface,cursor:u?"not-allowed":"pointer",opacity:u?.5:1,transition:x?"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:b?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:h("text-center"),children:[t.jsx("p",{className:h("m-0 text-sm font-medium"),style:{color:p.text},children:b?"Drop files here":k}),A&&t.jsx("p",{id:y,className:h("m-0 text-xs mt-1"),style:{color:p.textMuted},children:A})]})]}),O=t.jsxs("button",{type:"button",disabled:u,onClick:E,"aria-describedby":d?y:void 0,className:h("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"})]}),k,d&&t.jsx("span",{id:y,className:h("sr-only"),children:A})]});return t.jsxs("div",{className:h("flex flex-col gap-3 w-full font-sans"),children:[t.jsx("input",{ref:v,type:"file",accept:e,multiple:r,disabled:u,onChange:L,className:h("sr-only"),tabIndex:-1,"aria-hidden":"true"}),m==="dropzone"?D:O,w.length>0&&t.jsx("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:h("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(W=>t.jsxs("li",{className:h("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:p.surfaceAlt,border:`1px solid ${W.error?p.danger:p.border}`},children:[t.jsxs("div",{className:h("flex items-center gap-3"),children:[W.objectUrl&&f?t.jsx("img",{src:W.objectUrl,alt:R(W.file.name),className:h("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):t.jsx("span",{style:{flexShrink:0},children:t.jsx(ua,{mimeType:W.file.type,color:W.error?p.danger:p.textMuted})}),t.jsxs("div",{className:h("flex flex-col gap-0.5 flex-1 min-w-0"),children:[t.jsx("span",{className:h("text-sm font-medium truncate"),style:{color:W.error?p.danger:p.text},title:W.file.name,children:R(W.file.name)}),t.jsxs("span",{className:h("text-xs"),style:{color:p.textMuted},children:[Ur(W.file.size),W.error&&` — ${W.error}`]})]}),t.jsx("button",{type:"button","aria-label":`Remove ${R(W.file.name)}`,onClick:()=>z(W.id),className:h("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"})]})})]}),!W.error&&W.progress<100&&t.jsx("div",{className:h("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:`${W.progress}%`,transition:x?"none":"width 100ms ease"}})})]},W.id))})]})}const ha={sm:16,md:24,lg:32,xl:40};function ma({size:e,filled:r,color:n,halfFilled:o,id:i}){const l=i?`hg-${i}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&l&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,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:o&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ga({size:e,filled:r,color:n,halfFilled:o,id:i}){const l=i?`hg-${i}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&l&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,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:o&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ba({size:e,filled:r,color:n,halfFilled:o,id:i}){const l=i?`hg-${i}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&l&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,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:o&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5})]})}function ya({type:e,size:r,filled:n,color:o,halfFilled:i,uid:l}){const c={size:r,filled:n,color:o,halfFilled:i,id:l};return e==="heart"?t.jsx(ga,{...c}):e==="circle"?t.jsx(ba,{...c}):t.jsx(ma,{...c})}function Kr(e,r,n){return Math.min(n,Math.max(r,e))}function va(e,r){return r===1?Math.round(e):Math.round(e*2)/2}function Xr(e,r,n){if(n===1)return r+1;const o=e.currentTarget.getBoundingClientRect(),i=o.left+o.width/2;return e.clientX<i?r+.5:r+1}function ka({value:e,defaultValue:r=0,onChange:n,max:o=5,precision:i=1,size:l="md",isReadOnly:c=!1,isDisabled:d=!1,label:u,showValue:f=!1,colorScheme:s="warning",emptyIcon:m="star",filledIcon:p="star"}){const x=U(),y=te(),v=a.useId(),b=e!==void 0,[g,w]=a.useState(r),[S,M]=a.useState(null),N=a.useRef(null),j=b?e??0:g,L=S??j,T={warning:x.warning,primary:x.primary,danger:x.danger}[s]??x.warning,$=ha[l],z=!c&&!d,E=a.useCallback(W=>{b||w(W),n==null||n(W)},[b,n]),C=a.useCallback((W,H)=>{z&&M(Xr(W,H,i))},[z,i]),k=a.useCallback(()=>{z&&M(null)},[z]),A=a.useCallback((W,H)=>{if(!z)return;const B=Xr(W,H,i);E(B===j?0:B)},[z,i,j,E]),D=a.useCallback(W=>{if(!z)return;const H=i;let B=j;if(W.key==="ArrowRight"||W.key==="ArrowUp")W.preventDefault(),B=Kr(j+H,0,o);else if(W.key==="ArrowLeft"||W.key==="ArrowDown")W.preventDefault(),B=Kr(j-H,0,o);else if(W.key==="Home")W.preventDefault(),B=0;else if(W.key==="End")W.preventDefault(),B=o;else return;B=va(B,i),E(B)},[z,j,o,i,E]),O=u?R(u):"Rating";return t.jsxs("div",{className:ae(h("inline-flex items-center gap-2 font-sans"),d?h("opacity-50"):""),children:[t.jsx("div",{ref:N,role:"radiogroup","aria-label":O,"aria-disabled":d,"aria-readonly":c,tabIndex:z?0:-1,onKeyDown:D,onMouseLeave:k,className:h("flex items-center gap-0.5 outline-none"),style:{cursor:z?"pointer":"default"},children:Array.from({length:o},(W,H)=>{const B=H+1,P=H+.5,F=L>=B,V=!F&&i===.5&&L>=P,Q=`${v}-${H}`;return t.jsx("span",{role:"radio","aria-checked":i===.5&&j===P||j===B,"aria-label":i===.5?`${P} star${P!==1?"s":""} / ${B} star${B!==1?"s":""}`:`${B} star${B!==1?"s":""}`,tabIndex:-1,onMouseMove:re=>C(re,H),onClick:re=>A(re,H),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:S!==null&&L>=P&&z?"scale(1.15)":"scale(1)"},children:t.jsx(ya,{type:F||V?p:m,size:$,filled:F,halfFilled:V,color:F||V?T:x.border,uid:V?Q:void 0})},H)})}),f&&t.jsxs("span",{className:h("text-sm tabular-nums"),style:{color:x.textMuted},"aria-live":"polite","aria-atomic":"true",children:[j%1===0?j.toFixed(0):j.toFixed(1)," / ",o]})]})}let qr=!1;function wa(){if(qr||typeof document>"u")return;qr=!0;const e=document.createElement("style");e.textContent=`
24
24
  @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }
25
25
  @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }
26
26
  .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }
27
27
  .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }
28
28
  .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }
29
29
  .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }
30
- `,document.head.appendChild(e)}function mi(){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 gi(){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 Pn(){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 Bn({message:e,showTimestamp:r,avatarUser:n,avatarAssistant:i}){const s=ee(),a=ye(),{role:l,content:d,timestamp:u,isStreaming:x,error:o}=e,m=B(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",y=h?n??t.jsx(mi,{}):i??t.jsx(gi,{}),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:y}),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 bi({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=ye(),[p,h]=c.useState(""),y=c.useRef(null),z=c.useRef(null);c.useEffect(()=>{hi()},[]),c.useEffect(()=>{const N=y.current;N&&N.scrollTo({top:N.scrollHeight,behavior:m?"auto":"smooth"})},[e,n,m]);const v=c.useCallback(()=>{const N=p.trim();!N||!r||(r(N),h(""),z.current&&(z.current.style.height="auto"))},[p,r]),$=c.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),v())},[v]),w=c.useCallback(N=>{const T=s?N.target.value.slice(0,s):N.target.value;h(T);const j=z.current;if(j){j.style.height="auto";const Y=24*4+24;j.style.height=`${Math.min(j.scrollHeight,Y)}px`}},[s]),C=p.trim().length>0&&!n,I=typeof u=="number"?`${u}px`:u,R=x==="floating",M=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:w,onKeyDown:$,placeholder:B(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:v,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:y,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(Bn,{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(Pn,{})]})]})}),M]})}const yi={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},vi={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},ki={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},wi={sm:12,md:14,lg:16};function ji(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 Wn({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=ye(),h=ji(n,e),y=typeof d=="string"?B(d):d,z=wi[r],v=b("inline-flex items-center font-medium rounded-full select-none",yi[r],vi[r],ki[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(v,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?$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o($))}:void 0,...m,children:[s&&t.jsx("span",{"aria-hidden":"true",className:b("shrink-0 flex items-center"),children:s}),t.jsx("span",{children:y}),i&&!a&&t.jsx("button",{type:"button","aria-label":`Remove ${typeof d=="string"?d:"tag"}`,onClick:$=>{$.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 Si({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=ye(),[y,z]=c.useState(r),[v,$]=c.useState(""),[w,C]=c.useState(null),I=c.useRef(null),R=e!==void 0,M=R?e:y,N=c.useCallback(S=>{R||z(S),n==null||n(S)},[R,n]),T=c.useCallback(S=>{const F=S.trim();if(F){if(s!==void 0&&M.length>=s){C(`Maximum ${s} tags allowed`);return}if(!a&&M.includes(F)){C("Duplicate tags are not allowed");return}if(l){const D=l(F);if(D===!1){C("Invalid tag");return}if(typeof D=="string"){C(D);return}}C(null),N([...M,F]),$("")}},[M,s,a,l,N]),j=c.useCallback(S=>{const F=M.filter((D,V)=>V!==S);N(F),C(null)},[M,N]),k=c.useCallback(S=>{S.key==="Enter"||S.key===","?(S.preventDefault(),T(v)):S.key==="Backspace"&&v===""&&M.length>0&&j(M.length-1)},[v,M,T,j]),Y=c.useCallback(S=>{const F=S.target.value;F.endsWith(",")?T(F.slice(0,-1)):($(F),w&&C(null))},[T,w]),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 S;return(S=I.current)==null?void 0:S.focus()},children:B(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 ${w?p.danger:p.border}`,opacity:m?.55:1,minHeight:u==="sm"?36:u==="lg"?48:40},onClick:()=>{var S;return!m&&((S=I.current)==null?void 0:S.focus())},children:[M.map((S,F)=>t.jsx(Wn,{size:u,variant:"subtle",colorScheme:d,onRemove:m?void 0:()=>j(F),isDisabled:m,children:S},`${S}-${F}`)),(!s||M.length<s)&&!m&&t.jsx("input",{ref:I,type:"text",value:v,onChange:Y,onKeyDown:k,placeholder:M.length===0?B(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"})]}),w&&t.jsx("p",{className:b("text-xs"),style:{color:p.danger},role:"alert",children:w}),o&&!w&&t.jsx("p",{className:b("text-xs"),style:{color:p.textMuted},children:B(o)})]})}let Wr=!1;function $i(){if(Wr||typeof document>"u")return;Wr=!0;const e=document.createElement("style");e.textContent=`
30
+ `,document.head.appendChild(e)}function ja(){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 Sa(){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 bo(){const e=U();return t.jsxs("div",{className:h("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 yo({message:e,showTimestamp:r,avatarUser:n,avatarAssistant:o}){const i=U(),l=te(),{role:c,content:d,timestamp:u,isStreaming:f,error:s}=e,m=R(d),p=u?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(u):null;if(c==="system")return t.jsx("div",{role:"listitem",className:h("flex justify-center my-2"),children:t.jsx("p",{className:h("text-xs italic px-3 py-1 rounded-full"),style:{color:i.textMuted,backgroundColor:i.surfaceAlt},children:m})});const x=c==="user",y=x?n??t.jsx(ja,{}):o??t.jsx(Sa,{}),v=x?{backgroundColor:i.primary,color:i.bg}:{backgroundColor:i.surface,color:i.text,border:`1px solid ${s?i.danger:i.border}`};return s&&(v.borderColor=i.danger,v.borderWidth="2px"),t.jsxs("div",{role:"listitem",className:h("flex gap-2 mb-4",x?"flex-row-reverse":"flex-row"),children:[t.jsx("div",{className:h("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:x?i.primary:i.secondary},children:y}),t.jsxs("div",{className:h("flex flex-col gap-1 max-w-[75%]",x?"items-end":"items-start"),children:[t.jsxs("div",{className:ae(h("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),f&&!l?"tkx-cursor":""),style:v,children:[m,s&&t.jsx("span",{"aria-label":"Error",style:{marginLeft:6,color:i.danger},children:"⚠"})]}),r&&p&&t.jsx("span",{className:h("text-[10px]"),style:{color:i.textMuted},children:p})]})]})}function $a({messages:e,onSend:r,isLoading:n=!1,placeholder:o="Type a message…",maxLength:i,showTimestamps:l=!1,avatarUser:c,avatarAssistant:d,height:u=480,inputPosition:f="bottom"}){const s=U(),m=te(),[p,x]=a.useState(""),y=a.useRef(null),v=a.useRef(null);a.useEffect(()=>{wa()},[]),a.useEffect(()=>{const L=y.current;L&&L.scrollTo({top:L.scrollHeight,behavior:m?"auto":"smooth"})},[e,n,m]);const b=a.useCallback(()=>{const L=p.trim();!L||!r||(r(L),x(""),v.current&&(v.current.style.height="auto"))},[p,r]),g=a.useCallback(L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),b())},[b]),w=a.useCallback(L=>{const I=i?L.target.value.slice(0,i):L.target.value;x(I);const T=v.current;if(T){T.style.height="auto";const z=24*4+24;T.style.height=`${Math.min(T.scrollHeight,z)}px`}},[i]),S=p.trim().length>0&&!n,M=typeof u=="number"?`${u}px`:u,N=f==="floating",j=t.jsxs("div",{className:h("flex flex-col gap-1 p-3"),style:N?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:s.surface,border:`1px solid ${s.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${s.border}`,backgroundColor:s.surface},children:[t.jsxs("div",{className:h("flex items-end gap-2"),children:[t.jsx("textarea",{ref:v,rows:1,value:p,onChange:w,onKeyDown:g,placeholder:R(o),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:h("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:s.text,caretColor:s.primary,minHeight:32,maxHeight:120}}),t.jsx("button",{onClick:b,disabled:!S,"aria-label":"Send message",className:h("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!m&&"transition-opacity duration-150",S?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:s.primary,color:s.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"})})})]}),i&&t.jsxs("div",{className:h("text-right text-[10px]"),style:{color:s.textMuted},children:[p.length,"/",i]})]});return t.jsxs("div",{className:h("flex flex-col overflow-hidden rounded-2xl"),style:{height:M,backgroundColor:s.bg,border:`1px solid ${s.border}`,position:"relative"},children:[t.jsx("div",{ref:y,role:"log","aria-live":"polite","aria-label":"Chat messages",className:h("flex-1 overflow-y-auto p-4"),style:{paddingBottom:N?80:void 0},children:t.jsxs("div",{role:"list",children:[e.map(L=>t.jsx(yo,{message:L,showTimestamp:l,avatarUser:c,avatarAssistant:d},L.id)),n&&t.jsxs("div",{role:"listitem",className:h("flex gap-2 mb-4"),children:[t.jsx("div",{className:h("w-8 h-8 shrink-0")}),t.jsx(bo,{})]})]})}),j]})}const Ma={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Ca={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},Ta={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},Ea={sm:12,md:14,lg:16};function Ia(e,r){const n=U(),i={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:i,color:n.bg,border:"transparent"}:r==="subtle"?{bg:`${i}22`,color:i,border:"transparent"}:{bg:"transparent",color:i,border:i}}function vo({variant:e="subtle",size:r="md",colorScheme:n="default",onRemove:o,leftIcon:i,isDisabled:l=!1,clickable:c=!1,children:d,className:u,style:f,onClick:s,...m}){U();const p=te(),x=Ia(n,e),y=typeof d=="string"?R(d):d,v=Ea[r],b=h("inline-flex items-center font-medium rounded-full select-none",Ma[r],Ca[r],Ta[r],l?"opacity-50 cursor-not-allowed":c?"cursor-pointer":"cursor-default",c&&!p&&"transition-opacity duration-150");return t.jsxs("span",{role:c?"button":void 0,tabIndex:c&&!l?0:void 0,"aria-disabled":l||void 0,className:ae(b,u),style:{backgroundColor:x.bg,color:x.color,border:`1px solid ${x.border==="transparent"?"transparent":x.border}`,...f},onClick:l?void 0:s,onKeyDown:c&&!l&&s?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s(g))}:void 0,...m,children:[i&&t.jsx("span",{"aria-hidden":"true",className:h("shrink-0 flex items-center"),children:i}),t.jsx("span",{children:y}),o&&!l&&t.jsx("button",{type:"button","aria-label":`Remove ${typeof d=="string"?d:"tag"}`,onClick:g=>{g.stopPropagation(),o()},className:h("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:v+4,height:v+4,color:x.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:t.jsx("svg",{width:v,height:v,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 Na({value:e,defaultValue:r=[],onChange:n,placeholder:o="Add tag…",maxTags:i,allowDuplicates:l=!1,validate:c,colorScheme:d="primary",size:u="md",label:f,hint:s,isDisabled:m=!1}){const p=U(),x=te(),[y,v]=a.useState(r),[b,g]=a.useState(""),[w,S]=a.useState(null),M=a.useRef(null),N=e!==void 0,j=N?e:y,L=a.useCallback(k=>{N||v(k),n==null||n(k)},[N,n]),I=a.useCallback(k=>{const A=k.trim();if(A){if(i!==void 0&&j.length>=i){S(`Maximum ${i} tags allowed`);return}if(!l&&j.includes(A)){S("Duplicate tags are not allowed");return}if(c){const D=c(A);if(D===!1){S("Invalid tag");return}if(typeof D=="string"){S(D);return}}S(null),L([...j,A]),g("")}},[j,i,l,c,L]),T=a.useCallback(k=>{const A=j.filter((D,O)=>O!==k);L(A),S(null)},[j,L]),$=a.useCallback(k=>{k.key==="Enter"||k.key===","?(k.preventDefault(),I(b)):k.key==="Backspace"&&b===""&&j.length>0&&T(j.length-1)},[b,j,I,T]),z=a.useCallback(k=>{const A=k.target.value;A.endsWith(",")?I(A.slice(0,-1)):(g(A),w&&S(null))},[I,w]),E=u==="sm"?"6px 8px":u==="lg"?"10px 12px":"8px 10px",C=u==="sm"?11:u==="lg"?14:12;return t.jsxs("div",{className:h("flex flex-col gap-1.5"),children:[f&&t.jsx("label",{className:h("text-sm font-medium"),style:{color:p.text},onClick:()=>{var k;return(k=M.current)==null?void 0:k.focus()},children:R(f)}),t.jsxs("div",{className:h("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!x&&"transition-colors duration-150"),style:{padding:E,backgroundColor:p.surface,border:`1.5px solid ${w?p.danger:p.border}`,opacity:m?.55:1,minHeight:u==="sm"?36:u==="lg"?48:40},onClick:()=>{var k;return!m&&((k=M.current)==null?void 0:k.focus())},children:[j.map((k,A)=>t.jsx(vo,{size:u,variant:"subtle",colorScheme:d,onRemove:m?void 0:()=>T(A),isDisabled:m,children:k},`${k}-${A}`)),(!i||j.length<i)&&!m&&t.jsx("input",{ref:M,type:"text",value:b,onChange:z,onKeyDown:$,placeholder:j.length===0?R(o):"",disabled:m,className:h("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:C,color:p.text,caretColor:p.primary},"aria-label":f??"Tag input"})]}),w&&t.jsx("p",{className:h("text-xs"),style:{color:p.danger},role:"alert",children:w}),s&&!w&&t.jsx("p",{className:h("text-xs"),style:{color:p.textMuted},children:R(s)})]})}let Zr=!1;function za(){if(Zr||typeof document>"u")return;Zr=!0;const e=document.createElement("style");e.textContent=`
31
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
32
  @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }
33
33
  @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }
34
34
  .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }
35
35
  .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }
36
36
  .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }
37
- `,document.head.appendChild(e)}function Mi(e="pending"){const r=ee();return{completed:r.success,active:r.primary,pending:r.border,error:r.danger}[e]}function Xt({status:e="pending",icon:r,size:n=28}){const i=ee(),s=ye(),a=Mi(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 Hr({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 Vr({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 qt({item:e,compact:r}){const n=ee(),i=e.timestamp?B(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"?B(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"?B(e.description):e.description})]})}function Ci({items:e,variant:r="default",orientation:n="vertical",connectorStyle:i="solid"}){const s=ee(),a=ye(),l=c.useRef(!1);c.useEffect(()=>{$i(),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",y=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(Vr,{style:i,color:y,animate:d}),t.jsx(Xt,{status:h,icon:m.icon,size:24}),!z&&t.jsx(Vr,{style:i,color:y,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"?B(m.title):m.title}),m.timestamp&&t.jsx("div",{className:b("text-[10px] mt-0.5"),style:{color:s.textMuted},children:B(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",y=p===e.length-1,z=h==="completed"?s.success:s.border,v=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",v?"":"invisible"),children:v&&t.jsx(qt,{item:m,compact:u})}),t.jsxs("div",{className:b("flex flex-col items-center"),children:[t.jsx(Xt,{status:h,icon:m.icon,size:28}),!y&&t.jsx(Hr,{style:i,color:z,animate:d})]}),t.jsx("div",{className:b("flex-1 flex flex-col items-start pl-4",v?"invisible":""),children:!v&&t.jsx(qt,{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(Xt,{status:h,icon:m.icon,size:u?22:28}),!y&&t.jsx(Hr,{style:i,color:z,animate:d})]}),t.jsx("div",{className:b("flex-1 min-w-0 pt-0.5"),children:t.jsx(qt,{item:m,compact:u})})]},m.id)})})}function Or(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 Ti(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 Ii=`
37
+ `,document.head.appendChild(e)}function La(e="pending"){const r=U();return{completed:r.success,active:r.primary,pending:r.border,error:r.danger}[e]}function rr({status:e="pending",icon:r,size:n=28}){const o=U(),i=te(),l=La(e),c=e==="active";return t.jsx("div",{className:ae(h("relative flex items-center justify-center rounded-full shrink-0 z-10"),c&&!i?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:e==="pending"?o.surface:l,border:`2px solid ${l}`,color:e==="pending"?l:o.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"?l:o.bg,display:"block"}})})}function Gr({style:e,color:r,animate:n}){return U(),t.jsx("div",{className:ae(h("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 Jr({style:e,color:r,animate:n}){return t.jsx("div",{className:ae(h("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${r}`,borderColor:r},"aria-hidden":"true"})}function nr({item:e,compact:r}){const n=U(),o=e.timestamp?R(e.timestamp):null;return t.jsxs("div",{className:h("flex flex-col gap-0.5",r?"pb-3":"pb-5"),children:[t.jsxs("div",{className:h("flex items-center gap-2 flex-wrap"),children:[t.jsx("span",{className:h("text-sm font-semibold leading-snug"),style:{color:n.text},children:typeof e.title=="string"?R(e.title):e.title}),e.badge&&t.jsx("span",{children:e.badge}),o&&t.jsx("span",{className:h("text-[11px] ml-auto"),style:{color:n.textMuted},children:o})]}),e.description&&!r&&t.jsx("div",{className:h("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:typeof e.description=="string"?R(e.description):e.description})]})}function Aa({items:e,variant:r="default",orientation:n="vertical",connectorStyle:o="solid"}){const i=U(),l=te(),c=a.useRef(!1);a.useEffect(()=>{za(),c.current=!0},[]);const d=!l,u=r==="compact",f=r==="alternating"&&n==="vertical";return n==="horizontal"?t.jsx("div",{role:"list","aria-label":"Timeline",className:h("flex items-start w-full overflow-x-auto"),children:e.map((m,p)=>{const x=m.status??"pending",y=x==="completed"?i.success:i.border,v=p===e.length-1;return t.jsx("div",{role:"listitem",className:h("flex items-start flex-1 min-w-0"),children:t.jsxs("div",{className:h("flex flex-col items-center flex-1 min-w-0"),children:[t.jsxs("div",{className:h("flex items-center w-full"),children:[p>0&&t.jsx(Jr,{style:o,color:y,animate:d}),t.jsx(rr,{status:x,icon:m.icon,size:24}),!v&&t.jsx(Jr,{style:o,color:y,animate:d})]}),t.jsxs("div",{className:h("mt-2 px-1 text-center min-w-0 w-full"),children:[t.jsx("div",{className:h("text-xs font-semibold truncate"),style:{color:i.text},children:typeof m.title=="string"?R(m.title):m.title}),m.timestamp&&t.jsx("div",{className:h("text-[10px] mt-0.5"),style:{color:i.textMuted},children:R(m.timestamp)})]})]})},m.id)})}):t.jsx("div",{role:"list","aria-label":"Timeline",className:h("flex flex-col"),children:e.map((m,p)=>{const x=m.status??"pending",y=p===e.length-1,v=x==="completed"?i.success:i.border,b=f&&p%2===0;return f?t.jsxs("div",{role:"listitem",className:h("flex items-stretch gap-0"),children:[t.jsx("div",{className:h("flex-1 flex flex-col items-end pr-4",b?"":"invisible"),children:b&&t.jsx(nr,{item:m,compact:u})}),t.jsxs("div",{className:h("flex flex-col items-center"),children:[t.jsx(rr,{status:x,icon:m.icon,size:28}),!y&&t.jsx(Gr,{style:o,color:v,animate:d})]}),t.jsx("div",{className:h("flex-1 flex flex-col items-start pl-4",b?"invisible":""),children:!b&&t.jsx(nr,{item:m,compact:u})})]},m.id):t.jsxs("div",{role:"listitem",className:h("flex gap-3 items-stretch"),children:[t.jsxs("div",{className:h("flex flex-col items-center"),children:[t.jsx(rr,{status:x,icon:m.icon,size:u?22:28}),!y&&t.jsx(Gr,{style:o,color:v,animate:d})]}),t.jsx("div",{className:h("flex-1 min-w-0 pt-0.5"),children:t.jsx(nr,{item:m,compact:u})})]},m.id)})})}function Qr(e,r,n,o){const i=window.innerWidth,l=window.innerHeight,c=6;let d=0,u=0,f="top left";switch(r){case"bottom-start":d=e.bottom+c,u=e.left,f="top left",d+o>l&&e.top-c-o>0&&(d=e.top-c-o,f="bottom left"),u+n>i&&(u=Math.max(0,i-n-8));break;case"bottom-end":d=e.bottom+c,u=e.right-n,f="top right",d+o>l&&e.top-c-o>0&&(d=e.top-c-o,f="bottom right"),u<0&&(u=8);break;case"top-start":d=e.top-c-o,u=e.left,f="bottom left",d<0&&(d=e.bottom+c,f="top left"),u+n>i&&(u=Math.max(0,i-n-8));break;case"top-end":d=e.top-c-o,u=e.right-n,f="bottom right",d<0&&(d=e.bottom+c,f="top right"),u<0&&(u=8);break;case"right-start":d=e.top,u=e.right+c,f="top left",u+n>i&&(u=e.left-c-n,f="top right"),d+o>l&&(d=Math.max(8,l-o-8));break;case"left-start":d=e.top,u=e.left-c-n,f="top right",u<0&&(u=e.right+c,f="top left"),d+o>l&&(d=Math.max(8,l-o-8));break}return{top:d+window.scrollY,left:u+window.scrollX,transformOrigin:f}}function Ra(e,r,n){const o=window.innerWidth,i=window.innerHeight,l=4;let c=e.right+l,d="top left";c+r>o&&(c=e.left-l-r,d="top right");let u=e.top;return u+n>i&&(u=Math.max(8,i-n-8)),{top:u+window.scrollY,left:c+window.scrollX,transformOrigin:d}}const Da=`
38
38
  @keyframes tkxMenuIn {
39
39
  from { opacity: 0; transform: scale(0.94); }
40
40
  to { opacity: 1; transform: scale(1); }
@@ -53,7 +53,7 @@
53
53
  animation: tkxMenuInReduced 100ms ease forwards;
54
54
  }
55
55
  }
56
- `;function Ei(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 zi({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 Ni({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 Ri({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 Ai(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 Hn({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),[y,z]=c.useState(""),v=c.useRef(null),$=Ai(e);c.useEffect(()=>{var T;(T=h.current)==null||T.focus()},[]),c.useEffect(()=>{var j;if(d<0)return;const T=(j=h.current)==null?void 0:j.querySelector(`[data-midx="${d}"]`);T==null||T.scrollIntoView({block:"nearest"})},[d]);const w=c.useCallback(T=>{var j,k,Y,f,g,S;if(T.kind==="action"){if(T.item.disabled)return;(k=(j=T.item).onClick)==null||k.call(j),s()}else if(T.kind==="check"){if(T.item.disabled)return;(f=(Y=T.item).onChange)==null||f.call(Y,!T.item.checked)}else if(T.kind==="radio"){if(T.item.disabled)return;(S=(g=T.item).onChange)==null||S.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 j;switch(T.key){case"ArrowDown":T.preventDefault(),u(k=>{const Y=k+1;return Y<$.length?Y:0});break;case"ArrowUp":T.preventDefault(),u(k=>{const Y=k-1;return Y>=0?Y:$.length-1});break;case"Home":T.preventDefault(),u(0);break;case"End":T.preventDefault(),u($.length-1);break;case"Enter":case" ":T.preventDefault(),d>=0&&$[d]&&w($[d]);break;case"Escape":T.preventDefault(),a?i():s();break;case"Tab":T.preventDefault(),s();break;case"ArrowRight":T.preventDefault(),d>=0&&((j=$[d])==null?void 0:j.kind)==="submenu"&&o($[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){v.current&&clearTimeout(v.current);const j=y+T.toLowerCase();z(j);const k=$.findIndex(Y=>(Y.kind==="radio"?Y.item.options[Y.optionIdx].label:Y.item.label).toLowerCase().startsWith(j));k>=0&&u(k),v.current=setTimeout(()=>z(""),800)}function R(T,j){const k=j.getBoundingClientRect();o(T.id);const Y=Math.min(T.items.length*38+12,360);p(Ti(k,220,Y))}function M(){o(null),p(null)}const N=()=>{let T=-1;return e.map(j=>{if(j.type==="separator")return t.jsx("div",{role:"separator",style:{margin:(j.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:j.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:B(j.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"}})},j.id);if(j.type==="radio-group")return t.jsxs("div",{role:"group","aria-label":j.label,children:[j.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:B(j.label)}),j.options.map((D,V)=>{T++;const E=T,P=E===d,W=D.value===j.value,O=!!j.disabled,A=Ct(l,P,!1,O);return t.jsxs("div",{role:"menuitemradio","aria-checked":W,"aria-disabled":O||void 0,"data-midx":E,tabIndex:-1,style:A,onClick:()=>{var H;return!O&&((H=j.onChange)==null?void 0:H.call(j,D.value))},onMouseEnter:()=>!O&&u(E),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:W?t.jsx(Ni,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${l.border}`,display:"inline-block"}})}),D.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:D.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(D.label)})]},D.value)})]},j.id);if(j.type==="check"){T++;const D=T,V=D===d,E=!!j.disabled,P=Ct(l,V,!1,E);return t.jsxs("div",{role:"menuitemcheckbox","aria-checked":j.checked,"aria-disabled":E||void 0,"data-midx":D,tabIndex:-1,style:P,onClick:()=>{var W;return!E&&((W=j.onChange)==null?void 0:W.call(j,!j.checked))},onMouseEnter:()=>!E&&u(D),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:j.checked?t.jsx(zi,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),j.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:j.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(j.label)})]},j.id)}if(j.type==="submenu"){T++;const D=T,V=D===d,E=!!j.disabled,P=x===j.id,W=Ct(l,V||P,!1,E);return t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-disabled":E||void 0,"data-midx":D,tabIndex:-1,style:W,onMouseEnter:O=>{E||(u(D),R(j,O.currentTarget))},onMouseLeave:()=>{},onClick:()=>{E||o(P?null:j.id)},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:j.icon?t.jsx("span",{style:{display:"flex",color:l.textMuted},children:j.icon}):t.jsx("span",{style:{width:14}})}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(j.label)}),t.jsx(Ri,{color:l.textMuted})]}),P&&m&&Be.createPortal(t.jsx(Hn,{items:j.items,pos:m,panelId:`${n}-sub-${j.id}`,onClose:M,onCloseAll:s,isSubmenu:!0}),document.body)]},j.id)}const k=j;T++;const Y=T,f=Y===d,g=!!k.disabled,S=!!k.danger,F=Ct(l,f,S,g);return t.jsxs("div",{role:"menuitem","aria-disabled":g||void 0,"data-midx":Y,tabIndex:-1,style:F,onClick:()=>{var D;g||((D=k.onClick)==null||D.call(k),s())},onMouseEnter:()=>{g||(u(Y),M())},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:k.icon?t.jsx("span",{style:{display:"flex",color:S?l.danger:l.textMuted},children:k.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:B(k.label)}),k.description&&t.jsx("span",{style:{display:"block",fontSize:"12px",color:l.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(k.description)})]}),k.shortcut&&t.jsx("span",{style:{fontSize:"12px",color:l.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:B(k.shortcut)})]},k.id)})};return t.jsxs(t.Fragment,{children:[t.jsx("style",{children:Ii}),t.jsx("div",{ref:h,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:C,style:{...Ei(l,r),maxHeight:400,overflowY:"auto"},children:N()})]})}function Ct(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 Vn({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),y=c.useRef(null),z=c.useCallback(()=>{if(i)return;const w=y.current;if(!w)return;const C=w.getBoundingClientRect(),I=Math.min(r.length*38+12,360);h(Or(C,n,220,I)),m(!0),s==null||s()},[i,r.length,s,n]),v=c.useCallback(()=>{var w,C,I;m(!1),a==null||a(),(I=(C=(w=y.current)==null?void 0:w.firstElementChild)==null?void 0:C.focus)==null||I.call(C)},[a]);c.useEffect(()=>{if(!o)return;const w=C=>{var M;const I=C.target;if((M=y.current)!=null&&M.contains(I))return;const R=document.querySelectorAll(".tkx-menu-panel");for(const N of R)if(N.contains(I))return;v()};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[o,v]),c.useEffect(()=>{if(!o)return;const w=()=>{const C=y.current;if(!C)return;const I=C.getBoundingClientRect(),R=Math.min(r.length*38+12,360);h(Or(I,n,220,R))};return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[o,r.length,n]);const $=w=>{(w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),o||z()),w.key==="Escape"&&o&&(w.preventDefault(),v())};return t.jsxs("span",{ref:y,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?v():z(),onKeyDown:$,style:{display:"inline-flex",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none"},children:e}),o&&p&&Be.createPortal(t.jsx(Hn,{items:r,pos:p,panelId:x,onClose:v,onCloseAll:v}),document.body)]})}Vn.displayName="TkxMenu";const Di={sm:120,md:180,lg:240,xl:320};function Tt(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=v=>{var $;return(($=l.find(w=>w.type===v))==null?void 0:$.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"),y=d("year"),z=`${m}, ${p} ${h}, ${y}`;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 Li({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,y=r/2-4,{hours:z,minutes:v,seconds:$,milliseconds:w}=e,I=($+(s?0:w)/1e3)/60*360,R=v/60*360+$/60*6,M=z%12/12*360+v/60*30,N=(S,F)=>{const D=(S-90)*Math.PI/180;return{x:p+Math.cos(D)*F,y:h+Math.sin(D)*F}},T=s?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const S=(O,A)=>{const Q=-90+O*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=O>.5?1:0;return`M ${G.x} ${G.y} A ${A} ${A} 0 ${pe} 1 ${ne.x} ${ne.y}`},F=z%12/12+v/60/12,D=v/60+$/3600,V=($+(s?0:w/1e3))/60,E=y-2,P=y-10,W=y-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:P,fill:"none",stroke:x,strokeWidth:4}),i&&t.jsx("circle",{cx:p,cy:h,r:W,fill:"none",stroke:x,strokeWidth:3}),t.jsx("path",{d:S(F,E),fill:"none",stroke:a,strokeWidth:4,strokeLinecap:"round"}),t.jsx("path",{d:S(D,P),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),i&&t.jsx("path",{d:S(V,W),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(v).padStart(2,"0")]})]})}const j=N(M,y*.5),k=N(R,y*.75),Y=N(I,y*.85),f=N(I+180,y*.2),g=[];if(n==="classic"){for(let F=0;F<60;F++){const D=F/60*360,V=F%5===0,E=(D-90)*Math.PI/180,P=V?y-10:y-6,W=p+Math.cos(E)*y,O=h+Math.sin(E)*y,A=p+Math.cos(E)*P,H=h+Math.sin(E)*P;g.push(t.jsx("line",{x1:W,y1:O,x2:A,y2:H,stroke:V?d:u,strokeWidth:V?2:1,strokeLinecap:"round"},F))}const S=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:F,angle:D}of S){const V=(D-90)*Math.PI/180,E=y-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 S=0;S<12;S++){const D=(S/12*360-90)*Math.PI/180,V=y-8;g.push(t.jsx("circle",{cx:p+Math.cos(D)*V,cy:h+Math.sin(D)*V,r:S%3===0?3:2,fill:S%3===0?d:u},S))}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:y,fill:o,stroke:x,strokeWidth:2}),g,t.jsx("line",{x1:p,y1:h,x2:j.x,y2:j.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:k.x,y2:k.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:Y.x,y2:Y.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 Yr({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 y=o,z="";r==="12h"&&(z=o>=12?"PM":"AM",y=o%12||12);const v=a*.2,$={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:v,color:l,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[t.jsx("span",{children:String(y).padStart(2,"0")}),t.jsx("span",{style:$,children:":"}),t.jsx("span",{children:String(m).padStart(2,"0")}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:$,children:":"}),t.jsx("span",{children:String(p).padStart(2,"0")})]}),r==="12h"&&t.jsx("span",{style:{fontSize:v*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:v*.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:B(s)})]})}function On({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=ye(),[h,y]=c.useState(()=>Tt(a)),[z,v]=c.useState(()=>l?Tt(l):null),[$,w]=c.useState(!0),[C,I]=c.useState(!1),R=c.useRef(null);c.useEffect(()=>{I(!0)},[]),c.useEffect(()=>{const k=()=>{y(Tt(a)),l&&v(Tt(l))};k();const Y=setInterval(k,1e3);return()=>clearInterval(Y)},[a,l]),c.useEffect(()=>(R.current=setInterval(()=>{w(k=>!k)},500),()=>{R.current&&clearInterval(R.current)}),[]);const M=Di[r],N=e==="analog"||e==="both",T=e==="digital"||e==="both",j={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:e==="both"?`${M*.06}px`:0,opacity:C?1:0,transition:p?"none":"opacity 0.4s ease",...o};return t.jsxs("div",{className:x,style:j,role:"timer","aria-live":"off",children:[N&&t.jsx(Li,{time:h,size:M,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(Yr,{time:h,format:s,showSeconds:n,showDate:i,label:d,size:M,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:$}),z&&l&&t.jsx("div",{style:{marginTop:M*.04,padding:`${M*.03}px ${M*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:t.jsx(Yr,{time:z,format:s,showSeconds:!1,showDate:!1,label:l,size:M*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:$})})]})}On.displayName="TkxClock";function Zt(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 Le({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 Yn({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:y=[],startTime:z,onPlay:v,onPause:$,onEnded:w,onTimeUpdate:C,className:I,style:R}){const M=ee(),N=ye(),T=c.useRef(null),j=c.useRef(null),k=c.useRef(null),Y=c.useRef(null),[f,g]=c.useState(!1),[S,F]=c.useState(0),[D,V]=c.useState(0),[E,P]=c.useState(0),[W,O]=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,ve]=c.useState(!1),[we,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 L=T.current;if(!L)return;z!==void 0&&(L.currentTime=z);const fe=()=>{F(L.currentTime),L.buffered.length>0&&P(L.buffered.end(L.buffered.length-1))},ke=()=>V(L.duration),Ce=()=>g(!0),qe=()=>{g(!1),oe(!0)},Ye=()=>{g(!1),oe(!0),w==null||w()},lt=()=>$e(!0),ct=()=>$e(!1),dt=()=>Te(!0),jt=()=>Te(!1),St=()=>{const Fe=L.error;Ee(Fe?`Error ${Fe.code}: ${Fe.message||"Failed to load video"}`:"Failed to load video"),Te(!1)};return L.addEventListener("timeupdate",fe),L.addEventListener("durationchange",ke),L.addEventListener("play",Ce),L.addEventListener("pause",qe),L.addEventListener("ended",Ye),L.addEventListener("enterpictureinpicture",lt),L.addEventListener("leavepictureinpicture",ct),L.addEventListener("waiting",dt),L.addEventListener("canplay",jt),L.addEventListener("error",St),()=>{L.removeEventListener("timeupdate",fe),L.removeEventListener("durationchange",ke),L.removeEventListener("play",Ce),L.removeEventListener("pause",qe),L.removeEventListener("ended",Ye),L.removeEventListener("enterpictureinpicture",lt),L.removeEventListener("leavepictureinpicture",ct),L.removeEventListener("waiting",dt),L.removeEventListener("canplay",jt),L.removeEventListener("error",St)}},[w,z]),c.useEffect(()=>{T.current&&(f?v==null||v():$==null||$())},[f,v,$]),c.useEffect(()=>{C==null||C(S,D)},[S,D,C]),c.useEffect(()=>{const L=T.current;if(!L)return;const fe=L.textTracks;for(let ke=0;ke<fe.length;ke++)fe[ke].mode=ke===we?"showing":"disabled"},[we]),c.useEffect(()=>{const L=()=>G(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",L),()=>document.removeEventListener("fullscreenchange",L)},[]),c.useEffect(()=>{const L=j.current;if(!L)return;const fe=ke=>{const Ce=T.current;if(Ce&&ke.target.tagName!=="INPUT")switch(ke.key){case" ":case"k":ke.preventDefault(),Se();break;case"f":case"F":o&&De();break;case"m":case"M":Ae();break;case"ArrowRight":ke.preventDefault(),Ce.currentTime=Math.min(Ce.currentTime+10,Ce.duration);break;case"ArrowLeft":ke.preventDefault(),Ce.currentTime=Math.max(Ce.currentTime-10,0);break;case"ArrowUp":ke.preventDefault(),O(Math.min(W+.1,1)),T.current&&(T.current.volume=Math.min(W+.1,1));break;case"ArrowDown":ke.preventDefault(),O(Math.max(W-.1,0)),T.current&&(T.current.volume=Math.max(W-.1,0));break}};return L.addEventListener("keydown",fe),()=>L.removeEventListener("keydown",fe)},[W,o]);const se=c.useCallback(()=>{pe(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{f&&pe(!1)},3e3)},[f]);c.useEffect(()=>(se(),()=>{Y.current&&clearTimeout(Y.current)}),[f,se]);const Se=c.useCallback(()=>{const L=T.current;L&&(L.paused?(L.play().catch(()=>{}),te("play"),oe(!1)):(L.pause(),te("pause")),setTimeout(()=>te(null),600))},[]),Ae=c.useCallback(()=>{const L=T.current;if(!L)return;const fe=!A;H(fe),L.muted=fe},[A]),De=c.useCallback(()=>{const L=j.current;L&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):L.requestFullscreen().catch(()=>{}))},[]),at=c.useCallback(async()=>{const L=T.current;if(L)try{document.pictureInPictureElement?await document.exitPictureInPicture():await L.requestPictureInPicture()}catch{}},[]),rt=c.useCallback(()=>{y.length!==0&&(de(L=>(L+1)%(y.length+1)-1),de(L=>{const fe=L+1;return fe>=y.length?-1:fe}))},[y.length]),ht=c.useCallback(()=>{const L=T.current;L&&(L.currentTime=Math.min(L.currentTime+10,L.duration||0))},[]),mt=c.useCallback(()=>{const L=T.current;L&&(L.currentTime=Math.max(L.currentTime-10,0))},[]),gt=c.useCallback(()=>{const L=T.current;L&&(Ee(null),L.load())},[]),Oe=c.useCallback(()=>{o&&De()},[o,De]),Xe=c.useCallback(L=>{const fe=T.current,ke=k.current;if(!fe||!ke||!D)return;const Ce=ke.getBoundingClientRect(),qe=Math.max(0,Math.min(1,(L.clientX-Ce.left)/Ce.width));fe.currentTime=qe*D},[D]),nt=c.useCallback(L=>{const fe=k.current;if(!fe||!D)return;const ke=fe.getBoundingClientRect(),Ce=Math.max(0,Math.min(1,(L.clientX-ke.left)/ke.width));J(Ce*D),re(L.clientX-ke.left)},[D]),Pt=c.useCallback(L=>{const fe=parseFloat(L.target.value);O(fe),T.current&&(T.current.volume=fe,T.current.muted=fe===0,H(fe===0))},[]),Bt=c.useCallback(L=>{X(L),T.current&&(T.current.playbackRate=L),ve(!1)},[]),bt=h.length>0?[...h].reverse().find(L=>S>=L.time):null,yt=L=>[...h].reverse().find(fe=>L>=fe.time)??null,Wt=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Ht=Array.isArray(e)?e[0].src:e,vt=ne||xe||!f,kt=N?"none":"opacity 0.25s ease",Vt=A||W===0?Ie.volumeMute:W<.5?Ie.volumeDown:Ie.volumeUp,wt=D>0?S/D*100:0,Ot=D>0?E/D*100:0;return t.jsxs("div",{ref:j,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:Oe,children:[Wt.map((L,fe)=>t.jsx("source",{src:L.src,type:L.type},fe)),y.map((L,fe)=>t.jsx("track",{kind:"subtitles",label:B(L.label),srcLang:L.lang,src:L.src,default:L.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:vt?1:0,transition:kt,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:B(n)}),bt&&t.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",B(bt.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(Le,{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:M.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(Le,{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:gt,style:{display:"flex",alignItems:"center",gap:6,background:M.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[t.jsx(Le,{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:vt?1:0,transition:kt},onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),children:[t.jsxs("div",{ref:k,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(D),"aria-valuenow":Math.floor(S),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:L=>{L.currentTarget.style.height="8px"},onMouseLeave:L=>{L.currentTarget.style.height="4px",J(null)},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ot}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${wt}%`,background:M.primary,borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:"50%",left:`${wt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:M.primary,pointerEvents:"none"}}),h.map((L,fe)=>{const ke=D>0?L.time/D*100:0;return t.jsx("div",{title:B(L.label),style:{position:"absolute",top:"50%",left:`${ke}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${M.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:[Zt(ge),yt(ge)&&t.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:B(yt(ge).label)})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[t.jsx(Ze,{onClick:Se,title:f?"Pause":"Play",primary:M.primary,children:t.jsx(Le,{path:f?Ie.pause:Ie.play,size:22})}),t.jsx(Ze,{onClick:mt,title:"Skip back 10 seconds",primary:M.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Le,{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:ht,title:"Skip forward 10 seconds",primary:M.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Le,{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:M.primary,children:t.jsx(Le,{path:Vt,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:W,onChange:Pt,"aria-label":"Volume",style:{width:64,accentColor:M.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:[Zt(S)," / ",Zt(D)]}),t.jsx("div",{style:{flex:1}}),y.length>0&&t.jsx(Ze,{onClick:rt,title:"Subtitles",primary:M.primary,active:we>=0,children:t.jsx(Le,{path:Ie.closedCaption,size:20})}),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[t.jsxs("button",{type:"button",onClick:()=>ve(L=>!L),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:M.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 ${M.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(L=>t.jsxs("button",{type:"button",onClick:()=>Bt(L),style:{display:"block",width:"100%",padding:"6px 14px",background:L===me?M.primary+"30":"none",border:"none",color:L===me?M.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[L,"×"]},L))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&t.jsx(Ze,{onClick:at,title:"Picture-in-Picture",primary:M.primary,active:be,children:t.jsx(Le,{path:Ie.pip,size:20})}),p&&t.jsx("a",{href:Ht,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:t.jsx(Le,{path:Ie.download,size:20})}),o&&t.jsx(Ze,{onClick:De,title:Q?"Exit fullscreen":"Fullscreen",primary:M.primary,children:t.jsx(Le,{path:Q?Ie.fullscreenExit:Ie.fullscreen,size:20})})]})]}),t.jsx("style",{children:`
56
+ `;function Ba(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 Wa({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 Fa({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 Pa({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 Ha(e){const r=[];let n=0;for(const o of e)if(o.type!=="separator")if(o.type==="radio-group")for(let i=0;i<o.options.length;i++)r.push({kind:"radio",item:o,optionIdx:i,idx:n++});else o.type==="check"?r.push({kind:"check",item:o,idx:n++}):o.type==="submenu"?r.push({kind:"submenu",item:o,idx:n++}):r.push({kind:"action",item:o,idx:n++});return r}function ko({items:e,pos:r,panelId:n,onClose:o,onCloseAll:i,isSubmenu:l=!1}){const c=U(),[d,u]=a.useState(-1),[f,s]=a.useState(null),[m,p]=a.useState(null),x=a.useRef(null),[y,v]=a.useState(""),b=a.useRef(null),g=Ha(e);a.useEffect(()=>{var I;(I=x.current)==null||I.focus()},[]),a.useEffect(()=>{var T;if(d<0)return;const I=(T=x.current)==null?void 0:T.querySelector(`[data-midx="${d}"]`);I==null||I.scrollIntoView({block:"nearest"})},[d]);const w=a.useCallback(I=>{var T,$,z,E,C,k;if(I.kind==="action"){if(I.item.disabled)return;($=(T=I.item).onClick)==null||$.call(T),i()}else if(I.kind==="check"){if(I.item.disabled)return;(E=(z=I.item).onChange)==null||E.call(z,!I.item.checked)}else if(I.kind==="radio"){if(I.item.disabled)return;(k=(C=I.item).onChange)==null||k.call(C,I.item.options[I.optionIdx].value)}else if(I.kind==="submenu"){if(I.item.disabled)return;s(I.item.id)}},[i]),S=I=>{var T;switch(I.key){case"ArrowDown":I.preventDefault(),u($=>{const z=$+1;return z<g.length?z:0});break;case"ArrowUp":I.preventDefault(),u($=>{const z=$-1;return z>=0?z:g.length-1});break;case"Home":I.preventDefault(),u(0);break;case"End":I.preventDefault(),u(g.length-1);break;case"Enter":case" ":I.preventDefault(),d>=0&&g[d]&&w(g[d]);break;case"Escape":I.preventDefault(),l?o():i();break;case"Tab":I.preventDefault(),i();break;case"ArrowRight":I.preventDefault(),d>=0&&((T=g[d])==null?void 0:T.kind)==="submenu"&&s(g[d].item.id);break;case"ArrowLeft":I.preventDefault(),l&&o();break;default:I.key.length===1&&!I.ctrlKey&&!I.metaKey&&M(I.key)}};function M(I){b.current&&clearTimeout(b.current);const T=y+I.toLowerCase();v(T);const $=g.findIndex(z=>(z.kind==="radio"?z.item.options[z.optionIdx].label:z.item.label).toLowerCase().startsWith(T));$>=0&&u($),b.current=setTimeout(()=>v(""),800)}function N(I,T){const $=T.getBoundingClientRect();s(I.id);const z=Math.min(I.items.length*38+12,360);p(Ra($,220,z))}function j(){s(null),p(null)}const L=()=>{let I=-1;return e.map(T=>{if(T.type==="separator")return t.jsx("div",{role:"separator",style:{margin:(T.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:T.label?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,marginLeft:14}}),t.jsx("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:c.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:R(T.label)}),t.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,marginRight:14}})]}):t.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,margin:"0 10px"}})},T.id);if(T.type==="radio-group")return t.jsxs("div",{role:"group","aria-label":T.label,children:[T.label&&t.jsx("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:c.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:R(T.label)}),T.options.map((D,O)=>{I++;const W=I,H=W===d,B=D.value===T.value,P=!!T.disabled,F=Wt(c,H,!1,P);return t.jsxs("div",{role:"menuitemradio","aria-checked":B,"aria-disabled":P||void 0,"data-midx":W,tabIndex:-1,style:F,onClick:()=>{var V;return!P&&((V=T.onChange)==null?void 0:V.call(T,D.value))},onMouseEnter:()=>!P&&u(W),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:B?t.jsx(Fa,{color:c.primary}):t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${c.border}`,display:"inline-block"}})}),D.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:c.textMuted},children:D.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(D.label)})]},D.value)})]},T.id);if(T.type==="check"){I++;const D=I,O=D===d,W=!!T.disabled,H=Wt(c,O,!1,W);return t.jsxs("div",{role:"menuitemcheckbox","aria-checked":T.checked,"aria-disabled":W||void 0,"data-midx":D,tabIndex:-1,style:H,onClick:()=>{var B;return!W&&((B=T.onChange)==null?void 0:B.call(T,!T.checked))},onMouseEnter:()=>!W&&u(D),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:T.checked?t.jsx(Wa,{color:c.primary}):t.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),T.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:c.textMuted},children:T.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(T.label)})]},T.id)}if(T.type==="submenu"){I++;const D=I,O=D===d,W=!!T.disabled,H=f===T.id,B=Wt(c,O||H,!1,W);return t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":H,"aria-disabled":W||void 0,"data-midx":D,tabIndex:-1,style:B,onMouseEnter:P=>{W||(u(D),N(T,P.currentTarget))},onMouseLeave:()=>{},onClick:()=>{W||s(H?null:T.id)},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:T.icon?t.jsx("span",{style:{display:"flex",color:c.textMuted},children:T.icon}):t.jsx("span",{style:{width:14}})}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(T.label)}),t.jsx(Pa,{color:c.textMuted})]}),H&&m&&Ne.createPortal(t.jsx(ko,{items:T.items,pos:m,panelId:`${n}-sub-${T.id}`,onClose:j,onCloseAll:i,isSubmenu:!0}),document.body)]},T.id)}const $=T;I++;const z=I,E=z===d,C=!!$.disabled,k=!!$.danger,A=Wt(c,E,k,C);return t.jsxs("div",{role:"menuitem","aria-disabled":C||void 0,"data-midx":z,tabIndex:-1,style:A,onClick:()=>{var D;C||((D=$.onClick)==null||D.call($),i())},onMouseEnter:()=>{C||(u(z),j())},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:$.icon?t.jsx("span",{style:{display:"flex",color:k?c.danger:c.textMuted},children:$.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:R($.label)}),$.description&&t.jsx("span",{style:{display:"block",fontSize:"12px",color:c.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R($.description)})]}),$.shortcut&&t.jsx("span",{style:{fontSize:"12px",color:c.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:R($.shortcut)})]},$.id)})};return t.jsxs(t.Fragment,{children:[t.jsx("style",{children:Da}),t.jsx("div",{ref:x,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:S,style:{...Ba(c,r),maxHeight:400,overflowY:"auto"},children:L()})]})}function Wt(e,r,n,o){const i=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:o?"not-allowed":"pointer",userSelect:"none",color:o?e.textMuted:r&&n?e.danger:i,backgroundColor:r?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function wo({trigger:e,items:r,placement:n="bottom-start",isDisabled:o=!1,onOpen:i,onClose:l,className:c,style:d}){const f=`tkx-menu-${a.useId().replace(/:/g,"")}`,[s,m]=a.useState(!1),[p,x]=a.useState(null),y=a.useRef(null),v=a.useCallback(()=>{if(o)return;const w=y.current;if(!w)return;const S=w.getBoundingClientRect(),M=Math.min(r.length*38+12,360);x(Qr(S,n,220,M)),m(!0),i==null||i()},[o,r.length,i,n]),b=a.useCallback(()=>{var w,S,M;m(!1),l==null||l(),(M=(S=(w=y.current)==null?void 0:w.firstElementChild)==null?void 0:S.focus)==null||M.call(S)},[l]);a.useEffect(()=>{if(!s)return;const w=S=>{var j;const M=S.target;if((j=y.current)!=null&&j.contains(M))return;const N=document.querySelectorAll(".tkx-menu-panel");for(const L of N)if(L.contains(M))return;b()};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[s,b]),a.useEffect(()=>{if(!s)return;const w=()=>{const S=y.current;if(!S)return;const M=S.getBoundingClientRect(),N=Math.min(r.length*38+12,360);x(Qr(M,n,220,N))};return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[s,r.length,n]);const g=w=>{(w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),s||v()),w.key==="Escape"&&s&&(w.preventDefault(),b())};return t.jsxs("span",{ref:y,className:c,style:{display:"inline-flex",...d},children:[t.jsx("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":s,"aria-controls":s?f:void 0,"aria-disabled":o||void 0,onClick:()=>s?b():v(),onKeyDown:g,style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),s&&p&&Ne.createPortal(t.jsx(ko,{items:r,pos:p,panelId:f,onClose:b,onCloseAll:b}),document.body)]})}wo.displayName="TkxMenu";const Va={sm:120,md:180,lg:240,xl:320};function Ft(e){const r=new Date;if(e)try{const c=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=b=>{var g;return((g=c.find(w=>w.type===b))==null?void 0:g.value)??"0"};let u=parseInt(d("hour"),10);u===24&&(u=0);const f=parseInt(d("minute"),10),s=parseInt(d("second"),10),m=d("weekday"),p=d("month"),x=d("day"),y=d("year"),v=`${m}, ${p} ${x}, ${y}`;return{hours:u,minutes:f,seconds:s,milliseconds:r.getMilliseconds(),dateString:v}}catch{}const n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),l=r.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:i,milliseconds:r.getMilliseconds(),dateString:l}}function Oa({time:e,size:r,analogStyle:n,showSeconds:o,reducedMotion:i,primary:l,danger:c,text:d,textMuted:u,border:f,surface:s,bg:m}){const p=r/2,x=r/2,y=r/2-4,{hours:v,minutes:b,seconds:g,milliseconds:w}=e,M=(g+(i?0:w)/1e3)/60*360,N=b/60*360+g/60*6,j=v%12/12*360+b/60*30,L=(k,A)=>{const D=(k-90)*Math.PI/180;return{x:p+Math.cos(D)*A,y:x+Math.sin(D)*A}},I=i?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const k=(P,F)=>{const Q=-90+P*360,re={x:p+Math.cos(-90*Math.PI/180)*F,y:x+Math.sin(-90*Math.PI/180)*F},ie={x:p+Math.cos(Q*Math.PI/180)*F,y:x+Math.sin(Q*Math.PI/180)*F},fe=P>.5?1:0;return`M ${re.x} ${re.y} A ${F} ${F} 0 ${fe} 1 ${ie.x} ${ie.y}`},A=v%12/12+b/60/12,D=b/60+g/3600,O=(g+(i?0:w/1e3))/60,W=y-2,H=y-10,B=y-18;return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:p,cy:x,r:W,fill:"none",stroke:f,strokeWidth:4}),t.jsx("circle",{cx:p,cy:x,r:H,fill:"none",stroke:f,strokeWidth:4}),o&&t.jsx("circle",{cx:p,cy:x,r:B,fill:"none",stroke:f,strokeWidth:3}),t.jsx("path",{d:k(A,W),fill:"none",stroke:l,strokeWidth:4,strokeLinecap:"round"}),t.jsx("path",{d:k(D,H),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),o&&t.jsx("path",{d:k(O,B),fill:"none",stroke:c,strokeWidth:3,strokeLinecap:"round"}),t.jsx("circle",{cx:p,cy:x,r:4,fill:l}),t.jsxs("text",{x:p,y:x+20,textAnchor:"middle",fontSize:r*.12,fill:u,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(v).padStart(2,"0"),":",String(b).padStart(2,"0")]})]})}const T=L(j,y*.5),$=L(N,y*.75),z=L(M,y*.85),E=L(M+180,y*.2),C=[];if(n==="classic"){for(let A=0;A<60;A++){const D=A/60*360,O=A%5===0,W=(D-90)*Math.PI/180,H=O?y-10:y-6,B=p+Math.cos(W)*y,P=x+Math.sin(W)*y,F=p+Math.cos(W)*H,V=x+Math.sin(W)*H;C.push(t.jsx("line",{x1:B,y1:P,x2:F,y2:V,stroke:O?d:u,strokeWidth:O?2:1,strokeLinecap:"round"},A))}const k=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:A,angle:D}of k){const O=(D-90)*Math.PI/180,W=y-20;C.push(t.jsx("text",{x:p+Math.cos(O)*W,y:x+Math.sin(O)*W,textAnchor:"middle",dominantBaseline:"central",fontSize:r*.09,fill:d,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:A},`n${A}`))}}else for(let k=0;k<12;k++){const D=(k/12*360-90)*Math.PI/180,O=y-8;C.push(t.jsx("circle",{cx:p+Math.cos(D)*O,cy:x+Math.sin(D)*O,r:k%3===0?3:2,fill:k%3===0?d:u},k))}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:x,r:y,fill:s,stroke:f,strokeWidth:2}),C,t.jsx("line",{x1:p,y1:x,x2:T.x,y2:T.y,stroke:l,strokeWidth:n==="minimal"?3:4,strokeLinecap:"round",style:{transformOrigin:`${p}px ${x}px`,transition:I}}),t.jsx("line",{x1:p,y1:x,x2:$.x,y2:$.y,stroke:d,strokeWidth:n==="minimal"?2:3,strokeLinecap:"round",style:{transformOrigin:`${p}px ${x}px`,transition:I}}),o&&t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:E.x,y1:E.y,x2:z.x,y2:z.y,stroke:c,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${p}px ${x}px`,transition:"none"}}),t.jsx("circle",{cx:p,cy:x,r:3,fill:c})]}),t.jsx("circle",{cx:p,cy:x,r:n==="minimal"?3:5,fill:l})]})}function en({time:e,format:r,showSeconds:n,showDate:o,label:i,size:l,primary:c,text:d,textMuted:u,colonVisible:f}){const{hours:s,minutes:m,seconds:p,dateString:x}=e;let y=s,v="";r==="12h"&&(v=s>=12?"PM":"AM",y=s%12||12);const b=l*.2,g={opacity:f?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:b,color:c,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[t.jsx("span",{children:String(y).padStart(2,"0")}),t.jsx("span",{style:g,children:":"}),t.jsx("span",{children:String(m).padStart(2,"0")}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:g,children:":"}),t.jsx("span",{children:String(p).padStart(2,"0")})]}),r==="12h"&&t.jsx("span",{style:{fontSize:b*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:b*.05},children:v})]}),o&&t.jsx("div",{style:{fontSize:l*.072,color:u,marginTop:l*.025,letterSpacing:"0.03em"},children:x}),i&&t.jsx("div",{style:{fontSize:l*.065,color:u,marginTop:l*.015,textTransform:"uppercase",letterSpacing:"0.08em"},children:R(i)})]})}function jo({variant:e="both",size:r="md",showSeconds:n=!0,showDate:o=!1,format:i="24h",timezone:l,timezone2:c,label:d,analogStyle:u="classic",className:f,style:s}){const m=U(),p=te(),[x,y]=a.useState(()=>Ft(l)),[v,b]=a.useState(()=>c?Ft(c):null),[g,w]=a.useState(!0),[S,M]=a.useState(!1),N=a.useRef(null);a.useEffect(()=>{M(!0)},[]),a.useEffect(()=>{const $=()=>{y(Ft(l)),c&&b(Ft(c))};$();const z=setInterval($,1e3);return()=>clearInterval(z)},[l,c]),a.useEffect(()=>(N.current=setInterval(()=>{w($=>!$)},500),()=>{N.current&&clearInterval(N.current)}),[]);const j=Va[r],L=e==="analog"||e==="both",I=e==="digital"||e==="both",T={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:e==="both"?`${j*.06}px`:0,opacity:S?1:0,transition:p?"none":"opacity 0.4s ease",...s};return t.jsxs("div",{className:f,style:T,role:"timer","aria-live":"off",children:[L&&t.jsx(Oa,{time:x,size:j,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}),I&&t.jsx(en,{time:x,format:i,showSeconds:n,showDate:o,label:d,size:j,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:g}),v&&c&&t.jsx("div",{style:{marginTop:j*.04,padding:`${j*.03}px ${j*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:t.jsx(en,{time:v,format:i,showSeconds:!1,showDate:!1,label:c,size:j*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:g})})]})}jo.displayName="TkxClock";function or(e){if(!isFinite(e)||isNaN(e))return"0:00";const r=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return r>0?`${r}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function Fe({path:e,size:r=20,color:n="currentColor",title:o}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:n,"aria-hidden":o?void 0:"true",role:o?"img":void 0,"aria-label":o,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 dt({onClick:e,title:r,children:n,active:o,primary:i}){const[l,c]=a.useState(!1);return t.jsx("button",{type:"button",onClick:e,title:r,"aria-label":r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||l?i:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function So({src:e,poster:r,title:n,width:o="100%",height:i,autoPlay:l=!1,loop:c=!1,muted:d=!1,controls:u=!0,showTitle:f=!0,allowFullscreen:s=!0,allowPiP:m=!0,allowDownload:p=!1,chapters:x=[],subtitles:y=[],startTime:v,onPlay:b,onPause:g,onEnded:w,onTimeUpdate:S,className:M,style:N}){const j=U(),L=te(),I=a.useRef(null),T=a.useRef(null),$=a.useRef(null),z=a.useRef(null),[E,C]=a.useState(!1),[k,A]=a.useState(0),[D,O]=a.useState(0),[W,H]=a.useState(0),[B,P]=a.useState(1),[F,V]=a.useState(d),[Q,re]=a.useState(!1),[ie,fe]=a.useState(!0),[xe,ve]=a.useState(!1),[ge,X]=a.useState(1),[se,he]=a.useState(!1),[Se,de]=a.useState(-1),[be,ne]=a.useState(null),[q,K]=a.useState(0),[G,ee]=a.useState(null),[ue,ke]=a.useState(!1),[Me,je]=a.useState(!1),[ze,Te]=a.useState(null),[Pe,Ge]=a.useState(!1);a.useEffect(()=>{const Y=I.current;if(!Y)return;v!==void 0&&(Y.currentTime=v);const me=()=>{A(Y.currentTime),Y.buffered.length>0&&H(Y.buffered.end(Y.buffered.length-1))},$e=()=>O(Y.duration),Ee=()=>C(!0),ct=()=>{C(!1),ve(!0)},ot=()=>{C(!1),ve(!0),w==null||w()},$t=()=>ke(!0),Mt=()=>ke(!1),Ct=()=>je(!0),At=()=>je(!1),Rt=()=>{const _e=Y.error;Te(_e?`Error ${_e.code}: ${_e.message||"Failed to load video"}`:"Failed to load video"),je(!1)};return Y.addEventListener("timeupdate",me),Y.addEventListener("durationchange",$e),Y.addEventListener("play",Ee),Y.addEventListener("pause",ct),Y.addEventListener("ended",ot),Y.addEventListener("enterpictureinpicture",$t),Y.addEventListener("leavepictureinpicture",Mt),Y.addEventListener("waiting",Ct),Y.addEventListener("canplay",At),Y.addEventListener("error",Rt),()=>{Y.removeEventListener("timeupdate",me),Y.removeEventListener("durationchange",$e),Y.removeEventListener("play",Ee),Y.removeEventListener("pause",ct),Y.removeEventListener("ended",ot),Y.removeEventListener("enterpictureinpicture",$t),Y.removeEventListener("leavepictureinpicture",Mt),Y.removeEventListener("waiting",Ct),Y.removeEventListener("canplay",At),Y.removeEventListener("error",Rt)}},[w,v]),a.useEffect(()=>{I.current&&(E?b==null||b():g==null||g())},[E,b,g]),a.useEffect(()=>{S==null||S(k,D)},[k,D,S]),a.useEffect(()=>{const Y=I.current;if(!Y)return;const me=Y.textTracks;for(let $e=0;$e<me.length;$e++)me[$e].mode=$e===Se?"showing":"disabled"},[Se]),a.useEffect(()=>{const Y=()=>re(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",Y),()=>document.removeEventListener("fullscreenchange",Y)},[]),a.useEffect(()=>{const Y=T.current;if(!Y)return;const me=$e=>{const Ee=I.current;if(Ee&&$e.target.tagName!=="INPUT")switch($e.key){case" ":case"k":$e.preventDefault(),Be();break;case"f":case"F":s&&et();break;case"m":case"M":Qe();break;case"ArrowRight":$e.preventDefault(),Ee.currentTime=Math.min(Ee.currentTime+10,Ee.duration);break;case"ArrowLeft":$e.preventDefault(),Ee.currentTime=Math.max(Ee.currentTime-10,0);break;case"ArrowUp":$e.preventDefault(),P(Math.min(B+.1,1)),I.current&&(I.current.volume=Math.min(B+.1,1));break;case"ArrowDown":$e.preventDefault(),P(Math.max(B-.1,0)),I.current&&(I.current.volume=Math.max(B-.1,0));break}};return Y.addEventListener("keydown",me),()=>Y.removeEventListener("keydown",me)},[B,s]);const Je=a.useCallback(()=>{fe(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{E&&fe(!1)},3e3)},[E]);a.useEffect(()=>(Je(),()=>{z.current&&clearTimeout(z.current)}),[E,Je]);const Be=a.useCallback(()=>{const Y=I.current;Y&&(Y.paused?(Y.play().catch(()=>{}),ee("play"),ve(!1)):(Y.pause(),ee("pause")),setTimeout(()=>ee(null),600))},[]),Qe=a.useCallback(()=>{const Y=I.current;if(!Y)return;const me=!F;V(me),Y.muted=me},[F]),et=a.useCallback(()=>{const Y=T.current;Y&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):Y.requestFullscreen().catch(()=>{}))},[]),He=a.useCallback(async()=>{const Y=I.current;if(Y)try{document.pictureInPictureElement?await document.exitPictureInPicture():await Y.requestPictureInPicture()}catch{}},[]),tt=a.useCallback(()=>{y.length!==0&&(de(Y=>(Y+1)%(y.length+1)-1),de(Y=>{const me=Y+1;return me>=y.length?-1:me}))},[y.length]),mt=a.useCallback(()=>{const Y=I.current;Y&&(Y.currentTime=Math.min(Y.currentTime+10,Y.duration||0))},[]),gt=a.useCallback(()=>{const Y=I.current;Y&&(Y.currentTime=Math.max(Y.currentTime-10,0))},[]),Ve=a.useCallback(()=>{const Y=I.current;Y&&(Te(null),Y.load())},[]),Oe=a.useCallback(()=>{s&&et()},[s,et]),Ue=a.useCallback(Y=>{const me=I.current,$e=$.current;if(!me||!$e||!D)return;const Ee=$e.getBoundingClientRect(),ct=Math.max(0,Math.min(1,(Y.clientX-Ee.left)/Ee.width));me.currentTime=ct*D},[D]),rt=a.useCallback(Y=>{const me=$.current;if(!me||!D)return;const $e=me.getBoundingClientRect(),Ee=Math.max(0,Math.min(1,(Y.clientX-$e.left)/$e.width));ne(Ee*D),K(Y.clientX-$e.left)},[D]),bt=a.useCallback(Y=>{const me=parseFloat(Y.target.value);P(me),I.current&&(I.current.volume=me,I.current.muted=me===0,V(me===0))},[]),St=a.useCallback(Y=>{X(Y),I.current&&(I.current.playbackRate=Y),he(!1)},[]),yt=x.length>0?[...x].reverse().find(Y=>k>=Y.time):null,_=Y=>[...x].reverse().find(me=>Y>=me.time)??null,oe=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],le=Array.isArray(e)?e[0].src:e,ye=ie||xe||!E,We=L?"none":"opacity 0.25s ease",nt=F||B===0?Ie.volumeMute:B<.5?Ie.volumeDown:Ie.volumeUp,vt=D>0?k/D*100:0,Gt=D>0?W/D*100:0;return t.jsxs("div",{ref:T,className:M,tabIndex:0,onMouseMove:Je,onMouseLeave:()=>{E&&fe(!1)},style:{position:"relative",width:o,height:i??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...N},children:[t.jsxs("video",{ref:I,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:l,loop:c,muted:d,playsInline:!0,onClick:Be,onDoubleClick:Oe,children:[oe.map((Y,me)=>t.jsx("source",{src:Y.src,type:Y.type},me)),y.map((Y,me)=>t.jsx("track",{kind:"subtitles",label:R(Y.label),srcLang:Y.lang,src:Y.src,default:Y.default},me))]}),f&&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:ye?1:0,transition:We,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:R(n)}),yt&&t.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",R(yt.label)]})]}),G&&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:L?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:t.jsx(Fe,{path:G==="play"?Ie.play:Ie.pause,size:32,color:"#fff"})}),Me&&!ze&&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:j.primary,borderRadius:"50%",animation:L?"none":"tkxvp-spin 0.8s linear infinite"}})}),ze&&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(Fe,{path:Ie.errorOutline,size:48,color:"#ef4444"}),t.jsx("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:ze}),t.jsxs("button",{type:"button",onClick:Ve,style:{display:"flex",alignItems:"center",gap:6,background:j.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[t.jsx(Fe,{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:ye?1:0,transition:We},onMouseEnter:()=>ve(!0),onMouseLeave:()=>ve(!1),children:[t.jsxs("div",{ref:$,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(D),"aria-valuenow":Math.floor(k),tabIndex:0,onClick:Ue,onMouseMove:rt,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:Y=>{Y.currentTarget.style.height="8px"},onMouseLeave:Y=>{Y.currentTarget.style.height="4px",ne(null)},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Gt}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${vt}%`,background:j.primary,borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:"50%",left:`${vt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:j.primary,pointerEvents:"none"}}),x.map((Y,me)=>{const $e=D>0?Y.time/D*100:0;return t.jsx("div",{title:R(Y.label),style:{position:"absolute",top:"50%",left:`${$e}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${j.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},me)}),be!==null&&t.jsxs("div",{style:{position:"absolute",bottom:12,left:q,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:[or(be),_(be)&&t.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:R(_(be).label)})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[t.jsx(dt,{onClick:Be,title:E?"Pause":"Play",primary:j.primary,children:t.jsx(Fe,{path:E?Ie.pause:Ie.play,size:22})}),t.jsx(dt,{onClick:gt,title:"Skip back 10 seconds",primary:j.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Fe,{path:Ie.replay10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsx(dt,{onClick:mt,title:"Skip forward 10 seconds",primary:j.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Fe,{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:()=>Ge(!0),onMouseLeave:()=>Ge(!1),children:[t.jsx(dt,{onClick:Qe,title:F?"Unmute":"Mute",primary:j.primary,children:t.jsx(Fe,{path:nt,size:20})}),t.jsx("div",{style:{overflow:"hidden",width:Pe?64:0,opacity:Pe?1:0,transition:L?"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:F?0:B,onChange:bt,"aria-label":"Volume",style:{width:64,accentColor:j.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:[or(k)," / ",or(D)]}),t.jsx("div",{style:{flex:1}}),y.length>0&&t.jsx(dt,{onClick:tt,title:"Subtitles",primary:j.primary,active:Se>=0,children:t.jsx(Fe,{path:Ie.closedCaption,size:20})}),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[t.jsxs("button",{type:"button",onClick:()=>he(Y=>!Y),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:[ge,"×"]}),ge!==1&&t.jsxs("span",{style:{position:"absolute",top:0,right:0,background:j.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[ge,"x"]}),se&&t.jsx("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${j.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(Y=>t.jsxs("button",{type:"button",onClick:()=>St(Y),style:{display:"block",width:"100%",padding:"6px 14px",background:Y===ge?j.primary+"30":"none",border:"none",color:Y===ge?j.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[Y,"×"]},Y))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&t.jsx(dt,{onClick:He,title:"Picture-in-Picture",primary:j.primary,active:ue,children:t.jsx(Fe,{path:Ie.pip,size:20})}),p&&t.jsx("a",{href:le,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:t.jsx(Fe,{path:Ie.download,size:20})}),s&&t.jsx(dt,{onClick:et,title:Q?"Exit fullscreen":"Fullscreen",primary:j.primary,children:t.jsx(Fe,{path:Q?Ie.fullscreenExit:Ie.fullscreen,size:20})})]})]}),t.jsx("style",{children:`
57
57
  @keyframes tkxvp-flash {
58
58
  0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
59
59
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }
@@ -62,9 +62,70 @@
62
62
  0% { transform: rotate(0deg); }
63
63
  100% { transform: rotate(360deg); }
64
64
  }
65
- `})]})}Yn.displayName="TkxVideoPlayer";const Fi={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 Pi({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 Bi({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 Wi({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:y,clickable:z}){const v=e==="completed",$=e==="active",w=e==="error",C=e==="pending";let I=p,R=m,M=o,N=2;v?(I=h==="filled"?u:p,R=u,M=h==="filled"?"#fff":u):$?(I=h==="outlined"?p:l,R=l,M=h==="outlined"?l:"#fff",N=2):w?(I=h==="filled"?d:p,R=d,M=h==="filled"?"#fff":d):C&&(I=p,R=m,M=o);const T=$&&!y?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},j=z?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let k;return i&&!v&&!w?k=t.jsx("span",{style:{fontSize:a,lineHeight:1},children:i}):v?k=t.jsx(Pi,{size:s}):w?k=t.jsx(Bi,{size:s}):n?k=t.jsx("span",{style:{fontSize:a,fontWeight:600,lineHeight:1},children:r+1}):k=t.jsx("span",{style:{fontSize:s*.22,lineHeight:1,background:M,borderRadius:"50%",width:s*.22,height:s*.22,display:"block"}}),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`
65
+ `})]})}So.displayName="TkxVideoPlayer";const _a={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 Ya({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 Ua({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 Ka({status:e,index:r,showStepNumbers:n,icon:o,circleSize:i,fontSize:l,primary:c,danger:d,success:u,text:f,textMuted:s,border:m,surface:p,variant:x,reducedMotion:y,clickable:v}){const b=e==="completed",g=e==="active",w=e==="error",S=e==="pending";let M=p,N=m,j=s,L=2;b?(M=x==="filled"?u:p,N=u,j=x==="filled"?"#fff":u):g?(M=x==="outlined"?p:c,N=c,j=x==="outlined"?c:"#fff",L=2):w?(M=x==="filled"?d:p,N=d,j=x==="filled"?"#fff":d):S&&(M=p,N=m,j=s);const I=g&&!y?{boxShadow:`0 0 0 4px ${c}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},T=v?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let $;return o&&!b&&!w?$=t.jsx("span",{style:{fontSize:l,lineHeight:1},children:o}):b?$=t.jsx(Ya,{size:i}):w?$=t.jsx(Ua,{size:i}):n?$=t.jsx("span",{style:{fontSize:l,fontWeight:600,lineHeight:1},children:r+1}):$=t.jsx("span",{style:{fontSize:i*.22,lineHeight:1,background:j,borderRadius:"50%",width:i*.22,height:i*.22,display:"block"}}),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`
66
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; }
67
+ 0%, 100% { box-shadow: 0 0 0 0 ${c}50; }
68
+ 50% { box-shadow: 0 0 0 6px ${c}20; }
69
69
  }
70
- `}),t.jsx("div",{style:{width:s,height:s,minWidth:s,borderRadius:"50%",border:`${N}px solid ${R}`,backgroundColor:I,color:M,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:y?"none":"background-color 0.2s, border-color 0.2s",...T,...j},children:k})]})}function _r({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 _n({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=ye(),y=Fi[s],z=($,w)=>$.status?$.status:w<r?"completed":w===r?"active":"pending",v=n==="horizontal";return t.jsx("div",{className:o,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:v?"row":"column",alignItems:v?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map(($,w)=>{const C=z($,w),I=w===e.length-1,R=C==="completed"||w<r,M=w%2===0,N=()=>{a&&(l==null||l(w))},T=t.jsx(Wi,{status:C,index:w,showStepNumbers:d,icon:$.icon,circleSize:y.circle,fontSize:y.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}),j=t.jsxs("div",{style:{textAlign:v&&!u?"center":"left",maxWidth:v?120:void 0},children:[t.jsxs("div",{style:{fontSize:y.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:[B($.title),$.optional&&t.jsx("span",{style:{fontSize:y.descSize,color:p.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),$.description&&t.jsx("div",{style:{fontSize:y.descSize,color:p.textMuted,marginTop:2,lineHeight:1.4},children:B($.description)}),$.error&&C==="error"&&t.jsx("div",{style:{fontSize:y.descSize,color:p.danger,marginTop:2},children:B($.error)})]});return v?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&&!M&&t.jsx("div",{style:{minHeight:y.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:j}),T,!u&&j,u&&M&&t.jsx("div",{style:{marginTop:6},children:j})]}),!I&&t.jsx(_r,{completed:R,orientation:"horizontal",connectorStyle:x,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]},$.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(_r,{completed:R,orientation:"vertical",connectorStyle:x,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]}),t.jsx("div",{style:{paddingTop:(y.circle-parseFloat(y.titleSize)*16)/2,paddingBottom:I?0:16,flex:1,minWidth:0},children:j})]},$.id)})})}_n.displayName="TkxStepper";function Un(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 sr(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 Rt(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 Gt(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 Jt(e,r,n){if(n==="hex")return r<1?`${e}${Math.round(r*255).toString(16).padStart(2,"0")}`:e;const[i,s,a]=Rt(e);if(n==="rgb")return r<1?`rgba(${i}, ${s}, ${a}, ${r.toFixed(2)})`:`rgb(${i}, ${s}, ${a})`;const[l,d,u]=Un(e);return n==="hsl"?r<1?`hsla(${l}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${l}, ${d}%, ${u}%)`:e}const Hi=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Vi({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:sr(e,r,n/2+25)}})]})}function Oi({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 Yi({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]=Rt(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 _i({value:e,defaultValue:r="#3b82f6",onChange:n,format:i="hex",showAlpha:s=!1,presets:a=Hi,disabled:l=!1,size:d="md",placeholder:u,label:x,style:o}){const m=ee(),p=c.useRef(null),h=c.useRef(null),[y,z]=c.useState(!1),v=e!==void 0,[$,w]=c.useState(v&&e||r),C=v?e||r:$,[I,R]=c.useState(1),[M,N]=c.useState(C),[T,j]=c.useState({top:0,left:0}),[k,Y,f]=Un(Ge(C)?C:r),g=c.useCallback((X,Z=I)=>{Ge(X)&&(N(X),v||w(X),n==null||n(Jt(X,Z,i),i))},[I,v,i,n]);c.useEffect(()=>{v&&e&&Ge(e)&&N(e)},[v,e]);const S=()=>{if(l)return;const X=p.current;if(!X)return;const Z=X.getBoundingClientRect(),we=window.innerHeight-Z.bottom>320?Z.bottom+6:Z.top-326;j({top:we+window.scrollY,left:Z.left+window.scrollX}),z(!0)};c.useEffect(()=>{if(!y)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)},[y]),c.useEffect(()=>{if(!y)return;const X=Z=>{Z.key==="Escape"&&z(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[y]);const F=(X,Z)=>{const ve=Z/100,we=X/100,de=ve*(1-we/2),ge=de===0||de===1?0:(ve-de)/Math.min(de,1-de),J=sr(k,Math.round(ge*100),Math.round(de*100));g(J)},D=X=>{const Z=sr(X,Y,f);g(Z)},V=X=>{R(X),n==null||n(Jt(C,X,i),i)},E=X=>{const Z=X.target.value;N(Z),Ge(Z)&&g(Z)},P=(X,Z)=>{const ve=Math.max(0,Math.min(255,parseInt(Z)||0)),[we,de,ge]=Rt(C),J=X==="r"?Gt(ve,de,ge):X==="g"?Gt(we,ve,ge):Gt(we,de,ve);g(J)},O={sm:28,md:34,lg:40}[d],[A,H,Q]=Rt(Ge(C)?C:r),G={display:"inline-flex",alignItems:"center",gap:"8px",height:`${O}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:`${O-8}px`,height:`${O-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:S,disabled:l,"aria-label":`Color picker, current color ${C}`,"aria-haspopup":"dialog","aria-expanded":y,children:[t.jsx("div",{style:ne}),t.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??Jt(Ge(C)?C:r,I,i)})]}),y&&Be.createPortal(t.jsxs("div",{ref:h,style:pe,role:"dialog","aria-label":"Color picker",children:[t.jsx(Vi,{hue:k,sat:Y,bright:f,onChange:F}),t.jsx(Oi,{hue:k,onChange:D}),s&&t.jsx(Yi,{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:M,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:ve=>P(X,ve.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 Ui={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 Ur(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 Qt(e,r){if(r===void 0)return e;const n=Math.pow(10,r);return Math.round(e*n)/n}function Ki(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 Kr({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 y=e==="inc";return t.jsx("button",{type:"button","aria-label":y?"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:y?void 0:`1px solid ${a}`,borderLeft:y?`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:y?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 Kn({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:y="md",label:z,hint:v,isDisabled:$=!1,isReadOnly:w=!1,isInvalid:C=!1,errorMessage:I,id:R,className:M,style:N}){const T=ee(),j=c.useId(),k=R??j,Y=`${k}-hint`,f=`${k}-error`,g=e!==void 0,[S,F]=c.useState(r),D=g?e:S,[V,E]=c.useState(!1),[P,W]=c.useState(""),O=Ui[y],A=C||!!I,H=A?T.danger:V?T.primary:T.border,Q=[v&&Y,A&&f].filter(Boolean).join(" ")||void 0,G=z?B(z):void 0,ne=v?B(v):void 0,pe=I?B(I):void 0,xe=d?B(d):void 0,oe=u?B(u):void 0,me=c.useCallback(re=>{const q=Qt(re,l);g||F(q),n==null||n(q)},[g,n,l]),X=c.useCallback(re=>{if($||w)return;const q=Ur(Qt(D+re*a,l),i,s);me(q)},[$,w,D,a,l,i,s,me]),Z=()=>{E(!0),W(String(D))},ve=()=>{E(!1);const re=parseFloat(P);if(isNaN(re)){n==null||n(null),W(String(D));return}let q=Qt(re,l);p&&(q=Ur(q,i,s)),me(q)},we=re=>{W(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?P:Ki(D,x,o,m,l),ie=(xe||oe)&&!V;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),M),style:N,children:[G&&t.jsx("label",{htmlFor:k,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:$?T.surfaceAlt:T.surface,opacity:$?.65:1,height:O.height},children:[t.jsx(Kr,{direction:"dec",isDisabled:$||w,btnW:O.btnW,height:O.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:O.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:O.px,fontSize:O.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:xe}),t.jsx("input",{id:k,type:"text",inputMode:"decimal",value:V?P:J,readOnly:w,disabled:$,"aria-invalid":A,"aria-describedby":Q,"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":D,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:T.text,paddingLeft:ie&&xe?`calc(${O.px} + 1.2em)`:O.px,paddingRight:ie&&oe?`calc(${O.px} + 1.2em)`:O.px,cursor:$?"not-allowed":w?"default":"text"},onFocus:Z,onBlur:ve,onChange:we,onKeyDown:de,onWheel:ge}),ie&&oe&&t.jsx("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:oe})]}),t.jsx(Kr,{direction:"inc",isDisabled:$||w,btnW:O.btnW,height:O.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:O.iconSz,onStep:X})]}),ne&&!pe&&t.jsx("span",{id:Y,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]})]})}Kn.displayName="TkxNumberInput";const Xi={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},qi={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function Xr(e,r){return qi[r].test(e)?e.toUpperCase():""}function Xn({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:y,style:z}){const v=ee(),$=c.useId(),w=`${$}-hint`,C=`${$}-error`,I=r!==void 0,R=A=>{const H=A.split("").slice(0,e);for(;H.length<e;)H.push("");return H},[M,N]=c.useState(()=>R(I?r:"")),T=I?R(r):M,j=c.useRef([]),k=Xi[m],Y=u||!!x,f=T.every(A=>A!==""),g=o?B(o):void 0,S=x?B(x):void 0,F=A=>Y?v.danger:f?v.success:v.border;c.useEffect(()=>{var A;l&&((A=j.current[0])==null||A.focus())},[]);const D=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=j.current[H])==null||Q.focus()},E=A=>H=>{if(!d){if(H.key==="Backspace"){if(H.preventDefault(),T[A]!==""){const Q=[...T];Q[A]="",D(Q)}else if(A>0){const Q=[...T];Q[A-1]="",D(Q),V(A-1)}return}if(H.key==="Delete"){H.preventDefault();const Q=[...T];Q[A]="",D(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}}},P=A=>H=>{if(d)return;const G=H.target.value.slice(-1);if(!G)return;const ne=Xr(G,s);if(!ne)return;const pe=[...T];pe[A]=ne,D(pe),A<e-1&&V(A+1)},W=A=>H=>{if(H.preventDefault(),d)return;const G=H.clipboardData.getData("text").split("").map(xe=>Xr(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++}D(ne),V(Math.min(pe,e-1))},O=[g&&w,Y&&C].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{className:ue(b("flex flex-col gap-2 w-fit"),y),style:z,children:[t.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":O,className:b("flex items-center"),style:{gap:k.gap},children:Array.from({length:e},(A,H)=>{const Q=F();return typeof document<"u"&&(document.activeElement,j.current[H]),t.jsxs("div",{className:b("flex items-center"),style:{gap:k.gap},children:[p&&h===H&&H!==0&&t.jsx("span",{"aria-hidden":"true",style:{color:v.textMuted,userSelect:"none",flexShrink:0},children:p}),t.jsx("input",{ref:G=>{j.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:P(H),onKeyDown:E(H),onPaste:W(H),onFocus:G=>G.target.select(),style:{width:k.box,height:k.box,textAlign:"center",fontSize:k.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${Q}`,borderRadius:"8px",backgroundColor:d?v.surfaceAlt:v.surface,color:v.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=Y?v.danger:v.primary,G.currentTarget.style.boxShadow=`0 0 0 3px ${Y?v.danger:v.primary}33`)},onBlurCapture:G=>{G.currentTarget.style.borderColor=F(),G.currentTarget.style.boxShadow="none"}})]},H)})}),g&&!S&&t.jsx("span",{id:w,className:b("text-xs"),style:{color:v.textMuted},children:g}),S&&t.jsxs("span",{id:C,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:v.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"})}),S]})]})}Xn.displayName="TkxOTP";function Zi(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 Gi(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 Ji(){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 er(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 Qi(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=er(e,i.label),a=i.description?er(e,i.description):{matched:!1,score:0},l=(i.keywords??[]).some(d=>er(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 ea({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 ta({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 qn({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),[y,z]=c.useState(!1),v=c.useRef(null),$=c.useRef(null),w=c.useId(),C=Gi(r),I=Qi(o,e).slice(0,a),R=[];for(const f of I){const g=f.item.group,S=R.find(F=>F.group===g);S?S.items.push(f):R.push({group:g,items:[f]})}const M=R.flatMap(f=>f.items);Zi(()=>{n==null||n()},r),c.useEffect(()=>{r&&(m(""),h(0),setTimeout(()=>{var f;return(f=v.current)==null?void 0:f.focus()},30))},[r]),c.useEffect(()=>{p>=M.length&&h(Math.max(0,M.length-1))},[M.length,p]);const N=c.useCallback(f=>{const g=$.current;if(!g)return;const S=g.querySelectorAll("[data-command-item]")[f];S==null||S.scrollIntoView({block:"nearest"})},[]),T=f=>{if(f.key==="ArrowDown"){f.preventDefault();const g=Math.min(M.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=M[p];g&&j(g.item)}},j=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 k=B(i),Y=s?B(s):`No results for "${B(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 Be.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:w,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:v,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${w}-list`,"aria-activedescendant":M[p]?`${w}-item-${M[p].item.id}`:void 0,value:o,onChange:f=>{m(f.target.value),h(0)},onKeyDown:T,placeholder:k,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=v.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:`${w}-list`,ref:$,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},(f,g)=>t.jsx(ta,{surface:x.surface,border:x.border},g)):M.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:Y})]}):R.map(({group:f,items:g},S)=>{const F=R.slice(0,S).reduce((D,V)=>D+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:B(f)}),g.map((D,V)=>{const E=F+V,P=E===p,W=D.item;return t.jsxs("div",{id:`${w}-item-${W.id}`,role:"option","aria-selected":P,"aria-disabled":W.disabled,"data-command-item":!0,onClick:()=>j(W),onMouseEnter:()=>h(E),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:W.disabled?"not-allowed":"pointer",opacity:W.disabled?.45:1,backgroundColor:P?`${x.primary}18`:"transparent",borderLeft:P?`2px solid ${x.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[W.icon&&t.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:P?x.primary:x.textMuted},children:W.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(ea,{text:W.label,ranges:D.labelRanges,color:x.primary})}),W.description&&t.jsx("div",{style:{fontSize:"0.75rem",color:x.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:B(W.description)})]}),W.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:B(W.shortcut)})]},W.id)})]},f??"__default__")})}),M.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)}qn.displayName="TkxCommand";function It({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 Zn({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:y,arrowPosition:z="inside",height:v=320,className:$,style:w}){const C=ee(),I=ye(),R=c.useId(),M=e.length,[N,T]=c.useState(h),[j,k]=c.useState(s?h+1:h),[Y,f]=c.useState(!1),[g,S]=c.useState(!1),F=c.useRef(null),D=c.useRef(null),V=c.useRef(null),E=c.useRef(0),P=c.useRef(!1),W=u==="vertical",O=I?0:m,A=s&&M>1?[e[M-1],...e,e[0]]:e,H=A.length,Q=100/x,G=(q,te=0)=>{const be=te!==0?` - ${te}px`:"";return W?`translateY(calc(-${q*Q}%${be}))`:`translateX(calc(-${q*Q}%${be}))`},ne=c.useCallback((q,te=!1)=>{const be=s?(q%M+M)%M:Math.max(0,Math.min(M-1,q)),$e=s?be+1:be;te&&F.current?(F.current.style.transition="none",k($e),T(be),F.current.offsetHeight,F.current.style.transition=""):(f(!0),k($e),T(be)),y==null||y(be)},[M,s,y]),pe=c.useCallback(()=>ne(N-1),[N,ne]),xe=c.useCallback(()=>ne(N+1),[N,ne]),oe=c.useCallback(()=>{f(!1),!(!s||M<=1)&&(j===0?ne(M-1,!0):j===H-1&&ne(0,!0))},[s,M,j,H,ne]);c.useEffect(()=>{if(!(!r||g||M<=1))return D.current=setInterval(xe,n),()=>{D.current&&clearInterval(D.current)}},[r,g,n,xe,M]),c.useEffect(()=>{const q=te=>{const be=document.activeElement,$e=document.getElementById(R);$e!=null&&$e.contains(be)&&(te.key===(W?"ArrowUp":"ArrowLeft")&&(te.preventDefault(),pe()),te.key===(W?"ArrowDown":"ArrowRight")&&(te.preventDefault(),xe()))};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[R,W,pe,xe]);const me=q=>"touches"in q?W?q.touches[0].clientY:q.touches[0].clientX:W?q.clientY:q.clientX,X=q=>{p&&(V.current=me(q),E.current=0,P.current=!0)},Z=q=>{if(!P.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(j,-te))},ve=()=>{if(!P.current)return;P.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(j)),V.current=null,E.current=0},we=typeof v=="number"?`${v}px`:v,de={display:"flex",flexDirection:W?"column":"row",width:W?"100%":`${H/x*100}%`,height:W?`${H/x*100}%`:"100%",transform:G(j),transition:Y||!I?`transform ${O}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:o>0?o:void 0},ge={flexShrink:0,width:W?"100%":`${Q/(H/x)}%`,height:W?`${Q/(H/x)}%`:"100%",overflow:"hidden",position:"relative"},J=s||N>0,ie=s||N<M-1,re=z==="outside";return t.jsxs("div",{id:R,className:ue(b("flex flex-col gap-2"),$),style:w,"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(It,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"outside",orientation:u}),t.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:we,borderRadius:12,cursor:p?P.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>i&&S(!0),onMouseLeave:()=>{S(!1),ve()},onTouchStart:X,onTouchMove:Z,onTouchEnd:ve,onMouseDown:X,onMouseMove:Z,onMouseUp:ve,"aria-live":"polite","aria-atomic":"false",children:[a&&!re&&t.jsxs(t.Fragment,{children:[t.jsx(It,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"inside",orientation:u}),t.jsx(It,{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)+M)%M+1} of ${M}`,"aria-hidden":(te-(s?1:0)+M)%M!==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(It,{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))})]})}Zn.displayName="TkxCarousel";const Ft={close:"Close",cancel:"Cancel",confirm:"Confirm",save:"Save",delete:"Delete",search:"Search",loading:"Loading...",noResults:"No results found",required:"Required",previous:"Previous",next:"Next",pageOf:(e,r)=>`Page ${e} of ${r}`,selectPlaceholder:"Select...",clearSelection:"Clear selection",selectDate:"Select a date",today:"Today",dropFiles:"Drop files here or",browse:"Browse",noData:"No data available",sortAscending:"Sort ascending",sortDescending:"Sort descending"},Gn={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",delete:"Eliminar",search:"Buscar",loading:"Cargando...",noResults:"No se encontraron resultados",required:"Requerido",previous:"Anterior",next:"Siguiente",pageOf:(e,r)=>`Página ${e} de ${r}`,selectPlaceholder:"Seleccionar...",clearSelection:"Limpiar selección",selectDate:"Seleccionar fecha",today:"Hoy",dropFiles:"Suelte archivos aquí o",browse:"Explorar",noData:"No hay datos disponibles",sortAscending:"Orden ascendente",sortDescending:"Orden descendente"},Jn={close:"إغلاق",cancel:"إلغاء",confirm:"تأكيد",save:"حفظ",delete:"حذف",search:"بحث",loading:"...جارٍ التحميل",noResults:"لم يتم العثور على نتائج",required:"مطلوب",previous:"السابق",next:"التالي",pageOf:(e,r)=>`صفحة ${e} من ${r}`,selectPlaceholder:"...اختر",clearSelection:"مسح الاختيار",selectDate:"اختر تاريخ",today:"اليوم",dropFiles:"أفلت الملفات هنا أو",browse:"تصفح",noData:"لا توجد بيانات",sortAscending:"ترتيب تصاعدي",sortDescending:"ترتيب تنازلي"},Qn={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",save:"Enregistrer",delete:"Supprimer",search:"Rechercher",loading:"Chargement...",noResults:"Aucun résultat trouvé",required:"Obligatoire",previous:"Précédent",next:"Suivant",pageOf:(e,r)=>`Page ${e} sur ${r}`,selectPlaceholder:"Sélectionner...",clearSelection:"Effacer la sélection",selectDate:"Sélectionner une date",today:"Aujourd'hui",dropFiles:"Déposez les fichiers ici ou",browse:"Parcourir",noData:"Aucune donnée disponible",sortAscending:"Tri croissant",sortDescending:"Tri décroissant"},eo={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",save:"Speichern",delete:"Löschen",search:"Suchen",loading:"Wird geladen...",noResults:"Keine Ergebnisse gefunden",required:"Erforderlich",previous:"Zurück",next:"Weiter",pageOf:(e,r)=>`Seite ${e} von ${r}`,selectPlaceholder:"Auswählen...",clearSelection:"Auswahl löschen",selectDate:"Datum auswählen",today:"Heute",dropFiles:"Dateien hier ablegen oder",browse:"Durchsuchen",noData:"Keine Daten verfügbar",sortAscending:"Aufsteigend sortieren",sortDescending:"Absteigend sortieren"},to={close:"閉じる",cancel:"キャンセル",confirm:"確認",save:"保存",delete:"削除",search:"検索",loading:"読み込み中...",noResults:"結果が見つかりません",required:"必須",previous:"前へ",next:"次へ",pageOf:(e,r)=>`${r}ページ中${e}ページ`,selectPlaceholder:"選択...",clearSelection:"選択解除",selectDate:"日付を選択",today:"今日",dropFiles:"ファイルをドロップまたは",browse:"参照",noData:"データなし",sortAscending:"昇順",sortDescending:"降順"},ro={"en-US":Ft,"es-ES":Gn,"ar-SA":Jn,"fr-FR":Qn,"de-DE":eo,"ja-JP":to},ra=new Set(["ar-SA","he-IL","fa-IR","ur-PK"]);function no(e){return ra.has(e)}const xt=c.createContext({locale:"en-US",direction:"ltr",strings:Ft});function na(){return c.useContext(xt)}function oa(){return c.useContext(xt).strings}function sa(){return c.useContext(xt).direction}function ia({locale:e="en-US",direction:r,strings:n,children:i}){const s=c.useMemo(()=>{const a=ro[e]??Ft,l=n?{...a,...n}:a,d=r??(no(e)?"rtl":"ltr");return{locale:e,direction:d,strings:l}},[e,r,n]);return t.jsx(xt.Provider,{value:s,children:t.jsx("div",{dir:s.direction,style:{direction:s.direction},children:i})})}function aa({contentId:e="tkx-main-content",label:r="Skip to main content"}){return t.jsx("a",{href:`#${e}`,className:"tkx-skip-nav",children:r})}function la({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 ca({active:e,children:r,as:n="div"}){const i=Dt(e);return t.jsx(n,{ref:i,children:r})}function da({as:e,children:r,...n}){const i=e??"span";return t.jsx(i,{className:"tkx-sr-only",...n,children:r})}exports.FocusTrap=ca;exports.I18nContext=xt;exports.I18nProvider=ia;exports.LOCALES=ro;exports.LRUCache=qr;exports.LiveRegion=la;exports.Quantum=xo;exports.Shield=No;exports.SkipNav=aa;exports.TKX=bo;exports.ThemeContext=pr;exports.ThemeProvider=Co;exports.TkxAccordion=An;exports.TkxAlert=as;exports.TkxAvatar=Mn;exports.TkxBadge=kn;exports.TkxButton=bn;exports.TkxCard=yn;exports.TkxCardBody=Qo;exports.TkxCardFooter=es;exports.TkxCardHeader=Jo;exports.TkxCarousel=Zn;exports.TkxChat=bi;exports.TkxChatBubble=Bn;exports.TkxCheckbox=In;exports.TkxClock=On;exports.TkxColorPicker=_i;exports.TkxCommand=qn;exports.TkxDatePicker=Dn;exports.TkxDivider=Cn;exports.TkxDrawer=Os;exports.TkxFileUpload=ai;exports.TkxImage=ni;exports.TkxInput=vn;exports.TkxMenu=Vn;exports.TkxModal=ds;exports.TkxNumberInput=Kn;exports.TkxOTP=Xn;exports.TkxPagination=Fn;exports.TkxProgress=wn;exports.TkxRadio=zn;exports.TkxRadioGroup=Ts;exports.TkxRating=xi;exports.TkxSelect=Tn;exports.TkxSkeleton=mr;exports.TkxSlider=Ln;exports.TkxStepper=_n;exports.TkxTab=ps;exports.TkxTabList=fs;exports.TkxTabPanel=hs;exports.TkxTabPanels=xs;exports.TkxTable=ks;exports.TkxTabs=us;exports.TkxTag=Wn;exports.TkxTagInput=Si;exports.TkxThinkingIndicator=Pn;exports.TkxTimeline=Ci;exports.TkxToastProvider=Ls;exports.TkxToggle=jn;exports.TkxTooltip=gs;exports.TkxVideoPlayer=Yn;exports.VisuallyHidden=da;exports.WCAGEngine=jo;exports.arSA=Jn;exports.audit=fn;exports.auroraLight=So;exports.batchUpdate=Jr;exports.contrastRatio=it;exports.createFocusTrap=cr;exports.createTheme=Mo;exports.css=tn;exports.cssVar=ar;exports.cx=ue;exports.deDE=eo;exports.enUS=Ft;exports.esES=Gn;exports.extractAtomicCSS=_o;exports.extractCSS=lr;exports.fnv1aHash=tt;exports.frFR=Qn;exports.fromObject=rn;exports.getAccessibleForeground=Ue;exports.getAuditLog=pn;exports.injectStyles=sn;exports.isRTL=no;exports.jaJP=to;exports.keyframes=on;exports.meetsAA=zt;exports.meetsAAA=an;exports.memoize=Zr;exports.prefersHighContrast=ur;exports.prefersReducedMotion=dr;exports.quantumDark=fr;exports.resetAtomicCSS=Uo;exports.responsive=nn;exports.sanitizeProps=xr;exports.sanitizeString=B;exports.tkx=b;exports.tx=Yo;exports.useAnnounce=hr;exports.useClickOutside=hn;exports.useDirection=sa;exports.useEscapeKey=Lt;exports.useFocusTrap=Dt;exports.useHighContrast=Ro;exports.useI18n=na;exports.useLocale=oa;exports.useReducedMotion=ye;exports.useTheme=ee;exports.useTkxCommand=Ji;exports.useToast=zs;exports.validateProps=At;exports.verifyAuditIntegrity=xn;
70
+ `}),t.jsx("div",{style:{width:i,height:i,minWidth:i,borderRadius:"50%",border:`${L}px solid ${N}`,backgroundColor:M,color:j,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:y?"none":"background-color 0.2s, border-color 0.2s",...I,...T},children:$})]})}function tn({completed:e,orientation:r,connectorStyle:n,connectorWidth:o,primary:i,border:l,reducedMotion:c}){const d=e?i:l;return r==="horizontal"?t.jsx("div",{"aria-hidden":"true",style:{flex:1,height:o,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:c?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):t.jsx("div",{"aria-hidden":"true",style:{width:o,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:c?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function $o({steps:e,activeStep:r=0,orientation:n="horizontal",variant:o="default",size:i="md",clickable:l=!1,onStepClick:c,showStepNumbers:d=!0,alternateLabel:u=!1,connector:f="solid",className:s,style:m}){const p=U(),x=te(),y=_a[i],v=(g,w)=>g.status?g.status:w<r?"completed":w===r?"active":"pending",b=n==="horizontal";return t.jsx("div",{className:s,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:b?"row":"column",alignItems:b?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map((g,w)=>{const S=v(g,w),M=w===e.length-1,N=S==="completed"||w<r,j=w%2===0,L=()=>{l&&(c==null||c(w))},I=t.jsx(Ka,{status:S,index:w,showStepNumbers:d,icon:g.icon,circleSize:y.circle,fontSize:y.fontSize,primary:p.primary,danger:p.danger,success:p.success,text:p.text,textMuted:p.textMuted,border:p.border,surface:p.surface,variant:o,reducedMotion:x,clickable:l}),T=t.jsxs("div",{style:{textAlign:b&&!u?"center":"left",maxWidth:b?120:void 0},children:[t.jsxs("div",{style:{fontSize:y.titleSize,fontWeight:S==="active"?600:500,color:S==="pending"?p.textMuted:S==="error"?p.danger:p.text,lineHeight:1.3,transition:x?"none":"color 0.2s"},children:[R(g.title),g.optional&&t.jsx("span",{style:{fontSize:y.descSize,color:p.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),g.description&&t.jsx("div",{style:{fontSize:y.descSize,color:p.textMuted,marginTop:2,lineHeight:1.4},children:R(g.description)}),g.error&&S==="error"&&t.jsx("div",{style:{fontSize:y.descSize,color:p.danger,marginTop:2},children:R(g.error)})]});return b?t.jsxs("div",{role:"listitem",style:{display:"flex",flex:M?0:1,alignItems:"center",minWidth:0},children:[t.jsxs("div",{onClick:L,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:l?"pointer":"default",flexShrink:0},"aria-current":S==="active"?"step":void 0,children:[u&&!j&&t.jsx("div",{style:{minHeight:y.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:T}),I,!u&&T,u&&j&&t.jsx("div",{style:{marginTop:6},children:T})]}),!M&&t.jsx(tn,{completed:N,orientation:"horizontal",connectorStyle:f,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:x})]},g.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:L,style:{cursor:l?"pointer":"default"},"aria-current":S==="active"?"step":void 0,children:I}),!M&&t.jsx(tn,{completed:N,orientation:"vertical",connectorStyle:f,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:x})]}),t.jsx("div",{style:{paddingTop:(y.circle-parseFloat(y.titleSize)*16)/2,paddingBottom:M?0:16,flex:1,minWidth:0},children:T})]},g.id)})})}$o.displayName="TkxStepper";function Mo(e){let r=0,n=0,o=0;const i=e.replace("#","");i.length===3?(r=parseInt(i[0]+i[0],16),n=parseInt(i[1]+i[1],16),o=parseInt(i[2]+i[2],16)):i.length>=6&&(r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),o=parseInt(i.slice(4,6),16)),r/=255,n/=255,o/=255;const l=Math.max(r,n,o),c=Math.min(r,n,o);let d=0,u=0;const f=(l+c)/2;if(l!==c){const s=l-c;switch(u=f>.5?s/(2-l-c):s/(l+c),l){case r:d=((n-o)/s+(n<o?6:0))/6;break;case n:d=((o-r)/s+2)/6;break;case o:d=((r-n)/s+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(f*100)]}function pr(e,r,n){r/=100,n/=100;const o=r*Math.min(n,1-n),i=l=>{const c=(l+e/30)%12,d=n-o*Math.max(Math.min(c-3,9-c,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function Yt(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16),o=parseInt(r.slice(2,4),16),i=parseInt(r.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(i)?0:i]}function sr(e,r,n){return`#${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function ut(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function ir(e,r,n){if(n==="hex")return r<1?`${e}${Math.round(r*255).toString(16).padStart(2,"0")}`:e;const[o,i,l]=Yt(e);if(n==="rgb")return r<1?`rgba(${o}, ${i}, ${l}, ${r.toFixed(2)})`:`rgb(${o}, ${i}, ${l})`;const[c,d,u]=Mo(e);return n==="hsl"?r<1?`hsla(${c}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${c}, ${d}%, ${u}%)`:e}const Xa=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function qa({hue:e,sat:r,bright:n,onChange:o}){const i=a.useRef(null),l=a.useRef(!1),c=a.useCallback(f=>{const s=i.current;if(!s)return;const m=s.getBoundingClientRect(),p=Math.max(0,Math.min(1,(f.clientX-m.left)/m.width)),x=Math.max(0,Math.min(1,(f.clientY-m.top)/m.height));o(Math.round(p*100),Math.round((1-x)*100))},[o]);a.useEffect(()=>{const f=m=>{l.current&&c(m)},s=()=>{l.current=!1};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",s)}},[c]);const d=`${r}%`,u=`${100-n}%`;return t.jsxs("div",{ref:i,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:f=>{l.current=!0,c(f)},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:pr(e,r,n/2+25)}})]})}function Za({hue:e,onChange:r}){const n=a.useRef(null),o=a.useRef(!1),i=a.useCallback(l=>{const c=n.current;if(!c)return;const d=c.getBoundingClientRect(),u=Math.max(0,Math.min(1,(l.clientX-d.left)/d.width));r(Math.round(u*360))},[r]);return a.useEffect(()=>{const l=d=>{o.current&&i(d)},c=()=>{o.current=!1};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)}},[i]),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:l=>{o.current=!0,i(l)},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 Ga({alpha:e,hex:r,onChange:n}){const o=a.useRef(null),i=a.useRef(!1),l=a.useCallback(f=>{const s=o.current;if(!s)return;const m=s.getBoundingClientRect(),p=Math.max(0,Math.min(1,(f.clientX-m.left)/m.width));n(Math.round(p*100)/100)},[n]);a.useEffect(()=>{const f=m=>{i.current&&l(m)},s=()=>{i.current=!1};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",s)}},[l]);const[c,d,u]=Yt(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:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${c},${d},${u},0), rgba(${c},${d},${u},1))`},onMouseDown:f=>{i.current=!0,l(f)},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(${c},${d},${u},${e})`,pointerEvents:"none"}})})]})}function Ja({value:e,defaultValue:r="#3b82f6",onChange:n,format:o="hex",showAlpha:i=!1,presets:l=Xa,disabled:c=!1,size:d="md",placeholder:u,label:f,style:s}){const m=U(),p=a.useRef(null),x=a.useRef(null),[y,v]=a.useState(!1),b=e!==void 0,[g,w]=a.useState(b&&e||r),S=b?e||r:g,[M,N]=a.useState(1),[j,L]=a.useState(S),[I,T]=a.useState({top:0,left:0}),[$,z,E]=Mo(ut(S)?S:r),C=a.useCallback((X,se=M)=>{ut(X)&&(L(X),b||w(X),n==null||n(ir(X,se,o),o))},[M,b,o,n]);a.useEffect(()=>{b&&e&&ut(e)&&L(e)},[b,e]);const k=()=>{if(c)return;const X=p.current;if(!X)return;const se=X.getBoundingClientRect(),Se=window.innerHeight-se.bottom>320?se.bottom+6:se.top-326;T({top:Se+window.scrollY,left:se.left+window.scrollX}),v(!0)};a.useEffect(()=>{if(!y)return;const X=se=>{x.current&&!x.current.contains(se.target)&&p.current&&!p.current.contains(se.target)&&v(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[y]),a.useEffect(()=>{if(!y)return;const X=se=>{se.key==="Escape"&&v(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[y]);const A=(X,se)=>{const he=se/100,Se=X/100,de=he*(1-Se/2),be=de===0||de===1?0:(he-de)/Math.min(de,1-de),ne=pr($,Math.round(be*100),Math.round(de*100));C(ne)},D=X=>{const se=pr(X,z,E);C(se)},O=X=>{N(X),n==null||n(ir(S,X,o),o)},W=X=>{const se=X.target.value;L(se),ut(se)&&C(se)},H=(X,se)=>{const he=Math.max(0,Math.min(255,parseInt(se)||0)),[Se,de,be]=Yt(S),ne=X==="r"?sr(he,de,be):X==="g"?sr(Se,he,be):sr(Se,de,he);C(ne)},P={sm:28,md:34,lg:40}[d],[F,V,Q]=Yt(ut(S)?S:r),re={display:"inline-flex",alignItems:"center",gap:"8px",height:`${P}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:c?"not-allowed":"pointer",opacity:c?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...s},ie={width:`${P-8}px`,height:`${P-8}px`,borderRadius:"4px",backgroundColor:`rgba(${F},${V},${Q},${M})`,border:`1px solid ${m.border}`,flexShrink:0},fe={position:"absolute",top:I.top,left:I.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"},ve={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"},ge=X=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:X,border:X.toLowerCase()===S.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return t.jsxs(t.Fragment,{children:[f&&t.jsx("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:f}),t.jsxs("button",{ref:p,type:"button",style:re,onClick:k,disabled:c,"aria-label":`Color picker, current color ${S}`,"aria-haspopup":"dialog","aria-expanded":y,children:[t.jsx("div",{style:ie}),t.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??ir(ut(S)?S:r,M,o)})]}),y&&Ne.createPortal(t.jsxs("div",{ref:x,style:fe,role:"dialog","aria-label":"Color picker",children:[t.jsx(qa,{hue:$,sat:z,bright:E,onChange:A}),t.jsx(Za,{hue:$,onChange:D}),i&&t.jsx(Ga,{alpha:M,hex:ut(S)?S:r,onChange:O}),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(${F},${V},${Q},${M})`,border:`1px solid ${m.border}`}}),t.jsx("input",{style:xe,value:j,onChange:W,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 se=X==="r"?F:X==="g"?V:Q;return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:ve,type:"number",min:0,max:255,value:se,onChange:he=>H(X,he.target.value),"aria-label":`${X.toUpperCase()} channel`}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:X})]},X)}),i&&t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:ve,type:"number",min:0,max:100,value:Math.round(M*100),onChange:X=>O(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%"})]})]}),l.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:l.map(X=>t.jsx("button",{type:"button",style:ge(X),onClick:()=>C(X),"aria-label":`Select color ${X}`,onMouseEnter:se=>{se.currentTarget.style.transform="scale(1.15)"},onMouseLeave:se=>{se.currentTarget.style.transform="scale(1)"}},X))})]})]}),document.body)]})}const Qa={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 rn(e,r,n){let o=e;return r!==void 0&&(o=Math.max(o,r)),n!==void 0&&(o=Math.min(o,n)),o}function ar(e,r){if(r===void 0)return e;const n=Math.pow(10,r);return Math.round(e*n)/n}function el(e,r,n,o,i){const l=o??"en-US";return r==="currency"?new Intl.NumberFormat(l,{style:"currency",currency:n??"USD",minimumFractionDigits:i??2,maximumFractionDigits:i??2}).format(e):r==="percent"?new Intl.NumberFormat(l,{style:"percent",minimumFractionDigits:i??0,maximumFractionDigits:i??0}).format(e/100):r==="decimal"||i!==void 0?new Intl.NumberFormat(l,{minimumFractionDigits:i??0,maximumFractionDigits:i??20}).format(e):String(e)}function nn({direction:e,isDisabled:r,btnW:n,height:o,primaryColor:i,borderColor:l,textMuted:c,iconSz:d,onStep:u}){const f=a.useRef(null),s=a.useRef(null),m=e==="inc"?1:-1,p=a.useCallback(()=>{u(m),f.current=setTimeout(()=>{s.current=setInterval(()=>u(m),60)},400)},[m,u]),x=a.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),s.current&&(clearInterval(s.current),s.current=null)},[]);a.useEffect(()=>()=>x(),[x]);const y=e==="inc";return t.jsx("button",{type:"button","aria-label":y?"Increment":"Decrement",disabled:r,onMouseDown:p,onMouseUp:x,onMouseLeave:x,onTouchStart:v=>{v.preventDefault(),p()},onTouchEnd:x,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:y?void 0:`1px solid ${l}`,borderLeft:y?`1px solid ${l}`:void 0,cursor:r?"not-allowed":"pointer",color:r?c:i,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:v=>{r||(v.currentTarget.style.background=`${i}12`)},onBlur:v=>{v.currentTarget.style.background="transparent"},children:y?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 Co({value:e,defaultValue:r=0,onChange:n,min:o,max:i,step:l=1,precision:c,prefix:d,suffix:u,format:f,currency:s,locale:m,clampOnBlur:p=!0,allowMouseWheel:x=!1,size:y="md",label:v,hint:b,isDisabled:g=!1,isReadOnly:w=!1,isInvalid:S=!1,errorMessage:M,id:N,className:j,style:L}){const I=U(),T=a.useId(),$=N??T,z=`${$}-hint`,E=`${$}-error`,C=e!==void 0,[k,A]=a.useState(r),D=C?e:k,[O,W]=a.useState(!1),[H,B]=a.useState(""),P=Qa[y],F=S||!!M,V=F?I.danger:O?I.primary:I.border,Q=[b&&z,F&&E].filter(Boolean).join(" ")||void 0,re=v?R(v):void 0,ie=b?R(b):void 0,fe=M?R(M):void 0,xe=d?R(d):void 0,ve=u?R(u):void 0,ge=a.useCallback(K=>{const G=ar(K,c);C||A(G),n==null||n(G)},[C,n,c]),X=a.useCallback(K=>{if(g||w)return;const G=rn(ar(D+K*l,c),o,i);ge(G)},[g,w,D,l,c,o,i,ge]),se=()=>{W(!0),B(String(D))},he=()=>{W(!1);const K=parseFloat(H);if(isNaN(K)){n==null||n(null),B(String(D));return}let G=ar(K,c);p&&(G=rn(G,o,i)),ge(G)},Se=K=>{B(K.target.value)},de=K=>{K.key==="ArrowUp"&&(K.preventDefault(),X(1)),K.key==="ArrowDown"&&(K.preventDefault(),X(-1))},be=K=>{!x||!O||(K.preventDefault(),X(K.deltaY<0?1:-1))},ne=O?H:el(D,f,s,m,c),q=(xe||ve)&&!O;return t.jsxs("div",{className:ae(h("flex flex-col gap-1 w-full"),j),style:L,children:[re&&t.jsx("label",{htmlFor:$,className:h("text-sm font-medium font-sans"),style:{color:I.text},children:re}),t.jsxs("div",{className:h("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${V}`,backgroundColor:g?I.surfaceAlt:I.surface,opacity:g?.65:1,height:P.height},children:[t.jsx(nn,{direction:"dec",isDisabled:g||w,btnW:P.btnW,height:P.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:P.iconSz,onStep:X}),t.jsxs("div",{className:h("relative flex-1 flex items-center overflow-hidden"),children:[q&&xe&&t.jsx("span",{style:{position:"absolute",left:P.px,fontSize:P.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:xe}),t.jsx("input",{id:$,type:"text",inputMode:"decimal",value:O?H:ne,readOnly:w,disabled:g,"aria-invalid":F,"aria-describedby":Q,"aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":D,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:P.fontSize,fontFamily:"inherit",color:I.text,paddingLeft:q&&xe?`calc(${P.px} + 1.2em)`:P.px,paddingRight:q&&ve?`calc(${P.px} + 1.2em)`:P.px,cursor:g?"not-allowed":w?"default":"text"},onFocus:se,onBlur:he,onChange:Se,onKeyDown:de,onWheel:be}),q&&ve&&t.jsx("span",{style:{position:"absolute",right:P.px,fontSize:P.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:ve})]}),t.jsx(nn,{direction:"inc",isDisabled:g||w,btnW:P.btnW,height:P.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:P.iconSz,onStep:X})]}),ie&&!fe&&t.jsx("span",{id:z,className:h("text-xs"),style:{color:I.textMuted},children:ie}),fe&&t.jsxs("span",{id:E,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:I.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"})}),fe]})]})}Co.displayName="TkxNumberInput";const tl={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},rl={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function on(e,r){return rl[r].test(e)?e.toUpperCase():""}function To({length:e=6,value:r,onChange:n,onComplete:o,type:i="number",mask:l=!1,autoFocus:c=!1,isDisabled:d=!1,isInvalid:u=!1,errorMessage:f,hint:s,size:m="md",separator:p,separatorPosition:x,className:y,style:v}){const b=U(),g=a.useId(),w=`${g}-hint`,S=`${g}-error`,M=r!==void 0,N=F=>{const V=F.split("").slice(0,e);for(;V.length<e;)V.push("");return V},[j,L]=a.useState(()=>N(M?r:"")),I=M?N(r):j,T=a.useRef([]),$=tl[m],z=u||!!f,E=I.every(F=>F!==""),C=s?R(s):void 0,k=f?R(f):void 0,A=F=>z?b.danger:E?b.success:b.border;a.useEffect(()=>{var F;c&&((F=T.current[0])==null||F.focus())},[]);const D=a.useCallback(F=>{M||L(F);const V=F.join("");n==null||n(V),F.every(Q=>Q!=="")&&(o==null||o(V))},[M,n,o]),O=F=>{var Q;const V=Math.max(0,Math.min(e-1,F));(Q=T.current[V])==null||Q.focus()},W=F=>V=>{if(!d){if(V.key==="Backspace"){if(V.preventDefault(),I[F]!==""){const Q=[...I];Q[F]="",D(Q)}else if(F>0){const Q=[...I];Q[F-1]="",D(Q),O(F-1)}return}if(V.key==="Delete"){V.preventDefault();const Q=[...I];Q[F]="",D(Q);return}if(V.key==="ArrowLeft"){V.preventDefault(),O(F-1);return}if(V.key==="ArrowRight"){V.preventDefault(),O(F+1);return}if(V.key==="Home"){V.preventDefault(),O(0);return}if(V.key==="End"){V.preventDefault(),O(e-1);return}}},H=F=>V=>{if(d)return;const re=V.target.value.slice(-1);if(!re)return;const ie=on(re,i);if(!ie)return;const fe=[...I];fe[F]=ie,D(fe),F<e-1&&O(F+1)},B=F=>V=>{if(V.preventDefault(),d)return;const re=V.clipboardData.getData("text").split("").map(xe=>on(xe,i)).filter(Boolean);if(!re.length)return;const ie=[...I];let fe=F;for(const xe of re){if(fe>=e)break;ie[fe]=xe,fe++}D(ie),O(Math.min(fe,e-1))},P=[C&&w,z&&S].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{className:ae(h("flex flex-col gap-2 w-fit"),y),style:v,children:[t.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":P,className:h("flex items-center"),style:{gap:$.gap},children:Array.from({length:e},(F,V)=>{const Q=A();return typeof document<"u"&&(document.activeElement,T.current[V]),t.jsxs("div",{className:h("flex items-center"),style:{gap:$.gap},children:[p&&x===V&&V!==0&&t.jsx("span",{"aria-hidden":"true",style:{color:b.textMuted,userSelect:"none",flexShrink:0},children:p}),t.jsx("input",{ref:re=>{T.current[V]=re},type:l?"password":"text",inputMode:i==="number"?"numeric":"text",maxLength:1,value:I[V],disabled:d,"aria-label":`Digit ${V+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:H(V),onKeyDown:W(V),onPaste:B(V),onFocus:re=>re.target.select(),style:{width:$.box,height:$.box,textAlign:"center",fontSize:$.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${Q}`,borderRadius:"8px",backgroundColor:d?b.surfaceAlt:b.surface,color:b.text,outline:"none",boxShadow:"none",cursor:d?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:d?.6:1},onFocusCapture:re=>{d||(re.currentTarget.style.borderColor=z?b.danger:b.primary,re.currentTarget.style.boxShadow=`0 0 0 3px ${z?b.danger:b.primary}33`)},onBlurCapture:re=>{re.currentTarget.style.borderColor=A(),re.currentTarget.style.boxShadow="none"}})]},V)})}),C&&!k&&t.jsx("span",{id:w,className:h("text-xs"),style:{color:b.textMuted},children:C}),k&&t.jsxs("span",{id:S,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:b.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"})}),k]})]})}To.displayName="TkxOTP";function nl(e,r){a.useEffect(()=>{if(!r)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r])}function ol(e){const r=a.useRef(null);return a.useEffect(()=>{if(!e||!r.current)return;const n=r.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),i=o[0],l=o[o.length-1],c=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===i&&(d.preventDefault(),l==null||l.focus()):document.activeElement===l&&(d.preventDefault(),i==null||i.focus()))};return n.addEventListener("keydown",c),()=>n.removeEventListener("keydown",c)},[e]),r}function sl(){const[e,r]=a.useState(!1),n=a.useCallback(()=>r(!0),[]),o=a.useCallback(()=>r(!1),[]),i=a.useCallback(()=>r(l=>!l),[]);return{isOpen:e,open:n,close:o,toggle:i}}function lr(e,r){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=r.toLowerCase(),i=o.indexOf(n);if(i!==-1)return{matched:!0,ranges:[[i,i+n.length-1]],score:i===0?100:80};const l=[];let c=0,d=-1,u=-1;for(let f=0;f<o.length&&c<n.length;f++)o[f]===n[c]&&((u===-1||f!==u+1)&&(d!==-1&&l.push([d,u]),d=f),u=f,c++);return d!==-1&&u!==-1&&l.push([d,u]),c<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:l,score:40}}function il(e,r){if(!e.trim())return r.filter(o=>!o.disabled).map(o=>({item:o,score:0,labelRanges:[]}));const n=[];for(const o of r){if(o.disabled)continue;const i=lr(e,o.label),l=o.description?lr(e,o.description):{matched:!1,score:0},c=(o.keywords??[]).some(d=>lr(e,d).matched);i.matched?n.push({item:o,score:i.score+20,labelRanges:i.ranges}):l.matched?n.push({item:o,score:l.score,labelRanges:[]}):c&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((o,i)=>i.score-o.score)}function al({text:e,ranges:r,color:n}){if(!r.length)return t.jsx(t.Fragment,{children:e});const o=[];let i=0;for(const[l,c]of r)i<l&&o.push(t.jsx("span",{children:e.slice(i,l)},`t-${i}`)),o.push(t.jsx("span",{style:{color:n,fontWeight:700},children:e.slice(l,c+1)},`h-${l}`)),i=c+1;return i<e.length&&o.push(t.jsx("span",{children:e.slice(i)},"t-end")),t.jsx(t.Fragment,{children:o})}function ll({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 Eo({items:e,isOpen:r=!1,onClose:n,placeholder:o="Type a command or search…",emptyMessage:i,maxItems:l=8,onItemSelect:c,className:d,style:u}){const f=U(),[s,m]=a.useState(""),[p,x]=a.useState(0),[y,v]=a.useState(!1),b=a.useRef(null),g=a.useRef(null),w=a.useId(),S=ol(r),M=il(s,e).slice(0,l),N=[];for(const E of M){const C=E.item.group,k=N.find(A=>A.group===C);k?k.items.push(E):N.push({group:C,items:[E]})}const j=N.flatMap(E=>E.items);nl(()=>{n==null||n()},r),a.useEffect(()=>{r&&(m(""),x(0),setTimeout(()=>{var E;return(E=b.current)==null?void 0:E.focus()},30))},[r]),a.useEffect(()=>{p>=j.length&&x(Math.max(0,j.length-1))},[j.length,p]);const L=a.useCallback(E=>{const C=g.current;if(!C)return;const k=C.querySelectorAll("[data-command-item]")[E];k==null||k.scrollIntoView({block:"nearest"})},[]),I=E=>{if(E.key==="ArrowDown"){E.preventDefault();const C=Math.min(j.length-1,p+1);x(C),L(C)}else if(E.key==="ArrowUp"){E.preventDefault();const C=Math.max(0,p-1);x(C),L(C)}else if(E.key==="Enter"){E.preventDefault();const C=j[p];C&&T(C.item)}},T=E=>{var C;E.disabled||((C=E.onSelect)==null||C.call(E),c==null||c(E),n==null||n())};if(!r||typeof document>"u")return null;const $=R(o),z=i?R(i):`No results for "${R(s)}"`;if(typeof document<"u"&&!document.getElementById("tkx-shimmer-style")){const E=document.createElement("style");E.id="tkx-shimmer-style",E.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(E)}return Ne.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:S,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:w,className:ae(d),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:f.surface,border:`1px solid ${f.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${f.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 ${f.border}`},children:[t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:f.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:b,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${w}-list`,"aria-activedescendant":j[p]?`${w}-item-${j[p].item.id}`:void 0,value:s,onChange:E=>{m(E.target.value),x(0)},onKeyDown:I,placeholder:$,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:f.text}}),s&&t.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>{var E;m(""),x(0),(E=b.current)==null||E.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:f.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:`${w}-list`,ref:g,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},(E,C)=>t.jsx(ll,{surface:f.surface,border:f.border},C)):j.length===0?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:f.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:z})]}):N.map(({group:E,items:C},k)=>{const A=N.slice(0,k).reduce((D,O)=>D+O.items.length,0);return t.jsxs("div",{children:[E&&t.jsx("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:f.textMuted,padding:"10px 12px 4px"},children:R(E)}),C.map((D,O)=>{const W=A+O,H=W===p,B=D.item;return t.jsxs("div",{id:`${w}-item-${B.id}`,role:"option","aria-selected":H,"aria-disabled":B.disabled,"data-command-item":!0,onClick:()=>T(B),onMouseEnter:()=>x(W),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:B.disabled?"not-allowed":"pointer",opacity:B.disabled?.45:1,backgroundColor:H?`${f.primary}18`:"transparent",borderLeft:H?`2px solid ${f.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[B.icon&&t.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:H?f.primary:f.textMuted},children:B.icon}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.875rem",fontWeight:500,color:f.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.jsx(al,{text:B.label,ranges:D.labelRanges,color:f.primary})}),B.description&&t.jsx("div",{style:{fontSize:"0.75rem",color:f.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:R(B.description)})]}),B.shortcut&&t.jsx("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:f.textMuted,backgroundColor:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:R(B.shortcut)})]},B.id)})]},E??"__default__")})}),j.length>0&&t.jsxs("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${f.border}`,fontSize:"0.6875rem",color:f.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)}Eo.displayName="TkxCommand";function Pt({direction:e,onClick:r,isDisabled:n,primaryColor:o,position:i,orientation:l}){const c=l==="vertical",d=e==="prev",u=i==="inside"?{position:"absolute",zIndex:3,...c?{[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:f=>{f.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:f=>{f.currentTarget.style.boxShadow="none"},onMouseEnter:f=>{n||(f.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:c?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 Io({slides:e,autoPlay:r=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:i=!0,showArrows:l=!0,showDots:c=!0,showThumbnails:d=!1,orientation:u="horizontal",slidesToShow:f=1,gap:s=0,transitionDuration:m=400,swipeable:p=!0,initialIndex:x=0,onChange:y,arrowPosition:v="inside",height:b=320,className:g,style:w}){const S=U(),M=te(),N=a.useId(),j=e.length,[L,I]=a.useState(x),[T,$]=a.useState(i?x+1:x),[z,E]=a.useState(!1),[C,k]=a.useState(!1),A=a.useRef(null),D=a.useRef(null),O=a.useRef(null),W=a.useRef(0),H=a.useRef(!1),B=u==="vertical",P=M?0:m,F=i&&j>1?[e[j-1],...e,e[0]]:e,V=F.length,Q=100/f,re=(G,ee=0)=>{const ue=ee!==0?` - ${ee}px`:"";return B?`translateY(calc(-${G*Q}%${ue}))`:`translateX(calc(-${G*Q}%${ue}))`},ie=a.useCallback((G,ee=!1)=>{const ue=i?(G%j+j)%j:Math.max(0,Math.min(j-1,G)),ke=i?ue+1:ue;ee&&A.current?(A.current.style.transition="none",$(ke),I(ue),A.current.offsetHeight,A.current.style.transition=""):(E(!0),$(ke),I(ue)),y==null||y(ue)},[j,i,y]),fe=a.useCallback(()=>ie(L-1),[L,ie]),xe=a.useCallback(()=>ie(L+1),[L,ie]),ve=a.useCallback(()=>{E(!1),!(!i||j<=1)&&(T===0?ie(j-1,!0):T===V-1&&ie(0,!0))},[i,j,T,V,ie]);a.useEffect(()=>{if(!(!r||C||j<=1))return D.current=setInterval(xe,n),()=>{D.current&&clearInterval(D.current)}},[r,C,n,xe,j]),a.useEffect(()=>{const G=ee=>{const ue=document.activeElement,ke=document.getElementById(N);ke!=null&&ke.contains(ue)&&(ee.key===(B?"ArrowUp":"ArrowLeft")&&(ee.preventDefault(),fe()),ee.key===(B?"ArrowDown":"ArrowRight")&&(ee.preventDefault(),xe()))};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[N,B,fe,xe]);const ge=G=>"touches"in G?B?G.touches[0].clientY:G.touches[0].clientX:B?G.clientY:G.clientX,X=G=>{p&&(O.current=ge(G),W.current=0,H.current=!0)},se=G=>{if(!H.current||O.current===null)return;const ee=ge(G)-O.current;W.current=ee,A.current&&(A.current.style.transition="none",A.current.style.transform=re(T,-ee))},he=()=>{if(!H.current)return;H.current=!1;const G=W.current,ee=50;A.current&&(A.current.style.transition="",A.current.style.transform=""),G<-ee?xe():G>ee?fe():A.current&&(A.current.style.transform=re(T)),O.current=null,W.current=0},Se=typeof b=="number"?`${b}px`:b,de={display:"flex",flexDirection:B?"column":"row",width:B?"100%":`${V/f*100}%`,height:B?`${V/f*100}%`:"100%",transform:re(T),transition:z||!M?`transform ${P}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:s>0?s:void 0},be={flexShrink:0,width:B?"100%":`${Q/(V/f)}%`,height:B?`${Q/(V/f)}%`:"100%",overflow:"hidden",position:"relative"},ne=i||L>0,q=i||L<j-1,K=v==="outside";return t.jsxs("div",{id:N,className:ae(h("flex flex-col gap-2"),g),style:w,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[t.jsxs("div",{className:h("flex items-center gap-2"),style:{gap:K&&l?8:0},children:[l&&K&&t.jsx(Pt,{direction:"prev",onClick:fe,isDisabled:!ne,primaryColor:S.primary,position:"outside",orientation:u}),t.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:Se,borderRadius:12,cursor:p?H.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&k(!0),onMouseLeave:()=>{k(!1),he()},onTouchStart:X,onTouchMove:se,onTouchEnd:he,onMouseDown:X,onMouseMove:se,onMouseUp:he,"aria-live":"polite","aria-atomic":"false",children:[l&&!K&&t.jsxs(t.Fragment,{children:[t.jsx(Pt,{direction:"prev",onClick:fe,isDisabled:!ne,primaryColor:S.primary,position:"inside",orientation:u}),t.jsx(Pt,{direction:"next",onClick:xe,isDisabled:!q,primaryColor:S.primary,position:"inside",orientation:u})]}),t.jsx("div",{ref:A,style:de,onTransitionEnd:ve,children:F.map((G,ee)=>t.jsx("div",{style:be,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(ee-(i?1:0)+j)%j+1} of ${j}`,"aria-hidden":(ee-(i?1:0)+j)%j!==L,children:G.content},`${G.id}-${ee}`))}),c&&!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((G,ee)=>t.jsx("button",{type:"button","aria-label":`Go to slide ${ee+1}`,"aria-current":ee===L?"true":void 0,onClick:()=>ie(ee),style:{width:ee===L?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:ee===L?S.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:ue=>{ue.currentTarget.style.boxShadow=`0 0 0 3px ${S.primary}66`},onBlur:ue=>{ue.currentTarget.style.boxShadow="none"}},G.id))})]}),l&&K&&t.jsx(Pt,{direction:"next",onClick:xe,isDisabled:!q,primaryColor:S.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((G,ee)=>t.jsxs("button",{type:"button",role:"tab","aria-selected":ee===L,"aria-label":`Thumbnail for slide ${ee+1}`,onClick:()=>ie(ee),style:{flexShrink:0,width:60,height:42,border:`2px solid ${ee===L?S.primary:S.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:S.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:ue=>{ue.currentTarget.style.boxShadow=`0 0 0 3px ${S.primary}55`},onBlur:ue=>{ue.currentTarget.style.boxShadow="none"},children:[G.thumbnail?t.jsx("img",{src:G.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:S.textMuted,fontWeight:600},children:ee+1}),ee===L&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${S.primary}22`}})]},G.id))})]})}Io.displayName="TkxCarousel";function cl({color:e}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dl({onClick:e,bgColor:r,hoverColor:n,textColor:o}){const i=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),e())};return t.jsx("button",{type:"button",onClick:e,onKeyDown:i,"aria-label":"Show hidden breadcrumb items",className:h("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:r,color:o,transition:"background-color 150ms ease"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=n},onMouseLeave:l=>{l.currentTarget.style.backgroundColor=r},children:"…"})}function ul({items:e,separator:r,maxItems:n,onNavigate:o,className:i,style:l}){const c=U(),d=te(),u=n!==void 0&&n>1&&e.length>n,s=a.useCallback(()=>{if(!u||!n)return e.map((L,I)=>({item:L,originalIndex:I}));const S=Math.ceil((n-1)/2),M=n-1-S,N=e.slice(0,S).map((L,I)=>({item:L,originalIndex:I})),j=e.slice(e.length-M).map((L,I)=>({item:L,originalIndex:e.length-M+I}));return N.concat(j)},[e,n,u])(),m=u&&n?Math.ceil((n-1)/2):-1,p=(S,M)=>{o==null||o(S,M)},x=(S,M,N)=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),p(M,N))},y=d?{}:{transition:"color 150ms ease, background-color 150ms ease"},v=S=>t.jsx("li",{role:"presentation","aria-hidden":"true",className:h("flex items-center mx-1.5"),children:r??t.jsx(cl,{color:c.textMuted})},S),b=(S,M,N)=>{const j=R(S.label);if(N)return t.jsx("li",{children:t.jsxs("span",{"aria-current":"page",className:h("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:c.text},children:[S.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:S.icon}),j]})},`item-${M}`);const L=!!S.href,I={color:c.textMuted,textDecoration:"none",...y},T={onMouseEnter:z=>{z.currentTarget.style.color=c.primary},onMouseLeave:z=>{z.currentTarget.style.color=c.textMuted}},$=t.jsxs(t.Fragment,{children:[S.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:S.icon}),j]});return L?t.jsx("li",{children:t.jsx("a",{href:S.href,onClick:z=>{o&&(z.preventDefault(),p(S,M))},className:h("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...I,focusRingColor:c.primary},...T,children:$})},`item-${M}`):t.jsx("li",{children:t.jsx("button",{type:"button",onClick:()=>p(S,M),onKeyDown:z=>x(z,S,M),className:h("inline-flex items-center gap-1.5 text-sm rounded","border-none bg-transparent cursor-pointer p-0","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:I,...T,children:$})},`item-${M}`)},g=[];let w=!1;for(let S=0;S<s.length;S++){const{item:M,originalIndex:N}=s[S],j=N===e.length-1;u&&!w&&S===m&&(g.length>0&&g.push(v("sep-ellipsis-before")),g.push(t.jsx("li",{role:"presentation",children:t.jsx(dl,{onClick:()=>{},bgColor:c.surfaceAlt,hoverColor:c.surface,textColor:c.textMuted})},"ellipsis")),w=!0),g.length>0&&g[g.length-1]!==null&&g.push(v(`sep-${N}`)),g.push(b(M,N,j))}return t.jsx("nav",{"aria-label":"Breadcrumb",className:h("font-sans",i??""),style:{...l},children:t.jsx("ol",{role:"list",className:h("flex items-center flex-wrap list-none m-0 p-0"),children:g})})}const Ae=8,it=8;function fl(e,r,n){const o=r.getBoundingClientRect(),i=window.scrollX,l=window.scrollY,c=window.innerWidth,d=window.innerHeight;let u=0,f=0,s=n;const m={top:e.top-o.height-it-Ae>0,bottom:e.bottom+o.height+it+Ae<d,left:e.left-o.width-it-Ae>0,right:e.right+o.width+it+Ae<c};if(!m[n]){const x={top:"bottom",bottom:"top",left:"right",right:"left"};m[x[n]]&&(s=x[n])}switch(s){case"top":u=e.top+l-o.height-it-Ae,f=e.left+i+e.width/2-o.width/2;break;case"bottom":u=e.bottom+l+it+Ae,f=e.left+i+e.width/2-o.width/2;break;case"left":u=e.top+l+e.height/2-o.height/2,f=e.left+i-o.width-it-Ae;break;case"right":u=e.top+l+e.height/2-o.height/2,f=e.right+i+it+Ae;break}f=Math.max(8,Math.min(f,c+i-o.width-8)),u=Math.max(8,Math.min(u,d+l-o.height-8));const p={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:Ae};switch(s){case"top":Object.assign(p,{bottom:-Ae*2,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(p,{top:-Ae*2,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(p,{right:-Ae*2,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(p,{left:-Ae*2,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"});break}return{top:u,left:f,arrowStyle:p,resolvedPlacement:s}}function pl({trigger:e,content:r,placement:n="bottom",isOpen:o,onOpenChange:i,closeOnClickOutside:l=!0,className:c,style:d}){const u=U(),f=te(),s=a.useId(),m=o!==void 0,[p,x]=a.useState(!1),y=m?o:p,v=a.useRef(null),b=a.useRef(null);a.useRef(null);const[g,w]=a.useState(null),S=a.useCallback(I=>{m||x(I),i==null||i(I)},[m,i]),M=a.useCallback(()=>S(!1),[S]),N=a.useCallback(()=>S(!y),[S,y]);lt(M,y),a.useEffect(()=>{if(!y||!l)return;const I=T=>{var z,E;const $=T.target;(z=v.current)!=null&&z.contains($)||(E=b.current)!=null&&E.contains($)||M()};return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[y,l,M]),a.useEffect(()=>{if(!y||!v.current)return;const I=()=>{if(!v.current||!b.current)return;const T=v.current.getBoundingClientRect();w(fl(T,b.current,n))};return requestAnimationFrame(I),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[y,n]);const j=f?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},L=y&&typeof document<"u"?Ne.createPortal(t.jsxs("div",{ref:b,id:s,role:"dialog","aria-modal":"false",className:h("absolute z-[9100] rounded-lg font-sans",c??""),style:{"--tkx-popover-bg":u.surface,top:(g==null?void 0:g.top)??-9999,left:(g==null?void 0:g.left)??-9999,backgroundColor:u.surface,border:`1px solid ${u.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",minWidth:200,maxWidth:420,padding:"12px 16px",color:u.text,...j,...d},children:[g&&t.jsx("span",{style:g.arrowStyle,"aria-hidden":"true"}),r]}),document.body):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:v,className:h("inline-flex"),onClick:N,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),N())},"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":y?s:void 0,children:e}),L,y&&!f&&t.jsx("style",{children:`
71
+ @keyframes tkxPopoverFadeIn {
72
+ from { opacity: 0; transform: translateY(4px); }
73
+ to { opacity: 1; transform: translateY(0); }
74
+ }
75
+ `})]})}function xl(e,r){if(!r)return!0;const n=r.toLowerCase(),o=e.label.toLowerCase();let i=0;for(let l=0;l<o.length&&i<n.length;l++)o[l]===n[i]&&i++;return i===n.length}function hl(e,r){const n=e.getBoundingClientRect(),o=4,i=window.innerHeight-n.bottom,l=n.top,c=i>=r+o||i>=l?"below":"above";return{top:c==="below"?n.bottom+window.scrollY+o:n.top+window.scrollY-r-o,left:n.left+window.scrollX,width:n.width,placement:c}}function sn({color:e}){return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{animation:"spin 0.8s linear infinite",flexShrink:0},children:[t.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),t.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}const an=280;function ml({options:e,value:r,onChange:n,onInputChange:o,placeholder:i="",label:l,isLoading:c=!1,emptyMessage:d="No results found",filterFn:u,freeSolo:f=!1,className:s,style:m}){const p=U(),x=te(),y=a.useId(),v=a.useId(),b=a.useRef(null),g=a.useRef(null),[w,S]=a.useState(""),[M,N]=a.useState(!1),[j,L]=a.useState(-1),[I,T]=a.useState(null);a.useEffect(()=>{if(r!==void 0){const B=e.find(P=>P.value===r);S(B?B.label:r)}},[r,e]);const $=u??xl,z=a.useMemo(()=>M?e.filter(B=>$(B,w)):[],[e,w,M,$]),E=R(l),C=R(d);a.useEffect(()=>{if(!M||!g.current)return;const B=()=>{g.current&&T(hl(g.current,an))};return B(),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B)}},[M]),a.useEffect(()=>{if(!M)return;const B=P=>{var Q;const F=P.target;if((Q=g.current)!=null&&Q.contains(F))return;const V=document.getElementById(v);V!=null&&V.contains(F)||N(!1)};return document.addEventListener("pointerdown",B),()=>document.removeEventListener("pointerdown",B)},[M,v]),lt(()=>N(!1),M);const k=a.useCallback(B=>{var P;B.disabled||(S(B.label),n==null||n(B.value),N(!1),L(-1),(P=b.current)==null||P.focus())},[n]),A=B=>{const P=B.target.value;S(P),o==null||o(P),M||N(!0),L(-1),f&&(n==null||n(P))},D=B=>{if(!M&&(B.key==="ArrowDown"||B.key==="ArrowUp")){N(!0);return}switch(B.key){case"ArrowDown":{B.preventDefault(),L(P=>{let F=P+1;for(;F<z.length&&z[F].disabled;)F++;return F<z.length?F:P});break}case"ArrowUp":{B.preventDefault(),L(P=>{let F=P-1;for(;F>=0&&z[F].disabled;)F--;return F>=0?F:P});break}case"Enter":{B.preventDefault(),j>=0&&j<z.length?k(z[j]):f&&w&&(n==null||n(w),N(!1));break}case"Escape":{N(!1),L(-1);break}}};a.useEffect(()=>{var P;if(j<0)return;const B=`${v}-opt-${j}`;(P=document.getElementById(B))==null||P.scrollIntoView({block:"nearest"})},[j,v]);const O=j>=0?`${v}-opt-${j}`:void 0,W=x?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},H=M&&typeof document<"u"&&I?Ne.createPortal(t.jsx("ul",{id:v,role:"listbox","aria-label":E,className:h("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:I.top,left:I.left,width:I.width,maxHeight:an,backgroundColor:p.surface,border:`1px solid ${p.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...W},children:c?t.jsxs("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:h("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:p.textMuted},children:[t.jsx(sn,{color:p.primary}),"Loading..."]}):z.length===0?t.jsx("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:h("px-3 py-2 text-sm text-center"),style:{color:p.textMuted},children:C}):z.map((B,P)=>{const F=P===j,V=R(B.label),Q=B.description?R(B.description):null;return t.jsxs("li",{id:`${v}-opt-${P}`,role:"option","aria-selected":B.value===r,"aria-disabled":B.disabled||void 0,className:h("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",B.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:F?p.surfaceAlt:"transparent",color:B.disabled?p.textMuted:p.text,transition:x?"none":"background-color 100ms ease"},onMouseEnter:()=>!B.disabled&&L(P),onMouseDown:re=>{re.preventDefault(),k(B)},children:[B.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:B.icon}),t.jsxs("span",{className:h("flex flex-col min-w-0"),children:[t.jsx("span",{className:h("truncate"),children:V}),Q&&t.jsx("span",{className:h("text-xs truncate"),style:{color:p.textMuted},children:Q})]}),B.value===r&&t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:h("ml-auto flex-shrink-0"),children:t.jsx("path",{d:"M3 8l3.5 3.5L13 5",stroke:p.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},B.value)})}),document.body):null;return t.jsxs("div",{ref:g,className:h("relative font-sans",s??""),style:m,children:[t.jsx("label",{htmlFor:y,className:h("block text-sm font-medium mb-1.5"),style:{color:p.text},children:E}),t.jsxs("div",{className:h("relative flex items-center"),style:{backgroundColor:p.surface,border:`1px solid ${M?p.primary:p.border}`,borderRadius:8,transition:x?"none":"border-color 150ms ease"},children:[t.jsx("input",{ref:b,id:y,type:"text",role:"combobox","aria-expanded":M,"aria-controls":v,"aria-activedescendant":O,"aria-autocomplete":"list","aria-label":E,value:w,placeholder:i,onChange:A,onFocus:()=>N(!0),onKeyDown:D,className:h("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:p.text}}),c&&t.jsx("span",{className:h("pr-3"),children:t.jsx(sn,{color:p.primary})})]}),H,M&&!x&&t.jsx("style",{children:`
76
+ @keyframes tkxAutoFadeIn {
77
+ from { opacity: 0; transform: translateY(4px); }
78
+ to { opacity: 1; transform: translateY(0); }
79
+ }
80
+ `})]})}function gl(e,r){const n=[];function o(i,l){var c;for(const d of i)n.push({node:d,depth:l}),(c=d.children)!=null&&c.length&&r.has(d.id)&&o(d.children,l+1)}return o(e,0),n}function bl({expanded:e,color:r,reducedMotion:n}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:n?"none":"transform 150ms ease",flexShrink:0},children:t.jsx("path",{d:"M6 3l5 5-5 5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function yl({checked:e,color:r,borderColor:n}){return t.jsx("span",{role:"presentation","aria-hidden":"true",className:h("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?r:n}`,backgroundColor:e?r:"transparent",transition:"all 100ms ease"},children:e&&t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}const ln=24;function vl({data:e,selected:r,onSelect:n,expanded:o,onExpand:i,multiSelect:l=!1,showCheckboxes:c=!1,showLines:d=!1,className:u,style:f}){const s=U(),m=te();a.useId();const[p,x]=a.useState([]),[y,v]=a.useState([]),b=new Set(r??p),g=new Set(o??y),w=a.useCallback(z=>{o===void 0&&v(z),i==null||i(z)},[o,i]),S=a.useCallback(z=>{r===void 0&&x(z),n==null||n(z)},[r,n]),M=a.useCallback(z=>{const E=Array.from(g);g.has(z)?w(E.filter(C=>C!==z)):w([...E,z])},[g,w]),N=a.useCallback(z=>{if(l){const E=Array.from(b);b.has(z)?S(E.filter(C=>C!==z)):S([...E,z])}else S(b.has(z)?[]:[z])},[l,b,S]),j=gl(e,g),L=a.useRef(0),I=a.useRef(new Map),T=z=>{var E;L.current=z,(E=I.current.get(z))==null||E.focus()},$=(z,E)=>{var D;const C=j[E];if(!C)return;const{node:k}=C,A=(((D=k.children)==null?void 0:D.length)??0)>0;switch(z.key){case"ArrowDown":{z.preventDefault(),E<j.length-1&&T(E+1);break}case"ArrowUp":{z.preventDefault(),E>0&&T(E-1);break}case"ArrowRight":{z.preventDefault(),A&&!g.has(k.id)?M(k.id):A&&g.has(k.id)&&E<j.length-1&&T(E+1);break}case"ArrowLeft":{if(z.preventDefault(),A&&g.has(k.id))M(k.id);else for(let O=E-1;O>=0;O--)if(j[O].depth<C.depth){T(O);break}break}case"Enter":case" ":{z.preventDefault(),k.disabled||N(k.id);break}case"Home":{z.preventDefault(),T(0);break}case"End":{z.preventDefault(),T(j.length-1);break}}};return t.jsx("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":l||void 0,className:h("list-none m-0 p-0 font-sans select-none",u??""),style:{color:s.text,...f},children:j.map(({node:z,depth:E},C)=>{var W;const k=(((W=z.children)==null?void 0:W.length)??0)>0,A=g.has(z.id),D=b.has(z.id),O=R(z.label);return t.jsxs("li",{role:"treeitem","aria-selected":D,"aria-expanded":k?A:void 0,"aria-disabled":z.disabled||void 0,"aria-level":E+1,"aria-setsize":j.filter(H=>H.depth===E).length,tabIndex:C===0?0:-1,ref:H=>{H?I.current.set(C,H):I.current.delete(C)},onKeyDown:H=>$(H,C),onClick:()=>{z.disabled||(k&&M(z.id),N(z.id))},className:h("relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",z.disabled?"opacity-50 cursor-not-allowed":""),style:{paddingLeft:E*ln+8,backgroundColor:D?`${s.primary}18`:"transparent",transition:m?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:H=>{!D&&!z.disabled&&(H.currentTarget.style.backgroundColor=s.surfaceAlt)},onMouseLeave:H=>{H.currentTarget.style.backgroundColor=D?`${s.primary}18`:"transparent"},children:[d&&E>0&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:(E-1)*ln+16,top:0,bottom:0,width:1,backgroundColor:s.border}}),k?t.jsx("span",{role:"presentation",onClick:H=>{H.stopPropagation(),M(z.id)},className:h("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:t.jsx(bl,{expanded:A,color:s.textMuted,reducedMotion:m})}):t.jsx("span",{style:{width:20,height:20},"aria-hidden":"true"}),c&&t.jsx(yl,{checked:D,color:s.primary,borderColor:s.border}),z.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:z.icon}),t.jsx("span",{className:h("text-sm truncate"),style:{color:z.disabled?s.textMuted:s.text},children:O})]},z.id)})})}const kl={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function wl({items:e,orientation:r="horizontal",size:n="md",variant:o="default",ariaLabel:i="Toolbar",className:l,style:c}){const d=U(),u=te(),f=kl[n],s=r==="horizontal",m=a.useRef(new Map),p=e.filter(g=>g.type!=="separator"&&!g.disabled).map(g=>g.id),x=a.useCallback(g=>{var w;(w=m.current.get(g))==null||w.focus()},[]),y=a.useCallback((g,w)=>{const S=p.indexOf(w);if(S<0)return;const M=s?"ArrowRight":"ArrowDown",N=s?"ArrowLeft":"ArrowUp";switch(g.key){case M:{g.preventDefault();const j=S+1<p.length?S+1:0;x(p[j]);break}case N:{g.preventDefault();const j=S-1>=0?S-1:p.length-1;x(p[j]);break}case"Home":{g.preventDefault(),x(p[0]);break}case"End":{g.preventDefault(),x(p[p.length-1]);break}}},[p,x,s]),v=()=>{switch(o){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${d.border}`};case"filled":return{backgroundColor:d.surfaceAlt,border:"none"};default:return{backgroundColor:d.surface,border:`1px solid ${d.border}`}}},b=g=>{g.type;const w=g.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${f.buttonPy}px ${f.buttonPx}px`,fontSize:f.fontSize,borderRadius:6,border:"none",cursor:g.disabled?"not-allowed":"pointer",backgroundColor:w?`${d.primary}20`:"transparent",color:w?d.primary:g.disabled?d.textMuted:d.text,opacity:g.disabled?.5:1,outline:"none",transition:u?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};return t.jsx("div",{role:"toolbar","aria-label":i,"aria-orientation":r,className:h("inline-flex items-center rounded-lg font-sans",s?"flex-row":"flex-col",l??""),style:{...v(),padding:f.gap,gap:f.gap,...c},children:e.map((g,w)=>{if(g.type==="separator")return t.jsx("div",{role:"separator","aria-orientation":s?"vertical":"horizontal",className:h("flex-shrink-0"),style:{...s?{width:1,height:f.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:f.separatorSize,marginTop:2,marginBottom:2},backgroundColor:d.border}},g.id);const S=R(g.label),M=!g.disabled,N=p[0]===g.id;return t.jsxs("button",{ref:j=>{j?m.current.set(g.id,j):m.current.delete(g.id)},type:"button",role:(g.type==="toggle",void 0),"aria-pressed":g.type==="toggle"?g.active:void 0,"aria-label":S,"aria-disabled":g.disabled||void 0,tabIndex:M&&N?0:-1,disabled:g.disabled,onClick:()=>{var j;g.disabled||(j=g.onClick)==null||j.call(g)},onKeyDown:j=>{var L;y(j,g.id),(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),g.disabled||(L=g.onClick)==null||L.call(g))},className:h("focus-visible:ring-2 focus-visible:ring-offset-1"),style:b(g),onMouseEnter:j=>{!g.disabled&&!g.active&&(j.currentTarget.style.backgroundColor=d.surfaceAlt)},onMouseLeave:j=>{g.disabled||(j.currentTarget.style.backgroundColor=g.active?`${d.primary}20`:"transparent")},children:[g.icon&&t.jsx("span",{"aria-hidden":"true",style:{width:f.iconSize,height:f.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:g.icon}),!g.icon&&S]},g.id)})})}function jl({color:e}){return t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),t.jsx("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function cn({checked:e,primaryColor:r,borderColor:n}){return t.jsx("span",{"aria-hidden":"true",className:h("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?r:n}`,backgroundColor:e?r:"transparent",transition:"all 100ms ease"},children:e&&t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Sl({color:e}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $l({color:e}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dn({title:e,items:r,selected:n,onToggle:o,onToggleAll:i,search:l,onSearchChange:c,searchable:d,height:u,listId:f}){const s=U(),m=te(),p=R(e),x=a.useMemo(()=>{if(!l)return r;const g=l.toLowerCase();return r.filter(w=>w.label.toLowerCase().includes(g))},[r,l]),y=x.filter(g=>!g.disabled),v=y.length>0&&y.every(g=>n.has(g.value));y.some(g=>n.has(g.value));const b=(g,w)=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),o(w))};return t.jsxs("div",{className:h("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${s.border}`,backgroundColor:s.surface},children:[t.jsxs("div",{className:h("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:s.border,backgroundColor:s.surfaceAlt},children:[t.jsx("button",{type:"button","aria-label":v?`Deselect all ${p}`:`Select all ${p}`,onClick:i,className:h("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:t.jsx(cn,{checked:v,primaryColor:s.primary,borderColor:s.border})}),t.jsx("span",{className:h("text-sm font-medium flex-1 truncate"),style:{color:s.text},children:p}),t.jsxs("span",{className:h("text-xs"),style:{color:s.textMuted},children:[n.size,"/",r.length]})]}),d&&t.jsxs("div",{className:h("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:s.border},children:[t.jsx(jl,{color:s.textMuted}),t.jsx("input",{type:"text","aria-label":`Search ${p}`,value:l,onChange:g=>c(g.target.value),placeholder:"Search...",className:h("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:s.text}})]}),t.jsx("ul",{id:f,role:"listbox","aria-label":p,"aria-multiselectable":"true",className:h("list-none m-0 p-1 overflow-y-auto"),style:{height:u,minHeight:100},children:x.length===0?t.jsx("li",{className:h("text-xs text-center py-4"),style:{color:s.textMuted},"aria-disabled":"true",children:"No items"}):x.map(g=>{const w=n.has(g.value),S=R(g.label);return t.jsxs("li",{role:"option","aria-selected":w,"aria-disabled":g.disabled||void 0,tabIndex:0,onClick:()=>!g.disabled&&o(g.value),onKeyDown:M=>!g.disabled&&b(M,g.value),className:h("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",g.disabled?"opacity-50 cursor-not-allowed":""),style:{color:g.disabled?s.textMuted:s.text,backgroundColor:w?`${s.primary}10`:"transparent",transition:m?"none":"background-color 100ms ease"},onMouseEnter:M=>{!g.disabled&&!w&&(M.currentTarget.style.backgroundColor=s.surfaceAlt)},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=w?`${s.primary}10`:"transparent"},children:[t.jsx(cn,{checked:w,primaryColor:s.primary,borderColor:s.border}),t.jsx("span",{className:h("truncate"),children:S})]},g.value)})})]})}function Ml({sourceItems:e,targetItems:r,onTransfer:n,sourceTitle:o="Available",targetTitle:i="Selected",searchable:l=!1,height:c=300,className:d,style:u}){const f=U(),s=te(),m=a.useId(),p=a.useId(),[x,y]=a.useState(new Set),[v,b]=a.useState(new Set),[g,w]=a.useState(""),[S,M]=a.useState(""),N=a.useCallback(E=>{y(C=>{const k=new Set(C);return k.has(E)?k.delete(E):k.add(E),k})},[]),j=a.useCallback(E=>{b(C=>{const k=new Set(C);return k.has(E)?k.delete(E):k.add(E),k})},[]),L=a.useCallback(()=>{const E=e.filter(k=>!k.disabled).map(k=>k.value),C=E.every(k=>x.has(k));y(C?new Set:new Set(E))},[e,x]),I=a.useCallback(()=>{const E=r.filter(k=>!k.disabled).map(k=>k.value),C=E.every(k=>v.has(k));b(C?new Set:new Set(E))},[r,v]),T=a.useCallback(()=>{if(x.size===0)return;const E=e.filter(A=>x.has(A.value)&&!A.disabled),C=e.filter(A=>!x.has(A.value)||A.disabled),k=[...r,...E];n(C,k),y(new Set)},[e,r,x,n]),$=a.useCallback(()=>{if(v.size===0)return;const E=r.filter(A=>v.has(A.value)&&!A.disabled),C=r.filter(A=>!v.has(A.value)||A.disabled),k=[...e,...E];n(k,C),b(new Set)},[e,r,v,n]),z=E=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${f.border}`,backgroundColor:E?f.surface:f.surfaceAlt,cursor:E?"not-allowed":"pointer",opacity:E?.5:1,transition:s?"none":"all 100ms ease",outline:"none"});return t.jsxs("div",{className:h("flex gap-3 font-sans","flex-col sm:flex-row",d??""),style:{color:f.text,...u},children:[t.jsx(dn,{title:o,items:e,selected:x,onToggle:N,onToggleAll:L,search:g,onSearchChange:w,searchable:l,height:c,listId:m}),t.jsxs("div",{className:h("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[t.jsx("button",{type:"button","aria-label":"Move selected items to target list",disabled:x.size===0,onClick:T,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),T())},className:h("focus-visible:ring-2 focus-visible:ring-offset-1"),style:z(x.size===0),onMouseEnter:E=>{x.size>0&&(E.currentTarget.style.backgroundColor=f.primary,E.currentTarget.style.borderColor=f.primary)},onMouseLeave:E=>{E.currentTarget.style.backgroundColor=x.size===0?f.surface:f.surfaceAlt,E.currentTarget.style.borderColor=f.border},children:t.jsx(Sl,{color:f.text})}),t.jsx("button",{type:"button","aria-label":"Move selected items to source list",disabled:v.size===0,onClick:$,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),$())},className:h("focus-visible:ring-2 focus-visible:ring-offset-1"),style:z(v.size===0),onMouseEnter:E=>{v.size>0&&(E.currentTarget.style.backgroundColor=f.primary,E.currentTarget.style.borderColor=f.primary)},onMouseLeave:E=>{E.currentTarget.style.backgroundColor=v.size===0?f.surface:f.surfaceAlt,E.currentTarget.style.borderColor=f.border},children:t.jsx($l,{color:f.text})})]}),t.jsx(dn,{title:i,items:r,selected:v,onToggle:j,onToggleAll:I,search:S,onSearchChange:M,searchable:l,height:c,listId:p})]})}function Cl({color:e,rotated:r,reducedMotion:n}){return t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:r?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:t.jsx("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}const Tl={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function El(e,r,n){const o=(r+1)*n;switch(e){case"up":return{bottom:o,left:"50%",transform:"translateX(-50%)"};case"down":return{top:o,left:"50%",transform:"translateX(-50%)"};case"left":return{right:o,top:"50%",transform:"translateY(-50%)"};case"right":return{left:o,top:"50%",transform:"translateY(-50%)"}}}function Il(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10};case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}const un=56,fn=48,Nl=64;function zl({actions:e,icon:r,direction:n="up",position:o="bottom-right",className:i,style:l}){const c=U(),d=te(),u=a.useId(),[f,s]=a.useState(!1),[m,p]=a.useState(-1),x=a.useRef(null),y=a.useRef(new Map),v=a.useCallback(()=>{s(M=>!M),p(-1)},[]),b=a.useCallback(()=>{s(!1),p(-1)},[]);lt(b,f),a.useEffect(()=>{if(!f)return;const M=N=>{var j;(j=x.current)!=null&&j.contains(N.target)||b()};return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[f,b]),a.useEffect(()=>{var M;m>=0&&((M=y.current.get(m))==null||M.focus())},[m]);const g=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),v()),f&&((M.key==="ArrowUp"||M.key==="ArrowLeft")&&(M.preventDefault(),p(0)),(M.key==="ArrowDown"||M.key==="ArrowRight")&&(M.preventDefault(),p(0)))},w=(M,N)=>{var j,L;switch(M.key){case"ArrowUp":case"ArrowLeft":{M.preventDefault(),p(N>0?N-1:e.length-1);break}case"ArrowDown":case"ArrowRight":{M.preventDefault(),p(N<e.length-1?N+1:0);break}case"Enter":case" ":{M.preventDefault(),(L=(j=e[N]).onClick)==null||L.call(j),b();break}case"Escape":{b();break}case"Home":{M.preventDefault(),p(0);break}case"End":{M.preventDefault(),p(e.length-1);break}}},S=M=>d?"0ms":`${M*40}ms`;return t.jsxs(t.Fragment,{children:[f&&typeof document<"u"&&Ne.createPortal(t.jsx("div",{"aria-hidden":"true",onClick:b,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:d?"none":"opacity 200ms ease"}}),document.body),t.jsxs("div",{ref:x,className:h("fixed z-[9100] font-sans",i??""),style:{...Tl[o],...l},children:[f&&e.map((M,N)=>{const j=R(M.label),L=El(n,N,Nl),I=Il(n);return t.jsx("div",{className:h("absolute"),style:{...L,opacity:d?1:0,animation:d?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:S(N)},children:t.jsxs("div",{className:h("relative inline-flex"),children:[t.jsx("span",{className:h("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...I,backgroundColor:c.surfaceAlt,color:c.text,border:`1px solid ${c.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:j}),t.jsx("button",{ref:T=>{T?y.current.set(N,T):y.current.delete(N)},type:"button","aria-label":j,tabIndex:f?0:-1,onClick:()=>{var T;(T=M.onClick)==null||T.call(M),b()},onKeyDown:T=>w(T,N),className:h("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2","shadow-lg"),style:{width:fn,height:fn,backgroundColor:c.surface,color:c.text,border:`1px solid ${c.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:d?"none":"all 150ms ease"},onMouseEnter:T=>{T.currentTarget.style.backgroundColor=c.surfaceAlt,T.currentTarget.style.transform="scale(1.1)"},onMouseLeave:T=>{T.currentTarget.style.backgroundColor=c.surface,T.currentTarget.style.transform="scale(1)"},children:M.icon})]})},M.id)}),t.jsx("button",{type:"button","aria-label":f?"Close actions menu":"Open actions menu","aria-expanded":f,"aria-controls":u,"aria-haspopup":"true",onClick:v,onKeyDown:g,className:h("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2"),style:{width:un,height:un,backgroundColor:c.primary,color:c.bg,boxShadow:`0 6px 20px ${c.primary}40`,transition:d?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:M=>{M.currentTarget.style.boxShadow=`0 8px 28px ${c.primary}60`,d||(M.currentTarget.style.transform="scale(1.05)")},onMouseLeave:M=>{M.currentTarget.style.boxShadow=`0 6px 20px ${c.primary}40`,M.currentTarget.style.transform="scale(1)"},children:r??t.jsx(Cl,{color:c.bg,rotated:f,reducedMotion:d})}),t.jsx("div",{id:u,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(M=>t.jsx("div",{role:"menuitem",children:R(M.label)},M.id))})]}),f&&!d&&t.jsx("style",{children:`
81
+ @keyframes tkxSpeedDialIn {
82
+ from { opacity: 0; transform: translateX(-50%) scale(0.5); }
83
+ to { opacity: 1; transform: translateX(-50%) scale(1); }
84
+ }
85
+ `})]})}const pn=768,Ll=56;function Al({open:e}){return t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:e?t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),t.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Rl(){const[e,r]=a.useState(()=>typeof window>"u"?!1:window.innerWidth<pn);return a.useEffect(()=>{if(typeof window>"u")return;const n=()=>r(window.innerWidth<pn);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function Dl({title:e,logo:r,actions:n,navigation:o,position:i="sticky",variant:l="default",color:c="surface"}){const d=U(),u=te(),f=Rl(),[s,m]=a.useState(!1),p=a.useRef(null),x=a.useId();lt(()=>m(!1),s),a.useEffect(()=>{!f&&s&&m(!1)},[f,s]),a.useEffect(()=>{if(!s)return;const N=j=>{p.current&&!p.current.contains(j.target)&&m(!1)};return document.addEventListener("pointerdown",N),()=>document.removeEventListener("pointerdown",N)},[s]);const y=a.useCallback(()=>{m(N=>!N)},[]),v=c==="primary"?d.primary:d.surface,b=c==="primary"?d.bg:d.text,g={default:{backgroundColor:v,borderBottom:`1px solid ${d.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:v,boxShadow:`0 2px 8px ${d.bg}66`,borderBottom:"none"}},w={fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}},S=typeof e=="string"?R(e):e,M=u?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";return t.jsxs("header",{role:"banner",className:h("font-sans w-full"),style:{...w[i],...g[l],color:b,height:Ll},children:[t.jsxs("div",{ref:p,className:h("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[r&&t.jsx("div",{className:h("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:r}),S&&t.jsx("div",{className:h("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:b},children:S}),!f&&o&&t.jsx("nav",{id:x,"aria-label":"Main navigation",className:h("flex items-center flex-1 gap-1"),children:o}),f&&t.jsx("div",{className:h("flex-1")}),n&&t.jsx("div",{className:h("flex items-center gap-2 ml-auto shrink-0"),children:n}),f&&o&&t.jsx("button",{onClick:y,"aria-expanded":s,"aria-controls":x,"aria-label":s?"Close navigation menu":"Open navigation menu",className:h("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:b},children:t.jsx(Al,{open:s})})]}),f&&o&&t.jsx("nav",{id:x,"aria-label":"Main navigation",style:{maxHeight:s?400:0,opacity:s?1:0,overflow:"hidden",transition:M,backgroundColor:d.surface,borderBottom:s?`1px solid ${d.border}`:"none"},children:t.jsx("div",{className:h("flex flex-col gap-1 px-4 py-3"),role:"menu",children:o})})]})}const Bl=5,Wl=56;let xn=!1;function Fl(){if(xn||typeof document>"u")return;xn=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent=`
86
+ @keyframes tkx-bottom-nav-pulse {
87
+ 0% { transform: scale(1); }
88
+ 50% { transform: scale(1.15); }
89
+ 100% { transform: scale(1); }
90
+ }
91
+ `,document.head.appendChild(e)}function Pl({items:e,activeId:r,onChange:n,showLabels:o=!0}){const i=U(),l=te(),c=a.useRef(null);a.useEffect(()=>{Fl()},[]);const d=e.slice(0,Bl),u=a.useCallback(m=>{n==null||n(m)},[n]),f=a.useCallback(m=>{const p=c.current;if(!p)return;const x=Array.from(p.querySelectorAll('[role="tab"]')),y=x.findIndex(b=>b===document.activeElement);if(y===-1)return;let v=y;m.key==="ArrowRight"||m.key==="ArrowDown"?(m.preventDefault(),v=(y+1)%x.length):m.key==="ArrowLeft"||m.key==="ArrowUp"?(m.preventDefault(),v=(y-1+x.length)%x.length):m.key==="Home"?(m.preventDefault(),v=0):m.key==="End"&&(m.preventDefault(),v=x.length-1),v!==y&&(x[v].focus(),u(d[v].id))},[u,d]),s=l?"none":"color 200ms ease, transform 150ms ease";return t.jsx("nav",{ref:c,role:"navigation","aria-label":"Bottom navigation",className:h("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:Wl,backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,boxShadow:`0 -2px 12px ${i.bg}44`},children:t.jsx("div",{role:"tablist","aria-label":"Navigation tabs",className:h("flex items-center justify-around h-full"),onKeyDown:f,children:d.map(m=>{const p=m.id===r,x=R(m.label),y=p?i.primary:i.textMuted;return t.jsxs("button",{role:"tab","aria-selected":p,"aria-label":x,tabIndex:p?0:-1,onClick:()=>u(m.id),className:h("flex flex-col items-center justify-center gap-0.5","bg-transparent border-none cursor-pointer p-1","flex-1 h-full relative","focus-visible:focus-ring"),style:{color:y,transition:s,outline:"none"},children:[p&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:i.primary,transition:l?"none":"width 200ms ease"}}),t.jsxs("div",{className:h("relative flex items-center justify-center"),style:{animation:p&&!l?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[m.icon,m.badge!==void 0&&m.badge>0&&t.jsx("span",{"aria-label":`${m.badge} notifications`,className:h("absolute flex items-center justify-center","text-[10px] font-bold leading-none rounded-full"),style:{top:-4,right:-8,minWidth:16,height:16,padding:"0 4px",backgroundColor:i.danger,color:i.bg},children:m.badge>99?"99+":m.badge})]}),o&&t.jsx("span",{className:h("text-[10px] leading-tight mt-0.5"),style:{fontWeight:p?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x})]},m.id)})})})}const Hl=5e3;let hn=!1;function Vl(){if(hn||typeof document>"u")return;hn=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent=`
92
+ @keyframes tkx-snackbar-slide-up {
93
+ from { opacity: 0; transform: translateY(24px); }
94
+ to { opacity: 1; transform: translateY(0); }
95
+ }
96
+ @keyframes tkx-snackbar-slide-down {
97
+ from { opacity: 0; transform: translateY(-24px); }
98
+ to { opacity: 1; transform: translateY(0); }
99
+ }
100
+ @keyframes tkx-snackbar-fade-out {
101
+ from { opacity: 1; }
102
+ to { opacity: 0; transform: translateY(8px); }
103
+ }
104
+ `,document.head.appendChild(e)}const Ol={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"})}),error: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"})})},_l={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:"50%",transform:"translateX(-50%)"}};function Yl({message:e,isOpen:r,onClose:n,action:o,variant:i="default",position:l="bottom-center",autoHideDuration:c=Hl,icon:d}){const u=U(),f=te(),s=a.useId(),m=a.useRef(null),[p,x]=a.useState(!1),[y,v]=a.useState(!1);a.useEffect(()=>{Vl()},[]),a.useEffect(()=>{if(r)v(!1),x(!0);else if(p)if(f)x(!1);else{v(!0);const T=setTimeout(()=>{x(!1),v(!1)},250);return()=>clearTimeout(T)}},[r,f,p]),a.useEffect(()=>{if(!(!r||c<=0||!n))return m.current=setTimeout(()=>{n()},c),()=>{m.current&&clearTimeout(m.current)}},[r,c,n]);const b=a.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),g=a.useCallback(()=>{r&&c>0&&n&&(m.current=setTimeout(()=>n(),c))},[r,c,n]),S={default:u.textMuted,success:u.success,error:u.danger,warning:u.warning,info:u.info}[i],M=R(e);if(!p||typeof document>"u")return null;const j=l==="top-center"?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up";let L={};f||(y?L={animation:"tkx-snackbar-fade-out 250ms ease forwards"}:L={animation:`${j} 250ms cubic-bezier(0.16,1,0.3,1) both`});const I=d??Ol[i]??null;return Ne.createPortal(t.jsx("div",{role:i==="error"?"alert":"status","aria-live":i==="error"?"assertive":"polite","aria-atomic":"true","aria-labelledby":s,className:h("fixed z-[9500] font-sans"),style:{..._l[l],...L,pointerEvents:"auto"},onMouseEnter:b,onMouseLeave:g,children:t.jsxs("div",{className:h("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:u.surface,border:`1px solid ${S}44`,boxShadow:`0 8px 24px ${u.bg}aa`,color:u.text},children:[I&&t.jsx("span",{className:h("shrink-0 flex items-center"),style:{color:S},children:I}),t.jsx("span",{id:s,className:h("flex-1 text-sm leading-snug"),children:M}),o&&t.jsx("button",{onClick:()=>{o.onClick(),n==null||n()},className:h("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:u.primary},children:R(o.label)}),n&&t.jsx("button",{"aria-label":"Dismiss snackbar",onClick:n,className:h("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:u.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"})]})})]})}),document.body)}function Ul({direction:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:h("shrink-0 ml-1"),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.35"})})}function mn({checked:e,indeterminate:r}){const n=U();return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[t.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||r?n.primary:"transparent",stroke:e||r?n.primary:n.border,strokeWidth:"1.5"}),r&&t.jsx("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!r&&t.jsx("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function gn(e,r){return typeof r=="function"?r(e):String(e[r])}function Kl(e,r){return e[r]}function Xl({colCount:e}){const r=U(),n=Array.from({length:5},(o,i)=>i);return t.jsx("tbody",{children:n.map(o=>t.jsx("tr",{children:Array.from({length:e},(i,l)=>t.jsx("td",{className:h("px-3 py-2"),style:{borderBottom:`1px solid ${r.border}`},children:t.jsx(qt,{height:16})},l))},o))})}function ql({columns:e,data:r,rowKey:n,selectable:o=!1,selectedRows:i=[],onSelectionChange:l,sortable:c=!1,onSort:d,loading:u=!1,emptyMessage:f="No data to display",stickyHeader:s=!1,striped:m=!1,bordered:p=!1,compact:x=!1,maxHeight:y,onRowClick:v,virtualScroll:b,rowHeight:g=40}){const w=U(),S=te(),M=a.useId(),N=10,j=b!==void 0?b:y!==void 0&&r.length>=50,L=a.useRef(null),[I,T]=a.useState(0),[$,z]=a.useState(0),E=a.useCallback(()=>{L.current&&T(L.current.scrollTop)},[]);a.useEffect(()=>{if(!j||!L.current)return;const q=L.current;z(q.clientHeight);const K=new ResizeObserver(()=>{z(q.clientHeight)});return K.observe(q),()=>K.disconnect()},[j]),r.length*g;const C=j?Math.max(0,Math.floor(I/g)-N):0,k=j?Math.min(r.length,Math.ceil((I+$)/g)+N):r.length,A=j?r.slice(C,k):r,D=C*g,[O,W]=a.useState(null),[H,B]=a.useState("asc"),P=a.useCallback(q=>{let K="asc";O===q&&(K=H==="asc"?"desc":"asc"),W(q),B(K),d==null||d(q,K)},[O,H,d]),F=a.useMemo(()=>new Set(i),[i]),V=a.useMemo(()=>r.map(q=>gn(q,n)),[r,n]),Q=V.length>0&&V.every(q=>F.has(q)),re=V.some(q=>F.has(q)),ie=a.useCallback(()=>{Q?l==null||l([]):l==null||l(V)},[Q,V,l]),fe=a.useCallback(q=>{const K=F.has(q)?i.filter(G=>G!==q):[...i,q];l==null||l(K)},[F,i,l]),[xe,ve]=a.useState({}),ge=a.useRef(null),X=a.useCallback((q,K)=>{K.preventDefault(),K.stopPropagation();const G=K.target.closest("th");if(!G)return;const ee=xe[q]||G.getBoundingClientRect().width;ge.current={key:q,startX:K.clientX,startWidth:ee};const ue=Me=>{if(!ge.current)return;const je=Me.clientX-ge.current.startX,ze=Math.max(50,ge.current.startWidth+je);ve(Te=>({...Te,[ge.current.key]:ze}))},ke=()=>{ge.current=null,document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",ke)};document.addEventListener("mousemove",ue),document.addEventListener("mouseup",ke)},[xe]),se=x?"4px":"8px",he=x?"8px":"12px",Se=q=>{const K=xe[q.key]||q.width;return{width:K||void 0,minWidth:K||80,textAlign:q.align??"left",padding:`${se} ${he}`}},de=p?`1px solid ${w.border}`:"none",be=R(f),ne=e.length+(o?1:0);return t.jsx("div",{role:"grid","aria-label":"Data grid",id:M,className:h("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${w.border}`,backgroundColor:w.bg},children:t.jsx("div",{ref:L,onScroll:j?E:void 0,style:{maxHeight:y??"none",overflowX:"auto",overflowY:y?"auto":"visible"},children:t.jsxs("table",{className:h("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[t.jsx("thead",{children:t.jsxs("tr",{children:[o&&t.jsx("th",{scope:"col",className:h("shrink-0"),style:{position:s?"sticky":"static",top:0,zIndex:2,backgroundColor:w.surface,borderBottom:`2px solid ${w.border}`,borderRight:p?de:"none",padding:`${se} ${he}`,width:40,textAlign:"center"},children:t.jsx("button",{onClick:ie,"aria-label":Q?"Deselect all rows":"Select all rows",className:h("bg-transparent border-none cursor-pointer p-0","flex items-center justify-center","focus-visible:focus-ring"),style:{margin:"0 auto"},children:t.jsx(mn,{checked:Q,indeterminate:re&&!Q})})}),e.map(q=>{const K=(q.sortable??c)&&q.sortable!==!1,G=O===q.key,ee=R(q.header);return t.jsx("th",{scope:"col","aria-sort":G?H==="asc"?"ascending":"descending":void 0,className:h("text-xs font-semibold uppercase tracking-wider"),style:{...Se(q),position:s?"sticky":"static",top:0,zIndex:2,backgroundColor:w.surface,color:w.textMuted,borderBottom:`2px solid ${w.border}`,borderRight:p?de:"none",cursor:K?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:S?"none":"background-color 150ms ease"},onClick:K?()=>P(q.key):void 0,onKeyDown:K?ue=>{(ue.key==="Enter"||ue.key===" ")&&(ue.preventDefault(),P(q.key))}:void 0,tabIndex:K?0:void 0,role:K?"columnheader button":"columnheader",children:t.jsxs("div",{className:h("flex items-center gap-1"),children:[q.renderHeader?q.renderHeader(q):ee,K&&t.jsx(Ul,{direction:G?H:null}),q.resizable&&t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${ee}`,className:h("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:ue=>X(q.key,ue)})]})},q.key)})]})}),u&&t.jsx(Xl,{colCount:ne}),!u&&t.jsx("tbody",{children:r.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:ne,className:h("text-center py-10"),style:{color:w.textMuted},children:be})}):t.jsxs(t.Fragment,{children:[j&&D>0&&t.jsx("tr",{"aria-hidden":"true",children:t.jsx("td",{colSpan:ne,style:{height:D,padding:0,border:"none"}})}),A.map((q,K)=>{const G=C+K,ee=gn(q,n),ue=F.has(ee),ke=m&&G%2===1;let Me="transparent";return ue?Me=`${w.primary}15`:ke&&(Me=w.surfaceAlt),t.jsxs("tr",{role:"row","aria-selected":o?ue:void 0,onClick:v?()=>v(q):void 0,className:h(v?"cursor-pointer":""),style:{backgroundColor:Me,transition:S?"none":"background-color 120ms ease",...j?{height:g,boxSizing:"border-box"}:{}},onMouseEnter:v?je=>{je.currentTarget.style.backgroundColor=ue?`${w.primary}22`:`${w.surfaceAlt}`}:void 0,onMouseLeave:v?je=>{je.currentTarget.style.backgroundColor=Me}:void 0,children:[o&&t.jsx("td",{style:{borderBottom:`1px solid ${w.border}`,borderRight:p?de:"none",padding:`${se} ${he}`,textAlign:"center",width:40},children:t.jsx("button",{onClick:je=>{je.stopPropagation(),fe(ee)},"aria-label":ue?`Deselect row ${ee}`:`Select row ${ee}`,className:h("bg-transparent border-none cursor-pointer p-0","flex items-center justify-center","focus-visible:focus-ring"),style:{margin:"0 auto"},children:t.jsx(mn,{checked:ue})})}),e.map(je=>{const ze=Kl(q,je.key),Te=je.renderCell?je.renderCell(ze,q):typeof ze=="string"?R(ze):String(ze??"");return t.jsx("td",{className:h("text-sm"),style:{...Se(je),borderBottom:`1px solid ${w.border}`,borderRight:p?de:"none",color:w.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te},je.key)})]},ee)}),j&&k<r.length&&t.jsx("tr",{"aria-hidden":"true",children:t.jsx("td",{colSpan:ne,style:{height:(r.length-k)*g,padding:0,border:"none"}})})]})})]})})})}const Ht={md:768,lg:1024};function Zl(){const[e,r]=a.useState(()=>{if(typeof window>"u")return"lg";const n=window.innerWidth;return n>=Ht.lg?"lg":n>=Ht.md?"md":"sm"});return a.useEffect(()=>{if(typeof window>"u")return;const n=()=>{const o=window.innerWidth;o>=Ht.lg?r("lg"):o>=Ht.md?r("md"):r("sm")};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function Gl(e,r){return e===void 0?3:typeof e=="number"?Math.max(1,e):r==="lg"?e.lg??e.md??e.sm??3:r==="md"?e.md??e.sm??2:e.sm??1}let bn=!1;function Jl(){if(bn||typeof document>"u")return;bn=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent=`
105
+ @keyframes tkx-masonry-fade-in {
106
+ from { opacity: 0; transform: translateY(8px); }
107
+ to { opacity: 1; transform: translateY(0); }
108
+ }
109
+ `,document.head.appendChild(e)}function Ql({columns:e,gap:r=16,children:n}){U();const o=te(),i=Zl();a.useEffect(()=>{Jl()},[]);const l=Gl(e,i),c=a.Children.toArray(n),d=a.useMemo(()=>{const f=Array.from({length:l},()=>[]);return c.forEach((s,m)=>{f[m%l].push(s)}),f},[c,l]),u=f=>o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(f*40,400)}ms`};return t.jsx("div",{role:"list","aria-label":"Masonry grid",className:h("flex w-full"),style:{gap:r,alignItems:"flex-start"},children:d.map((f,s)=>t.jsx("div",{className:h("flex flex-col"),style:{flex:1,gap:r,minWidth:0},children:f.map((m,p)=>{const x=p*l+s;return t.jsx("div",{role:"listitem",style:u(x),children:m},p)})},s))})}const ec={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"})}),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"})}),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"})})},tc={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}};function rc({block:e}){const r=U(),n=e.level??1,o=`h${n}`,i=R(e.content??"");return t.jsx(o,{className:h("m-0"),style:{...tc[n],color:r.text},children:i})}function nc({block:e}){const r=U(),n=R(e.content??"");return t.jsx("p",{className:h("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:r.text,marginBottom:12},children:n})}function oc({block:e}){const r=U(),n=R(e.content??"");return t.jsx("blockquote",{className:h("m-0"),style:{borderLeft:`3px solid ${r.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${r.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:r.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})}function sc({block:e}){const r=U(),n=R(e.content??""),o=e.language?R(e.language):null;return t.jsxs("div",{className:h("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${r.border}`,backgroundColor:r.surfaceAlt},children:[o&&t.jsx("div",{className:h("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:r.textMuted,borderBottom:`1px solid ${r.border}`,backgroundColor:r.surface},children:o}),t.jsx("pre",{className:h("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:r.text,tabSize:2},children:t.jsx("code",{"aria-label":o?`Code block in ${o}`:"Code block",children:n})})]})}function ic({block:e}){const r=U(),n=e.ordered?"ol":"ul",o=(e.items??[]).map(i=>R(i));return t.jsx(n,{className:h("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:r.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:o.map((i,l)=>t.jsx("li",{role:"listitem",style:{marginBottom:4},children:i},l))})}function ac(){const e=U();return t.jsx("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${e.border}`,marginTop:20,marginBottom:20}})}function lc({block:e}){const r=U(),n=R(e.src??""),o=R(e.alt??"Image");return t.jsxs("figure",{className:h("m-0"),style:{marginTop:12,marginBottom:12},children:[t.jsx("img",{src:n,alt:o,loading:"lazy",className:h("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${r.border}`}}),e.alt&&t.jsx("figcaption",{className:h("text-xs mt-2 text-center"),style:{color:r.textMuted},children:o})]})}function cc({block:e}){const r=U(),n=e.variant??"info",o=R(e.content??""),l={info:r.info,warning:r.warning,success:r.success,danger:r.danger}[n],c=ec[n],d={info:"note",warning:"alert",success:"status",danger:"alert"};return t.jsxs("div",{role:d[n],className:h("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${l}12`,border:`1px solid ${l}33`,marginTop:12,marginBottom:12},children:[t.jsx("span",{className:h("shrink-0 mt-[2px]"),style:{color:l},children:c}),t.jsx("div",{className:h("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:r.text},children:o})]})}const dc={heading:rc,paragraph:nc,blockquote:oc,code:sc,list:ic,divider:ac,image:lc,callout:cc};function uc({blocks:e,className:r,style:n}){const o=U(),i=te(),l=a.useMemo(()=>e.map((c,d)=>{const u=dc[c.type];return u?t.jsx("div",{style:i?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(d*30,300)}ms`},children:t.jsx(u,{block:c,index:d})},d):null}),[e,i]);return a.useMemo(()=>{if(typeof document>"u"||document.getElementById("tkx-rich-text-kf"))return;const c=document.createElement("style");c.id="tkx-rich-text-kf",c.textContent=`
110
+ @keyframes tkx-rich-text-fade-in {
111
+ from { opacity: 0; }
112
+ to { opacity: 1; }
113
+ }
114
+ `,document.head.appendChild(c)},[]),t.jsx("article",{"aria-label":"Rich text content",className:h("font-sans",r??""),style:{color:o.text,maxWidth:720,...n},children:l})}const Cr=a.createContext(null);function fc(){const e=a.useContext(Cr);if(!e)throw new Error("TkxFormField must be used inside a <TkxForm>. Wrap your fields in a TkxForm component.");return e}async function yn(e,r){for(const n of r){if(n.required&&(e==null||e===""||Array.isArray(e)&&e.length===0))return n.message??"This field is required";if(!(e==null||e==="")){if(n.min!==void 0){if(typeof e=="string"&&e.length<n.min)return n.message??`Must be at least ${n.min} characters`;if(typeof e=="number"&&e<n.min)return n.message??`Must be at least ${n.min}`}if(n.max!==void 0){if(typeof e=="string"&&e.length>n.max)return n.message??`Must be no more than ${n.max} characters`;if(typeof e=="number"&&e>n.max)return n.message??`Must be no more than ${n.max}`}if(n.pattern&&typeof e=="string"&&!n.pattern.test(e))return n.message??"Invalid format";if(n.validator){const o=await n.validator(e);if(o)return o}}}return null}function pc(e,r){const n=e?[...e]:[];return r&&!n.some(o=>o.required)&&n.unshift({required:!0,message:"This field is required"}),n}function xc(e){return e.some(r=>r.required)}function hc(){const e=a.useContext(Cr);if(e)return e.instance;throw new Error("useTkxForm() must be called inside a <TkxForm> provider. Wrap your component tree with <TkxForm> first.")}function No({onSubmit:e,onValuesChange:r,initialValues:n={},layout:o="vertical",disabled:i=!1,children:l,className:c,style:d}){const u=U(),[f,s]=a.useState({values:{...n},errors:{},touched:{}}),m=a.useRef(n),p=a.useRef({}),x=a.useRef(f);x.current=f;const y=a.useCallback(($,z)=>{p.current[$]=z},[]),v=a.useCallback($=>{delete p.current[$]},[]),b=a.useCallback(($,z)=>{s(E=>{const C={...E,values:{...E.values,[$]:z}};return r==null||r({[$]:z},C.values),C})},[r]),g=a.useCallback(($,z)=>{s(E=>({...E,errors:{...E.errors,[$]:z}}))},[]),w=a.useCallback($=>{s(z=>({...z,touched:{...z.touched,[$]:!0}}))},[]),S=a.useCallback(async $=>{const z=p.current[$];if(!z)return!0;const E=x.current.values[$],C=await yn(E,z.rules);return s(k=>({...k,errors:{...k.errors,[$]:C},touched:{...k.touched,[$]:!0}})),C===null},[]),M=a.useCallback(async()=>{const $=Object.keys(p.current),z=await Promise.all($.map(async A=>{const D=p.current[A],O=x.current.values[A],W=await yn(O,D.rules);return{name:A,error:W}})),E={},C={};let k=!1;for(const{name:A,error:D}of z)E[A]=D,C[A]=!0,D&&(k=!0);if(s(A=>({...A,errors:{...A.errors,...E},touched:{...A.touched,...C}})),k){const A=Object.fromEntries(z.filter(D=>D.error).map(D=>[D.name,D.error]));return Promise.reject(A)}return{...x.current.values}},[]),N=a.useCallback(()=>{s({values:{...m.current},errors:{},touched:{}})},[]),j=a.useMemo(()=>({getFieldValue:$=>x.current.values[$],setFieldValue:b,getFieldsValue:()=>({...x.current.values}),setFieldsValue:$=>{s(z=>{const E={...z.values,...$};return r==null||r($,E),{...z,values:E}})},validateFields:M,validateField:S,resetFields:N,getFieldError:$=>x.current.errors[$]??null,isFieldTouched:$=>!!x.current.touched[$]}),[b,M,S,N,r]),L=a.useCallback(async $=>{$.preventDefault();try{const z=await M();await(e==null?void 0:e(z))}catch{}},[M,e]),I=h(o==="inline"?"flex flex-row flex-wrap items-end gap-4":"flex flex-col gap-5"),T=a.useMemo(()=>({state:f,initialValues:m.current,layout:o,disabled:i,fieldMeta:p,setFieldValue:b,setFieldError:g,setFieldTouched:w,registerField:y,unregisterField:v,validateField:S,instance:j}),[f,o,i,b,g,w,y,v,S,j]);return t.jsx(Cr.Provider,{value:T,children:t.jsx("form",{noValidate:!0,onSubmit:L,className:ae(I,c),style:{color:u.text,...d},children:l})})}No.displayName="TkxForm";function zo({name:e,label:r,rules:n,help:o,required:i,children:l,className:c,style:d}){const u=U(),f=fc(),{state:s,layout:m,disabled:p}=f,x=a.useMemo(()=>pc(n,i),[n,i]),y=xc(x),v=a.useRef({rules:x});v.current.rules=x;const b=a.useRef(!1);b.current||(f.registerField(e,v.current),b.current=!0),a.useMemo(()=>{f.registerField(e,v.current)},[x,e,f]);const g=s.values[e],w=s.touched[e]?s.errors[e]??null:null,S=w?R(w):null,M=r?R(r):void 0,N=o?R(o):void 0,j=a.useCallback(k=>{let A;if(k!==null&&typeof k=="object"&&"target"in k){const D=k.target;A=D.type==="checkbox"?D.checked:D.value}else A=k;f.setFieldValue(e,A)},[f,e]),L=a.useCallback(()=>{f.setFieldTouched(e),f.validateField(e)},[f,e]),I=a.cloneElement(l,{value:g??"",onChange:j,onBlur:L,error:S??void 0,isInvalid:!!S,isRequired:y,disabled:p||l.props.disabled,name:e}),T=m==="horizontal",$=m==="inline",z=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"})}),E=M?t.jsxs("label",{className:h("text-sm font-medium font-sans",T?"min-w-[140px] pt-2.5":""),style:{color:u.text},children:[M,y&&t.jsx("span",{"aria-hidden":"true",className:h("ml-1"),style:{color:u.danger},children:"*"})]}):null,C=t.jsxs(t.Fragment,{children:[N&&!S&&t.jsx("span",{className:h("text-xs mt-0.5"),style:{color:u.textMuted},children:N}),S&&t.jsxs("span",{role:"alert",className:h("text-xs flex items-center gap-1 mt-0.5"),style:{color:u.danger,animation:"tkxFormErrorReveal 200ms ease-out"},children:[z,S]})]});return $?t.jsxs("div",{className:ae(h("flex flex-col gap-1"),c),style:d,children:[E,I,C]}):T?t.jsxs("div",{className:ae(h("flex flex-row gap-4 items-start"),c),style:d,children:[E,t.jsxs("div",{className:h("flex flex-col gap-1 flex-1 min-w-0"),children:[I,C]})]}):t.jsxs("div",{className:ae(h("flex flex-col gap-1"),c),style:d,children:[E,I,C]})}zo.displayName="TkxFormField";let vn=!1;function mc(){if(vn||typeof document>"u")return;vn=!0;const e=document.createElement("style");e.setAttribute("data-tkx-form",""),e.textContent=`
115
+ @keyframes tkxFormErrorReveal {
116
+ from {
117
+ opacity: 0;
118
+ transform: translateY(-4px);
119
+ }
120
+ to {
121
+ opacity: 1;
122
+ transform: translateY(0);
123
+ }
124
+ }
125
+ `,document.head.appendChild(e)}mc();const Lo={sm:576,md:768,lg:992,xl:1200};function Ao(e){return typeof e=="number"?`${e}px`:e}const Ro=a.createContext({h:0,v:0}),Do=a.forwardRef(({children:e,hasSider:r=!1,className:n,style:o,...i},l)=>{const c=U(),d=h("flex min-h-0 w-full font-sans"),u=r?{flexDirection:"row"}:{flexDirection:"column"};return t.jsx("section",{ref:l,className:ae("tkx-layout",d,n),style:{minHeight:"100%",color:c.text,backgroundColor:c.bg,...u,...o},...i,children:e})});Do.displayName="TkxLayout";const Bo=a.forwardRef(({children:e,height:r=64,fixed:n=!1,className:o,style:i,...l},c)=>{const d=U(),u=Ao(r),f=h("flex items-center px-6 shrink-0 w-full"),s=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};return t.jsx("header",{ref:c,className:ae("tkx-layout-header",f,o),style:{height:u,minHeight:u,backgroundColor:d.surface,borderBottom:`1px solid ${d.border}`,...s,...i},...l,children:e})});Bo.displayName="TkxHeader";function gc({collapsed:e,onClick:r,color:n}){const o=te();return t.jsx("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:r,className:h("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:o?"none":"transform 200ms ease"},"aria-hidden":"true",children:t.jsx("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}const Wo=a.forwardRef(({children:e,width:r=240,collapsedWidth:n=64,collapsed:o,onCollapse:i,collapsible:l=!1,breakpoint:c,trigger:d,className:u,style:f,...s},m)=>{const p=U(),x=te(),[y,v]=a.useState(!1),b=o??y,g=a.useCallback(j=>{o===void 0&&v(j),i==null||i(j)},[o,i]);a.useEffect(()=>{if(!c)return;const j=Lo[c];if(!j)return;const L=window.matchMedia(`(max-width: ${j-1}px)`),I=T=>{g(T.matches)};return g(L.matches),L.addEventListener("change",I),()=>L.removeEventListener("change",I)},[c,g]);const w=Ao(r),S=b?`${n}px`:w,M=l&&d!==null,N=x?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";return t.jsxs("aside",{ref:m,className:ae("tkx-layout-sider",h("shrink-0 overflow-hidden flex flex-col"),u),style:{width:S,minWidth:S,maxWidth:S,backgroundColor:p.surface,borderRight:`1px solid ${p.border}`,transition:N,...f},...s,children:[t.jsx("div",{className:h("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:S,transition:N},children:e}),M&&t.jsx("div",{className:h("shrink-0"),style:{borderTop:`1px solid ${p.border}`},children:d!==void 0?d:t.jsx(gc,{collapsed:b,onClick:()=>g(!b),color:p.textMuted})})]})});Wo.displayName="TkxSider";const Fo=a.forwardRef(({children:e,className:r,style:n,...o},i)=>{const l=U();return t.jsx("main",{ref:i,className:ae("tkx-layout-content",h("flex-1 min-w-0 min-h-0"),r),style:{backgroundColor:l.bg,padding:"24px",...n},...o,children:e})});Fo.displayName="TkxContent";const Po=a.forwardRef(({children:e,className:r,style:n,...o},i)=>{const l=U();return t.jsx("footer",{ref:i,className:ae("tkx-layout-footer",h("flex items-center px-6 py-4 shrink-0"),r),style:{backgroundColor:l.surface,borderTop:`1px solid ${l.border}`,color:l.textMuted,...n},...o,children:e})});Po.displayName="TkxFooter";const bc={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},yc={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Ho=a.forwardRef(({children:e,gutter:r,justify:n="start",align:o="top",wrap:i=!0,className:l,style:c,...d},u)=>{const[f,s]=Array.isArray(r)?r:[r??0,0],m=f/2,p=s/2,x=f||s?{marginLeft:-m,marginRight:-m,marginTop:-p,marginBottom:-p}:{},y={h:m,v:p};return t.jsx(Ro.Provider,{value:y,children:t.jsx("div",{ref:u,className:ae("tkx-row",h("flex w-full"),l),style:{flexWrap:i?"wrap":"nowrap",justifyContent:bc[n]??"flex-start",alignItems:yc[o]??"flex-start",...x,...c},...d,children:e})})});Ho.displayName="TkxRow";let kn=!1;function vc(){if(kn||typeof document>"u")return;kn=!0;const e=[];for(const[n,o]of Object.entries(Lo)){for(let i=1;i<=24;i++){const l=`${i/24*100}%`;e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${i} { flex: 0 0 ${l} !important; max-width: ${l} !important; } }`)}for(let i=0;i<=24;i++){const l=`${i/24*100}%`;e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${i} { margin-left: ${l} !important; } }`)}}const r=document.createElement("style");r.id="tkx-col-responsive",r.textContent=e.join(`
126
+ `),document.head.appendChild(r)}function kc(e){if(e!==void 0)return typeof e=="number"?{span:e}:e}const Vo=a.forwardRef(({children:e,span:r,offset:n=0,push:o,pull:i,order:l,sm:c,md:d,lg:u,xl:f,className:s,style:m,...p},x)=>{a.useEffect(()=>{vc()},[]);const y=a.useContext(Ro),v=r!==void 0?`${r/24*100}%`:void 0,b=n?`${n/24*100}%`:void 0,g=[],w=[["sm",c],["md",d],["lg",u],["xl",f]];for(const[M,N]of w){const j=kc(N);j&&(g.push(`tkx-col-${M}-${j.span}`),j.offset!==void 0&&j.offset>0&&g.push(`tkx-col-${M}-offset-${j.offset}`))}const S={};return o!==void 0&&(S.left=`${o/24*100}%`,S.position="relative"),i!==void 0&&(S.right=`${i/24*100}%`,S.position="relative"),l!==void 0&&(S.order=l),t.jsx("div",{ref:x,className:ae("tkx-col",h("box-border min-h-[1px]"),...g,s),style:{flex:v?`0 0 ${v}`:"1",maxWidth:v??"100%",marginLeft:b,paddingLeft:y.h||void 0,paddingRight:y.h||void 0,paddingTop:y.v||void 0,paddingBottom:y.v||void 0,...S,...m},...p,children:e})});Vo.displayName="TkxCol";const wc={size:"md",variant:"default",animation:!0,bordered:!0},jc={locale:"en-US",direction:"ltr",componentDefaults:wc,componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0},xr=a.createContext(jc);function Oo({children:e,locale:r,direction:n,componentDefaults:o,componentOverrides:i,prefixCls:l}){const c=a.useContext(xr),d=a.useMemo(()=>({size:(o==null?void 0:o.size)??c.componentDefaults.size,variant:(o==null?void 0:o.variant)??c.componentDefaults.variant,animation:(o==null?void 0:o.animation)??c.componentDefaults.animation,bordered:(o==null?void 0:o.bordered)??c.componentDefaults.bordered}),[o,c.componentDefaults]),u=a.useMemo(()=>{const g=c.componentOverrides,w=i??{};return{button:{...g.button,...w.button},input:{...g.input,...w.input},table:{...g.table,...w.table},modal:{...g.modal,...w.modal}}},[i,c.componentOverrides]),f=r??c.locale,s=n??c.direction,m=l??c.prefixCls,p=a.useCallback(g=>`${m}-${g}`,[m]),x=a.useCallback((g,w)=>{if(w!==void 0)return w;if(g){const S=u[g];if(S!=null&&S.size)return S.size}return d.size},[d.size,u]),y=a.useCallback(g=>g!==void 0?g:d.animation,[d.animation]),v=a.useCallback((g,w)=>{if(w!==void 0)return w;if(g){const S=u[g];if((S==null?void 0:S.bordered)!==void 0)return S.bordered}return d.bordered},[d.bordered,u]),b=a.useMemo(()=>({locale:f,direction:s,componentDefaults:d,componentOverrides:u,prefixCls:m,configured:!0,cls:p,getSize:x,getAnimation:y,getBordered:v}),[f,s,d,u,m,p,x,y,v]);return t.jsx(xr.Provider,{value:b,children:t.jsx("div",{dir:s,lang:f,className:`${m}-config-root`,style:{direction:s},children:e})})}Oo.displayName="TkxConfigProvider";function zt(){return a.useContext(xr)}function Sc(e,r){const{prefixCls:n}=zt();return`${r??n}-${e}`}function $c(e,r){const{getSize:n}=zt();return n(e,r)}const Mc={sm:32,md:40,lg:48},Cc={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Tc={sm:8,md:12,lg:16},Ec={sm:4,md:8,lg:12},Ic={sm:4,md:6,lg:8},Nc={sm:14,md:16,lg:20};function zc(){const{direction:e}=zt();if(e==="rtl")return{transform:"scaleX(-1)"}}function Lc(e,r=0){const{direction:n}=zt(),o=typeof e=="number"?`${e}px`:e,i=typeof r=="number"?`${r}px`:r;return n==="rtl"?{marginRight:o,marginLeft:i}:{marginLeft:o,marginRight:i}}const wn={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},jn=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function Ac(e){return jn.has(e)||jn.has(e.split("-")[0])}function Rc(e){if(wn[e])return wn[e];if(typeof Intl<"u"&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Nt(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(Nt).join(""):e&&typeof e=="object"&&"props"in e?Nt(e.props.children):""}function Tr({text:e}){const r=U(),[n,o]=a.useState(!1),i=a.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]);return a.createElement("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?r.success:r.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function _o(e="default"){const r=U();return{default:r.text,secondary:r.textMuted,success:r.success,warning:r.warning,danger:r.danger}[e]}const Dc={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}};function Bc({level:e=1,children:r,copyable:n=!1,type:o="default",style:i}){const l=_o(o);U();const c=Dc[e],d=`h${e}`,u=typeof r=="string"?R(r):r,f=Nt(r);return a.createElement(d,{style:{color:l,fontSize:c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...i}},u,n&&a.createElement(Tr,{text:f}))}function Wc({children:e,type:r="default",strong:n=!1,italic:o=!1,underline:i=!1,delete:l=!1,code:c=!1,mark:d=!1,copyable:u=!1,style:f}){const s=_o(r),m=U(),p=Nt(e),x=typeof e=="string"?R(e):e,y=[];i&&y.push("underline"),l&&y.push("line-through");let v=x;return c&&(v=a.createElement("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:"4px",fontFamily:"monospace"}},v)),d&&(v=a.createElement("mark",{style:{backgroundColor:`${m.warning}33`,color:s,padding:"0 2px",borderRadius:"2px"}},v)),a.createElement("span",{style:{color:s,fontWeight:n?600:"inherit",fontStyle:o?"italic":"normal",textDecoration:y.length>0?y.join(" "):"none",...f}},v,u&&a.createElement(Tr,{text:p}))}function Fc({children:e,type:r="default",copyable:n=!1,ellipsis:o=!1,style:i}){const l=U(),c=r==="secondary"?l.textMuted:l.text,d=Nt(e),u=typeof e=="string"?R(e):e,f={};if(o){const s=typeof o=="object"?o.rows??3:3;f.display="-webkit-box",f.WebkitLineClamp=s,f.WebkitBoxOrient="vertical",f.overflow="hidden"}return a.createElement("div",{style:{color:c,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...f,...i}},u,n&&a.createElement(Tr,{text:d}))}const Pc={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}};let Sn=!1;function Hc(){if(Sn||typeof document>"u")return;Sn=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent=`
127
+ @keyframes tkx-spin-rotate {
128
+ 0% { transform: rotate(0deg); }
129
+ 100% { transform: rotate(360deg); }
130
+ }
131
+ `,document.head.appendChild(e)}function Vc({size:e,color:r}){return a.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},a.createElement("circle",{cx:12,cy:12,r:10,stroke:`${r}33`,strokeWidth:2.5,fill:"none"}),a.createElement("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:r,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function Oc({size:e,borderWidth:r,color:n,reducedMotion:o}){return o?a.createElement(Vc,{size:e,color:n}):(Hc(),a.createElement("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${r}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function _c({spinning:e=!0,size:r="md",tip:n,indicator:o,children:i,fullscreen:l=!1,delay:c=0,style:d}){const u=U(),f=te(),[s,m]=a.useState(c===0&&e),p=a.useRef(null);if(a.useEffect(()=>(e&&c>0?p.current=setTimeout(()=>m(!0),c):m(e),()=>{p.current!==null&&clearTimeout(p.current)}),[e,c]),!s)return i?a.createElement("div",{style:d},i):null;const x=Pc[r],y=n?R(n):void 0,v=a.createElement("div",{role:"status","aria-live":"polite","aria-label":y??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??a.createElement(Oc,{size:x.dimension,borderWidth:x.borderWidth,color:u.primary,reducedMotion:f}),y&&a.createElement("span",{style:{color:u.primary,fontSize:x.fontSize,marginTop:"4px"}},y));return l?a.createElement("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}cc`,zIndex:9999,...d}},v):i?a.createElement("div",{style:{position:"relative",...d}},a.createElement("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:f?"none":"opacity 0.2s, filter 0.2s"}},i),a.createElement("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}66`,borderRadius:"4px"}},v)):a.createElement("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...d}},v)}function Yc({color:e,mutedColor:r}){return a.createElement("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},a.createElement("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${r}18`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${r}10`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${r}0d`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),a.createElement("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function Uc({mutedColor:e}){return a.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},a.createElement("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),a.createElement("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),a.createElement("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function Kc({image:e="default",description:r="No data",children:n,style:o}){const i=U(),l=typeof r=="string"?R(r):r;let c;return e==="default"?c=a.createElement(Yc,{color:i.primary,mutedColor:i.textMuted}):e==="simple"?c=a.createElement(Uc,{mutedColor:i.textMuted}):c=e,a.createElement("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},a.createElement("div",{style:{marginBottom:"12px",opacity:.85}},c),l&&a.createElement("div",{style:{color:i.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},l),n&&a.createElement("div",{style:{marginTop:"16px"}},n))}function Xc(e,r,n=","){if(typeof e=="string")return e;const o=r!==void 0?e.toFixed(r):String(e),[i,l]=o.split("."),c=i.replace(/\B(?=(\d{3})+(?!\d))/g,n);return l!==void 0?`${c}.${l}`:c}function qc(e,r){if(e<=0)return r.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),i=Math.floor(n%86400/3600),l=Math.floor(n%3600/60),c=n%60,d=u=>String(u).padStart(2,"0");return r.replace(/DD/g,d(o)).replace(/D/g,String(o)).replace(/HH/g,d(i)).replace(/H/g,String(i)).replace(/mm/g,d(l)).replace(/m/g,String(l)).replace(/ss/g,d(c)).replace(/s/g,String(c))}function Zc({direction:e,color:r}){const n=e==="up"?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4";return a.createElement("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},a.createElement("path",{d:n,stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}let $n=!1;function Gc(){if($n||typeof document>"u")return;$n=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}function Jc({w:e,h:r,alt:n,bdr:o,rm:i}){return i||Gc(),a.createElement("div",{"aria-hidden":"true",style:{width:e,height:r,borderRadius:"4px",background:i?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:i?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function Qc({title:e,value:r,prefix:n,suffix:o,precision:i,groupSeparator:l=",",valueStyle:c,loading:d=!1,trend:u,trendValue:f,style:s}){const m=U(),p=te(),x=R(e),y=f?R(f):void 0,v=u==="up"?m.success:u==="down"?m.danger:void 0;return a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...s}},a.createElement("div",{style:{color:m.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},x),d?a.createElement(Jc,{w:"120px",h:"32px",alt:m.surfaceAlt,bdr:m.border,rm:p}):a.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m.text,fontVariantNumeric:"tabular-nums",...c}},n&&a.createElement("span",{style:{fontSize:"0.75em",fontWeight:400}},n),a.createElement("span",null,Xc(r,i,l)),o&&a.createElement("span",{style:{fontSize:"0.6em",fontWeight:400,color:m.textMuted}},o)),u&&a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:v,marginTop:"2px"}},a.createElement(Zc,{direction:u,color:v}),y&&a.createElement("span",null,y)))}function ed({title:e,value:r,format:n="HH:mm:ss",onFinish:o,prefix:i,suffix:l,style:c}){const d=U(),u=R(e),f=a.useRef(o);f.current=o;const s=a.useRef(!1),[m,p]=a.useState(()=>Math.max(0,r-Date.now()));a.useEffect(()=>{s.current=!1;const y=()=>{var g;const b=Math.max(0,r-Date.now());p(b),b<=0&&!s.current&&(s.current=!0,(g=f.current)==null||g.call(f))};y();const v=setInterval(y,1e3);return()=>clearInterval(v)},[r]);const x=qc(m,n);return a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},a.createElement("div",{style:{color:d.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},u),a.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m<=0?d.danger:d.text,fontVariantNumeric:"tabular-nums"}},i&&a.createElement("span",{style:{fontSize:"0.75em",fontWeight:400}},i),a.createElement("span",null,x),l&&a.createElement("span",{style:{fontSize:"0.6em",fontWeight:400,color:d.textMuted}},l)))}const td={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function rd({options:e,value:r,onChange:n,size:o="md",block:i=!1}){const l=U(),c=te(),d=a.useRef(null),[u,f]=a.useState(()=>Math.max(0,e.findIndex(v=>v.value===r))),[s,m]=a.useState({}),p=td[o];a.useEffect(()=>{const v=e.findIndex(b=>b.value===r);v>=0&&f(v)},[r,e]),a.useEffect(()=>{const v=d.current;if(!v)return;const g=v.querySelectorAll("[data-seg-btn]")[u];g&&m({left:g.offsetLeft,width:g.offsetWidth,height:g.offsetHeight,transition:c?"none":"left 0.2s ease, width 0.2s ease"})},[u,e,c]);const x=a.useCallback(v=>{const b=e[v];!b||b.disabled||(f(v),n==null||n(b.value))},[e,n]),y=a.useCallback(v=>{var g,w,S;let b=u;if(v.key==="ArrowRight"||v.key==="ArrowDown")for(v.preventDefault(),b=(u+1)%e.length;(g=e[b])!=null&&g.disabled&&b!==u;)b=(b+1)%e.length;else if(v.key==="ArrowLeft"||v.key==="ArrowUp")for(v.preventDefault(),b=(u-1+e.length)%e.length;(w=e[b])!=null&&w.disabled&&b!==u;)b=(b-1+e.length)%e.length;if(b!==u){x(b);const M=d.current,N=M==null?void 0:M.querySelectorAll("[data-seg-btn]");(S=N==null?void 0:N[b])==null||S.focus()}},[u,e,x]);return t.jsxs("div",{ref:d,role:"radiogroup","aria-label":"Segmented control",className:h("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:l.surfaceAlt,border:`1px solid ${l.border}`,width:i?"100%":void 0},onKeyDown:y,children:[t.jsx("div",{"aria-hidden":"true",className:h("absolute top-1 rounded-md"),style:{...s,backgroundColor:l.surface,boxShadow:`0 1px 3px ${l.border}`,zIndex:0}}),e.map((v,b)=>{const g=b===u,w=R(v.label);return t.jsxs("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":g,"aria-disabled":v.disabled||void 0,disabled:v.disabled,tabIndex:g?0:-1,className:h("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:p.height,fontSize:p.fontSize,padding:`0 ${p.px}px`,flex:i?1:void 0,color:g?l.text:l.textMuted,backgroundColor:"transparent",opacity:v.disabled?.4:1,fontWeight:g?600:400,transition:c?"none":"color 0.15s ease"},onClick:()=>x(b),children:[v.icon&&t.jsx("span",{"aria-hidden":"true",children:v.icon}),w]},v.value)})]})}function nd({options:e,value:r="",onChange:n,trigger:o="@",placeholder:i,label:l}){const c=U(),d=te(),u=a.useRef(null),f=a.useRef(null),[s,m]=a.useState(r),[p,x]=a.useState(!1),[y,v]=a.useState(""),[b,g]=a.useState(0),[w,S]=a.useState(-1);a.useEffect(()=>{r!==void 0&&m(r)},[r]);const M=e.filter($=>$.label.toLowerCase().includes(y.toLowerCase())),N=a.useCallback($=>{const z=$.target.value;m(z),n==null||n(z);const E=$.target.selectionStart??z.length,C=z.slice(0,E),k=C.lastIndexOf(o);if(k>=0){const A=C.slice(k+o.length);if(!/\s/.test(A)){v(A),S(k),x(!0),g(0);return}}x(!1)},[o,n]),j=a.useCallback($=>{var k;const z=s.slice(0,w),E=s.slice(w+o.length+y.length),C=`${z}${o}${$.value} ${E}`;m(C),n==null||n(C),x(!1),(k=u.current)==null||k.focus()},[s,w,o,y,n]),L=a.useCallback($=>{p&&($.key==="ArrowDown"?($.preventDefault(),g(z=>(z+1)%M.length)):$.key==="ArrowUp"?($.preventDefault(),g(z=>(z-1+M.length)%M.length)):$.key==="Enter"&&M[b]?($.preventDefault(),j(M[b])):$.key==="Escape"&&x(!1))},[p,M,b,j]);a.useEffect(()=>{if(!p||!f.current)return;const $=f.current.children[b];$==null||$.scrollIntoView({block:"nearest"})},[b,p]);const I=l?R(l):void 0,T=i?R(i):void 0;return t.jsxs("div",{className:h("relative font-sans"),style:{width:"100%"},children:[I&&t.jsx("label",{className:h("block text-sm font-medium mb-1"),style:{color:c.text},children:I}),t.jsx("textarea",{ref:u,role:"combobox","aria-expanded":p,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":I??"Mentions input",value:s,placeholder:T,onChange:N,onKeyDown:L,onBlur:()=>setTimeout(()=>x(!1),200),className:h("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:c.surface,borderColor:c.border,color:c.text,minHeight:80,outline:"none"},rows:3}),p&&M.length>0&&t.jsx("ul",{ref:f,role:"listbox","aria-label":"Mention suggestions",className:h("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:c.surface,borderColor:c.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${c.bg}80`,animation:d?"none":"tkxFadeIn 0.15s ease"},children:M.map(($,z)=>t.jsxs("li",{role:"option","aria-selected":z===b,className:h("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:z===b?c.surfaceAlt:"transparent",color:c.text},onMouseDown:E=>{E.preventDefault(),j($)},onMouseEnter:()=>g(z),children:[$.avatar&&t.jsx("img",{src:R($.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:h("rounded-full"),style:{objectFit:"cover"}}),t.jsx("span",{children:R($.label)}),t.jsxs("span",{style:{color:c.textMuted,marginLeft:"auto"},children:[o,R($.value)]})]},$.value))})]})}function od(e){let r=5381;for(let n=0;n<e.length;n++)r=(r<<5)+r+e.charCodeAt(n)|0;return Math.abs(r)}function sd(e){let r=e;return()=>(r=r*1664525+1013904223|0,(r>>>0)/4294967295)}const id={L:.38,M:.42,Q:.48,H:.55};function ad(e,r,n){const o=od(e),i=sd(o),l=id[n]??.42,c=Array.from({length:r},()=>Array.from({length:r},()=>!1)),d=(u,f)=>{for(let s=0;s<7;s++)for(let m=0;m<7;m++){const p=s===0||s===6||m===0||m===6,x=s>=2&&s<=4&&m>=2&&m<=4;c[u+s][f+m]=p||x}};d(0,0),d(0,r-7),d(r-7,0);for(let u=7;u<r-7;u++)c[6][u]=u%2===0,c[u][6]=u%2===0;for(let u=0;u<r;u++)for(let f=0;f<r;f++)u<8&&f<8||u<8&&f>=r-8||u>=r-8&&f<8||(u===6||f===6)||(c[u][f]=i()<l);return c}function ld({value:e,size:r=160,color:n,bgColor:o,errorLevel:i="M",icon:l,bordered:c=!0}){const d=U(),u=te(),f=a.useRef(null),s=R(e),m=n??d.text,p=o??d.surface,x=25,y=a.useMemo(()=>ad(s,x,i),[s,i]);return a.useEffect(()=>{const v=f.current;if(!v)return;const b=v.getContext("2d");if(!b)return;const g=window.devicePixelRatio||1;v.width=r*g,v.height=r*g,b.scale(g,g);const w=r/x;b.fillStyle=p,b.fillRect(0,0,r,r),b.fillStyle=m;for(let S=0;S<x;S++)for(let M=0;M<x;M++)y[S][M]&&b.fillRect(M*w,S*w,w,w);if(l){const S=r*.22,M=(r-S)/2;b.fillStyle=p,b.fillRect(M-2,M-2,S+4,S+4);const N=new Image;N.crossOrigin="anonymous",N.onload=()=>{b.drawImage(N,M,M,S,S)},N.src=R(l)}},[y,r,m,p,l]),t.jsx("div",{role:"img","aria-label":`QR code for: ${s}`,className:h("inline-block rounded-lg"),style:{padding:c?12:0,backgroundColor:c?p:"transparent",border:c?`1px solid ${d.border}`:"none",lineHeight:0,animation:u?"none":"tkxFadeIn 0.2s ease"},children:t.jsx("canvas",{ref:f,"aria-hidden":"true",style:{width:r,height:r,display:"block"}})})}const cd={success:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),t.jsx("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),t.jsx("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),t.jsx("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function dd(e,r){switch(e){case"success":return r.success;case"error":case"500":return r.danger;case"warning":return r.warning;case"info":return r.info;case"404":case"403":return r.textMuted}}function ud({status:e,title:r,subTitle:n,icon:o,extra:i}){const l=U(),c=te(),d=dd(e,l),u=R(r),f=n?R(n):void 0;return t.jsxs("div",{role:"status","aria-live":"polite",className:h("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:c?"none":"tkxFadeIn 0.3s ease"},children:[t.jsx("div",{className:h("mb-6"),children:o??cd[e](d)}),t.jsx("h2",{className:h("text-xl font-semibold m-0 mb-2"),style:{color:l.text},children:u}),f&&t.jsx("p",{className:h("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:l.textMuted},children:f}),i&&t.jsx("div",{className:h("flex items-center gap-3 mt-4"),children:i})]})}function fd(e){const r=document.querySelector(e);return r?r.getBoundingClientRect():null}function pd(e,r,n,o){switch(r){case"top":return{top:e.top-o-12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"bottom":return{top:e.bottom+12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"left":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.left-n-12+window.scrollX};case"right":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.right+12+window.scrollX};default:return{top:e.bottom+12+window.scrollY,left:e.left+window.scrollX}}}function xd({steps:e,isOpen:r=!1,onClose:n,current:o,onChange:i}){const l=U(),c=te(),[d,u]=a.useState(0),f=o??d,s=a.useRef(null),[m,p]=a.useState({top:0,left:0}),[x,y]=a.useState(null),v=e[f],b=a.useCallback(()=>{if(!v)return;const T=fd(v.target);if(y(T),T&&s.current){const $=s.current.offsetWidth,z=s.current.offsetHeight;p(pd(T,v.placement??"bottom",$,z))}},[v]);a.useEffect(()=>{if(r)return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[r,f,b]),a.useEffect(()=>{var T;r&&((T=s.current)==null||T.focus())},[r,f]);const g=a.useCallback(T=>{u(T),i==null||i(T)},[i]),w=a.useCallback(()=>{f<e.length-1?g(f+1):n==null||n()},[f,e.length,g,n]),S=a.useCallback(()=>{f>0&&g(f-1)},[f,g]);if(!r||!v)return null;const M=6,N=R(v.title),j=R(v.description),I=t.jsxs("div",{"aria-hidden":"true",children:[t.jsx("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:x?`polygon(0% 0%, 0% 100%, ${x.left-M}px 100%, ${x.left-M}px ${x.top-M}px, ${x.right+M}px ${x.top-M}px, ${x.right+M}px ${x.bottom+M}px, ${x.left-M}px ${x.bottom+M}px, ${x.left-M}px 100%, 100% 100%, 100% 0%)`:void 0,transition:c?"none":"clip-path 0.25s ease"},onClick:n}),t.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":`Tour step ${f+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:m.top,left:m.left,width:300,backgroundColor:l.surface,border:`1px solid ${l.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${l.bg}80`,animation:c?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:T=>{T.key==="Escape"&&(n==null||n())},children:[t.jsx("h3",{className:h("m-0 mb-2 text-base font-semibold"),style:{color:l.text},children:N}),t.jsx("p",{className:h("m-0 mb-4 text-sm leading-relaxed"),style:{color:l.textMuted},children:j}),t.jsx("div",{className:h("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((T,$)=>t.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:$===f?l.primary:l.border,transition:c?"none":"background-color 0.2s"}},$))}),t.jsxs("div",{className:h("flex items-center justify-between gap-2"),children:[t.jsx("button",{type:"button","aria-label":"Skip tour",onClick:n,className:h("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:l.textMuted},children:"Skip"}),t.jsxs("div",{className:h("flex gap-2"),children:[f>0&&t.jsx("button",{type:"button","aria-label":"Previous step",onClick:S,className:h("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:l.border,color:l.text},children:"Prev"}),t.jsx("button",{type:"button","aria-label":f===e.length-1?"Finish tour":"Next step",onClick:w,className:h("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:l.primary,color:"#fff"},children:f===e.length-1?"Finish":"Next"})]})]})]})]});return Ne.createPortal(I,document.body)}function hd(e,r,n,o,i){const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return"";const d=o*1.5,u=e.length*d,f=Math.max(...e.map(x=>x.length))*o*.6,s=n[0]+f,m=n[1]+u,p=2;return l.width=s*p,l.height=m*p,c.scale(p,p),c.translate(s/2,m/2),c.rotate(r*Math.PI/180),c.font=`${o}px sans-serif`,c.fillStyle=i,c.textAlign="center",c.textBaseline="middle",e.forEach((x,y)=>{const v=(y-(e.length-1)/2)*d;c.fillText(x,0,v)}),l.toDataURL()}function md({text:e,children:r,rotate:n=-22,gap:o=[100,100],fontSize:i=14,color:l,zIndex:c=10}){const d=U(),u=te(),f=a.useRef(null),[s,m]=a.useState(""),p=a.useMemo(()=>(Array.isArray(e)?e:[e]).map(v=>R(v)),[e]),x=l??`${d.textMuted}22`,y=a.useCallback(()=>hd(p,n,o,i,x),[p,n,o,i,x]);return a.useEffect(()=>{const v=y();v&&m(`url(${v})`)},[y]),a.useEffect(()=>{var g;const v=(g=f.current)==null?void 0:g.querySelector("[data-watermark]");if(!v)return;const b=new MutationObserver(()=>{const w=y();w&&(v.style.backgroundImage=`url(${w})`)});return b.observe(v,{attributes:!0,attributeFilter:["style"]}),()=>b.disconnect()},[y]),t.jsxs("div",{ref:f,className:h("relative"),style:{overflow:"hidden"},children:[r,t.jsx("div",{"data-watermark":!0,"aria-hidden":"true",className:h("absolute inset-0 pointer-events-none"),style:{zIndex:c,backgroundImage:s,backgroundRepeat:"repeat",animation:u?"none":"tkxFadeIn 0.3s ease"}})]})}function Mn(e){if(e)try{return e()}catch{return window}return window}function gd(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const r=e.getBoundingClientRect();return{top:r.top,bottom:r.bottom}}function bd({children:e,offsetTop:r,offsetBottom:n,onChange:o,target:i}){const l=U(),c=te(),d=a.useRef(null),u=a.useRef(null),[f,s]=a.useState(!1),[m,p]=a.useState({width:0,height:0}),x=a.useRef(!1),y=a.useMemo(()=>R("Sticky content"),[]),v=a.useCallback(()=>{const w=d.current;if(!w)return;const S=w.getBoundingClientRect(),M=gd(Mn(i));let N=!1;r!==void 0?N=S.top-M.top<=r:n!==void 0&&(N=M.bottom-S.bottom<=n),N!==x.current&&(x.current=N,s(N),p({width:S.width,height:S.height}),o==null||o(N))},[r,n,o,i]);a.useEffect(()=>{const w=Mn(i);return v(),w.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{w.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[v,i]);const b=f?{position:"fixed",zIndex:100,...r!==void 0?{top:r}:{},...n!==void 0?{bottom:n}:{},width:m.width||void 0,transition:c?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${l.border}`}:{},g=f?{height:m.height,width:m.width}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:d,"aria-hidden":f,style:g}),t.jsx("div",{ref:u,role:"region","aria-label":y,className:h(f?"tkx-affixed":""),style:b,children:e})]})}function Yo(e){const r=[];for(const n of e)r.push(n),n.children&&r.push(...Yo(n.children));return r}function Cn(e){return e.startsWith("#")?e.slice(1):e}function Uo({item:e,activeKey:r,depth:n,onClick:o,theme:i,reducedMotion:l}){const c=e.key===r,d=R(e.title);return t.jsxs("li",{role:"none",style:{listStyle:"none"},children:[t.jsx("a",{role:"treeitem","aria-current":c?"location":void 0,href:e.href,onClick:u=>{u.preventDefault(),o(e.href)},className:h("block text-sm py-1 no-underline"),style:{paddingLeft:12+n*16,color:c?i.primary:i.textMuted,fontWeight:c?600:400,borderLeft:`2px solid ${c?i.primary:"transparent"}`,transition:l?"none":"color 0.15s ease, border-color 0.15s ease"},children:d}),e.children&&e.children.length>0&&t.jsx("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(u=>t.jsx(Uo,{item:u,activeKey:r,depth:n+1,onClick:o,theme:i,reducedMotion:l},u.key))})]})}function yd({items:e,offsetTop:r=0,getCurrentAnchor:n,onChange:o}){var p;const i=U(),l=te(),[c,d]=a.useState(((p=e[0])==null?void 0:p.key)??""),u=a.useRef(!1),f=Yo(e),s=a.useCallback(()=>{var y;if(u.current)return;let x=((y=f[0])==null?void 0:y.key)??"";for(const v of f){const b=Cn(v.href),g=document.getElementById(b);g&&g.getBoundingClientRect().top<=r+10&&(x=v.key)}n&&(x=n(x)),x!==c&&(d(x),o==null||o(x))},[f,r,n,c,o]);a.useEffect(()=>(window.addEventListener("scroll",s,{passive:!0}),s(),()=>window.removeEventListener("scroll",s)),[s]);const m=a.useCallback(x=>{const y=Cn(x),v=document.getElementById(y);if(!v)return;u.current=!0;const b=v.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:b,behavior:l?"auto":"smooth"});const g=f.find(w=>w.href===x);g&&(d(g.key),o==null||o(g.key)),setTimeout(()=>{u.current=!1},800)},[f,r,l,o]);return t.jsx("nav",{role:"tree","aria-label":"Anchor navigation",className:h("font-sans"),style:{borderLeft:`1px solid ${i.border}`,padding:"4px 0"},children:t.jsx("ul",{role:"group",style:{margin:0,padding:0},children:e.map(x=>t.jsx(Uo,{item:x,activeKey:c,depth:0,onClick:m,theme:i,reducedMotion:l},x.key))})})}function vd(e,r){var i;const n=[e];let o=e;for(const l of r){const c=o.find(d=>d.value===l);if((i=c==null?void 0:c.children)!=null&&i.length)n.push(c.children),o=c.children;else break}return n}function Ko(e,r){const n=[];let o=e;for(const i of r){const l=o.find(c=>c.value===i);if(l)n.push(l),o=l.children??[];else break}return n}function kd(e,r){return Ko(e,r).map(n=>R(n.label)).join(" / ")}function wd({options:e,value:r=[],onChange:n,placeholder:o="Select...",label:i,multiple:l=!1}){const c=U(),d=te(),u=a.useRef(null),f=a.useRef(null),[s,m]=a.useState(!1),[p,x]=a.useState(r),[y,v]=a.useState({top:0,left:0,width:0}),b=i?R(i):void 0,g=R(o),w=r.length>0?kd(e,r):"";a.useEffect(()=>{if(!s||!u.current)return;const L=u.current.getBoundingClientRect();v({top:L.bottom+4+window.scrollY,left:L.left+window.scrollX,width:Math.max(L.width,200)})},[s]),a.useEffect(()=>{if(!s)return;const L=I=>{var T,$;!((T=u.current)!=null&&T.contains(I.target))&&!(($=f.current)!=null&&$.contains(I.target))&&m(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[s]);const S=a.useCallback((L,I)=>{var $;if(I.disabled)return;const T=[...p.slice(0,L),I.value];if(x(T),!(($=I.children)!=null&&$.length)){const z=Ko(e,T);n==null||n(T,z),l||m(!1)}},[p,e,n,l]),M=a.useCallback(L=>{var I;L.key==="Escape"?(m(!1),(I=u.current)==null||I.focus()):(L.key==="Enter"||L.key===" ")&&(s||(L.preventDefault(),m(!0)))},[s]),N=vd(e,p),j=s?Ne.createPortal(t.jsx("div",{ref:f,role:"tree","aria-label":b??"Cascader options",className:h("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:y.top,left:y.left,backgroundColor:c.surface,borderColor:c.border,boxShadow:`0 4px 16px ${c.bg}80`,animation:d?"none":"tkxFadeIn 0.15s ease"},children:N.map((L,I)=>t.jsx("ul",{role:"group",className:h("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:I<N.length-1?`1px solid ${c.border}`:"none"},children:L.map(T=>{var E;const $=p[I]===T.value,z=R(T.label);return t.jsxs("li",{role:"treeitem","aria-selected":$,"aria-disabled":T.disabled||void 0,"aria-expanded":(E=T.children)!=null&&E.length?$:void 0,className:h("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:$?c.surfaceAlt:"transparent",color:T.disabled?c.textMuted:c.text,opacity:T.disabled?.5:1,cursor:T.disabled?"not-allowed":"pointer"},onClick:()=>S(I,T),onMouseEnter:()=>{T.disabled||x(C=>[...C.slice(0,I),T.value])},children:[t.jsx("span",{children:z}),T.children&&T.children.length>0&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:c.textMuted,flexShrink:0},children:t.jsx("path",{d:"M10 6l6 6-6 6V6z"})})]},T.value)})},I))}),document.body):null;return t.jsxs("div",{className:h("relative font-sans"),onKeyDown:M,children:[b&&t.jsx("label",{className:h("block text-sm font-medium mb-1"),style:{color:c.text},children:b}),t.jsxs("button",{ref:u,type:"button",role:"combobox","aria-expanded":s,"aria-haspopup":"tree","aria-label":b??"Cascader",className:h("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:c.surface,borderColor:s?c.primary:c.border,color:w?c.text:c.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>m(L=>!L),children:[t.jsx("span",{className:h("truncate"),children:w||g}),t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:c.textMuted,transform:s?"rotate(180deg)":"rotate(0deg)",transition:d?"none":"transform 0.2s ease",flexShrink:0},children:t.jsx("path",{d:"M7 10l5 5 5-5H7z"})})]}),j]})}const jd={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Sd({theme:e,reducedMotion:r}){return t.jsxs("div",{className:h("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[t.jsx("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:r?"none":"tkxPulse 1.5s ease infinite"}}),t.jsxs("div",{className:h("flex-1"),children:[t.jsx("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:r?"none":"tkxPulse 1.5s ease infinite"}}),t.jsx("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:r?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function $d({items:e,header:r,footer:n,bordered:o=!0,size:i="md",loading:l=!1,emptyText:c="No data",grid:d}){const u=U(),f=te(),s=R(c),m=jd[i],p=!!d,x=(d==null?void 0:d.column)??1,y=(d==null?void 0:d.gutter)??16;return t.jsxs("div",{role:"list","aria-label":"List","aria-busy":l,className:h("font-sans rounded-lg overflow-hidden"),style:{border:o?`1px solid ${u.border}`:"none",backgroundColor:u.surface},children:[r&&t.jsx("div",{className:h("font-semibold text-sm"),style:{padding:m,color:u.text,borderBottom:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:r}),l&&t.jsx("div",{children:Array.from({length:3}).map((v,b)=>t.jsx(Sd,{theme:u,reducedMotion:f},b))}),!l&&e.length===0&&t.jsx("div",{role:"status",className:h("text-center py-12 text-sm"),style:{color:u.textMuted},children:s}),!l&&e.length>0&&t.jsx("div",{style:p?{display:"grid",gridTemplateColumns:`repeat(${x}, 1fr)`,gap:y,padding:y}:void 0,children:e.map((v,b)=>{const g=R(v.title),w=v.description?R(v.description):void 0;return t.jsxs("div",{role:"listitem",className:h("flex items-start gap-3"),style:{padding:m,borderBottom:!p&&b<e.length-1?`1px solid ${u.border}`:"none",...p?{border:`1px solid ${u.border}`,borderRadius:8,backgroundColor:u.surface}:{},animation:f?"none":`tkxFadeIn 0.2s ease ${b*.03}s both`},children:[v.avatar&&t.jsx("div",{"aria-hidden":"true",className:h("shrink-0"),children:v.avatar}),t.jsxs("div",{className:h("flex-1 min-w-0"),children:[t.jsx("div",{className:h("text-sm font-medium"),style:{color:u.text},children:g}),w&&t.jsx("div",{className:h("text-xs mt-1 leading-relaxed"),style:{color:u.textMuted},children:w})]}),v.extra&&t.jsx("div",{className:h("shrink-0 ml-auto"),style:{color:u.textMuted},children:v.extra}),v.actions&&t.jsx("div",{className:h("shrink-0 flex items-center gap-2"),children:v.actions})]},v.key)})}),n&&t.jsx("div",{className:h("text-sm"),style:{padding:m,color:u.textMuted,borderTop:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:n})]})}const Zt={close:"Close",cancel:"Cancel",confirm:"Confirm",save:"Save",delete:"Delete",search:"Search",loading:"Loading...",noResults:"No results found",required:"Required",previous:"Previous",next:"Next",pageOf:(e,r)=>`Page ${e} of ${r}`,selectPlaceholder:"Select...",clearSelection:"Clear selection",selectDate:"Select a date",today:"Today",dropFiles:"Drop files here or",browse:"Browse",noData:"No data available",sortAscending:"Sort ascending",sortDescending:"Sort descending"},Xo={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",delete:"Eliminar",search:"Buscar",loading:"Cargando...",noResults:"No se encontraron resultados",required:"Requerido",previous:"Anterior",next:"Siguiente",pageOf:(e,r)=>`Página ${e} de ${r}`,selectPlaceholder:"Seleccionar...",clearSelection:"Limpiar selección",selectDate:"Seleccionar fecha",today:"Hoy",dropFiles:"Suelte archivos aquí o",browse:"Explorar",noData:"No hay datos disponibles",sortAscending:"Orden ascendente",sortDescending:"Orden descendente"},qo={close:"إغلاق",cancel:"إلغاء",confirm:"تأكيد",save:"حفظ",delete:"حذف",search:"بحث",loading:"...جارٍ التحميل",noResults:"لم يتم العثور على نتائج",required:"مطلوب",previous:"السابق",next:"التالي",pageOf:(e,r)=>`صفحة ${e} من ${r}`,selectPlaceholder:"...اختر",clearSelection:"مسح الاختيار",selectDate:"اختر تاريخ",today:"اليوم",dropFiles:"أفلت الملفات هنا أو",browse:"تصفح",noData:"لا توجد بيانات",sortAscending:"ترتيب تصاعدي",sortDescending:"ترتيب تنازلي"},Zo={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",save:"Enregistrer",delete:"Supprimer",search:"Rechercher",loading:"Chargement...",noResults:"Aucun résultat trouvé",required:"Obligatoire",previous:"Précédent",next:"Suivant",pageOf:(e,r)=>`Page ${e} sur ${r}`,selectPlaceholder:"Sélectionner...",clearSelection:"Effacer la sélection",selectDate:"Sélectionner une date",today:"Aujourd'hui",dropFiles:"Déposez les fichiers ici ou",browse:"Parcourir",noData:"Aucune donnée disponible",sortAscending:"Tri croissant",sortDescending:"Tri décroissant"},Go={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",save:"Speichern",delete:"Löschen",search:"Suchen",loading:"Wird geladen...",noResults:"Keine Ergebnisse gefunden",required:"Erforderlich",previous:"Zurück",next:"Weiter",pageOf:(e,r)=>`Seite ${e} von ${r}`,selectPlaceholder:"Auswählen...",clearSelection:"Auswahl löschen",selectDate:"Datum auswählen",today:"Heute",dropFiles:"Dateien hier ablegen oder",browse:"Durchsuchen",noData:"Keine Daten verfügbar",sortAscending:"Aufsteigend sortieren",sortDescending:"Absteigend sortieren"},Jo={close:"閉じる",cancel:"キャンセル",confirm:"確認",save:"保存",delete:"削除",search:"検索",loading:"読み込み中...",noResults:"結果が見つかりません",required:"必須",previous:"前へ",next:"次へ",pageOf:(e,r)=>`${r}ページ中${e}ページ`,selectPlaceholder:"選択...",clearSelection:"選択解除",selectDate:"日付を選択",today:"今日",dropFiles:"ファイルをドロップまたは",browse:"参照",noData:"データなし",sortAscending:"昇順",sortDescending:"降順"},Qo={"en-US":Zt,"es-ES":Xo,"ar-SA":qo,"fr-FR":Zo,"de-DE":Go,"ja-JP":Jo},Md=new Set(["ar-SA","he-IL","fa-IR","ur-PK"]);function es(e){return Md.has(e)}const Lt=a.createContext({locale:"en-US",direction:"ltr",strings:Zt});function Cd(){return a.useContext(Lt)}function Td(){return a.useContext(Lt).strings}function Ed(){return a.useContext(Lt).direction}function Id({locale:e="en-US",direction:r,strings:n,children:o}){const i=a.useMemo(()=>{const l=Qo[e]??Zt,c=n?{...l,...n}:l,d=r??(es(e)?"rtl":"ltr");return{locale:e,direction:d,strings:c}},[e,r,n]);return t.jsx(Lt.Provider,{value:i,children:t.jsx("div",{dir:i.direction,style:{direction:i.direction},children:o})})}function Nd({contentId:e="tkx-main-content",label:r="Skip to main content"}){return t.jsx("a",{href:`#${e}`,className:"tkx-skip-nav",children:r})}function zd({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 Ld({active:e,children:r,as:n="div"}){const o=Kt(e);return t.jsx(n,{ref:o,children:r})}function Ad({as:e,children:r,...n}){const o=e??"span";return t.jsx(o,{className:"tkx-sr-only",...n,children:r})}exports.FocusTrap=Ld;exports.I18nContext=Lt;exports.I18nProvider=Id;exports.LOCALES=Qo;exports.LRUCache=Tn;exports.LiveRegion=zd;exports.Quantum=ds;exports.SIZE_BORDER_RADIUS=Ic;exports.SIZE_FONT=Cc;exports.SIZE_HEIGHT=Mc;exports.SIZE_ICON=Nc;exports.SIZE_PADDING_X=Tc;exports.SIZE_PADDING_Y=Ec;exports.Shield=Ds;exports.SkipNav=Nd;exports.TKX=xs;exports.ThemeContext=wr;exports.ThemeProvider=js;exports.TkxAccordion=xo;exports.TkxAffix=bd;exports.TkxAlert=xi;exports.TkxAnchor=yd;exports.TkxAppBar=Dl;exports.TkxAutocomplete=ml;exports.TkxAvatar=so;exports.TkxBadge=eo;exports.TkxBottomNav=Pl;exports.TkxBreadcrumb=ul;exports.TkxButton=Gn;exports.TkxCard=Jn;exports.TkxCardBody=ii;exports.TkxCardFooter=ai;exports.TkxCardHeader=si;exports.TkxCarousel=Io;exports.TkxCascader=wd;exports.TkxChat=$a;exports.TkxChatBubble=yo;exports.TkxCheckbox=lo;exports.TkxClock=jo;exports.TkxCol=Vo;exports.TkxColorPicker=Ja;exports.TkxCommand=Eo;exports.TkxConfigProvider=Oo;exports.TkxContent=Fo;exports.TkxCountdown=ed;exports.TkxDataGrid=ql;exports.TkxDatePicker=ho;exports.TkxDivider=io;exports.TkxDrawer=Zi;exports.TkxEmpty=Kc;exports.TkxFileUpload=xa;exports.TkxFooter=Po;exports.TkxForm=No;exports.TkxFormField=zo;exports.TkxHeader=Bo;exports.TkxImage=da;exports.TkxInput=Qn;exports.TkxLayout=Do;exports.TkxList=$d;exports.TkxMasonry=Ql;exports.TkxMentions=nd;exports.TkxMenu=wo;exports.TkxModal=gi;exports.TkxNumberInput=Co;exports.TkxOTP=To;exports.TkxPagination=go;exports.TkxParagraph=Fc;exports.TkxPopover=pl;exports.TkxProgress=to;exports.TkxQRCode=ld;exports.TkxRadio=uo;exports.TkxRadioGroup=Ri;exports.TkxRating=ka;exports.TkxResult=ud;exports.TkxRichTextDisplay=uc;exports.TkxRow=Ho;exports.TkxSegmented=rd;exports.TkxSelect=ao;exports.TkxSider=Wo;exports.TkxSkeleton=qt;exports.TkxSlider=mo;exports.TkxSnackbar=Yl;exports.TkxSpeedDial=zl;exports.TkxSpin=_c;exports.TkxStatistic=Qc;exports.TkxStepper=$o;exports.TkxTab=vi;exports.TkxTabList=yi;exports.TkxTabPanel=wi;exports.TkxTabPanels=ki;exports.TkxTable=Ti;exports.TkxTabs=bi;exports.TkxTag=vo;exports.TkxTagInput=Na;exports.TkxText=Wc;exports.TkxThinkingIndicator=bo;exports.TkxTimeline=Aa;exports.TkxTitle=Bc;exports.TkxToastProvider=Oi;exports.TkxToggle=ro;exports.TkxToolbar=wl;exports.TkxTooltip=Si;exports.TkxTour=xd;exports.TkxTransferList=Ml;exports.TkxTreeView=vl;exports.TkxVideoPlayer=So;exports.TkxWatermark=md;exports.VisuallyHidden=Ad;exports.WCAGEngine=ys;exports.arSA=qo;exports.audit=_n;exports.auroraLight=vs;exports.batchUpdate=Nn;exports.breakpoints=Ts;exports.contrastRatio=jt;exports.createFocusTrap=br;exports.createTheme=ws;exports.css=An;exports.cssVar=mr;exports.cx=ae;exports.deDE=Go;exports.enUS=Zt;exports.esES=Xo;exports.extractAtomicCSS=qs;exports.extractCSS=gr;exports.fnv1aHash=ht;exports.frFR=Zo;exports.fromObject=Rn;exports.generatePalette=$s;exports.getAccessibleForeground=at;exports.getAuditLog=Yn;exports.getLocaleDisplayName=Rc;exports.injectStyles=Wn;exports.isRTL=es;exports.isRtlLocale=Ac;exports.jaJP=Jo;exports.keyframes=Bn;exports.meetsAA=Ot;exports.meetsAAA=Fn;exports.memoize=En;exports.prefersHighContrast=vr;exports.prefersReducedMotion=yr;exports.quantumDark=kr;exports.radii=Ns;exports.resetAtomicCSS=Zs;exports.resolvePluginUtility=Zn;exports.responsive=Dn;exports.sanitizeProps=jr;exports.sanitizeString=R;exports.shadows=Es;exports.spacing=Cs;exports.tkx=h;exports.tkxListPlugins=Qs;exports.tkxPlugin=Gs;exports.tkxRemovePlugin=Js;exports.tx=Xs;exports.typography=Ms;exports.useAnnounce=Sr;exports.useClickOutside=Kn;exports.useComponentSize=$c;exports.useConfig=zt;exports.useDirection=Ed;exports.useEscapeKey=lt;exports.useFocusTrap=Kt;exports.useHighContrast=Bs;exports.useI18n=Cd;exports.useLocale=Td;exports.useLogicalSpacing=Lc;exports.usePrefixCls=Sc;exports.useReducedMotion=te;exports.useRtlFlip=zc;exports.useTheme=U;exports.useTkxCommand=sl;exports.useTkxForm=hc;exports.useToast=Wi;exports.validateProps=Ut;exports.verifyAuditIntegrity=Un;exports.zIndex=Is;