tekivex-ui 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/chunk-Bze40nDX.js +1 -0
- package/dist/chunk-DTO-RrPx.js +3 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +44 -37
- package/dist/src/components/TkxHolographic.d.ts +37 -0
- package/package.json +8 -11
- package/dist/chunk-CDGrC2Wo.js +0 -3
- package/dist/chunk-VUD-TF9j.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as o,F as r,I as i,L as a,N as l,O as s,P as d,R as c,S as u,T as h,a as p,b as f,c as m,d as g,f as x,g as y,h as b,i as v,j as w,k,l as S,m as C,n as $,o as z,p as N,r as M,s as I,t as D,u as W,v as L,w as R,x as T,y as A}from"./chunk-DdHSYetV.js";import{A as B,C as F,D as E,E as j,O as H,S as P,T as O,_ as V,a as K,b as U,c as Y,d as X,f as q,g as
|
|
1
|
+
import{A as e,C as t,D as n,E as o,F as r,I as i,L as a,N as l,O as s,P as d,R as c,S as u,T as h,a as p,b as f,c as m,d as g,f as x,g as y,h as b,i as v,j as w,k,l as S,m as C,n as $,o as z,p as N,r as M,s as I,t as D,u as W,v as L,w as R,x as T,y as A}from"./chunk-DdHSYetV.js";import{A as B,C as F,D as E,E as j,O as H,S as P,T as O,_ as V,a as K,b as U,c as Y,d as X,f as q,g as Z,h as _,i as G,j as J,k as Q,l as ee,m as te,n as ne,o as oe,p as re,r as ie,s as ae,t as le,u as se,v as de,w as ce,x as ue,y as he}from"./chunk-DcVMayoM.js";import{a as pe,i as fe,n as me,o as ge,r as xe,t as ye}from"./chunk-BHX35YDv.js";import{I18nContext as be,LOCALES as ve,enUS as we,isRTL as ke,useDirection as Se,useI18n as Ce,useLocale as $e}from"./i18n.js";import{g as ze,h as Ne,m as Me}from"./chunk-DTO-RrPx.js";import Ie,{Children as De,cloneElement as We,createContext as Le,createElement as Re,forwardRef as Te,useCallback as Ae,useContext as Be,useEffect as Fe,useId as Ee,useImperativeHandle as je,useMemo as He,useReducer as Pe,useRef as Oe,useState as Ve}from"react";import{Fragment as Ke,jsx as Ue,jsxs as Ye}from"react/jsx-runtime";import{createPortal as Xe}from"react-dom";var qe={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Ze={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},_e={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},Ge={sm:14,md:16,lg:18,xl:20};function Je({size:e}){const t=Ge[e];/* @__PURE__ */
|
|
2
2
|
return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:K("animate-spin shrink-0"),children:[/* @__PURE__ */Ue("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),/* @__PURE__ */Ue("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var Qe=Te(({variant:e="solid",size:t="md",colorScheme:n="primary",isLoading:o=!1,loadingText:r,leftIcon:i,rightIcon:a,isFullWidth:l=!1,glow:s=!1,disabled:d,children:c,className:u,style:h,...p},f)=>{const m=N(),g=ge(),x=d||o,y={primary:m.primary,secondary:m.secondary,danger:m.danger,warning:m.warning,success:m.success}[n],b=A(y,["#ffffff","#000000",m.bg]),v="string"==typeof c?j(c):c,w=r?j(r):void 0,k="solid"===e?{backgroundColor:y,color:b,border:"none",boxShadow:s&&!g?`0 0 20px ${y}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:y,border:`2px solid ${y}`}:"ghost"===e?{backgroundColor:"transparent",color:y,border:"none"}:{backgroundColor:"transparent",color:y,border:"none",textDecoration:"underline"};/* @__PURE__ */
|
|
3
|
-
return Ue("button",{ref:f,"aria-busy":o,"aria-disabled":x,disabled:x,className:le(K("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",qe[t],
|
|
3
|
+
return Ue("button",{ref:f,"aria-busy":o,"aria-disabled":x,disabled:x,className:le(K("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",qe[t],Ze[t],_e[t],"link"!==e&&_e[t],l&&"w-full",x?"cursor-not-allowed opacity-60":"cursor-pointer",!g&&"transition-all duration-200","focus-visible:focus-ring"),u),style:{...k,...h},...p,children:/* @__PURE__ */Ye(Ke,o?{children:[/* @__PURE__ */Ue(Je,{size:t}),w??v]}:{children:[i&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:i}),v,a&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:a})]})})});Qe.displayName="TkxButton";var et={none:"",sm:"p-3",md:"p-5",lg:"p-7"},tt=Te(({variant:e="default",isHoverable:t,isClickable:n,padding:o="md",as:r,children:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=r??(n?"button":"div"),p={default:{backgroundColor:c.surface,border:`1px solid ${c.border}`},glass:{backgroundColor:`${c.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${c.border}55`,boxShadow:`0 4px 24px ${c.bg}40`},quantum:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.primary}33`,boxShadow:`0 0 24px ${c.primary}18`},elevated:{backgroundColor:c.surface,boxShadow:`0 4px 20px ${c.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${c.border}`}}[e];/* @__PURE__ */
|
|
4
4
|
return Ue(h,{ref:d,className:le("tkx-card",K("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",et[o],(t||n)&&!u&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default"),a),style:{color:c.text,...p,...l},...s,children:i})});function nt({title:e,subtitle:t,action:n,children:o,className:r,...i}){const a=N();/* @__PURE__ */
|
|
5
5
|
return Ye("div",{className:le(K("flex justify-between items-start mb-4"),r),...i,children:[/* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[e&&/* @__PURE__ */Ue("h3",{className:K("text-base font-semibold m-0"),style:{color:a.text},children:e}),t&&/* @__PURE__ */Ue("p",{className:K("text-sm mt-1 mb-0"),style:{color:a.textMuted},children:t}),o]}),n&&/* @__PURE__ */Ue("div",{className:K("ml-3 shrink-0"),children:n})]})}function ot({children:e,className:t,...n}){/* @__PURE__ */
|
|
6
6
|
return Ue("div",{className:le(K(""),t),...n,children:e})}function rt({children:e,className:t,style:n,...o}){const r=N();/* @__PURE__ */
|
|
@@ -37,7 +37,7 @@ return Ue("td",{style:{padding:`${P} ${O}`,color:v.text,borderRight:V},children:
|
|
|
37
37
|
/* @__PURE__ */Ue("hr",{className:K("flex-1 m-0 border-none"),style:{[c]:u}}),
|
|
38
38
|
/* @__PURE__ */Ue("span",{children:s}),
|
|
39
39
|
/* @__PURE__ */Ue("hr",{className:K("flex-1 m-0 border-none"),style:{[c]:u}})]}):/* @__PURE__ */Ue("hr",{ref:a,role:"separator","aria-orientation":e,className:le(K(d?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),o),style:{[c]:u,...r},...i})});Bt.displayName="TkxDivider";var Ft={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 Et(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function jt({size:e,color:t}){/* @__PURE__ */
|
|
40
|
-
return Ye("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__ */Ue("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */Ue("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function Ht({options:e,value:t,defaultValue:n,placeholder:o,size:r="md",isDisabled:i=!1,isInvalid:a=!1,label:l,hint:s,errorMessage:d,multiple:c=!1,searchable:u=!1,clearable:h=!1,isLoading:p=!1,onChange:f,renderOption:m,maxMenuHeight:g=280,virtualScroll:x,optionHeight:y=36,id:b,className:v,style:w}){const k=N(),S=$e(),C=o??S.selectPlaceholder,$=Ee(),z=b??$,M=`${z}-listbox`,I=`${z}-hint`,D=`${z}-error`,W=void 0!==t,[L,R]=Ve(Et(n)),T=W?Et(t):L,[A,B]=Ve(!1),[F,E]=Ve(""),[H,P]=Ve(-1),[O,V]=Ve(null),[U,Y]=Ve(""),X=Oe(null),q=Oe(null),
|
|
40
|
+
return Ye("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__ */Ue("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */Ue("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function Ht({options:e,value:t,defaultValue:n,placeholder:o,size:r="md",isDisabled:i=!1,isInvalid:a=!1,label:l,hint:s,errorMessage:d,multiple:c=!1,searchable:u=!1,clearable:h=!1,isLoading:p=!1,onChange:f,renderOption:m,maxMenuHeight:g=280,virtualScroll:x,optionHeight:y=36,id:b,className:v,style:w}){const k=N(),S=$e(),C=o??S.selectPlaceholder,$=Ee(),z=b??$,M=`${z}-listbox`,I=`${z}-hint`,D=`${z}-error`,W=void 0!==t,[L,R]=Ve(Et(n)),T=W?Et(t):L,[A,B]=Ve(!1),[F,E]=Ve(""),[H,P]=Ve(-1),[O,V]=Ve(null),[U,Y]=Ve(""),X=Oe(null),q=Oe(null),Z=Oe(null),_=Oe(null),G=Oe(null),J=Ft[r],Q=a||!!d,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Fe(()=>{if(!A)return void ne(0);const e=ee.current;if(!e)return;re(e.clientHeight);const t=new ResizeObserver(()=>{re(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[A]);const ae=u&&F?e.filter(e=>e.label.toLowerCase().includes(F.toLowerCase())):e,se=ae.filter(e=>!e.disabled),de=ae.some(e=>!!e.group),ce=(void 0!==x?x:ae.length>=100)&&!de,ue=ae.length*y,he=ce?Math.max(0,Math.floor(te/y)-8):0,pe=ce?Math.min(ae.length,Math.ceil((te+oe)/y)+8):ae.length,fe=ce?ae.slice(he,pe):ae,me=he*y,ge=ae.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),xe=Ae(e=>{let t;t=c?T.includes(e)?T.filter(t=>t!==e):[...T,e]:[e],W||R(t),f?.(c?t:t[0]??""),c||(B(!1),E(""),P(-1),q.current?.focus())},[W,c,f,T]),ye=Ae((e,t)=>{t.stopPropagation();const n=T.filter(t=>t!==e);W||R(n),f?.(c?n:n[0]??"")},[W,c,f,T]),be=Ae(e=>{e.stopPropagation(),W||R([]),f?.(c?[]:"")},[W,c,f]),ve=Ae(()=>{q.current&&A&&V(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight-n.bottom-6,r=n.top-6,i=o>=Math.min(t,200)||o>=r?"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}}(q.current,g))},[A,g]);function we(){if(i||p)return;B(!0);const e=se.findIndex(e=>T.includes(e.value));P(e>=0?e:0)}Fe(()=>{if(A)return ve(),window.addEventListener("scroll",ve,!0),window.addEventListener("resize",ve),()=>{window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",ve)}},[A,ve]),Fe(()=>{if(!A)return;const e=e=>{const t=e.target;q.current?.contains(t)||_.current?.contains(t)||(B(!1),E(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[A]),Fe(()=>{A&&u&&setTimeout(()=>Z.current?.focus(),0)},[A,u]),Fe(()=>{if(A&&!(H<0))if(ce&&ee.current){const e=H*y,t=e+y,n=ee.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(G.current?.querySelector(`[data-idx="${H}"]`))?.scrollIntoView({block:"nearest"})},[H,A,ce,y]);const ke=Q?k.danger:A?k.primary:k.border,Se=H>=0&&se[H]?`${z}-opt-${se[H].value}`:void 0,Ce=[s&&I,Q&&D].filter(Boolean).join(" ")||void 0,ze=T.map(t=>e.find(e=>e.value===t)).filter(Boolean),Ne=A&&O?Xe(/* @__PURE__ */Ye("div",{ref:_,role:"listbox",id:M,"aria-label":l?j(l):"Options","aria-multiselectable":c,style:{position:"absolute",top:O.top,left:O.left,width:O.width,zIndex:9999,backgroundColor:k.surface,border:`1.5px solid ${k.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:O.width,maxHeight:g,display:"flex",flexDirection:"column"},children:[u&&/* @__PURE__ */Ye("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${k.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ue("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ue("path",{d:"M21 21l-4.35-4.35"})]}),/* @__PURE__ */Ue("input",{ref:Z,type:"text",value:F,onChange:e=>{E(e.target.value),P(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),B(!1),E(""),q.current?.focus();break;case"ArrowDown":e.preventDefault(),P(e=>Math.min(e+1,se.length-1));break;case"ArrowUp":e.preventDefault(),P(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P(se.length-1);break;case"Enter":e.preventDefault(),H>=0&&se[H]&&xe(se[H].value)}},placeholder:`${S.search}…`,"aria-label":`${S.search} options`,style:{border:"none",outline:"none",background:"transparent",color:k.text,fontSize:J.fontSize,fontFamily:"inherit",width:"100%"}})]}),/* @__PURE__ */Ue("div",{ref:e=>{G.current=e,ee.current=e},onScroll:ce?ie:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:g-(u?48:0)},children:ce?/* @__PURE__ */Ye("div",{style:{height:ue,position:"relative"},children:[/* @__PURE__ */Ue("div",{style:{position:"absolute",top:me,left:0,right:0},children:fe.map(e=>{const t=se.indexOf(e),n=t===H,o=T.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ue("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.label)})]}),e.description&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.description)})]});/* @__PURE__ */
|
|
41
41
|
return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{height:y,boxSizing:"border-box",padding:`0 ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.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:[r,o&&!m&&/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===ae.length&&/* @__PURE__ */Ue("div",{style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:p?"Loading…":"No options found"})]}):/* @__PURE__ */Ye(Ke,{children:[Object.entries(ge).map(([e,t])=>/* @__PURE__ */Ye("div",{children:[e&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:k.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:k.surface,zIndex:1,borderBottom:`1px solid ${k.border}`},children:j(e)}),t.map(e=>{const t=se.indexOf(e),n=t===H,o=T.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ue("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.label)})]}),e.description&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.description)})]});/* @__PURE__ */
|
|
42
42
|
return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.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:[r,o&&!m&&/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===ae.length&&/* @__PURE__ */Ue("div",{style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center"},children:p?"Loading…":"No options found"})]})})]}),document.body):null,Me=h&&T.length>0&&!i&&!p;/* @__PURE__ */
|
|
43
43
|
return Ye("div",{className:le(K("flex flex-col gap-1 w-full"),v),style:w,children:[l&&/* @__PURE__ */Ue("label",{htmlFor:z,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:k.text,userSelect:"none"},children:j(l)}),
|
|
@@ -55,11 +55,11 @@ return Ye("div",{className:le(K("flex flex-col gap-0.5"),d),style:{opacity:v?.5:
|
|
|
55
55
|
/* @__PURE__ */Ue("input",{ref:p,id:x,type:"radio",name:w,value:r,checked:b,onChange:()=>{v||(y?y.onChange(String(r??"")):a?.({target:{value:String(r??"")}}))},disabled:v,"aria-invalid":y?.isInvalid,className:K("sr-only"),...h}),
|
|
56
56
|
/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{position:"relative",width:k.outer,height:k.outer,minWidth:k.outer,borderRadius:"50%",border:`2px solid ${C}`,backgroundColor:$,display:"inline-block",boxSizing:"border-box",transition:m?"none":"border-color 120ms"},children:b&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:k.inner,height:k.inner,borderRadius:"50%",backgroundColor:S,transform:"translate(-50%, -50%)",transformOrigin:"center",...m?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&/* @__PURE__ */Ue("span",{style:{fontSize:k.fontSize,color:f.text,lineHeight:1.4},children:"string"==typeof e?j(e):e})]}),t&&/* @__PURE__ */Ue("span",{className:K("text-xs"),style:{color:f.textMuted,marginLeft:k.outer+8},children:j(t)})]})});function Yt({name:e,value:t,defaultValue:n="",onChange:o,label:r,orientation:i="vertical",isDisabled:a=!1,isInvalid:l=!1,errorMessage:s,children:d}){const c=N(),u=`${Ee()}-error`,[h,p]=Ve(n),f=void 0!==t,m=f?t:h,g=l||!!s;/* @__PURE__ */
|
|
57
57
|
return Ue(Vt.Provider,{value:{name:e,value:m,onChange:e=>{f||p(e),o?.(e)},isDisabled:a,isInvalid:l},children:/* @__PURE__ */Ye("div",{role:"radiogroup","aria-label":r?j(r):void 0,"aria-describedby":g?u:void 0,"aria-invalid":g,children:[r&&/* @__PURE__ */Ue("div",{className:K("text-sm font-medium font-sans mb-2"),style:{color:c.text},children:j(r)}),
|
|
58
|
-
/* @__PURE__ */Ue("div",{className:K("horizontal"===i?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:d}),g&&s&&/* @__PURE__ */Ye("span",{id:u,role:"alert",className:K("text-xs flex items-center gap-1 mt-1"),style:{color:c.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),j(s)]})]})})}Ut.displayName="TkxRadio";var Xt=[],qt=[],
|
|
58
|
+
/* @__PURE__ */Ue("div",{className:K("horizontal"===i?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:d}),g&&s&&/* @__PURE__ */Ye("span",{id:u,role:"alert",className:K("text-xs flex items-center gap-1 mt-1"),style:{color:c.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),j(s)]})]})})}Ut.displayName="TkxRadio";var Xt=[],qt=[],Zt=/* @__PURE__ */new Set,_t=/* @__PURE__ */new Map;function Gt(){const e=[...qt];Zt.forEach(t=>t(e))}function Jt(e,t){0!==t&&_t.set(e,setTimeout(()=>Qt(e),t))}function Qt(e){clearTimeout(_t.get(e)),_t.delete(e);const t=qt.some(t=>t.id===e);if(qt=qt.filter(t=>t.id!==e),Xt=Xt.filter(t=>t.id!==e),t&&Xt.length>0&&qt.length<5){const e=Xt.shift();qt=[...qt,e],Jt(e.id,e.duration??4e3)}Gt()}function en(){return{toast:Ae(e=>function(e){const t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return qt.length<5?(qt=[...qt,n],Jt(t,n.duration)):Xt=[...Xt,n],Gt(),t}(e),[]),dismiss:Ae(e=>Qt(e),[]),dismissAll:Ae(()=>(_t.forEach(e=>clearTimeout(e)),_t.clear(),qt=[],Xt=[],void Gt()),[])}}var tn={default:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},nn={"top-right":{top:16,right:16,alignItems:"flex-end"},"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"}};function on(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function rn({toast:e,position:t,onDismiss:n,reduced:o}){const r=N(),i=$e(),a=Ee(),l={default:r.textMuted,success:r.success,danger:r.danger,warning:r.warning,info:r.info},s=e.variant??"default",d=l[s],c="danger"===s,u=e.title?j(e.title):void 0,h=e.description?j(e.description):void 0;/* @__PURE__ */
|
|
59
59
|
return Ye("div",{role:c?"alert":"status","aria-live":c?"assertive":"polite","aria-atomic":"true","aria-labelledby":u?a:void 0,className:K("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:r.surface,border:`1px solid ${d}55`,boxShadow:`0 8px 24px ${r.bg}cc`,color:r.text,...on(t,o)},children:[
|
|
60
60
|
/* @__PURE__ */Ue("span",{className:K("shrink-0 mt-[2px]"),style:{color:d},children:tn[s]}),
|
|
61
61
|
/* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[u&&/* @__PURE__ */Ue("p",{id:a,className:K("m-0 font-semibold text-sm leading-snug"),children:u}),h&&/* @__PURE__ */Ue("p",{className:K("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:r.textMuted},children:h}),e.action&&/* @__PURE__ */Ue("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:K("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:d},children:j(e.action.label)})]}),
|
|
62
|
-
/* @__PURE__ */Ue("button",{"aria-label":i.close,onClick:()=>n(e.id),className:K("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:r.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function an({position:e="top-right",children:t}){const[n,o]=Ve([...qt]),r=ge(),i=$e();Fe(()=>{o([...qt]);const e=e=>o([...e]);return
|
|
62
|
+
/* @__PURE__ */Ue("button",{"aria-label":i.close,onClick:()=>n(e.id),className:K("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:r.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function an({position:e="top-right",children:t}){const[n,o]=Ve([...qt]),r=ge(),i=$e();Fe(()=>{o([...qt]);const e=e=>o([...e]);return Zt.add(e),()=>{Zt.delete(e)}},[]);const a=e.startsWith("bottom"),l=nn[e],s=Oe(!1);if(Fe(()=>{if(!s.current&&"undefined"!=typeof document&&(s.current=!0,!document.getElementById("tkx-toast-kf"))){const e=document.createElement("style");e.id="tkx-toast-kf",e.textContent="\n @keyframes tkx-toast-slide-down {\n from { opacity: 0; transform: translateY(-16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-toast-slide-up {\n from { opacity: 0; transform: translateY(16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}},[]),"undefined"==typeof document)/* @__PURE__ */return Ue(Ke,{children:t});const d=a?[...n].reverse():n;/* @__PURE__ */
|
|
63
63
|
return Ye(Ke,{children:[t,Xe(/* @__PURE__ */Ue("div",{"aria-label":i.notifications??"Notifications",className:K("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(t=>/* @__PURE__ */Ue("div",{className:K("pointer-events-auto"),children:/* @__PURE__ */Ue(rn,{toast:t,position:e,onDismiss:Qt,reduced:r})},t.id))}),document.body)]})}var ln={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function sn({open:e,reduced:t,iconStyle:n,size:o,color:r}){const i=t?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return"chevron"===n?/* @__PURE__ */Ue("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:i,flexShrink:0},children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})}):/* @__PURE__ */Ye("svg","plus"===n?{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[/* @__PURE__ */Ue("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}:{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),/* @__PURE__ */Ue("polyline",{points:"12 5 19 12 12 19"})]})}function dn({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=Oe(null),a=Oe(null),l=Oe(e),s=Oe(!1);return Fe(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),Fe(()=>{if(l.current===e)return;l.current=e;const n=i.current,o=a.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(s.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}s.current=!0,n.style.overflow="hidden",e?(n.style.height="0px",n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${o.scrollHeight}px`})})):(n.style.height=`${o.scrollHeight}px`,n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height="0px"})}))}},[e,t]),/* @__PURE__ */Ue("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;s.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:/* @__PURE__ */Ue("div",{ref:a,children:n})})}function cn({items:e,multiple:t=!1,defaultOpen:n,value:o,onChange:r,variant:i="default",size:a="md",iconPosition:l="right",iconStyle:s="chevron",flush:d=!1,className:c,style:u}){const h=N(),p=ge(),f=Ee(),m=void 0!==o,g=e=>e?Array.isArray(e)?new Set(e):new Set([e]):/* @__PURE__ */new Set,[x,y]=Ve(()=>g(n)),b=m?g(o):x,v=Ae((e,n)=>{if(n)return;let i;if(!m)return void y(n=>{i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e));const o=[...i];return r?.(t?o:o[0]??""),i});{const n=g(o);i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e))}const a=[...i];r?.(t?a:a[0]??"")},[t,r,m,o]),w=ln[a],k=(e,t,n)=>{if(d)return{};switch(i){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${h.border}`};case"separated":return{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};default:return{}}},S="separated"===i;/* @__PURE__ */
|
|
64
64
|
return Ue("div",{className:K(c??""),style:{...d?{}:"bordered"===i?{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:S?"flex":void 0,flexDirection:S?"column":void 0,gap:S?"8px":void 0,...u},children:e.map((t,n)=>{const o=b.has(t.id),r=n===e.length-1,a=`${f}-trigger-${t.id}`,d=`${f}-panel-${t.id}`;/* @__PURE__ */
|
|
65
65
|
return Ye("div",{className:t.className,style:k(0,0,r),children:[/* @__PURE__ */Ye("button",{id:a,type:"button",role:"button","aria-expanded":o,"aria-controls":d,disabled:t.disabled,onClick:()=>v(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:w.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:w.fontSize,fontWeight:500,color:t.disabled?h.textMuted:h.text,opacity:t.disabled?.5:1,transition:p?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===i||"flush"===i?e?`${h.primary}10`:`${h.surfaceAlt}80`:e?`${h.primary}0d`:`${h.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${h.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${h.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:h.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===l&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ue(sn,{open:o,reduced:p,iconStyle:s,size:w.iconSize,color:o?h.primary:h.textMuted})}),
|
|
@@ -68,8 +68,8 @@ return Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"
|
|
|
68
68
|
/* @__PURE__ */Ue("div",{className:K("flex-1 overflow-y-auto px-5 py-4"),style:{color:d.text},children:i}),a&&/* @__PURE__ */Ue("div",{className:K("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${d.border}`},children:a})]})]}),document.body)}var gn=["Su","Mo","Tu","We","Th","Fr","Sa"],xn=["January","February","March","April","May","June","July","August","September","October","November","December"],yn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function bn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function vn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wn(e,t,n){return!(!t||!bn(e,t))||!(!n||!bn(e,n))}function kn(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),o=t.slice(-2),r=e.getMonth()+1,i=String(r).padStart(2,"0"),a=yn[e.getMonth()],l=xn[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,l).replace(/MMM/g,a).replace(/MM/g,i).replace(/\bM\b/g,String(r)).replace(/DD/g,d).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function Sn(e,t){return new Date(e,t+1,0).getDate()}function Cn(e){return 10*Math.floor(e/10)}function $n({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const a=Oe([]),l=Oe(null);Fe(()=>{const e=a.current[t];e&&l.current&&e.scrollIntoView({block:"nearest"})},[t]);const s=i??(e=>String(e).padStart(2,"0"));/* @__PURE__ */
|
|
69
69
|
return Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */Ue("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),/* @__PURE__ */Ue("div",{ref:l,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${r.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const o=e===t;/* @__PURE__ */
|
|
70
70
|
return Ue("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:o?600:400,backgroundColor:o?r.primary:"transparent",color:o?r.bg:r.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:s(e)},e)})})]})}function zn({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:a,hoverDate:l,focusedDate:s,isDateDisabled:d,onSelectDate:c,onHoverDate:u,onSetFocused:h,theme:p,locale:f}){const m=function(e,t){const n=new Date(e,t,1).getDay(),o=Sn(e,t),r=[],i=Sn(e,t-1);for(let l=n-1;l>=0;l--)r.push(new Date(e,t-1,i-l));for(let l=1;l<=o;l++)r.push(new Date(e,t,l));let a=1;for(;r.length<42;)r.push(new Date(e,t+1,a++));return r}(e,t);/* @__PURE__ */
|
|
71
|
-
return Ye("div",{children:[/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:gn.map(e=>/* @__PURE__ */Ue("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:p.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:m.map((e,m)=>{const g=e.getMonth()===t,x=bn(e,n),y=0===e.getDay()||6===e.getDay(),b=d(e),v="single"===o&&null!=r&&bn(e,r),w="multiple"===o&&a.some(t=>bn(t,e)),k="range"===o&&wn(e,i[0],null),S="range"===o&&wn(e,null,i[1]),C=k||S,$="range"===o&&i[0]&&!i[1]&&l?l:i[1],z="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=vn(e).getTime(),r=vn(t).getTime(),i=vn(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],$),N="range"===o&&i[0]&&!i[1]&&l&&bn(e,l),M=v||w||C,I=null!=s&&bn(e,s);let D="transparent",W=g?y?`${p.text}cc`:p.text:`${p.textMuted}60`,L="none",R=400;return M||N?(D=p.primary,W=p.bg,R=600):z&&(D=`${p.primary}18`),x&&!M&&(L=`2px solid ${p.primary}`,R=600),b&&(W=`${p.textMuted}50`),I&&!M&&(L=`2px solid ${p.secondary}`),/* @__PURE__ */Ue("button",{type:"button","aria-label":e.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":M,"aria-disabled":b,disabled:b,onClick:()=>!b&&c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:W,border:L,fontSize:"13px",fontWeight:R,cursor:b?"not-allowed":"pointer",opacity:b?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:b?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},m)})})]})}function Nn({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:r,onMultiChange:i,mode:a="single",minDate:l,maxDate:s,disabledDates:d,locale:c="en-US",dateFormat:u,showTime:h=!1,timeValue:p,onTimeChange:f,showPresets:m=!1,customPresets:g,label:x,placeholder:y="MM/DD/YYYY",hint:b,isDisabled:v=!1,isInvalid:w=!1,errorMessage:k,numberOfMonths:S=1,id:C,className:$,style:z}){const M=N(),I=$e(),D=Ee(),W=C??D,L=ge(),R=vn(/* @__PURE__ */new Date),T=void 0!==e,[A,B]=Ve(null),F=T?e??null:A,E=void 0!==n,[H,P]=Ve([null,null]),O=E?n:H,V=void 0!==r,[K,U]=Ve([]),Y=V?r:K,[X,q]=Ve("start"),
|
|
72
|
-
return Ue("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];G(r),E||P(r),o?.(r),ne(t.getFullYear()),re(t.getMonth()),q("start"),
|
|
71
|
+
return Ye("div",{children:[/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:gn.map(e=>/* @__PURE__ */Ue("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:p.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:m.map((e,m)=>{const g=e.getMonth()===t,x=bn(e,n),y=0===e.getDay()||6===e.getDay(),b=d(e),v="single"===o&&null!=r&&bn(e,r),w="multiple"===o&&a.some(t=>bn(t,e)),k="range"===o&&wn(e,i[0],null),S="range"===o&&wn(e,null,i[1]),C=k||S,$="range"===o&&i[0]&&!i[1]&&l?l:i[1],z="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=vn(e).getTime(),r=vn(t).getTime(),i=vn(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],$),N="range"===o&&i[0]&&!i[1]&&l&&bn(e,l),M=v||w||C,I=null!=s&&bn(e,s);let D="transparent",W=g?y?`${p.text}cc`:p.text:`${p.textMuted}60`,L="none",R=400;return M||N?(D=p.primary,W=p.bg,R=600):z&&(D=`${p.primary}18`),x&&!M&&(L=`2px solid ${p.primary}`,R=600),b&&(W=`${p.textMuted}50`),I&&!M&&(L=`2px solid ${p.secondary}`),/* @__PURE__ */Ue("button",{type:"button","aria-label":e.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":M,"aria-disabled":b,disabled:b,onClick:()=>!b&&c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:W,border:L,fontSize:"13px",fontWeight:R,cursor:b?"not-allowed":"pointer",opacity:b?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:b?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},m)})})]})}function Nn({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:r,onMultiChange:i,mode:a="single",minDate:l,maxDate:s,disabledDates:d,locale:c="en-US",dateFormat:u,showTime:h=!1,timeValue:p,onTimeChange:f,showPresets:m=!1,customPresets:g,label:x,placeholder:y="MM/DD/YYYY",hint:b,isDisabled:v=!1,isInvalid:w=!1,errorMessage:k,numberOfMonths:S=1,id:C,className:$,style:z}){const M=N(),I=$e(),D=Ee(),W=C??D,L=ge(),R=vn(/* @__PURE__ */new Date),T=void 0!==e,[A,B]=Ve(null),F=T?e??null:A,E=void 0!==n,[H,P]=Ve([null,null]),O=E?n:H,V=void 0!==r,[K,U]=Ve([]),Y=V?r:K,[X,q]=Ve("start"),Z="range"===a||"single"===a&&h,[_,G]=Ve([null,null]),[J,Q]=Ve(null),ee=F??O[0]??R,[te,ne]=Ve(ee.getFullYear()),[oe,re]=Ve(ee.getMonth()),[ie,ae]=Ve("day"),[le,se]=Ve({h:0,m:0}),de=p??le,[ce,ue]=Ve(!1),[he,pe]=Ve(()=>{if("single"===a)return kn(F,c,u);if("range"===a){const[e,t]=O;if(e&&t)return`${kn(e,c,u)} – ${kn(t,c,u)}`}return""}),[fe,me]=Ve(null),[xe,ye]=Ve(null),[be,ve]=Ve({top:0,left:0,flipUp:!1}),[,we]=Pe(e=>e+1,0),ke=Oe(null),Se=Oe(null),Ce=Oe(null),ze=m?420:h?480:360;Fe(()=>{if("single"===a)pe(kn(F,c,u));else if("range"===a){const[e,t]=O;pe(e&&t?`${kn(e,c,u)} – ${kn(t,c,u)}`:e?kn(e,c,u):"")}else"multiple"===a&&pe(Y.length>0?`${Y.length} date${1!==Y.length?"s":""} selected`:"")},[F,O,Y,a,c,u]);const Ne=Ae(()=>{ke.current&&ve(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,a=o-n.bottom<t+8&&n.top>t+8;return{top:a?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:a}}(ke.current,ze))},[ze]);Fe(()=>{if(ce)return Ne(),window.addEventListener("scroll",Ne,!0),window.addEventListener("resize",Ne),()=>{window.removeEventListener("scroll",Ne,!0),window.removeEventListener("resize",Ne)}},[ce,Ne]),Fe(()=>{if(!ce)return;const e=e=>{ke.current?.contains(e.target)||Se.current?.contains(e.target)||ue(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[ce]),Fe(()=>{if(!ce)return;const e=e=>{"Escape"===e.key&&(ue(!1),Ce.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ce]);const Me=Ae(e=>!!(l&&vn(e)<vn(l))||!!(s&&vn(e)>vn(s))||!!d&&("function"==typeof d?d(e):d.some(t=>bn(t,e))),[l,s,d]),Ie=Ae(e=>{if(!Me(e)){if("single"===a)Z?Q(e):(T||B(e),t?.(e),pe(kn(e,c,u)),ue(!1));else if("range"===a)if("start"===X){const t=[e,null];G(t),E||P(t),o?.(t),q("end")}else{const t=_[0]??O[0],n=t&&e<t?[e,t]:[t,e];G(n),Z?q("start"):(E||P(n),o?.(n),q("start"),ue(!1))}else if("multiple"===a){const t=Y.some(t=>bn(t,e))?Y.filter(t=>!bn(t,e)):[...Y,e];V||U(t),i?.(t)}we()}},[a,Me,T,E,V,t,o,i,X,_,O,Y,Z,c]),De=Ae(()=>{if("single"===a){const e=J??F;T||B(e),t?.(e)}else"range"===a&&(E||P(_),o?.(_));ue(!1),q("start")},[a,J,_,F,T,E,t,o]),We=Ae(()=>{Q(null),G([null,null]),q("start"),ue(!1)},[]),Le=g??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=vn(/* @__PURE__ */new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=vn(/* @__PURE__ */new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=vn(/* @__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=vn(/* @__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,o=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(o,3*n,1),new Date(o,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)]}}]}(I),Re=11===oe?0:oe+1,Te=11===oe?te+1:te,Be=S>=2,je=x?j(x):void 0,He=b?j(b):void 0,qe=k?j(k):void 0,Ze=j(y),_e="single"===a&&null!=F||"range"===a&&(null!=O[0]||null!=O[1])||"multiple"===a&&Y.length>0,Ge="range"===a?Z?_:O:[null,null],Je=w?M.danger:ce?M.primary:M.border,Qe=Array.from({length:24},(e,t)=>t),et=Array.from({length:60},(e,t)=>t),tt=/* @__PURE__ */Ye("div",{ref:Se,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ie)return;const t=fe??F??R;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&&fe)return void Ie(fe);n&&(e.preventDefault(),me(n),n.getMonth()===oe&&n.getFullYear()===te||(re(n.getMonth()),ne(n.getFullYear())))},style:{position:"absolute",top:be.top,left:be.left,zIndex:9999,backgroundColor:M.surface,border:`1px solid ${M.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:Be?"580px":"300px",maxWidth:Be&&m?"780px":Be?"620px":m?"520px":"300px",opacity:ce?1:0,transform:ce?"translateY(0) scale(1)":be.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:L?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[m&&"range"===a&&/* @__PURE__ */Ye("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${M.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[/* @__PURE__ */Ue("div",{style:{fontSize:"11px",fontWeight:600,color:M.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),Le.map(e=>{const[t,n]=e.getValue(),r=Ge[0]&&Ge[1]&&bn(Ge[0],t)&&bn(Ge[1],n);/* @__PURE__ */
|
|
72
|
+
return Ue("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];G(r),E||P(r),o?.(r),ne(t.getFullYear()),re(t.getMonth()),q("start"),Z||ue(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:r?`${M.primary}20`:"transparent",color:r?M.primary:M.text,fontWeight:r?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${M.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),/* @__PURE__ */Ye("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[
|
|
73
73
|
/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[
|
|
74
74
|
/* @__PURE__ */Ue("button",{type:"button","aria-label":"day"===ie?"Previous month":"month"===ie?"Previous year":"Previous decade",onClick:()=>{"day"===ie?(0===oe?(re(11),ne(e=>e-1)):re(e=>e-1),ae("day")):ne("month"===ie?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ue("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__ */Ue("polyline",{points:"15 18 9 12 15 6"})})}),
|
|
75
75
|
/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===ie&&/* @__PURE__ */Ye(Ke,{children:[
|
|
@@ -81,7 +81,7 @@ return Ue("button",{type:"button",onClick:()=>{ne(n),ae("month")},style:{padding
|
|
|
81
81
|
/* @__PURE__ */Ue($n,{values:Qe,selected:de.h,onSelect:e=>{p||se(t=>({...t,h:e})),f?.({...de,h:e})},label:"Hour",theme:M}),
|
|
82
82
|
/* @__PURE__ */Ue("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:M.textMuted},children:":"}),
|
|
83
83
|
/* @__PURE__ */Ue($n,{values:et,selected:de.m,onSelect:e=>{p||se(t=>({...t,m:e})),f?.({...de,m:e})},label:"Min",theme:M})]}),"multiple"===a&&"day"===ie&&Y.length>0&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"8px",fontSize:"12px",color:M.textMuted,textAlign:"center"},children:[Y.length," date",1!==Y.length?"s":""," selected"]}),
|
|
84
|
-
/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:
|
|
84
|
+
/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:Z?"space-between":"flex-start",gap:"8px"},children:[/* @__PURE__ */Ue("button",{type:"button",onClick:()=>{ne(R.getFullYear()),re(R.getMonth()),ae("day"),Ie(R)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:M.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),Z&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px"},children:[/* @__PURE__ */Ue("button",{type:"button",onClick:We,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${M.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:M.text,fontFamily:"inherit"},children:"Cancel"}),/* @__PURE__ */Ue("button",{type:"button",onClick:De,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:M.primary,color:M.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});/* @__PURE__ */
|
|
85
85
|
return Ye("div",{className:$,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...z},children:[je&&/* @__PURE__ */Ue("label",{htmlFor:W,style:{fontSize:"13px",fontWeight:500,color:M.text,marginBottom:"2px"},children:je}),
|
|
86
86
|
/* @__PURE__ */Ye("div",{ref:ke,style:{display:"flex",alignItems:"center",border:`1.5px solid ${Je}`,borderRadius:"8px",backgroundColor:M.surface,overflow:"hidden",transition:L?"none":"border-color 120ms ease",opacity:v?.5:1},children:[
|
|
87
87
|
/* @__PURE__ */Ue("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
|
|
@@ -89,12 +89,12 @@ return Ye("div",{className:$,style:{display:"flex",flexDirection:"column",gap:"4
|
|
|
89
89
|
/* @__PURE__ */Ue("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),
|
|
90
90
|
/* @__PURE__ */Ue("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),
|
|
91
91
|
/* @__PURE__ */Ue("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),
|
|
92
|
-
/* @__PURE__ */Ue("input",{ref:Ce,id:W,type:"text",value:he,placeholder:
|
|
92
|
+
/* @__PURE__ */Ue("input",{ref:Ce,id:W,type:"text",value:he,placeholder:Ze,disabled:v,"aria-invalid":w,"aria-haspopup":"dialog","aria-expanded":ce,readOnly:"range"===a||"multiple"===a,onChange:e=>(e=>{if(pe(e),"single"===a){const n=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,o]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(o,e-1,t);if(n.getMonth()===e-1)return n}}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const[,e,t,n]=o.map(Number),r=new Date(e,t-1,n);if(r.getMonth()===t-1)return r}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,o]=t.map(Number),r=new Date(o,n-1,e);if(r.getMonth()===n-1)return r}}return null}(e,u);n&&!Me(n)&&(T||B(n),t?.(n),ne(n.getFullYear()),re(n.getMonth()))}})(e.target.value),onFocus:()=>{v||ue(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:M.text,cursor:"single"!==a?"pointer":"text",fontFamily:"inherit",minWidth:0}}),_e&&!v&&/* @__PURE__ */Ue("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===a)T||B(null),t?.(null),pe("");else if("range"===a){const e=[null,null];E||P(e),o?.(e),G(e),pe(""),q("start")}else"multiple"===a&&(V||U([]),i?.([]),pe(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:/* @__PURE__ */Ye("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__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),
|
|
93
93
|
/* @__PURE__ */Ue("button",{type:"button","aria-label":ce?"Close calendar":"Open calendar",tabIndex:-1,disabled:v,onClick:()=>{v||ue(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:v?"not-allowed":"pointer",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ue("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:ce?"rotate(180deg)":"rotate(0deg)",transition:L?"none":"transform 160ms ease"},children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})})})]}),He&&!w&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:M.textMuted},children:He}),w&&qe&&/* @__PURE__ */Ue("span",{role:"alert",style:{fontSize:"12px",color:M.danger},children:qe}),ce&&"undefined"!=typeof document&&Xe(tt,document.body)]})}Nn.displayName="TkxDatePicker";var Mn={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function In(e,t,n){return Math.min(Math.max(e,t),n)}function Dn(e,t,n){return Math.round((e-t)/n)*n+t}function Wn(e,t,n){return(e-t)/(n-t)*100}function Ln({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:a,ariaLabel:l,tooltipMode:s,formatValue:d,orientation:c,onChange:u,onChangeEnd:h}){const[p,f]=Ve(!1),[m,g]=Ve(!1),[x,y]=Ve(!1),b="vertical"===c,v=Wn(e,t,n);/* @__PURE__ */
|
|
94
|
-
return Ye("div",{style:b?{position:"absolute",bottom:`${v}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${v}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},children:[("always"===s||"hover"===s&&(x||m||p))&&/* @__PURE__ */Ue("div",{style:b?{position:"absolute",left:a+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:a+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"},children:d(e)}),/* @__PURE__ */Ue("div",{role:"slider",tabIndex:r?-1:0,"aria-label":l,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":c,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),u(In(Dn(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),u(In(Dn(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),u(t)):"End"===i.key&&(i.preventDefault(),u(n)))},onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerEnter:()=>y(!0),onPointerLeave:()=>y(!1),onPointerDown:e=>{r||(g(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{g(!1),h?.()},style:{width:a,height:a,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:p?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Rn({value:e,defaultValue:t=0,onChange:n,rangeValue:o,onRangeChange:r,min:i=0,max:a=100,step:l=1,isRange:s=!1,label:d,showValue:c=!1,showTicks:u=!1,tickCount:h=5,isDisabled:p=!1,colorScheme:f="primary",size:m="md",marks:g,orientation:x="horizontal",showTooltip:y=!1,formatValue:b,onChangeEnd:v,onRangeChangeEnd:w,gradient:k=!1}){const S=N(),C=Ee(),$=ge(),z=void 0!==e,[M,I]=Ve(t),D=z?e:M,W=void 0!==o,[L,R]=Ve([i,a]),T=W?o:L,A=Oe(null),B=Oe(D);B.current=D;const F=Oe(T);F.current=T;const E={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[f],H=Mn[m],P="vertical"===x,O=!0===y?"hover":!1!==y&&y,V=b??(e=>String(e)),U=E+"66",Y=Ae((e,t)=>{const n=A.current;if(!n)return i;const o=n.getBoundingClientRect();let r;return r=In(P?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),In(Dn(r*(a-i)+i,i,l),i,a)},[i,a,l,P]),X=Ae(e=>{if(p)return;const t=Y(e.clientX,e.clientY);if(s){const[e,n]=T,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];W||R(o),r?.(o)}else z||I(t),n?.(t)},[p,s,z,W,Y,n,r,T]),q=s?Wn(T[0],i,a):0,
|
|
94
|
+
return Ye("div",{style:b?{position:"absolute",bottom:`${v}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${v}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},children:[("always"===s||"hover"===s&&(x||m||p))&&/* @__PURE__ */Ue("div",{style:b?{position:"absolute",left:a+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:a+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"},children:d(e)}),/* @__PURE__ */Ue("div",{role:"slider",tabIndex:r?-1:0,"aria-label":l,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":c,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),u(In(Dn(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),u(In(Dn(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),u(t)):"End"===i.key&&(i.preventDefault(),u(n)))},onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerEnter:()=>y(!0),onPointerLeave:()=>y(!1),onPointerDown:e=>{r||(g(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{g(!1),h?.()},style:{width:a,height:a,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:p?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Rn({value:e,defaultValue:t=0,onChange:n,rangeValue:o,onRangeChange:r,min:i=0,max:a=100,step:l=1,isRange:s=!1,label:d,showValue:c=!1,showTicks:u=!1,tickCount:h=5,isDisabled:p=!1,colorScheme:f="primary",size:m="md",marks:g,orientation:x="horizontal",showTooltip:y=!1,formatValue:b,onChangeEnd:v,onRangeChangeEnd:w,gradient:k=!1}){const S=N(),C=Ee(),$=ge(),z=void 0!==e,[M,I]=Ve(t),D=z?e:M,W=void 0!==o,[L,R]=Ve([i,a]),T=W?o:L,A=Oe(null),B=Oe(D);B.current=D;const F=Oe(T);F.current=T;const E={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[f],H=Mn[m],P="vertical"===x,O=!0===y?"hover":!1!==y&&y,V=b??(e=>String(e)),U=E+"66",Y=Ae((e,t)=>{const n=A.current;if(!n)return i;const o=n.getBoundingClientRect();let r;return r=In(P?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),In(Dn(r*(a-i)+i,i,l),i,a)},[i,a,l,P]),X=Ae(e=>{if(p)return;const t=Y(e.clientX,e.clientY);if(s){const[e,n]=T,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];W||R(o),r?.(o)}else z||I(t),n?.(t)},[p,s,z,W,Y,n,r,T]),q=s?Wn(T[0],i,a):0,Z=Wn(s?T[1]:D,i,a),_=u?Array.from({length:h},(e,t)=>i+t/(h-1)*(a-i)):[],G=d?j(d):void 0,J=$?"none":"background 150ms ease";/* @__PURE__ */
|
|
95
95
|
return Ye("div",{className:K("flex flex-col gap-2"),style:{opacity:p?.55:1,...P?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(G||c)&&/* @__PURE__ */Ye("div",{className:K("flex items-center justify-between"),children:[G&&/* @__PURE__ */Ue("label",{htmlFor:C,className:K("text-sm font-medium"),style:{color:S.text,fontSize:H.fontSize},children:G}),c&&!s&&/* @__PURE__ */Ue("span",{className:K("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:H.fontSize},children:V(D)}),c&&s&&/* @__PURE__ */Ye("span",{className:K("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:H.fontSize},children:[V(T[0])," – ",V(T[1])]})]}),
|
|
96
96
|
/* @__PURE__ */Ye("div",{style:{position:"relative",...P?{paddingLeft:H.thumb/2,paddingRight:H.thumb/2,flex:1}:{paddingTop:H.thumb/2,paddingBottom:H.thumb/2}},children:[/* @__PURE__ */Ye("div",{ref:A,onPointerDown:X,style:{position:"relative",...P?{width:H.track,height:"100%"}:{height:H.track},borderRadius:9999,backgroundColor:S.border,cursor:p?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[
|
|
97
|
-
/* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{left:0,bottom:`${q}%`,height:
|
|
97
|
+
/* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{left:0,bottom:`${q}%`,height:Z-q+"%",width:"100%"}:{top:0,left:`${q}%`,width:Z-q+"%",height:"100%"},borderRadius:9999,...p?{backgroundColor:S.textMuted}:k?{background:P?`linear-gradient(to top, ${U}, ${E})`:`linear-gradient(to right, ${U}, ${E})`}:{backgroundColor:E},transition:J}}),_.map((e,t)=>/* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{bottom:`${Wn(e,i,a)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:H.track+4}:{left:`${Wn(e,i,a)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:H.track+4},backgroundColor:S.surface,borderRadius:9999,pointerEvents:"none"}},t)),s?/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue(Ln,{value:T[0],min:i,max:T[1],step:l,isDisabled:p,trackColor:E,trackHeight:H.track,thumbSize:H.thumb,ariaLabel:`${G??"Range"} start`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[In(e,i,T[1]),T[1]];W||R(t),r?.(t)},onChangeEnd:w?()=>w(F.current):void 0}),/* @__PURE__ */Ue(Ln,{value:T[1],min:T[0],max:a,step:l,isDisabled:p,trackColor:E,trackHeight:H.track,thumbSize:H.thumb,ariaLabel:`${G??"Range"} end`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[T[0],In(e,T[0],a)];W||R(t),r?.(t)},onChangeEnd:w?()=>w(F.current):void 0})]}):/* @__PURE__ */Ue(Ln,{value:D,min:i,max:a,step:l,isDisabled:p,trackColor:E,trackHeight:H.track,thumbSize:H.thumb,ariaLabel:G??"Slider",tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{z||I(e),n?.(e)},onChangeEnd:v?()=>v(B.current):void 0})]}),g&&g.length>0&&/* @__PURE__ */Ue("div",{style:{position:P?"absolute":"relative",...P?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:g.map((e,t)=>/* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{bottom:`${Wn(e.value,i,a)}%`,transform:"translateY(50%)",left:0}:{left:`${Wn(e.value,i,a)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:S.textMuted,whiteSpace:"nowrap"},children:j(e.label)},t))})]}),u&&!g&&!P&&/* @__PURE__ */Ue("div",{style:{position:"relative",height:"1rem"},children:_.map((e,t)=>/* @__PURE__ */Ue("span",{style:{position:"absolute",left:`${Wn(e,i,a)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:S.textMuted},children:V(Math.round(e))},t))})]})}Rn.displayName="TkxSlider";var Tn={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function An({total:e,pageSize:t=10,page:n,defaultPage:o=1,onChange:r,siblingCount:i=1,showEdges:a=!0,showPageSize:l=!1,onPageSizeChange:s,pageSizeOptions:d=[10,25,50,100],size:c="md",variant:u="default"}){const h=N(),p=$e(),f=Ee(),m={pagination:"Pagination",firstPage:p.firstPage??"First page",lastPage:p.lastPage??"Last page",previousPage:p.previousPage??"Previous page",nextPage:p.nextPage??"Next page",pageN:e=>`Page ${e}`,showing:(e,t,n)=>p.showingRange?p.showingRange(e,t,n):`Showing ${e}–${t} of ${n} items`},g=void 0!==n,[x,y]=Ve(o),b=g?n:x,[v,w]=Ve(t),k=t,S=Math.max(1,Math.ceil(e/k)),C=e=>{const t=Math.min(Math.max(e,1),S);t!==b&&(g||y(t),r?.(t))},$=function(e,t,n,o){if(t<=1)return[1];const r=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),i=Math.max(e-n,1),a=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,a)),a<t&&e.push("..."),e}const l=i>3,s=a<t-2,d=[];d.push(1),l?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(a,t-1))),s?d.push("right-ellipsis"):d.push(...r(a+1,t-1)),t>1&&d.push(t);const c=/* @__PURE__ */new Set,u=[];for(const h of d)"number"==typeof h?c.has(h)||(c.add(h),u.push(h)):u.push(h);return u}(b,S,i,a),z=Tn[c],M=Math.min((b-1)*k+1,e),I=Math.min(b*k,e),D=(e,t)=>{const n={height:z.height,minWidth:z.minWidth,paddingLeft:z.px,paddingRight:z.px,fontSize:z.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:t?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:t?.4:1};return e?{...n,backgroundColor:h.primary,color:h.bg,fontWeight:600,boxShadow:`0 0 0 2px ${h.primary}44`}:"default"===u?{...n,backgroundColor:h.surface,color:h.text,border:`1px solid ${h.border}`}:"outline"===u?{...n,backgroundColor:"transparent",color:h.text,border:`1px solid ${h.border}`}:{...n,backgroundColor:"transparent",color:h.text}},W=({d:e})=>/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:e})});/* @__PURE__ */
|
|
98
98
|
return Ye("nav",{"aria-label":m.pagination,className:K("flex flex-col gap-2"),children:[e>0&&/* @__PURE__ */Ue("p",{className:K("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize},children:j(m.showing(M,I,e))}),/* @__PURE__ */Ye("div",{className:K("flex items-center gap-1 flex-wrap"),children:[a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.firstPage,disabled:1===b,onClick:()=>C(1),style:D(!1,1===b),children:[/* @__PURE__ */Ue(W,{d:"15 18 9 12 15 6"}),/* @__PURE__ */Ue(W,{d:"20 18 14 12 20 6"})]}),
|
|
99
99
|
/* @__PURE__ */Ue("button",{type:"button","aria-label":m.previousPage,disabled:1===b,onClick:()=>C(b-1),style:D(!1,1===b),children:/* @__PURE__ */Ue(W,{d:"15 18 9 12 15 6"})}),$.map((e,t)=>{if("string"==typeof e)/* @__PURE__ */return Ue("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:z.minWidth,height:z.height,fontSize:z.fontSize,color:h.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===b;/* @__PURE__ */
|
|
100
100
|
return Ue("button",{type:"button","aria-label":m.pageN(n),"aria-current":o?"page":void 0,onClick:()=>C(n),style:D(o,!1),children:n},n)}),
|
|
@@ -128,7 +128,7 @@ return Ye("div",{className:K("flex flex-col gap-3 w-full font-sans"),children:[
|
|
|
128
128
|
return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ue("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ue("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Yn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
|
|
129
129
|
return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ue("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ue("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Xn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
|
|
130
130
|
return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ue("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ue("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function qn({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){/* @__PURE__ */
|
|
131
|
-
return Ue("heart"===e?Yn:"circle"===e?Xn:Un,{size:t,filled:n,color:o,halfFilled:r,id:i})}function
|
|
131
|
+
return Ue("heart"===e?Yn:"circle"===e?Xn:Un,{size:t,filled:n,color:o,halfFilled:r,id:i})}function Zn(e,t,n){return Math.min(n,Math.max(t,e))}function _n(e,t,n){if(1===n)return t+1;const o=e.currentTarget.getBoundingClientRect(),r=o.left+o.width/2;return e.clientX<r?t+.5:t+1}function Gn({value:e,defaultValue:t=0,onChange:n,max:o=5,precision:r=1,size:i="md",isReadOnly:a=!1,isDisabled:l=!1,label:s,showValue:d=!1,colorScheme:c="warning",emptyIcon:u="star",filledIcon:h="star"}){const p=N(),f=ge(),m=Ee(),g=void 0!==e,[x,y]=Ve(t),[b,v]=Ve(null),w=Oe(null),k=g?e??0:x,S=b??k,C={warning:p.warning,primary:p.primary,danger:p.danger}[c]??p.warning,$=Kn[i],z=!a&&!l,M=Ae(e=>{g||y(e),n?.(e)},[g,n]),I=Ae((e,t)=>{z&&v(_n(e,t,r))},[z,r]),D=Ae(()=>{z&&v(null)},[z]),W=Ae((e,t)=>{if(!z)return;const n=_n(e,t,r);M(n===k?0:n)},[z,r,k,M]),L=Ae(e=>{if(!z)return;const t=r;let n=k;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Zn(k+t,0,o);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Zn(k-t,0,o);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=o}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,r),M(n)},[z,k,o,r,M]),R=s?j(s):"Rating";/* @__PURE__ */
|
|
132
132
|
return Ye("div",{className:le(K("inline-flex items-center gap-2 font-sans"),l?K("opacity-50"):""),children:[/* @__PURE__ */Ue("div",{ref:w,role:"radiogroup","aria-label":R,"aria-disabled":l,"aria-readonly":a,tabIndex:z?0:-1,onKeyDown:L,onMouseLeave:D,className:K("flex items-center gap-0.5 outline-none"),style:{cursor:z?"pointer":"default"},children:Array.from({length:o},(e,t)=>{const n=t+1,o=t+.5,i=S>=n,a=!i&&.5===r&&S>=o,l=`${m}-${t}`;/* @__PURE__ */
|
|
133
133
|
return Ue("span",{role:"radio","aria-checked":.5===r&&k===o||k===n,"aria-label":.5===r?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>I(e,t),onClick:e=>W(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:f?"none":"transform 120ms ease",transform:null!==b&&S>=o&&z?"scale(1.15)":"scale(1)"},children:/* @__PURE__ */Ue(qn,{type:i||a?h:u,size:$,filled:i,halfFilled:a,color:i||a?C:p.border,uid:a?l:void 0})},t)})}),d&&/* @__PURE__ */Ye("span",{className:K("text-sm tabular-nums"),style:{color:p.textMuted},"aria-live":"polite","aria-atomic":"true",children:[k%1==0?k.toFixed(0):k.toFixed(1)," / ",o]})]})}var Jn=!1;function Qn(){/* @__PURE__ */
|
|
134
134
|
return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[
|
|
@@ -195,7 +195,7 @@ return Ye("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, m
|
|
|
195
195
|
/* @__PURE__ */Ue("span",{children:String(u).padStart(2,"0")}),n&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("span",{style:x,children:":"}),/* @__PURE__ */Ue("span",{children:String(h).padStart(2,"0")})]}),"12h"===t&&/* @__PURE__ */Ue("span",{style:{fontSize:.45*g,color:s,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*g},children:m})]}),o&&/* @__PURE__ */Ue("div",{style:{fontSize:.072*i,color:s,marginTop:.025*i,letterSpacing:"0.03em"},children:p}),r&&/* @__PURE__ */Ue("div",{style:{fontSize:.065*i,color:s,marginTop:.015*i,textTransform:"uppercase",letterSpacing:"0.08em"},children:j(r)})]})}function Io({variant:e="both",size:t="md",showSeconds:n=!0,showDate:o=!1,format:r="24h",timezone:i,timezone2:a,label:l,analogStyle:s="classic",className:d,style:c}){const u=N(),h=ge(),[p,f]=Ve(()=>zo(i)),[m,g]=Ve(()=>a?zo(a):null),[x,y]=Ve(!0),[b,v]=Ve(!1),w=Oe(null);Fe(()=>{v(!0)},[]),Fe(()=>{const e=()=>{f(zo(i)),a&&g(zo(a))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[i,a]),Fe(()=>(w.current=setInterval(()=>{y(e=>!e)},500),()=>{w.current&&clearInterval(w.current)}),[]);const k=$o[t],S="digital"===e||"both"===e;/* @__PURE__ */
|
|
196
196
|
return Ye("div",{className:d,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*k+"px":0,opacity:b?1:0,transition:h?"none":"opacity 0.4s ease",...c},role:"timer","aria-live":"off",children:[("analog"===e||"both"===e)&&/* @__PURE__ */Ue(No,{time:p,size:k,analogStyle:s,showSeconds:n,reducedMotion:h,primary:u.primary,danger:u.danger,text:u.text,textMuted:u.textMuted,border:u.border,surface:u.surface,bg:u.bg}),S&&/* @__PURE__ */Ue(Mo,{time:p,format:r,showSeconds:n,showDate:o,label:l,size:k,primary:u.primary,text:u.text,textMuted:u.textMuted,colonVisible:x}),m&&a&&/* @__PURE__ */Ue("div",{style:{marginTop:.04*k,padding:`${.03*k}px ${.06*k}px`,borderTop:`1px solid ${u.border}`,textAlign:"center"},children:/* @__PURE__ */Ue(Mo,{time:m,format:r,showSeconds:!1,showDate:!1,label:a,size:.7*k,primary:u.secondary,text:u.text,textMuted:u.textMuted,colonVisible:x})})]})}function Do(e){if(!isFinite(e)||isNaN(e))return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function Wo({path:e,size:t=20,color:n="currentColor",title:o}){/* @__PURE__ */
|
|
197
197
|
return Ue("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:n,"aria-hidden":o?void 0:"true",role:o?"img":void 0,"aria-label":o,style:{display:"block",flexShrink:0},children:/* @__PURE__ */Ue("path",{d:e})})}Io.displayName="TkxClock";var Lo="M8 5v14l11-7z",Ro="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function To({onClick:e,title:t,children:n,active:o,primary:r}){const[i,a]=Ve(!1);/* @__PURE__ */
|
|
198
|
-
return Ue("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function Ao({src:e,poster:t,title:n,width:o="100%",height:r,autoPlay:i=!1,loop:a=!1,muted:l=!1,controls:s=!0,showTitle:d=!0,allowFullscreen:c=!0,allowPiP:u=!0,allowDownload:h=!1,chapters:p=[],subtitles:f=[],startTime:m,onPlay:g,onPause:x,onEnded:y,onTimeUpdate:b,className:v,style:w}){const k=N(),S=ge(),C=Oe(null),$=Oe(null),z=Oe(null),M=Oe(null),[I,D]=Ve(!1),[W,L]=Ve(0),[R,T]=Ve(0),[A,B]=Ve(0),[F,E]=Ve(1),[H,P]=Ve(l),[O,V]=Ve(!1),[K,U]=Ve(!0),[Y,X]=Ve(!1),[q,
|
|
198
|
+
return Ue("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function Ao({src:e,poster:t,title:n,width:o="100%",height:r,autoPlay:i=!1,loop:a=!1,muted:l=!1,controls:s=!0,showTitle:d=!0,allowFullscreen:c=!0,allowPiP:u=!0,allowDownload:h=!1,chapters:p=[],subtitles:f=[],startTime:m,onPlay:g,onPause:x,onEnded:y,onTimeUpdate:b,className:v,style:w}){const k=N(),S=ge(),C=Oe(null),$=Oe(null),z=Oe(null),M=Oe(null),[I,D]=Ve(!1),[W,L]=Ve(0),[R,T]=Ve(0),[A,B]=Ve(0),[F,E]=Ve(1),[H,P]=Ve(l),[O,V]=Ve(!1),[K,U]=Ve(!0),[Y,X]=Ve(!1),[q,Z]=Ve(1),[_,G]=Ve(!1),[J,Q]=Ve(-1),[ee,te]=Ve(null),[ne,oe]=Ve(0),[re,ie]=Ve(null),[ae,le]=Ve(!1),[se,de]=Ve(!1),[ce,ue]=Ve(null),[he,pe]=Ve(!1);Fe(()=>{const e=C.current;if(!e)return;void 0!==m&&(e.currentTime=m);const t=()=>{L(e.currentTime),e.buffered.length>0&&B(e.buffered.end(e.buffered.length-1))},n=()=>T(e.duration),o=()=>D(!0),r=()=>{D(!1),X(!0)},i=()=>{D(!1),X(!0),y?.()},a=()=>le(!0),l=()=>le(!1),s=()=>de(!0),d=()=>de(!1),c=()=>{const t=e.error;ue(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),de(!1)};return e.addEventListener("timeupdate",t),e.addEventListener("durationchange",n),e.addEventListener("play",o),e.addEventListener("pause",r),e.addEventListener("ended",i),e.addEventListener("enterpictureinpicture",a),e.addEventListener("leavepictureinpicture",l),e.addEventListener("waiting",s),e.addEventListener("canplay",d),e.addEventListener("error",c),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("durationchange",n),e.removeEventListener("play",o),e.removeEventListener("pause",r),e.removeEventListener("ended",i),e.removeEventListener("enterpictureinpicture",a),e.removeEventListener("leavepictureinpicture",l),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[y,m]),Fe(()=>{C.current&&(I?g?.():x?.())},[I,g,x]),Fe(()=>{b?.(W,R)},[W,R,b]),Fe(()=>{const e=C.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===J?"showing":"disabled"},[J]),Fe(()=>{const e=()=>V(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),Fe(()=>{const e=$.current;if(!e)return;const t=e=>{const t=C.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),me();break;case"f":case"F":c&&ye();break;case"m":case"M":xe();break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case"ArrowUp":e.preventDefault(),E(Math.min(F+.1,1)),C.current&&(C.current.volume=Math.min(F+.1,1));break;case"ArrowDown":e.preventDefault(),E(Math.max(F-.1,0)),C.current&&(C.current.volume=Math.max(F-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[F,c]);const fe=Ae(()=>{U(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{I&&U(!1)},3e3)},[I]);Fe(()=>(fe(),()=>{M.current&&clearTimeout(M.current)}),[I,fe]);const me=Ae(()=>{const e=C.current;e&&(e.paused?(e.play().catch(()=>{}),ie("play"),X(!1)):(e.pause(),ie("pause")),setTimeout(()=>ie(null),600))},[]),xe=Ae(()=>{const e=C.current;if(!e)return;const t=!H;P(t),e.muted=t},[H]),ye=Ae(()=>{const e=$.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),be=Ae(async()=>{const e=C.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ve=Ae(()=>{0!==f.length&&(Q(e=>(e+1)%(f.length+1)-1),Q(e=>{const t=e+1;return t>=f.length?-1:t}))},[f.length]),we=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),ke=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),Se=Ae(()=>{const e=C.current;e&&(ue(null),e.load())},[]),Ce=Ae(()=>{c&&ye()},[c,ye]),$e=Ae(e=>{const t=C.current,n=z.current;if(!t||!n||!R)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*R},[R]),ze=Ae(e=>{const t=z.current;if(!t||!R)return;const n=t.getBoundingClientRect();te(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*R),oe(e.clientX-n.left)},[R]),Ne=Ae(e=>{const t=parseFloat(e.target.value);E(t),C.current&&(C.current.volume=t,C.current.muted=0===t,P(0===t))},[]),Me=Ae(e=>{Z(e),C.current&&(C.current.playbackRate=e),G(!1)},[]),Ie=p.length>0?[...p].reverse().find(e=>W>=e.time):null,De=e=>[...p].reverse().find(t=>e>=t.time)??null,We=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Le=Array.isArray(e)?e[0].src:e,Re=K||Y||!I,Te=S?"none":"opacity 0.25s ease",Be=H||0===F?"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z":F<.5?"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z":"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",Ee=R>0?W/R*100:0,je=R>0?A/R*100:0;/* @__PURE__ */
|
|
199
199
|
return Ye("div",{ref:$,className:v,tabIndex:0,onMouseMove:fe,onMouseLeave:()=>{I&&U(!1)},style:{position:"relative",width:o,height:r??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...w},children:[
|
|
200
200
|
/* @__PURE__ */Ye("video",{ref:C,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:t,autoPlay:i,loop:a,muted:l,playsInline:!0,onClick:me,onDoubleClick:Ce,children:[We.map((e,t)=>/* @__PURE__ */Ue("source",{src:e.src,type:e.type},t)),f.map((e,t)=>/* @__PURE__ */Ue("track",{kind:"subtitles",label:j(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),d&&n&&/* @__PURE__ */Ye("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:Re?1:0,transition:Te,pointerEvents:"none"},children:[/* @__PURE__ */Ue("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:j(n)}),Ie&&/* @__PURE__ */Ye("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",j(Ie.label)]})]}),re&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:S?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:/* @__PURE__ */Ue(Wo,{path:"play"===re?Lo:Ro,size:32,color:"#fff"})}),se&&!ce&&/* @__PURE__ */Ue("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:/* @__PURE__ */Ue("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:k.primary,borderRadius:"50%",animation:S?"none":"tkxvp-spin 0.8s linear infinite"}})}),ce&&/* @__PURE__ */Ye("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[
|
|
201
201
|
/* @__PURE__ */Ue(Wo,{path:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",size:48,color:"#ef4444"}),
|
|
@@ -212,32 +212,32 @@ return Ue("div",{title:j(e.label),style:{position:"absolute",top:"50%",left:`${n
|
|
|
212
212
|
/* @__PURE__ */Ye("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Do(W)," / ",Do(R)]}),
|
|
213
213
|
/* @__PURE__ */Ue("div",{style:{flex:1}}),f.length>0&&/* @__PURE__ */Ue(To,{onClick:ve,title:"Subtitles",primary:k.primary,active:J>=0,children:/* @__PURE__ */Ue(Wo,{path:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",size:20})}),
|
|
214
214
|
/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[
|
|
215
|
-
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>G(e=>!e),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[q,"×"]}),1!==q&&/* @__PURE__ */Ye("span",{style:{position:"absolute",top:0,right:0,background:k.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[q,"x"]}),
|
|
215
|
+
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>G(e=>!e),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[q,"×"]}),1!==q&&/* @__PURE__ */Ye("span",{style:{position:"absolute",top:0,right:0,background:k.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[q,"x"]}),_&&/* @__PURE__ */Ue("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${k.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>Me(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===q?k.primary+"30":"none",border:"none",color:e===q?k.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),u&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&/* @__PURE__ */Ue(To,{onClick:be,title:"Picture-in-Picture",primary:k.primary,active:ae,children:/* @__PURE__ */Ue(Wo,{path:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",size:20})}),h&&/* @__PURE__ */Ue("a",{href:Le,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:/* @__PURE__ */Ue(Wo,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),c&&/* @__PURE__ */Ue(To,{onClick:ye,title:O?"Exit fullscreen":"Fullscreen",primary:k.primary,children:/* @__PURE__ */Ue(Wo,{path:O?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",size:20})})]})]}),
|
|
216
216
|
/* @__PURE__ */Ue("style",{children:"\n @keyframes tkxvp-flash {\n 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }\n 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }\n }\n @keyframes tkxvp-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})}Ao.displayName="TkxVideoPlayer";var Bo={sm:{circle:24,fontSize:"0.75rem",titleSize:"0.8rem",descSize:"0.7rem",connectorWidth:2},md:{circle:32,fontSize:"0.875rem",titleSize:"0.9rem",descSize:"0.775rem",connectorWidth:2},lg:{circle:40,fontSize:"1rem",titleSize:"1rem",descSize:"0.85rem",connectorWidth:3}};function Fo({size:e}){const t=.55*e;/* @__PURE__ */
|
|
217
217
|
return Ue("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function Eo({size:e}){const t=.55*e;/* @__PURE__ */
|
|
218
218
|
return Ue("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})})}function jo({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:a,danger:l,success:s,text:d,textMuted:c,border:u,surface:h,variant:p,reducedMotion:f,clickable:m}){const g="completed"===e,x="active"===e,y="error"===e;let b=h,v=u,w=c,k=2;g?(b="filled"===p?s:h,v=s,w="filled"===p?"#fff":s):x?(b="outlined"===p?h:a,v=a,w="outlined"===p?a:"#fff",k=2):y?(b="filled"===p?l:h,v=l,w="filled"===p?"#fff":l):"pending"===e&&(b=h,v=u,w=c);const S=x&&!f?{boxShadow:`0 0 0 4px ${a}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},C=m?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let $;return $=!o||g||y?g?/* @__PURE__ */Ue(Fo,{size:r}):y?/* @__PURE__ */Ue(Eo,{size:r}):/* @__PURE__ */Ue("span",n?{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}:{style:{fontSize:.22*r,lineHeight:1,background:w,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):/* @__PURE__ */Ue("span",{style:{fontSize:i,lineHeight:1},children:o}),/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${a}50; }\n 50% { box-shadow: 0 0 0 6px ${a}20; }\n }\n `}),/* @__PURE__ */Ue("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${k}px solid ${v}`,backgroundColor:b,color:w,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:f?"none":"background-color 0.2s, border-color 0.2s",...S,...C},children:$})]})}function Ho({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:a}){const l=e?r:i;/* @__PURE__ */
|
|
219
219
|
return Ue("div","horizontal"===t?{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}:{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Po({steps:e,activeStep:t=0,orientation:n="horizontal",variant:o="default",size:r="md",clickable:i=!1,onStepClick:a,showStepNumbers:l=!0,alternateLabel:s=!1,connector:d="solid",className:c,style:u}){const h=N(),p=ge(),f=Bo[r],m="horizontal"===n;/* @__PURE__ */
|
|
220
220
|
return Ue("div",{className:c,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:m?"row":"column",alignItems:m?s?"flex-start":"center":"stretch",width:"100%",gap:0,...u},children:e.map((n,r)=>{const c=((e,n)=>e.status?e.status:n<t?"completed":n===t?"active":"pending")(n,r),u=r===e.length-1,g="completed"===c||r<t,x=r%2==0,y=()=>{i&&a?.(r)},b=/* @__PURE__ */Ue(jo,{status:c,index:r,showStepNumbers:l,icon:n.icon,circleSize:f.circle,fontSize:f.fontSize,primary:h.primary,danger:h.danger,success:h.success,text:h.text,textMuted:h.textMuted,border:h.border,surface:h.surface,variant:o,reducedMotion:p,clickable:i}),v=/* @__PURE__ */Ye("div",{style:{textAlign:m&&!s?"center":"left",maxWidth:m?120:void 0},children:[
|
|
221
221
|
/* @__PURE__ */Ye("div",{style:{fontSize:f.titleSize,fontWeight:"active"===c?600:500,color:"pending"===c?h.textMuted:"error"===c?h.danger:h.text,lineHeight:1.3,transition:p?"none":"color 0.2s"},children:[j(n.title),n.optional&&/* @__PURE__ */Ue("span",{style:{fontSize:f.descSize,color:h.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),n.description&&/* @__PURE__ */Ue("div",{style:{fontSize:f.descSize,color:h.textMuted,marginTop:2,lineHeight:1.4},children:j(n.description)}),n.error&&"error"===c&&/* @__PURE__ */Ue("div",{style:{fontSize:f.descSize,color:h.danger,marginTop:2},children:j(n.error)})]});/* @__PURE__ */
|
|
222
|
-
return Ye("div",m?{role:"listitem",style:{display:"flex",flex:u?0:1,alignItems:"center",minWidth:0},children:[/* @__PURE__ */Ye("div",{onClick:y,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:i?"pointer":"default",flexShrink:0},"aria-current":"active"===c?"step":void 0,children:[s&&!x&&/* @__PURE__ */Ue("div",{style:{minHeight:1.5*f.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:v}),b,!s&&v,s&&x&&/* @__PURE__ */Ue("div",{style:{marginTop:6},children:v})]}),!u&&/* @__PURE__ */Ue(Ho,{completed:g,orientation:"horizontal",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}:{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[/* @__PURE__ */Ue("div",{onClick:y,style:{cursor:i?"pointer":"default"},"aria-current":"active"===c?"step":void 0,children:b}),!u&&/* @__PURE__ */Ue(Ho,{completed:g,orientation:"vertical",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}),/* @__PURE__ */Ue("div",{style:{paddingTop:(f.circle-16*parseFloat(f.titleSize))/2,paddingBottom:u?0:16,flex:1,minWidth:0},children:v})]},n.id)})})}function Oo(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,s=0;const d=(i+a)/2;if(i!==a){const e=i-a;switch(s=d>.5?e/(2-i-a):e/(i+a),i){case t:l=((n-o)/e+(n<o?6:0))/6;break;case n:l=((o-t)/e+2)/6;break;case o:l=((t-n)/e+4)/6}}return[Math.round(360*l),Math.round(100*s),Math.round(100*d)]}function Vo(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function Ko(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function Uo(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Yo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Xo(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=Ko(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[a,l,s]=Oo(e);return"hsl"===n?t<1?`hsla(${a}, ${l}%, ${s}%, ${t.toFixed(2)})`:`hsl(${a}, ${l}%, ${s}%)`:e}Po.displayName="TkxStepper";var qo=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function
|
|
222
|
+
return Ye("div",m?{role:"listitem",style:{display:"flex",flex:u?0:1,alignItems:"center",minWidth:0},children:[/* @__PURE__ */Ye("div",{onClick:y,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:i?"pointer":"default",flexShrink:0},"aria-current":"active"===c?"step":void 0,children:[s&&!x&&/* @__PURE__ */Ue("div",{style:{minHeight:1.5*f.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:v}),b,!s&&v,s&&x&&/* @__PURE__ */Ue("div",{style:{marginTop:6},children:v})]}),!u&&/* @__PURE__ */Ue(Ho,{completed:g,orientation:"horizontal",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}:{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[/* @__PURE__ */Ue("div",{onClick:y,style:{cursor:i?"pointer":"default"},"aria-current":"active"===c?"step":void 0,children:b}),!u&&/* @__PURE__ */Ue(Ho,{completed:g,orientation:"vertical",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}),/* @__PURE__ */Ue("div",{style:{paddingTop:(f.circle-16*parseFloat(f.titleSize))/2,paddingBottom:u?0:16,flex:1,minWidth:0},children:v})]},n.id)})})}function Oo(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,s=0;const d=(i+a)/2;if(i!==a){const e=i-a;switch(s=d>.5?e/(2-i-a):e/(i+a),i){case t:l=((n-o)/e+(n<o?6:0))/6;break;case n:l=((o-t)/e+2)/6;break;case o:l=((t-n)/e+4)/6}}return[Math.round(360*l),Math.round(100*s),Math.round(100*d)]}function Vo(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function Ko(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function Uo(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Yo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Xo(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=Ko(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[a,l,s]=Oo(e);return"hsl"===n?t<1?`hsla(${a}, ${l}%, ${s}%, ${t.toFixed(2)})`:`hsl(${a}, ${l}%, ${s}%)`:e}Po.displayName="TkxStepper";var qo=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Zo({hue:e,sat:t,bright:n,onChange:o}){const r=Oe(null),i=Oe(!1),a=Ae(e=>{const t=r.current;if(!t)return;const n=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),a=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-a)))},[o]);Fe(()=>{const e=e=>{i.current&&a(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[a]);const l=`${t}%`,s=100-n+"%";/* @__PURE__ */
|
|
223
223
|
return Ye("div",{ref:r,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{i.current=!0,a(e)},children:[
|
|
224
224
|
/* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),
|
|
225
225
|
/* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),
|
|
226
|
-
/* @__PURE__ */Ue("div",{style:{position:"absolute",left:l,top:s,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:Vo(e,t,n/2+25)}})]})}function
|
|
226
|
+
/* @__PURE__ */Ue("div",{style:{position:"absolute",left:l,top:s,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:Vo(e,t,n/2+25)}})]})}function _o({hue:e,onChange:t}){const n=Oe(null),o=Oe(!1),r=Ae(e=>{const o=n.current;if(!o)return;const r=o.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));t(Math.round(360*i))},[t]);return Fe(()=>{const e=e=>{o.current&&r(e)},t=()=>{o.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[r]),/* @__PURE__ */Ue("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:e=>{o.current=!0,r(e)},children:/* @__PURE__ */Ue("div",{style:{position:"absolute",left:e/360*100+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Go({alpha:e,hex:t,onChange:n}){const o=Oe(null),r=Oe(!1),i=Ae(e=>{const t=o.current;if(!t)return;const r=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));n(Math.round(100*i)/100)},[n]);Fe(()=>{const e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[i]);const[a,l,s]=Ko(t);/* @__PURE__ */
|
|
227
227
|
return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),/* @__PURE__ */Ue("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${a},${l},${s},0), rgba(${a},${l},${s},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:/* @__PURE__ */Ue("div",{style:{position:"absolute",left:100*e+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${a},${l},${s},${e})`,pointerEvents:"none"}})})]})}function Jo({value:e,defaultValue:t="#3b82f6",onChange:n,format:o="hex",showAlpha:r=!1,presets:i=qo,disabled:a=!1,size:l="md",placeholder:s,label:d,style:c}){const u=N(),h=Oe(null),p=Oe(null),[f,m]=Ve(!1),g=void 0!==e,[x,y]=Ve(g&&e||t),b=g?e||t:x,[v,w]=Ve(1),[k,S]=Ve(b),[C,$]=Ve({top:0,left:0}),[z,M,I]=Oo(Yo(b)?b:t);Math.round(I+M/100*Math.min(I/100,1-I/100)*100);const D=Ae((e,t=v)=>{Yo(e)&&(S(e),g||y(e),n?.(Xo(e,t,o),o))},[v,g,o,n]);Fe(()=>{g&&e&&Yo(e)&&S(e)},[g,e]),Fe(()=>{if(!f)return;const e=e=>{p.current&&!p.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]),Fe(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);const W=e=>{w(e),n?.(Xo(b,e,o),o)},L={sm:28,md:34,lg:40}[l],[R,T,A]=Ko(Yo(b)?b:t),B={display:"inline-flex",alignItems:"center",gap:"8px",height:`${L}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${u.border}`,backgroundColor:u.surface,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,color:u.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...c},F={width:L-8+"px",height:L-8+"px",borderRadius:"4px",backgroundColor:`rgba(${R},${T},${A},${v})`,border:`1px solid ${u.border}`,flexShrink:0},E={position:"absolute",top:C.top,left:C.left,zIndex:9999,width:"260px",backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},j={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},H={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},P=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===b.toLowerCase()?`2px solid ${u.primary}`:`1px solid ${u.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});/* @__PURE__ */
|
|
228
228
|
return Ye(Ke,{children:[d&&/* @__PURE__ */Ue("label",{style:{display:"block",fontSize:"13px",color:u.text,marginBottom:"6px",fontWeight:500},children:d}),
|
|
229
229
|
/* @__PURE__ */Ye("button",{ref:h,type:"button",style:B,onClick:()=>{if(a)return;const e=h.current;if(!e)return;const t=e.getBoundingClientRect();$({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),m(!0)},disabled:a,"aria-label":`Color picker, current color ${b}`,"aria-haspopup":"dialog","aria-expanded":f,children:[/* @__PURE__ */Ue("div",{style:F}),/* @__PURE__ */Ue("span",{style:{fontFamily:"monospace",fontSize:"12px",color:u.textMuted},children:s??Xo(Yo(b)?b:t,v,o)})]}),f&&Xe(/* @__PURE__ */Ye("div",{ref:p,style:E,role:"dialog","aria-label":"Color picker",children:[
|
|
230
|
-
/* @__PURE__ */Ue(
|
|
231
|
-
/* @__PURE__ */Ue(
|
|
230
|
+
/* @__PURE__ */Ue(Zo,{hue:z,sat:M,bright:I,onChange:(e,t)=>{const n=t/100,o=n*(1-e/100/2),r=0===o||1===o?0:(n-o)/Math.min(o,1-o);D(Vo(z,Math.round(100*r),Math.round(100*o)))}}),
|
|
231
|
+
/* @__PURE__ */Ue(_o,{hue:z,onChange:e=>{D(Vo(e,M,I))}}),r&&/* @__PURE__ */Ue(Go,{alpha:v,hex:Yo(b)?b:t,onChange:W}),
|
|
232
232
|
/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[/* @__PURE__ */Ue("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${R},${T},${A},${v})`,border:`1px solid ${u.border}`}}),/* @__PURE__ */Ue("input",{style:j,value:k,onChange:e=>{const t=e.target.value;S(t),Yo(t)&&D(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),
|
|
233
233
|
/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ue("input",{style:H,type:"number",min:0,max:255,value:"r"===e?R:"g"===e?T:A,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=Ko(b);D("r"===e?Uo(n,r,i):"g"===e?Uo(o,n,i):Uo(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),/* @__PURE__ */Ue("span",{style:{fontSize:"10px",color:u.textMuted,textTransform:"uppercase"},children:e})]},e)),r&&/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ue("input",{style:H,type:"number",min:0,max:100,value:Math.round(100*v),onChange:e=>W(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),/* @__PURE__ */Ue("span",{style:{fontSize:"10px",color:u.textMuted},children:"A%"})]})]}),i.length>0&&/* @__PURE__ */Ye("div",{children:[/* @__PURE__ */Ue("div",{style:{fontSize:"11px",color:u.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),/* @__PURE__ */Ue("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:i.map(e=>/* @__PURE__ */Ue("button",{type:"button",style:P(e),onClick:()=>D(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"}},e))})]})]}),document.body)]})}var Qo={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 er(e,t,n){let o=e;return void 0!==t&&(o=Math.max(o,t)),void 0!==n&&(o=Math.min(o,n)),o}function tr(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function nr({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:a,iconSz:l,onStep:s,incrementLabel:d,decrementLabel:c}){const u=Oe(null),h=Oe(null),p="inc"===e?1:-1,f=Ae(()=>{s(p),u.current=setTimeout(()=>{h.current=setInterval(()=>s(p),60)},400)},[p,s]),m=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null),h.current&&(clearInterval(h.current),h.current=null)},[]);Fe(()=>()=>m(),[m]);const g="inc"===e;/* @__PURE__ */
|
|
234
|
-
return Ue("button",{type:"button","aria-label":g?d:c,disabled:t,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onTouchStart:e=>{e.preventDefault(),f()},onTouchEnd:m,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:g?void 0:`1px solid ${i}`,borderLeft:g?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?a:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:g?/* @__PURE__ */Ye("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */Ue("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function or({value:e,defaultValue:t=0,onChange:n,min:o,max:r,step:i=1,precision:a,prefix:l,suffix:s,format:d,currency:c,locale:u,clampOnBlur:h=!0,allowMouseWheel:p=!1,size:f="md",label:m,hint:g,isDisabled:x=!1,isReadOnly:y=!1,isInvalid:b=!1,errorMessage:v,id:w,className:k,style:S}){const C=N(),$=$e(),z=$.increment??"Increment",M=$.decrement??"Decrement",I=Ee(),D=w??I,W=`${D}-hint`,L=`${D}-error`,R=void 0!==e,[T,A]=Ve(t),B=R?e:T,[F,E]=Ve(!1),[H,P]=Ve(""),O=Qo[f],V=b||!!v,U=V?C.danger:F?C.primary:C.border,Y=[g&&W,V&&L].filter(Boolean).join(" ")||void 0,X=m?j(m):void 0,q=g?j(g):void 0,
|
|
234
|
+
return Ue("button",{type:"button","aria-label":g?d:c,disabled:t,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onTouchStart:e=>{e.preventDefault(),f()},onTouchEnd:m,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:g?void 0:`1px solid ${i}`,borderLeft:g?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?a:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:g?/* @__PURE__ */Ye("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */Ue("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function or({value:e,defaultValue:t=0,onChange:n,min:o,max:r,step:i=1,precision:a,prefix:l,suffix:s,format:d,currency:c,locale:u,clampOnBlur:h=!0,allowMouseWheel:p=!1,size:f="md",label:m,hint:g,isDisabled:x=!1,isReadOnly:y=!1,isInvalid:b=!1,errorMessage:v,id:w,className:k,style:S}){const C=N(),$=$e(),z=$.increment??"Increment",M=$.decrement??"Decrement",I=Ee(),D=w??I,W=`${D}-hint`,L=`${D}-error`,R=void 0!==e,[T,A]=Ve(t),B=R?e:T,[F,E]=Ve(!1),[H,P]=Ve(""),O=Qo[f],V=b||!!v,U=V?C.danger:F?C.primary:C.border,Y=[g&&W,V&&L].filter(Boolean).join(" ")||void 0,X=m?j(m):void 0,q=g?j(g):void 0,Z=v?j(v):void 0,_=l?j(l):void 0,G=s?j(s):void 0,J=Ae(e=>{const t=tr(e,a);R||A(t),n?.(t)},[R,n,a]),Q=Ae(e=>{x||y||J(er(tr(B+e*i,a),o,r))},[x,y,B,i,a,o,r,J]),ee=F?H:function(e,t,n,o,r){const i=o??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:r??2,maximumFractionDigits:r??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:r??0,maximumFractionDigits:r??0}).format(e/100):"decimal"===t||void 0!==r?new Intl.NumberFormat(i,{minimumFractionDigits:r??0,maximumFractionDigits:r??20}).format(e):String(e)}(B,d,c,u,a),te=(_||G)&&!F;/* @__PURE__ */
|
|
235
235
|
return Ye("div",{className:le(K("flex flex-col gap-1 w-full"),k),style:S,children:[X&&/* @__PURE__ */Ue("label",{htmlFor:D,className:K("text-sm font-medium font-sans"),style:{color:C.text},children:X}),
|
|
236
236
|
/* @__PURE__ */Ye("div",{className:K("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${U}`,backgroundColor:x?C.surfaceAlt:C.surface,opacity:x?.65:1,height:O.height},children:[
|
|
237
237
|
/* @__PURE__ */Ue(nr,{direction:"dec",isDisabled:x||y,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M}),
|
|
238
|
-
/* @__PURE__ */Ye("div",{className:K("relative flex-1 flex items-center overflow-hidden"),children:[te&&
|
|
239
|
-
/* @__PURE__ */Ue("input",{id:D,type:"text",inputMode:"decimal",value:F?H:ee,readOnly:y,disabled:x,"aria-invalid":V,"aria-describedby":Y,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":B,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:C.text,paddingLeft:te&&
|
|
240
|
-
/* @__PURE__ */Ue(nr,{direction:"inc",isDisabled:x||y,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M})]}),q&&!
|
|
238
|
+
/* @__PURE__ */Ye("div",{className:K("relative flex-1 flex items-center overflow-hidden"),children:[te&&_&&/* @__PURE__ */Ue("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:_}),
|
|
239
|
+
/* @__PURE__ */Ue("input",{id:D,type:"text",inputMode:"decimal",value:F?H:ee,readOnly:y,disabled:x,"aria-invalid":V,"aria-describedby":Y,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":B,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:C.text,paddingLeft:te&&_?`calc(${O.px} + 1.2em)`:O.px,paddingRight:te&&G?`calc(${O.px} + 1.2em)`:O.px,cursor:x?"not-allowed":y?"default":"text"},onFocus:()=>{E(!0),P(String(B))},onBlur:()=>{E(!1);const e=parseFloat(H);if(isNaN(e))return n?.(null),void P(String(B));let t=tr(e,a);h&&(t=er(t,o,r)),J(t)},onChange:e=>{P(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),Q(1)),"ArrowDown"===e.key&&(e.preventDefault(),Q(-1))},onWheel:e=>{p&&F&&(e.preventDefault(),Q(e.deltaY<0?1:-1))}}),te&&G&&/* @__PURE__ */Ue("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:G})]}),
|
|
240
|
+
/* @__PURE__ */Ue(nr,{direction:"inc",isDisabled:x||y,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M})]}),q&&!Z&&/* @__PURE__ */Ue("span",{id:W,className:K("text-xs"),style:{color:C.textMuted},children:q}),Z&&/* @__PURE__ */Ye("span",{id:L,role:"alert",className:K("text-xs flex items-center gap-1"),style:{color:C.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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]})]})}or.displayName="TkxNumberInput";var rr={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},ir={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function ar(e,t){return ir[t].test(e)?e.toUpperCase():""}function lr({length:e=6,value:t,onChange:n,onComplete:o,type:r="number",mask:i=!1,autoFocus:a=!1,isDisabled:l=!1,isInvalid:s=!1,errorMessage:d,hint:c,size:u="md",separator:h,separatorPosition:p,webOTP:f=!0,className:m,style:g}){const x=N(),y=$e(),b=Ee(),v=`${b}-hint`,w=`${b}-error`,k=void 0!==t,S=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[C,$]=Ve(()=>S(k?t:"")),z=k?S(t):C,M=Oe([]),I=rr[u],D=s||!!d,W=z.every(e=>""!==e),L=c?j(c):void 0,R=d?j(d):void 0,T=e=>D?x.danger:W?x.success:x.border;Fe(()=>{a&&M.current[0]?.focus()},[]);const A=Ae(e=>{k||$(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&o?.(t)},[k,n,o]);Fe(()=>{if(!f||l)return;if("undefined"==typeof window||!("OTPCredential"in window))return;const t=new AbortController;return navigator.credentials?.get({otp:{transport:["sms"]},signal:t.signal}).then(t=>{if(!t?.code)return;const n=String(t.code).slice(0,e).split("").map(e=>ar(e,r));for(;n.length<e;)n.push("");A(n)}).catch(()=>{}),()=>t.abort()},[f,l,e,r]);const B=t=>{const n=Math.max(0,Math.min(e-1,t));M.current[n]?.focus()},F=t=>n=>{if(!l){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...z];return e[t]="",void A(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void B(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void B(t+1)):"Home"===n.key?(n.preventDefault(),void B(0)):"End"===n.key?(n.preventDefault(),void B(e-1)):void 0}if(n.preventDefault(),""!==z[t]){const e=[...z];e[t]="",A(e)}else if(t>0){const e=[...z];e[t-1]="",A(e),B(t-1)}}},E=t=>n=>{if(l)return;const o=n.target.value.slice(-1);if(!o)return;const i=ar(o,r);if(!i)return;const a=[...z];a[t]=i,A(a),t<e-1&&B(t+1)},H=t=>n=>{if(n.preventDefault(),l)return;const o=n.clipboardData.getData("text").split("").map(e=>ar(e,r)).filter(Boolean);if(!o.length)return;const i=[...z];let a=t;for(const t of o){if(a>=e)break;i[a]=t,a++}A(i),B(Math.min(a,e-1))},P=[L&&v,D&&w].filter(Boolean).join(" ")||void 0;/* @__PURE__ */
|
|
241
241
|
return Ye("div",{className:le(K("flex flex-col gap-2 w-fit"),m),style:g,children:[
|
|
242
242
|
/* @__PURE__ */Ue("div",{role:"group","aria-label":y.oneTimePassword??"One-time password","aria-describedby":P,className:K("flex items-center"),style:{gap:I.gap},children:Array.from({length:e},(t,n)=>{const o=T();return"undefined"!=typeof document&&(document.activeElement,M.current[n]/* @__PURE__ */),Ye("div",{className:K("flex items-center"),style:{gap:I.gap},children:[h&&p===n&&0!==n&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{color:x.textMuted,userSelect:"none",flexShrink:0},children:h}),/* @__PURE__ */Ue("input",{ref:e=>{M.current[n]=e},type:i?"password":"text",inputMode:"number"===r?"numeric":"text",maxLength:1,value:z[n],disabled:l,"aria-label":`Digit ${n+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:E(n),onKeyDown:F(n),onPaste:H(n),onFocus:e=>e.target.select(),style:{width:I.box,height:I.box,textAlign:"center",fontSize:I.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${o}`,borderRadius:"8px",backgroundColor:l?x.surfaceAlt:x.surface,color:x.text,outline:"none",boxShadow:"none",cursor:l?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:l?.6:1},onFocusCapture:e=>{l||(e.currentTarget.style.borderColor=D?x.danger:x.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${D?x.danger:x.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=T(),e.currentTarget.style.boxShadow="none"}})]},n)})}),L&&!R&&/* @__PURE__ */Ue("span",{id:v,className:K("text-xs"),style:{color:x.textMuted},children:L}),R&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:K("text-xs flex items-center gap-1"),style:{color:x.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),R]})]})}function sr(){const[e,t]=Ve(!1);return{isOpen:e,open:Ae(()=>t(!0),[]),close:Ae(()=>t(!1),[]),toggle:Ae(()=>t(e=>!e),[])}}function dr(e,t){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=t.toLowerCase(),r=o.indexOf(n);if(-1!==r)return{matched:!0,ranges:[[r,r+n.length-1]],score:0===r?100:80};const i=[];let a=0,l=-1,s=-1;for(let d=0;d<o.length&&a<n.length;d++)o[d]===n[a]&&(-1!==s&&d===s+1||(-1!==l&&i.push([l,s]),l=d),s=d,a++);return-1!==l&&-1!==s&&i.push([l,s]),a<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function cr({text:e,ranges:t,color:n}){if(!t.length)/* @__PURE__ */return Ue(Ke,{children:e});const o=[];let r=0;for(const[i,a]of t)r<i&&o.push(/* @__PURE__ */Ue("span",{children:e.slice(r,i)},`t-${r}`)),o.push(/* @__PURE__ */Ue("span",{style:{color:n,fontWeight:700},children:e.slice(i,a+1)},`h-${i}`)),r=a+1;return r<e.length&&o.push(/* @__PURE__ */Ue("span",{children:e.slice(r)},"t-end")),/* @__PURE__ */Ue(Ke,{children:o})}function ur({surface:e,border:t}){/* @__PURE__ */
|
|
243
243
|
return Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[/* @__PURE__ */Ue("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[/* @__PURE__ */Ue("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),/* @__PURE__ */Ue("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function hr({items:e,isOpen:t=!1,onClose:n,placeholder:o,emptyMessage:r,maxItems:i=8,onItemSelect:a,className:l,style:s}){const d=N(),c=$e(),u=o??c.commandSearch??"Type a command or search…",[h,p]=Ve(""),[f,m]=Ve(0),[g,x]=Ve(!1),y=Oe(null),b=Oe(null),v=Ee(),w=function(e){const t=Oe(null);return Fe(()=>{if(!e||!t.current)return;const n=t.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],a=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[e]),t}(t),k=function(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));const n=[];for(const o of t){if(o.disabled)continue;const t=dr(e,o.label),r=o.description?dr(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>dr(e,t).matched);t.matched?n.push({item:o,score:t.score+20,labelRanges:t.ranges}):r.matched?n.push({item:o,score:r.score,labelRanges:[]}):i&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}(h,e).slice(0,i),S=[];for(const N of k){const e=N.item.group,t=S.find(t=>t.group===e);t?t.items.push(N):S.push({group:e,items:[N]})}const C=S.flatMap(e=>e.items);var $,z;Fe(()=>{if(!z)return;const e=e=>{"Escape"===e.key&&$()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$=()=>{n?.()},z=t]),Fe(()=>{t&&(p(""),m(0),setTimeout(()=>y.current?.focus(),30))},[t]),Fe(()=>{f>=C.length&&m(Math.max(0,C.length-1))},[C.length,f]);const M=Ae(e=>{const t=b.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),I=e=>{e.disabled||(e.onSelect?.(),a?.(e),n?.())};if(!t||"undefined"==typeof document)return null;const D=j(u),W=c.noCommandsFound??`No results for "${j(h)}"`,L=r?j(r):W;if("undefined"!=typeof document&&!document.getElementById("tkx-shimmer-style")){const e=document.createElement("style");e.id="tkx-shimmer-style",e.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(e)}return Xe(/* @__PURE__ */Ye("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[/* @__PURE__ */Ue("div",{"aria-hidden":"true",onClick:n,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),/* @__PURE__ */Ye("div",{ref:w,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:v,className:le(l),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:d.surface,border:`1px solid ${d.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${d.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...s},children:[
|
|
@@ -254,9 +254,9 @@ return Ye("div",{id:`${v}-item-${i.id}`,role:"option","aria-selected":r,"aria-di
|
|
|
254
254
|
/* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ue("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),
|
|
255
255
|
/* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ue("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),
|
|
256
256
|
/* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ue("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function pr({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const a="vertical"===i,l="prev"===e,s="inside"===r?{position:"absolute",zIndex:3,...a?{[l?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[l?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};/* @__PURE__ */
|
|
257
|
-
return Ue("button",{type:"button","aria-label":l?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...s,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:/* @__PURE__ */Ue("svg",a?l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"18 15 12 9 6 15"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})}:l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"15 18 9 12 15 6"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"9 18 15 12 9 6"})})})}function fr({slides:e,autoPlay:t=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:r=!0,showArrows:i=!0,showDots:a=!0,showThumbnails:l=!1,orientation:s="horizontal",slidesToShow:d=1,gap:c=0,transitionDuration:u=400,swipeable:h=!0,initialIndex:p=0,onChange:f,arrowPosition:m="inside",height:g=320,className:x,style:y}){const b=N(),v=ge(),w=Ee(),k=e.length,[S,C]=Ve(p),[$,z]=Ve(r?p+1:p),[M,I]=Ve(!1),[D,W]=Ve(!1),L=Oe(null),R=Oe(null),T=Oe(null),A=Oe(0),B=Oe(!1),F="vertical"===s,E=v?0:u,j=r&&k>1?[e[k-1],...e,e[0]]:e,H=j.length,P=100/d,O=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return F?`translateY(calc(-${e*P}%${n}))`:`translateX(calc(-${e*P}%${n}))`},V=Ae((e,t=!1)=>{const n=r?(e%k+k)%k:Math.max(0,Math.min(k-1,e)),o=r?n+1:n;t&&L.current?(L.current.style.transition="none",z(o),C(n),L.current.offsetHeight,L.current.style.transition=""):(I(!0),z(o),C(n)),f?.(n)},[k,r,f]),U=Ae(()=>V(S-1),[S,V]),Y=Ae(()=>V(S+1),[S,V]),X=Ae(()=>{I(!1),!r||k<=1||(0===$?V(k-1,!0):$===H-1&&V(0,!0))},[r,k,$,H,V]);Fe(()=>{if(!(!t||D||k<=1))return R.current=setInterval(Y,n),()=>{R.current&&clearInterval(R.current)}},[t,D,n,Y,k]),Fe(()=>{const e=e=>{const t=document.activeElement;document.getElementById(w)?.contains(t)&&(e.key===(F?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),U()),e.key===(F?"ArrowDown":"ArrowRight")&&(e.preventDefault(),Y()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w,F,U,Y]);const q=e=>"touches"in e?F?e.touches[0].clientY:e.touches[0].clientX:F?e.clientY:e.clientX,
|
|
257
|
+
return Ue("button",{type:"button","aria-label":l?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...s,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:/* @__PURE__ */Ue("svg",a?l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"18 15 12 9 6 15"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})}:l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"15 18 9 12 15 6"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"9 18 15 12 9 6"})})})}function fr({slides:e,autoPlay:t=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:r=!0,showArrows:i=!0,showDots:a=!0,showThumbnails:l=!1,orientation:s="horizontal",slidesToShow:d=1,gap:c=0,transitionDuration:u=400,swipeable:h=!0,initialIndex:p=0,onChange:f,arrowPosition:m="inside",height:g=320,className:x,style:y}){const b=N(),v=ge(),w=Ee(),k=e.length,[S,C]=Ve(p),[$,z]=Ve(r?p+1:p),[M,I]=Ve(!1),[D,W]=Ve(!1),L=Oe(null),R=Oe(null),T=Oe(null),A=Oe(0),B=Oe(!1),F="vertical"===s,E=v?0:u,j=r&&k>1?[e[k-1],...e,e[0]]:e,H=j.length,P=100/d,O=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return F?`translateY(calc(-${e*P}%${n}))`:`translateX(calc(-${e*P}%${n}))`},V=Ae((e,t=!1)=>{const n=r?(e%k+k)%k:Math.max(0,Math.min(k-1,e)),o=r?n+1:n;t&&L.current?(L.current.style.transition="none",z(o),C(n),L.current.offsetHeight,L.current.style.transition=""):(I(!0),z(o),C(n)),f?.(n)},[k,r,f]),U=Ae(()=>V(S-1),[S,V]),Y=Ae(()=>V(S+1),[S,V]),X=Ae(()=>{I(!1),!r||k<=1||(0===$?V(k-1,!0):$===H-1&&V(0,!0))},[r,k,$,H,V]);Fe(()=>{if(!(!t||D||k<=1))return R.current=setInterval(Y,n),()=>{R.current&&clearInterval(R.current)}},[t,D,n,Y,k]),Fe(()=>{const e=e=>{const t=document.activeElement;document.getElementById(w)?.contains(t)&&(e.key===(F?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),U()),e.key===(F?"ArrowDown":"ArrowRight")&&(e.preventDefault(),Y()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w,F,U,Y]);const q=e=>"touches"in e?F?e.touches[0].clientY:e.touches[0].clientX:F?e.clientY:e.clientX,Z=e=>{h&&(T.current=q(e),A.current=0,B.current=!0)},_=e=>{if(!B.current||null===T.current)return;const t=q(e)-T.current;A.current=t,L.current&&(L.current.style.transition="none",L.current.style.transform=O($,-t))},G=()=>{if(!B.current)return;B.current=!1;const e=A.current;L.current&&(L.current.style.transition="",L.current.style.transform=""),e<-50?Y():e>50?U():L.current&&(L.current.style.transform=O($)),T.current=null,A.current=0},J="number"==typeof g?`${g}px`:g,Q={display:"flex",flexDirection:F?"column":"row",width:F?"100%":H/d*100+"%",height:F?H/d*100+"%":"100%",transform:O($),transition:M||!v?`transform ${E}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:c>0?c:void 0},ee={flexShrink:0,width:F?"100%":P/(H/d)+"%",height:F?P/(H/d)+"%":"100%",overflow:"hidden",position:"relative"},te=r||S>0,ne=r||S<k-1,oe="outside"===m;/* @__PURE__ */
|
|
258
258
|
return Ye("div",{id:w,className:le(K("flex flex-col gap-2"),x),style:y,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[/* @__PURE__ */Ye("div",{className:K("flex items-center gap-2"),style:{gap:oe&&i?8:0},children:[i&&oe&&/* @__PURE__ */Ue(pr,{direction:"prev",onClick:U,isDisabled:!te,primaryColor:b.primary,position:"outside",orientation:s}),
|
|
259
|
-
/* @__PURE__ */Ye("div",{style:{position:"relative",flex:1,overflow:"hidden",height:J,borderRadius:12,cursor:h?B.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&W(!0),onMouseLeave:()=>{W(!1),G()},onTouchStart:
|
|
259
|
+
/* @__PURE__ */Ye("div",{style:{position:"relative",flex:1,overflow:"hidden",height:J,borderRadius:12,cursor:h?B.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&W(!0),onMouseLeave:()=>{W(!1),G()},onTouchStart:Z,onTouchMove:_,onTouchEnd:G,onMouseDown:Z,onMouseMove:_,onMouseUp:G,"aria-live":"polite","aria-atomic":"false",children:[i&&!oe&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue(pr,{direction:"prev",onClick:U,isDisabled:!te,primaryColor:b.primary,position:"inside",orientation:s}),/* @__PURE__ */Ue(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:b.primary,position:"inside",orientation:s})]}),
|
|
260
260
|
/* @__PURE__ */Ue("div",{ref:L,style:Q,onTransitionEnd:X,children:j.map((e,t)=>/* @__PURE__ */Ue("div",{style:ee,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(r?1:0)+k)%k+1} of ${k}`,"aria-hidden":(t-(r?1:0)+k)%k!==S,children:e.content},`${e.id}-${t}`))}),a&&!l&&/* @__PURE__ */Ue("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((e,t)=>/* @__PURE__ */Ue("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===S?"true":void 0,onClick:()=>V(t),style:{width:t===S?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===S?b.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${b.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),i&&oe&&/* @__PURE__ */Ue(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:b.primary,position:"outside",orientation:s})]}),l&&/* @__PURE__ */Ue("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>/* @__PURE__ */Ye("button",{type:"button",role:"tab","aria-selected":t===S,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>V(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===S?b.primary:b.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:b.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${b.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?/* @__PURE__ */Ue("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ue("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:b.textMuted,fontWeight:600},children:t+1}),t===S&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${b.primary}22`}})]},e.id))})]})}function mr({color:e}){/* @__PURE__ */
|
|
261
261
|
return Ue("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gr({onClick:e,bgColor:t,hoverColor:n,textColor:o,label:r}){/* @__PURE__ */
|
|
262
262
|
return Ue("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":r,className:K("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:t,color:o,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=n},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function xr({items:e,separator:t,maxItems:n,onNavigate:o,className:r,style:i}){const a=N(),l=$e(),s=ge(),d=void 0!==n&&n>1&&e.length>n,c=Ae(()=>{if(!d||!n)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((n-1)/2),o=n-1-t,r=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),i=e.slice(e.length-o).map((t,n)=>({item:t,originalIndex:e.length-o+n}));return r.concat(i)},[e,n,d])(),u=d&&n?Math.ceil((n-1)/2):-1,h=(e,t)=>{o?.(e,t)},p=s?{}:{transition:"color 150ms ease, background-color 150ms ease"},f=e=>/* @__PURE__ */Ue("li",{role:"presentation","aria-hidden":"true",className:K("flex items-center mx-1.5"),children:t??/* @__PURE__ */Ue(mr,{color:a.textMuted})},e),m=(e,t,n)=>{const r=j(e.label);if(n)/* @__PURE__ */return Ue("li",{children:/* @__PURE__ */Ye("span",{"aria-current":"page",className:K("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:a.text},children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:a.textMuted,textDecoration:"none",...p},s={onMouseEnter:e=>{e.currentTarget.style.color=a.primary},onMouseLeave:e=>{e.currentTarget.style.color=a.textMuted}},d=/* @__PURE__ */Ye(Ke,{children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("flex-shrink-0"),children:e.icon}),r]});/* @__PURE__ */
|
|
@@ -308,8 +308,8 @@ return Ye("button",{role:"tab","aria-selected":n,"aria-label":a,tabIndex:n?0:-1,
|
|
|
308
308
|
/* @__PURE__ */Ue("span",{id:c,className:K("flex-1 text-sm leading-snug"),children:b}),o&&/* @__PURE__ */Ue("button",{onClick:()=>{o.onClick(),n?.()},className:K("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:s.primary},children:j(o.label)}),n&&/* @__PURE__ */Ue("button",{"aria-label":"Dismiss snackbar",onClick:n,className:K("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)}function Kr({direction:e}){/* @__PURE__ */
|
|
309
309
|
return Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:K("shrink-0 ml-1"),children:/* @__PURE__ */Ue("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function Ur({checked:e,indeterminate:t}){const n=N();/* @__PURE__ */
|
|
310
310
|
return Ye("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[
|
|
311
|
-
/* @__PURE__ */Ue("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||t?n.primary:"transparent",stroke:e||t?n.primary:n.border,strokeWidth:"1.5"}),t&&/* @__PURE__ */Ue("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!t&&/* @__PURE__ */Ue("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr(e,t){return"function"==typeof t?t(e):String(e[t])}function Xr(e,t){return e[t]}function qr(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function
|
|
312
|
-
return Ue("tbody",{children:Array.from({length:5},(n,o)=>/* @__PURE__ */Ue("tr",{children:Array.from({length:e},(e,n)=>/* @__PURE__ */Ue("td",{className:K("px-3 py-2"),style:{borderBottom:`1px solid ${t.border}`},children:/* @__PURE__ */Ue(Dt,{height:16})},n))},o))})}function
|
|
311
|
+
/* @__PURE__ */Ue("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||t?n.primary:"transparent",stroke:e||t?n.primary:n.border,strokeWidth:"1.5"}),t&&/* @__PURE__ */Ue("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!t&&/* @__PURE__ */Ue("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr(e,t){return"function"==typeof t?t(e):String(e[t])}function Xr(e,t){return e[t]}function qr(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function Zr({colCount:e}){const t=N();/* @__PURE__ */
|
|
312
|
+
return Ue("tbody",{children:Array.from({length:5},(n,o)=>/* @__PURE__ */Ue("tr",{children:Array.from({length:e},(e,n)=>/* @__PURE__ */Ue("td",{className:K("px-3 py-2"),style:{borderBottom:`1px solid ${t.border}`},children:/* @__PURE__ */Ue(Dt,{height:16})},n))},o))})}function _r({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[/* @__PURE__ */Ue("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&/* @__PURE__ */Ye("button",{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer"},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
|
|
313
313
|
/* @__PURE__ */Ue("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
|
|
314
314
|
/* @__PURE__ */Ue("polyline",{points:"7 10 12 15 17 10"}),
|
|
315
315
|
/* @__PURE__ */Ue("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Gr({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const a=(e-1)*n+1,l=Math.min(e*n,o),s={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer",fontSize:13,fontWeight:500};/* @__PURE__ */
|
|
@@ -317,14 +317,14 @@ return Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space
|
|
|
317
317
|
/* @__PURE__ */Ue("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...s,opacity:1===e?.4:1},children:"«"}),
|
|
318
318
|
/* @__PURE__ */Ue("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...s,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let a=o+1;return t>5&&(a=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),/* @__PURE__ */Ue("button",{onClick:()=>r(a),"aria-label":`Page ${a}`,"aria-current":a===e?"page":void 0,style:{...s,backgroundColor:a===e?i.primary:"transparent",color:a===e?i.bg:i.text,borderColor:a===e?i.primary:i.border},children:a},a)}),
|
|
319
319
|
/* @__PURE__ */Ue("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...s,opacity:e===t?.4:1},children:"›"}),
|
|
320
|
-
/* @__PURE__ */Ue("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...s,opacity:e===t?.4:1},children:"»"})]})]})}function Jr({columns:e,data:t,rowKey:n,selectable:o=!1,selectedRows:r=[],onSelectionChange:i,sortable:a=!1,onSort:l,loading:s=!1,emptyMessage:d,stickyHeader:c=!1,striped:u=!1,bordered:h=!1,compact:p=!1,maxHeight:f,onRowClick:m,virtualScroll:g,rowHeight:x=40,showFilters:y=!1,filterValues:b,onFilterChange:v,pageSize:w=0,showExport:k=!1,exportFileName:S="export",onLoadMore:C,hasMore:$,loadingMore:z=!1,loadMoreThreshold:M=200}){const I=N(),D=$e(),W=d??D.noRows??D.noData??"No data to display",L=ge(),R=Ee(),[T,A]=Ve(null),[B,F]=Ve("asc"),E=Ae(e=>{const t=T===e&&"asc"===B?"desc":"asc";A(e),F(t),l?.(e,t)},[T,B,l]),H=He(()=>l||!T?t:[...t].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Xr(e,T),Xr(t,T));return"asc"===B?n:-n}),[t,T,B,l]),[P,O]=Ve({}),V=b??P,U=Ae((e,t)=>{v?v(e,t):O(n=>({...n,[e]:t}))},[v]),Y=He(()=>{const e=Object.entries(V).filter(([,e])=>""!==e.trim());return 0===e.length?H:H.filter(t=>e.every(([e,n])=>{const o=Xr(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[H,V]),[X,q]=Ve(1),
|
|
321
|
-
return Ye("div",{role:"grid","aria-label":"Data grid","aria-rowcount":
|
|
322
|
-
/* @__PURE__ */Ue(
|
|
320
|
+
/* @__PURE__ */Ue("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...s,opacity:e===t?.4:1},children:"»"})]})]})}function Jr({columns:e,data:t,rowKey:n,selectable:o=!1,selectedRows:r=[],onSelectionChange:i,sortable:a=!1,onSort:l,loading:s=!1,emptyMessage:d,stickyHeader:c=!1,striped:u=!1,bordered:h=!1,compact:p=!1,maxHeight:f,onRowClick:m,virtualScroll:g,rowHeight:x=40,showFilters:y=!1,filterValues:b,onFilterChange:v,pageSize:w=0,showExport:k=!1,exportFileName:S="export",onLoadMore:C,hasMore:$,loadingMore:z=!1,loadMoreThreshold:M=200}){const I=N(),D=$e(),W=d??D.noRows??D.noData??"No data to display",L=ge(),R=Ee(),[T,A]=Ve(null),[B,F]=Ve("asc"),E=Ae(e=>{const t=T===e&&"asc"===B?"desc":"asc";A(e),F(t),l?.(e,t)},[T,B,l]),H=He(()=>l||!T?t:[...t].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Xr(e,T),Xr(t,T));return"asc"===B?n:-n}),[t,T,B,l]),[P,O]=Ve({}),V=b??P,U=Ae((e,t)=>{v?v(e,t):O(n=>({...n,[e]:t}))},[v]),Y=He(()=>{const e=Object.entries(V).filter(([,e])=>""!==e.trim());return 0===e.length?H:H.filter(t=>e.every(([e,n])=>{const o=Xr(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[H,V]),[X,q]=Ve(1),Z=w>0,_=Y.length,G=Z?Math.max(1,Math.ceil(_/w)):1;Fe(()=>{q(1)},[V,T,B]);const J=He(()=>Z?Y.slice((X-1)*w,X*w):Y,[Y,Z,X,w]),Q=void 0!==g?g:!Z&&void 0!==f&&J.length>=50,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Fe(()=>{if(!Q||!ee.current)return;const e=ee.current;re(e.clientHeight);const t=new ResizeObserver(()=>re(e.clientHeight));return t.observe(e),()=>t.disconnect()},[Q]),J.length;const ae=Q?Math.max(0,Math.floor(te/x)-10):0,le=Q?Math.min(J.length,Math.ceil((te+oe)/x)+10):J.length,se=Q?J.slice(ae,le):J,de=ae*x,ce=Oe(null),ue=Oe(!1);Fe(()=>{ue.current=!1},[t.length]),Fe(()=>{if(!C)return;const e=ce.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!ue.current&&!1!==$&&(ue.current=!0,C())},{root:ee.current,rootMargin:`0px 0px ${M}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[C,$,M]);const he=He(()=>new Set(r),[r]),pe=He(()=>Y.map(e=>Yr(e,n)),[Y,n]),fe=pe.length>0&&pe.every(e=>he.has(e)),me=pe.some(e=>he.has(e)),xe=Ae(()=>{i?.(fe?[]:pe)},[fe,pe,i]),ye=Ae(e=>{const t=he.has(e)?r.filter(t=>t!==e):[...r,e];i?.(t)},[he,r,i]),[be,ve]=Ve({}),we=Oe(null),ke=Ae((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=be[e]||n.getBoundingClientRect().width;we.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!we.current)return;const t=Math.max(50,we.current.startWidth+e.clientX-we.current.startX);ve(e=>({...e,[we.current.key]:t}))},i=()=>{we.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[be]),Se=Ae(()=>{const t=[e.map(e=>qr(e.header)).join(","),...Y.map(t=>e.map(e=>qr(Xr(t,e.key))).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=`${S}.csv`,r.click(),URL.revokeObjectURL(o)},[e,Y,S]),Ce=p?"4px":"8px",ze=p?"8px":"12px",Ne=e=>{const t=be[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Ce} ${ze}`}},Me=h?`1px solid ${I.border}`:"none",Ie=j(W),De=e.length+(o?1:0),We=e.some(e=>e.filterable);/* @__PURE__ */
|
|
321
|
+
return Ye("div",{role:"grid","aria-label":"Data grid","aria-rowcount":_,id:R,className:K("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${I.border}`,backgroundColor:I.bg},children:[
|
|
322
|
+
/* @__PURE__ */Ue(_r,{label:"data grid",showExport:k,onExport:Se,totalRows:_,selectedCount:r.length,theme:I}),
|
|
323
323
|
/* @__PURE__ */Ye("div",{ref:ee,onScroll:Q?ie:void 0,style:{maxHeight:f??"none",overflowX:"auto",overflowY:f?"auto":"visible"},children:[
|
|
324
324
|
/* @__PURE__ */Ye("table",{className:K("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[
|
|
325
325
|
/* @__PURE__ */Ye("thead",{children:[/* @__PURE__ */Ye("tr",{role:"row",children:[o&&/* @__PURE__ */Ue("th",{scope:"col",role:"columnheader",style:{position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,borderBottom:`2px solid ${I.border}`,borderRight:Me,padding:`${Ce} ${ze}`,width:40,textAlign:"center"},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[/* @__PURE__ */Ue("input",{type:"checkbox",checked:fe,ref:e=>{e&&(e.indeterminate=me&&!fe)},onChange:xe,"aria-label":fe?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ue(Ur,{checked:fe,indeterminate:me&&!fe})]})}),e.map(e=>{const t=(e.sortable??a)&&!1!==e.sortable,n=T===e.key,o=j(e.header);/* @__PURE__ */
|
|
326
|
-
return Ue("th",{scope:"col",role:"columnheader","aria-sort":n?"asc"===B?"ascending":"descending":t?"none":void 0,className:K("text-xs font-semibold uppercase tracking-wider"),style:{...Ne(e),position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,color:I.textMuted,borderBottom:`2px solid ${I.border}`,borderRight:Me,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:L?"none":"background-color 150ms ease"},onClick:t?()=>E(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),E(e.key))}:void 0,tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("div",{className:K("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):o,t&&/* @__PURE__ */Ue(Kr,{direction:n?B:null}),e.resizable&&/* @__PURE__ */Ue("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${o}`,className:K("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ke(e.key,t)})]})},e.key)})]}),(y||We)&&/* @__PURE__ */Ye("tr",{role:"row","aria-label":"Column filters",children:[o&&/* @__PURE__ */Ue("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`,width:40}}),e.map(e=>/* @__PURE__ */Ue("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`},children:(e.filterable||y)&&/* @__PURE__ */Ue("input",{type:"text",value:V[e.key]??"",onChange:t=>U(e.key,t.target.value),placeholder:`${D.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${I.border}`,backgroundColor:I.bg,color:I.text,outline:"none"}})},e.key))]})]}),s&&/* @__PURE__ */Ue(
|
|
327
|
-
return Ue("td",{role:"gridcell",className:K("text-sm"),style:{...Ne(e),borderBottom:`1px solid ${I.border}`,borderRight:Me,color:I.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o},e.key)})]},a)}),Q&&le<J.length&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ue("td",{colSpan:De,style:{height:(J.length-le)*x,padding:0,border:"none"}})})]})})]}),($||z)&&/* @__PURE__ */Ue("div",{ref:ce,style:{height:1,width:"100%"},children:z&&/* @__PURE__ */Ue("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ue("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ue("tr",{children:e.map(e=>/* @__PURE__ */Ue("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ue(Dt,{variant:"text",height:"16px"})},e.key))},n))})})}),!$&&C&&/* @__PURE__ */Ue("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:I.textMuted},children:"✓ All rows loaded"})]}),
|
|
326
|
+
return Ue("th",{scope:"col",role:"columnheader","aria-sort":n?"asc"===B?"ascending":"descending":t?"none":void 0,className:K("text-xs font-semibold uppercase tracking-wider"),style:{...Ne(e),position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,color:I.textMuted,borderBottom:`2px solid ${I.border}`,borderRight:Me,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:L?"none":"background-color 150ms ease"},onClick:t?()=>E(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),E(e.key))}:void 0,tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("div",{className:K("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):o,t&&/* @__PURE__ */Ue(Kr,{direction:n?B:null}),e.resizable&&/* @__PURE__ */Ue("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${o}`,className:K("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ke(e.key,t)})]})},e.key)})]}),(y||We)&&/* @__PURE__ */Ye("tr",{role:"row","aria-label":"Column filters",children:[o&&/* @__PURE__ */Ue("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`,width:40}}),e.map(e=>/* @__PURE__ */Ue("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`},children:(e.filterable||y)&&/* @__PURE__ */Ue("input",{type:"text",value:V[e.key]??"",onChange:t=>U(e.key,t.target.value),placeholder:`${D.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${I.border}`,backgroundColor:I.bg,color:I.text,outline:"none"}})},e.key))]})]}),s&&/* @__PURE__ */Ue(Zr,{colCount:De}),!s&&/* @__PURE__ */Ue("tbody",{children:0===J.length?/* @__PURE__ */Ue("tr",{children:/* @__PURE__ */Ue("td",{colSpan:De,className:K("text-center py-10"),style:{color:I.textMuted},children:Ie})}):/* @__PURE__ */Ye(Ke,{children:[Q&&de>0&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ue("td",{colSpan:De,style:{height:de,padding:0,border:"none"}})}),se.map((t,r)=>{const i=ae+r,a=Yr(t,n),l=he.has(a),s=u&&i%2==1;let d="transparent";return l?d=`${I.primary}22`:s&&(d=I.surfaceAlt),/* @__PURE__ */Ye("tr",{role:"row","aria-rowindex":i+1,"aria-selected":o?l:void 0,onClick:m?()=>m(t):void 0,onKeyDown:m?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m(t))}:void 0,tabIndex:m?0:void 0,className:K(m?"cursor-pointer":""),style:{backgroundColor:d,transition:L?"none":"background-color 120ms ease",...Q?{height:x,boxSizing:"border-box"}:{}},onMouseEnter:m?e=>{e.currentTarget.style.backgroundColor=l?`${I.primary}30`:I.surfaceAlt}:void 0,onMouseLeave:m?e=>{e.currentTarget.style.backgroundColor=d}:void 0,children:[o&&/* @__PURE__ */Ue("td",{role:"gridcell",style:{borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`${Ce} ${ze}`,textAlign:"center",width:40},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[/* @__PURE__ */Ue("input",{type:"checkbox",checked:l,onChange:()=>ye(a),"aria-label":l?`Deselect row ${a}`:`Select row ${a}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ue(Ur,{checked:l})]})}),e.map(e=>{const n=Xr(t,e.key),o=e.renderCell?e.renderCell(n,t):"string"==typeof n?j(n):String(n??"");/* @__PURE__ */
|
|
327
|
+
return Ue("td",{role:"gridcell",className:K("text-sm"),style:{...Ne(e),borderBottom:`1px solid ${I.border}`,borderRight:Me,color:I.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o},e.key)})]},a)}),Q&&le<J.length&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ue("td",{colSpan:De,style:{height:(J.length-le)*x,padding:0,border:"none"}})})]})})]}),($||z)&&/* @__PURE__ */Ue("div",{ref:ce,style:{height:1,width:"100%"},children:z&&/* @__PURE__ */Ue("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ue("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ue("tr",{children:e.map(e=>/* @__PURE__ */Ue("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ue(Dt,{variant:"text",height:"16px"})},e.key))},n))})})}),!$&&C&&/* @__PURE__ */Ue("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:I.textMuted},children:"✓ All rows loaded"})]}),Z&&!s&&/* @__PURE__ */Ue(Gr,{page:X,totalPages:G,pageSize:w,totalRows:_,onPageChange:q,theme:I})]})}var Qr=!1;function ei({columns:e,gap:t=16,children:n}){N();const o=ge(),r=function(){const[e,t]=Ve(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return Fe(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth;t(e>=1024?"lg":e>=768?"md":"sm")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();Fe(()=>{!function(){if(Qr||"undefined"==typeof document)return;Qr=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent="\n @keyframes tkx-masonry-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}()},[]);const i=function(e,t){return void 0===e?3:"number"==typeof e?Math.max(1,e):"lg"===t?e.lg??e.md??e.sm??3:"md"===t?e.md??e.sm??2:e.sm??1}(e,r),a=De.toArray(n),l=He(()=>{const e=Array.from({length:i},()=>[]);return a.forEach((t,n)=>{e[n%i].push(t)}),e},[a,i]);/* @__PURE__ */
|
|
328
328
|
return Ue("div",{role:"list","aria-label":"Masonry grid",className:K("flex w-full"),style:{gap:t,alignItems:"flex-start"},children:l.map((e,n)=>/* @__PURE__ */Ue("div",{className:K("flex flex-col"),style:{flex:1,gap:t,minWidth:0},children:e.map((e,t)=>{/* @__PURE__ */
|
|
329
329
|
return Ue("div",{role:"listitem",style:(r=t*i+n,o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*r,400)}ms`}),children:e},t);var r})},n))})}var ti={info:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),warning:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})})},ni={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}},oi={heading:function({block:e}){const t=N(),n=e.level??1,o=`h${n}`,r=j(e.content??"");/* @__PURE__ */
|
|
330
330
|
return Ue(o,{className:K("m-0"),style:{...ni[n],color:t.text},children:r})},paragraph:function({block:e}){const t=N(),n=j(e.content??"");/* @__PURE__ */
|
|
@@ -348,7 +348,7 @@ return Ye("aside",{ref:u,className:le("tkx-layout-sider",K("shrink-0 overflow-hi
|
|
|
348
348
|
return Ue("main",{ref:r,className:le("tkx-layout-content",K("flex-1 min-w-0 min-h-0"),t),style:{backgroundColor:i.bg,padding:"24px",...n},...o,children:e})});zi.displayName="TkxContent";var Ni=Te(({children:e,className:t,style:n,...o},r)=>{const i=N();/* @__PURE__ */
|
|
349
349
|
return Ue("footer",{ref:r,className:le("tkx-layout-footer",K("flex items-center px-6 py-4 shrink-0"),t),style:{backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,color:i.textMuted,...n},...o,children:e})});Ni.displayName="TkxFooter";var Mi={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},Ii={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Di=Te(({children:e,gutter:t,justify:n="start",align:o="top",wrap:r=!0,className:i,style:a,...l},s)=>{const[d,c]=Array.isArray(t)?t:[t??0,0],u=d/2,h=c/2,p=d||c?{marginLeft:-u,marginRight:-u,marginTop:-h,marginBottom:-h}:{},f={h:u,v:h};/* @__PURE__ */
|
|
350
350
|
return Ue(wi.Provider,{value:f,children:/* @__PURE__ */Ue("div",{ref:s,className:le("tkx-row",K("flex w-full"),i),style:{flexWrap:r?"wrap":"nowrap",justifyContent:Mi[n]??"flex-start",alignItems:Ii[o]??"flex-start",...p,...a},...l,children:e})})});Di.displayName="TkxRow";var Wi=!1;function Li(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var Ri=Te(({children:e,span:t,offset:n=0,push:o,pull:r,order:i,sm:a,md:l,lg:s,xl:d,className:c,style:u,...h},p)=>{Fe(()=>{!function(){if(Wi||"undefined"==typeof document)return;Wi=!0;const e=[];for(const[n,o]of Object.entries(bi)){for(let t=1;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${t} { flex: 0 0 ${r} !important; max-width: ${r} !important; } }`)}for(let t=0;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${t} { margin-left: ${r} !important; } }`)}}const t=document.createElement("style");t.id="tkx-col-responsive",t.textContent=e.join("\n"),document.head.appendChild(t)}()},[]);const f=Be(wi),m=void 0!==t?t/24*100+"%":void 0,g=n?n/24*100+"%":void 0,x=[],y=[["sm",a],["md",l],["lg",s],["xl",d]];for(const[v,w]of y){const e=Li(w);e&&(x.push(`tkx-col-${v}-${e.span}`),void 0!==e.offset&&e.offset>0&&x.push(`tkx-col-${v}-offset-${e.offset}`))}const b={};return void 0!==o&&(b.left=o/24*100+"%",b.position="relative"),void 0!==r&&(b.right=r/24*100+"%",b.position="relative"),void 0!==i&&(b.order=i),/* @__PURE__ */Ue("div",{ref:p,className:le("tkx-col",K("box-border min-h-[1px]"),...x,c),style:{flex:m?`0 0 ${m}`:"1",maxWidth:m??"100%",marginLeft:g,paddingLeft:f.h||void 0,paddingRight:f.h||void 0,paddingTop:f.v||void 0,paddingBottom:f.v||void 0,...b,...u},...h,children:e})});Ri.displayName="TkxCol";var Ti=Le({locale:"en-US",direction:"ltr",componentDefaults:{size:"md",variant:"default",animation:!0,bordered:!0},componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0});function Ai({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const a=Be(Ti),l=He(()=>({size:o?.size??a.componentDefaults.size,variant:o?.variant??a.componentDefaults.variant,animation:o?.animation??a.componentDefaults.animation,bordered:o?.bordered??a.componentDefaults.bordered}),[o,a.componentDefaults]),s=He(()=>{const e=a.componentOverrides,t=r??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[r,a.componentOverrides]),d=t??a.locale,c=n??a.direction,u=i??a.prefixCls,h=Ae(e=>`${u}-${e}`,[u]),p=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(t?.size)return t.size}return l.size},[l.size,s]),f=Ae(e=>void 0!==e?e:l.animation,[l.animation]),m=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(void 0!==t?.bordered)return t.bordered}return l.bordered},[l.bordered,s]),g=He(()=>({locale:d,direction:c,componentDefaults:l,componentOverrides:s,prefixCls:u,configured:!0,cls:h,getSize:p,getAnimation:f,getBordered:m}),[d,c,l,s,u,h,p,f,m]);/* @__PURE__ */
|
|
351
|
-
return Ue(Ti.Provider,{value:g,children:/* @__PURE__ */Ue("div",{dir:c,lang:d,className:`${u}-config-root`,style:{direction:c},children:e})})}function Bi(){return Be(Ti)}function Fi(e,t){const{prefixCls:n}=Bi();return`${t??n}-${e}`}function Ei(e,t){const{getSize:n}=Bi();return n(e,t)}Ai.displayName="TkxConfigProvider";var ji={sm:32,md:40,lg:48},Hi={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Pi={sm:8,md:12,lg:16},Oi={sm:4,md:8,lg:12},Vi={sm:4,md:6,lg:8},Ki={sm:14,md:16,lg:20};function Ui(){const{direction:e}=Bi();if("rtl"===e)return{transform:"scaleX(-1)"}}function Yi(e,t=0){const{direction:n}=Bi(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}}var Xi={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},qi=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function _i(e){return qi.has(e)||qi.has(e.split("-")[0])}function Zi(e){if(Xi[e])return Xi[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Gi(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Gi).join(""):e&&"object"==typeof e&&"props"in e?Gi(e.props.children):""}function Ji({text:e}){const t=N(),[n,o]=Ve(!1);return Re("button",{type:"button",onClick:Ae(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]),"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?t.success:t.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function Qi(e="default"){const t=N();return{default:t.text,secondary:t.textMuted,success:t.success,warning:t.warning,danger:t.danger}[e]}var ea={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}};function ta({level:e=1,children:t,copyable:n=!1,type:o="default",style:r}){const i=Qi(o);N();const a=ea[e],l=`h${e}`,s="string"==typeof t?j(t):t,d=Gi(t);return Re(l,{style:{color:i,fontSize:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...r}},s,n&&Re(Ji,{text:d}))}function na({children:e,type:t="default",strong:n=!1,italic:o=!1,underline:r=!1,delete:i=!1,code:a=!1,mark:l=!1,copyable:s=!1,style:d}){const c=Qi(t),u=N(),h=Gi(e),p="string"==typeof e?j(e):e,f=[];r&&f.push("underline"),i&&f.push("line-through");let m=p;return a&&(m=Re("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:"4px",fontFamily:"monospace"}},m)),l&&(m=Re("mark",{style:{backgroundColor:`${u.warning}33`,color:c,padding:"0 2px",borderRadius:"2px"}},m)),Re(n?"strong":o?"em":"span",{style:{color:c,fontStyle:o?"italic":"normal",textDecoration:f.length>0?f.join(" "):"none",...d}},m,s&&Re(Ji,{text:h}))}function oa({children:e,type:t="default",copyable:n=!1,ellipsis:o=!1,style:r}){const i=N(),a="secondary"===t?i.textMuted:i.text,l=Gi(e),s="string"==typeof e?j(e):e,d={};if(o){const e="object"==typeof o?o.rows??3:3;d.display="-webkit-box",d.WebkitLineClamp=e,d.WebkitBoxOrient="vertical",d.overflow="hidden"}return Re("div",{style:{color:a,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...d,...r}},s,n&&Re(Ji,{text:l}))}var ra={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ia=!1;function aa({size:e,color:t}){return Re("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},Re("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),Re("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function la({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?Re(aa,{size:e,color:n}):(function(){if(ia||"undefined"==typeof document)return;ia=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),Re("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function sa({spinning:e=!0,size:t="md",tip:n,indicator:o,children:r,fullscreen:i=!1,delay:a=0,style:l}){const s=N(),d=ge(),[c,u]=Ve(0===a&&e),h=Oe(null);if(Fe(()=>(e&&a>0?h.current=setTimeout(()=>u(!0),a):u(e),()=>{null!==h.current&&clearTimeout(h.current)}),[e,a]),!c)return r?Re("div",{style:l},r):null;const p=ra[t],f=n?j(n):void 0,m=Re("div",{role:"status","aria-live":"polite","aria-label":f??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??Re(la,{size:p.dimension,borderWidth:p.borderWidth,color:s.primary,reducedMotion:d}),f&&Re("span",{style:{color:s.primary,fontSize:p.fontSize,marginTop:"4px"}},f));return i?Re("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}cc`,zIndex:9999,...l}},m):r?Re("div",{style:{position:"relative",...l}},Re("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:d?"none":"opacity 0.2s, filter 0.2s"}},r),Re("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}66`,borderRadius:"4px"}},m)):Re("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...l}},m)}function da({color:e,mutedColor:t}){return Re("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},Re("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),Re("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function ca({mutedColor:e}){return Re("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},Re("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),Re("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),Re("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function ua({image:e="default",description:t="No data",children:n,style:o}){const r=N(),i="string"==typeof t?j(t):t;let a;return a="default"===e?Re(da,{color:r.primary,mutedColor:r.textMuted}):"simple"===e?Re(ca,{mutedColor:r.textMuted}):e,Re("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},Re("div",{style:{marginBottom:"12px",opacity:.85}},a),i&&Re("div",{style:{color:r.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},i),n&&Re("div",{style:{marginTop:"16px"}},n))}function ha({direction:e,color:t}){return Re("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},Re("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var pa=!1;function fa({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(pa||"undefined"==typeof document)return;pa=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}(),Re("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function ma({title:e,value:t,prefix:n,suffix:o,precision:r,groupSeparator:i=",",valueStyle:a,loading:l=!1,trend:s,trendValue:d,style:c}){const u=N(),h=ge(),p=j(e),f=d?j(d):void 0,m="up"===s?u.success:"down"===s?u.danger:void 0;return Re("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},Re("div",{style:{color:u.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),l?Re(fa,{w:"120px",h:"32px",alt:u.surfaceAlt,bdr:u.border,rm:h}):Re("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u.text,fontVariantNumeric:"tabular-nums",...a}},n&&Re("span",{style:{fontSize:"0.75em",fontWeight:400}},n),Re("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(t,r,i)),o&&Re("span",{style:{fontSize:"0.6em",fontWeight:400,color:u.textMuted}},o)),s&&Re("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:m,marginTop:"2px"}},Re(ha,{direction:s,color:m}),f&&Re("span",null,f)))}function ga({title:e,value:t,format:n="HH:mm:ss",onFinish:o,prefix:r,suffix:i,style:a}){const l=N(),s=j(e),d=Oe(o);d.current=o;const c=Oe(!1),[u,h]=Ve(()=>Math.max(0,t-Date.now()));Fe(()=>{c.current=!1;const e=()=>{const e=Math.max(0,t-Date.now());h(e),e<=0&&!c.current&&(c.current=!0,d.current?.())};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const p=function(e,t){if(e<=0)return t.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),a=n%60,l=e=>String(e).padStart(2,"0");return t.replace(/DD/g,l(o)).replace(/D/g,String(o)).replace(/HH/g,l(r)).replace(/H/g,String(r)).replace(/mm/g,l(i)).replace(/m/g,String(i)).replace(/ss/g,l(a)).replace(/s/g,String(a))}(u,n);return Re("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...a}},Re("div",{style:{color:l.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},s),Re("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u<=0?l.danger:l.text,fontVariantNumeric:"tabular-nums"}},r&&Re("span",{style:{fontSize:"0.75em",fontWeight:400}},r),Re("span",null,p),i&&Re("span",{style:{fontSize:"0.6em",fontWeight:400,color:l.textMuted}},i)))}var xa={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function ya({options:e,value:t,onChange:n,size:o="md",block:r=!1}){const i=N(),a=ge(),l=Oe(null),[s,d]=Ve(()=>Math.max(0,e.findIndex(e=>e.value===t))),[c,u]=Ve({}),h=xa[o];Fe(()=>{const n=e.findIndex(e=>e.value===t);n>=0&&d(n)},[t,e]),Fe(()=>{const e=l.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[s];t&&u({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:a?"none":"left 0.2s ease, width 0.2s ease"})},[s,e,a]);const p=Ae(t=>{const o=e[t];o&&!o.disabled&&(d(t),n?.(o.value))},[e,n]),f=Ae(t=>{let n=s;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(s+1)%e.length;e[n]?.disabled&&n!==s;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(s-1+e.length)%e.length;e[n]?.disabled&&n!==s;)n=(n-1+e.length)%e.length;n!==s&&(p(n),(l.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[s,e,p]);/* @__PURE__ */
|
|
351
|
+
return Ue(Ti.Provider,{value:g,children:/* @__PURE__ */Ue("div",{dir:c,lang:d,className:`${u}-config-root`,style:{direction:c},children:e})})}function Bi(){return Be(Ti)}function Fi(e,t){const{prefixCls:n}=Bi();return`${t??n}-${e}`}function Ei(e,t){const{getSize:n}=Bi();return n(e,t)}Ai.displayName="TkxConfigProvider";var ji={sm:32,md:40,lg:48},Hi={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Pi={sm:8,md:12,lg:16},Oi={sm:4,md:8,lg:12},Vi={sm:4,md:6,lg:8},Ki={sm:14,md:16,lg:20};function Ui(){const{direction:e}=Bi();if("rtl"===e)return{transform:"scaleX(-1)"}}function Yi(e,t=0){const{direction:n}=Bi(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}}var Xi={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},qi=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function Zi(e){return qi.has(e)||qi.has(e.split("-")[0])}function _i(e){if(Xi[e])return Xi[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Gi(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Gi).join(""):e&&"object"==typeof e&&"props"in e?Gi(e.props.children):""}function Ji({text:e}){const t=N(),[n,o]=Ve(!1);return Re("button",{type:"button",onClick:Ae(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]),"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?t.success:t.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function Qi(e="default"){const t=N();return{default:t.text,secondary:t.textMuted,success:t.success,warning:t.warning,danger:t.danger}[e]}var ea={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}};function ta({level:e=1,children:t,copyable:n=!1,type:o="default",style:r}){const i=Qi(o);N();const a=ea[e],l=`h${e}`,s="string"==typeof t?j(t):t,d=Gi(t);return Re(l,{style:{color:i,fontSize:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...r}},s,n&&Re(Ji,{text:d}))}function na({children:e,type:t="default",strong:n=!1,italic:o=!1,underline:r=!1,delete:i=!1,code:a=!1,mark:l=!1,copyable:s=!1,style:d}){const c=Qi(t),u=N(),h=Gi(e),p="string"==typeof e?j(e):e,f=[];r&&f.push("underline"),i&&f.push("line-through");let m=p;return a&&(m=Re("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:"4px",fontFamily:"monospace"}},m)),l&&(m=Re("mark",{style:{backgroundColor:`${u.warning}33`,color:c,padding:"0 2px",borderRadius:"2px"}},m)),Re(n?"strong":o?"em":"span",{style:{color:c,fontStyle:o?"italic":"normal",textDecoration:f.length>0?f.join(" "):"none",...d}},m,s&&Re(Ji,{text:h}))}function oa({children:e,type:t="default",copyable:n=!1,ellipsis:o=!1,style:r}){const i=N(),a="secondary"===t?i.textMuted:i.text,l=Gi(e),s="string"==typeof e?j(e):e,d={};if(o){const e="object"==typeof o?o.rows??3:3;d.display="-webkit-box",d.WebkitLineClamp=e,d.WebkitBoxOrient="vertical",d.overflow="hidden"}return Re("div",{style:{color:a,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...d,...r}},s,n&&Re(Ji,{text:l}))}var ra={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ia=!1;function aa({size:e,color:t}){return Re("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},Re("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),Re("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function la({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?Re(aa,{size:e,color:n}):(function(){if(ia||"undefined"==typeof document)return;ia=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),Re("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function sa({spinning:e=!0,size:t="md",tip:n,indicator:o,children:r,fullscreen:i=!1,delay:a=0,style:l}){const s=N(),d=ge(),[c,u]=Ve(0===a&&e),h=Oe(null);if(Fe(()=>(e&&a>0?h.current=setTimeout(()=>u(!0),a):u(e),()=>{null!==h.current&&clearTimeout(h.current)}),[e,a]),!c)return r?Re("div",{style:l},r):null;const p=ra[t],f=n?j(n):void 0,m=Re("div",{role:"status","aria-live":"polite","aria-label":f??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??Re(la,{size:p.dimension,borderWidth:p.borderWidth,color:s.primary,reducedMotion:d}),f&&Re("span",{style:{color:s.primary,fontSize:p.fontSize,marginTop:"4px"}},f));return i?Re("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}cc`,zIndex:9999,...l}},m):r?Re("div",{style:{position:"relative",...l}},Re("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:d?"none":"opacity 0.2s, filter 0.2s"}},r),Re("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}66`,borderRadius:"4px"}},m)):Re("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...l}},m)}function da({color:e,mutedColor:t}){return Re("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},Re("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),Re("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function ca({mutedColor:e}){return Re("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},Re("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),Re("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),Re("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function ua({image:e="default",description:t="No data",children:n,style:o}){const r=N(),i="string"==typeof t?j(t):t;let a;return a="default"===e?Re(da,{color:r.primary,mutedColor:r.textMuted}):"simple"===e?Re(ca,{mutedColor:r.textMuted}):e,Re("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},Re("div",{style:{marginBottom:"12px",opacity:.85}},a),i&&Re("div",{style:{color:r.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},i),n&&Re("div",{style:{marginTop:"16px"}},n))}function ha({direction:e,color:t}){return Re("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},Re("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var pa=!1;function fa({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(pa||"undefined"==typeof document)return;pa=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}(),Re("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function ma({title:e,value:t,prefix:n,suffix:o,precision:r,groupSeparator:i=",",valueStyle:a,loading:l=!1,trend:s,trendValue:d,style:c}){const u=N(),h=ge(),p=j(e),f=d?j(d):void 0,m="up"===s?u.success:"down"===s?u.danger:void 0;return Re("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},Re("div",{style:{color:u.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),l?Re(fa,{w:"120px",h:"32px",alt:u.surfaceAlt,bdr:u.border,rm:h}):Re("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u.text,fontVariantNumeric:"tabular-nums",...a}},n&&Re("span",{style:{fontSize:"0.75em",fontWeight:400}},n),Re("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(t,r,i)),o&&Re("span",{style:{fontSize:"0.6em",fontWeight:400,color:u.textMuted}},o)),s&&Re("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:m,marginTop:"2px"}},Re(ha,{direction:s,color:m}),f&&Re("span",null,f)))}function ga({title:e,value:t,format:n="HH:mm:ss",onFinish:o,prefix:r,suffix:i,style:a}){const l=N(),s=j(e),d=Oe(o);d.current=o;const c=Oe(!1),[u,h]=Ve(()=>Math.max(0,t-Date.now()));Fe(()=>{c.current=!1;const e=()=>{const e=Math.max(0,t-Date.now());h(e),e<=0&&!c.current&&(c.current=!0,d.current?.())};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const p=function(e,t){if(e<=0)return t.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),a=n%60,l=e=>String(e).padStart(2,"0");return t.replace(/DD/g,l(o)).replace(/D/g,String(o)).replace(/HH/g,l(r)).replace(/H/g,String(r)).replace(/mm/g,l(i)).replace(/m/g,String(i)).replace(/ss/g,l(a)).replace(/s/g,String(a))}(u,n);return Re("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...a}},Re("div",{style:{color:l.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},s),Re("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u<=0?l.danger:l.text,fontVariantNumeric:"tabular-nums"}},r&&Re("span",{style:{fontSize:"0.75em",fontWeight:400}},r),Re("span",null,p),i&&Re("span",{style:{fontSize:"0.6em",fontWeight:400,color:l.textMuted}},i)))}var xa={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function ya({options:e,value:t,onChange:n,size:o="md",block:r=!1}){const i=N(),a=ge(),l=Oe(null),[s,d]=Ve(()=>Math.max(0,e.findIndex(e=>e.value===t))),[c,u]=Ve({}),h=xa[o];Fe(()=>{const n=e.findIndex(e=>e.value===t);n>=0&&d(n)},[t,e]),Fe(()=>{const e=l.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[s];t&&u({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:a?"none":"left 0.2s ease, width 0.2s ease"})},[s,e,a]);const p=Ae(t=>{const o=e[t];o&&!o.disabled&&(d(t),n?.(o.value))},[e,n]),f=Ae(t=>{let n=s;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(s+1)%e.length;e[n]?.disabled&&n!==s;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(s-1+e.length)%e.length;e[n]?.disabled&&n!==s;)n=(n-1+e.length)%e.length;n!==s&&(p(n),(l.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[s,e,p]);/* @__PURE__ */
|
|
352
352
|
return Ye("div",{ref:l,role:"radiogroup","aria-label":"Segmented control",className:K("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:i.surfaceAlt,border:`1px solid ${i.border}`,width:r?"100%":void 0},onKeyDown:f,children:[/* @__PURE__ */Ue("div",{"aria-hidden":"true",className:K("absolute top-1 rounded-md"),style:{...c,backgroundColor:i.surface,boxShadow:`0 1px 3px ${i.border}`,zIndex:0}}),e.map((e,t)=>{const n=t===s,o=j(e.label);/* @__PURE__ */
|
|
353
353
|
return Ye("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":n,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:n?0:-1,className:K("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:h.height,fontSize:h.fontSize,padding:`0 ${h.px}px`,flex:r?1:void 0,color:n?i.text:i.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:n?600:400,transition:a?"none":"color 0.15s ease"},onClick:()=>p(t),children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:e.icon}),o]},e.value)})]})}function ba({options:e,value:t="",onChange:n,trigger:o="@",placeholder:r,label:i}){const a=N(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(t),[h,p]=Ve(!1),[f,m]=Ve(""),[g,x]=Ve(0),[y,b]=Ve(-1);Fe(()=>{void 0!==t&&u(t)},[t]);const v=e.filter(e=>e.label.toLowerCase().includes(f.toLowerCase())),w=Ae(e=>{const t=e.target.value;u(t),n?.(t);const r=e.target.selectionStart??t.length,i=t.slice(0,r),a=i.lastIndexOf(o);if(a>=0){const e=i.slice(a+o.length);if(!/\s/.test(e))return m(e),b(a),p(!0),void x(0)}p(!1)},[o,n]),k=Ae(e=>{const t=c.slice(0,y),r=c.slice(y+o.length+f.length),i=`${t}${o}${e.value} ${r}`;u(i),n?.(i),p(!1),s.current?.focus()},[c,y,o,f,n]),S=Ae(e=>{h&&("ArrowDown"===e.key?(e.preventDefault(),x(e=>(e+1)%v.length)):"ArrowUp"===e.key?(e.preventDefault(),x(e=>(e-1+v.length)%v.length)):"Enter"===e.key&&v[g]?(e.preventDefault(),k(v[g])):"Escape"===e.key&&p(!1))},[h,v,g,k]);Fe(()=>{h&&d.current&&d.current.children[g]?.scrollIntoView({block:"nearest"})},[g,h]);const C=i?j(i):void 0,$=r?j(r):void 0;/* @__PURE__ */
|
|
354
354
|
return Ye("div",{className:K("relative font-sans"),style:{width:"100%"},children:[C&&/* @__PURE__ */Ue("label",{className:K("block text-sm font-medium mb-1"),style:{color:a.text},children:C}),
|
|
@@ -383,7 +383,7 @@ return Ye("div",{className:K("relative font-sans"),onKeyDown:v,children:[g&&/* @
|
|
|
383
383
|
return Ye("div",{className:K("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[/* @__PURE__ */Ue("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ye("div",{className:K("flex-1"),children:[/* @__PURE__ */Ue("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ue("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function Ea({items:e,header:t,footer:n,bordered:o=!0,size:r="md",loading:i=!1,emptyText:a="No data",grid:l}){const s=N(),d=ge(),c=j(a),u=Ba[r],h=!!l,p=l?.column??1,f=l?.gutter??16;/* @__PURE__ */
|
|
384
384
|
return Ye("div",{role:"list","aria-label":"List","aria-busy":i,className:K("font-sans rounded-lg overflow-hidden"),style:{border:o?`1px solid ${s.border}`:"none",backgroundColor:s.surface},children:[t&&/* @__PURE__ */Ue("div",{className:K("font-semibold text-sm"),style:{padding:u,color:s.text,borderBottom:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:t}),i&&/* @__PURE__ */Ue("div",{children:Array.from({length:3}).map((e,t)=>/* @__PURE__ */Ue(Fa,{theme:s,reducedMotion:d},t))}),!i&&0===e.length&&/* @__PURE__ */Ue("div",{role:"status",className:K("text-center py-12 text-sm"),style:{color:s.textMuted},children:c}),!i&&e.length>0&&/* @__PURE__ */Ue("div",{style:h?{display:"grid",gridTemplateColumns:`repeat(${p}, 1fr)`,gap:f,padding:f}:void 0,children:e.map((t,n)=>{const o=j(t.title),r=t.description?j(t.description):void 0;/* @__PURE__ */
|
|
385
385
|
return Ye("div",{role:"listitem",className:K("flex items-start gap-3"),style:{padding:u,borderBottom:!h&&n<e.length-1?`1px solid ${s.border}`:"none",...h?{border:`1px solid ${s.border}`,borderRadius:8,backgroundColor:s.surface}:{},animation:d?"none":`tkxFadeIn 0.2s ease ${.03*n}s both`},children:[t.avatar&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",className:K("shrink-0"),children:t.avatar}),
|
|
386
|
-
/* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[/* @__PURE__ */Ue("div",{className:K("text-sm font-medium"),style:{color:s.text},children:o}),r&&/* @__PURE__ */Ue("div",{className:K("text-xs mt-1 leading-relaxed"),style:{color:s.textMuted},children:r})]}),t.extra&&/* @__PURE__ */Ue("div",{className:K("shrink-0 ml-auto"),style:{color:s.textMuted},children:t.extra}),t.actions&&/* @__PURE__ */Ue("div",{className:K("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),n&&/* @__PURE__ */Ue("div",{className:K("text-sm"),style:{padding:u,color:s.textMuted,borderTop:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:n})]})}var ja={turnstile:"https://challenges.cloudflare.com/turnstile/v0/api.js",hcaptcha:"https://js.hcaptcha.com/1/api.js",recaptcha:"https://www.google.com/recaptcha/api.js"},Ha={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Pa=/^[A-Za-z0-9_-]{20,80}$/,Oa={},Va=Te(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:a,onExpire:l,onError:s,className:d,style:c,testMode:u=!1},h){const p=Oe(null),f=Oe(null),m=Oe(null);return"string"!=typeof t||Pa.test(t),je(h,()=>({reset:()=>{if(u)return void(m.current=null);const t=window[Ha[e]];if(t&&null!=f.current){try{t.reset?.(f.current)}catch{}m.current=null}},execute:()=>{if(u)return void setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);const t=window[Ha[e]];if(t&&null!=f.current)try{t.execute?.(f.current)}catch{}},getResponse:()=>m.current}),[e,a,u]),Fe(()=>{if(u){const e=window.setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let d=!1,c=null;const h=p.current;if(h)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[Ha[e]])return Promise.resolve();if(Oa[e])return Oa[e];const n=new Promise((n,o)=>{const r=document.querySelector(`script[data-tkx-captcha="${e}"]`);if(r)return r.addEventListener("load",()=>n()),void r.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed")));const i=document.createElement("script");let a=ja[e];t&&"turnstile"!==e&&(a+=`?hl=${encodeURIComponent(t)}`),i.src=a,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(i)});return Oa[e]=n,n}(e,r).then(()=>{if(d||!h)return;const u=window[Ha[e]];if(!u)return;const p={callback:e=>{m.current=e,a(e)},"expired-callback":()=>{m.current=null,l?.()},"error-callback":e=>{m.current=null,s?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?c=u.render(h,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...p}):"hcaptcha"===e?c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...p}):"recaptcha"===e&&(c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...p})),f.current=c}catch(g){s?.(g?.message||"render-failed")}}).catch(()=>{d||s?.("script-load-failed")}),()=>{d=!0;const t=window[Ha[e]];if(t&&null!=c)try{t.remove?.(c)}catch{}f.current=null,m.current=null}},[]),/* @__PURE__ */Ue("div",{ref:p,className:d,style:c,"data-tkx-captcha-provider":e,children:u&&/* @__PURE__ */Ue("div",{"aria-live":"polite",style:{padding:"12px 16px",border:"1px dashed currentColor",borderRadius:8,fontSize:13,opacity:.7,display:"inline-block"},children:"[TkxCaptcha test mode — auto-verifying with TEST_TOKEN]"})})});Va.displayName="TkxCaptcha";var Ka={latin:{id:"tkx-font-latin",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},"latin-ext":{id:"tkx-font-latin-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=latin-ext"},devanagari:{id:"tkx-font-devanagari",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap"},tamil:{id:"tkx-font-tamil",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap"},telugu:{id:"tkx-font-telugu",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;500;600;700&display=swap"},kannada:{id:"tkx-font-kannada",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Kannada:wght@400;500;600;700&display=swap"},malayalam:{id:"tkx-font-malayalam",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap"},bengali:{id:"tkx-font-bengali",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap"},gujarati:{id:"tkx-font-gujarati",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap"},gurmukhi:{id:"tkx-font-gurmukhi",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gurmukhi:wght@400;500;600;700&display=swap"},oriya:{id:"tkx-font-oriya",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Oriya:wght@400;500;600;700&display=swap"},sinhala:{id:"tkx-font-sinhala",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap"},arabic:{id:"tkx-font-arabic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},hebrew:{id:"tkx-font-hebrew",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"},thai:{id:"tkx-font-thai",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap"},vietnamese:{id:"tkx-font-vietnamese",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=vietnamese"},cyrillic:{id:"tkx-font-cyrillic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic"},"cyrillic-ext":{id:"tkx-font-cyrillic-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic-ext"},greek:{id:"tkx-font-greek",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek"},"greek-ext":{id:"tkx-font-greek-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek-ext"},jp:{id:"tkx-font-jp",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap"},kr:{id:"tkx-font-kr",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap"},sc:{id:"tkx-font-sc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap"},tc:{id:"tkx-font-tc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap"}},Ua={en:["latin"],hi:["devanagari"],mr:["devanagari"],sa:["devanagari"],ne:["devanagari"],ta:["tamil"],te:["telugu"],kn:["kannada"],ml:["malayalam"],bn:["bengali"],as:["bengali"],gu:["gujarati"],pa:["gurmukhi"],or:["oriya"],si:["sinhala"],ar:["arabic"],ur:["arabic"],fa:["arabic"],he:["hebrew"],th:["thai"],vi:["vietnamese","latin"],ru:["cyrillic"],uk:["cyrillic"],bg:["cyrillic"],el:["greek"],ja:["jp"],ko:["kr"],zh:["sc"],"zh-CN":["sc"],"zh-TW":["tc"],"zh-HK":["tc"]},Ya=!1;function Xa(e){if("undefined"==typeof document)return;const t=Ka[e];if(!t)return;if(document.getElementById(t.id))return;const n=document.createElement("link");n.id=t.id,n.rel="stylesheet",n.href=t.href,document.head.appendChild(n)}function qa(e){return e&&(Ua[e]||Ua[e.split("-")[0]])||["latin"]}function _a({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?qa(t):["latin"];return Fe(()=>{n&&function(){if(Ya||"undefined"==typeof document)return;const e=document.head,t=(t,n)=>{if(e.querySelector(`link[rel="preconnect"][href="${t}"]`))return;const o=document.createElement("link");o.rel="preconnect",o.href=t,n&&(o.crossOrigin="anonymous"),e.appendChild(o)};t("https://fonts.googleapis.com"),t("https://fonts.gstatic.com",!0),Ya=!0}(),r.forEach(Xa)},[r.join(","),n]),null==o?null:/* @__PURE__ */Ue(Ke,{children:o})}function Za(e){Xa(e)}function Ga(e){!function(e){if("undefined"==typeof document)return;const t=Ka[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)}var Ja=[{iso2:"in",name:"India",dial:"91",length:10,format:"##### #####",flag:"🇮🇳"},{iso2:"us",name:"United States",dial:"1",length:10,format:"(###) ###-####",flag:"🇺🇸"},{iso2:"gb",name:"United Kingdom",dial:"44",length:[9,10],format:"#### ######",flag:"🇬🇧"},{iso2:"ca",name:"Canada",dial:"1",length:10,format:"(###) ###-####",flag:"🇨🇦"},{iso2:"au",name:"Australia",dial:"61",length:9,format:"### ### ###",flag:"🇦🇺"},{iso2:"de",name:"Germany",dial:"49",length:[10,11],format:"#### ########",flag:"🇩🇪"},{iso2:"fr",name:"France",dial:"33",length:9,format:"# ## ## ## ##",flag:"🇫🇷"},{iso2:"es",name:"Spain",dial:"34",length:9,format:"### ### ###",flag:"🇪🇸"},{iso2:"it",name:"Italy",dial:"39",length:[9,10],format:"### ### ####",flag:"🇮🇹"},{iso2:"nl",name:"Netherlands",dial:"31",length:9,format:"# #### ####",flag:"🇳🇱"},{iso2:"se",name:"Sweden",dial:"46",length:[7,9],format:"## ### ## ##",flag:"🇸🇪"},{iso2:"no",name:"Norway",dial:"47",length:8,format:"### ## ###",flag:"🇳🇴"},{iso2:"dk",name:"Denmark",dial:"45",length:8,format:"## ## ## ##",flag:"🇩🇰"},{iso2:"fi",name:"Finland",dial:"358",length:[9,10],format:"## ### ####",flag:"🇫🇮"},{iso2:"pl",name:"Poland",dial:"48",length:9,format:"### ### ###",flag:"🇵🇱"},{iso2:"ie",name:"Ireland",dial:"353",length:9,format:"## ### ####",flag:"🇮🇪"},{iso2:"pt",name:"Portugal",dial:"351",length:9,format:"### ### ###",flag:"🇵🇹"},{iso2:"ch",name:"Switzerland",dial:"41",length:9,format:"## ### ## ##",flag:"🇨🇭"},{iso2:"at",name:"Austria",dial:"43",length:[10,11],format:"### ### ####",flag:"🇦🇹"},{iso2:"be",name:"Belgium",dial:"32",length:9,format:"### ## ## ##",flag:"🇧🇪"},{iso2:"jp",name:"Japan",dial:"81",length:10,format:"## #### ####",flag:"🇯🇵"},{iso2:"kr",name:"South Korea",dial:"82",length:[9,10],format:"## #### ####",flag:"🇰🇷"},{iso2:"cn",name:"China",dial:"86",length:11,format:"### #### ####",flag:"🇨🇳"},{iso2:"hk",name:"Hong Kong",dial:"852",length:8,format:"#### ####",flag:"🇭🇰"},{iso2:"sg",name:"Singapore",dial:"65",length:8,format:"#### ####",flag:"🇸🇬"},{iso2:"my",name:"Malaysia",dial:"60",length:[9,10],format:"## ### ####",flag:"🇲🇾"},{iso2:"id",name:"Indonesia",dial:"62",length:[9,12],format:"### ### ####",flag:"🇮🇩"},{iso2:"th",name:"Thailand",dial:"66",length:9,format:"## ### ####",flag:"🇹🇭"},{iso2:"vn",name:"Vietnam",dial:"84",length:[9,10],format:"### ### ####",flag:"🇻🇳"},{iso2:"ph",name:"Philippines",dial:"63",length:10,format:"### ### ####",flag:"🇵🇭"},{iso2:"pk",name:"Pakistan",dial:"92",length:10,format:"### #######",flag:"🇵🇰"},{iso2:"bd",name:"Bangladesh",dial:"880",length:10,format:"#### ######",flag:"🇧🇩"},{iso2:"lk",name:"Sri Lanka",dial:"94",length:9,format:"## ### ####",flag:"🇱🇰"},{iso2:"np",name:"Nepal",dial:"977",length:10,format:"###-#######",flag:"🇳🇵"},{iso2:"ae",name:"UAE",dial:"971",length:9,format:"## ### ####",flag:"🇦🇪"},{iso2:"sa",name:"Saudi Arabia",dial:"966",length:9,format:"## ### ####",flag:"🇸🇦"},{iso2:"qa",name:"Qatar",dial:"974",length:8,format:"#### ####",flag:"🇶🇦"},{iso2:"kw",name:"Kuwait",dial:"965",length:8,format:"#### ####",flag:"🇰🇼"},{iso2:"om",name:"Oman",dial:"968",length:8,format:"#### ####",flag:"🇴🇲"},{iso2:"bh",name:"Bahrain",dial:"973",length:8,format:"#### ####",flag:"🇧🇭"},{iso2:"il",name:"Israel",dial:"972",length:9,format:"## ### ####",flag:"🇮🇱"},{iso2:"tr",name:"Turkey",dial:"90",length:10,format:"### ### ####",flag:"🇹🇷"},{iso2:"ru",name:"Russia",dial:"7",length:10,format:"### ### ####",flag:"🇷🇺"},{iso2:"ua",name:"Ukraine",dial:"380",length:9,format:"## ### ####",flag:"🇺🇦"},{iso2:"br",name:"Brazil",dial:"55",length:[10,11],format:"## ##### ####",flag:"🇧🇷"},{iso2:"mx",name:"Mexico",dial:"52",length:10,format:"## #### ####",flag:"🇲🇽"},{iso2:"ar",name:"Argentina",dial:"54",length:10,format:"## #### ####",flag:"🇦🇷"},{iso2:"cl",name:"Chile",dial:"56",length:9,format:"# #### ####",flag:"🇨🇱"},{iso2:"co",name:"Colombia",dial:"57",length:10,format:"### ### ####",flag:"🇨🇴"},{iso2:"pe",name:"Peru",dial:"51",length:9,format:"### ### ###",flag:"🇵🇪"},{iso2:"za",name:"South Africa",dial:"27",length:9,format:"## ### ####",flag:"🇿🇦"},{iso2:"ng",name:"Nigeria",dial:"234",length:10,format:"### ### ####",flag:"🇳🇬"},{iso2:"ke",name:"Kenya",dial:"254",length:9,format:"### ### ###",flag:"🇰🇪"},{iso2:"eg",name:"Egypt",dial:"20",length:10,format:"### ### ####",flag:"🇪🇬"},{iso2:"ma",name:"Morocco",dial:"212",length:9,format:"## ### ####",flag:"🇲🇦"},{iso2:"nz",name:"New Zealand",dial:"64",length:[8,9],format:"## ### ####",flag:"🇳🇿"}];function Qa(e){return e.replace(/\D+/g,"")}function el(e,t){if(!t)return e;let n="",o=0;for(const r of t)if("#"===r){if(o>=e.length)break;n+=e[o++]}else o<e.length&&(n+=r);return o<e.length&&(n+=e.slice(o)),n}function tl(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nl(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var ol=Te(function({defaultCountry:e="in",value:t,defaultValue:n,onChange:o,onValid:r,label:i,placeholder:a,disabled:l,required:s,id:d,name:c,extraCountries:u=[],className:h,style:p},f){const m=N(),g=Ee(),x=Ee(),y=He(()=>[...Ja,...u].sort((e,t)=>e.name.localeCompare(t.name)),[u]),b=e=>y.find(t=>t.iso2===e.toLowerCase())||y[0],v=t=>{if(!t.startsWith("+"))return{country:b(e),digits:Qa(t)};const n=Qa(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=y.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:b(e),digits:n}},w=t?v(t):{country:b(e),digits:Qa(n||"")},[k,S]=Ve(w.country),[C,$]=Ve(w.digits),[z,M]=Ve(!1),[I,D]=Ve(""),[W,L]=Ve(0),R=Oe(null),T=Oe(null);Fe(()=>{if(void 0===t)return;const e=v(t);S(e.country),$(e.digits)},[t]);const A=el(C,k.format),B=tl(C,k.length),F=C?`+${k.dial}${C}`:"",E=(e,t)=>{const n={raw:el(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tl(e,t.length)};o?.(n)},j=e=>{S(e),M(!1),E(C,e),R.current?.focus()},H=He(()=>{const e=I.trim().toLowerCase();return e?y.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):y},[y,I]);Fe(()=>{L(0)},[I]),Fe(()=>{if(z){const e=setTimeout(()=>T.current?.focus(),0);return()=>clearTimeout(e)}},[z]);const P=a??nl(k.length).replace(/\d/g,"#"),O={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...p},V={fontSize:13,fontWeight:600,color:m.text},K={display:"flex",alignItems:"stretch",border:`1px solid ${m.border}`,borderRadius:8,background:m.surface,overflow:"visible",position:"relative"},U={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${m.border}`,cursor:l?"not-allowed":"pointer",color:m.text,fontSize:14,minHeight:40,fontWeight:500},Y={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:m.text,background:"transparent",minHeight:40,minWidth:0},X={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},q={width:"100%",padding:"8px 10px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,fontSize:13,marginBottom:6,outline:"none"},_={fontSize:12,color:m.danger,marginTop:2};/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[/* @__PURE__ */Ue("div",{className:K("text-sm font-medium"),style:{color:s.text},children:o}),r&&/* @__PURE__ */Ue("div",{className:K("text-xs mt-1 leading-relaxed"),style:{color:s.textMuted},children:r})]}),t.extra&&/* @__PURE__ */Ue("div",{className:K("shrink-0 ml-auto"),style:{color:s.textMuted},children:t.extra}),t.actions&&/* @__PURE__ */Ue("div",{className:K("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),n&&/* @__PURE__ */Ue("div",{className:K("text-sm"),style:{padding:u,color:s.textMuted,borderTop:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:n})]})}var ja={turnstile:"https://challenges.cloudflare.com/turnstile/v0/api.js",hcaptcha:"https://js.hcaptcha.com/1/api.js",recaptcha:"https://www.google.com/recaptcha/api.js"},Ha={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Pa=/^[A-Za-z0-9_-]{20,80}$/,Oa={},Va=Te(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:a,onExpire:l,onError:s,className:d,style:c,testMode:u=!1},h){const p=Oe(null),f=Oe(null),m=Oe(null);return"string"!=typeof t||Pa.test(t),je(h,()=>({reset:()=>{if(u)return void(m.current=null);const t=window[Ha[e]];if(t&&null!=f.current){try{t.reset?.(f.current)}catch{}m.current=null}},execute:()=>{if(u)return void setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);const t=window[Ha[e]];if(t&&null!=f.current)try{t.execute?.(f.current)}catch{}},getResponse:()=>m.current}),[e,a,u]),Fe(()=>{if(u){const e=window.setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let d=!1,c=null;const h=p.current;if(h)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[Ha[e]])return Promise.resolve();if(Oa[e])return Oa[e];const n=new Promise((n,o)=>{const r=document.querySelector(`script[data-tkx-captcha="${e}"]`);if(r)return r.addEventListener("load",()=>n()),void r.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed")));const i=document.createElement("script");let a=ja[e];t&&"turnstile"!==e&&(a+=`?hl=${encodeURIComponent(t)}`),i.src=a,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(i)});return Oa[e]=n,n}(e,r).then(()=>{if(d||!h)return;const u=window[Ha[e]];if(!u)return;const p={callback:e=>{m.current=e,a(e)},"expired-callback":()=>{m.current=null,l?.()},"error-callback":e=>{m.current=null,s?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?c=u.render(h,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...p}):"hcaptcha"===e?c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...p}):"recaptcha"===e&&(c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...p})),f.current=c}catch(g){s?.(g?.message||"render-failed")}}).catch(()=>{d||s?.("script-load-failed")}),()=>{d=!0;const t=window[Ha[e]];if(t&&null!=c)try{t.remove?.(c)}catch{}f.current=null,m.current=null}},[]),/* @__PURE__ */Ue("div",{ref:p,className:d,style:c,"data-tkx-captcha-provider":e,children:u&&/* @__PURE__ */Ue("div",{"aria-live":"polite",style:{padding:"12px 16px",border:"1px dashed currentColor",borderRadius:8,fontSize:13,opacity:.7,display:"inline-block"},children:"[TkxCaptcha test mode — auto-verifying with TEST_TOKEN]"})})});Va.displayName="TkxCaptcha";var Ka={latin:{id:"tkx-font-latin",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},"latin-ext":{id:"tkx-font-latin-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=latin-ext"},devanagari:{id:"tkx-font-devanagari",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap"},tamil:{id:"tkx-font-tamil",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap"},telugu:{id:"tkx-font-telugu",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;500;600;700&display=swap"},kannada:{id:"tkx-font-kannada",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Kannada:wght@400;500;600;700&display=swap"},malayalam:{id:"tkx-font-malayalam",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap"},bengali:{id:"tkx-font-bengali",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap"},gujarati:{id:"tkx-font-gujarati",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap"},gurmukhi:{id:"tkx-font-gurmukhi",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gurmukhi:wght@400;500;600;700&display=swap"},oriya:{id:"tkx-font-oriya",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Oriya:wght@400;500;600;700&display=swap"},sinhala:{id:"tkx-font-sinhala",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap"},arabic:{id:"tkx-font-arabic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},hebrew:{id:"tkx-font-hebrew",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"},thai:{id:"tkx-font-thai",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap"},vietnamese:{id:"tkx-font-vietnamese",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=vietnamese"},cyrillic:{id:"tkx-font-cyrillic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic"},"cyrillic-ext":{id:"tkx-font-cyrillic-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic-ext"},greek:{id:"tkx-font-greek",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek"},"greek-ext":{id:"tkx-font-greek-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek-ext"},jp:{id:"tkx-font-jp",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap"},kr:{id:"tkx-font-kr",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap"},sc:{id:"tkx-font-sc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap"},tc:{id:"tkx-font-tc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap"}},Ua={en:["latin"],hi:["devanagari"],mr:["devanagari"],sa:["devanagari"],ne:["devanagari"],ta:["tamil"],te:["telugu"],kn:["kannada"],ml:["malayalam"],bn:["bengali"],as:["bengali"],gu:["gujarati"],pa:["gurmukhi"],or:["oriya"],si:["sinhala"],ar:["arabic"],ur:["arabic"],fa:["arabic"],he:["hebrew"],th:["thai"],vi:["vietnamese","latin"],ru:["cyrillic"],uk:["cyrillic"],bg:["cyrillic"],el:["greek"],ja:["jp"],ko:["kr"],zh:["sc"],"zh-CN":["sc"],"zh-TW":["tc"],"zh-HK":["tc"]},Ya=!1;function Xa(e){if("undefined"==typeof document)return;const t=Ka[e];if(!t)return;if(document.getElementById(t.id))return;const n=document.createElement("link");n.id=t.id,n.rel="stylesheet",n.href=t.href,document.head.appendChild(n)}function qa(e){return e&&(Ua[e]||Ua[e.split("-")[0]])||["latin"]}function Za({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?qa(t):["latin"];return Fe(()=>{n&&function(){if(Ya||"undefined"==typeof document)return;const e=document.head,t=(t,n)=>{if(e.querySelector(`link[rel="preconnect"][href="${t}"]`))return;const o=document.createElement("link");o.rel="preconnect",o.href=t,n&&(o.crossOrigin="anonymous"),e.appendChild(o)};t("https://fonts.googleapis.com"),t("https://fonts.gstatic.com",!0),Ya=!0}(),r.forEach(Xa)},[r.join(","),n]),null==o?null:/* @__PURE__ */Ue(Ke,{children:o})}function _a(e){Xa(e)}function Ga(e){!function(e){if("undefined"==typeof document)return;const t=Ka[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)}var Ja=[{iso2:"in",name:"India",dial:"91",length:10,format:"##### #####",flag:"🇮🇳"},{iso2:"us",name:"United States",dial:"1",length:10,format:"(###) ###-####",flag:"🇺🇸"},{iso2:"gb",name:"United Kingdom",dial:"44",length:[9,10],format:"#### ######",flag:"🇬🇧"},{iso2:"ca",name:"Canada",dial:"1",length:10,format:"(###) ###-####",flag:"🇨🇦"},{iso2:"au",name:"Australia",dial:"61",length:9,format:"### ### ###",flag:"🇦🇺"},{iso2:"de",name:"Germany",dial:"49",length:[10,11],format:"#### ########",flag:"🇩🇪"},{iso2:"fr",name:"France",dial:"33",length:9,format:"# ## ## ## ##",flag:"🇫🇷"},{iso2:"es",name:"Spain",dial:"34",length:9,format:"### ### ###",flag:"🇪🇸"},{iso2:"it",name:"Italy",dial:"39",length:[9,10],format:"### ### ####",flag:"🇮🇹"},{iso2:"nl",name:"Netherlands",dial:"31",length:9,format:"# #### ####",flag:"🇳🇱"},{iso2:"se",name:"Sweden",dial:"46",length:[7,9],format:"## ### ## ##",flag:"🇸🇪"},{iso2:"no",name:"Norway",dial:"47",length:8,format:"### ## ###",flag:"🇳🇴"},{iso2:"dk",name:"Denmark",dial:"45",length:8,format:"## ## ## ##",flag:"🇩🇰"},{iso2:"fi",name:"Finland",dial:"358",length:[9,10],format:"## ### ####",flag:"🇫🇮"},{iso2:"pl",name:"Poland",dial:"48",length:9,format:"### ### ###",flag:"🇵🇱"},{iso2:"ie",name:"Ireland",dial:"353",length:9,format:"## ### ####",flag:"🇮🇪"},{iso2:"pt",name:"Portugal",dial:"351",length:9,format:"### ### ###",flag:"🇵🇹"},{iso2:"ch",name:"Switzerland",dial:"41",length:9,format:"## ### ## ##",flag:"🇨🇭"},{iso2:"at",name:"Austria",dial:"43",length:[10,11],format:"### ### ####",flag:"🇦🇹"},{iso2:"be",name:"Belgium",dial:"32",length:9,format:"### ## ## ##",flag:"🇧🇪"},{iso2:"jp",name:"Japan",dial:"81",length:10,format:"## #### ####",flag:"🇯🇵"},{iso2:"kr",name:"South Korea",dial:"82",length:[9,10],format:"## #### ####",flag:"🇰🇷"},{iso2:"cn",name:"China",dial:"86",length:11,format:"### #### ####",flag:"🇨🇳"},{iso2:"hk",name:"Hong Kong",dial:"852",length:8,format:"#### ####",flag:"🇭🇰"},{iso2:"sg",name:"Singapore",dial:"65",length:8,format:"#### ####",flag:"🇸🇬"},{iso2:"my",name:"Malaysia",dial:"60",length:[9,10],format:"## ### ####",flag:"🇲🇾"},{iso2:"id",name:"Indonesia",dial:"62",length:[9,12],format:"### ### ####",flag:"🇮🇩"},{iso2:"th",name:"Thailand",dial:"66",length:9,format:"## ### ####",flag:"🇹🇭"},{iso2:"vn",name:"Vietnam",dial:"84",length:[9,10],format:"### ### ####",flag:"🇻🇳"},{iso2:"ph",name:"Philippines",dial:"63",length:10,format:"### ### ####",flag:"🇵🇭"},{iso2:"pk",name:"Pakistan",dial:"92",length:10,format:"### #######",flag:"🇵🇰"},{iso2:"bd",name:"Bangladesh",dial:"880",length:10,format:"#### ######",flag:"🇧🇩"},{iso2:"lk",name:"Sri Lanka",dial:"94",length:9,format:"## ### ####",flag:"🇱🇰"},{iso2:"np",name:"Nepal",dial:"977",length:10,format:"###-#######",flag:"🇳🇵"},{iso2:"ae",name:"UAE",dial:"971",length:9,format:"## ### ####",flag:"🇦🇪"},{iso2:"sa",name:"Saudi Arabia",dial:"966",length:9,format:"## ### ####",flag:"🇸🇦"},{iso2:"qa",name:"Qatar",dial:"974",length:8,format:"#### ####",flag:"🇶🇦"},{iso2:"kw",name:"Kuwait",dial:"965",length:8,format:"#### ####",flag:"🇰🇼"},{iso2:"om",name:"Oman",dial:"968",length:8,format:"#### ####",flag:"🇴🇲"},{iso2:"bh",name:"Bahrain",dial:"973",length:8,format:"#### ####",flag:"🇧🇭"},{iso2:"il",name:"Israel",dial:"972",length:9,format:"## ### ####",flag:"🇮🇱"},{iso2:"tr",name:"Turkey",dial:"90",length:10,format:"### ### ####",flag:"🇹🇷"},{iso2:"ru",name:"Russia",dial:"7",length:10,format:"### ### ####",flag:"🇷🇺"},{iso2:"ua",name:"Ukraine",dial:"380",length:9,format:"## ### ####",flag:"🇺🇦"},{iso2:"br",name:"Brazil",dial:"55",length:[10,11],format:"## ##### ####",flag:"🇧🇷"},{iso2:"mx",name:"Mexico",dial:"52",length:10,format:"## #### ####",flag:"🇲🇽"},{iso2:"ar",name:"Argentina",dial:"54",length:10,format:"## #### ####",flag:"🇦🇷"},{iso2:"cl",name:"Chile",dial:"56",length:9,format:"# #### ####",flag:"🇨🇱"},{iso2:"co",name:"Colombia",dial:"57",length:10,format:"### ### ####",flag:"🇨🇴"},{iso2:"pe",name:"Peru",dial:"51",length:9,format:"### ### ###",flag:"🇵🇪"},{iso2:"za",name:"South Africa",dial:"27",length:9,format:"## ### ####",flag:"🇿🇦"},{iso2:"ng",name:"Nigeria",dial:"234",length:10,format:"### ### ####",flag:"🇳🇬"},{iso2:"ke",name:"Kenya",dial:"254",length:9,format:"### ### ###",flag:"🇰🇪"},{iso2:"eg",name:"Egypt",dial:"20",length:10,format:"### ### ####",flag:"🇪🇬"},{iso2:"ma",name:"Morocco",dial:"212",length:9,format:"## ### ####",flag:"🇲🇦"},{iso2:"nz",name:"New Zealand",dial:"64",length:[8,9],format:"## ### ####",flag:"🇳🇿"}];function Qa(e){return e.replace(/\D+/g,"")}function el(e,t){if(!t)return e;let n="",o=0;for(const r of t)if("#"===r){if(o>=e.length)break;n+=e[o++]}else o<e.length&&(n+=r);return o<e.length&&(n+=e.slice(o)),n}function tl(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nl(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var ol=Te(function({defaultCountry:e="in",value:t,defaultValue:n,onChange:o,onValid:r,label:i,placeholder:a,disabled:l,required:s,id:d,name:c,extraCountries:u=[],className:h,style:p},f){const m=N(),g=Ee(),x=Ee(),y=He(()=>[...Ja,...u].sort((e,t)=>e.name.localeCompare(t.name)),[u]),b=e=>y.find(t=>t.iso2===e.toLowerCase())||y[0],v=t=>{if(!t.startsWith("+"))return{country:b(e),digits:Qa(t)};const n=Qa(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=y.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:b(e),digits:n}},w=t?v(t):{country:b(e),digits:Qa(n||"")},[k,S]=Ve(w.country),[C,$]=Ve(w.digits),[z,M]=Ve(!1),[I,D]=Ve(""),[W,L]=Ve(0),R=Oe(null),T=Oe(null);Fe(()=>{if(void 0===t)return;const e=v(t);S(e.country),$(e.digits)},[t]);const A=el(C,k.format),B=tl(C,k.length),F=C?`+${k.dial}${C}`:"",E=(e,t)=>{const n={raw:el(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tl(e,t.length)};o?.(n)},j=e=>{S(e),M(!1),E(C,e),R.current?.focus()},H=He(()=>{const e=I.trim().toLowerCase();return e?y.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):y},[y,I]);Fe(()=>{L(0)},[I]),Fe(()=>{if(z){const e=setTimeout(()=>T.current?.focus(),0);return()=>clearTimeout(e)}},[z]);const P=a??nl(k.length).replace(/\d/g,"#"),O={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...p},V={fontSize:13,fontWeight:600,color:m.text},K={display:"flex",alignItems:"stretch",border:`1px solid ${m.border}`,borderRadius:8,background:m.surface,overflow:"visible",position:"relative"},U={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${m.border}`,cursor:l?"not-allowed":"pointer",color:m.text,fontSize:14,minHeight:40,fontWeight:500},Y={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:m.text,background:"transparent",minHeight:40,minWidth:0},X={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},q={width:"100%",padding:"8px 10px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,fontSize:13,marginBottom:6,outline:"none"},Z={fontSize:12,color:m.danger,marginTop:2};/* @__PURE__ */
|
|
387
387
|
return Ye("div",{className:h,style:O,onKeyDown:e=>{z&&("ArrowDown"===e.key?(e.preventDefault(),L(e=>Math.min(H.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),L(e=>Math.max(0,e-1))):"Enter"===e.key?(e.preventDefault(),H[W]&&j(H[W])):"Escape"===e.key&&(e.preventDefault(),M(!1),R.current?.focus()))},children:[i&&/* @__PURE__ */Ye("label",{htmlFor:d||g,style:V,children:[i,s&&/* @__PURE__ */Ue("span",{style:{color:m.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),
|
|
388
388
|
/* @__PURE__ */Ye("div",{style:K,children:[
|
|
389
389
|
/* @__PURE__ */Ye("button",{ref:R,type:"button",style:U,onClick:()=>!l&&M(e=>!e),"aria-haspopup":"listbox","aria-expanded":z,"aria-controls":x,"aria-label":`Country: ${k.name}, dial code +${k.dial}`,disabled:l,children:[
|
|
@@ -394,7 +394,7 @@ return Ye("div",{className:h,style:O,onKeyDown:e=>{z&&("ArrowDown"===e.key?(e.pr
|
|
|
394
394
|
/* @__PURE__ */Ue("input",{ref:T,type:"text",placeholder:"Search country or dial code…",value:I,onChange:e=>D(e.target.value),style:q,"aria-label":"Filter countries"}),0===H.length&&/* @__PURE__ */Ye("div",{style:{padding:"12px 10px",fontSize:13,color:m.textMuted},children:['No country matches "',I,'"']}),H.map((e,t)=>{/* @__PURE__ */return Ye("div",{role:"option","aria-selected":t===W,onMouseEnter:()=>L(t),onClick:()=>j(e),style:(n=t===W,{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",borderRadius:6,cursor:"pointer",background:n?m.surfaceAlt:"transparent",color:m.text,fontSize:13}),children:[
|
|
395
395
|
/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{fontSize:16},children:e.flag}),
|
|
396
396
|
/* @__PURE__ */Ue("span",{style:{flex:1},children:e.name}),
|
|
397
|
-
/* @__PURE__ */Ye("span",{style:{color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),C.length>0&&!B&&/* @__PURE__ */Ye("div",{id:`${g}-err`,role:"alert",style:
|
|
397
|
+
/* @__PURE__ */Ye("span",{style:{color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),C.length>0&&!B&&/* @__PURE__ */Ye("div",{id:`${g}-err`,role:"alert",style:Z,children:["Expected ",nl(k.length)," digits for ",k.name,"."]})]})});ol.displayName="TkxPhoneInput";var rl={free:null,"1:1":1,"3:4":3/4,"4:5":.8,"16:9":16/9,"4:3":4/3,"3:2":1.5},il={drop:"Drop an image here, or",browse:"browse",rotate:"Rotate",apply:"Apply",cancel:"Cancel",brightness:"Brightness",contrast:"Contrast",aspect:"Aspect",free:"Free"},al=Te(function({src:e,aspectRatio:t="free",ratios:n=["free","1:1","3:4","4:5","16:9"],mimeType:o="image/png",quality:r=.92,maxOutputSize:i=2048,outputFilename:a="edited.png",onChange:l,onResult:s,onCancel:d,className:c,style:u,labels:h},p){const f={...il,...h},m=N(),g=Oe(null),x=Oe(null),y=Oe(null),b=Oe(null),[v,w]=Ve(e??null),[k,S]=Ve(null),[C,$]=Ve(t),[z,M]=Ve(0),[I,D]=Ve(100),[W,L]=Ve(100),[R,T]=Ve({x:0,y:0,w:0,h:0}),[A,B]=Ve(!1),F=Oe({mode:null,startX:0,startY:0,startCrop:{x:0,y:0,w:0,h:0}});Fe(()=>{if(!v)return b.current=null,void S(null);const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{b.current=e,S({w:e.naturalWidth,h:e.naturalHeight});const t=rl[C];if(t){const n=Math.min(e.naturalWidth,e.naturalHeight*t),o=n/t;T({x:(e.naturalWidth-n)/2,y:(e.naturalHeight-o)/2,w:n,h:o})}else T({x:0,y:0,w:e.naturalWidth,h:e.naturalHeight})},e.src=v},[v,C]),Fe(()=>{l?.({rotation:z,brightness:I,contrast:W})},[z,I,W,l]);const E=Ae(()=>{const e=x.current,t=b.current,n=k;if(!e||!t||!n)return;const o=e.getContext("2d");if(!o)return;const r=y.current,i=r?Math.min(r.clientWidth,800):600,a=z%180!=0,l=a?n.h:n.w,s=a?n.w:n.h,d=Math.min(i/l,600/s,1),c=Math.floor(l*d),u=Math.floor(s*d);e.width=c,e.height=u,o.save(),o.filter=`brightness(${I}%) contrast(${W}%)`,o.translate(c/2,u/2),o.rotate(z*Math.PI/180),o.drawImage(t,-n.w*d/2,-n.h*d/2,n.w*d,n.h*d),o.restore()},[z,I,W,k]);Fe(()=>{E()},[E]),Fe(()=>{const e=k;if(!e)return;const t=rl[C];t&&T(n=>{const o=n.x+n.w/2,r=n.y+n.h/2;let i=n.w,a=i/t;return a>e.h&&(a=e.h,i=a*t),i>e.w&&(i=e.w,a=i/t),{x:Math.max(0,Math.min(e.w-i,o-i/2)),y:Math.max(0,Math.min(e.h-a,r-a/2)),w:i,h:a}})},[C,k]);const j=e=>{const t=new FileReader;t.onload=()=>{"string"==typeof t.result&&(w(t.result),M(0),D(100),L(100))},t.readAsDataURL(e)},H=e=>t=>{t.preventDefault(),t.stopPropagation();const n="touches"in t?t.touches[0]:t;F.current={mode:e,startX:n.clientX,startY:n.clientY,startCrop:{...R}};const o=e=>{e.preventDefault();const t="touches"in e?e.touches[0]:e,n=t.clientX-F.current.startX,o=t.clientY-F.current.startY,r=k;if(!r)return;const i=x.current;if(!i)return;const a=n*(r.w/i.width),l=o*(r.h/i.height),s=F.current.startCrop,d=rl[C];let c={...s};if("move"===F.current.mode)c.x=Math.max(0,Math.min(r.w-s.w,s.x+a)),c.y=Math.max(0,Math.min(r.h-s.h,s.y+l));else{const e=F.current.mode;if("se"===e)c.w=Math.max(20,Math.min(r.w-s.x,s.w+a)),c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+l));else if("sw"===e){const e=Math.max(20,s.w-a);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x,c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+l))}else if("ne"===e){c.w=Math.max(20,Math.min(r.w-s.x,s.w+a));const e=d?c.w/d:Math.max(20,s.h-l);c.y=Math.max(0,s.y+s.h-e),c.h=s.y+s.h-c.y}else if("nw"===e){const e=Math.max(20,s.w-a);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x;const t=d?c.w/d:Math.max(20,s.h-l);c.y=Math.max(0,s.y+s.h-t),c.h=s.y+s.h-c.y}}T(c)},r=()=>{F.current.mode=null,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",r)};window.addEventListener("mousemove",o,{passive:!1}),window.addEventListener("mouseup",r),window.addEventListener("touchmove",o,{passive:!1}),window.addEventListener("touchend",r)},P=Ae(()=>new Promise(e=>{const t=b.current,n=k;if(!t||!n)return e(null);const l=document.createElement("canvas"),s=z%180!=0,d=s?R.h:R.w,c=s?R.w:R.h,u=Math.min(1,i/Math.max(d,c));l.width=Math.round(d*u),l.height=Math.round(c*u);const h=l.getContext("2d");if(!h)return e(null);h.filter=`brightness(${I}%) contrast(${W}%)`;const p=document.createElement("canvas");p.width=s?n.h:n.w,p.height=s?n.w:n.h;const f=p.getContext("2d");if(!f)return e(null);f.translate(p.width/2,p.height/2),f.rotate(z*Math.PI/180),f.drawImage(t,-n.w/2,-n.h/2,n.w,n.h),h.drawImage(p,R.x,R.y,R.w,R.h,0,0,l.width,l.height),l.toBlob(t=>{if(!t)return e(null);const n="image/jpeg"===o?"jpg":"image/webp"===o?"webp":"png",r=a.endsWith(`.${n}`)?a:a.replace(/\.\w+$/,"")+`.${n}`;e({blob:t,file:new File([t],r,{type:o,lastModified:Date.now()}),url:URL.createObjectURL(t),width:l.width,height:l.height})},o,r)}),[R,z,I,W,k,o,r,i,a]);je(p,()=>({getResult:P,reset:()=>{if(M(0),D(100),L(100),k){const e=rl[C];if(e){const t=Math.min(k.w,k.h*e),n=t/e;T({x:(k.w-t)/2,y:(k.h-n)/2,w:t,h:n})}else T({x:0,y:0,w:k.w,h:k.h})}},loadSource:e=>w(e)}),[P,C,k]);const O={border:`1px solid ${m.border}`,borderRadius:12,background:m.surface,padding:16,...u},V={border:`2px dashed ${A?m.primary:m.border}`,borderRadius:10,padding:48,textAlign:"center",color:m.textMuted,cursor:"pointer",transition:"border-color 0.15s",background:A?`${m.primary}10`:"transparent"},K={padding:"8px 14px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,cursor:"pointer",fontSize:13,fontWeight:600,minHeight:36},U=He(()=>{const e=x.current,t=k;if(!e||!t)return null;const n=z%180!=0,o=n?t.h:t.w,r=n?t.w:t.h,i=e.width/o,a=e.height/r;return{left:R.x*i,top:R.y*a,width:R.w*i,height:R.h*a}},[R,k,z]);return v?/* @__PURE__ */Ye("div",{ref:y,className:c,style:O,children:[
|
|
398
398
|
/* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12,alignItems:"center"},children:[
|
|
399
399
|
/* @__PURE__ */Ye("span",{style:{fontSize:13,fontWeight:600,marginRight:4},children:[f.aspect,":"]}),n.map(e=>{/* @__PURE__ */return Ue("button",{type:"button",onClick:()=>$(e),style:(t=C===e,{...K,background:t?m.primary:m.bg,color:t?m.bg:m.text,borderColor:t?m.primary:m.border}),"aria-pressed":C===e,children:"free"===e?f.free:e},e);var t}),
|
|
400
400
|
/* @__PURE__ */Ue("div",{style:{width:1,height:24,background:m.border,margin:"0 4px"}}),
|
|
@@ -446,13 +446,13 @@ return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,
|
|
|
446
446
|
return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ue("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
|
|
447
447
|
/* @__PURE__ */Ue("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:10,value:y,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:Ol(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===y.length&&!b,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==y.length||b?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.5,outline:"none",textTransform:"uppercase"},placeholder:"ABC1234567"}),10===y.length&&!b&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Voter ID format."})]})});Vl.displayName="TkxVoterIdInput";var Kl=15;function Ul(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return t.length===Kl&&/^[A-Z]{2}[0-9]{13}$/.test(t)}function Yl(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return 0===t.length?"":[t.slice(0,2),t.slice(2,4),t.slice(4,8),t.slice(8)].filter(Boolean).join("-")}var Xl=Te(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=Ee(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase()),y=m?e??"":g,b=y.toUpperCase().replace(/[\s-]/g,"").slice(0,Kl),v=Ul(b);/* @__PURE__ */
|
|
448
448
|
return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ue("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
|
|
449
|
-
/* @__PURE__ */Ue("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:20,value:y,onChange:e=>(e=>{const t=e.toUpperCase();m||x(t);const o=t.replace(/[\s-]/g,"").slice(0,Kl);n?.({raw:e,normalised:o,pretty:Yl(o),valid:Ul(o)})})(e.target.value),disabled:r,required:i,"aria-invalid":b.length===Kl&&!v,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${b.length!==Kl||v?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),b.length===Kl&&!v&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Driving Licence format."})]})});function ql(e,t,n){try{return new Intl.NumberFormat(n??"en-US",{style:"currency",currency:t,maximumFractionDigits:e%1==0?0:2}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}Xl.displayName="TkxDrivingLicenceInput";var
|
|
449
|
+
/* @__PURE__ */Ue("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:20,value:y,onChange:e=>(e=>{const t=e.toUpperCase();m||x(t);const o=t.replace(/[\s-]/g,"").slice(0,Kl);n?.({raw:e,normalised:o,pretty:Yl(o),valid:Ul(o)})})(e.target.value),disabled:r,required:i,"aria-invalid":b.length===Kl&&!v,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${b.length!==Kl||v?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),b.length===Kl&&!v&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Driving Licence format."})]})});function ql(e,t,n){try{return new Intl.NumberFormat(n??"en-US",{style:"currency",currency:t,maximumFractionDigits:e%1==0?0:2}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}Xl.displayName="TkxDrivingLicenceInput";var Zl=Te(function({plans:e,cycle:t,selectedId:n,onSelect:o,className:r,style:i},a){const l=N();/* @__PURE__ */
|
|
450
450
|
return Ue("div",{ref:a,className:r,style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:16,...i},role:"radiogroup","aria-label":"Plans",children:e.map(e=>{const r=e.id===n;/* @__PURE__ */
|
|
451
451
|
return Ye("button",{type:"button",role:"radio","aria-checked":r,disabled:e.disabled,onClick:()=>!e.disabled&&o?.(e),style:{position:"relative",padding:20,borderRadius:12,border:`${e.highlighted?2:1}px solid ${r||e.highlighted?l.primary:l.border}`,background:l.surface,color:l.text,textAlign:"left",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,transition:"border-color 0.15s, transform 0.05s",fontFamily:"inherit",fontSize:"inherit",width:"100%"},children:[e.highlighted&&/* @__PURE__ */Ue("span",{style:{position:"absolute",top:-10,right:16,background:l.primary,color:l.bg,fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:4,letterSpacing:.4,textTransform:"uppercase"},"aria-hidden":"true",children:"Most popular"}),
|
|
452
452
|
/* @__PURE__ */Ue("div",{style:{fontSize:12,fontWeight:700,color:l.textMuted,textTransform:"uppercase",letterSpacing:.5},children:e.name}),e.tagline&&/* @__PURE__ */Ue("div",{style:{fontSize:12,color:l.textMuted,marginTop:2},children:e.tagline}),
|
|
453
453
|
/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"baseline",gap:4,marginTop:12},children:[/* @__PURE__ */Ue("span",{style:{fontSize:32,fontWeight:800,color:l.text},children:ql(e.prices[t],e.currency,e.locale)}),/* @__PURE__ */Ye("span",{style:{fontSize:12,color:l.textMuted},children:["/ ","monthly"===t?"mo":"yr"]})]}),
|
|
454
454
|
/* @__PURE__ */Ue("ul",{style:{listStyle:"none",padding:0,margin:"16px 0 0",fontSize:13,lineHeight:1.7},children:e.features.map(e=>/* @__PURE__ */Ye("li",{style:{display:"flex",gap:6,alignItems:"flex-start",color:l.text},children:[/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{color:l.success},children:"✓"}),/* @__PURE__ */Ue("span",{children:e})]},e))}),
|
|
455
|
-
/* @__PURE__ */Ue("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:r?l.primary:"transparent",color:r?l.bg:l.primary,border:`1px solid ${l.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(r?"Selected":`Choose ${e.name}`)})]},e.id)})})});function
|
|
455
|
+
/* @__PURE__ */Ue("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:r?l.primary:"transparent",color:r?l.bg:l.primary,border:`1px solid ${l.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(r?"Selected":`Choose ${e.name}`)})]},e.id)})})});function _l({value:e,onChange:t,annualSavingsLabel:n,className:o,style:r}){const i=N(),a={display:"inline-flex",alignItems:"center",gap:8,padding:4,border:`1px solid ${i.border}`,borderRadius:999,background:i.surface,...r},l=e=>({padding:"6px 16px",borderRadius:999,fontSize:13,fontWeight:600,background:e?i.primary:"transparent",color:e?i.bg:i.text,border:"none",cursor:"pointer",transition:"background 0.15s, color 0.15s",display:"inline-flex",alignItems:"center",gap:6});/* @__PURE__ */
|
|
456
456
|
return Ye("div",{role:"radiogroup","aria-label":"Billing cycle",className:o,style:a,children:[/* @__PURE__ */Ue("button",{type:"button",role:"radio","aria-checked":"monthly"===e,onClick:()=>t("monthly"),style:l("monthly"===e),children:"Monthly"}),/* @__PURE__ */Ye("button",{type:"button",role:"radio","aria-checked":"annual"===e,onClick:()=>t("annual"),style:l("annual"===e),children:["Annual",n&&/* @__PURE__ */Ue("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"annual"===e?i.bg:i.success,color:"annual"===e?i.success:i.bg,fontWeight:700},children:n})]})]})}function Gl({newPlan:e,currentPlan:t,cycle:n,daysRemaining:o,cycleDays:r,className:i,style:a,children:l}){const s=N(),d=r>0?o/r:0,c=t.prices[n]*d,u=e.prices[n]*d,h=Math.max(0,u-c),p=Math.max(0,c-u),f={border:`1px solid ${s.border}`,borderRadius:12,padding:20,background:s.surface,...a},m={display:"flex",justifyContent:"space-between",fontSize:13,padding:"6px 0"},g=t=>ql(t,e.currency,e.locale);/* @__PURE__ */
|
|
457
457
|
return Ye("div",{className:i,style:f,children:[
|
|
458
458
|
/* @__PURE__ */Ue("div",{style:{fontSize:12,fontWeight:700,color:s.textMuted,textTransform:"uppercase",letterSpacing:.5,marginBottom:12},children:"Plan change"}),
|
|
@@ -511,4 +511,11 @@ return Ye("div",{style:{position:"relative",width:28,height:28},children:[
|
|
|
511
511
|
/* @__PURE__ */Ue("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ks={sm:12,md:14,lg:16};function Ss({label:e="Thinking…",steps:t,size:n="md",variant:o="dots",active:r=!0,className:i,style:a}){const l=N(),[s,d]=Ve(0);Fe(()=>{if(!t?.length||!r)return;const e=setInterval(()=>{d(e=>(e+1)%t.length)},1800);return()=>clearInterval(e)},[t,r]);const c=l.primary,u=ks[n],h={dots:/* @__PURE__ */Ue(ys,{color:c}),pulse:/* @__PURE__ */Ue(bs,{color:c}),wave:/* @__PURE__ */Ue(vs,{color:c}),orbit:/* @__PURE__ */Ue(ws,{color:c})}[o];/* @__PURE__ */
|
|
512
512
|
return Ye("div",{className:le(K("inline-flex flex-col gap-2"),i),style:a,role:"status","aria-live":"polite","aria-label":r?e:"Done thinking",children:[
|
|
513
513
|
/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:10},children:[/* @__PURE__ */Ue("div",{style:{opacity:r?1:.35,transition:"opacity 0.3s"},children:r?h:/* @__PURE__ */Ue("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */Ue("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[/* @__PURE__ */Ue("span",{style:{fontSize:u,fontWeight:600,color:r?l.text:l.textMuted,transition:"color 0.3s"},children:r?t?t[s]:e:"Done"}),r&&/* @__PURE__ */Ue("span",{style:{fontSize:u-2,color:l.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),t&&t.length>1&&/* @__PURE__ */Ue("div",{style:{display:"flex",gap:4,paddingLeft:2},children:t.map((e,t)=>/* @__PURE__ */Ue("div",{style:{width:t===s?16:6,height:4,borderRadius:4,background:t===s?c:`${c}44`,transition:"all 0.3s ease"}},t))}),
|
|
514
|
-
/* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})}
|
|
514
|
+
/* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})}var Cs=!1,$s="tkx-holographic-styles";function zs(e={}){const{maxTilt:t=14,disabled:n=!1}=e,o=Oe(null),r=ge(),i=Oe(null),a=Oe({rx:0,ry:0,mx:50,my:50});return Fe(()=>{!function(){if(Cs||"undefined"==typeof document)return;if(document.getElementById($s))return void(Cs=!0);Cs=!0;const e=document.createElement("style");e.id=$s,e.textContent="\n@keyframes tkx-holo-shimmer {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n}\n@keyframes tkx-holo-snapback {\n to { --tkx-holo-rx: 0deg; --tkx-holo-ry: 0deg; --tkx-holo-mx: 50%; --tkx-holo-my: 50%; }\n}\n.tkx-holo-root {\n --tkx-holo-rx: 0deg;\n --tkx-holo-ry: 0deg;\n --tkx-holo-mx: 50%;\n --tkx-holo-my: 50%;\n position: relative;\n transform-style: preserve-3d;\n transform: perspective(1000px) rotateX(var(--tkx-holo-rx)) rotateY(var(--tkx-holo-ry));\n transition: transform 280ms cubic-bezier(.2,.8,.2,1);\n will-change: transform;\n isolation: isolate;\n}\n.tkx-holo-root.tkx-holo-tracking {\n transition: none;\n}\n.tkx-holo-foil {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n background:\n radial-gradient(circle at var(--tkx-holo-mx) var(--tkx-holo-my),\n rgba(255,255,255,0.32) 0%,\n rgba(255,255,255,0.08) 22%,\n transparent 55%),\n conic-gradient(from calc(var(--tkx-holo-mx) * 3.6deg) at 50% 50%,\n #ff006e, #ffbe0b, #06d6a0, #00f5d4, #3a86ff, #7b2ff7, #ff006e);\n background-size: 100% 100%, 280% 280%;\n background-position: 0 0, var(--tkx-holo-mx) var(--tkx-holo-my);\n mix-blend-mode: color-dodge;\n opacity: 0.55;\n filter: saturate(1.4) contrast(1.1);\n}\n.tkx-holo-foil.tkx-holo-foil-soft {\n mix-blend-mode: overlay;\n opacity: 0.35;\n}\n.tkx-holo-scan {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n background: repeating-linear-gradient(\n 180deg,\n rgba(255,255,255,0.06) 0px,\n rgba(255,255,255,0.06) 1px,\n transparent 1px,\n transparent 3px\n );\n mix-blend-mode: overlay;\n opacity: 0.5;\n}\n.tkx-holo-content {\n position: relative;\n z-index: 1;\n transform: translateZ(20px);\n}\n.tkx-holo-root:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 4px;\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-holo-root, .tkx-holo-root.tkx-holo-tracking {\n transform: none !important;\n transition: none;\n }\n .tkx-holo-content { transform: none !important; }\n .tkx-holo-foil { animation: tkx-holo-shimmer 8s ease infinite; }\n}",document.head.appendChild(e)}()},[]),Fe(()=>{const e=o.current;if(e&&!n&&!r)return e.addEventListener("pointermove",d),e.addEventListener("pointerleave",c),()=>{e.removeEventListener("pointermove",d),e.removeEventListener("pointerleave",c),null!=i.current&&cancelAnimationFrame(i.current)};function l(){if(!e)return;const{rx:t,ry:n,mx:o,my:r}=a.current;e.style.setProperty("--tkx-holo-rx",`${t}deg`),e.style.setProperty("--tkx-holo-ry",`${n}deg`),e.style.setProperty("--tkx-holo-mx",`${o}%`),e.style.setProperty("--tkx-holo-my",`${r}%`),i.current=null}function s(){null==i.current&&(i.current=requestAnimationFrame(l))}function d(n){const o=e.getBoundingClientRect(),r=(n.clientX-o.left)/o.width,i=(n.clientY-o.top)/o.height,l=Math.max(0,Math.min(1,r)),d=Math.max(0,Math.min(1,i));a.current={rx:(.5-d)*t*2,ry:(l-.5)*t*2,mx:100*l,my:100*d},e.classList.add("tkx-holo-tracking"),s()}function c(){a.current={rx:0,ry:0,mx:50,my:50},e.classList.remove("tkx-holo-tracking"),s()}},[t,n,r]),o}var Ns=Te(function({children:e,maxTilt:t=14,scanLines:n=!0,foilIntensity:o="strong",radius:r=16,disabled:i=!1,className:a,style:l,...s},d){const c=N(),u=zs({maxTilt:t,disabled:i});Fe(()=>{if(!d)return;const e=u.current;"function"==typeof d?d(e):d.current=e},[d,u]);const h={borderRadius:"number"==typeof r?`${r}px`:r,background:`linear-gradient(135deg, ${c.surface}cc, ${c.surfaceAlt}cc)`,border:`1px solid ${c.border}`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:c.text,...l};/* @__PURE__ */
|
|
515
|
+
return Ye("div",{ref:u,className:["tkx-holo-root",a].filter(Boolean).join(" "),style:h,...s,children:["none"!==o&&/* @__PURE__ */Ue("div",{className:"tkx-holo-foil "+("soft"===o?"tkx-holo-foil-soft":""),"aria-hidden":"true"}),n&&/* @__PURE__ */Ue("div",{className:"tkx-holo-scan","aria-hidden":"true"}),
|
|
516
|
+
/* @__PURE__ */Ue("div",{className:"tkx-holo-content",children:e})]})}),Ms=Te(function({title:e,subtitle:t,badge:n,children:o,padding:r=24,...i},a){const l=N(),s=Ee(),d="number"==typeof r?`${r}px`:r;/* @__PURE__ */
|
|
517
|
+
return Ue(Ns,{ref:a,role:"article","aria-labelledby":e?s:void 0,...i,style:{minHeight:200,...i.style},children:/* @__PURE__ */Ye("div",{style:{padding:d},children:[(e||n)&&/* @__PURE__ */Ye("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,marginBottom:t?4:12},children:[e&&/* @__PURE__ */Ue("h3",{id:s,style:{margin:0,fontSize:20,fontWeight:700,letterSpacing:"-0.01em",color:l.text},children:e}),n]}),t&&/* @__PURE__ */Ue("p",{style:{margin:"0 0 16px",color:l.textMuted,fontSize:14},children:t}),o]})})}),Is=Te(function({src:e,alt:t,size:n=96,initials:o,scanLines:r=!1,...i},a){const l=N();/* @__PURE__ */
|
|
518
|
+
return Ue(Ns,{ref:a,radius:"50%",scanLines:r,...i,style:{width:n,height:n,...i.style},children:e?/* @__PURE__ */Ue("img",{src:e,alt:t,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ue("div",{role:"img","aria-label":t,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:.36*n,fontWeight:700,color:l.text},children:o??t.charAt(0).toUpperCase()})})}),Ds={sm:"4px 10px",md:"6px 14px",lg:"8px 18px"},Ws={sm:11,md:13,lg:15},Ls=Te(function({children:e,size:t="md",scanLines:n=!1,...o},r){/* @__PURE__ */
|
|
519
|
+
return Ue(Ns,{ref:r,radius:999,scanLines:n,maxTilt:6,...o,style:{display:"inline-flex",padding:Ds[t],fontSize:Ws[t],fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",...o.style},children:e})}),Rs=Te(function({children:e,onClick:t,isDisabled:n=!1,type:o="button",maxTilt:r=8,...i},a){const l=N(),s=ge(),d=Oe(null),c=zs({maxTilt:r,disabled:n});return Fe(()=>{const e=d.current;e&&(c.current=e,"function"==typeof a?a(e):a&&(a.current=e))},[a,c]),/* @__PURE__ */Ye("button",{ref:d,type:o,onClick:n?void 0:t,disabled:n,className:"tkx-holo-root",style:{position:"relative",padding:"14px 28px",fontSize:15,fontWeight:700,letterSpacing:"0.02em",color:l.text,background:`linear-gradient(135deg, ${l.surface}, ${l.surfaceAlt})`,border:`1px solid ${l.primary}55`,borderRadius:12,cursor:n?"not-allowed":"pointer",opacity:n?.5:1,minHeight:44,transformStyle:"preserve-3d",...i.style},...i,children:[
|
|
520
|
+
/* @__PURE__ */Ue("span",{className:"tkx-holo-foil","aria-hidden":"true"}),
|
|
521
|
+
/* @__PURE__ */Ue("span",{className:"tkx-holo-content",style:{display:"inline-block"},children:e}),!s&&!n&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{position:"absolute",inset:-1,borderRadius:12,border:`1px solid ${l.primary}88`,boxShadow:`0 0 24px ${l.primary}44`,pointerEvents:"none",opacity:.6}})]})});export{Ja as COUNTRIES,ls as FocusTrap,be as I18nContext,rs as I18nProvider,d as LRUCache,as as LiveRegion,r as Quantum,Vi as SIZE_BORDER_RADIUS,Hi as SIZE_FONT,ji as SIZE_HEIGHT,Ki as SIZE_ICON,Pi as SIZE_PADDING_X,Oi as SIZE_PADDING_Y,se as SecurityCore,X as Shield,is as SkipNav,h as TKX,D as ThemeContext,$ as ThemeProvider,xs as TkxAIChatBubble,ms as TkxAIConfidenceBar,Ss as TkxAIThinking,Fl as TkxAadhaarInput,cn as TkxAccordion,ml as TkxAddressInput,Ia as TkxAffix,mt as TkxAlert,Ra as TkxAnchor,Fr as TkxAppBar,wr as TkxAutocomplete,Rt as TkxAvatar,st as TkxBadge,_l as TkxBillingCycleToggle,jr as TkxBottomNav,xr as TkxBreadcrumb,Qe as TkxButton,Dl as TkxCalendarLunar,Va as TkxCaptcha,tt as TkxCard,ot as TkxCardBody,rt as TkxCardFooter,nt as TkxCardHeader,fr as TkxCarousel,Aa as TkxCascader,oo as TkxChat,no as TkxChatBubble,Ot as TkxCheckbox,Wl as TkxCheckout,Io as TkxClock,Ri as TkxCol,Jo as TkxColorPicker,hr as TkxCommand,vl as TkxConfetti,Ai as TkxConfigProvider,zi as TkxContent,ga as TkxCountdown,xl as TkxCurrencyInput,Jr as TkxDataGrid,Nn as TkxDatePicker,Bt as TkxDivider,mn as TkxDrawer,Xl as TkxDrivingLicenceInput,ps as TkxDropdown,ua as TkxEmpty,Vn as TkxFileUpload,Za as TkxFontProvider,Ni as TkxFooter,Me as TkxForm,Ne as TkxFormField,Si as TkxHeader,Is as TkxHolographicAvatar,Ls as TkxHolographicBadge,Rs as TkxHolographicButton,Ms as TkxHolographicCard,Ns as TkxHolographicSurface,jn as TkxImage,al as TkxImageEditor,it as TkxInput,ki as TkxLayout,Ea as TkxList,yi as TkxMarkdown,ei as TkxMasonry,ba as TkxMentions,Co as TkxMenu,bt as TkxModal,or as TkxNumberInput,lr as TkxOTP,ts as TkxOrgChart,An as TkxPagination,Hl as TkxPanInput,oa as TkxParagraph,ul as TkxPaymentButton,ol as TkxPhoneInput,Zl as TkxPlanSelector,yr as TkxPopover,ut as TkxProgress,Gl as TkxProrationPreview,wa as TkxQRCode,Ut as TkxRadio,Yt as TkxRadioGroup,Gn as TkxRating,Sa as TkxResult,ri as TkxRichTextDisplay,Di as TkxRow,Cl as TkxSEO,ya as TkxSegmented,Ht as TkxSelect,$i as TkxSider,hl as TkxSignaturePad,Dt as TkxSkeleton,Rn as TkxSlider,Vr as TkxSnackbar,yl as TkxSortable,Ar as TkxSpeedDial,sa as TkxSpin,ma as TkxStatistic,Po as TkxStepper,Ct as TkxTab,St as TkxTabList,zt as TkxTabPanel,$t as TkxTabPanels,At as TkxTable,kt as TkxTabs,so as TkxTag,co as TkxTagInput,na as TkxText,to as TkxThinkingIndicator,go as TkxTimeline,ta as TkxTitle,an as TkxToastProvider,pt as TkxToggle,zr as TkxToolbar,Mt as TkxTooltip,Ca as TkxTour,Lr as TkxTransferList,Cr as TkxTreeView,Ao as TkxVideoPlayer,Vl as TkxVoterIdInput,Na as TkxWatermark,ss as VisuallyHidden,b as WCAGEngine,q as audit,M as auroraLight,i as batchUpdate,v as breakpoints,re as buildTkxCSP,y as contrastRatio,L as createFocusTrap,te as createRateLimiter,p as createTheme,o as css,n as cssVar,le as cx,_ as deepFreeze,ne as extractAtomicCSS,s as extractCSS,a as fnv1aHash,k as fromObject,z as generatePalette,A as getAccessibleForeground,Z as getAuditLog,_i as getLocaleDisplayName,e as injectStyles,V as installFrameBuster,de as installTrustedTypes,he as isFramed,ke as isRTL,Zi as isRtlLocale,U as isSafeAttrName,Tl as isValidAadhaar,Ul as isValidDrivingLicence,jl as isValidPan,Ol as isValidVoterId,w as keyframes,_a as loadFontScript,T as meetsAA,u as meetsAAA,c as memoize,t as prefersHighContrast,R as prefersReducedMotion,I as quantumDark,m as radii,ie as resetAtomicCSS,G as resolvePluginUtility,l as responsive,ue as sanitizeCSS,P as sanitizeHTML,F as sanitizeHref,ce as sanitizeJSON,O as sanitizeProps,j as sanitizeString,E as sanitizeUnicode,qa as scriptsForLanguage,H as scrubPII,$l as seoSchema,S as shadows,Q as sniffMimeType,W as spacing,K as tkx,oe as tkxListPlugins,ae as tkxPlugin,Y as tkxRemovePlugin,ee as tx,g as typography,Ga as unloadFontScript,ye as useAnnounce,me as useClickOutside,Ei as useComponentSize,Bi as useConfig,za as useDevtoolsOpen,Se as useDirection,xe as useEscapeKey,fe as useFocusTrap,pe as useHighContrast,Ce as useI18n,$e as useLocale,Yi as useLogicalSpacing,x as usePrefersColorScheme,Fi as usePrefixCls,ge as useReducedMotion,Ui as useRtlFlip,N as useTheme,sr as useTkxCommand,ze as useTkxForm,en as useToast,B as validateProps,J as verifyAuditIntegrity,C as zIndex};
|