tekivex-ui 3.19.1 → 3.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +32 -32
- package/dist/index.cjs +1 -1
- package/dist/index.js +25 -23
- package/dist/src/components/TkxAddressInput.d.ts +19 -0
- package/package.json +1 -1
package/dist/headless.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import{cloneElement as e,createContext as t,forwardRef as n,useCallback as r,useContext as o,useEffect as i,useId as l,useMemo as a,useReducer as s,useRef as c,useState as d}from"react";import{Fragment as u,jsx as f,jsxs as p}from"react/jsx-runtime";import{createPortal as h}from"react-dom";function m(e){const[t,n,r]=function(e){if(!e||"string"!=typeof e)return[0,0,0];const t=e.replace("#",""),n=3===t.length?t.split("").map(e=>e+e).join(""):t,r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),i=parseInt(n.slice(4,6),16);return[isNaN(r)?0:r,isNaN(o)?0:o,isNaN(i)?0:i]}(e).map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*r}function g(e,t){const n=m(e),r=m(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function x(e,t,n=!1){return g(e,t)>=(n?3:4.5)}function b(e,t,n=!1){return g(e,t)>=(n?4.5:7)}function y(e,t){const n=t??["#ffffff","#000000"];return n.reduce((t,n)=>g(n,e)>g(t,e)?n:t,n[0])}var w=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function v(){const[e,t]=d(()=>"undefined"!=typeof window&&"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return i(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}function k(){const[e,t]=d(()=>"undefined"!=typeof window&&"undefined"!=typeof window&&window.matchMedia("(forced-colors: active)").matches);return i(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(forced-colors: active)"),n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}function $(e){const t=c(null);return i(()=>{if(!e||!t.current)return;const n=function(e){let t=null,n=null;function r(){return Array.from(e.querySelectorAll(w)).filter(e=>!e.closest("[hidden]")&&!e.closest('[aria-hidden="true"]'))}return{activate(){t=document.activeElement;const o=r();o.length>0&&o[0].focus(),n=e=>{if("Tab"!==e.key)return;const t=r();if(0===t.length)return;const n=t[0],o=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),n.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),t instanceof HTMLElement&&t.focus(),t=null,n=null}}}(t.current);return n.activate(),()=>n.deactivate()},[e]),t}function S(){const e=c(null);return i(()=>{if("undefined"!=typeof document)return e.current=function(){const e=document.createElement("div"),t=document.createElement("div");for(const n of[e,t])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"),t.setAttribute("aria-live","assertive"),{announce(n,r="polite"){const o="assertive"===r?t:e;o.textContent="",setTimeout(()=>{o.textContent=n},0)},destroy(){e.remove(),t.remove()}}}(),()=>{e.current?.destroy()}},[]),r((t,n="polite")=>{e.current?.announce(t,n)},[])}function z(e,t=!0){const n=c(e);n.current=e,i(()=>{if(!t||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&n.current()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t])}function D(e,t){const n=c(t);n.current=t,i(()=>{const t=t=>{e.current&&!e.current.contains(t.target)&&n.current()};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[e])}new class{constructor(e=512){this.cache=/* @__PURE__ */new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(e,512)}get(e){if(!this.cache.has(e))return void this.misses++;this.hits++;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}has(e){return this.cache.has(e)}invalidate(e){void 0!==e?this.cache.delete(e):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const e=this.hits+this.misses;return 0===e?0:this.hits/e*100}}(512);var C=/* @__PURE__ */new Map;function M(e,t){return void 0!==t?`--tkx-${e}: ${t};`:`var(--tkx-${e})`}function F(){return Array.from(C.entries()).map(([e,t])=>`.${e} { ${t} }`).join("\n")}function j(){C.clear()}function A(){if("undefined"==typeof document)return;let e=document.getElementById("tkx-styles");e||(e=document.createElement("style"),e.id="tkx-styles",document.head.appendChild(e)),e.textContent=F()}var T=t({bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"});function N(){return o(T)}var I=t({locale:"en-US",direction:"ltr",strings:{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,t)=>`Page ${e} of ${t}`,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",filterPlaceholder:"Filter...",exportCsv:"Export CSV",rowsSelected:e=>`${e} row${1===e?"":"s"} selected`}});function W(){return o(I).strings}var O=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function L(e,t){return e>>>t|e<<32-t}function R(e){const t=[];for(let l=0;l<e.length;l++){let n=e.charCodeAt(l);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(l++,n=65536+((1023&n)<<10|1023&e.charCodeAt(l)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}const n=8*t.length;for(t.push(128);t.length%64!=56;)t.push(0);for(let l=0;l<4;l++)t.push(0);t.push(n>>>24&255,n>>>16&255,n>>>8&255,255&n);const r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),o=new Uint32Array(64);for(let l=0;l<t.length;l+=64){for(let r=0;r<16;r++)o[r]=t[l+4*r]<<24|t[l+4*r+1]<<16|t[l+4*r+2]<<8|t[l+4*r+3];for(let t=16;t<64;t++){const e=L(o[t-15],7)^L(o[t-15],18)^o[t-15]>>>3,n=L(o[t-2],17)^L(o[t-2],19)^o[t-2]>>>10;o[t]=o[t-16]+e+o[t-7]+n|0}let[e,n,i,a,s,c,d,u]=r;for(let t=0;t<64;t++){const r=u+(L(s,6)^L(s,11)^L(s,25))+(s&c^~s&d)+O[t]+o[t]|0,l=(L(e,2)^L(e,13)^L(e,22))+(e&n^e&i^n&i)|0;u=d,d=c,c=s,s=a+r|0,a=i,i=n,n=e,e=r+l|0}r[0]=r[0]+e|0,r[1]=r[1]+n|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+d|0,r[7]=r[7]+u|0}let i="";for(let l=0;l<8;l++)i+=(r[l]>>>0).toString(16).padStart(8,"0");return i}var V={"<":"<",">":">","&":"&","'":"'",'"':""","`":"`"};function B(e){if(null==e)return"";let t=String(e);return t=t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,""),t.replace(/[<>&'"`]/g,e=>V[e]??e)}function E(e){const t={};for(const n of Object.keys(e))t[n]=H(e[n]);return t}function H(e){return"string"==typeof e?B(e):Array.isArray(e)?e.map(H):null===e||"object"!=typeof e||function(e){return"object"==typeof e&&null!==e&&"$$typeof"in e}(e)?e:E(e)}var P=[];function Y(e,t,n){const r=R(JSON.stringify(n??{})),o=R((P.length>0?P[P.length-1].chainHash:"0000000000000000000000000000000000000000000000000000000000000000")+r+t+e),i=Object.freeze({timestamp:Date.now(),component:t,action:e,propsHash:r,chainHash:o});return P=Object.freeze([...P,i]),i}function q(e){let t=P;return e?.component&&(t=t.filter(t=>t.component===e.component)),e?.action&&(t=t.filter(t=>t.action===e.action)),e?.limit&&(t=t.slice(-e.limit)),t}function U(){let e="0000000000000000000000000000000000000000000000000000000000000000";for(const t of P){if(R(e+t.propsHash+t.component+t.action)!==t.chainHash)return!1;e=t.chainHash}return!0}function J(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;const n=t.replace(/[\u0000-\u001F\u007F]/g,"");return/^javascript:/i.test(n)||/^vbscript:/i.test(n)||/^data:/i.test(n)&&!/^data:image\//i.test(n)||/^file:/i.test(n)?null:n}var _=new Set(["a","abbr","b","blockquote","br","code","del","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),Z={a:new Set(["href","title","target","rel"]),img:new Set(["src","alt","title","width","height","loading","decoding"]),th:new Set(["scope","colspan","rowspan","align"]),td:new Set(["colspan","rowspan","align"]),"*":new Set(["id","class","lang","dir","title"])},K=new Set(["constructor","prototype","__proto__","submit","reset","action","method","enctype","target","elements","children","firstChild","nextSibling","parentNode","ownerDocument","cookie","domain","location","documentElement","body","head","title","contentWindow","contentDocument"]);function X(e){if("string"!=typeof e)return"";if("undefined"==typeof DOMParser)return B(e);const t=(new DOMParser).parseFromString(`<div>${e}</div>`,"text/html").body.firstElementChild;return t?(G(t),t.innerHTML):""}function G(e){const t=Array.from(e.children);for(const n of t){const e=n.tagName.toLowerCase();if(_.has(e)){for(const t of Array.from(n.attributes)){const r=t.name.toLowerCase();if(r.startsWith("on"))n.removeAttribute(t.name);else if(K.has(r))n.removeAttribute(t.name);else if("style"!==r)if((Z[e]??/* @__PURE__ */new Set).has(r)||Z["*"].has(r)){if(("href"===r||"src"===r)&&"string"==typeof t.value){const e=J(t.value);null===e?n.removeAttribute(t.name):n.setAttribute(t.name,e)}"name"!==r&&"id"!==r||!K.has(t.value.toLowerCase())||n.removeAttribute(t.name)}else n.removeAttribute(t.name);else n.setAttribute("style",Q(t.value))}G(n)}else n.remove()}}function Q(e){if("string"!=typeof e)return"";let t=e;return t=t.replace(/expression\s*\([^)]*\)/gi,""),t=t.replace(/url\s*\(\s*['"]?\s*(javascript|vbscript|data)\s*:[^)]*\)/gi,"url(#)"),t=t.replace(/@import[^;]*;?/gi,""),t=t.replace(/behavior\s*:[^;]*;?/gi,""),t=t.replace(/-moz-binding[^;]*;?/gi,""),t=t.replace(/[<>]/g,""),t=t.replace(/[\u0000-\u001F\u007F]/g,""),t.trim()}var ee=new Set(["__proto__","constructor","prototype"]);function te(e){try{return ne(JSON.parse(e,(e,t)=>{if(!ee.has(e))return t}))}catch{return null}}function ne(e){if(Array.isArray(e))return e.map(ne);if(e&&"object"==typeof e){const t={};for(const[n,r]of Object.entries(e))ee.has(n)||(t[n]=ne(r));return t}return e}function re(e){return"string"!=typeof e?"":e.replace(/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF\u00AD]/g,"")}function oe(e={}){const{allowInlineStyles:t=!0,imgHosts:n=[],connectHosts:r=[],fontHosts:o=[],scriptNonce:i,reportUri:l}=e,a=["default-src 'self'","script-src "+(i?`'self' 'nonce-${i}'`:"'self'"),"style-src "+(t?"'self' 'unsafe-inline'":"'self'"),`img-src ${["'self'","data:","https:",...n].join(" ")}`,`font-src ${["'self'","https:","data:",...o].join(" ")}`,`connect-src ${["'self'",...r].join(" ")}`,"frame-ancestors 'none'","form-action 'self'","base-uri 'self'","object-src 'none'","upgrade-insecure-requests"];return l&&a.push(`report-uri ${l}`),a.join("; ")}function ie(){if("undefined"==typeof window)return;const e=window.trustedTypes;if(e)try{e.createPolicy("tkx",{createHTML:X,createScriptURL:e=>J(e)??"",createScript:()=>{throw new Error("TekiVex: inline script creation forbidden")}})}catch{}}function le(){if("undefined"==typeof window)return!1;try{return window.top!==window.self}catch{return!0}}function ae(e,t){let n=e,r=Date.now();return{check(){const o=Date.now(),i=o-r,l=Math.floor(i/t);return l>0&&(n=Math.min(e,n+l),r=o),!(n<=0||(n-=1,0))},reset(){n=e,r=Date.now()}}}async function se(e){const t=new Uint8Array(await e.slice(0,12).arrayBuffer()),n=(...e)=>e.every((e,n)=>t[n]===e);return n(137,80,78,71)?"image/png":n(255,216,255)?"image/jpeg":n(71,73,70,56)?"image/gif":n(66,77)?"image/bmp":n(82,73,70,70)&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"image/webp":n(37,80,68,70)?"application/pdf":n(80,75,3,4)?"application/zip":123===t[0]||91===t[0]?"application/json":[...t].includes(0)?null:"text/plain"}var ce=[{name:"ssn",re:/\b\d{3}-\d{2}-\d{4}\b/g,repl:"[redacted-ssn]"},{name:"credit",re:/\b(?:\d[ -]?){13,19}\b/g,repl:e=>{const t=e.replace(/[ -]/g,"");return t.length<13||t.length>19?e:function(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let o=e.charCodeAt(r)-48;if(o<0||o>9)return!1;n&&(o*=2,o>9&&(o-=9)),t+=o,n=!n}return t>0&&t%10==0}(t)?"[redacted-card]":e}},{name:"email",re:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,repl:"[redacted-email]"},{name:"phone",re:/\b(\+?\d{1,3}[ -])?\(?\d{3}\)?[ -]?\d{3}[ -]?\d{4}\b/g,repl:"[redacted-phone]"},{name:"apikey",re:/\b(sk|pk|rk)-[A-Za-z0-9]{20,}\b/g,repl:"[redacted-key]"}];function de(e){if("string"!=typeof e)return"";let t=e;for(const{re:n,repl:r}of ce)t=t.replace(n,r);return t}Object.freeze({sanitizeString:B,sanitizeHref:J,sanitizeHTML:X,sanitizeCSS:Q,sanitizeJSON:te,sanitizeUnicode:re,isSafeAttrName:function(e){return!("string"!=typeof e||!e||/[\u0000-\u001F\u007F<>"]/.test(e)||K.has(e.toLowerCase()))},buildTkxCSP:oe,installTrustedTypes:ie,isFramed:le,installFrameBuster:function(e){if("undefined"!=typeof window&&le())if(e)e();else try{window.top.location.href=window.self.location.href}catch{}},createRateLimiter:ae,sniffMimeType:se,scrubPII:de,deepFreeze:function e(t){if(t&&"object"==typeof t&&!Object.isFrozen(t)){for(const n of Object.keys(t))e(t[n]);Object.freeze(t)}return t},__brand:"TekiVex SecurityCore v2.6.0 © 007krcs"});var ue={0:"0",px:"1px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},fe={...ue,screen:"100vh"},pe={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},he={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},me={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"},ge={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"]},xe={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},be={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"},ye={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},we={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},ve=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)])),ke=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),$e={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Se=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,ze=new Set(["behavior","-moz-binding","-webkit-binding","src"]),De=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function Ce(e){return Se.test(e)||e.includes("}")||e.includes("{")||e.includes("<")||e.includes(">")?null:e}function Me(e){const t=e.match(/^\[(.+)]$/);return t?Ce(t[1]):null}function Fe(e){return ke.has(e)?`var(--tkx-${e})`:"transparent"===e?"transparent":"current"===e?"currentColor":"white"===e?"#ffffff":"black"===e?"#000000":"inherit"===e?"inherit":Me(e)||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),e)}function je(e){const t=e.match(/^\[(--[a-zA-Z0-9_-]+):(.+)]$/);if(t){const e=Ce(t[2]);return e?{[t[1]]:e}:null}const n=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(n){const e=function(e){const t=e.toLowerCase().trim();return ze.has(t)?null:De.has(t)?t:null}(n[1]),t=Ce(n[2]);return e&&t?{[e]:t}:null}const r={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(r[e])return{display:r[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("grow"===e||"flex-grow"===e)return{"flex-grow":"1"};if("grow-0"===e)return{"flex-grow":"0"};if("shrink"===e||"flex-shrink"===e)return{"flex-shrink":"1"};if("shrink-0"===e||"flex-shrink-0"===e)return{"flex-shrink":"0"};const a={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(a[e])return{"align-items":a[e]};const s={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(s[e])return{"justify-content":s[e]};const c={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(c[e])return{"align-self":c[e]};const d={"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(d[e])return{"align-content":d[e]};let u;if(u=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":"none"===u[1]?"none":"subgrid"===u[1]?"subgrid":`repeat(${u[1]},minmax(0,1fr))`};if(u=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":"none"===u[1]?"none":"subgrid"===u[1]?"subgrid":`repeat(${u[1]},minmax(0,1fr))`};if(u=e.match(/^col-span-(full|\d+)$/))return{"grid-column":"full"===u[1]?"1 / -1":`span ${u[1]} / span ${u[1]}`};if(u=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":u[1]};if(u=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":u[1]};if(u=e.match(/^row-span-(full|\d+)$/))return{"grid-row":"full"===u[1]?"1 / -1":`span ${u[1]} / span ${u[1]}`};if(u=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":u[1]};if(u=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":u[1]};if("grid-flow-row"===e)return{"grid-auto-flow":"row"};if("grid-flow-col"===e)return{"grid-auto-flow":"column"};if("grid-flow-dense"===e)return{"grid-auto-flow":"dense"};if("grid-flow-row-dense"===e)return{"grid-auto-flow":"row dense"};if("grid-flow-col-dense"===e)return{"grid-auto-flow":"column dense"};if(u=e.match(/^p-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{padding:e}}if(u=e.match(/^px-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-left":e,"padding-right":e}}if(u=e.match(/^py-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-top":e,"padding-bottom":e}}if(u=e.match(/^pt-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-top":e}}if(u=e.match(/^pr-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-right":e}}if(u=e.match(/^pb-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-bottom":e}}if(u=e.match(/^pl-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-left":e}}if(u=e.match(/^-?m-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{margin:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?mx-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n){const e=t&&"0"!==n?`-${n}`:n;return{"margin-left":e,"margin-right":e}}}if(u=e.match(/^-?my-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n){const e=t&&"0"!==n?`-${n}`:n;return{"margin-top":e,"margin-bottom":e}}}if(u=e.match(/^-?mt-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-top":t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?mr-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-right":t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?mb-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-bottom":t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?ml-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-left":t&&"0"!==n?`-${n}`:n}}if("mx-auto"===e)return{"margin-left":"auto","margin-right":"auto"};if("my-auto"===e)return{"margin-top":"auto","margin-bottom":"auto"};if(u=e.match(/^gap-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{gap:e}}if(u=e.match(/^gap-x-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"column-gap":e}}if(u=e.match(/^gap-y-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"row-gap":e}}if(u=e.match(/^w-(.+)$/)){const e=u[1],t=ue[e]??pe[e]??Me(e);if(t)return{width:t}}if(u=e.match(/^min-w-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"min-width":e}}if(u=e.match(/^max-w-(.+)$/)){const e={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[u[1]]??ue[u[1]]??Me(u[1]);if(e)return{"max-width":e}}if(u=e.match(/^h-(.+)$/)){const e=u[1],t=fe[e]??pe[e]??Me(e);if(t)return{height:t}}if(u=e.match(/^min-h-(.+)$/)){const e={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[u[1]]??ue[u[1]]??Me(u[1]);if(e)return{"min-height":e}}if(u=e.match(/^max-h-(.+)$/)){const e=fe[u[1]]??Me(u[1]);if(e)return{"max-height":e}}if(u=e.match(/^size-(.+)$/)){const e=ue[u[1]]??pe[u[1]]??Me(u[1]);if(e)return{width:e,height:e}}if(u=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[e,t]=ge[u[1]]??["1rem","1.5rem"];return{"font-size":e,"line-height":t}}if(u=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":xe[u[1]]??u[1]};if(u=e.match(/^leading-(.+)$/)){const e=be[u[1]]??Me(u[1]);if(e)return{"line-height":e}}if(u=e.match(/^tracking-(.+)$/)){const e=ye[u[1]]??Me(u[1]);if(e)return{"letter-spacing":e}}const f={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(f[e])return{"text-align":f[e]};if("italic"===e)return{"font-style":"italic"};if("not-italic"===e)return{"font-style":"normal"};if("uppercase"===e)return{"text-transform":"uppercase"};if("lowercase"===e)return{"text-transform":"lowercase"};if("capitalize"===e)return{"text-transform":"capitalize"};if("normal-case"===e)return{"text-transform":"none"};if("underline"===e)return{"text-decoration-line":"underline"};if("overline"===e)return{"text-decoration-line":"overline"};if("line-through"===e)return{"text-decoration-line":"line-through"};if("no-underline"===e)return{"text-decoration-line":"none"};if("truncate"===e)return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if("text-ellipsis"===e)return{"text-overflow":"ellipsis"};if("text-clip"===e)return{"text-overflow":"clip"};if("whitespace-normal"===e)return{"white-space":"normal"};if("whitespace-nowrap"===e)return{"white-space":"nowrap"};if("whitespace-pre"===e)return{"white-space":"pre"};if("whitespace-pre-wrap"===e)return{"white-space":"pre-wrap"};if("whitespace-pre-line"===e)return{"white-space":"pre-line"};if("break-words"===e)return{"overflow-wrap":"break-word"};if("break-all"===e)return{"word-break":"break-all"};if("break-keep"===e)return{"word-break":"keep-all"};if("font-mono"===e)return{"font-family":"var(--tkx-font-mono,monospace)"};if("font-sans"===e)return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if("font-serif"===e)return{"font-family":"ui-serif,Georgia,serif"};if("antialiased"===e)return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(u=e.match(/^indent-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"text-indent":e}}if(u=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":u[1],"-webkit-box-orient":"vertical"};if(u=e.match(/^text-(.+)$/)){const[e,t]=u[1].split("/"),n=Fe(e);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(e)){if(t){const e=parseInt(t)/100;return{color:n,opacity:String(e)}}return{color:n}}}if(u=e.match(/^bg-(.+)$/)){const[e,t]=u[1].split("/"),n=Fe(e);return t?{"background-color":n,opacity:String(parseInt(t)/100)}:"none"===e?{background:"none"}:{"background-color":n}}if(u=e.match(/^border-color-(.+)$/))return{"border-color":Fe(u[1])};if(u=e.match(/^fill-(.+)$/))return{fill:Fe(u[1])};if(u=e.match(/^stroke-(.+)$/))return{stroke:Fe(u[1])};if(u=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Fe(u[1])};if(u=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Fe(u[1])};if(u=e.match(/^accent-(.+)$/))return{"accent-color":Fe(u[1])};if(u=e.match(/^caret-(.+)$/))return{"caret-color":Fe(u[1])};if(u=e.match(/^outline-color-(.+)$/))return{"outline-color":Fe(u[1])};if("border"===e)return{"border-width":"1px"};if(u=e.match(/^border-(\d+)$/))return{"border-width":`${u[1]}px`};if("border-t"===e)return{"border-top-width":"1px"};if(u=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${u[1]}px`};if("border-r"===e)return{"border-right-width":"1px"};if(u=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${u[1]}px`};if("border-b"===e)return{"border-bottom-width":"1px"};if(u=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${u[1]}px`};if("border-l"===e)return{"border-left-width":"1px"};if(u=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${u[1]}px`};if("border-x"===e)return{"border-left-width":"1px","border-right-width":"1px"};if("border-y"===e)return{"border-top-width":"1px","border-bottom-width":"1px"};if("border-none"===e)return{"border-style":"none"};if("border-solid"===e)return{"border-style":"solid"};if("border-dashed"===e)return{"border-style":"dashed"};if("border-dotted"===e)return{"border-style":"dotted"};if("border-double"===e)return{"border-style":"double"};if((u=e.match(/^border-([a-zA-Z].*)$/))&&ke.has(u[1]))return{"border-color":`var(--tkx-${u[1]})`};if(u=e.match(/^border-\[(.+)]$/))return{"border-color":u[1]};if("border-0"===e)return{"border-width":"0"};if("rounded"===e)return{"border-radius":he[""]};if(u=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":he[u[1]]??Me(u[1])??u[1]};if(u=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const e=u[1],t=he[u[2]??""]??he[""];return{t:{"border-top-left-radius":t,"border-top-right-radius":t},r:{"border-top-right-radius":t,"border-bottom-right-radius":t},b:{"border-bottom-left-radius":t,"border-bottom-right-radius":t},l:{"border-top-left-radius":t,"border-bottom-left-radius":t},tl:{"border-top-left-radius":t},tr:{"border-top-right-radius":t},br:{"border-bottom-right-radius":t},bl:{"border-bottom-left-radius":t}}[e]??{}}const p={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if("ring"===e)return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((u=e.match(/^ring-(\d+)$/))&&p[u[1]])return{"box-shadow":`0 0 0 ${p[u[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if("ring-inset"===e)return{"--tkx-ring-offset":"inset"};if(u=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${u[1]}px`,"box-shadow":`0 0 0 ${u[1]}px var(--tkx-bg)`};if("shadow"===e)return{"box-shadow":me[""]};if(u=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":me[u[1]]};if(u=e.match(/^opacity-(\d+)$/)){const e=ve[u[1]];if(void 0!==e)return{opacity:e}}if("bg-none"===e)return{background:"none"};const h={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(h[e])return{"background-size":h[e]};const m={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(m[e])return{"background-position":m[e]};const g={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(g[e])return{"background-repeat":g[e]};if("backdrop-blur"===e)return{"backdrop-filter":`blur(${we[""]})`};if(u=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${we[u[1]]})`};if("blur"===e)return{filter:`blur(${we[""]})`};if(u=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${we[u[1]]})`};if("grayscale"===e)return{filter:"grayscale(100%)"};if("grayscale-0"===e)return{filter:"grayscale(0)"};if("invert"===e)return{filter:"invert(100%)"};if("invert-0"===e)return{filter:"invert(0)"};const x={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(x[e])return{position:x[e]};if("inset-0"===e)return{top:"0",right:"0",bottom:"0",left:"0"};if("inset-auto"===e)return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if("inset-full"===e)return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if("inset-x-0"===e)return{left:"0",right:"0"};if("inset-y-0"===e)return{top:"0",bottom:"0"};if(u=e.match(/^-?top-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{top:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?right-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{right:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?bottom-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{bottom:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?left-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{left:t&&"0"!==n?`-${n}`:n}}const b={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(u=e.match(/^z-(.+)$/)){const e=b[u[1]]??Me(u[1]);if(e)return{"z-index":e}}const y={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(y[e])return{overflow:y[e]};if(u=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${u[1]}`]:u[2]};if("scrollbar-hide"===e)return{"-ms-overflow-style":"none","scrollbar-width":"none"};if("visible"===e)return{visibility:"visible"};if("invisible"===e)return{visibility:"hidden"};if("collapse"===e)return{visibility:"collapse"};const w={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(w[e])return{cursor:w[e]};if("select-none"===e)return{"user-select":"none"};if("select-text"===e)return{"user-select":"text"};if("select-all"===e)return{"user-select":"all"};if("select-auto"===e)return{"user-select":"auto"};if("pointer-events-none"===e)return{"pointer-events":"none"};if("pointer-events-auto"===e)return{"pointer-events":"auto"};const v={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(u=e.match(/^scale-(.+)$/)){const e=v[u[1]]??Me(u[1]);if(e)return{transform:`scale(${e})`}}if(u=e.match(/^scale-x-(.+)$/)){const e=v[u[1]]??Me(u[1]);if(e)return{transform:`scaleX(${e})`}}if(u=e.match(/^scale-y-(.+)$/)){const e=v[u[1]]??Me(u[1]);if(e)return{transform:`scaleY(${e})`}}const k={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(u=e.match(/^-?rotate-(.+)$/)){const t=e.startsWith("-"),n=k[u[1]]??Me(u[1]);if(n)return{transform:t?`rotate(-${n})`:`rotate(${n})`}}if(u=e.match(/^-?translate-x-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{transform:`translateX(${t&&"0"!==n?`-${n}`:n})`}}if(u=e.match(/^-?translate-y-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{transform:`translateY(${t&&"0"!==n?`-${n}`:n})`}}if(u=e.match(/^-?skew-x-(.+)$/)){const t=e.startsWith("-"),n=Me(u[1])??`${u[1]}deg`;return{transform:t?`skewX(-${n})`:`skewX(${n})`}}if(u=e.match(/^-?skew-y-(.+)$/)){const t=e.startsWith("-"),n=Me(u[1])??`${u[1]}deg`;return{transform:t?`skewY(-${n})`:`skewY(${n})`}}const $={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if($[e])return{"transform-origin":$[e]};const S={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(S[e])return{"transition-property":S[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const z={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(u=e.match(/^duration-(.+)$/)){const e=z[u[1]]??Me(u[1]);if(e)return{"transition-duration":e}}if(u=e.match(/^delay-(.+)$/)){const e=z[u[1]]??Me(u[1]);if(e)return{"transition-delay":e}}const D={"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(D[e])return{"transition-timing-function":D[e]};const C={"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(C[e])return{animation:C[e]};const M={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return M[e]?{"object-fit":M[e]}:"aspect-square"===e?{"aspect-ratio":"1 / 1"}:"aspect-video"===e?{"aspect-ratio":"16 / 9"}:"aspect-auto"===e?{"aspect-ratio":"auto"}:(u=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":u[1]}:"list-none"===e?{"list-style-type":"none"}:"list-disc"===e?{"list-style-type":"disc"}:"list-decimal"===e?{"list-style-type":"decimal"}:"list-inside"===e?{"list-style-position":"inside"}:"list-outside"===e?{"list-style-position":"outside"}:(u=e.match(/^columns-(\d+)$/))?{columns:u[1]}:"resize"===e?{resize:"both"}:"resize-none"===e?{resize:"none"}:"resize-x"===e?{resize:"horizontal"}:"resize-y"===e?{resize:"vertical"}:"sr-only"===e?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:"not-sr-only"===e?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:"focus-ring"===e?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:"appearance-none"===e?{appearance:"none"}:"outline-none"===e?{outline:"none"}:"outline"===e?{outline:"2px solid currentColor","outline-offset":"2px"}:"float-left"===e?{float:"left"}:"float-right"===e?{float:"right"}:"float-none"===e?{float:"none"}:"clear-both"===e?{clear:"both"}:"isolate"===e?{isolation:"isolate"}:"isolation-auto"===e?{isolation:"auto"}:(u=e.match(/^will-change-(.+)$/))?{"will-change":u[1]}:"touch-manipulation"===e?{"touch-action":"manipulation"}:"touch-none"===e?{"touch-action":"none"}:"touch-pan-x"===e?{"touch-action":"pan-x"}:"touch-pan-y"===e?{"touch-action":"pan-y"}:"scroll-smooth"===e?{"scroll-behavior":"smooth"}:"scroll-auto"===e?{"scroll-behavior":"auto"}:(u=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[u[1]]:u[2]}:function(e){for(const t of Pe.values())if(t[e])return t[e];return null}(e)||null}function Ae(e){let t=0,n=-1;for(let r=0;r<e.length;r++)if("["===e[r])t++;else if("]"===e[r])t--;else if(":"===e[r]&&0===t){n=r;break}return-1===n?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function Te(e,t){for(const[n,r]of Object.entries(t))e[n]=r}function Ne(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}var Ie=/* @__PURE__ */new Map,We=null,Oe=null;function Le(){return We&&We.isConnected||(We=document.getElementById("tkx-atomic"))||((We=document.createElement("style")).id="tkx-atomic",document.head.appendChild(We)),We}function Re(e){const t=[];for(const n of e)if(n)if("string"==typeof n)t.push(...n.split(/\s+/).filter(Boolean));else if(Array.isArray(n))t.push(...Re(n));else if("object"==typeof n)for(const[e,r]of Object.entries(n))r&&t.push(e);return t}function Ve(...e){const t=Re(e);if(0===t.length)return"";const n={base:{},variants:{}};for(const a of t){const{variant:e,utility:t}=Ae(a),r=je(t);r&&(e?(n.variants[e]||(n.variants[e]={}),Te(n.variants[e],r)):Te(n.base,r))}const r=[],o=Ne(n.base),i=function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}([o,...Object.entries(n.variants).map(([e,t])=>`${e}{${Ne(t)}}`)].join("|")),l=`tkx-${i}`;o&&r.push(`.${l}{${o}}`);for(const[a,s]of Object.entries(n.variants)){const e=Ne(s);if(e)if(a.startsWith("@")){const t=$e[a.slice(1)];t&&r.push(`@media(min-width:${t}){.${l}{${e}}}`)}else if("motion-safe"===a)r.push(`@media(prefers-reduced-motion:no-preference){.${l}{${e}}}`);else if("motion-reduce"===a)r.push(`@media(prefers-reduced-motion:reduce){.${l}{${e}}}`);else if("contrast-more"===a)r.push(`@media(prefers-contrast:more){.${l}{${e}}}`);else if("forced-colors"===a)r.push(`@media(forced-colors:active){.${l}{${e}}}`);else if("dark"===a)r.push(`@media(prefers-color-scheme:dark){.${l}{${e}}}`);else if("print"===a)r.push(`@media print{.${l}{${e}}}`);else if("group-hover"===a)r.push(`.group:hover .${l}{${e}}`);else if("group-focus"===a)r.push(`.group:focus-within .${l}{${e}}`);else if("peer-hover"===a)r.push(`.peer:hover~.${l}{${e}}`);else{const t={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[a]??`:${a}`;r.push(`.${l}${t}{${e}}`)}}return r.length>0&&function(e,t){if(Ie.has(e))return;if(Ie.set(e,t),"undefined"==typeof document)return;const n=function(){if(Oe)return Oe;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],Oe=e,e}catch{return null}}();if(n){const e=function(e){const t=[];let n=0,r=0;for(let o=0;o<e.length;o++)if("{"===e[o])n++;else if("}"===e[o]&&(n--,0===n)){const n=e.slice(r,o+1).trim();n&&t.push(n),r=o+1}return t}(t);for(const t of e)try{n.insertRule(t,n.cssRules.length)}catch{Le().textContent+=t+"\n"}}else Le().textContent+=t+"\n"}(i,r.join("")),l}function Be(){return Array.from(Ie.values()).join("\n")}function Ee(){Ie.clear(),We=null,Oe&&"undefined"!=typeof document&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==Oe),Oe=null)}function He(...e){return e.filter(Boolean).join(" ")}var Pe=/* @__PURE__ */new Map;function Ye(e){Pe.set(e.name,e.utilities)}function qe(e){Pe.delete(e)}function Ue(){return Array.from(Pe.keys())}var Je=t(null);function _e(){const e=o(Je),t=c({}),n=c({}),r=c({}),i=a(()=>({getFieldValue:e=>t.current[e],setFieldValue:(e,n)=>{t.current[e]=n},getFieldsValue:()=>({...t.current}),setFieldsValue:e=>{Object.assign(t.current,e)},validateFields:()=>Promise.resolve({...t.current}),validateField:e=>Promise.resolve(!0),resetFields:()=>{t.current={},n.current={},r.current={}},getFieldError:e=>n.current[e]??null,isFieldTouched:e=>r.current[e]??!1}),[]);return e?e.instance:i}var Ze=!1;function Ke(e=!1){const[t,n]=d(e);return{isOpen:t,open:r(()=>n(!0),[]),close:r(()=>n(!1),[]),toggle:r(()=>n(e=>!e),[])}}function Xe({count:e,initialIndex:t=0,orientation:n="horizontal",loop:o=!0}){const[i,l]=d(t),a=c([]),s=r(t=>{l(n=>{let r=n+t;return r=o?(r%e+e)%e:Math.max(0,Math.min(e-1,r)),requestAnimationFrame(()=>{a.current[r]?.focus()}),r})},[e,o]);return{focusedIndex:i,setFocusedIndex:l,getItemProps:r(t=>({tabIndex:t===i?0:-1,"data-focused":t===i,onFocus:()=>l(t),onKeyDown:t=>{const r="horizontal"===n||"both"===n,o="vertical"===n||"both"===n;r&&"ArrowRight"===t.key&&(t.preventDefault(),s(1)),r&&"ArrowLeft"===t.key&&(t.preventDefault(),s(-1)),o&&"ArrowDown"===t.key&&(t.preventDefault(),s(1)),o&&"ArrowUp"===t.key&&(t.preventDefault(),s(-1)),"Home"===t.key&&(t.preventDefault(),l(0),requestAnimationFrame(()=>a.current[0]?.focus())),"End"===t.key&&(t.preventDefault(),l(e-1),requestAnimationFrame(()=>a.current[e-1]?.focus()))}}),[i,s,n,e])}}function Ge({initialValues:e,validate:t,validateAsync:n,debounceMs:o=300}){const[l,a]=d({...e}),[s,u]=d({}),[f,p]=d({}),[h,m]=d({}),[g,x]=d(void 0),[b,y]=d({}),w=c(e),v=c({}),k=c({}),$=c(l);i(()=>{$.current=l},[l]);const S=c(n);i(()=>{S.current=n},[n]);const z=r(e=>{const t=S.current?.[e];if(!t)return;const n=v.current[e];n&&clearTimeout(n),v.current[e]=setTimeout(()=>{const n=(k.current[e]??0)+1;k.current[e]=n,m(t=>({...t,[e]:!0})),Promise.resolve().then(()=>t($.current[e],$.current)).then(t=>{k.current[e]===n&&(m(t=>{const n={...t};return delete n[e],n}),p(n=>{const r={...n};return t?r[e]=t:delete r[e],r}))}).catch(()=>{k.current[e]===n&&m(t=>{const n={...t};return delete n[e],n})})},o)},[o]),D=r((e,t)=>{a(n=>({...n,[e]:t})),k.current[e]=(k.current[e]??0)+1,z(e)},[z]),C=r(e=>{a(t=>({...t,...e}));for(const t of Object.keys(e))k.current[t]=(k.current[t]??0)+1,z(t)},[z]),M=r(e=>{y(t=>({...t,[e]:!0}))},[]),F=r(()=>{if(!t)return!0;const{o:e,...n}=t(l),r=Object.fromEntries(Object.entries(n).filter(([,e])=>null!=e));return u(r),x(e||void 0),y(Object.fromEntries(Object.keys(l).map(e=>[e,!0]))),0===Object.keys(r).length&&!e},[l,t]),j=r(()=>{for(const e of Object.keys(v.current)){const t=v.current[e];t&&clearTimeout(t),k.current[e]=(k.current[e]??0)+1}v.current={},a({...w.current}),u({}),p({}),m({}),x(void 0),y({})},[]);i(()=>()=>{for(const e of Object.keys(v.current)){const t=v.current[e];t&&clearTimeout(t)}},[]);const A={...s,...f};return{values:l,errors:A,asyncErrors:f,validating:h,rootError:g,touched:b,dirty:Object.keys(l).some(e=>l[e]!==w.current[e]),isValid:0===Object.keys(A).length&&!g,setValue:D,setValues:C,touchField:M,validate:F,reset:j,getFieldProps:r(e=>({value:l[e],onChange:t=>{D(e,t.target.value)},onBlur:()=>M(e),"aria-invalid":!(!b[e]||!A[e])||void 0,"aria-describedby":A[e]?`${String(e)}-error`:void 0}),[l,A,b,D,M])}}function Qe({items:e,initialSelected:t=[],multiple:n=!0}){const[o,i]=d(()=>new Set(t)),l=r(e=>{i(t=>{const r=new Set(t);return r.has(e)?r.delete(e):(n||r.clear(),r.add(e)),r})},[n]),s=r(e=>{i(t=>{if(t.has(e))return t;const r=n?new Set(t):/* @__PURE__ */new Set;return r.add(e),r})},[n]),c=r(e=>{i(t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n})},[]),u=r(()=>{n&&i(new Set(e))},[e,n]),f=r(()=>i(/* @__PURE__ */new Set),[]),p=r(()=>{i(t=>e.every(e=>t.has(e))?/* @__PURE__ */new Set:new Set(e))},[e]),h=e.length>0&&e.every(e=>o.has(e)),m=e.some(e=>o.has(e)),g=a(()=>Array.from(o),[o]);return{selected:o,isSelected:r(e=>o.has(e),[o]),toggle:l,select:s,deselect:c,selectAll:u,deselectAll:f,toggleAll:p,allSelected:h,someSelected:m,selectedCount:o.size,selectedArray:g}}function et(e,t){const[n,r]=d(e);return i(()=>{const n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function tt(e,t){const[n,r]=d(e),o=c(Date.now());return i(()=>{const n=Date.now(),i=t-(n-o.current);if(!(i<=0)){const t=setTimeout(()=>{o.current=Date.now(),r(e)},i);return()=>clearTimeout(t)}o.current=n,r(e)},[e,t]),n}function nt({value:e,onChange:t,defaultValue:n}){const o=void 0!==e,[i,l]=d(n),a=c(t);a.current=t;const s=r(e=>{o||l(e),a.current?.(e)},[o]);return[o?e:i,s]}function rt(e){const[t,n]=d(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return i(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e);n(t.matches);const r=e=>n(e.matches);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),t}function ot(e,t){const[n,o]=d(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return null!==n?JSON.parse(n):t}catch{return t}});return[n,r(t=>{o(n=>{const r="function"==typeof t?t(n):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(r))}catch{}return r})},[e]),r(()=>{if(o(t),"undefined"!=typeof window)try{window.localStorage.removeItem(e)}catch{}},[e,t])]}function it({threshold:e=0,rootMargin:t="0px",root:n=null,once:r=!1}={}){const o=c(null),[l,a]=d(null),s=c(null);return i(()=>{const i=o.current;if(i&&"undefined"!=typeof IntersectionObserver)return s.current=new IntersectionObserver(([e])=>{a(e),r&&e.isIntersecting&&s.current?.unobserve(i)},{threshold:e,rootMargin:t,root:n}),s.current.observe(i),()=>s.current?.disconnect()},[e,t,n,r]),{ref:o,isIntersecting:l?.isIntersecting??!1,entry:l}}function lt(e){const{url:t,protocols:n,reconnect:o=!0,reconnectDelay:l=1e3,reconnectAttempts:a=10,heartbeatInterval:s=3e4,heartbeatMessage:u="ping",onOpen:f,onClose:p,onError:h,onMessage:m}=e,[g,x]=d("disconnected"),[b,y]=d(null),[w,v]=d([]),[k,$]=d(0),[S,z]=d(null),D=c(null),C=c(0),M=c(null),F=c(null),j=c(null),A=c([]),T=c(!0),N=c(!1),I=c(f),W=c(p),O=c(h),L=c(m);I.current=f,W.current=p,O.current=h,L.current=m;const R=r(()=>{M.current&&(clearTimeout(M.current),M.current=null),F.current&&(clearInterval(F.current),F.current=null)},[]),V=r(e=>{for(;A.current.length>0;){const t=A.current.shift();void 0!==t&&e.send("string"==typeof t?t:JSON.stringify(t))}},[]),B=r(()=>{if(D.current&&D.current.readyState===WebSocket.OPEN)return;N.current=!1,R(),T.current&&x("connecting");const e=new WebSocket(t,n);D.current=e,e.onopen=t=>{T.current&&(x("connected"),C.current=0,$(0),I.current?.(t),V(e),F.current=setInterval(()=>{if(e.readyState===WebSocket.OPEN){j.current=Date.now();try{e.send(JSON.stringify({type:"ping",t:j.current}))}catch{}}},s))},e.onmessage=e=>{if(!T.current)return;const t=te(e.data),n=null!==t?t:e.data,r=n;if(r&&"object"==typeof r&&"pong"===r.type&&"number"==typeof r.t)z(Date.now()-r.t);else{if(n===u&&null!==j.current)return z(Date.now()-j.current),void(j.current=null);y(n),v(e=>{const t=[...e,n];return t.length>100?t.slice(t.length-100):t}),L.current?.(n)}},e.onerror=e=>{T.current&&(x("error"),O.current?.(e))},e.onclose=e=>{if(T.current&&(R(),x("disconnected"),W.current?.(e),!N.current&&o&&C.current<a)){const e=C.current,t=l*Math.pow(1.5,e);C.current+=1,$(C.current),M.current=setTimeout(()=>{T.current&&B()},t)}}},[t,n,o,l,a,s,u,R,V]),E=r(()=>{N.current=!0,R(),D.current&&(D.current.close(),D.current=null),T.current&&x("disconnected")},[R]),H=r(e=>{D.current&&D.current.readyState===WebSocket.OPEN?D.current.send("string"==typeof e?e:JSON.stringify(e)):A.current.push(e)},[]);return i(()=>(T.current=!0,B(),()=>{T.current=!1,N.current=!0,R(),D.current&&(D.current.close(),D.current=null)}),[]),{status:g,lastMessage:b,messages:w,send:H,connect:B,disconnect:E,reconnectCount:k,latency:S}}function at(e){const{url:t,events:n=["message"],withCredentials:o=!1,reconnect:l=!0,reconnectDelay:a=3e3,onOpen:s,onError:u}=e,[f,p]=d("connecting"),[h,m]=d(null),[g,x]=d([]),[b,y]=d(0),w=c(null),v=c(null),k=c(!0),$=c(!1),S=c(s),z=c(u);S.current=s,z.current=u;const D=r(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),C=r(()=>{if("undefined"==typeof EventSource)return void(k.current&&p("error"));$.current=!1,D(),w.current&&(w.current.close(),w.current=null),k.current&&p("connecting");const e=new EventSource(t,{withCredentials:o});w.current=e,e.onopen=()=>{k.current&&(p("connected"),S.current?.())},e.onerror=e=>{k.current&&(p("error"),z.current?.(e),!$.current&&l&&(D(),v.current=setTimeout(()=>{k.current&&C()},a)))};const r=e=>t=>{if(!k.current)return;let n;try{n=JSON.parse(t.data)}catch{n=t.data}const r={type:e,data:n,timestamp:Date.now(),...t.lastEventId?{id:t.lastEventId}:{}};m({type:r.type,data:r.data,id:r.id}),x(e=>{const t=[...e,r];return t.length>200?t.slice(t.length-200):t}),y(e=>e+1)};for(const t of n)e.addEventListener(t,r(t))},[t,o,l,a,D]),M=r(()=>{$.current=!0,D(),w.current&&(w.current.close(),w.current=null),k.current&&p("closed")},[D]);return i(()=>(k.current=!0,C(),()=>{k.current=!1,$.current=!0,D(),w.current&&(w.current.close(),w.current=null)}),[]),{status:f,lastEvent:h,events:g,connect:C,disconnect:M,eventCount:b}}function st(e){const{queryFn:t,initialCursor:n=null,enabled:o=!0,dedupKey:l}=e,[a,s]=d([]),[u,f]=d("idle"),[p,h]=d(null),[m,g]=d(!1),[x,b]=d(0),y=c(n??null),w=c(!1),v=c(!0),k=c(void 0),$=c(t);$.current=t;const S=r(async(e,t,n)=>{if(w.current)return;if(void 0!==l&&l===k.current)return;w.current=!0;let r=!1;v.current&&(f(n?"loading":"fetching-more"),h(null));try{const o=await $.current(e,t);if(r||!v.current)return;void 0!==l&&(k.current=l),y.current=o.nextCursor,s(e=>n?[o.data]:[...e,o.data]),g(o.hasMore),b(t),f("success")}catch(o){if(r||!v.current)return;h(o instanceof Error?o:new Error(String(o))),f("error")}finally{r||(w.current=!1)}return()=>{r=!0}},[l]),z=r(()=>{m&&!w.current&&S(y.current,x+1,!1)},[m,x,S]),D=r(()=>{w.current=!1,k.current=void 0,y.current=n??null,s([]),f("idle"),h(null),g(!1),b(0)},[n]);i(()=>(v.current=!0,o&&S(n??null,0,!0),()=>{v.current=!1}),[o]);const C=a.flat();return{data:C,pages:a,status:u,error:p,hasMore:m,isFetchingMore:"fetching-more"===u,fetchMore:z,reset:D,pageIndex:x,totalLoaded:C.length}}function ct(e){return t=>{const n=e.safeParse(t);if(n.success)return{};const r={};for(const e of n.error?.issues??[]){const t=e.path.length>0?e.path.join("."):"_root";r[t]||(r[t]=e.message)}return r}}function dt(e){const t=Ge({initialValues:e.initialValues,validate:ct(e.schema)}),n=r(async n=>{n?.preventDefault?.(),t.validate()&&e.onSubmit&&await e.onSubmit(t.values)},[t,e]);return{...t,handleSubmit:n}}function ut(e,t){return n=>{const r=e(t,n);if(r.success)return{};const o={};for(const e of r.issues??[]){const t=(e.path??[]).map(e=>String(e.key)),n=t.length>0?t.join("."):"_root";o[n]||(o[n]=e.message)}return o}}function ft(e){const t=Ge({initialValues:e.initialValues,validate:ut(e.safeParse,e.schema)}),n=r(async n=>{n?.preventDefault?.(),t.validate()&&e.onSubmit&&await e.onSubmit(t.values)},[t,e]);return{...t,handleSubmit:n}}!function(){if(Ze)return;if("undefined"==typeof document)return;Ze=!0;const e=document.createElement("style");e.setAttribute("data-tkx-form",""),e.textContent="\n @keyframes tkxFormErrorReveal {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n ",document.head.appendChild(e)}();var pt=n(({label:e,id:t,error:n,hint:r,leftAddon:o,rightAddon:i,isInvalid:a,isRequired:s,disabled:c,className:d,style:u,unicodeSafe:h=!0,onChange:m,...g},x)=>{const b=N(),y=l(),w=t??y,v=`${w}-hint`,k=`${w}-error`,$=a||!!n,S=[r&&v,$&&k].filter(Boolean).join(" ")||void 0,z=B(e),D=n?B(n):void 0,C=r?B(r):void 0,M=$?b.danger:b.border;/* @__PURE__ */
|
|
1
|
+
import{cloneElement as e,createContext as t,forwardRef as n,useCallback as r,useContext as o,useEffect as i,useId as l,useMemo as a,useReducer as s,useRef as c,useState as d}from"react";import{Fragment as u,jsx as f,jsxs as p}from"react/jsx-runtime";import{createPortal as h}from"react-dom";function m(e){const[t,n,r]=function(e){if(!e||"string"!=typeof e)return[0,0,0];const t=e.replace("#",""),n=3===t.length?t.split("").map(e=>e+e).join(""):t,r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),i=parseInt(n.slice(4,6),16);return[isNaN(r)?0:r,isNaN(o)?0:o,isNaN(i)?0:i]}(e).map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*r}function g(e,t){const n=m(e),r=m(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function x(e,t,n=!1){return g(e,t)>=(n?3:4.5)}function b(e,t,n=!1){return g(e,t)>=(n?4.5:7)}function y(e,t){const n=t??["#ffffff","#000000"];return n.reduce((t,n)=>g(n,e)>g(t,e)?n:t,n[0])}var w=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function v(){const[e,t]=d(()=>"undefined"!=typeof window&&"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return i(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}function k(){const[e,t]=d(()=>"undefined"!=typeof window&&"undefined"!=typeof window&&window.matchMedia("(forced-colors: active)").matches);return i(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(forced-colors: active)"),n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}function $(e){const t=c(null);return i(()=>{if(!e||!t.current)return;const n=function(e){let t=null,n=null;function r(){return Array.from(e.querySelectorAll(w)).filter(e=>!e.closest("[hidden]")&&!e.closest('[aria-hidden="true"]'))}return{activate(){t=document.activeElement;const o=r();o.length>0&&o[0].focus(),n=e=>{if("Tab"!==e.key)return;const t=r();if(0===t.length)return;const n=t[0],o=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),n.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),t instanceof HTMLElement&&t.focus(),t=null,n=null}}}(t.current);return n.activate(),()=>n.deactivate()},[e]),t}function S(){const e=c(null);return i(()=>{if("undefined"!=typeof document)return e.current=function(){const e=document.createElement("div"),t=document.createElement("div");for(const n of[e,t])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"),t.setAttribute("aria-live","assertive"),{announce(n,r="polite"){const o="assertive"===r?t:e;o.textContent="",setTimeout(()=>{o.textContent=n},0)},destroy(){e.remove(),t.remove()}}}(),()=>{e.current?.destroy()}},[]),r((t,n="polite")=>{e.current?.announce(t,n)},[])}function D(e,t=!0){const n=c(e);n.current=e,i(()=>{if(!t||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&n.current()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t])}function z(e,t){const n=c(t);n.current=t,i(()=>{const t=t=>{e.current&&!e.current.contains(t.target)&&n.current()};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[e])}new class{constructor(e=512){this.cache=/* @__PURE__ */new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(e,512)}get(e){if(!this.cache.has(e))return void this.misses++;this.hits++;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}has(e){return this.cache.has(e)}invalidate(e){void 0!==e?this.cache.delete(e):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const e=this.hits+this.misses;return 0===e?0:this.hits/e*100}}(512);var C=/* @__PURE__ */new Map;function M(e,t){return void 0!==t?`--tkx-${e}: ${t};`:`var(--tkx-${e})`}function F(){return Array.from(C.entries()).map(([e,t])=>`.${e} { ${t} }`).join("\n")}function j(){C.clear()}function A(){if("undefined"==typeof document)return;let e=document.getElementById("tkx-styles");e||(e=document.createElement("style"),e.id="tkx-styles",document.head.appendChild(e)),e.textContent=F()}var T=t({bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"});function N(){return o(T)}var I=t({locale:"en-US",direction:"ltr",strings:{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,t)=>`Page ${e} of ${t}`,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",filterPlaceholder:"Filter...",exportCsv:"Export CSV",rowsSelected:e=>`${e} row${1===e?"":"s"} selected`}});function W(){return o(I).strings}var O=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function L(e,t){return e>>>t|e<<32-t}function R(e){const t=[];for(let l=0;l<e.length;l++){let n=e.charCodeAt(l);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(l++,n=65536+((1023&n)<<10|1023&e.charCodeAt(l)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}const n=8*t.length;for(t.push(128);t.length%64!=56;)t.push(0);for(let l=0;l<4;l++)t.push(0);t.push(n>>>24&255,n>>>16&255,n>>>8&255,255&n);const r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),o=new Uint32Array(64);for(let l=0;l<t.length;l+=64){for(let r=0;r<16;r++)o[r]=t[l+4*r]<<24|t[l+4*r+1]<<16|t[l+4*r+2]<<8|t[l+4*r+3];for(let t=16;t<64;t++){const e=L(o[t-15],7)^L(o[t-15],18)^o[t-15]>>>3,n=L(o[t-2],17)^L(o[t-2],19)^o[t-2]>>>10;o[t]=o[t-16]+e+o[t-7]+n|0}let[e,n,i,a,s,c,d,u]=r;for(let t=0;t<64;t++){const r=u+(L(s,6)^L(s,11)^L(s,25))+(s&c^~s&d)+O[t]+o[t]|0,l=(L(e,2)^L(e,13)^L(e,22))+(e&n^e&i^n&i)|0;u=d,d=c,c=s,s=a+r|0,a=i,i=n,n=e,e=r+l|0}r[0]=r[0]+e|0,r[1]=r[1]+n|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+d|0,r[7]=r[7]+u|0}let i="";for(let l=0;l<8;l++)i+=(r[l]>>>0).toString(16).padStart(8,"0");return i}var V={"<":"<",">":">","&":"&","'":"'",'"':""","`":"`"};function B(e){if(null==e)return"";let t=String(e);return t=t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,""),t.replace(/[<>&'"`]/g,e=>V[e]??e)}function E(e){const t={};for(const n of Object.keys(e))t[n]=H(e[n]);return t}function H(e){return"string"==typeof e?B(e):Array.isArray(e)?e.map(H):null===e||"object"!=typeof e||function(e){return"object"==typeof e&&null!==e&&"$$typeof"in e}(e)?e:E(e)}var P=[];function Y(e,t,n){const r=R(JSON.stringify(n??{})),o=R((P.length>0?P[P.length-1].chainHash:"0000000000000000000000000000000000000000000000000000000000000000")+r+t+e),i=Object.freeze({timestamp:Date.now(),component:t,action:e,propsHash:r,chainHash:o});return P=Object.freeze([...P,i]),i}function q(e){let t=P;return e?.component&&(t=t.filter(t=>t.component===e.component)),e?.action&&(t=t.filter(t=>t.action===e.action)),e?.limit&&(t=t.slice(-e.limit)),t}function U(){let e="0000000000000000000000000000000000000000000000000000000000000000";for(const t of P){if(R(e+t.propsHash+t.component+t.action)!==t.chainHash)return!1;e=t.chainHash}return!0}function J(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;const n=t.replace(/[\u0000-\u001F\u007F]/g,"");return/^javascript:/i.test(n)||/^vbscript:/i.test(n)||/^data:/i.test(n)&&!/^data:image\//i.test(n)||/^file:/i.test(n)?null:n}var _=new Set(["a","abbr","b","blockquote","br","code","del","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),Z={a:new Set(["href","title","target","rel"]),img:new Set(["src","alt","title","width","height","loading","decoding"]),th:new Set(["scope","colspan","rowspan","align"]),td:new Set(["colspan","rowspan","align"]),"*":new Set(["id","class","lang","dir","title"])},K=new Set(["constructor","prototype","__proto__","submit","reset","action","method","enctype","target","elements","children","firstChild","nextSibling","parentNode","ownerDocument","cookie","domain","location","documentElement","body","head","title","contentWindow","contentDocument"]);function X(e){if("string"!=typeof e)return"";if("undefined"==typeof DOMParser)return B(e);const t=(new DOMParser).parseFromString(`<div>${e}</div>`,"text/html").body.firstElementChild;return t?(G(t),t.innerHTML):""}function G(e){const t=Array.from(e.children);for(const n of t){const e=n.tagName.toLowerCase();if(_.has(e)){for(const t of Array.from(n.attributes)){const r=t.name.toLowerCase();if(r.startsWith("on"))n.removeAttribute(t.name);else if(K.has(r))n.removeAttribute(t.name);else if("style"!==r)if((Z[e]??/* @__PURE__ */new Set).has(r)||Z["*"].has(r)){if(("href"===r||"src"===r)&&"string"==typeof t.value){const e=J(t.value);null===e?n.removeAttribute(t.name):n.setAttribute(t.name,e)}"name"!==r&&"id"!==r||!K.has(t.value.toLowerCase())||n.removeAttribute(t.name)}else n.removeAttribute(t.name);else n.setAttribute("style",Q(t.value))}G(n)}else n.remove()}}function Q(e){if("string"!=typeof e)return"";let t=e;return t=t.replace(/expression\s*\([^)]*\)/gi,""),t=t.replace(/url\s*\(\s*['"]?\s*(javascript|vbscript|data)\s*:[^)]*\)/gi,"url(#)"),t=t.replace(/@import[^;]*;?/gi,""),t=t.replace(/behavior\s*:[^;]*;?/gi,""),t=t.replace(/-moz-binding[^;]*;?/gi,""),t=t.replace(/[<>]/g,""),t=t.replace(/[\u0000-\u001F\u007F]/g,""),t.trim()}var ee=new Set(["__proto__","constructor","prototype"]);function te(e){try{return ne(JSON.parse(e,(e,t)=>{if(!ee.has(e))return t}))}catch{return null}}function ne(e){if(Array.isArray(e))return e.map(ne);if(e&&"object"==typeof e){const t={};for(const[n,r]of Object.entries(e))ee.has(n)||(t[n]=ne(r));return t}return e}function re(e){return"string"!=typeof e?"":e.replace(/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF\u00AD]/g,"")}function oe(e={}){const{allowInlineStyles:t=!0,imgHosts:n=[],connectHosts:r=[],fontHosts:o=[],scriptNonce:i,reportUri:l}=e,a=["default-src 'self'","script-src "+(i?`'self' 'nonce-${i}'`:"'self'"),"style-src "+(t?"'self' 'unsafe-inline'":"'self'"),`img-src ${["'self'","data:","https:",...n].join(" ")}`,`font-src ${["'self'","https:","data:",...o].join(" ")}`,`connect-src ${["'self'",...r].join(" ")}`,"frame-ancestors 'none'","form-action 'self'","base-uri 'self'","object-src 'none'","upgrade-insecure-requests"];return l&&a.push(`report-uri ${l}`),a.join("; ")}function ie(){if("undefined"==typeof window)return;const e=window.trustedTypes;if(e)try{e.createPolicy("tkx",{createHTML:X,createScriptURL:e=>J(e)??"",createScript:()=>{throw new Error("TekiVex: inline script creation forbidden")}})}catch{}}function le(){if("undefined"==typeof window)return!1;try{return window.top!==window.self}catch{return!0}}function ae(e,t){let n=e,r=Date.now();return{check(){const o=Date.now(),i=o-r,l=Math.floor(i/t);return l>0&&(n=Math.min(e,n+l),r=o),!(n<=0||(n-=1,0))},reset(){n=e,r=Date.now()}}}async function se(e){const t=new Uint8Array(await e.slice(0,12).arrayBuffer()),n=(...e)=>e.every((e,n)=>t[n]===e);return n(137,80,78,71)?"image/png":n(255,216,255)?"image/jpeg":n(71,73,70,56)?"image/gif":n(66,77)?"image/bmp":n(82,73,70,70)&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"image/webp":n(37,80,68,70)?"application/pdf":n(80,75,3,4)?"application/zip":123===t[0]||91===t[0]?"application/json":[...t].includes(0)?null:"text/plain"}var ce=[{name:"ssn",re:/\b\d{3}-\d{2}-\d{4}\b/g,repl:"[redacted-ssn]"},{name:"credit",re:/\b(?:\d[ -]?){13,19}\b/g,repl:e=>{const t=e.replace(/[ -]/g,"");return t.length<13||t.length>19?e:function(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let o=e.charCodeAt(r)-48;if(o<0||o>9)return!1;n&&(o*=2,o>9&&(o-=9)),t+=o,n=!n}return t>0&&t%10==0}(t)?"[redacted-card]":e}},{name:"email",re:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,repl:"[redacted-email]"},{name:"phone",re:/\b(\+?\d{1,3}[ -])?\(?\d{3}\)?[ -]?\d{3}[ -]?\d{4}\b/g,repl:"[redacted-phone]"},{name:"apikey",re:/\b(sk|pk|rk)-[A-Za-z0-9]{20,}\b/g,repl:"[redacted-key]"}];function de(e){if("string"!=typeof e)return"";let t=e;for(const{re:n,repl:r}of ce)t=t.replace(n,r);return t}Object.freeze({sanitizeString:B,sanitizeHref:J,sanitizeHTML:X,sanitizeCSS:Q,sanitizeJSON:te,sanitizeUnicode:re,isSafeAttrName:function(e){return!("string"!=typeof e||!e||/[\u0000-\u001F\u007F<>"]/.test(e)||K.has(e.toLowerCase()))},buildTkxCSP:oe,installTrustedTypes:ie,isFramed:le,installFrameBuster:function(e){if("undefined"!=typeof window&&le())if(e)e();else try{window.top.location.href=window.self.location.href}catch{}},createRateLimiter:ae,sniffMimeType:se,scrubPII:de,deepFreeze:function e(t){if(t&&"object"==typeof t&&!Object.isFrozen(t)){for(const n of Object.keys(t))e(t[n]);Object.freeze(t)}return t},__brand:"TekiVex SecurityCore v2.6.0 © 007krcs"});var ue={0:"0",px:"1px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},fe={...ue,screen:"100vh"},pe={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},he={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},me={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"},ge={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"]},xe={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},be={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"},ye={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},we={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},ve=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)])),ke=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),$e={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Se=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,De=new Set(["behavior","-moz-binding","-webkit-binding","src"]),ze=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function Ce(e){return Se.test(e)||e.includes("}")||e.includes("{")||e.includes("<")||e.includes(">")?null:e}function Me(e){const t=e.match(/^\[(.+)]$/);return t?Ce(t[1]):null}function Fe(e){return ke.has(e)?`var(--tkx-${e})`:"transparent"===e?"transparent":"current"===e?"currentColor":"white"===e?"#ffffff":"black"===e?"#000000":"inherit"===e?"inherit":Me(e)||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),e)}function je(e){const t=e.match(/^\[(--[a-zA-Z0-9_-]+):(.+)]$/);if(t){const e=Ce(t[2]);return e?{[t[1]]:e}:null}const n=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(n){const e=function(e){const t=e.toLowerCase().trim();return De.has(t)?null:ze.has(t)?t:null}(n[1]),t=Ce(n[2]);return e&&t?{[e]:t}:null}const r={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(r[e])return{display:r[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("grow"===e||"flex-grow"===e)return{"flex-grow":"1"};if("grow-0"===e)return{"flex-grow":"0"};if("shrink"===e||"flex-shrink"===e)return{"flex-shrink":"1"};if("shrink-0"===e||"flex-shrink-0"===e)return{"flex-shrink":"0"};const a={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(a[e])return{"align-items":a[e]};const s={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(s[e])return{"justify-content":s[e]};const c={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(c[e])return{"align-self":c[e]};const d={"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(d[e])return{"align-content":d[e]};let u;if(u=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":"none"===u[1]?"none":"subgrid"===u[1]?"subgrid":`repeat(${u[1]},minmax(0,1fr))`};if(u=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":"none"===u[1]?"none":"subgrid"===u[1]?"subgrid":`repeat(${u[1]},minmax(0,1fr))`};if(u=e.match(/^col-span-(full|\d+)$/))return{"grid-column":"full"===u[1]?"1 / -1":`span ${u[1]} / span ${u[1]}`};if(u=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":u[1]};if(u=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":u[1]};if(u=e.match(/^row-span-(full|\d+)$/))return{"grid-row":"full"===u[1]?"1 / -1":`span ${u[1]} / span ${u[1]}`};if(u=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":u[1]};if(u=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":u[1]};if("grid-flow-row"===e)return{"grid-auto-flow":"row"};if("grid-flow-col"===e)return{"grid-auto-flow":"column"};if("grid-flow-dense"===e)return{"grid-auto-flow":"dense"};if("grid-flow-row-dense"===e)return{"grid-auto-flow":"row dense"};if("grid-flow-col-dense"===e)return{"grid-auto-flow":"column dense"};if(u=e.match(/^p-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{padding:e}}if(u=e.match(/^px-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-left":e,"padding-right":e}}if(u=e.match(/^py-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-top":e,"padding-bottom":e}}if(u=e.match(/^pt-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-top":e}}if(u=e.match(/^pr-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-right":e}}if(u=e.match(/^pb-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-bottom":e}}if(u=e.match(/^pl-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"padding-left":e}}if(u=e.match(/^-?m-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{margin:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?mx-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n){const e=t&&"0"!==n?`-${n}`:n;return{"margin-left":e,"margin-right":e}}}if(u=e.match(/^-?my-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n){const e=t&&"0"!==n?`-${n}`:n;return{"margin-top":e,"margin-bottom":e}}}if(u=e.match(/^-?mt-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-top":t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?mr-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-right":t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?mb-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-bottom":t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?ml-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??Me(u[1]);if(n)return{"margin-left":t&&"0"!==n?`-${n}`:n}}if("mx-auto"===e)return{"margin-left":"auto","margin-right":"auto"};if("my-auto"===e)return{"margin-top":"auto","margin-bottom":"auto"};if(u=e.match(/^gap-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{gap:e}}if(u=e.match(/^gap-x-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"column-gap":e}}if(u=e.match(/^gap-y-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"row-gap":e}}if(u=e.match(/^w-(.+)$/)){const e=u[1],t=ue[e]??pe[e]??Me(e);if(t)return{width:t}}if(u=e.match(/^min-w-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"min-width":e}}if(u=e.match(/^max-w-(.+)$/)){const e={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[u[1]]??ue[u[1]]??Me(u[1]);if(e)return{"max-width":e}}if(u=e.match(/^h-(.+)$/)){const e=u[1],t=fe[e]??pe[e]??Me(e);if(t)return{height:t}}if(u=e.match(/^min-h-(.+)$/)){const e={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[u[1]]??ue[u[1]]??Me(u[1]);if(e)return{"min-height":e}}if(u=e.match(/^max-h-(.+)$/)){const e=fe[u[1]]??Me(u[1]);if(e)return{"max-height":e}}if(u=e.match(/^size-(.+)$/)){const e=ue[u[1]]??pe[u[1]]??Me(u[1]);if(e)return{width:e,height:e}}if(u=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[e,t]=ge[u[1]]??["1rem","1.5rem"];return{"font-size":e,"line-height":t}}if(u=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":xe[u[1]]??u[1]};if(u=e.match(/^leading-(.+)$/)){const e=be[u[1]]??Me(u[1]);if(e)return{"line-height":e}}if(u=e.match(/^tracking-(.+)$/)){const e=ye[u[1]]??Me(u[1]);if(e)return{"letter-spacing":e}}const f={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(f[e])return{"text-align":f[e]};if("italic"===e)return{"font-style":"italic"};if("not-italic"===e)return{"font-style":"normal"};if("uppercase"===e)return{"text-transform":"uppercase"};if("lowercase"===e)return{"text-transform":"lowercase"};if("capitalize"===e)return{"text-transform":"capitalize"};if("normal-case"===e)return{"text-transform":"none"};if("underline"===e)return{"text-decoration-line":"underline"};if("overline"===e)return{"text-decoration-line":"overline"};if("line-through"===e)return{"text-decoration-line":"line-through"};if("no-underline"===e)return{"text-decoration-line":"none"};if("truncate"===e)return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if("text-ellipsis"===e)return{"text-overflow":"ellipsis"};if("text-clip"===e)return{"text-overflow":"clip"};if("whitespace-normal"===e)return{"white-space":"normal"};if("whitespace-nowrap"===e)return{"white-space":"nowrap"};if("whitespace-pre"===e)return{"white-space":"pre"};if("whitespace-pre-wrap"===e)return{"white-space":"pre-wrap"};if("whitespace-pre-line"===e)return{"white-space":"pre-line"};if("break-words"===e)return{"overflow-wrap":"break-word"};if("break-all"===e)return{"word-break":"break-all"};if("break-keep"===e)return{"word-break":"keep-all"};if("font-mono"===e)return{"font-family":"var(--tkx-font-mono,monospace)"};if("font-sans"===e)return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if("font-serif"===e)return{"font-family":"ui-serif,Georgia,serif"};if("antialiased"===e)return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(u=e.match(/^indent-(.+)$/)){const e=ue[u[1]]??Me(u[1]);if(e)return{"text-indent":e}}if(u=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":u[1],"-webkit-box-orient":"vertical"};if(u=e.match(/^text-(.+)$/)){const[e,t]=u[1].split("/"),n=Fe(e);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(e)){if(t){const e=parseInt(t)/100;return{color:n,opacity:String(e)}}return{color:n}}}if(u=e.match(/^bg-(.+)$/)){const[e,t]=u[1].split("/"),n=Fe(e);return t?{"background-color":n,opacity:String(parseInt(t)/100)}:"none"===e?{background:"none"}:{"background-color":n}}if(u=e.match(/^border-color-(.+)$/))return{"border-color":Fe(u[1])};if(u=e.match(/^fill-(.+)$/))return{fill:Fe(u[1])};if(u=e.match(/^stroke-(.+)$/))return{stroke:Fe(u[1])};if(u=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Fe(u[1])};if(u=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Fe(u[1])};if(u=e.match(/^accent-(.+)$/))return{"accent-color":Fe(u[1])};if(u=e.match(/^caret-(.+)$/))return{"caret-color":Fe(u[1])};if(u=e.match(/^outline-color-(.+)$/))return{"outline-color":Fe(u[1])};if("border"===e)return{"border-width":"1px"};if(u=e.match(/^border-(\d+)$/))return{"border-width":`${u[1]}px`};if("border-t"===e)return{"border-top-width":"1px"};if(u=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${u[1]}px`};if("border-r"===e)return{"border-right-width":"1px"};if(u=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${u[1]}px`};if("border-b"===e)return{"border-bottom-width":"1px"};if(u=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${u[1]}px`};if("border-l"===e)return{"border-left-width":"1px"};if(u=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${u[1]}px`};if("border-x"===e)return{"border-left-width":"1px","border-right-width":"1px"};if("border-y"===e)return{"border-top-width":"1px","border-bottom-width":"1px"};if("border-none"===e)return{"border-style":"none"};if("border-solid"===e)return{"border-style":"solid"};if("border-dashed"===e)return{"border-style":"dashed"};if("border-dotted"===e)return{"border-style":"dotted"};if("border-double"===e)return{"border-style":"double"};if((u=e.match(/^border-([a-zA-Z].*)$/))&&ke.has(u[1]))return{"border-color":`var(--tkx-${u[1]})`};if(u=e.match(/^border-\[(.+)]$/))return{"border-color":u[1]};if("border-0"===e)return{"border-width":"0"};if("rounded"===e)return{"border-radius":he[""]};if(u=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":he[u[1]]??Me(u[1])??u[1]};if(u=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const e=u[1],t=he[u[2]??""]??he[""];return{t:{"border-top-left-radius":t,"border-top-right-radius":t},r:{"border-top-right-radius":t,"border-bottom-right-radius":t},b:{"border-bottom-left-radius":t,"border-bottom-right-radius":t},l:{"border-top-left-radius":t,"border-bottom-left-radius":t},tl:{"border-top-left-radius":t},tr:{"border-top-right-radius":t},br:{"border-bottom-right-radius":t},bl:{"border-bottom-left-radius":t}}[e]??{}}const p={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if("ring"===e)return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((u=e.match(/^ring-(\d+)$/))&&p[u[1]])return{"box-shadow":`0 0 0 ${p[u[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if("ring-inset"===e)return{"--tkx-ring-offset":"inset"};if(u=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${u[1]}px`,"box-shadow":`0 0 0 ${u[1]}px var(--tkx-bg)`};if("shadow"===e)return{"box-shadow":me[""]};if(u=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":me[u[1]]};if(u=e.match(/^opacity-(\d+)$/)){const e=ve[u[1]];if(void 0!==e)return{opacity:e}}if("bg-none"===e)return{background:"none"};const h={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(h[e])return{"background-size":h[e]};const m={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(m[e])return{"background-position":m[e]};const g={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(g[e])return{"background-repeat":g[e]};if("backdrop-blur"===e)return{"backdrop-filter":`blur(${we[""]})`};if(u=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${we[u[1]]})`};if("blur"===e)return{filter:`blur(${we[""]})`};if(u=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${we[u[1]]})`};if("grayscale"===e)return{filter:"grayscale(100%)"};if("grayscale-0"===e)return{filter:"grayscale(0)"};if("invert"===e)return{filter:"invert(100%)"};if("invert-0"===e)return{filter:"invert(0)"};const x={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(x[e])return{position:x[e]};if("inset-0"===e)return{top:"0",right:"0",bottom:"0",left:"0"};if("inset-auto"===e)return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if("inset-full"===e)return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if("inset-x-0"===e)return{left:"0",right:"0"};if("inset-y-0"===e)return{top:"0",bottom:"0"};if(u=e.match(/^-?top-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{top:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?right-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{right:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?bottom-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{bottom:t&&"0"!==n?`-${n}`:n}}if(u=e.match(/^-?left-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{left:t&&"0"!==n?`-${n}`:n}}const b={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(u=e.match(/^z-(.+)$/)){const e=b[u[1]]??Me(u[1]);if(e)return{"z-index":e}}const y={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(y[e])return{overflow:y[e]};if(u=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${u[1]}`]:u[2]};if("scrollbar-hide"===e)return{"-ms-overflow-style":"none","scrollbar-width":"none"};if("visible"===e)return{visibility:"visible"};if("invisible"===e)return{visibility:"hidden"};if("collapse"===e)return{visibility:"collapse"};const w={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(w[e])return{cursor:w[e]};if("select-none"===e)return{"user-select":"none"};if("select-text"===e)return{"user-select":"text"};if("select-all"===e)return{"user-select":"all"};if("select-auto"===e)return{"user-select":"auto"};if("pointer-events-none"===e)return{"pointer-events":"none"};if("pointer-events-auto"===e)return{"pointer-events":"auto"};const v={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(u=e.match(/^scale-(.+)$/)){const e=v[u[1]]??Me(u[1]);if(e)return{transform:`scale(${e})`}}if(u=e.match(/^scale-x-(.+)$/)){const e=v[u[1]]??Me(u[1]);if(e)return{transform:`scaleX(${e})`}}if(u=e.match(/^scale-y-(.+)$/)){const e=v[u[1]]??Me(u[1]);if(e)return{transform:`scaleY(${e})`}}const k={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(u=e.match(/^-?rotate-(.+)$/)){const t=e.startsWith("-"),n=k[u[1]]??Me(u[1]);if(n)return{transform:t?`rotate(-${n})`:`rotate(${n})`}}if(u=e.match(/^-?translate-x-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{transform:`translateX(${t&&"0"!==n?`-${n}`:n})`}}if(u=e.match(/^-?translate-y-(.+)$/)){const t=e.startsWith("-"),n=ue[u[1]]??pe[u[1]]??Me(u[1]);if(n)return{transform:`translateY(${t&&"0"!==n?`-${n}`:n})`}}if(u=e.match(/^-?skew-x-(.+)$/)){const t=e.startsWith("-"),n=Me(u[1])??`${u[1]}deg`;return{transform:t?`skewX(-${n})`:`skewX(${n})`}}if(u=e.match(/^-?skew-y-(.+)$/)){const t=e.startsWith("-"),n=Me(u[1])??`${u[1]}deg`;return{transform:t?`skewY(-${n})`:`skewY(${n})`}}const $={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if($[e])return{"transform-origin":$[e]};const S={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(S[e])return{"transition-property":S[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const D={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(u=e.match(/^duration-(.+)$/)){const e=D[u[1]]??Me(u[1]);if(e)return{"transition-duration":e}}if(u=e.match(/^delay-(.+)$/)){const e=D[u[1]]??Me(u[1]);if(e)return{"transition-delay":e}}const z={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(z[e])return{"transition-timing-function":z[e]};const C={"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(C[e])return{animation:C[e]};const M={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return M[e]?{"object-fit":M[e]}:"aspect-square"===e?{"aspect-ratio":"1 / 1"}:"aspect-video"===e?{"aspect-ratio":"16 / 9"}:"aspect-auto"===e?{"aspect-ratio":"auto"}:(u=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":u[1]}:"list-none"===e?{"list-style-type":"none"}:"list-disc"===e?{"list-style-type":"disc"}:"list-decimal"===e?{"list-style-type":"decimal"}:"list-inside"===e?{"list-style-position":"inside"}:"list-outside"===e?{"list-style-position":"outside"}:(u=e.match(/^columns-(\d+)$/))?{columns:u[1]}:"resize"===e?{resize:"both"}:"resize-none"===e?{resize:"none"}:"resize-x"===e?{resize:"horizontal"}:"resize-y"===e?{resize:"vertical"}:"sr-only"===e?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:"not-sr-only"===e?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:"focus-ring"===e?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:"appearance-none"===e?{appearance:"none"}:"outline-none"===e?{outline:"none"}:"outline"===e?{outline:"2px solid currentColor","outline-offset":"2px"}:"float-left"===e?{float:"left"}:"float-right"===e?{float:"right"}:"float-none"===e?{float:"none"}:"clear-both"===e?{clear:"both"}:"isolate"===e?{isolation:"isolate"}:"isolation-auto"===e?{isolation:"auto"}:(u=e.match(/^will-change-(.+)$/))?{"will-change":u[1]}:"touch-manipulation"===e?{"touch-action":"manipulation"}:"touch-none"===e?{"touch-action":"none"}:"touch-pan-x"===e?{"touch-action":"pan-x"}:"touch-pan-y"===e?{"touch-action":"pan-y"}:"scroll-smooth"===e?{"scroll-behavior":"smooth"}:"scroll-auto"===e?{"scroll-behavior":"auto"}:(u=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[u[1]]:u[2]}:function(e){for(const t of Pe.values())if(t[e])return t[e];return null}(e)||null}function Ae(e){let t=0,n=-1;for(let r=0;r<e.length;r++)if("["===e[r])t++;else if("]"===e[r])t--;else if(":"===e[r]&&0===t){n=r;break}return-1===n?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function Te(e,t){for(const[n,r]of Object.entries(t))e[n]=r}function Ne(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}var Ie=/* @__PURE__ */new Map,We=null,Oe=null;function Le(){return We&&We.isConnected||(We=document.getElementById("tkx-atomic"))||((We=document.createElement("style")).id="tkx-atomic",document.head.appendChild(We)),We}function Re(e){const t=[];for(const n of e)if(n)if("string"==typeof n)t.push(...n.split(/\s+/).filter(Boolean));else if(Array.isArray(n))t.push(...Re(n));else if("object"==typeof n)for(const[e,r]of Object.entries(n))r&&t.push(e);return t}function Ve(...e){const t=Re(e);if(0===t.length)return"";const n={base:{},variants:{}};for(const a of t){const{variant:e,utility:t}=Ae(a),r=je(t);r&&(e?(n.variants[e]||(n.variants[e]={}),Te(n.variants[e],r)):Te(n.base,r))}const r=[],o=Ne(n.base),i=function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}([o,...Object.entries(n.variants).map(([e,t])=>`${e}{${Ne(t)}}`)].join("|")),l=`tkx-${i}`;o&&r.push(`.${l}{${o}}`);for(const[a,s]of Object.entries(n.variants)){const e=Ne(s);if(e)if(a.startsWith("@")){const t=$e[a.slice(1)];t&&r.push(`@media(min-width:${t}){.${l}{${e}}}`)}else if("motion-safe"===a)r.push(`@media(prefers-reduced-motion:no-preference){.${l}{${e}}}`);else if("motion-reduce"===a)r.push(`@media(prefers-reduced-motion:reduce){.${l}{${e}}}`);else if("contrast-more"===a)r.push(`@media(prefers-contrast:more){.${l}{${e}}}`);else if("forced-colors"===a)r.push(`@media(forced-colors:active){.${l}{${e}}}`);else if("dark"===a)r.push(`@media(prefers-color-scheme:dark){.${l}{${e}}}`);else if("print"===a)r.push(`@media print{.${l}{${e}}}`);else if("group-hover"===a)r.push(`.group:hover .${l}{${e}}`);else if("group-focus"===a)r.push(`.group:focus-within .${l}{${e}}`);else if("peer-hover"===a)r.push(`.peer:hover~.${l}{${e}}`);else{const t={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[a]??`:${a}`;r.push(`.${l}${t}{${e}}`)}}return r.length>0&&function(e,t){if(Ie.has(e))return;if(Ie.set(e,t),"undefined"==typeof document)return;const n=function(){if(Oe)return Oe;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],Oe=e,e}catch{return null}}();if(n){const e=function(e){const t=[];let n=0,r=0;for(let o=0;o<e.length;o++)if("{"===e[o])n++;else if("}"===e[o]&&(n--,0===n)){const n=e.slice(r,o+1).trim();n&&t.push(n),r=o+1}return t}(t);for(const t of e)try{n.insertRule(t,n.cssRules.length)}catch{Le().textContent+=t+"\n"}}else Le().textContent+=t+"\n"}(i,r.join("")),l}function Be(){return Array.from(Ie.values()).join("\n")}function Ee(){Ie.clear(),We=null,Oe&&"undefined"!=typeof document&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==Oe),Oe=null)}function He(...e){return e.filter(Boolean).join(" ")}var Pe=/* @__PURE__ */new Map;function Ye(e){Pe.set(e.name,e.utilities)}function qe(e){Pe.delete(e)}function Ue(){return Array.from(Pe.keys())}var Je=t(null);function _e(){const e=o(Je),t=c({}),n=c({}),r=c({}),i=a(()=>({getFieldValue:e=>t.current[e],setFieldValue:(e,n)=>{t.current[e]=n},getFieldsValue:()=>({...t.current}),setFieldsValue:e=>{Object.assign(t.current,e)},validateFields:()=>Promise.resolve({...t.current}),validateField:e=>Promise.resolve(!0),resetFields:()=>{t.current={},n.current={},r.current={}},getFieldError:e=>n.current[e]??null,isFieldTouched:e=>r.current[e]??!1}),[]);return e?e.instance:i}var Ze=!1;function Ke(e=!1){const[t,n]=d(e);return{isOpen:t,open:r(()=>n(!0),[]),close:r(()=>n(!1),[]),toggle:r(()=>n(e=>!e),[])}}function Xe({count:e,initialIndex:t=0,orientation:n="horizontal",loop:o=!0}){const[i,l]=d(t),a=c([]),s=r(t=>{l(n=>{let r=n+t;return r=o?(r%e+e)%e:Math.max(0,Math.min(e-1,r)),requestAnimationFrame(()=>{a.current[r]?.focus()}),r})},[e,o]);return{focusedIndex:i,setFocusedIndex:l,getItemProps:r(t=>({tabIndex:t===i?0:-1,"data-focused":t===i,onFocus:()=>l(t),onKeyDown:t=>{const r="horizontal"===n||"both"===n,o="vertical"===n||"both"===n;r&&"ArrowRight"===t.key&&(t.preventDefault(),s(1)),r&&"ArrowLeft"===t.key&&(t.preventDefault(),s(-1)),o&&"ArrowDown"===t.key&&(t.preventDefault(),s(1)),o&&"ArrowUp"===t.key&&(t.preventDefault(),s(-1)),"Home"===t.key&&(t.preventDefault(),l(0),requestAnimationFrame(()=>a.current[0]?.focus())),"End"===t.key&&(t.preventDefault(),l(e-1),requestAnimationFrame(()=>a.current[e-1]?.focus()))}}),[i,s,n,e])}}function Ge({initialValues:e,validate:t,validateAsync:n,debounceMs:o=300}){const[l,a]=d({...e}),[s,u]=d({}),[f,p]=d({}),[h,m]=d({}),[g,x]=d(void 0),[b,y]=d({}),w=c(e),v=c({}),k=c({}),$=c(l);i(()=>{$.current=l},[l]);const S=c(n);i(()=>{S.current=n},[n]);const D=r(e=>{const t=S.current?.[e];if(!t)return;const n=v.current[e];n&&clearTimeout(n),v.current[e]=setTimeout(()=>{const n=(k.current[e]??0)+1;k.current[e]=n,m(t=>({...t,[e]:!0})),Promise.resolve().then(()=>t($.current[e],$.current)).then(t=>{k.current[e]===n&&(m(t=>{const n={...t};return delete n[e],n}),p(n=>{const r={...n};return t?r[e]=t:delete r[e],r}))}).catch(()=>{k.current[e]===n&&m(t=>{const n={...t};return delete n[e],n})})},o)},[o]),z=r((e,t)=>{a(n=>({...n,[e]:t})),k.current[e]=(k.current[e]??0)+1,D(e)},[D]),C=r(e=>{a(t=>({...t,...e}));for(const t of Object.keys(e))k.current[t]=(k.current[t]??0)+1,D(t)},[D]),M=r(e=>{y(t=>({...t,[e]:!0}))},[]),F=r(()=>{if(!t)return!0;const{o:e,...n}=t(l),r=Object.fromEntries(Object.entries(n).filter(([,e])=>null!=e));return u(r),x(e||void 0),y(Object.fromEntries(Object.keys(l).map(e=>[e,!0]))),0===Object.keys(r).length&&!e},[l,t]),j=r(()=>{for(const e of Object.keys(v.current)){const t=v.current[e];t&&clearTimeout(t),k.current[e]=(k.current[e]??0)+1}v.current={},a({...w.current}),u({}),p({}),m({}),x(void 0),y({})},[]);i(()=>()=>{for(const e of Object.keys(v.current)){const t=v.current[e];t&&clearTimeout(t)}},[]);const A={...s,...f};return{values:l,errors:A,asyncErrors:f,validating:h,rootError:g,touched:b,dirty:Object.keys(l).some(e=>l[e]!==w.current[e]),isValid:0===Object.keys(A).length&&!g,setValue:z,setValues:C,touchField:M,validate:F,reset:j,getFieldProps:r(e=>({value:l[e],onChange:t=>{z(e,t.target.value)},onBlur:()=>M(e),"aria-invalid":!(!b[e]||!A[e])||void 0,"aria-describedby":A[e]?`${String(e)}-error`:void 0}),[l,A,b,z,M])}}function Qe({items:e,initialSelected:t=[],multiple:n=!0}){const[o,i]=d(()=>new Set(t)),l=r(e=>{i(t=>{const r=new Set(t);return r.has(e)?r.delete(e):(n||r.clear(),r.add(e)),r})},[n]),s=r(e=>{i(t=>{if(t.has(e))return t;const r=n?new Set(t):/* @__PURE__ */new Set;return r.add(e),r})},[n]),c=r(e=>{i(t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n})},[]),u=r(()=>{n&&i(new Set(e))},[e,n]),f=r(()=>i(/* @__PURE__ */new Set),[]),p=r(()=>{i(t=>e.every(e=>t.has(e))?/* @__PURE__ */new Set:new Set(e))},[e]),h=e.length>0&&e.every(e=>o.has(e)),m=e.some(e=>o.has(e)),g=a(()=>Array.from(o),[o]);return{selected:o,isSelected:r(e=>o.has(e),[o]),toggle:l,select:s,deselect:c,selectAll:u,deselectAll:f,toggleAll:p,allSelected:h,someSelected:m,selectedCount:o.size,selectedArray:g}}function et(e,t){const[n,r]=d(e);return i(()=>{const n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function tt(e,t){const[n,r]=d(e),o=c(Date.now());return i(()=>{const n=Date.now(),i=t-(n-o.current);if(!(i<=0)){const t=setTimeout(()=>{o.current=Date.now(),r(e)},i);return()=>clearTimeout(t)}o.current=n,r(e)},[e,t]),n}function nt({value:e,onChange:t,defaultValue:n}){const o=void 0!==e,[i,l]=d(n),a=c(t);a.current=t;const s=r(e=>{o||l(e),a.current?.(e)},[o]);return[o?e:i,s]}function rt(e){const[t,n]=d(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return i(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e);n(t.matches);const r=e=>n(e.matches);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),t}function ot(e,t){const[n,o]=d(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return null!==n?JSON.parse(n):t}catch{return t}});return[n,r(t=>{o(n=>{const r="function"==typeof t?t(n):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(r))}catch{}return r})},[e]),r(()=>{if(o(t),"undefined"!=typeof window)try{window.localStorage.removeItem(e)}catch{}},[e,t])]}function it({threshold:e=0,rootMargin:t="0px",root:n=null,once:r=!1}={}){const o=c(null),[l,a]=d(null),s=c(null);return i(()=>{const i=o.current;if(i&&"undefined"!=typeof IntersectionObserver)return s.current=new IntersectionObserver(([e])=>{a(e),r&&e.isIntersecting&&s.current?.unobserve(i)},{threshold:e,rootMargin:t,root:n}),s.current.observe(i),()=>s.current?.disconnect()},[e,t,n,r]),{ref:o,isIntersecting:l?.isIntersecting??!1,entry:l}}function lt(e){const{url:t,protocols:n,reconnect:o=!0,reconnectDelay:l=1e3,reconnectAttempts:a=10,heartbeatInterval:s=3e4,heartbeatMessage:u="ping",onOpen:f,onClose:p,onError:h,onMessage:m}=e,[g,x]=d("disconnected"),[b,y]=d(null),[w,v]=d([]),[k,$]=d(0),[S,D]=d(null),z=c(null),C=c(0),M=c(null),F=c(null),j=c(null),A=c([]),T=c(!0),N=c(!1),I=c(f),W=c(p),O=c(h),L=c(m);I.current=f,W.current=p,O.current=h,L.current=m;const R=r(()=>{M.current&&(clearTimeout(M.current),M.current=null),F.current&&(clearInterval(F.current),F.current=null)},[]),V=r(e=>{for(;A.current.length>0;){const t=A.current.shift();void 0!==t&&e.send("string"==typeof t?t:JSON.stringify(t))}},[]),B=r(()=>{if(z.current&&z.current.readyState===WebSocket.OPEN)return;N.current=!1,R(),T.current&&x("connecting");const e=new WebSocket(t,n);z.current=e,e.onopen=t=>{T.current&&(x("connected"),C.current=0,$(0),I.current?.(t),V(e),F.current=setInterval(()=>{if(e.readyState===WebSocket.OPEN){j.current=Date.now();try{e.send(JSON.stringify({type:"ping",t:j.current}))}catch{}}},s))},e.onmessage=e=>{if(!T.current)return;const t=te(e.data),n=null!==t?t:e.data,r=n;if(r&&"object"==typeof r&&"pong"===r.type&&"number"==typeof r.t)D(Date.now()-r.t);else{if(n===u&&null!==j.current)return D(Date.now()-j.current),void(j.current=null);y(n),v(e=>{const t=[...e,n];return t.length>100?t.slice(t.length-100):t}),L.current?.(n)}},e.onerror=e=>{T.current&&(x("error"),O.current?.(e))},e.onclose=e=>{if(T.current&&(R(),x("disconnected"),W.current?.(e),!N.current&&o&&C.current<a)){const e=C.current,t=l*Math.pow(1.5,e);C.current+=1,$(C.current),M.current=setTimeout(()=>{T.current&&B()},t)}}},[t,n,o,l,a,s,u,R,V]),E=r(()=>{N.current=!0,R(),z.current&&(z.current.close(),z.current=null),T.current&&x("disconnected")},[R]),H=r(e=>{z.current&&z.current.readyState===WebSocket.OPEN?z.current.send("string"==typeof e?e:JSON.stringify(e)):A.current.push(e)},[]);return i(()=>(T.current=!0,B(),()=>{T.current=!1,N.current=!0,R(),z.current&&(z.current.close(),z.current=null)}),[]),{status:g,lastMessage:b,messages:w,send:H,connect:B,disconnect:E,reconnectCount:k,latency:S}}function at(e){const{url:t,events:n=["message"],withCredentials:o=!1,reconnect:l=!0,reconnectDelay:a=3e3,onOpen:s,onError:u}=e,[f,p]=d("connecting"),[h,m]=d(null),[g,x]=d([]),[b,y]=d(0),w=c(null),v=c(null),k=c(!0),$=c(!1),S=c(s),D=c(u);S.current=s,D.current=u;const z=r(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]),C=r(()=>{if("undefined"==typeof EventSource)return void(k.current&&p("error"));$.current=!1,z(),w.current&&(w.current.close(),w.current=null),k.current&&p("connecting");const e=new EventSource(t,{withCredentials:o});w.current=e,e.onopen=()=>{k.current&&(p("connected"),S.current?.())},e.onerror=e=>{k.current&&(p("error"),D.current?.(e),!$.current&&l&&(z(),v.current=setTimeout(()=>{k.current&&C()},a)))};const r=e=>t=>{if(!k.current)return;let n;try{n=JSON.parse(t.data)}catch{n=t.data}const r={type:e,data:n,timestamp:Date.now(),...t.lastEventId?{id:t.lastEventId}:{}};m({type:r.type,data:r.data,id:r.id}),x(e=>{const t=[...e,r];return t.length>200?t.slice(t.length-200):t}),y(e=>e+1)};for(const t of n)e.addEventListener(t,r(t))},[t,o,l,a,z]),M=r(()=>{$.current=!0,z(),w.current&&(w.current.close(),w.current=null),k.current&&p("closed")},[z]);return i(()=>(k.current=!0,C(),()=>{k.current=!1,$.current=!0,z(),w.current&&(w.current.close(),w.current=null)}),[]),{status:f,lastEvent:h,events:g,connect:C,disconnect:M,eventCount:b}}function st(e){const{queryFn:t,initialCursor:n=null,enabled:o=!0,dedupKey:l}=e,[a,s]=d([]),[u,f]=d("idle"),[p,h]=d(null),[m,g]=d(!1),[x,b]=d(0),y=c(n??null),w=c(!1),v=c(!0),k=c(void 0),$=c(t);$.current=t;const S=r(async(e,t,n)=>{if(w.current)return;if(void 0!==l&&l===k.current)return;w.current=!0;let r=!1;v.current&&(f(n?"loading":"fetching-more"),h(null));try{const o=await $.current(e,t);if(r||!v.current)return;void 0!==l&&(k.current=l),y.current=o.nextCursor,s(e=>n?[o.data]:[...e,o.data]),g(o.hasMore),b(t),f("success")}catch(o){if(r||!v.current)return;h(o instanceof Error?o:new Error(String(o))),f("error")}finally{r||(w.current=!1)}return()=>{r=!0}},[l]),D=r(()=>{m&&!w.current&&S(y.current,x+1,!1)},[m,x,S]),z=r(()=>{w.current=!1,k.current=void 0,y.current=n??null,s([]),f("idle"),h(null),g(!1),b(0)},[n]);i(()=>(v.current=!0,o&&S(n??null,0,!0),()=>{v.current=!1}),[o]);const C=a.flat();return{data:C,pages:a,status:u,error:p,hasMore:m,isFetchingMore:"fetching-more"===u,fetchMore:D,reset:z,pageIndex:x,totalLoaded:C.length}}function ct(e){return t=>{const n=e.safeParse(t);if(n.success)return{};const r={};for(const e of n.error?.issues??[]){const t=e.path.length>0?e.path.join("."):"_root";r[t]||(r[t]=e.message)}return r}}function dt(e){const t=Ge({initialValues:e.initialValues,validate:ct(e.schema)}),n=r(async n=>{n?.preventDefault?.(),t.validate()&&e.onSubmit&&await e.onSubmit(t.values)},[t,e]);return{...t,handleSubmit:n}}function ut(e,t){return n=>{const r=e(t,n);if(r.success)return{};const o={};for(const e of r.issues??[]){const t=(e.path??[]).map(e=>String(e.key)),n=t.length>0?t.join("."):"_root";o[n]||(o[n]=e.message)}return o}}function ft(e){const t=Ge({initialValues:e.initialValues,validate:ut(e.safeParse,e.schema)}),n=r(async n=>{n?.preventDefault?.(),t.validate()&&e.onSubmit&&await e.onSubmit(t.values)},[t,e]);return{...t,handleSubmit:n}}!function(){if(Ze)return;if("undefined"==typeof document)return;Ze=!0;const e=document.createElement("style");e.setAttribute("data-tkx-form",""),e.textContent="\n @keyframes tkxFormErrorReveal {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n ",document.head.appendChild(e)}();var pt=n(({label:e,id:t,error:n,hint:r,leftAddon:o,rightAddon:i,isInvalid:a,isRequired:s,disabled:c,className:d,style:u,unicodeSafe:h=!0,onChange:m,...g},x)=>{const b=N(),y=l(),w=t??y,v=`${w}-hint`,k=`${w}-error`,$=a||!!n,S=[r&&v,$&&k].filter(Boolean).join(" ")||void 0,D=B(e),z=n?B(n):void 0,C=r?B(r):void 0,M=$?b.danger:b.border;/* @__PURE__ */
|
|
2
2
|
return p("div",{className:He(Ve("flex flex-col gap-1 w-full"),d),style:u,children:[
|
|
3
|
-
/* @__PURE__ */p("label",{htmlFor:w,className:Ve("text-sm font-medium font-sans"),style:{color:b.text},children:[
|
|
3
|
+
/* @__PURE__ */p("label",{htmlFor:w,className:Ve("text-sm font-medium font-sans"),style:{color:b.text},children:[D,s&&/* @__PURE__ */f("span",{"aria-hidden":"true",className:Ve("ml-1"),style:{color:b.danger},children:"*"})]}),
|
|
4
4
|
/* @__PURE__ */p("div",{className:Ve("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",c?"opacity-60":""),style:{border:`1.5px solid ${M}`,backgroundColor:b.surface},children:[o&&/* @__PURE__ */f("div",{className:Ve("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:b.surfaceAlt,color:b.textMuted,borderRight:`1px solid ${b.border}`},children:o}),
|
|
5
|
-
/* @__PURE__ */f("input",{ref:x,id:w,"aria-invalid":$,"aria-required":s,"aria-describedby":S,disabled:c,className:He(Ve("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:b.text},onChange:h?e=>{const t=re(e.target.value);t!==e.target.value&&(e.target.value=t),m?.(e)}:m,...g}),i&&/* @__PURE__ */f("div",{className:Ve("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:b.surfaceAlt,color:b.textMuted,borderLeft:`1px solid ${b.border}`},children:i})]}),C&&!
|
|
6
|
-
return p("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[/* @__PURE__ */f("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */f("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function xt({options:e,value:t,defaultValue:n,placeholder:o,size:a="md",isDisabled:s=!1,isInvalid:m=!1,label:g,hint:x,errorMessage:b,multiple:y=!1,searchable:w=!1,clearable:v=!1,isLoading:k=!1,onChange:$,renderOption:S,maxMenuHeight:
|
|
7
|
-
return p("div",{id:`${L}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&
|
|
8
|
-
return p("div",{id:`${L}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&
|
|
5
|
+
/* @__PURE__ */f("input",{ref:x,id:w,"aria-invalid":$,"aria-required":s,"aria-describedby":S,disabled:c,className:He(Ve("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:b.text},onChange:h?e=>{const t=re(e.target.value);t!==e.target.value&&(e.target.value=t),m?.(e)}:m,...g}),i&&/* @__PURE__ */f("div",{className:Ve("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:b.surfaceAlt,color:b.textMuted,borderLeft:`1px solid ${b.border}`},children:i})]}),C&&!z&&/* @__PURE__ */f("span",{id:v,className:Ve("text-xs"),style:{color:b.textMuted},children:C}),z&&/* @__PURE__ */p("span",{id:k,role:"alert",className:Ve("text-xs flex items-center gap-1"),style:{color:b.danger},children:[/* @__PURE__ */f("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */f("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"})}),z]})]})});pt.displayName="TkxInput";var ht={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 mt(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function gt({size:e,color:t}){/* @__PURE__ */
|
|
6
|
+
return p("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[/* @__PURE__ */f("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */f("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function xt({options:e,value:t,defaultValue:n,placeholder:o,size:a="md",isDisabled:s=!1,isInvalid:m=!1,label:g,hint:x,errorMessage:b,multiple:y=!1,searchable:w=!1,clearable:v=!1,isLoading:k=!1,onChange:$,renderOption:S,maxMenuHeight:D=280,virtualScroll:z,optionHeight:C=36,id:M,className:F,style:j}){const A=N(),T=W(),I=o??T.selectPlaceholder,O=l(),L=M??O,R=`${L}-listbox`,V=`${L}-hint`,E=`${L}-error`,H=void 0!==t,[P,Y]=d(mt(n)),q=H?mt(t):P,[U,J]=d(!1),[_,Z]=d(""),[K,X]=d(-1),[G,Q]=d(null),[ee,te]=d(""),ne=c(null),re=c(null),oe=c(null),ie=c(null),le=c(null),ae=ht[a],se=m||!!b,ce=c(null),[de,ue]=d(0),[fe,pe]=d(0),he=r(()=>{ce.current&&ue(ce.current.scrollTop)},[]);i(()=>{if(!U)return void ue(0);const e=ce.current;if(!e)return;pe(e.clientHeight);const t=new ResizeObserver(()=>{pe(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[U]);const me=w&&_?e.filter(e=>e.label.toLowerCase().includes(_.toLowerCase())):e,ge=me.filter(e=>!e.disabled),xe=me.some(e=>!!e.group),be=(void 0!==z?z:me.length>=100)&&!xe,ye=me.length*C,we=be?Math.max(0,Math.floor(de/C)-8):0,ve=be?Math.min(me.length,Math.ceil((de+fe)/C)+8):me.length,ke=be?me.slice(we,ve):me,$e=we*C,Se=me.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),De=r(e=>{let t;t=y?q.includes(e)?q.filter(t=>t!==e):[...q,e]:[e],H||Y(t),$?.(y?t:t[0]??""),y||(J(!1),Z(""),X(-1),re.current?.focus())},[H,y,$,q]),ze=r((e,t)=>{t.stopPropagation();const n=q.filter(t=>t!==e);H||Y(n),$?.(y?n:n[0]??"")},[H,y,$,q]),Ce=r(e=>{e.stopPropagation(),H||Y([]),$?.(y?[]:"")},[H,y,$]),Me=r(()=>{re.current&&U&&Q(function(e,t){const n=e.getBoundingClientRect(),r=window.innerHeight-n.bottom-6,o=n.top-6,i=r>=Math.min(t,200)||r>=o?"below":"above";return{top:"below"===i?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:i}}(re.current,D))},[U,D]);function Fe(){if(s||k)return;J(!0);const e=ge.findIndex(e=>q.includes(e.value));X(e>=0?e:0)}i(()=>{if(U)return Me(),window.addEventListener("scroll",Me,!0),window.addEventListener("resize",Me),()=>{window.removeEventListener("scroll",Me,!0),window.removeEventListener("resize",Me)}},[U,Me]),i(()=>{if(!U)return;const e=e=>{const t=e.target;re.current?.contains(t)||ie.current?.contains(t)||(J(!1),Z(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[U]),i(()=>{U&&w&&setTimeout(()=>oe.current?.focus(),0)},[U,w]),i(()=>{if(U&&!(K<0))if(be&&ce.current){const e=K*C,t=e+C,n=ce.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(le.current?.querySelector(`[data-idx="${K}"]`))?.scrollIntoView({block:"nearest"})},[K,U,be,C]);const je=se?A.danger:U?A.primary:A.border,Ae=K>=0&&ge[K]?`${L}-opt-${ge[K].value}`:void 0,Te=[x&&V,se&&E].filter(Boolean).join(" ")||void 0,Ne=q.map(t=>e.find(e=>e.value===t)).filter(Boolean),Ie=U&&G?h(/* @__PURE__ */p("div",{ref:ie,role:"listbox",id:R,"aria-label":g?B(g):"Options","aria-multiselectable":y,style:{position:"absolute",top:G.top,left:G.left,width:G.width,zIndex:9999,backgroundColor:A.surface,border:`1.5px solid ${A.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:G.width,maxHeight:D,display:"flex",flexDirection:"column"},children:[w&&/* @__PURE__ */p("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${A.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */p("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:A.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */f("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */f("path",{d:"M21 21l-4.35-4.35"})]}),/* @__PURE__ */f("input",{ref:oe,type:"text",value:_,onChange:e=>{Z(e.target.value),X(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),J(!1),Z(""),re.current?.focus();break;case"ArrowDown":e.preventDefault(),X(e=>Math.min(e+1,ge.length-1));break;case"ArrowUp":e.preventDefault(),X(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),X(0);break;case"End":e.preventDefault(),X(ge.length-1);break;case"Enter":e.preventDefault(),K>=0&&ge[K]&&De(ge[K].value)}},placeholder:`${T.search}…`,"aria-label":`${T.search} options`,style:{border:"none",outline:"none",background:"transparent",color:A.text,fontSize:ae.fontSize,fontFamily:"inherit",width:"100%"}})]}),/* @__PURE__ */f("div",{ref:e=>{le.current=e,ce.current=e},onScroll:be?he:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:D-(w?48:0)},children:be?/* @__PURE__ */p("div",{style:{height:ye,position:"relative"},children:[/* @__PURE__ */f("div",{style:{position:"absolute",top:$e,left:0,right:0},children:ke.map(e=>{const t=ge.indexOf(e),n=t===K,r=q.includes(e.value),o=S?S(e,r):/* @__PURE__ */p("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */p("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */f("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */f("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(e.label)})]}),e.description&&/* @__PURE__ */f("span",{style:{fontSize:"12px",color:A.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(e.description)})]});/* @__PURE__ */
|
|
7
|
+
return p("div",{id:`${L}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&De(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&X(t),style:{height:C,boxSizing:"border-box",padding:`0 ${ae.px}`,fontSize:ae.fontSize,fontFamily:"inherit",color:e.disabled?A.textMuted:A.text,backgroundColor:n?`${A.primary}22`:r?`${A.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[o,r&&!S&&/* @__PURE__ */f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:A.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */f("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===me.length&&/* @__PURE__ */f("div",{style:{padding:`${ae.py} ${ae.px}`,fontSize:ae.fontSize,fontFamily:"inherit",color:A.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:k?"Loading…":"No options found"})]}):/* @__PURE__ */p(u,{children:[Object.entries(Se).map(([e,t])=>/* @__PURE__ */p("div",{children:[e&&/* @__PURE__ */f("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:A.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:A.surface,zIndex:1,borderBottom:`1px solid ${A.border}`},children:B(e)}),t.map(e=>{const t=ge.indexOf(e),n=t===K,r=q.includes(e.value),o=S?S(e,r):/* @__PURE__ */p("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */p("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */f("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */f("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(e.label)})]}),e.description&&/* @__PURE__ */f("span",{style:{fontSize:"12px",color:A.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(e.description)})]});/* @__PURE__ */
|
|
8
|
+
return p("div",{id:`${L}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&De(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&X(t),style:{padding:`${ae.py} ${ae.px}`,fontSize:ae.fontSize,fontFamily:"inherit",color:e.disabled?A.textMuted:A.text,backgroundColor:n?`${A.primary}22`:r?`${A.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[o,r&&!S&&/* @__PURE__ */f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:A.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */f("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===me.length&&/* @__PURE__ */f("div",{style:{padding:`${ae.py} ${ae.px}`,fontSize:ae.fontSize,fontFamily:"inherit",color:A.textMuted,textAlign:"center"},children:k?"Loading…":"No options found"})]})})]}),document.body):null,We=v&&q.length>0&&!s&&!k;/* @__PURE__ */
|
|
9
9
|
return p("div",{className:He(Ve("flex flex-col gap-1 w-full"),F),style:j,children:[g&&/* @__PURE__ */f("label",{htmlFor:L,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:A.text,userSelect:"none"},children:B(g)}),
|
|
10
|
-
/* @__PURE__ */f("div",{style:{position:"relative",width:"100%",opacity:s?.55:1},children:/* @__PURE__ */p("button",{ref:re,id:L,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":U,"aria-controls":R,"aria-activedescendant":Ae,"aria-invalid":se||void 0,"aria-describedby":Te,"aria-multiselectable":y,disabled:s,onClick:()=>U?J(!1):Fe(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),U?K>=0&&ge[K]&&
|
|
10
|
+
/* @__PURE__ */f("div",{style:{position:"relative",width:"100%",opacity:s?.55:1},children:/* @__PURE__ */p("button",{ref:re,id:L,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":U,"aria-controls":R,"aria-activedescendant":Ae,"aria-invalid":se||void 0,"aria-describedby":Te,"aria-multiselectable":y,disabled:s,onClick:()=>U?J(!1):Fe(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),U?K>=0&&ge[K]&&De(ge[K].value):Fe();break;case"Escape":e.preventDefault(),J(!1),Z("");break;case"ArrowDown":e.preventDefault(),U?X(e=>Math.min(e+1,ge.length-1)):Fe();break;case"ArrowUp":e.preventDefault(),U?X(e=>Math.max(e-1,0)):Fe();break;case"Home":e.preventDefault(),U&&X(0);break;case"End":e.preventDefault(),U&&X(ge.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(U||Fe(),function(e){ne.current&&clearTimeout(ne.current);const t=ee+e.toLowerCase();te(t);const n=ge.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&X(n),ne.current=setTimeout(()=>te(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:y&&q.length>0?`4px ${ae.px}`:`${ae.py} ${ae.px}`,fontSize:ae.fontSize,fontFamily:"inherit",backgroundColor:A.surface,color:q.length>0?A.text:A.textMuted,border:`1.5px solid ${je}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:s?"not-allowed":"pointer",outline:"none",minHeight:"sm"===a?34:"lg"===a?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[/* @__PURE__ */f("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:y&&Ne.length>0?Ne.map(e=>/* @__PURE__ */p("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${ae.tagPy} ${ae.tagPx}`,fontSize:`calc(${ae.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${A.primary}22`,color:A.primary,borderRadius:6,border:`1px solid ${A.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[/* @__PURE__ */f("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:B(e.label)}),/* @__PURE__ */f("span",{role:"button","aria-label":`Remove ${B(e.label)}`,tabIndex:-1,onClick:t=>ze(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:/* @__PURE__ */f("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!y&&q.length>0?(()=>{const t=e.find(e=>e.value===q[0]);/* @__PURE__ */
|
|
11
11
|
return p("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&/* @__PURE__ */f("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?B(t.label):""]})})():/* @__PURE__ */f("span",{style:{opacity:.6},children:B(I)})}),/* @__PURE__ */p("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:A.textMuted},children:[k&&/* @__PURE__ */f(gt,{size:ae.iconSize,color:A.primary}),We&&!k&&/* @__PURE__ */f("span",{role:"button","aria-label":T.clearSelection,tabIndex:-1,onClick:Ce,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:/* @__PURE__ */f("svg",{width:ae.iconSize,height:ae.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M18 6L6 18M6 6l12 12"})})}),
|
|
12
|
-
/* @__PURE__ */f("svg",{width:ae.iconSize,height:ae.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:U?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:/* @__PURE__ */f("path",{d:"M6 9l6 6 6-6"})})]})]})}),x&&!se&&/* @__PURE__ */f("span",{id:V,style:{fontSize:"12px",color:A.textMuted,fontFamily:"inherit"},children:B(x)}),se&&b&&/* @__PURE__ */p("span",{id:E,role:"alert",style:{fontSize:"12px",color:A.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[/* @__PURE__ */f("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */f("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(b)]}),Ie]})}xt.displayName="TkxSelect";var bt={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},yt=n(({label:e,hint:t,isInvalid:n,errorMessage:r,isIndeterminate:o=!1,size:a="md",colorScheme:s="primary",checked:u,defaultChecked:h,onChange:m,disabled:g,className:x,style:b,id:w,...k},$)=>{const S=N(),
|
|
12
|
+
/* @__PURE__ */f("svg",{width:ae.iconSize,height:ae.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:U?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:/* @__PURE__ */f("path",{d:"M6 9l6 6 6-6"})})]})]})}),x&&!se&&/* @__PURE__ */f("span",{id:V,style:{fontSize:"12px",color:A.textMuted,fontFamily:"inherit"},children:B(x)}),se&&b&&/* @__PURE__ */p("span",{id:E,role:"alert",style:{fontSize:"12px",color:A.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[/* @__PURE__ */f("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */f("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(b)]}),Ie]})}xt.displayName="TkxSelect";var bt={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},yt=n(({label:e,hint:t,isInvalid:n,errorMessage:r,isIndeterminate:o=!1,size:a="md",colorScheme:s="primary",checked:u,defaultChecked:h,onChange:m,disabled:g,className:x,style:b,id:w,...k},$)=>{const S=N(),D=v(),z=l(),C=w??z,M=`${C}-hint`,F=`${C}-error`,j=c(null),[A,T]=d(!1),I=bt[a],W=n||!!r,O={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[s]??S.primary,L=void 0!==u?u:void 0;i(()=>{const e=$?.current??j.current;e&&(e.indeterminate=o)},[o,$]);const R=o||(L??!1),V=R?O:S.surface,E=W?S.danger:R?O:S.border,H=y(O),P=A?{outline:`2px solid ${O}`,outlineOffset:"2px"}:{},Y=[t&&M,W&&F].filter(Boolean).join(" ")||void 0,q=!D&&R?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};/* @__PURE__ */
|
|
13
13
|
return p("div",{className:He(Ve("flex flex-col gap-1"),x),style:{opacity:g?.5:1,...b},children:[
|
|
14
14
|
/* @__PURE__ */f("style",{children:"\n @keyframes tkx-check-scale-in {\n from { transform: scale(0.4); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n }\n "}),
|
|
15
15
|
/* @__PURE__ */p("label",{htmlFor:C,className:Ve("flex items-center gap-2 select-none"),style:{cursor:g?"not-allowed":"pointer",fontFamily:"inherit"},children:[
|
|
16
16
|
/* @__PURE__ */f("input",{ref:e=>{j.current=e,"function"==typeof $?$(e):$&&($.current=e)},id:C,type:"checkbox",checked:u,defaultChecked:h,onChange:m,disabled:g,"aria-invalid":W,"aria-describedby":Y,onFocus:e=>{e.target.matches(":focus-visible")&&T(!0)},onBlur:()=>T(!1),className:Ve("sr-only"),...k}),
|
|
17
|
-
/* @__PURE__ */f("span",{"aria-hidden":"true",style:{width:I.box,height:I.box,minWidth:I.box,borderRadius:"4px",border:`2px solid ${E}`,backgroundColor:V,display:"flex",alignItems:"center",justifyContent:"center",transition:
|
|
18
|
-
return p("div",{className:He(Ve("inline-flex items-center gap-2",i?"opacity-50":""),a),style:s,children:[!o&&/* @__PURE__ */f("label",{htmlFor:m,className:Ve("text-sm font-sans",i?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:u.text},children:n}),/* @__PURE__ */f("button",{ref:d,id:m,role:"switch","aria-checked":e,"aria-label":o?n:void 0,disabled:i,onClick:()=>!i&&t(!e),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||i||(n.preventDefault(),t(!e))},className:He(Ve("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",i?"cursor-not-allowed":"cursor-pointer",!h&&"transition-colors duration-200")),style:{width:g,height:x,borderRadius:x,backgroundColor:k},...c,children:/* @__PURE__ */f("span",{"aria-hidden":"true",className:Ve("absolute rounded-full"),style:{top:"50%",left:w,width:b,height:b,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:h?"none":"left 200ms ease"}})})]})});vt.displayName="TkxToggle";var kt=t(null),$t={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},St=n(({label:e,hint:t,size:n="md",colorScheme:r="primary",value:i,checked:a,onChange:s,disabled:c,name:d,className:u,style:h,id:m,...g},x)=>{const b=N(),w=v(),k=l(),$=m??k,S=o(kt),
|
|
19
|
-
return p("div",{className:He(Ve("flex flex-col gap-0.5"),u),style:{opacity:
|
|
17
|
+
/* @__PURE__ */f("span",{"aria-hidden":"true",style:{width:I.box,height:I.box,minWidth:I.box,borderRadius:"4px",border:`2px solid ${E}`,backgroundColor:V,display:"flex",alignItems:"center",justifyContent:"center",transition:D?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...P},children:o?/* @__PURE__ */f("span",{"aria-hidden":"true",style:{display:"block",width:.5*I.box,height:2,backgroundColor:H,borderRadius:"1px",...q}}):R?/* @__PURE__ */f("svg",{width:.6*I.box,height:.6*I.box,viewBox:"0 0 24 24",fill:"none",stroke:H,strokeWidth:I.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:q,children:/* @__PURE__ */f("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&/* @__PURE__ */f("span",{style:{fontSize:I.fontSize,color:S.text,lineHeight:1.4},children:"string"==typeof e?B(e):e})]}),t&&!W&&/* @__PURE__ */f("span",{id:M,className:Ve("text-xs ml-7"),style:{color:S.textMuted,marginLeft:I.box+8},children:B(t)}),W&&r&&/* @__PURE__ */p("span",{id:F,role:"alert",className:Ve("text-xs flex items-center gap-1"),style:{color:S.danger,marginLeft:I.box+8},children:[/* @__PURE__ */f("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */f("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(r)]})]})});yt.displayName="TkxCheckbox";var wt={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}},vt=n(({checked:e,onChange:t,label:n,size:r="md",hideLabel:o,disabled:i,className:a,style:s,...c},d)=>{const u=N(),h=v(),m=l();!function(e){const t=[];for(const[n,r]of Object.entries({label:{type:"string",required:!0},checked:{type:"boolean",required:!0}})){const o=e[n],i=null==o;r.required&&i?t.push(`prop '${n}' is required`):i||(typeof o===r.type?("number"===r.type&&"number"==typeof o&&(void 0!==r.min&&o<r.min&&t.push(`prop '${n}' must be >= ${r.min}`),void 0!==r.max&&o>r.max&&t.push(`prop '${n}' must be <= ${r.max}`)),"string"===r.type&&"string"==typeof o&&r.pattern&&!r.pattern.test(o)&&t.push(`prop '${n}' does not match pattern ${r.pattern}`),r.enum&&!r.enum.includes(o)&&t.push(`prop '${n}' must be one of: ${r.enum.join(", ")}`)):t.push(`prop '${n}' must be of type ${r.type}, got ${typeof o}`))}t.length}({label:n,checked:e});const{tw:g,th:x,td:b,gap:y}=wt[r],w=e?g-b-y:y,k=e?u.primary:u.border;/* @__PURE__ */
|
|
18
|
+
return p("div",{className:He(Ve("inline-flex items-center gap-2",i?"opacity-50":""),a),style:s,children:[!o&&/* @__PURE__ */f("label",{htmlFor:m,className:Ve("text-sm font-sans",i?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:u.text},children:n}),/* @__PURE__ */f("button",{ref:d,id:m,role:"switch","aria-checked":e,"aria-label":o?n:void 0,disabled:i,onClick:()=>!i&&t(!e),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||i||(n.preventDefault(),t(!e))},className:He(Ve("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",i?"cursor-not-allowed":"cursor-pointer",!h&&"transition-colors duration-200")),style:{width:g,height:x,borderRadius:x,backgroundColor:k},...c,children:/* @__PURE__ */f("span",{"aria-hidden":"true",className:Ve("absolute rounded-full"),style:{top:"50%",left:w,width:b,height:b,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:h?"none":"left 200ms ease"}})})]})});vt.displayName="TkxToggle";var kt=t(null),$t={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},St=n(({label:e,hint:t,size:n="md",colorScheme:r="primary",value:i,checked:a,onChange:s,disabled:c,name:d,className:u,style:h,id:m,...g},x)=>{const b=N(),w=v(),k=l(),$=m??k,S=o(kt),D=S?S.value===String(i??""):a??!1,z=c??S?.isDisabled??!1,C=d??S?.name??"",M=$t[n],F={primary:b.primary,success:b.success,danger:b.danger}[r]??b.primary;y(F);const j=D?F:b.border,A=b.surface;/* @__PURE__ */
|
|
19
|
+
return p("div",{className:He(Ve("flex flex-col gap-0.5"),u),style:{opacity:z?.5:1,...h},children:[
|
|
20
20
|
/* @__PURE__ */f("style",{children:"\n @keyframes tkx-radio-dot-in {\n from { transform: scale(0) translate(-50%, -50%); opacity: 0; }\n to { transform: scale(1) translate(-50%, -50%); opacity: 1; }\n }\n "}),
|
|
21
|
-
/* @__PURE__ */p("label",{htmlFor:$,className:Ve("flex items-center gap-2 select-none"),style:{cursor:
|
|
22
|
-
/* @__PURE__ */f("input",{ref:x,id:$,type:"radio",name:C,value:i,checked:
|
|
23
|
-
/* @__PURE__ */f("span",{"aria-hidden":"true",style:{position:"relative",width:M.outer,height:M.outer,minWidth:M.outer,borderRadius:"50%",border:`2px solid ${j}`,backgroundColor:A,display:"inline-block",boxSizing:"border-box",transition:w?"none":"border-color 120ms"},children:
|
|
24
|
-
return f("button",{type:"button","aria-label":v?h:m,disabled:t,onMouseDown:y,onMouseUp:w,onMouseLeave:w,onTouchStart:e=>{e.preventDefault(),y()},onTouchEnd:w,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:v?void 0:`1px solid ${a}`,borderLeft:v?`1px solid ${a}`:void 0,cursor:t?"not-allowed":"pointer",color:t?s:l,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${l}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:v?/* @__PURE__ */p("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */f("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */f("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */f("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */f("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function Ft({value:e,defaultValue:t=0,onChange:n,min:o,max:i,step:a=1,precision:s,prefix:c,suffix:u,format:h,currency:m,locale:g,clampOnBlur:x=!0,allowMouseWheel:b=!1,size:y="md",label:w,hint:v,isDisabled:k=!1,isReadOnly:$=!1,isInvalid:S=!1,errorMessage:
|
|
21
|
+
/* @__PURE__ */p("label",{htmlFor:$,className:Ve("flex items-center gap-2 select-none"),style:{cursor:z?"not-allowed":"pointer",fontFamily:"inherit"},children:[
|
|
22
|
+
/* @__PURE__ */f("input",{ref:x,id:$,type:"radio",name:C,value:i,checked:D,onChange:()=>{z||(S?S.onChange(String(i??"")):s?.({target:{value:String(i??"")}}))},disabled:z,"aria-invalid":S?.isInvalid,className:Ve("sr-only"),...g}),
|
|
23
|
+
/* @__PURE__ */f("span",{"aria-hidden":"true",style:{position:"relative",width:M.outer,height:M.outer,minWidth:M.outer,borderRadius:"50%",border:`2px solid ${j}`,backgroundColor:A,display:"inline-block",boxSizing:"border-box",transition:w?"none":"border-color 120ms"},children:D&&/* @__PURE__ */f("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:M.inner,height:M.inner,borderRadius:"50%",backgroundColor:F,transform:"translate(-50%, -50%)",transformOrigin:"center",...w?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&/* @__PURE__ */f("span",{style:{fontSize:M.fontSize,color:b.text,lineHeight:1.4},children:"string"==typeof e?B(e):e})]}),t&&/* @__PURE__ */f("span",{className:Ve("text-xs"),style:{color:b.textMuted,marginLeft:M.outer+8},children:B(t)})]})});St.displayName="TkxRadio";var Dt={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 zt(e,t,n){let r=e;return void 0!==t&&(r=Math.max(r,t)),void 0!==n&&(r=Math.min(r,n)),r}function Ct(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function Mt({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:l,borderColor:a,textMuted:s,iconSz:d,onStep:u,incrementLabel:h,decrementLabel:m}){const g=c(null),x=c(null),b="inc"===e?1:-1,y=r(()=>{u(b),g.current=setTimeout(()=>{x.current=setInterval(()=>u(b),60)},400)},[b,u]),w=r(()=>{g.current&&(clearTimeout(g.current),g.current=null),x.current&&(clearInterval(x.current),x.current=null)},[]);i(()=>()=>w(),[w]);const v="inc"===e;/* @__PURE__ */
|
|
24
|
+
return f("button",{type:"button","aria-label":v?h:m,disabled:t,onMouseDown:y,onMouseUp:w,onMouseLeave:w,onTouchStart:e=>{e.preventDefault(),y()},onTouchEnd:w,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:v?void 0:`1px solid ${a}`,borderLeft:v?`1px solid ${a}`:void 0,cursor:t?"not-allowed":"pointer",color:t?s:l,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${l}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:v?/* @__PURE__ */p("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */f("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */f("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */f("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */f("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function Ft({value:e,defaultValue:t=0,onChange:n,min:o,max:i,step:a=1,precision:s,prefix:c,suffix:u,format:h,currency:m,locale:g,clampOnBlur:x=!0,allowMouseWheel:b=!1,size:y="md",label:w,hint:v,isDisabled:k=!1,isReadOnly:$=!1,isInvalid:S=!1,errorMessage:D,id:z,className:C,style:M}){const F=N(),j=W(),A=j.increment??"Increment",T=j.decrement??"Decrement",I=l(),O=z??I,L=`${O}-hint`,R=`${O}-error`,V=void 0!==e,[E,H]=d(t),P=V?e:E,[Y,q]=d(!1),[U,J]=d(""),_=Dt[y],Z=S||!!D,K=Z?F.danger:Y?F.primary:F.border,X=[v&&L,Z&&R].filter(Boolean).join(" ")||void 0,G=w?B(w):void 0,Q=v?B(v):void 0,ee=D?B(D):void 0,te=c?B(c):void 0,ne=u?B(u):void 0,oe=r(e=>{const t=Ct(e,s);V||H(t),n?.(t)},[V,n,s]),ie=r(e=>{k||$||oe(zt(Ct(P+e*a,s),o,i))},[k,$,P,a,s,o,i,oe]),le=Y?U:function(e,t,n,r,o){const i=r??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:o??2,maximumFractionDigits:o??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:o??0,maximumFractionDigits:o??0}).format(e/100):"decimal"===t||void 0!==o?new Intl.NumberFormat(i,{minimumFractionDigits:o??0,maximumFractionDigits:o??20}).format(e):String(e)}(P,h,m,g,s),ae=(te||ne)&&!Y;/* @__PURE__ */
|
|
25
25
|
return p("div",{className:He(Ve("flex flex-col gap-1 w-full"),C),style:M,children:[G&&/* @__PURE__ */f("label",{htmlFor:O,className:Ve("text-sm font-medium font-sans"),style:{color:F.text},children:G}),
|
|
26
26
|
/* @__PURE__ */p("div",{className:Ve("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${K}`,backgroundColor:k?F.surfaceAlt:F.surface,opacity:k?.65:1,height:_.height},children:[
|
|
27
27
|
/* @__PURE__ */f(Mt,{direction:"dec",isDisabled:k||$,btnW:_.btnW,height:_.height,primaryColor:F.primary,borderColor:F.border,textMuted:F.textMuted,iconSz:_.iconSz,onStep:ie,incrementLabel:A,decrementLabel:T}),
|
|
28
28
|
/* @__PURE__ */p("div",{className:Ve("relative flex-1 flex items-center overflow-hidden"),children:[ae&&te&&/* @__PURE__ */f("span",{style:{position:"absolute",left:_.px,fontSize:_.fontSize,color:F.textMuted,pointerEvents:"none",userSelect:"none"},children:te}),
|
|
29
|
-
/* @__PURE__ */f("input",{id:O,type:"text",inputMode:"decimal",value:Y?U:le,readOnly:$,disabled:k,"aria-invalid":Z,"aria-describedby":X,"aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":P,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:_.fontSize,fontFamily:"inherit",color:F.text,paddingLeft:ae&&te?`calc(${_.px} + 1.2em)`:_.px,paddingRight:ae&&ne?`calc(${_.px} + 1.2em)`:_.px,cursor:k?"not-allowed":$?"default":"text"},onFocus:()=>{q(!0),J(String(P))},onBlur:()=>{q(!1);const e=parseFloat(U);if(isNaN(e))return n?.(null),void J(String(P));let t=Ct(e,s);x&&(t=
|
|
29
|
+
/* @__PURE__ */f("input",{id:O,type:"text",inputMode:"decimal",value:Y?U:le,readOnly:$,disabled:k,"aria-invalid":Z,"aria-describedby":X,"aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":P,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:_.fontSize,fontFamily:"inherit",color:F.text,paddingLeft:ae&&te?`calc(${_.px} + 1.2em)`:_.px,paddingRight:ae&&ne?`calc(${_.px} + 1.2em)`:_.px,cursor:k?"not-allowed":$?"default":"text"},onFocus:()=>{q(!0),J(String(P))},onBlur:()=>{q(!1);const e=parseFloat(U);if(isNaN(e))return n?.(null),void J(String(P));let t=Ct(e,s);x&&(t=zt(t,o,i)),oe(t)},onChange:e=>{J(re(e.target.value))},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),ie(1)),"ArrowDown"===e.key&&(e.preventDefault(),ie(-1))},onWheel:e=>{b&&Y&&(e.preventDefault(),ie(e.deltaY<0?1:-1))}}),ae&&ne&&/* @__PURE__ */f("span",{style:{position:"absolute",right:_.px,fontSize:_.fontSize,color:F.textMuted,pointerEvents:"none",userSelect:"none"},children:ne})]}),
|
|
30
30
|
/* @__PURE__ */f(Mt,{direction:"inc",isDisabled:k||$,btnW:_.btnW,height:_.height,primaryColor:F.primary,borderColor:F.border,textMuted:F.textMuted,iconSz:_.iconSz,onStep:ie,incrementLabel:A,decrementLabel:T})]}),Q&&!ee&&/* @__PURE__ */f("span",{id:L,className:Ve("text-xs"),style:{color:F.textMuted},children:Q}),ee&&/* @__PURE__ */p("span",{id:R,role:"alert",className:Ve("text-xs flex items-center gap-1"),style:{color:F.danger},children:[/* @__PURE__ */f("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */f("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"})}),ee]})]})}Ft.displayName="TkxNumberInput";var jt=["Su","Mo","Tu","We","Th","Fr","Sa"],At=["January","February","March","April","May","June","July","August","September","October","November","December"],Tt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Nt(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function It(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Wt(e,t,n){return!(!t||!Nt(e,t))||!(!n||!Nt(e,n))}function Ot(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),r=t.slice(-2),o=e.getMonth()+1,i=String(o).padStart(2,"0"),l=Tt[e.getMonth()],a=At[e.getMonth()],s=e.getDate(),c=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,r).replace(/MMMM/g,a).replace(/MMM/g,l).replace(/MM/g,i).replace(/\bM\b/g,String(o)).replace(/DD/g,c).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function Lt(e,t){return new Date(e,t+1,0).getDate()}function Rt(e){return 10*Math.floor(e/10)}function Vt({values:e,selected:t,onSelect:n,label:r,theme:o,format:l}){const a=c([]),s=c(null);i(()=>{const e=a.current[t];e&&s.current&&e.scrollIntoView({block:"nearest"})},[t]);const d=l??(e=>String(e).padStart(2,"0"));/* @__PURE__ */
|
|
31
31
|
return p("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */f("div",{style:{fontSize:"11px",fontWeight:600,color:o.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:r}),/* @__PURE__ */f("div",{ref:s,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${o.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const r=e===t;/* @__PURE__ */
|
|
32
32
|
return f("button",{ref:t=>{a.current[e]=t},type:"button",onClick:()=>n(e),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:r?600:400,backgroundColor:r?o.primary:"transparent",color:r?o.bg:o.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:d(e)},e)})})]})}function Bt({year:e,month:t,today:n,mode:r,selectedDate:o,selectedRange:i,multiDates:l,hoverDate:a,focusedDate:s,isDateDisabled:c,onSelectDate:d,onHoverDate:u,onSetFocused:h,theme:m,locale:g}){const x=function(e,t){const n=new Date(e,t,1).getDay(),r=Lt(e,t),o=[],i=Lt(e,t-1);for(let a=n-1;a>=0;a--)o.push(new Date(e,t-1,i-a));for(let a=1;a<=r;a++)o.push(new Date(e,t,a));let l=1;for(;o.length<42;)o.push(new Date(e,t+1,l++));return o}(e,t);/* @__PURE__ */
|
|
33
|
-
return p("div",{children:[/* @__PURE__ */f("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:jt.map(e=>/* @__PURE__ */f("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:m.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */f("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:x.map((e,p)=>{const x=e.getMonth()===t,b=Nt(e,n),y=0===e.getDay()||6===e.getDay(),w=c(e),v="single"===r&&null!=o&&Nt(e,o),k="multiple"===r&&l.some(t=>Nt(t,e)),$="range"===r&&Wt(e,i[0],null),S="range"===r&&Wt(e,null,i[1]),
|
|
34
|
-
return f("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];
|
|
33
|
+
return p("div",{children:[/* @__PURE__ */f("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:jt.map(e=>/* @__PURE__ */f("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:m.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */f("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:x.map((e,p)=>{const x=e.getMonth()===t,b=Nt(e,n),y=0===e.getDay()||6===e.getDay(),w=c(e),v="single"===r&&null!=o&&Nt(e,o),k="multiple"===r&&l.some(t=>Nt(t,e)),$="range"===r&&Wt(e,i[0],null),S="range"===r&&Wt(e,null,i[1]),D=$||S,z="range"===r&&i[0]&&!i[1]&&a?a:i[1],C="range"===r&&function(e,t,n){if(!t||!n)return!1;const r=It(e).getTime(),o=It(t).getTime(),i=It(n).getTime();return r>Math.min(o,i)&&r<Math.max(o,i)}(e,i[0],z),M="range"===r&&i[0]&&!i[1]&&a&&Nt(e,a),F=v||k||D,j=null!=s&&Nt(e,s);let A="transparent",T=x?y?`${m.text}cc`:m.text:`${m.textMuted}60`,N="none",I=400;return F||M?(A=m.primary,T=m.bg,I=600):C&&(A=`${m.primary}18`),b&&!F&&(N=`2px solid ${m.primary}`,I=600),w&&(T=`${m.textMuted}50`),j&&!F&&(N=`2px solid ${m.secondary}`),/* @__PURE__ */f("button",{type:"button","aria-label":e.toLocaleDateString(g,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":F,"aria-disabled":w,disabled:w,onClick:()=>!w&&d(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:A,color:T,border:N,fontSize:"13px",fontWeight:I,cursor:w?"not-allowed":"pointer",opacity:w?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:w?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},p)})})]})}function Et({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:a,onMultiChange:m,mode:g="single",minDate:x,maxDate:b,disabledDates:y,locale:w="en-US",dateFormat:k,showTime:$=!1,timeValue:S,onTimeChange:D,showPresets:z=!1,customPresets:C,label:M,placeholder:F="MM/DD/YYYY",hint:j,isDisabled:A=!1,isInvalid:T=!1,errorMessage:I,numberOfMonths:O=1,id:L,className:R,style:V}){const E=N(),H=W(),P=l(),Y=L??P,q=v(),U=It(/* @__PURE__ */new Date),J=e=>e instanceof Date&&!Number.isNaN(e.getTime())?e:null,_=void 0!==e,[Z,K]=d(null),X=_?J(e):Z,G=void 0!==n,[Q,ee]=d([null,null]),te=G?(ne=n,Array.isArray(ne)?[J(ne[0]),J(ne[1])]:[null,null]):Q;var ne;const re=void 0!==a,[oe,ie]=d([]),le=re?(a??[]).filter(e=>e instanceof Date&&!Number.isNaN(e.getTime())):oe,[ae,se]=d("start"),ce="range"===g||"single"===g&&$,[de,ue]=d([null,null]),[fe,pe]=d(null),he=X??te[0]??U,[me,ge]=d(he.getFullYear()),[xe,be]=d(he.getMonth()),[ye,we]=d("day"),[ve,ke]=d({h:0,m:0}),$e=S??ve,[Se,De]=d(!1),[ze,Ce]=d(()=>{if("single"===g)return Ot(X,w,k);if("range"===g){const[e,t]=te;if(e&&t)return`${Ot(e,w,k)} – ${Ot(t,w,k)}`}return""}),[Me,Fe]=d(null),[je,Ae]=d(null),[Te,Ne]=d({top:0,left:0,flipUp:!1}),[,Ie]=s(e=>e+1,0),We=c(null),Oe=c(null),Le=c(null),Re=c(!1),Ve=z?420:$?480:360;i(()=>{if("single"===g)Ce(Ot(X,w,k));else if("range"===g){const[e,t]=te;Ce(e&&t?`${Ot(e,w,k)} – ${Ot(t,w,k)}`:e?Ot(e,w,k):"")}else"multiple"===g&&Ce(le.length>0?`${le.length} date${1!==le.length?"s":""} selected`:"")},[X,te,le,g,w,k]);const Be=r(()=>{We.current&&Ne(function(e,t){const n=e.getBoundingClientRect(),r=window.innerHeight,o=window.scrollY,i=window.scrollX,l=r-n.bottom<t+8&&n.top>t+8;return{top:l?o+n.top-t-4:o+n.bottom+4,left:i+n.left,flipUp:l}}(We.current,Ve))},[Ve]);i(()=>{if(Se)return Be(),window.addEventListener("scroll",Be,!0),window.addEventListener("resize",Be),()=>{window.removeEventListener("scroll",Be,!0),window.removeEventListener("resize",Be)}},[Se,Be]),i(()=>{if(!Se)return;const e=e=>{We.current?.contains(e.target)||Oe.current?.contains(e.target)||De(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[Se]),i(()=>{if(!Se)return;const e=e=>{"Escape"===e.key&&(De(!1),Re.current=!0,Le.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Se]);const Ee=r(e=>!!(x&&It(e)<It(x))||!!(b&&It(e)>It(b))||!!y&&("function"==typeof y?y(e):y.some(t=>Nt(t,e))),[x,b,y]),He=r(e=>{if(!Ee(e)){if("single"===g)ce?pe(e):(_||K(e),t?.(e),Ce(Ot(e,w,k)),De(!1));else if("range"===g)if("start"===ae){const t=[e,null];ue(t),G||ee(t),o?.(t),se("end")}else{const t=de[0]??te[0],n=t&&e<t?[e,t]:[t,e];ue(n),ce?se("start"):(G||ee(n),o?.(n),se("start"),De(!1))}else if("multiple"===g){const t=le.some(t=>Nt(t,e))?le.filter(t=>!Nt(t,e)):[...le,e];re||ie(t),m?.(t)}Ie()}},[g,Ee,_,G,re,t,o,m,ae,de,te,le,ce,w]),Pe=r(()=>{if("single"===g){const e=fe??X;_||K(e),t?.(e)}else"range"===g&&(G||ee(de),o?.(de));De(!1),se("start")},[g,fe,de,X,_,G,t,o]),Ye=r(()=>{pe(null),ue([null,null]),se("start"),De(!1)},[]),qe=C??function(e){const t={today:e?.today??"Today",yesterday:e?.yesterday??"Yesterday",last7:e?.last7Days??"Last 7 days",last30:e?.last30Days??"Last 30 days",last90:"Last 90 days",thisWeek:"This week",lastWeek:"Last week",thisMonth:e?.thisMonth??"This month",lastMonth:e?.lastMonth??"Last month"};return[{label:t.today,getValue:()=>{const e=It(/* @__PURE__ */new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=It(/* @__PURE__ */new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=It(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=It(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=It(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=It(/* @__PURE__ */new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());const n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:t.lastWeek,getValue:()=>{const e=It(/* @__PURE__ */new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);const n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:t.thisMonth,getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:t.lastMonth,getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=/* @__PURE__ */new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),3*t,1),new Date(e.getFullYear(),3*t+3,0)]}},{label:"Last quarter",getValue:()=>{const e=/* @__PURE__ */new Date,t=Math.floor(e.getMonth()/3),n=0===t?3:t-1,r=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(r,3*n,1),new Date(r,3*n+3,0)]}},{label:"This year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}(H),Ue=11===xe?0:xe+1,Je=11===xe?me+1:me,_e=O>=2,Ze=M?B(M):void 0,Ke=j?B(j):void 0,Xe=I?B(I):void 0,Ge=B(F),Qe="single"===g&&null!=X||"range"===g&&(null!=te[0]||null!=te[1])||"multiple"===g&&le.length>0,et="range"===g?ce?de:te:[null,null],tt=T?E.danger:Se?E.primary:E.border,nt=Array.from({length:24},(e,t)=>t),rt=Array.from({length:60},(e,t)=>t),ot=/* @__PURE__ */p("div",{ref:Oe,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ye)return;const t=Me??X??U;let n=null;if("ArrowRight"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if("ArrowLeft"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if("ArrowDown"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if("ArrowUp"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if("Enter"===e.key&&Me)return void He(Me);n&&(e.preventDefault(),Fe(n),n.getMonth()===xe&&n.getFullYear()===me||(be(n.getMonth()),ge(n.getFullYear())))},style:{position:"absolute",top:Te.top,left:Te.left,zIndex:9999,backgroundColor:E.surface,border:`1px solid ${E.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:_e?"580px":"300px",maxWidth:_e&&z?"780px":_e?"620px":z?"520px":"300px",opacity:Se?1:0,transform:Se?"translateY(0) scale(1)":Te.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:q?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[z&&"range"===g&&/* @__PURE__ */p("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${E.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[/* @__PURE__ */f("div",{style:{fontSize:"11px",fontWeight:600,color:E.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),qe.map(e=>{const[t,n]=e.getValue(),r=et[0]&&et[1]&&Nt(et[0],t)&&Nt(et[1],n);/* @__PURE__ */
|
|
34
|
+
return f("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];ue(r),G||ee(r),o?.(r),ge(t.getFullYear()),be(t.getMonth()),se("start"),ce||De(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:r?`${E.primary}20`:"transparent",color:r?E.primary:E.text,fontWeight:r?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${E.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),/* @__PURE__ */p("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[
|
|
35
35
|
/* @__PURE__ */p("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[
|
|
36
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"day"===
|
|
37
|
-
/* @__PURE__ */p("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===
|
|
38
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>
|
|
39
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>
|
|
40
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":"day"===
|
|
41
|
-
return f("button",{type:"button",onClick:()=>{
|
|
42
|
-
return f("button",{type:"button",onClick:()=>{
|
|
43
|
-
/* @__PURE__ */f(Vt,{values:
|
|
36
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"day"===ye?"Previous month":"month"===ye?"Previous year":"Previous decade",onClick:()=>{"day"===ye?(0===xe?(be(11),ge(e=>e-1)):be(e=>e-1),we("day")):ge("month"===ye?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:E.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */f("polyline",{points:"15 18 9 12 15 6"})})}),
|
|
37
|
+
/* @__PURE__ */p("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===ye&&/* @__PURE__ */p(u,{children:[
|
|
38
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>we("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:E.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:At[xe]}),
|
|
39
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>we("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:E.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:me}),_e&&/* @__PURE__ */p(u,{children:[/* @__PURE__ */f("span",{style:{color:E.textMuted,fontSize:"14px"},children:"–"}),/* @__PURE__ */p("span",{style:{fontSize:"14px",fontWeight:600,color:E.text},children:[At[Ue]," ",Je]})]})]}),"month"===ye&&/* @__PURE__ */f("button",{type:"button",onClick:()=>we("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:E.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:me}),"year"===ye&&/* @__PURE__ */p("span",{style:{fontSize:"14px",fontWeight:600,color:E.text},children:[Rt(me),"–",Rt(me)+9]})]}),
|
|
40
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":"day"===ye?"Next month":"month"===ye?"Next year":"Next decade",onClick:()=>{"day"===ye?(11===xe?(be(0),ge(e=>e+1)):be(e=>e+1),we("day")):ge("month"===ye?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:E.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */f("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===ye&&/* @__PURE__ */p("div",{style:{display:"flex",gap:"20px"},children:[/* @__PURE__ */f(Bt,{year:me,month:xe,today:U,mode:g,selectedDate:X,selectedRange:et,multiDates:le,hoverDate:je,focusedDate:Me,isDateDisabled:Ee,onSelectDate:He,onHoverDate:Ae,onSetFocused:Fe,theme:E,locale:w}),_e&&/* @__PURE__ */f(Bt,{year:Je,month:Ue,today:U,mode:g,selectedDate:X,selectedRange:et,multiDates:le,hoverDate:je,focusedDate:Me,isDateDisabled:Ee,onSelectDate:He,onHoverDate:Ae,onSetFocused:Fe,theme:E,locale:w})]}),"month"===ye&&/* @__PURE__ */f("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:Tt.map((e,t)=>{const n=t===xe;/* @__PURE__ */
|
|
41
|
+
return f("button",{type:"button",onClick:()=>{be(t),we("day")},style:{padding:"10px",borderRadius:"8px",border:t!==U.getMonth()||me!==U.getFullYear()||n?"none":`2px solid ${E.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?E.primary:"transparent",color:n?E.bg:E.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===ye&&/* @__PURE__ */f("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=Rt(me)-1+t,r=n===me,o=n===U.getFullYear(),i=0===t||11===t;/* @__PURE__ */
|
|
42
|
+
return f("button",{type:"button",onClick:()=>{ge(n),we("month")},style:{padding:"10px 6px",borderRadius:"8px",border:o&&!r?`2px solid ${E.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:r?600:400,backgroundColor:r?E.primary:"transparent",color:r?E.bg:i?E.textMuted:E.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),$&&"day"===ye&&/* @__PURE__ */p("div",{style:{borderTop:`1px solid ${E.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[
|
|
43
|
+
/* @__PURE__ */f(Vt,{values:nt,selected:$e.h,onSelect:e=>{S||ke(t=>({...t,h:e})),D?.({...$e,h:e})},label:"Hour",theme:E}),
|
|
44
44
|
/* @__PURE__ */f("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:E.textMuted},children:":"}),
|
|
45
|
-
/* @__PURE__ */f(Vt,{values:
|
|
46
|
-
/* @__PURE__ */p("div",{style:{borderTop:`1px solid ${E.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:
|
|
47
|
-
return p("div",{className:R,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...V},children:[
|
|
48
|
-
/* @__PURE__ */p("div",{ref:
|
|
45
|
+
/* @__PURE__ */f(Vt,{values:rt,selected:$e.m,onSelect:e=>{S||ke(t=>({...t,m:e})),D?.({...$e,m:e})},label:"Min",theme:E})]}),"multiple"===g&&"day"===ye&&le.length>0&&/* @__PURE__ */p("div",{style:{borderTop:`1px solid ${E.border}`,paddingTop:"8px",fontSize:"12px",color:E.textMuted,textAlign:"center"},children:[le.length," date",1!==le.length?"s":""," selected"]}),
|
|
46
|
+
/* @__PURE__ */p("div",{style:{borderTop:`1px solid ${E.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:ce?"space-between":"flex-start",gap:"8px"},children:[/* @__PURE__ */f("button",{type:"button",onClick:()=>{ge(U.getFullYear()),be(U.getMonth()),we("day"),He(U)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:E.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),ce&&/* @__PURE__ */p("div",{style:{display:"flex",gap:"6px"},children:[/* @__PURE__ */f("button",{type:"button",onClick:Ye,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${E.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:E.text,fontFamily:"inherit"},children:"Cancel"}),/* @__PURE__ */f("button",{type:"button",onClick:Pe,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:E.primary,color:E.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});/* @__PURE__ */
|
|
47
|
+
return p("div",{className:R,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...V},children:[Ze&&/* @__PURE__ */f("label",{htmlFor:Y,style:{fontSize:"13px",fontWeight:500,color:E.text,marginBottom:"2px"},children:Ze}),
|
|
48
|
+
/* @__PURE__ */p("div",{ref:We,style:{display:"flex",alignItems:"center",border:`1.5px solid ${tt}`,borderRadius:"8px",backgroundColor:E.surface,overflow:"hidden",transition:q?"none":"border-color 120ms ease",opacity:A?.5:1},children:[
|
|
49
49
|
/* @__PURE__ */f("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:E.textMuted,flexShrink:0},children:/* @__PURE__ */p("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
|
|
50
50
|
/* @__PURE__ */f("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),
|
|
51
51
|
/* @__PURE__ */f("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),
|
|
52
52
|
/* @__PURE__ */f("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),
|
|
53
53
|
/* @__PURE__ */f("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),
|
|
54
|
-
/* @__PURE__ */f("input",{ref:
|
|
55
|
-
/* @__PURE__ */f("button",{type:"button","aria-label":
|
|
54
|
+
/* @__PURE__ */f("input",{ref:Le,id:Y,type:"text",value:ze,placeholder:Ge,disabled:A,"aria-invalid":T,"aria-haspopup":"dialog","aria-expanded":Se,readOnly:"range"===g||"multiple"===g,onChange:e=>(e=>{if(Ce(e),"single"===g){const n=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,r]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(r,e-1,t);if(n.getMonth()===e-1)return n}}const r=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(r){const[,e,t,n]=r.map(Number),o=new Date(e,t-1,n);if(o.getMonth()===t-1)return o}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,r]=t.map(Number),o=new Date(r,n-1,e);if(o.getMonth()===n-1)return o}}return null}(e,k);n&&!Ee(n)&&(_||K(n),t?.(n),ge(n.getFullYear()),be(n.getMonth()))}})(e.target.value),onFocus:()=>{A||(Re.current?Re.current=!1:De(!0))},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:E.text,cursor:"single"!==g?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Qe&&!A&&/* @__PURE__ */f("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===g)_||K(null),t?.(null),Ce("");else if("range"===g){const e=[null,null];G||ee(e),o?.(e),ue(e),Ce(""),se("start")}else"multiple"===g&&(re||ie([]),m?.([]),Ce(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:E.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:/* @__PURE__ */p("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:[/* @__PURE__ */f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),
|
|
55
|
+
/* @__PURE__ */f("button",{type:"button","aria-label":Se?"Close calendar":"Open calendar",tabIndex:-1,disabled:A,onClick:()=>{A||De(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:A?"not-allowed":"pointer",color:E.textMuted,flexShrink:0},children:/* @__PURE__ */f("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:Se?"rotate(180deg)":"rotate(0deg)",transition:q?"none":"transform 160ms ease"},children:/* @__PURE__ */f("polyline",{points:"6 9 12 15 18 9"})})})]}),Ke&&!T&&/* @__PURE__ */f("span",{style:{fontSize:"12px",color:E.textMuted},children:Ke}),T&&Xe&&/* @__PURE__ */f("span",{role:"alert",style:{fontSize:"12px",color:E.danger},children:Xe}),Se&&"undefined"!=typeof document&&h(ot,document.body)]})}function Ht(e){const{Controller:t}=e;return{TkxRHFInput:({name:e,control:n,rules:r,defaultValue:o,...i})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o??"",render:({field:e,fieldState:t})=>/* @__PURE__ */f(pt,{...i,name:e.name,value:e.value??"",onChange:t=>e.onChange(t.target.value),onBlur:e.onBlur,ref:e.ref,error:t.error?.message})}),TkxRHFSelect:({name:e,control:n,rules:r,defaultValue:o,...i})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o??"",render:({field:e,fieldState:t})=>/* @__PURE__ */f(xt,{...i,value:e.value,onChange:t=>e.onChange(t),errorMessage:t.error?.message})}),TkxRHFCheckbox:({name:e,control:n,rules:r,defaultValue:o,...i})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o??!1,render:({field:e,fieldState:t})=>/* @__PURE__ */f(yt,{...i,name:e.name,checked:Boolean(e.value),onChange:t=>e.onChange(t.target.checked),onBlur:e.onBlur,ref:e.ref,errorMessage:t.error?.message})}),TkxRHFToggle:({name:e,control:n,rules:r,defaultValue:o,...i})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o??!1,render:({field:e})=>/* @__PURE__ */f(vt,{...i,checked:Boolean(e.value),onChange:t=>e.onChange(t),onBlur:e.onBlur,ref:e.ref})}),TkxRHFRadio:({name:e,control:n,rules:r,defaultValue:o,value:i,...l})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o??"",render:({field:e})=>/* @__PURE__ */f(St,{...l,name:e.name,value:i,checked:String(e.value??"")===String(i??""),onChange:()=>e.onChange(i),onBlur:e.onBlur,ref:e.ref})}),TkxRHFNumberInput:({name:e,control:n,rules:r,defaultValue:o,...i})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o,render:({field:e,fieldState:t})=>/* @__PURE__ */f(Ft,{...i,value:e.value??void 0,onChange:t=>e.onChange(t),errorMessage:t.error?.message})}),TkxRHFDatePicker:({name:e,control:n,rules:r,defaultValue:o,...i})=>/* @__PURE__ */f(t,{name:e,control:n,rules:r,defaultValue:o??null,render:({field:e})=>/* @__PURE__ */f(Et,{...i,value:e.value??null,onChange:t=>e.onChange(t)})})}}Et.displayName="TkxDatePicker";export{Y as audit,oe as buildTkxCSP,g as contrastRatio,Ht as createRHFBindings,ae as createRateLimiter,M as cssVar,He as cx,Be as extractAtomicCSS,F as extractCSS,q as getAuditLog,A as injectStyles,ie as installTrustedTypes,le as isFramed,x as meetsAA,b as meetsAAA,Ee as resetAtomicCSS,j as resetStyles,te as sanitizeJSON,E as sanitizeProps,B as sanitizeString,re as sanitizeUnicode,de as scrubPII,R as sha256Hex,se as sniffMimeType,Ue as tkxListPlugins,Ye as tkxPlugin,qe as tkxRemovePlugin,S as useAnnounce,z as useClickOutside,nt as useControllable,et as useDebounce,Ke as useDisclosure,D as useEscapeKey,$ as useFocusTrap,Ge as useFormState,ft as useFormWithValibot,dt as useFormWithZod,k as useHighContrast,st as useInfiniteQuery,it as useIntersectionObserver,Qe as useListSelection,ot as useLocalStorage,rt as useMediaQuery,v as useReducedMotion,Xe as useRovingTabIndex,at as useSSE,tt as useThrottle,_e as useTkxForm,lt as useWebSocket,ut as valibotResolver,U as verifyAuditIntegrity,ct as zodResolver};
|