@nicorp/nui 0.11.0 → 0.11.2

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/dist/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),E=require("react"),to=require("@radix-ui/react-slot"),Li=require("@radix-ui/react-label"),Di=require("@radix-ui/react-separator"),Ei=require("@radix-ui/react-avatar"),Ai=require("@radix-ui/react-checkbox"),I=require("lucide-react"),Fi=require("@radix-ui/react-switch"),Vi=require("@radix-ui/react-select"),zi=require("@radix-ui/react-radio-group"),$i=require("@radix-ui/react-slider"),Bi=require("@radix-ui/react-toggle"),Oi=require("@radix-ui/react-toggle-group"),Se=require("date-fns"),Hi=require("@radix-ui/react-popover"),Gi=require("@radix-ui/react-aspect-ratio"),qi=require("@radix-ui/react-collapsible"),Wi=require("@radix-ui/react-scroll-area"),Ui=require("@radix-ui/react-tabs"),Ki=require("@radix-ui/react-accordion"),Xi=require("@radix-ui/react-dialog"),Yi=require("@radix-ui/react-dropdown-menu"),Zi=require("@radix-ui/react-tooltip"),Ee=require("cmdk"),Ji=require("@radix-ui/react-alert-dialog"),Qi=require("@radix-ui/react-progress"),Hr=require("react-dom"),el=require("@radix-ui/react-navigation-menu"),tl=require("@radix-ui/react-context-menu"),rl=require("@radix-ui/react-hover-card"),Gr=require("recharts");function ge(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const p=ge(E),ro=ge(Li),no=ge(Di),bt=ge(Ei),Ir=ge(Ai),Tr=ge(Fi),he=ge(Vi),Dt=ge(zi),_t=ge($i),oo=ge(Bi),ar=ge(Oi),Et=ge(Hi),nl=ge(Gi),qr=ge(qi),ct=ge(Wi),mt=ge(Ui),dt=ge(Ki),ue=ge(Xi),me=ge(Yi),$t=ge(Zi),Te=ge(Ji),Lr=ge(Qi),Ae=ge(el),fe=ge(tl),ir=ge(rl);function so(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=so(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ao(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=so(e))&&(n&&(n+=" "),n+=t);return n}const ol=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},sl=(e,t)=>({classGroupId:e,validator:t}),io=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),rr="-",Tn=[],al="arbitrary..",il=e=>{const t=cl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ll(i);const l=i.split(rr),c=l[0]===""&&l.length>1?1:0;return lo(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],d=r[i];return c?d?ol(d,c):c:d||Tn}return r[i]||Tn}}},lo=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const d=lo(e,t+1,a);if(d)return d}const i=r.validators;if(i===null)return;const l=t===0?e.join(rr):e.slice(t).join(rr),c=i.length;for(let d=0;d<c;d++){const g=i[d];if(g.validator(l))return g.classGroupId}},ll=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?al+n:void 0})(),cl=e=>{const{theme:t,classGroups:r}=e;return dl(r,t)},dl=(e,t)=>{const r=io();for(const n in e){const s=e[n];Wr(s,r,n,t)}return r},Wr=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];ul(i,t,r,n)}},ul=(e,t,r,n)=>{if(typeof e=="string"){ml(e,t,r);return}if(typeof e=="function"){fl(e,t,r,n);return}gl(e,t,r,n)},ml=(e,t,r)=>{const n=e===""?t:co(t,e);n.classGroupId=r},fl=(e,t,r,n)=>{if(pl(e)){Wr(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(sl(r,e))},gl=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];Wr(c,co(t,l),r,n)}},co=(e,t)=>{let r=e;const n=t.split(rr),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=io(),r.nextPart.set(i,l)),r=l}return r},pl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,hl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},Dr="!",Ln=":",xl=[],Dn=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),bl=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,d;const g=s.length;for(let x=0;x<g;x++){const y=s[x];if(i===0&&l===0){if(y===Ln){a.push(s.slice(c,x)),c=x+1;continue}if(y==="/"){d=x;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const u=a.length===0?s:s.slice(c);let f=u,m=!1;u.endsWith(Dr)?(f=u.slice(0,-1),m=!0):u.startsWith(Dr)&&(f=u.slice(1),m=!0);const h=d&&d>c?d-c:void 0;return Dn(a,m,f,h)};if(t){const s=t+Ln,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):Dn(xl,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},vl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},wl=e=>({cache:hl(e.cacheSize),parseClassName:bl(e),sortModifiers:vl(e),...il(e)}),yl=/\s+/,jl=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(yl);let c="";for(let d=l.length-1;d>=0;d-=1){const g=l[d],{isExternal:u,modifiers:f,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:x}=r(g);if(u){c=g+(c.length>0?" "+c:c);continue}let y=!!x,w=n(y?h.substring(0,x):h);if(!w){if(!y){c=g+(c.length>0?" "+c:c);continue}if(w=n(h),!w){c=g+(c.length>0?" "+c:c);continue}y=!1}const v=f.length===0?"":f.length===1?f[0]:a(f).join(":"),j=m?v+Dr:v,R=j+w;if(i.indexOf(R)>-1)continue;i.push(R);const M=s(w,y);for(let C=0;C<M.length;++C){const k=M[C];i.push(j+k)}c=g+(c.length>0?" "+c:c)}return c},Nl=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=uo(r))&&(s&&(s+=" "),s+=n);return s},uo=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=uo(e[n]))&&(r&&(r+=" "),r+=t);return r},Cl=(e,...t)=>{let r,n,s,a;const i=c=>{const d=t.reduce((g,u)=>u(g),e());return r=wl(d),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const d=n(c);if(d)return d;const g=jl(c,r);return s(c,g),g};return a=i,(...c)=>a(Nl(...c))},kl=[],ke=e=>{const t=r=>r[e]||kl;return t.isThemeGetter=!0,t},mo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sl=/^\d+\/\d+$/,Rl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_l=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Il=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>Sl.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),rt=e=>!!e&&Number.isInteger(Number(e)),wr=e=>e.endsWith("%")&&se(e.slice(0,-1)),et=e=>Rl.test(e),Tl=()=>!0,Ll=e=>_l.test(e)&&!Ml.test(e),go=()=>!1,Dl=e=>Pl.test(e),El=e=>Il.test(e),Al=e=>!W(e)&&!U(e),Fl=e=>vt(e,xo,go),W=e=>mo.test(e),it=e=>vt(e,bo,Ll),yr=e=>vt(e,Ol,se),En=e=>vt(e,po,go),Vl=e=>vt(e,ho,El),Kt=e=>vt(e,vo,Dl),U=e=>fo.test(e),St=e=>wt(e,bo),zl=e=>wt(e,Hl),An=e=>wt(e,po),$l=e=>wt(e,xo),Bl=e=>wt(e,ho),Xt=e=>wt(e,vo,!0),vt=(e,t,r)=>{const n=mo.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},wt=(e,t,r=!1)=>{const n=fo.exec(e);return n?n[1]?t(n[1]):r:!1},po=e=>e==="position"||e==="percentage",ho=e=>e==="image"||e==="url",xo=e=>e==="length"||e==="size"||e==="bg-size",bo=e=>e==="length",Ol=e=>e==="number",Hl=e=>e==="family-name",vo=e=>e==="shadow",Gl=()=>{const e=ke("color"),t=ke("font"),r=ke("text"),n=ke("font-weight"),s=ke("tracking"),a=ke("leading"),i=ke("breakpoint"),l=ke("container"),c=ke("spacing"),d=ke("radius"),g=ke("shadow"),u=ke("inset-shadow"),f=ke("text-shadow"),m=ke("drop-shadow"),h=ke("blur"),x=ke("perspective"),y=ke("aspect"),w=ke("ease"),v=ke("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),U,W],C=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],N=()=>[U,W,c],S=()=>[xt,"full","auto",...N()],_=()=>[rt,"none","subgrid",U,W],D=()=>["auto",{span:["full",rt,U,W]},rt,U,W],F=()=>[rt,"auto",U,W],B=()=>["auto","min","max","fr",U,W],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...N()],A=()=>[xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],T=()=>[e,U,W],oe=()=>[...R(),An,En,{position:[U,W]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",$l,Fl,{size:[U,W]}],ee=()=>[wr,St,it],z=()=>["","none","full",d,U,W],L=()=>["",se,St,it],H=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[se,wr,An,En],X=()=>["","none",h,U,W],ce=()=>["none",se,U,W],ae=()=>["none",se,U,W],ie=()=>[se,U,W],G=()=>[xt,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[et],breakpoint:[et],color:[Tl],container:[et],"drop-shadow":[et],ease:["in","out","in-out"],font:[Al],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[et],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[et],shadow:[et],spacing:["px",se],text:[et],"text-shadow":[et],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xt,W,U,y]}],container:["container"],columns:[{columns:[se,W,U,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[rt,"auto",U,W]}],basis:[{basis:[xt,"full","auto",l,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,xt,"auto","initial","none",W]}],grow:[{grow:["",se,U,W]}],shrink:[{shrink:["",se,U,W]}],order:[{order:[rt,"first","last","none",U,W]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",r,St,it]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,U,yr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wr,W]}],"font-family":[{font:[zl,W,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,U,W]}],"line-clamp":[{"line-clamp":[se,"none",U,yr]}],leading:[{leading:[a,...N()]}],"list-image":[{"list-image":["none",U,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",U,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",U,it]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[se,"auto",U,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",U,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},rt,U,W],radial:["",U,W],conic:[rt,U,W]},Bl,Vl]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,U,W]}],"outline-w":[{outline:["",se,St,it]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",g,Xt,Kt]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",u,Xt,Kt]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[se,it]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",f,Xt,Kt]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[se,U,W]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[U,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,W]}],filter:[{filter:["","none",U,W]}],blur:[{blur:X()}],brightness:[{brightness:[se,U,W]}],contrast:[{contrast:[se,U,W]}],"drop-shadow":[{"drop-shadow":["","none",m,Xt,Kt]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",se,U,W]}],"hue-rotate":[{"hue-rotate":[se,U,W]}],invert:[{invert:["",se,U,W]}],saturate:[{saturate:[se,U,W]}],sepia:[{sepia:["",se,U,W]}],"backdrop-filter":[{"backdrop-filter":["","none",U,W]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[se,U,W]}],"backdrop-contrast":[{"backdrop-contrast":[se,U,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,U,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,U,W]}],"backdrop-invert":[{"backdrop-invert":["",se,U,W]}],"backdrop-opacity":[{"backdrop-opacity":[se,U,W]}],"backdrop-saturate":[{"backdrop-saturate":[se,U,W]}],"backdrop-sepia":[{"backdrop-sepia":["",se,U,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",U,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",U,W]}],ease:[{ease:["linear","initial",w,U,W]}],delay:[{delay:[se,U,W]}],animate:[{animate:["none",v,U,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,U,W]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[U,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",U,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",U,W]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[se,St,it,yr]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ql=Cl(Gl);function b(...e){return ql(ao(e))}function We(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}const Fn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vn=ao,ze=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Vn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(d=>{const g=r==null?void 0:r[d],u=a==null?void 0:a[d];if(g===null)return null;const f=Fn(g)||Fn(u);return s[d][f]}),l=r&&Object.entries(r).reduce((d,g)=>{let[u,f]=g;return f===void 0||(d[u]=f),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,g)=>{let{class:u,className:f,...m}=g;return Object.entries(m).every(h=>{let[x,y]=h;return Array.isArray(y)?y.includes({...a,...l}[x]):{...a,...l}[x]===y})?[...d,u,f]:d},[]);return Vn(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)},Bt=ze("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",brand:"bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-500 hover:to-indigo-500 shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 hover:scale-[1.02] active:scale-[0.98]",glow:"bg-primary text-primary-foreground shadow-[0_0_20px_rgba(139,92,246,0.5)] hover:shadow-[0_0_30px_rgba(139,92,246,0.7)] hover:scale-[1.02] active:scale-[0.98]"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",xl:"h-12 rounded-lg px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ve=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},a)=>{const i=n?to.Slot:"button";return o.jsx(i,{className:b(Bt({variant:t,size:r,className:e})),ref:a,...s})});ve.displayName="Button";const wo=ze("flex w-full rounded-lg text-sm transition-all duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",filled:"h-10 border-0 bg-muted/50 px-3 py-2 focus-visible:outline-none focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring",glow:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:border-violet-500/50 focus-visible:ring-2 focus-visible:ring-violet-500/30 focus-visible:shadow-[0_0_15px_rgba(139,92,246,0.3)]",ghost:"h-10 border-0 bg-transparent px-3 py-2 focus-visible:outline-none focus-visible:bg-muted/30"},inputSize:{default:"h-10",sm:"h-9 text-xs",lg:"h-12 text-base"}},defaultVariants:{variant:"default",inputSize:"default"}}),st=p.forwardRef(({className:e,type:t,variant:r,inputSize:n,...s},a)=>o.jsx("input",{type:t,className:b(wo({variant:r,inputSize:n}),e),ref:a,...s}));st.displayName="Input";const yo=p.forwardRef(({className:e,...t},r)=>o.jsx("textarea",{className:b("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));yo.displayName="Textarea";const Wl=ze("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lr=p.forwardRef(({className:e,...t},r)=>o.jsx(ro.Root,{ref:r,className:b(Wl(),e),...t}));lr.displayName=ro.Root.displayName;const jo=ze("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ur({className:e,variant:t,...r}){return o.jsx("div",{className:b(jo({variant:t}),e),...r})}const No=p.forwardRef(({className:e,orientation:t="horizontal",...r},n)=>o.jsx(no.Root,{ref:n,decorative:!0,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));No.displayName=no.Root.displayName;const Co=p.forwardRef(({className:e,...t},r)=>o.jsx(bt.Root,{ref:r,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Co.displayName=bt.Root.displayName;const ko=p.forwardRef(({className:e,...t},r)=>o.jsx(bt.Image,{ref:r,className:b("aspect-square h-full w-full",e),...t}));ko.displayName=bt.Image.displayName;const So=p.forwardRef(({className:e,...t},r)=>o.jsx(bt.Fallback,{ref:r,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));So.displayName=bt.Fallback.displayName;const Ro=p.forwardRef(({className:e,...t},r)=>o.jsx(Ir.Root,{ref:r,className:b("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(Ir.Indicator,{className:b("flex items-center justify-center text-current"),children:o.jsx(I.Check,{className:"h-4 w-4"})})}));Ro.displayName=Ir.Root.displayName;const _o=p.forwardRef(({className:e,...t},r)=>o.jsx(Tr.Root,{className:b("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:o.jsx(Tr.Thumb,{className:b("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));_o.displayName=Tr.Root.displayName;const Ul=he.Root,Kl=he.Group,Xl=he.Value,Mo=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(he.Trigger,{ref:n,className:b("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,o.jsx(he.Icon,{asChild:!0,children:o.jsx(I.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Mo.displayName=he.Trigger.displayName;const Kr=p.forwardRef(({className:e,...t},r)=>o.jsx(he.ScrollUpButton,{ref:r,className:b("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(I.ChevronUp,{className:"h-4 w-4"})}));Kr.displayName=he.ScrollUpButton.displayName;const Xr=p.forwardRef(({className:e,...t},r)=>o.jsx(he.ScrollDownButton,{ref:r,className:b("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(I.ChevronDown,{className:"h-4 w-4"})}));Xr.displayName=he.ScrollDownButton.displayName;const Po=p.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(he.Portal,{children:o.jsxs(he.Content,{ref:s,className:b("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[o.jsx(Kr,{}),o.jsx(he.Viewport,{className:b("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(Xr,{})]})}));Po.displayName=he.Content.displayName;const Io=p.forwardRef(({className:e,...t},r)=>o.jsx(he.Label,{ref:r,className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Io.displayName=he.Label.displayName;const To=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(he.Item,{ref:n,className:b("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(he.ItemIndicator,{children:o.jsx(I.Check,{className:"h-4 w-4"})})}),o.jsx(he.ItemText,{children:t})]}));To.displayName=he.Item.displayName;const Lo=p.forwardRef(({className:e,...t},r)=>o.jsx(he.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Lo.displayName=he.Separator.displayName;const Do=p.forwardRef(({className:e,...t},r)=>o.jsx(Dt.Root,{className:b("grid gap-2",e),...t,ref:r}));Do.displayName=Dt.Root.displayName;const Eo=p.forwardRef(({className:e,...t},r)=>o.jsx(Dt.Item,{ref:r,className:b("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(Dt.Indicator,{className:"flex items-center justify-center",children:o.jsx(I.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Eo.displayName=Dt.Item.displayName;const Ao=p.forwardRef(({className:e,...t},r)=>o.jsxs(_t.Root,{ref:r,className:b("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(_t.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(_t.Range,{className:"absolute h-full bg-primary"})}),o.jsx(_t.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Ao.displayName=_t.Root.displayName;const Yr=ze("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Fo=p.forwardRef(({className:e,variant:t,size:r,...n},s)=>o.jsx(oo.Root,{ref:s,className:b(Yr({variant:t,size:r,className:e})),...n}));Fo.displayName=oo.Root.displayName;const Vo=p.forwardRef(({className:e,variant:t,size:r,children:n,...s},a)=>o.jsx(ar.Root,{ref:a,className:b("flex items-center justify-center gap-1",e),...s,children:o.jsx(zo.Provider,{value:{variant:t,size:r},children:n})}));Vo.displayName=ar.Root.displayName;const zo=p.createContext({size:"default",variant:"default"}),$o=p.forwardRef(({className:e,children:t,variant:r,size:n,...s},a)=>{const i=p.useContext(zo);return o.jsx(ar.Item,{ref:a,className:b(Yr({variant:i.variant||r,size:i.size||n}),e),...s,children:t})});$o.displayName=ar.Item.displayName;function Zr({selected:e,onSelect:t,className:r,disabled:n}){const[s,a]=p.useState(()=>e?Se.startOfMonth(e):Se.startOfMonth(new Date)),i=Se.startOfMonth(s),l=Se.endOfMonth(s),c=Se.startOfWeek(i,{weekStartsOn:1}),d=Se.endOfWeek(l,{weekStartsOn:1}),g=Se.eachDayOfInterval({start:c,end:d}),u=["Mo","Tu","We","Th","Fr","Sa","Su"],f=()=>{a(Se.subMonths(s,1))},m=()=>{a(Se.addMonths(s,1))},h=x=>{n!=null&&n(x)||t==null||t(Se.isSameDay(x,e||new Date(0))?void 0:x)};return o.jsxs("div",{className:b("p-4 bg-card rounded-xl border shadow-sm w-[320px]",r),children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx(ve,{variant:"ghost",size:"icon",onClick:f,className:"h-8 w-8 rounded-full hover:bg-accent",children:o.jsx(I.ChevronLeft,{className:"h-4 w-4"})}),o.jsx("h2",{className:"text-base font-semibold",children:Se.format(s,"MMMM yyyy")}),o.jsx(ve,{variant:"ghost",size:"icon",onClick:m,className:"h-8 w-8 rounded-full hover:bg-accent",children:o.jsx(I.ChevronRight,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:u.map(x=>o.jsx("div",{className:"h-8 flex items-center justify-center text-xs font-medium text-muted-foreground",children:x},x))}),o.jsx("div",{className:"grid grid-cols-7 gap-1",children:g.map((x,y)=>{const w=Se.isSameMonth(x,s),v=e&&Se.isSameDay(x,e),j=Se.isToday(x),R=n==null?void 0:n(x);return o.jsx("button",{onClick:()=>h(x),disabled:R,className:b("h-10 w-10 rounded-lg text-sm font-medium transition-all duration-150","flex items-center justify-center","hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",!w&&"text-muted-foreground/40",w&&!v&&"text-foreground hover:text-foreground",v&&"bg-primary text-primary-foreground hover:bg-primary/90 shadow-md",j&&!v&&"bg-accent text-accent-foreground font-bold",R&&"opacity-30 cursor-not-allowed hover:bg-transparent"),children:Se.format(x,"d")},y)})}),o.jsxs("div",{className:"mt-4 pt-3 border-t flex justify-between items-center",children:[o.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{const x=new Date;a(Se.startOfMonth(x)),t==null||t(x)},className:"text-xs",children:"Today"}),e&&o.jsx("span",{className:"text-xs text-muted-foreground",children:Se.format(e,"MMM d, yyyy")})]})]})}Zr.displayName="Calendar";const yt=Et.Root,jt=Et.Trigger,ft=p.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(Et.Portal,{children:o.jsx(Et.Content,{ref:s,align:t,sideOffset:r,className:b("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ft.displayName=Et.Content.displayName;const At={chatInput_placeholder:"Type a message...",chatInput_attachFile:"Attach file",chatInput_stopGenerating:"Stop generating",chatInput_sendMessage:"Send message",conversationList_newChat:"New Chat",conversationList_searchPlaceholder:"Search conversations...",conversationList_noResults:"No conversations found",conversationList_empty:"No conversations yet",conversationList_today:"Today",conversationList_yesterday:"Yesterday",conversationList_previous7Days:"Previous 7 days",conversationList_older:"Older",conversationList_rename:"Rename",conversationList_delete:"Delete",chatHeader_online:"Online",chatHeader_offline:"Offline",chatHeader_typing:"Typing...",chatHeader_back:"Back",chatHeader_clearConversation:"Clear conversation",chatHeader_settings:"Settings",reasoning_title:"Reasoning",reasoning_thinking:"Thinking",reasoning_thoughtFor:"Thought for {duration}",toolCall_calling:"Calling {name}...",toolCall_failed:"{name} — failed",toolCall_arguments:"Arguments",toolCall_result:"Result",toolCall_error:"Error",messageActions_copy:"Copy",messageActions_retry:"Retry",messageActions_edit:"Edit",messageActions_like:"Like",messageActions_dislike:"Dislike",messageActions_share:"Share",messageActions_copied:"Copied!",followUp_freeTextPlaceholder:"Or type your answer...",followUp_send:"Send",sourceCitation_sources:"Sources",aiLoading_thinking:"Thinking",filePreview_remove:"Remove {name}",modelSelector_placeholder:"Select model",modelSelector_searchPlaceholder:"Search models...",modelSelector_noResults:"No models found",common_close:"Close",common_search:"Search",common_noResults:"No results found.",common_previous:"Previous",common_next:"Next",common_more:"More",common_copyCode:"Copy code",combobox_placeholder:"Select option...",combobox_searchPlaceholder:"Search...",combobox_empty:"No results found.",multiselect_placeholder:"Select options...",multiselect_searchPlaceholder:"Search...",multiselect_empty:"No results found.",multiselect_selected:"{count} selected",datePicker_placeholder:"Pick a date",dataTable_searchPlaceholder:"Search...",dataTable_noResults:"No results.",dataTable_pageOf:"Page {page} of {total}",dataTable_previous:"Previous",dataTable_next:"Next",fileUpload_dragDrop:"Drag & drop files here, or click to select",fileUpload_maxSize:"Max file size: {size}",tagInput_placeholder:"Add tag...",pagination_previous:"Previous",pagination_next:"Next",pagination_morePages:"More pages",pagination_goToPrevious:"Go to previous page",pagination_goToNext:"Go to next page",modeToggle_toggleTheme:"Toggle theme",modeToggle_light:"Light",modeToggle_dark:"Dark",modeToggle_system:"System",modeToggle_colorTheme:"Color theme",carousel_previousSlide:"Previous slide",carousel_nextSlide:"Next slide",breadcrumb_more:"More",audioPlayer_play:"Play",audioPlayer_pause:"Pause",audioPlayer_mute:"Mute",audioPlayer_unmute:"Unmute",audioPlayer_seek:"Seek",audioPlayer_volume:"Volume",audioRecorder_startRecording:"Start recording",audioRecorder_stopRecording:"Stop recording",audioRecorder_pauseRecording:"Pause recording",audioRecorder_resumeRecording:"Resume recording",audioRecorder_reRecord:"Re-record",audioRecorder_microphoneAccess:"Microphone access required",audioWaveform_label:"Audio waveform",audioPlaylist_shuffle:"Shuffle",audioPlaylist_repeatOff:"Repeat off",audioPlaylist_repeatAll:"Repeat all",audioPlaylist_repeatOne:"Repeat one",audioPlaylist_previousTrack:"Previous track",audioPlaylist_nextTrack:"Next track",audioPlaylist_trackOf:"Track {current} of {total}",videoPlayer_play:"Play",videoPlayer_pause:"Pause",videoPlayer_mute:"Mute",videoPlayer_unmute:"Unmute",videoPlayer_seek:"Seek",videoPlayer_volume:"Volume",videoPlayer_fullscreen:"Fullscreen",videoPlayer_exitFullscreen:"Exit fullscreen",videoPlayer_pictureInPicture:"Picture in picture",videoPlayer_playbackSpeed:"Playback speed",videoPlayer_subtitles:"Subtitles",videoPlayer_label:"Video player",videoRecorder_startCamera:"Start camera",videoRecorder_shareScreen:"Share screen",videoRecorder_startRecording:"Start recording",videoRecorder_stopRecording:"Stop recording",videoRecorder_pauseRecording:"Pause recording",videoRecorder_resumeRecording:"Resume recording",videoRecorder_reRecord:"Re-record",videoRecorder_cameraPreview:"Camera preview",videoRecorder_screenPreview:"Screen preview",videoThumbnail_play:"Play video: {title}",videoGallery_label:"Video gallery",image_loading:"Loading image",image_zoomIn:"Zoom in",image_failedToLoad:"Image failed to load",lightbox_label:"Image viewer",lightbox_zoomIn:"Zoom in",lightbox_zoomOut:"Zoom out",lightbox_imageOf:"{current} of {total}",imageCropper_label:"Image crop area",imageCropper_crop:"Crop",imageCropper_reset:"Reset",imageCompare_slider:"Image comparison slider",imageCompare_before:"Before",imageCompare_after:"After"},Bo={chatInput_placeholder:"Введите сообщение...",chatInput_attachFile:"Прикрепить файл",chatInput_stopGenerating:"Остановить генерацию",chatInput_sendMessage:"Отправить сообщение",conversationList_newChat:"Новый чат",conversationList_searchPlaceholder:"Поиск диалогов...",conversationList_noResults:"Диалоги не найдены",conversationList_empty:"Нет диалогов",conversationList_today:"Сегодня",conversationList_yesterday:"Вчера",conversationList_previous7Days:"Последние 7 дней",conversationList_older:"Ранее",conversationList_rename:"Переименовать",conversationList_delete:"Удалить",chatHeader_online:"Онлайн",chatHeader_offline:"Не в сети",chatHeader_typing:"Печатает...",chatHeader_back:"Назад",chatHeader_clearConversation:"Очистить диалог",chatHeader_settings:"Настройки",reasoning_title:"Рассуждение",reasoning_thinking:"Думаю",reasoning_thoughtFor:"Думал {duration}",toolCall_calling:"Вызываю {name}...",toolCall_failed:"{name} — ошибка",toolCall_arguments:"Аргументы",toolCall_result:"Результат",toolCall_error:"Ошибка",messageActions_copy:"Копировать",messageActions_retry:"Повторить",messageActions_edit:"Редактировать",messageActions_like:"Нравится",messageActions_dislike:"Не нравится",messageActions_share:"Поделиться",messageActions_copied:"Скопировано!",followUp_freeTextPlaceholder:"Или введите свой ответ...",followUp_send:"Отправить",sourceCitation_sources:"Источники",aiLoading_thinking:"Думаю",filePreview_remove:"Удалить {name}",modelSelector_placeholder:"Выберите модель",modelSelector_searchPlaceholder:"Поиск моделей...",modelSelector_noResults:"Модели не найдены",common_close:"Закрыть",common_search:"Поиск",common_noResults:"Ничего не найдено.",common_previous:"Назад",common_next:"Далее",common_more:"Ещё",common_copyCode:"Копировать код",combobox_placeholder:"Выберите...",combobox_searchPlaceholder:"Поиск...",combobox_empty:"Ничего не найдено.",multiselect_placeholder:"Выберите...",multiselect_searchPlaceholder:"Поиск...",multiselect_empty:"Ничего не найдено.",multiselect_selected:"{count} выбрано",datePicker_placeholder:"Выберите дату",dataTable_searchPlaceholder:"Поиск...",dataTable_noResults:"Нет результатов.",dataTable_pageOf:"Страница {page} из {total}",dataTable_previous:"Назад",dataTable_next:"Далее",fileUpload_dragDrop:"Перетащите файлы сюда или нажмите для выбора",fileUpload_maxSize:"Макс. размер файла: {size}",tagInput_placeholder:"Добавить тег...",pagination_previous:"Назад",pagination_next:"Далее",pagination_morePages:"Ещё страницы",pagination_goToPrevious:"Предыдущая страница",pagination_goToNext:"Следующая страница",modeToggle_toggleTheme:"Сменить тему",modeToggle_light:"Светлая",modeToggle_dark:"Тёмная",modeToggle_system:"Системная",modeToggle_colorTheme:"Цветовая тема",carousel_previousSlide:"Предыдущий слайд",carousel_nextSlide:"Следующий слайд",breadcrumb_more:"Ещё",audioPlayer_play:"Воспроизвести",audioPlayer_pause:"Пауза",audioPlayer_mute:"Выключить звук",audioPlayer_unmute:"Включить звук",audioPlayer_seek:"Перемотка",audioPlayer_volume:"Громкость",audioRecorder_startRecording:"Начать запись",audioRecorder_stopRecording:"Остановить запись",audioRecorder_pauseRecording:"Приостановить запись",audioRecorder_resumeRecording:"Продолжить запись",audioRecorder_reRecord:"Перезаписать",audioRecorder_microphoneAccess:"Требуется доступ к микрофону",audioWaveform_label:"Звуковая волна",audioPlaylist_shuffle:"Перемешать",audioPlaylist_repeatOff:"Повтор выключен",audioPlaylist_repeatAll:"Повторять все",audioPlaylist_repeatOne:"Повторять одну",audioPlaylist_previousTrack:"Предыдущий трек",audioPlaylist_nextTrack:"Следующий трек",audioPlaylist_trackOf:"Трек {current} из {total}",videoPlayer_play:"Воспроизвести",videoPlayer_pause:"Пауза",videoPlayer_mute:"Выключить звук",videoPlayer_unmute:"Включить звук",videoPlayer_seek:"Перемотка",videoPlayer_volume:"Громкость",videoPlayer_fullscreen:"Полный экран",videoPlayer_exitFullscreen:"Выйти из полного экрана",videoPlayer_pictureInPicture:"Картинка в картинке",videoPlayer_playbackSpeed:"Скорость воспроизведения",videoPlayer_subtitles:"Субтитры",videoPlayer_label:"Видеоплеер",videoRecorder_startCamera:"Включить камеру",videoRecorder_shareScreen:"Поделиться экраном",videoRecorder_startRecording:"Начать запись",videoRecorder_stopRecording:"Остановить запись",videoRecorder_pauseRecording:"Приостановить запись",videoRecorder_resumeRecording:"Продолжить запись",videoRecorder_reRecord:"Перезаписать",videoRecorder_cameraPreview:"Предпросмотр камеры",videoRecorder_screenPreview:"Предпросмотр экрана",videoThumbnail_play:"Воспроизвести видео: {title}",videoGallery_label:"Галерея видео",image_loading:"Загрузка изображения",image_zoomIn:"Увеличить",image_failedToLoad:"Не удалось загрузить изображение",lightbox_label:"Просмотр изображений",lightbox_zoomIn:"Увеличить",lightbox_zoomOut:"Уменьшить",lightbox_imageOf:"{current} из {total}",imageCropper_label:"Область обрезки",imageCropper_crop:"Обрезать",imageCropper_reset:"Сбросить",imageCompare_slider:"Сравнение изображений",imageCompare_before:"До",imageCompare_after:"После"};function zn(e,t){if(!e)return;const r=t.split(".");let n=e;for(const s of r){if(n===void 0||typeof n=="string")return;n=n[s]}return typeof n=="string"?n:void 0}function tr(e,t){if(!t)return e;let r=e;for(const[n,s]of Object.entries(t))r=r.replaceAll(`{${n}}`,String(s));return r}const Yl={en:At,ru:Bo},Oo=p.createContext(At),Ho=p.createContext({lang:"en",messages:{}});function Go({locale:e="en",messages:t,children:r}){const n=typeof e=="string"?e:"en",s=p.useMemo(()=>typeof e=="string"?Yl[e]??At:{...At,...e},[e]),a=p.useMemo(()=>({lang:n,messages:t??{}}),[n,t]);return o.jsx(Ho.Provider,{value:a,children:o.jsx(Oo.Provider,{value:s,children:r})})}function te(){return p.useContext(Oo)}function Zl(){const{lang:e,messages:t}=p.useContext(Ho);return{t:p.useCallback((n,s)=>{const a=zn(t[e],n);if(a!==void 0)return tr(a,s);if(e!=="en"){const i=zn(t.en,n);if(i!==void 0)return tr(i,s)}return tr(n,s)},[e,t]),lang:e}}function De(e,t){return tr(e,t)}function Jl({value:e,onChange:t,placeholder:r,disabled:n,className:s}){const a=te(),i=r??a.datePicker_placeholder,[l,c]=p.useState(!1);return o.jsxs(yt,{open:l,onOpenChange:c,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:n,className:b("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",s),children:[o.jsx(I.CalendarIcon,{className:"mr-2 h-4 w-4"}),e?Se.format(e,"PPP"):o.jsx("span",{children:i})]})}),o.jsx(ft,{className:"w-auto p-0",align:"start",children:o.jsx(Zr,{selected:e,onSelect:d=>{t==null||t(d),c(!1)}})})]})}function Ql({value:e={hours:12,minutes:0},onChange:t,is24Hour:r=!1,disabled:n,className:s}){const[a,i]=p.useState(!1),[l,c]=p.useState(e.hours>=12?"PM":"AM"),d=r?e.hours:e.hours===0?12:e.hours>12?e.hours-12:e.hours,g=()=>{const y=d.toString().padStart(2,"0"),w=e.minutes.toString().padStart(2,"0");return r?`${y}:${w}`:`${y}:${w} ${l}`},u=y=>{let w=y;r||(l==="PM"&&y!==12&&(w+=12),l==="AM"&&y===12&&(w=0)),t==null||t({...e,hours:w})},f=y=>{t==null||t({...e,minutes:y})},m=y=>{c(y);let w=e.hours;y==="PM"&&e.hours<12&&(w+=12),y==="AM"&&e.hours>=12&&(w-=12),t==null||t({...e,hours:w})},h=r?Array.from({length:24},(y,w)=>w):Array.from({length:12},(y,w)=>w+1),x=Array.from({length:12},(y,w)=>w*5);return o.jsxs(yt,{open:a,onOpenChange:i,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:n,className:b("w-full justify-start font-normal",s),children:[o.jsx(I.Clock,{className:"mr-2 h-4 w-4"}),g()]})}),o.jsx(ft,{className:"w-auto p-2",align:"start",children:o.jsxs("div",{className:"flex gap-1",children:[o.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:h.map(y=>o.jsx("button",{onClick:()=>u(y),className:b("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",d===y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:y.toString().padStart(2,"0")},y))}),o.jsx("div",{className:"flex items-center text-muted-foreground font-bold",children:":"}),o.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:x.map(y=>o.jsx("button",{onClick:()=>f(y),className:b("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",e.minutes===y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:y.toString().padStart(2,"0")},y))}),!r&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("button",{onClick:()=>m("AM"),className:b("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="AM"&&"bg-primary text-primary-foreground border-primary"),children:"AM"}),o.jsx("button",{onClick:()=>m("PM"),className:b("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="PM"&&"bg-primary text-primary-foreground border-primary"),children:"PM"})]})]})})]})}function ec({value:e=0,onChange:t,min:r=-1/0,max:n=1/0,step:s=1,disabled:a,className:i}){const l=()=>{const g=Math.min(e+s,n);t==null||t(g)},c=()=>{const g=Math.max(e-s,r);t==null||t(g)},d=g=>{const u=parseFloat(g.target.value);if(!isNaN(u)){const f=Math.min(Math.max(u,r),n);t==null||t(f)}};return o.jsxs("div",{className:b("flex items-center gap-2",i),children:[o.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:c,disabled:a||e<=r,className:"h-9 w-9",children:o.jsx(I.Minus,{className:"h-4 w-4"})}),o.jsx(st,{type:"number",value:e,onChange:d,disabled:a,className:"w-20 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",min:r,max:n,step:s}),o.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:l,disabled:a||e>=n,className:"h-9 w-9",children:o.jsx(I.Plus,{className:"h-4 w-4"})})]})}function tc({values:e=[],onChange:t,placeholder:r,disabled:n,className:s,maxTags:a}){const i=te(),l=r??i.tagInput_placeholder,[c,d]=p.useState(""),g=p.useRef(null),u=m=>{if(m.key==="Enter"&&c.trim()){if(m.preventDefault(),a&&e.length>=a)return;e.includes(c.trim())||t==null||t([...e,c.trim()]),d("")}else m.key==="Backspace"&&!c&&e.length>0&&(t==null||t(e.slice(0,-1)))},f=m=>{t==null||t(e.filter(h=>h!==m))};return o.jsxs("div",{className:b("flex flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",n&&"opacity-50 cursor-not-allowed",s),onClick:()=>{var m;return(m=g.current)==null?void 0:m.focus()},children:[e.map(m=>o.jsxs(Ur,{variant:"secondary",className:"gap-1",children:[m,!n&&o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),f(m)},className:"ml-1 rounded-full outline-none hover:bg-muted",children:o.jsx(I.X,{className:"h-3 w-3"})})]},m)),o.jsx("input",{ref:g,type:"text",value:c,onChange:m=>d(m.target.value),onKeyDown:u,placeholder:e.length===0?l:"",disabled:n||(a?e.length>=a:!1),className:"flex-1 min-w-[120px] bg-transparent outline-none placeholder:text-muted-foreground text-sm"})]})}function rc({options:e,value:t,onChange:r,placeholder:n,searchPlaceholder:s,emptyText:a,disabled:i,className:l}){const c=te(),d=n??c.combobox_placeholder,g=s??c.combobox_searchPlaceholder,u=a??c.combobox_empty,[f,m]=p.useState(!1),[h,x]=p.useState(""),y=e.filter(v=>v.label.toLowerCase().includes(h.toLowerCase())),w=e.find(v=>v.value===t);return o.jsxs(yt,{open:f,onOpenChange:m,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",role:"combobox","aria-expanded":f,disabled:i,className:b("w-full justify-between font-normal",!t&&"text-muted-foreground",l),children:[w?w.label:d,o.jsx(I.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsxs(ft,{className:"w-full p-0",align:"start",children:[o.jsx("div",{className:"p-2 border-b",children:o.jsx(st,{placeholder:g,value:h,onChange:v=>x(v.target.value),className:"h-8"})}),o.jsx("div",{className:"max-h-60 overflow-auto p-1",children:y.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):y.map(v=>o.jsxs("button",{onClick:()=>{r==null||r(v.value===t?"":v.value),m(!1),x("")},className:b("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",t===v.value&&"bg-accent"),children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t===v.value&&o.jsx(I.Check,{className:"h-4 w-4"})}),v.label]},v.value))})]})]})}function nc({options:e,value:t=[],onChange:r,placeholder:n,searchPlaceholder:s,emptyText:a,disabled:i,className:l,maxDisplay:c=3}){const d=te(),g=n??d.multiselect_placeholder,u=s??d.multiselect_searchPlaceholder,f=a??d.multiselect_empty,[m,h]=p.useState(!1),[x,y]=p.useState(""),w=e.filter(C=>C.label.toLowerCase().includes(x.toLowerCase())),v=e.filter(C=>t.includes(C.value)),j=C=>{const k=t.includes(C)?t.filter(N=>N!==C):[...t,C];r==null||r(k)},R=(C,k)=>{k.stopPropagation(),r==null||r(t.filter(N=>N!==C))},M=()=>t.length===0?g:t.length<=c?v.map(C=>C.label).join(", "):De(d.multiselect_selected,{count:t.length});return o.jsxs(yt,{open:m,onOpenChange:h,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",role:"combobox","aria-expanded":m,disabled:i,className:b("w-full justify-between font-normal",t.length===0&&"text-muted-foreground",l),children:[o.jsx("span",{className:"truncate",children:M()}),o.jsx(I.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsxs(ft,{className:"w-full p-0",align:"start",children:[o.jsx("div",{className:"p-2 border-b",children:o.jsx(st,{placeholder:u,value:x,onChange:C=>y(C.target.value),className:"h-8"})}),t.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1 p-2 border-b",children:v.map(C=>o.jsxs(Ur,{variant:"secondary",className:"pr-1",children:[C.label,o.jsx("button",{onClick:k=>R(C.value,k),className:"ml-1 rounded-full hover:bg-muted",children:o.jsx(I.X,{className:"h-3 w-3"})})]},C.value))}),o.jsx("div",{className:"max-h-60 overflow-auto p-1",children:w.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:f}):w.map(C=>{const k=t.includes(C.value);return o.jsxs("button",{onClick:()=>j(C.value),className:b("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",k&&"bg-accent"),children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:k&&o.jsx(I.Check,{className:"h-4 w-4"})}),C.label]},C.value)})})]})]})}function oc({length:e=6,value:t="",onChange:r,onComplete:n,disabled:s,className:a}){const i=p.useRef([]),l=(g,u)=>{var h;if(!/^\d*$/.test(u))return;const f=t.split("");f[g]=u;const m=f.join("").slice(0,e);r==null||r(m),u&&g<e-1&&((h=i.current[g+1])==null||h.focus()),m.length===e&&(n==null||n(m))},c=(g,u)=>{var f;u.key==="Backspace"&&!t[g]&&g>0&&((f=i.current[g-1])==null||f.focus())},d=g=>{var f;g.preventDefault();const u=g.clipboardData.getData("text").replace(/\D/g,"").slice(0,e);r==null||r(u),u.length===e&&(n==null||n(u)),(f=i.current[Math.min(u.length,e-1)])==null||f.focus()};return o.jsx("div",{className:b("flex gap-2",a),children:Array.from({length:e}).map((g,u)=>o.jsx("input",{ref:f=>{i.current[u]=f},type:"text",inputMode:"numeric",maxLength:1,value:t[u]||"",onChange:f=>l(u,f.target.value),onKeyDown:f=>c(u,f),onPaste:d,disabled:s,className:b("h-12 w-12 rounded-lg border border-input bg-background text-center text-lg font-semibold","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed")},u))})}function sc({accept:e,maxSize:t,multiple:r=!1,onUpload:n,disabled:s,className:a}){const[i,l]=p.useState([]),[c,d]=p.useState(!1),g=p.useRef(null),u=te(),f=v=>{if(!v)return;const j=Array.from(v).filter(M=>!(t&&M.size>t)),R=r?[...i,...j]:j.slice(0,1);l(R),n==null||n(R)},m=v=>{v.preventDefault(),d(!1),s||f(v.dataTransfer.files)},h=v=>{v.preventDefault(),s||d(!0)},x=()=>{d(!1)},y=v=>{const j=i.filter((R,M)=>M!==v);l(j),n==null||n(j)},w=v=>v<1024?v+" B":v<1024*1024?(v/1024).toFixed(1)+" KB":(v/(1024*1024)).toFixed(1)+" MB";return o.jsxs("div",{className:b("space-y-4",a),children:[o.jsxs("div",{onClick:()=>{var v;return!s&&((v=g.current)==null?void 0:v.click())},onDrop:m,onDragOver:h,onDragLeave:x,className:b("border-2 border-dashed rounded-lg p-8 text-center transition-colors cursor-pointer",c?"border-primary bg-primary/5":"border-muted-foreground/25",s&&"opacity-50 cursor-not-allowed","hover:border-primary/50"),children:[o.jsx(I.Upload,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:u.fileUpload_dragDrop}),t&&o.jsx("p",{className:"text-xs text-muted-foreground",children:De(u.fileUpload_maxSize,{size:w(t)})}),o.jsx("input",{ref:g,type:"file",accept:e,multiple:r,onChange:v=>f(v.target.files),disabled:s,className:"hidden"})]}),i.length>0&&o.jsx("div",{className:"space-y-2",children:i.map((v,j)=>o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-muted/50",children:[o.jsx(I.FileIcon,{className:"h-8 w-8 text-muted-foreground"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:v.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:w(v.size)})]}),o.jsx(ve,{type:"button",variant:"ghost",size:"icon",onClick:()=>y(j),className:"h-8 w-8",children:o.jsx(I.X,{className:"h-4 w-4"})})]},j))})]})}const ac=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#8b5cf6","#ec4899","#000000","#ffffff"];function Yt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return{h:0,s:100,l:50};let r=parseInt(t[1],16)/255,n=parseInt(t[2],16)/255,s=parseInt(t[3],16)/255;const a=Math.max(r,n,s),i=Math.min(r,n,s);let l=0,c=0;const d=(a+i)/2;if(a!==i){const g=a-i;switch(c=d>.5?g/(2-a-i):g/(a+i),a){case r:l=((n-s)/g+(n<s?6:0))/6;break;case n:l=((s-r)/g+2)/6;break;case s:l=((r-n)/g+4)/6;break}}return{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(d*100)}}function ic(e,t,r){t/=100,r/=100;const n=t*Math.min(r,1-r),s=a=>{const i=(a+e/30)%12,l=r-n*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*l).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function lc({value:e="#3b82f6",onChange:t,disabled:r,className:n}){const[s,a]=p.useState(!1),[i,l]=p.useState(()=>Yt(e)),[c,d]=p.useState(e),g=p.useRef(null);p.useEffect(()=>{l(Yt(e)),d(e)},[e]);const u=h=>{l(h);const x=ic(h.h,h.s,h.l);d(x),t==null||t(x)},f=h=>{if(!g.current)return;const x=g.current.getBoundingClientRect(),y=Math.max(0,Math.min(1,(h.clientX-x.left)/x.width)),w=Math.max(0,Math.min(1,(h.clientY-x.top)/x.height));u({...i,s:Math.round(y*100),l:Math.round((1-w)*100)})},m=h=>{if(d(h),/^#[0-9A-Fa-f]{6}$/.test(h)){const x=Yt(h);l(x),t==null||t(h)}};return o.jsxs(yt,{open:s,onOpenChange:a,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:r,className:b("w-full justify-start gap-2",n),children:[o.jsx("div",{className:"h-5 w-5 rounded border shadow-sm",style:{backgroundColor:e}}),o.jsx("span",{className:"font-mono text-sm",children:e})]})}),o.jsx(ft,{className:"w-72 p-3",align:"start",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{ref:g,onClick:f,className:"relative h-40 rounded-lg cursor-crosshair overflow-hidden border",style:{background:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),B=require("react"),ro=require("@radix-ui/react-slot"),Bi=require("@radix-ui/react-label"),Oi=require("@radix-ui/react-separator"),Hi=require("@radix-ui/react-avatar"),Gi=require("@radix-ui/react-checkbox"),P=require("lucide-react"),qi=require("@radix-ui/react-switch"),Wi=require("@radix-ui/react-select"),Ui=require("@radix-ui/react-radio-group"),Ki=require("@radix-ui/react-slider"),Xi=require("@radix-ui/react-toggle"),Yi=require("@radix-ui/react-toggle-group"),_e=require("date-fns"),Zi=require("@radix-ui/react-popover"),Ji=require("@radix-ui/react-aspect-ratio"),Qi=require("@radix-ui/react-collapsible"),el=require("@radix-ui/react-scroll-area"),tl=require("@radix-ui/react-tabs"),rl=require("@radix-ui/react-accordion"),nl=require("@radix-ui/react-dialog"),ol=require("@radix-ui/react-dropdown-menu"),sl=require("@radix-ui/react-tooltip"),$e=require("cmdk"),al=require("@radix-ui/react-alert-dialog"),il=require("@radix-ui/react-progress"),qr=require("react-dom"),ll=require("@radix-ui/react-navigation-menu"),cl=require("@radix-ui/react-context-menu"),dl=require("@radix-ui/react-hover-card"),Wr=require("recharts");function xe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const f=xe(B),no=xe(Bi),oo=xe(Oi),Rt=xe(Hi),Lr=xe(Gi),Tr=xe(qi),ye=xe(Wi),$t=xe(Ui),Et=xe(Ki),so=xe(Xi),dr=xe(Yi),Bt=xe(Zi),ul=xe(Ji),Ur=xe(Qi),xt=xe(el),wt=xe(tl),vt=xe(rl),ge=xe(nl),pe=xe(ol),Wt=xe(sl),Ae=xe(al),Er=xe(il),Be=xe(ll),he=xe(cl),ur=xe(dl);function ao(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=ao(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function io(){for(var e,t,r=0,o="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=ao(e))&&(o&&(o+=" "),o+=t);return o}const ml=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},fl=(e,t)=>({classGroupId:e,validator:t}),lo=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ar="-",Tn=[],gl="arbitrary..",pl=e=>{const t=xl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return hl(i);const l=i.split(ar),d=l[0]===""&&l.length>1?1:0;return co(l,d,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const d=o[i],c=r[i];return d?c?ml(c,d):d:c||Tn}return r[i]||Tn}}},co=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const c=co(e,t+1,a);if(c)return c}const i=r.validators;if(i===null)return;const l=t===0?e.join(ar):e.slice(t).join(ar),d=i.length;for(let c=0;c<d;c++){const p=i[c];if(p.validator(l))return p.classGroupId}},hl=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?gl+o:void 0})(),xl=e=>{const{theme:t,classGroups:r}=e;return vl(r,t)},vl=(e,t)=>{const r=lo();for(const o in e){const s=e[o];Kr(s,r,o,t)}return r},Kr=(e,t,r,o)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];bl(i,t,r,o)}},bl=(e,t,r,o)=>{if(typeof e=="string"){wl(e,t,r);return}if(typeof e=="function"){yl(e,t,r,o);return}jl(e,t,r,o)},wl=(e,t,r)=>{const o=e===""?t:uo(t,e);o.classGroupId=r},yl=(e,t,r,o)=>{if(Nl(e)){Kr(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(fl(r,e))},jl=(e,t,r,o)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,d]=s[i];Kr(d,uo(t,l),r,o)}},uo=(e,t)=>{let r=e;const o=t.split(ar),s=o.length;for(let a=0;a<s;a++){const i=o[a];let l=r.nextPart.get(i);l||(l=lo(),r.nextPart.set(i,l)),r=l}return r},Nl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,kl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=o[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},Dr="!",En=":",Cl=[],Dn=(e,t,r,o,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:s}),Sl=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=s=>{const a=[];let i=0,l=0,d=0,c;const p=s.length;for(let x=0;x<p;x++){const y=s[x];if(i===0&&l===0){if(y===En){a.push(s.slice(d,x)),d=x+1;continue}if(y==="/"){c=x;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const u=a.length===0?s:s.slice(d);let m=u,g=!1;u.endsWith(Dr)?(m=u.slice(0,-1),g=!0):u.startsWith(Dr)&&(m=u.slice(1),g=!0);const h=c&&c>d?c-d:void 0;return Dn(a,g,m,h)};if(t){const s=t+En,a=o;o=i=>i.startsWith(s)?a(i.slice(s.length)):Dn(Cl,!1,i,void 0,!0)}if(r){const s=o;o=a=>r({className:a,parseClassName:s})}return o},Rl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",d=t.has(i);l||d?(s.length>0&&(s.sort(),o.push(...s),s=[]),o.push(i)):s.push(i)}return s.length>0&&(s.sort(),o.push(...s)),o}},_l=e=>({cache:kl(e.cacheSize),parseClassName:Sl(e),sortModifiers:Rl(e),...pl(e)}),Ml=/\s+/,Pl=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(Ml);let d="";for(let c=l.length-1;c>=0;c-=1){const p=l[c],{isExternal:u,modifiers:m,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:x}=r(p);if(u){d=p+(d.length>0?" "+d:d);continue}let y=!!x,b=o(y?h.substring(0,x):h);if(!b){if(!y){d=p+(d.length>0?" "+d:d);continue}if(b=o(h),!b){d=p+(d.length>0?" "+d:d);continue}y=!1}const w=m.length===0?"":m.length===1?m[0]:a(m).join(":"),j=g?w+Dr:w,M=j+b;if(i.indexOf(M)>-1)continue;i.push(M);const R=s(b,y);for(let _=0;_<R.length;++_){const C=R[_];i.push(j+C)}d=p+(d.length>0?" "+d:d)}return d},Il=(...e)=>{let t=0,r,o,s="";for(;t<e.length;)(r=e[t++])&&(o=mo(r))&&(s&&(s+=" "),s+=o);return s},mo=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=mo(e[o]))&&(r&&(r+=" "),r+=t);return r},Ll=(e,...t)=>{let r,o,s,a;const i=d=>{const c=t.reduce((p,u)=>u(p),e());return r=_l(c),o=r.cache.get,s=r.cache.set,a=l,l(d)},l=d=>{const c=o(d);if(c)return c;const p=Pl(d,r);return s(d,p),p};return a=i,(...d)=>a(Il(...d))},Tl=[],Se=e=>{const t=r=>r[e]||Tl;return t.isThemeGetter=!0,t},fo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,go=/^\((?:(\w[\w-]*):)?(.+)\)$/i,El=/^\d+\/\d+$/,Dl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Al=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>El.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),ct=e=>!!e&&Number.isInteger(Number(e)),yr=e=>e.endsWith("%")&&de(e.slice(0,-1)),tt=e=>Dl.test(e),$l=()=>!0,Bl=e=>Al.test(e)&&!Fl.test(e),po=()=>!1,Ol=e=>Vl.test(e),Hl=e=>zl.test(e),Gl=e=>!J(e)&&!Q(e),ql=e=>_t(e,vo,po),J=e=>fo.test(e),pt=e=>_t(e,bo,Bl),jr=e=>_t(e,Yl,de),An=e=>_t(e,ho,po),Wl=e=>_t(e,xo,Hl),Jt=e=>_t(e,wo,Ol),Q=e=>go.test(e),Lt=e=>Mt(e,bo),Ul=e=>Mt(e,Zl),Fn=e=>Mt(e,ho),Kl=e=>Mt(e,vo),Xl=e=>Mt(e,xo),Qt=e=>Mt(e,wo,!0),_t=(e,t,r)=>{const o=fo.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},Mt=(e,t,r=!1)=>{const o=go.exec(e);return o?o[1]?t(o[1]):r:!1},ho=e=>e==="position"||e==="percentage",xo=e=>e==="image"||e==="url",vo=e=>e==="length"||e==="size"||e==="bg-size",bo=e=>e==="length",Yl=e=>e==="number",Zl=e=>e==="family-name",wo=e=>e==="shadow",Jl=()=>{const e=Se("color"),t=Se("font"),r=Se("text"),o=Se("font-weight"),s=Se("tracking"),a=Se("leading"),i=Se("breakpoint"),l=Se("container"),d=Se("spacing"),c=Se("radius"),p=Se("shadow"),u=Se("inset-shadow"),m=Se("text-shadow"),g=Se("drop-shadow"),h=Se("blur"),x=Se("perspective"),y=Se("aspect"),b=Se("ease"),w=Se("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...M(),Q,J],_=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],S=()=>[Q,J,d],T=()=>[St,"full","auto",...S()],L=()=>[ct,"none","subgrid",Q,J],V=()=>["auto",{span:["full",ct,Q,J]},ct,Q,J],O=()=>[ct,"auto",Q,J],$=()=>["auto","min","max","fr",Q,J],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...S()],E=()=>[St,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],N=()=>[e,Q,J],W=()=>[...M(),Fn,An,{position:[Q,J]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",Kl,ql,{size:[Q,J]}],Z=()=>[yr,Lt,pt],I=()=>["","none","full",c,Q,J],F=()=>["",de,Lt,pt],U=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[de,yr,Fn,An],Y=()=>["","none",h,Q,J],ae=()=>["none",de,Q,J],te=()=>["none",de,Q,J],ie=()=>[de,Q,J],K=()=>[St,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tt],breakpoint:[tt],color:[$l],container:[tt],"drop-shadow":[tt],ease:["in","out","in-out"],font:[Gl],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tt],shadow:[tt],spacing:["px",de],text:[tt],"text-shadow":[tt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",St,J,Q,y]}],container:["container"],columns:[{columns:[de,J,Q,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[ct,"auto",Q,J]}],basis:[{basis:[St,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,St,"auto","initial","none",J]}],grow:[{grow:["",de,Q,J]}],shrink:[{shrink:["",de,Q,J]}],order:[{order:[ct,"first","last","none",Q,J]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[l,"screen",...E()]}],"min-w":[{"min-w":[l,"screen","none",...E()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",r,Lt,pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Q,jr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yr,J]}],"font-family":[{font:[Ul,J,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Q,J]}],"line-clamp":[{"line-clamp":[de,"none",Q,jr]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":["none",Q,J]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Q,J]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",Q,pt]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[de,"auto",Q,J]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q,J]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q,J]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ct,Q,J],radial:["",Q,J],conic:[ct,Q,J]},Xl,Wl]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...U(),"hidden","none"]}],"divide-style":[{divide:[...U(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,Q,J]}],"outline-w":[{outline:["",de,Lt,pt]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",p,Qt,Jt]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",u,Qt,Jt]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[de,pt]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",m,Qt,Jt]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[de,Q,J]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Q,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Q,J]}],filter:[{filter:["","none",Q,J]}],blur:[{blur:Y()}],brightness:[{brightness:[de,Q,J]}],contrast:[{contrast:[de,Q,J]}],"drop-shadow":[{"drop-shadow":["","none",g,Qt,Jt]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",de,Q,J]}],"hue-rotate":[{"hue-rotate":[de,Q,J]}],invert:[{invert:["",de,Q,J]}],saturate:[{saturate:[de,Q,J]}],sepia:[{sepia:["",de,Q,J]}],"backdrop-filter":[{"backdrop-filter":["","none",Q,J]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[de,Q,J]}],"backdrop-contrast":[{"backdrop-contrast":[de,Q,J]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,Q,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,Q,J]}],"backdrop-invert":[{"backdrop-invert":["",de,Q,J]}],"backdrop-opacity":[{"backdrop-opacity":[de,Q,J]}],"backdrop-saturate":[{"backdrop-saturate":[de,Q,J]}],"backdrop-sepia":[{"backdrop-sepia":["",de,Q,J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Q,J]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",Q,J]}],ease:[{ease:["linear","initial",b,Q,J]}],delay:[{delay:[de,Q,J]}],animate:[{animate:["none",w,Q,J]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Q,J]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[Q,J,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q,J]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q,J]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[de,Lt,pt,jr]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ql=Ll(Jl);function v(...e){return Ql(io(e))}function Ke(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${r}:${o.toString().padStart(2,"0")}`}const Vn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zn=io,Le=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return zn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(c=>{const p=r==null?void 0:r[c],u=a==null?void 0:a[c];if(p===null)return null;const m=Vn(p)||Vn(u);return s[c][m]}),l=r&&Object.entries(r).reduce((c,p)=>{let[u,m]=p;return m===void 0||(c[u]=m),c},{}),d=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,p)=>{let{class:u,className:m,...g}=p;return Object.entries(g).every(h=>{let[x,y]=h;return Array.isArray(y)?y.includes({...a,...l}[x]):{...a,...l}[x]===y})?[...c,u,m]:c},[]);return zn(e,i,d,r==null?void 0:r.class,r==null?void 0:r.className)},Ut=Le("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",brand:"bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-500 hover:to-indigo-500 shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 hover:scale-[1.02] active:scale-[0.98]",glow:"bg-primary text-primary-foreground shadow-[0_0_20px_rgba(139,92,246,0.5)] hover:shadow-[0_0_30px_rgba(139,92,246,0.7)] hover:scale-[1.02] active:scale-[0.98]"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",xl:"h-12 rounded-lg px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ke=f.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...s},a)=>{const i=o?ro.Slot:"button";return n.jsx(i,{className:v(Ut({variant:t,size:r,className:e})),ref:a,...s})});ke.displayName="Button";const yo=Le("flex w-full rounded-lg text-sm transition-all duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",filled:"h-10 border-0 bg-muted/50 px-3 py-2 focus-visible:outline-none focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring",glow:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:border-violet-500/50 focus-visible:ring-2 focus-visible:ring-violet-500/30 focus-visible:shadow-[0_0_15px_rgba(139,92,246,0.3)]",ghost:"h-10 border-0 bg-transparent px-3 py-2 focus-visible:outline-none focus-visible:bg-muted/30"},inputSize:{default:"h-10",sm:"h-9 text-xs",lg:"h-12 text-base"}},defaultVariants:{variant:"default",inputSize:"default"}}),mt=f.forwardRef(({className:e,type:t,variant:r,inputSize:o,...s},a)=>n.jsx("input",{type:t,className:v(yo({variant:r,inputSize:o}),e),ref:a,...s}));mt.displayName="Input";const jo=f.forwardRef(({className:e,...t},r)=>n.jsx("textarea",{className:v("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));jo.displayName="Textarea";const ec=Le("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),mr=f.forwardRef(({className:e,...t},r)=>n.jsx(no.Root,{ref:r,className:v(ec(),e),...t}));mr.displayName=no.Root.displayName;const No=Le("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Xr({className:e,variant:t,...r}){return n.jsx("div",{className:v(No({variant:t}),e),...r})}const ko=f.forwardRef(({className:e,orientation:t="horizontal",...r},o)=>n.jsx(oo.Root,{ref:o,decorative:!0,orientation:t,className:v("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ko.displayName=oo.Root.displayName;const Co=f.forwardRef(({className:e,...t},r)=>n.jsx(Rt.Root,{ref:r,className:v("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Co.displayName=Rt.Root.displayName;const So=f.forwardRef(({className:e,...t},r)=>n.jsx(Rt.Image,{ref:r,className:v("aspect-square h-full w-full",e),...t}));So.displayName=Rt.Image.displayName;const Ro=f.forwardRef(({className:e,...t},r)=>n.jsx(Rt.Fallback,{ref:r,className:v("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ro.displayName=Rt.Fallback.displayName;const _o=f.forwardRef(({className:e,...t},r)=>n.jsx(Lr.Root,{ref:r,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:n.jsx(Lr.Indicator,{className:v("flex items-center justify-center text-current"),children:n.jsx(P.Check,{className:"h-4 w-4"})})}));_o.displayName=Lr.Root.displayName;const Mo=f.forwardRef(({className:e,...t},r)=>n.jsx(Tr.Root,{className:v("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:n.jsx(Tr.Thumb,{className:v("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Mo.displayName=Tr.Root.displayName;const tc=ye.Root,rc=ye.Group,nc=ye.Value,Po=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(ye.Trigger,{ref:o,className:v("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,n.jsx(ye.Icon,{asChild:!0,children:n.jsx(P.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Po.displayName=ye.Trigger.displayName;const Yr=f.forwardRef(({className:e,...t},r)=>n.jsx(ye.ScrollUpButton,{ref:r,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(P.ChevronUp,{className:"h-4 w-4"})}));Yr.displayName=ye.ScrollUpButton.displayName;const Zr=f.forwardRef(({className:e,...t},r)=>n.jsx(ye.ScrollDownButton,{ref:r,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(P.ChevronDown,{className:"h-4 w-4"})}));Zr.displayName=ye.ScrollDownButton.displayName;const Io=f.forwardRef(({className:e,children:t,position:r="popper",...o},s)=>n.jsx(ye.Portal,{children:n.jsxs(ye.Content,{ref:s,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[n.jsx(Yr,{}),n.jsx(ye.Viewport,{className:v("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),n.jsx(Zr,{})]})}));Io.displayName=ye.Content.displayName;const Lo=f.forwardRef(({className:e,...t},r)=>n.jsx(ye.Label,{ref:r,className:v("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Lo.displayName=ye.Label.displayName;const To=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(ye.Item,{ref:o,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(ye.ItemIndicator,{children:n.jsx(P.Check,{className:"h-4 w-4"})})}),n.jsx(ye.ItemText,{children:t})]}));To.displayName=ye.Item.displayName;const Eo=f.forwardRef(({className:e,...t},r)=>n.jsx(ye.Separator,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Eo.displayName=ye.Separator.displayName;const Do=f.forwardRef(({className:e,...t},r)=>n.jsx($t.Root,{className:v("grid gap-2",e),...t,ref:r}));Do.displayName=$t.Root.displayName;const Ao=f.forwardRef(({className:e,...t},r)=>n.jsx($t.Item,{ref:r,className:v("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:n.jsx($t.Indicator,{className:"flex items-center justify-center",children:n.jsx(P.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ao.displayName=$t.Item.displayName;const Fo=f.forwardRef(({className:e,...t},r)=>n.jsxs(Et.Root,{ref:r,className:v("relative flex w-full touch-none select-none items-center",e),...t,children:[n.jsx(Et.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:n.jsx(Et.Range,{className:"absolute h-full bg-primary"})}),n.jsx(Et.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Fo.displayName=Et.Root.displayName;const Jr=Le("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Vo=f.forwardRef(({className:e,variant:t,size:r,...o},s)=>n.jsx(so.Root,{ref:s,className:v(Jr({variant:t,size:r,className:e})),...o}));Vo.displayName=so.Root.displayName;const zo=f.forwardRef(({className:e,variant:t,size:r,children:o,...s},a)=>n.jsx(dr.Root,{ref:a,className:v("flex items-center justify-center gap-1",e),...s,children:n.jsx($o.Provider,{value:{variant:t,size:r},children:o})}));zo.displayName=dr.Root.displayName;const $o=f.createContext({size:"default",variant:"default"}),Bo=f.forwardRef(({className:e,children:t,variant:r,size:o,...s},a)=>{const i=f.useContext($o);return n.jsx(dr.Item,{ref:a,className:v(Jr({variant:i.variant||r,size:i.size||o}),e),...s,children:t})});Bo.displayName=dr.Item.displayName;function Qr({selected:e,onSelect:t,className:r,disabled:o}){const[s,a]=f.useState(()=>e?_e.startOfMonth(e):_e.startOfMonth(new Date)),i=_e.startOfMonth(s),l=_e.endOfMonth(s),d=_e.startOfWeek(i,{weekStartsOn:1}),c=_e.endOfWeek(l,{weekStartsOn:1}),p=_e.eachDayOfInterval({start:d,end:c}),u=["Mo","Tu","We","Th","Fr","Sa","Su"],m=()=>{a(_e.subMonths(s,1))},g=()=>{a(_e.addMonths(s,1))},h=x=>{o!=null&&o(x)||t==null||t(_e.isSameDay(x,e||new Date(0))?void 0:x)};return n.jsxs("div",{className:v("p-4 bg-card rounded-xl border shadow-sm w-[320px]",r),children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx(ke,{variant:"ghost",size:"icon",onClick:m,className:"h-8 w-8 rounded-full hover:bg-accent",children:n.jsx(P.ChevronLeft,{className:"h-4 w-4"})}),n.jsx("h2",{className:"text-base font-semibold",children:_e.format(s,"MMMM yyyy")}),n.jsx(ke,{variant:"ghost",size:"icon",onClick:g,className:"h-8 w-8 rounded-full hover:bg-accent",children:n.jsx(P.ChevronRight,{className:"h-4 w-4"})})]}),n.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:u.map(x=>n.jsx("div",{className:"h-8 flex items-center justify-center text-xs font-medium text-muted-foreground",children:x},x))}),n.jsx("div",{className:"grid grid-cols-7 gap-1",children:p.map((x,y)=>{const b=_e.isSameMonth(x,s),w=e&&_e.isSameDay(x,e),j=_e.isToday(x),M=o==null?void 0:o(x);return n.jsx("button",{onClick:()=>h(x),disabled:M,className:v("h-10 w-10 rounded-lg text-sm font-medium transition-all duration-150","flex items-center justify-center","hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",!b&&"text-muted-foreground/40",b&&!w&&"text-foreground hover:text-foreground",w&&"bg-primary text-primary-foreground hover:bg-primary/90 shadow-md",j&&!w&&"bg-accent text-accent-foreground font-bold",M&&"opacity-30 cursor-not-allowed hover:bg-transparent"),children:_e.format(x,"d")},y)})}),n.jsxs("div",{className:"mt-4 pt-3 border-t flex justify-between items-center",children:[n.jsx(ke,{variant:"ghost",size:"sm",onClick:()=>{const x=new Date;a(_e.startOfMonth(x)),t==null||t(x)},className:"text-xs",children:"Today"}),e&&n.jsx("span",{className:"text-xs text-muted-foreground",children:_e.format(e,"MMM d, yyyy")})]})]})}Qr.displayName="Calendar";const Pt=Bt.Root,It=Bt.Trigger,yt=f.forwardRef(({className:e,align:t="center",sideOffset:r=4,...o},s)=>n.jsx(Bt.Portal,{children:n.jsx(Bt.Content,{ref:s,align:t,sideOffset:r,className:v("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));yt.displayName=Bt.Content.displayName;const Ot={chatInput_placeholder:"Type a message...",chatInput_attachFile:"Attach file",chatInput_stopGenerating:"Stop generating",chatInput_sendMessage:"Send message",conversationList_newChat:"New Chat",conversationList_searchPlaceholder:"Search conversations...",conversationList_noResults:"No conversations found",conversationList_empty:"No conversations yet",conversationList_today:"Today",conversationList_yesterday:"Yesterday",conversationList_previous7Days:"Previous 7 days",conversationList_older:"Older",conversationList_rename:"Rename",conversationList_delete:"Delete",chatHeader_online:"Online",chatHeader_offline:"Offline",chatHeader_typing:"Typing...",chatHeader_back:"Back",chatHeader_clearConversation:"Clear conversation",chatHeader_settings:"Settings",reasoning_title:"Reasoning",reasoning_thinking:"Thinking",reasoning_thoughtFor:"Thought for {duration}",toolCall_calling:"Calling {name}...",toolCall_failed:"{name} — failed",toolCall_arguments:"Arguments",toolCall_result:"Result",toolCall_error:"Error",messageActions_copy:"Copy",messageActions_retry:"Retry",messageActions_edit:"Edit",messageActions_like:"Like",messageActions_dislike:"Dislike",messageActions_share:"Share",messageActions_copied:"Copied!",followUp_freeTextPlaceholder:"Or type your answer...",followUp_send:"Send",sourceCitation_sources:"Sources",aiLoading_thinking:"Thinking",filePreview_remove:"Remove {name}",modelSelector_placeholder:"Select model",modelSelector_searchPlaceholder:"Search models...",modelSelector_noResults:"No models found",common_close:"Close",common_search:"Search",common_noResults:"No results found.",common_previous:"Previous",common_next:"Next",common_more:"More",common_copyCode:"Copy code",combobox_placeholder:"Select option...",combobox_searchPlaceholder:"Search...",combobox_empty:"No results found.",multiselect_placeholder:"Select options...",multiselect_searchPlaceholder:"Search...",multiselect_empty:"No results found.",multiselect_selected:"{count} selected",datePicker_placeholder:"Pick a date",dataTable_searchPlaceholder:"Search...",dataTable_noResults:"No results.",dataTable_pageOf:"Page {page} of {total}",dataTable_previous:"Previous",dataTable_next:"Next",fileUpload_dragDrop:"Drag & drop files here, or click to select",fileUpload_maxSize:"Max file size: {size}",tagInput_placeholder:"Add tag...",pagination_previous:"Previous",pagination_next:"Next",pagination_morePages:"More pages",pagination_goToPrevious:"Go to previous page",pagination_goToNext:"Go to next page",modeToggle_toggleTheme:"Toggle theme",modeToggle_light:"Light",modeToggle_dark:"Dark",modeToggle_system:"System",modeToggle_colorTheme:"Color theme",carousel_previousSlide:"Previous slide",carousel_nextSlide:"Next slide",breadcrumb_more:"More",audioPlayer_play:"Play",audioPlayer_pause:"Pause",audioPlayer_mute:"Mute",audioPlayer_unmute:"Unmute",audioPlayer_seek:"Seek",audioPlayer_volume:"Volume",audioPlayer_error:"Audio failed to load",audioPlayer_loading:"Loading...",audioRecorder_startRecording:"Start recording",audioRecorder_stopRecording:"Stop recording",audioRecorder_pauseRecording:"Pause recording",audioRecorder_resumeRecording:"Resume recording",audioRecorder_reRecord:"Re-record",audioRecorder_microphoneAccess:"Microphone access required",audioRecorder_error:"Recording failed",audioRecorder_permissionDenied:"Microphone access denied",audioWaveform_label:"Audio waveform",audioWaveform_error:"Failed to load audio waveform",audioPlaylist_shuffle:"Shuffle",audioPlaylist_repeatOff:"Repeat off",audioPlaylist_repeatAll:"Repeat all",audioPlaylist_repeatOne:"Repeat one",audioPlaylist_previousTrack:"Previous track",audioPlaylist_nextTrack:"Next track",audioPlaylist_trackOf:"Track {current} of {total}",audioPlaylist_empty:"No tracks in playlist",videoPlayer_play:"Play",videoPlayer_pause:"Pause",videoPlayer_mute:"Mute",videoPlayer_unmute:"Unmute",videoPlayer_seek:"Seek",videoPlayer_volume:"Volume",videoPlayer_fullscreen:"Fullscreen",videoPlayer_exitFullscreen:"Exit fullscreen",videoPlayer_pictureInPicture:"Picture in picture",videoPlayer_playbackSpeed:"Playback speed",videoPlayer_subtitles:"Subtitles",videoPlayer_subtitlesOff:"Off",videoPlayer_label:"Video player",videoPlayer_loading:"Loading...",videoPlayer_error:"Video failed to load",videoRecorder_startCamera:"Start camera",videoRecorder_shareScreen:"Share screen",videoRecorder_startRecording:"Start recording",videoRecorder_stopRecording:"Stop recording",videoRecorder_pauseRecording:"Pause recording",videoRecorder_resumeRecording:"Resume recording",videoRecorder_reRecord:"Re-record",videoRecorder_cameraPreview:"Camera preview",videoRecorder_screenPreview:"Screen preview",videoRecorder_error:"Recording failed",videoRecorder_permissionDenied:"Camera access denied",videoThumbnail_play:"Play video: {title}",videoGallery_label:"Video gallery",image_loading:"Loading image",image_zoomIn:"Zoom in",image_failedToLoad:"Image failed to load",lightbox_label:"Image viewer",lightbox_zoomIn:"Zoom in",lightbox_zoomOut:"Zoom out",lightbox_imageOf:"{current} of {total}",lightbox_download:"Download",imageCropper_label:"Image crop area",imageCropper_crop:"Crop",imageCropper_reset:"Reset",imageCropper_cropFailed:"Failed to create cropped image",imageCompare_slider:"Image comparison slider",imageCompare_before:"Before",imageCompare_after:"After"},Oo={chatInput_placeholder:"Введите сообщение...",chatInput_attachFile:"Прикрепить файл",chatInput_stopGenerating:"Остановить генерацию",chatInput_sendMessage:"Отправить сообщение",conversationList_newChat:"Новый чат",conversationList_searchPlaceholder:"Поиск диалогов...",conversationList_noResults:"Диалоги не найдены",conversationList_empty:"Нет диалогов",conversationList_today:"Сегодня",conversationList_yesterday:"Вчера",conversationList_previous7Days:"Последние 7 дней",conversationList_older:"Ранее",conversationList_rename:"Переименовать",conversationList_delete:"Удалить",chatHeader_online:"Онлайн",chatHeader_offline:"Не в сети",chatHeader_typing:"Печатает...",chatHeader_back:"Назад",chatHeader_clearConversation:"Очистить диалог",chatHeader_settings:"Настройки",reasoning_title:"Рассуждение",reasoning_thinking:"Думаю",reasoning_thoughtFor:"Думал {duration}",toolCall_calling:"Вызываю {name}...",toolCall_failed:"{name} — ошибка",toolCall_arguments:"Аргументы",toolCall_result:"Результат",toolCall_error:"Ошибка",messageActions_copy:"Копировать",messageActions_retry:"Повторить",messageActions_edit:"Редактировать",messageActions_like:"Нравится",messageActions_dislike:"Не нравится",messageActions_share:"Поделиться",messageActions_copied:"Скопировано!",followUp_freeTextPlaceholder:"Или введите свой ответ...",followUp_send:"Отправить",sourceCitation_sources:"Источники",aiLoading_thinking:"Думаю",filePreview_remove:"Удалить {name}",modelSelector_placeholder:"Выберите модель",modelSelector_searchPlaceholder:"Поиск моделей...",modelSelector_noResults:"Модели не найдены",common_close:"Закрыть",common_search:"Поиск",common_noResults:"Ничего не найдено.",common_previous:"Назад",common_next:"Далее",common_more:"Ещё",common_copyCode:"Копировать код",combobox_placeholder:"Выберите...",combobox_searchPlaceholder:"Поиск...",combobox_empty:"Ничего не найдено.",multiselect_placeholder:"Выберите...",multiselect_searchPlaceholder:"Поиск...",multiselect_empty:"Ничего не найдено.",multiselect_selected:"{count} выбрано",datePicker_placeholder:"Выберите дату",dataTable_searchPlaceholder:"Поиск...",dataTable_noResults:"Нет результатов.",dataTable_pageOf:"Страница {page} из {total}",dataTable_previous:"Назад",dataTable_next:"Далее",fileUpload_dragDrop:"Перетащите файлы сюда или нажмите для выбора",fileUpload_maxSize:"Макс. размер файла: {size}",tagInput_placeholder:"Добавить тег...",pagination_previous:"Назад",pagination_next:"Далее",pagination_morePages:"Ещё страницы",pagination_goToPrevious:"Предыдущая страница",pagination_goToNext:"Следующая страница",modeToggle_toggleTheme:"Сменить тему",modeToggle_light:"Светлая",modeToggle_dark:"Тёмная",modeToggle_system:"Системная",modeToggle_colorTheme:"Цветовая тема",carousel_previousSlide:"Предыдущий слайд",carousel_nextSlide:"Следующий слайд",breadcrumb_more:"Ещё",audioPlayer_play:"Воспроизвести",audioPlayer_pause:"Пауза",audioPlayer_mute:"Выключить звук",audioPlayer_unmute:"Включить звук",audioPlayer_seek:"Перемотка",audioPlayer_volume:"Громкость",audioPlayer_error:"Не удалось загрузить аудио",audioPlayer_loading:"Загрузка...",audioRecorder_startRecording:"Начать запись",audioRecorder_stopRecording:"Остановить запись",audioRecorder_pauseRecording:"Приостановить запись",audioRecorder_resumeRecording:"Продолжить запись",audioRecorder_reRecord:"Перезаписать",audioRecorder_microphoneAccess:"Требуется доступ к микрофону",audioRecorder_error:"Ошибка записи",audioRecorder_permissionDenied:"Нет доступа к микрофону",audioWaveform_label:"Звуковая волна",audioWaveform_error:"Не удалось загрузить звуковую волну",audioPlaylist_shuffle:"Перемешать",audioPlaylist_repeatOff:"Повтор выключен",audioPlaylist_repeatAll:"Повторять все",audioPlaylist_repeatOne:"Повторять одну",audioPlaylist_previousTrack:"Предыдущий трек",audioPlaylist_nextTrack:"Следующий трек",audioPlaylist_trackOf:"Трек {current} из {total}",audioPlaylist_empty:"Нет треков в плейлисте",videoPlayer_play:"Воспроизвести",videoPlayer_pause:"Пауза",videoPlayer_mute:"Выключить звук",videoPlayer_unmute:"Включить звук",videoPlayer_seek:"Перемотка",videoPlayer_volume:"Громкость",videoPlayer_fullscreen:"Полный экран",videoPlayer_exitFullscreen:"Выйти из полного экрана",videoPlayer_pictureInPicture:"Картинка в картинке",videoPlayer_playbackSpeed:"Скорость воспроизведения",videoPlayer_subtitles:"Субтитры",videoPlayer_subtitlesOff:"Выключены",videoPlayer_label:"Видеоплеер",videoPlayer_loading:"Загрузка...",videoPlayer_error:"Не удалось загрузить видео",videoRecorder_startCamera:"Включить камеру",videoRecorder_shareScreen:"Поделиться экраном",videoRecorder_startRecording:"Начать запись",videoRecorder_stopRecording:"Остановить запись",videoRecorder_pauseRecording:"Приостановить запись",videoRecorder_resumeRecording:"Продолжить запись",videoRecorder_reRecord:"Перезаписать",videoRecorder_cameraPreview:"Предпросмотр камеры",videoRecorder_screenPreview:"Предпросмотр экрана",videoRecorder_error:"Ошибка записи",videoRecorder_permissionDenied:"Нет доступа к камере",videoThumbnail_play:"Воспроизвести видео: {title}",videoGallery_label:"Галерея видео",image_loading:"Загрузка изображения",image_zoomIn:"Увеличить",image_failedToLoad:"Не удалось загрузить изображение",lightbox_label:"Просмотр изображений",lightbox_zoomIn:"Увеличить",lightbox_zoomOut:"Уменьшить",lightbox_imageOf:"{current} из {total}",lightbox_download:"Скачать",imageCropper_label:"Область обрезки",imageCropper_crop:"Обрезать",imageCropper_reset:"Сбросить",imageCropper_cropFailed:"Не удалось создать обрезанное изображение",imageCompare_slider:"Сравнение изображений",imageCompare_before:"До",imageCompare_after:"После"};function $n(e,t){if(!e)return;const r=t.split(".");let o=e;for(const s of r){if(o===void 0||typeof o=="string")return;o=o[s]}return typeof o=="string"?o:void 0}function sr(e,t){if(!t)return e;let r=e;for(const[o,s]of Object.entries(t))r=r.replaceAll(`{${o}}`,String(s));return r}const oc={en:Ot,ru:Oo},Ho=f.createContext(Ot),Go=f.createContext({lang:"en",messages:{}});function qo({locale:e="en",messages:t,children:r}){const o=typeof e=="string"?e:"en",s=f.useMemo(()=>typeof e=="string"?oc[e]??Ot:{...Ot,...e},[e]),a=f.useMemo(()=>({lang:o,messages:t??{}}),[o,t]);return n.jsx(Go.Provider,{value:a,children:n.jsx(Ho.Provider,{value:s,children:r})})}function ce(){return f.useContext(Ho)}function sc(){const{lang:e,messages:t}=f.useContext(Go);return{t:f.useCallback((o,s)=>{const a=$n(t[e],o);if(a!==void 0)return sr(a,s);if(e!=="en"){const i=$n(t.en,o);if(i!==void 0)return sr(i,s)}return sr(o,s)},[e,t]),lang:e}}function ze(e,t){return sr(e,t)}function ac({value:e,onChange:t,placeholder:r,disabled:o,className:s}){const a=ce(),i=r??a.datePicker_placeholder,[l,d]=f.useState(!1);return n.jsxs(Pt,{open:l,onOpenChange:d,children:[n.jsx(It,{asChild:!0,children:n.jsxs(ke,{variant:"outline",disabled:o,className:v("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",s),children:[n.jsx(P.CalendarIcon,{className:"mr-2 h-4 w-4"}),e?_e.format(e,"PPP"):n.jsx("span",{children:i})]})}),n.jsx(yt,{className:"w-auto p-0",align:"start",children:n.jsx(Qr,{selected:e,onSelect:c=>{t==null||t(c),d(!1)}})})]})}function ic({value:e={hours:12,minutes:0},onChange:t,is24Hour:r=!1,disabled:o,className:s}){const[a,i]=f.useState(!1),[l,d]=f.useState(e.hours>=12?"PM":"AM"),c=r?e.hours:e.hours===0?12:e.hours>12?e.hours-12:e.hours,p=()=>{const y=c.toString().padStart(2,"0"),b=e.minutes.toString().padStart(2,"0");return r?`${y}:${b}`:`${y}:${b} ${l}`},u=y=>{let b=y;r||(l==="PM"&&y!==12&&(b+=12),l==="AM"&&y===12&&(b=0)),t==null||t({...e,hours:b})},m=y=>{t==null||t({...e,minutes:y})},g=y=>{d(y);let b=e.hours;y==="PM"&&e.hours<12&&(b+=12),y==="AM"&&e.hours>=12&&(b-=12),t==null||t({...e,hours:b})},h=r?Array.from({length:24},(y,b)=>b):Array.from({length:12},(y,b)=>b+1),x=Array.from({length:12},(y,b)=>b*5);return n.jsxs(Pt,{open:a,onOpenChange:i,children:[n.jsx(It,{asChild:!0,children:n.jsxs(ke,{variant:"outline",disabled:o,className:v("w-full justify-start font-normal",s),children:[n.jsx(P.Clock,{className:"mr-2 h-4 w-4"}),p()]})}),n.jsx(yt,{className:"w-auto p-2",align:"start",children:n.jsxs("div",{className:"flex gap-1",children:[n.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:h.map(y=>n.jsx("button",{onClick:()=>u(y),className:v("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",c===y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:y.toString().padStart(2,"0")},y))}),n.jsx("div",{className:"flex items-center text-muted-foreground font-bold",children:":"}),n.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:x.map(y=>n.jsx("button",{onClick:()=>m(y),className:v("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",e.minutes===y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:y.toString().padStart(2,"0")},y))}),!r&&n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("button",{onClick:()=>g("AM"),className:v("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="AM"&&"bg-primary text-primary-foreground border-primary"),children:"AM"}),n.jsx("button",{onClick:()=>g("PM"),className:v("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="PM"&&"bg-primary text-primary-foreground border-primary"),children:"PM"})]})]})})]})}function lc({value:e=0,onChange:t,min:r=-1/0,max:o=1/0,step:s=1,disabled:a,className:i}){const l=()=>{const p=Math.min(e+s,o);t==null||t(p)},d=()=>{const p=Math.max(e-s,r);t==null||t(p)},c=p=>{const u=parseFloat(p.target.value);if(!isNaN(u)){const m=Math.min(Math.max(u,r),o);t==null||t(m)}};return n.jsxs("div",{className:v("flex items-center gap-2",i),children:[n.jsx(ke,{type:"button",variant:"outline",size:"icon",onClick:d,disabled:a||e<=r,className:"h-9 w-9",children:n.jsx(P.Minus,{className:"h-4 w-4"})}),n.jsx(mt,{type:"number",value:e,onChange:c,disabled:a,className:"w-20 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",min:r,max:o,step:s}),n.jsx(ke,{type:"button",variant:"outline",size:"icon",onClick:l,disabled:a||e>=o,className:"h-9 w-9",children:n.jsx(P.Plus,{className:"h-4 w-4"})})]})}function cc({values:e=[],onChange:t,placeholder:r,disabled:o,className:s,maxTags:a}){const i=ce(),l=r??i.tagInput_placeholder,[d,c]=f.useState(""),p=f.useRef(null),u=g=>{if(g.key==="Enter"&&d.trim()){if(g.preventDefault(),a&&e.length>=a)return;e.includes(d.trim())||t==null||t([...e,d.trim()]),c("")}else g.key==="Backspace"&&!d&&e.length>0&&(t==null||t(e.slice(0,-1)))},m=g=>{t==null||t(e.filter(h=>h!==g))};return n.jsxs("div",{className:v("flex flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",o&&"opacity-50 cursor-not-allowed",s),onClick:()=>{var g;return(g=p.current)==null?void 0:g.focus()},children:[e.map(g=>n.jsxs(Xr,{variant:"secondary",className:"gap-1",children:[g,!o&&n.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),m(g)},className:"ml-1 rounded-full outline-none hover:bg-muted",children:n.jsx(P.X,{className:"h-3 w-3"})})]},g)),n.jsx("input",{ref:p,type:"text",value:d,onChange:g=>c(g.target.value),onKeyDown:u,placeholder:e.length===0?l:"",disabled:o||(a?e.length>=a:!1),className:"flex-1 min-w-[120px] bg-transparent outline-none placeholder:text-muted-foreground text-sm"})]})}function dc({options:e,value:t,onChange:r,placeholder:o,searchPlaceholder:s,emptyText:a,disabled:i,className:l}){const d=ce(),c=o??d.combobox_placeholder,p=s??d.combobox_searchPlaceholder,u=a??d.combobox_empty,[m,g]=f.useState(!1),[h,x]=f.useState(""),y=e.filter(w=>w.label.toLowerCase().includes(h.toLowerCase())),b=e.find(w=>w.value===t);return n.jsxs(Pt,{open:m,onOpenChange:g,children:[n.jsx(It,{asChild:!0,children:n.jsxs(ke,{variant:"outline",role:"combobox","aria-expanded":m,disabled:i,className:v("w-full justify-between font-normal",!t&&"text-muted-foreground",l),children:[b?b.label:c,n.jsx(P.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsxs(yt,{className:"w-full p-0",align:"start",children:[n.jsx("div",{className:"p-2 border-b",children:n.jsx(mt,{placeholder:p,value:h,onChange:w=>x(w.target.value),className:"h-8"})}),n.jsx("div",{className:"max-h-60 overflow-auto p-1",children:y.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):y.map(w=>n.jsxs("button",{onClick:()=>{r==null||r(w.value===t?"":w.value),g(!1),x("")},className:v("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",t===w.value&&"bg-accent"),children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t===w.value&&n.jsx(P.Check,{className:"h-4 w-4"})}),w.label]},w.value))})]})]})}function uc({options:e,value:t=[],onChange:r,placeholder:o,searchPlaceholder:s,emptyText:a,disabled:i,className:l,maxDisplay:d=3}){const c=ce(),p=o??c.multiselect_placeholder,u=s??c.multiselect_searchPlaceholder,m=a??c.multiselect_empty,[g,h]=f.useState(!1),[x,y]=f.useState(""),b=e.filter(_=>_.label.toLowerCase().includes(x.toLowerCase())),w=e.filter(_=>t.includes(_.value)),j=_=>{const C=t.includes(_)?t.filter(S=>S!==_):[...t,_];r==null||r(C)},M=(_,C)=>{C.stopPropagation(),r==null||r(t.filter(S=>S!==_))},R=()=>t.length===0?p:t.length<=d?w.map(_=>_.label).join(", "):ze(c.multiselect_selected,{count:t.length});return n.jsxs(Pt,{open:g,onOpenChange:h,children:[n.jsx(It,{asChild:!0,children:n.jsxs(ke,{variant:"outline",role:"combobox","aria-expanded":g,disabled:i,className:v("w-full justify-between font-normal",t.length===0&&"text-muted-foreground",l),children:[n.jsx("span",{className:"truncate",children:R()}),n.jsx(P.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsxs(yt,{className:"w-full p-0",align:"start",children:[n.jsx("div",{className:"p-2 border-b",children:n.jsx(mt,{placeholder:u,value:x,onChange:_=>y(_.target.value),className:"h-8"})}),t.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1 p-2 border-b",children:w.map(_=>n.jsxs(Xr,{variant:"secondary",className:"pr-1",children:[_.label,n.jsx("button",{onClick:C=>M(_.value,C),className:"ml-1 rounded-full hover:bg-muted",children:n.jsx(P.X,{className:"h-3 w-3"})})]},_.value))}),n.jsx("div",{className:"max-h-60 overflow-auto p-1",children:b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):b.map(_=>{const C=t.includes(_.value);return n.jsxs("button",{onClick:()=>j(_.value),className:v("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",C&&"bg-accent"),children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:C&&n.jsx(P.Check,{className:"h-4 w-4"})}),_.label]},_.value)})})]})]})}function mc({length:e=6,value:t="",onChange:r,onComplete:o,disabled:s,className:a}){const i=f.useRef([]),l=(p,u)=>{var h;if(!/^\d*$/.test(u))return;const m=t.split("");m[p]=u;const g=m.join("").slice(0,e);r==null||r(g),u&&p<e-1&&((h=i.current[p+1])==null||h.focus()),g.length===e&&(o==null||o(g))},d=(p,u)=>{var m;u.key==="Backspace"&&!t[p]&&p>0&&((m=i.current[p-1])==null||m.focus())},c=p=>{var m;p.preventDefault();const u=p.clipboardData.getData("text").replace(/\D/g,"").slice(0,e);r==null||r(u),u.length===e&&(o==null||o(u)),(m=i.current[Math.min(u.length,e-1)])==null||m.focus()};return n.jsx("div",{className:v("flex gap-2",a),children:Array.from({length:e}).map((p,u)=>n.jsx("input",{ref:m=>{i.current[u]=m},type:"text",inputMode:"numeric",maxLength:1,value:t[u]||"",onChange:m=>l(u,m.target.value),onKeyDown:m=>d(u,m),onPaste:c,disabled:s,className:v("h-12 w-12 rounded-lg border border-input bg-background text-center text-lg font-semibold","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed")},u))})}function fc({accept:e,maxSize:t,multiple:r=!1,onUpload:o,disabled:s,className:a}){const[i,l]=f.useState([]),[d,c]=f.useState(!1),p=f.useRef(null),u=ce(),m=w=>{if(!w)return;const j=Array.from(w).filter(R=>!(t&&R.size>t)),M=r?[...i,...j]:j.slice(0,1);l(M),o==null||o(M)},g=w=>{w.preventDefault(),c(!1),s||m(w.dataTransfer.files)},h=w=>{w.preventDefault(),s||c(!0)},x=()=>{c(!1)},y=w=>{const j=i.filter((M,R)=>R!==w);l(j),o==null||o(j)},b=w=>w<1024?w+" B":w<1024*1024?(w/1024).toFixed(1)+" KB":(w/(1024*1024)).toFixed(1)+" MB";return n.jsxs("div",{className:v("space-y-4",a),children:[n.jsxs("div",{onClick:()=>{var w;return!s&&((w=p.current)==null?void 0:w.click())},onDrop:g,onDragOver:h,onDragLeave:x,className:v("border-2 border-dashed rounded-lg p-8 text-center transition-colors cursor-pointer",d?"border-primary bg-primary/5":"border-muted-foreground/25",s&&"opacity-50 cursor-not-allowed","hover:border-primary/50"),children:[n.jsx(P.Upload,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),n.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:u.fileUpload_dragDrop}),t&&n.jsx("p",{className:"text-xs text-muted-foreground",children:ze(u.fileUpload_maxSize,{size:b(t)})}),n.jsx("input",{ref:p,type:"file",accept:e,multiple:r,onChange:w=>m(w.target.files),disabled:s,className:"hidden"})]}),i.length>0&&n.jsx("div",{className:"space-y-2",children:i.map((w,j)=>n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-muted/50",children:[n.jsx(P.FileIcon,{className:"h-8 w-8 text-muted-foreground"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),n.jsx("p",{className:"text-xs text-muted-foreground",children:b(w.size)})]}),n.jsx(ke,{type:"button",variant:"ghost",size:"icon",onClick:()=>y(j),className:"h-8 w-8",children:n.jsx(P.X,{className:"h-4 w-4"})})]},j))})]})}const gc=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#8b5cf6","#ec4899","#000000","#ffffff"];function er(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return{h:0,s:100,l:50};let r=parseInt(t[1],16)/255,o=parseInt(t[2],16)/255,s=parseInt(t[3],16)/255;const a=Math.max(r,o,s),i=Math.min(r,o,s);let l=0,d=0;const c=(a+i)/2;if(a!==i){const p=a-i;switch(d=c>.5?p/(2-a-i):p/(a+i),a){case r:l=((o-s)/p+(o<s?6:0))/6;break;case o:l=((s-r)/p+2)/6;break;case s:l=((r-o)/p+4)/6;break}}return{h:Math.round(l*360),s:Math.round(d*100),l:Math.round(c*100)}}function pc(e,t,r){t/=100,r/=100;const o=t*Math.min(r,1-r),s=a=>{const i=(a+e/30)%12,l=r-o*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*l).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function hc({value:e="#3b82f6",onChange:t,disabled:r,className:o}){const[s,a]=f.useState(!1),[i,l]=f.useState(()=>er(e)),[d,c]=f.useState(e),p=f.useRef(null);f.useEffect(()=>{l(er(e)),c(e)},[e]);const u=h=>{l(h);const x=pc(h.h,h.s,h.l);c(x),t==null||t(x)},m=h=>{if(!p.current)return;const x=p.current.getBoundingClientRect(),y=Math.max(0,Math.min(1,(h.clientX-x.left)/x.width)),b=Math.max(0,Math.min(1,(h.clientY-x.top)/x.height));u({...i,s:Math.round(y*100),l:Math.round((1-b)*100)})},g=h=>{if(c(h),/^#[0-9A-Fa-f]{6}$/.test(h)){const x=er(h);l(x),t==null||t(h)}};return n.jsxs(Pt,{open:s,onOpenChange:a,children:[n.jsx(It,{asChild:!0,children:n.jsxs(ke,{variant:"outline",disabled:r,className:v("w-full justify-start gap-2",o),children:[n.jsx("div",{className:"h-5 w-5 rounded border shadow-sm",style:{backgroundColor:e}}),n.jsx("span",{className:"font-mono text-sm",children:e})]})}),n.jsx(yt,{className:"w-72 p-3",align:"start",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{ref:p,onClick:m,className:"relative h-40 rounded-lg cursor-crosshair overflow-hidden border",style:{background:`
2
2
  linear-gradient(to top, #000 0%, transparent 100%),
3
3
  linear-gradient(to right, #fff 0%, hsl(${i.h}, 100%, 50%) 100%)
4
- `},children:o.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow-md transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",style:{left:`${i.s}%`,top:`${100-i.l}%`,backgroundColor:e}})}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(lr,{className:"text-xs",children:"Hue"}),o.jsx("input",{type:"range",min:0,max:360,value:i.h,onChange:h=>u({...i,h:parseInt(h.target.value)}),className:"w-full h-3 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right,
4
+ `},children:n.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow-md transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",style:{left:`${i.s}%`,top:`${100-i.l}%`,backgroundColor:e}})}),n.jsxs("div",{className:"space-y-1",children:[n.jsx(mr,{className:"text-xs",children:"Hue"}),n.jsx("input",{type:"range",min:0,max:360,value:i.h,onChange:h=>u({...i,h:parseInt(h.target.value)}),className:"w-full h-3 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right,
5
5
  hsl(0, 100%, 50%),
6
6
  hsl(60, 100%, 50%),
7
7
  hsl(120, 100%, 50%),
@@ -9,7 +9,7 @@
9
9
  hsl(240, 100%, 50%),
10
10
  hsl(300, 100%, 50%),
11
11
  hsl(360, 100%, 50%)
12
- )`}})]}),o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx("div",{className:"h-9 w-9 rounded-md border flex-shrink-0 shadow-inner",style:{backgroundColor:e}}),o.jsx(st,{value:c,onChange:h=>m(h.target.value),placeholder:"#000000",className:"font-mono text-sm"})]}),o.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:ac.map(h=>o.jsx("button",{onClick:()=>{t==null||t(h),l(Yt(h)),d(h)},className:b("h-7 w-7 rounded-md border-2 transition-transform hover:scale-110",e===h?"border-primary ring-2 ring-ring":"border-transparent"),style:{backgroundColor:h}},h))})]})})]})}const qo=p.forwardRef(({className:e,as:t="div",...r},n)=>o.jsx(t,{ref:n,className:b(e),...r}));qo.displayName="Box";const Wo=p.forwardRef(({className:e,direction:t,wrap:r,justify:n,align:s,gap:a,style:i,...l},c)=>o.jsx("div",{ref:c,className:b("flex",t&&`flex-${t}`,r&&`flex-${r}`,n&&`justify-${n}`,s&&`items-${s}`,typeof a=="number"&&`gap-${a}`,e),style:{...typeof a=="string"?{gap:a}:{},...i},...l}));Wo.displayName="Flex";const Uo=p.forwardRef(({className:e,spacing:t=4,align:r,style:n,...s},a)=>o.jsx("div",{ref:a,className:b("flex flex-col",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...n},...s}));Uo.displayName="VStack";const Ko=p.forwardRef(({className:e,spacing:t=4,align:r="center",style:n,...s},a)=>o.jsx("div",{ref:a,className:b("flex flex-row",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...n},...s}));Ko.displayName="HStack";const Xo=p.forwardRef(({className:e,cols:t=1,gap:r=4,style:n,...s},a)=>{const i=typeof t=="number"?`grid-cols-${t}`:[t.sm&&`sm:grid-cols-${t.sm}`,t.md&&`md:grid-cols-${t.md}`,t.lg&&`lg:grid-cols-${t.lg}`,t.xl&&`xl:grid-cols-${t.xl}`].filter(Boolean).join(" ");return o.jsx("div",{ref:a,className:b("grid",i,typeof r=="number"&&`gap-${r}`,e),style:{...typeof r=="string"?{gap:r}:{},...n},...s})});Xo.displayName="Grid";const cc={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},Yo=p.forwardRef(({className:e,maxWidth:t="lg",centered:r=!0,...n},s)=>o.jsx("div",{ref:s,className:b("w-full px-4",cc[t],r&&"mx-auto",e),...n}));Yo.displayName="Container";const dc=nl.Root,uc=qr.Root,mc=qr.CollapsibleTrigger,Zo=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx(qr.CollapsibleContent,{ref:n,className:b("overflow-hidden transition-all duration-300 ease-in-out","data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",e),...r,children:o.jsx("div",{className:"pb-2",children:t})}));Zo.displayName="CollapsibleContent";const Jo=ze("rounded-xl text-card-foreground transition-all duration-300",{variants:{variant:{default:"border bg-card shadow-sm",elevated:"border border-white/10 bg-gradient-to-br from-card/80 to-card/40 backdrop-blur-xl shadow-2xl shadow-black/20",glass:"border border-white/10 bg-white/5 backdrop-blur-xl shadow-xl",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Jr=p.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,className:b(Jo({variant:t}),e),...r}));Jr.displayName="Card";const Qr=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex flex-col space-y-1.5 p-6",e),...t}));Qr.displayName="CardHeader";const en=p.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:b("text-2xl font-semibold leading-none tracking-tight",e),...t}));en.displayName="CardTitle";const Qo=p.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:b("text-sm text-muted-foreground",e),...t}));Qo.displayName="CardDescription";const tn=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("p-6 pt-0",e),...t}));tn.displayName="CardContent";const es=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex items-center p-6 pt-0",e),...t}));es.displayName="CardFooter";const rn=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:b("w-full caption-bottom text-sm",e),...t})}));rn.displayName="Table";const nn=p.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:b("[&_tr]:border-b",e),...t}));nn.displayName="TableHeader";const on=p.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:b("[&_tr:last-child]:border-0",e),...t}));on.displayName="TableBody";const ts=p.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ts.displayName="TableFooter";const Pt=p.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:b("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Pt.displayName="TableRow";const sn=p.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:b("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));sn.displayName="TableHead";const nr=p.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:b("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));nr.displayName="TableCell";const rs=p.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:b("mt-4 text-sm text-muted-foreground",e),...t}));rs.displayName="TableCaption";const cr=p.forwardRef(({className:e,children:t,orientation:r="vertical",...n},s)=>o.jsxs(ct.Root,{ref:s,className:b("relative overflow-hidden",e),...n,children:[o.jsx(ct.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(r==="vertical"||r==="both")&&o.jsx(or,{orientation:"vertical"}),(r==="horizontal"||r==="both")&&o.jsx(or,{orientation:"horizontal"}),o.jsx(ct.Corner,{})]}));cr.displayName=ct.Root.displayName;const or=p.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(ct.ScrollAreaScrollbar,{ref:n,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:o.jsx(ct.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));or.displayName=ct.ScrollAreaScrollbar.displayName;const fc=mt.Root,ns=p.forwardRef(({className:e,...t},r)=>o.jsx(mt.List,{ref:r,className:b("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ns.displayName=mt.List.displayName;const os=p.forwardRef(({className:e,...t},r)=>o.jsx(mt.Trigger,{ref:r,className:b("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));os.displayName=mt.Trigger.displayName;const ss=p.forwardRef(({className:e,...t},r)=>o.jsx(mt.Content,{ref:r,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ss.displayName=mt.Content.displayName;const gc=dt.Root,as=p.forwardRef(({className:e,...t},r)=>o.jsx(dt.Item,{ref:r,className:b("border-b",e),...t}));as.displayName="AccordionItem";const is=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx(dt.Header,{className:"flex",children:o.jsxs(dt.Trigger,{ref:n,className:b("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,o.jsx(I.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));is.displayName=dt.Trigger.displayName;const ls=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx(dt.Content,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:o.jsx("div",{className:b("pb-4 pt-0",e),children:t})}));ls.displayName=dt.Content.displayName;const cs=ue.Root,pc=ue.Trigger,ds=ue.Portal,hc=ue.Close,an=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Overlay,{ref:r,className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));an.displayName=ue.Overlay.displayName;const ln=p.forwardRef(({className:e,children:t,...r},n)=>{const s=te();return o.jsxs(ds,{children:[o.jsx(an,{}),o.jsxs(ue.Content,{ref:n,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(I.X,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:s.common_close})]})]})]})});ln.displayName=ue.Content.displayName;const us=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});us.displayName="DialogHeader";const ms=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ms.displayName="DialogFooter";const fs=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Title,{ref:r,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));fs.displayName=ue.Title.displayName;const gs=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));gs.displayName=ue.Description.displayName;const ps=ue.Root,hs=ue.Trigger,xs=ue.Close,bs=ue.Portal,cn=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Overlay,{className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));cn.displayName=ue.Overlay.displayName;const xc=ze("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),dn=p.forwardRef(({side:e="right",className:t,children:r,...n},s)=>{const a=te();return o.jsxs(bs,{children:[o.jsx(cn,{}),o.jsxs(ue.Content,{ref:s,className:b(xc({side:e}),t),...n,children:[r,o.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(I.X,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:a.common_close})]})]})]})});dn.displayName=ue.Content.displayName;const un=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});un.displayName="SheetHeader";const mn=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mn.displayName="SheetFooter";const fn=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Title,{ref:r,className:b("text-lg font-semibold text-foreground",e),...t}));fn.displayName=ue.Title.displayName;const gn=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));gn.displayName=ue.Description.displayName;const vs=me.Root,ws=me.Trigger,bc=me.Group,vc=me.Portal,wc=me.Sub,yc=me.RadioGroup,ys=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(me.SubTrigger,{ref:s,className:b("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,o.jsx(I.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ys.displayName=me.SubTrigger.displayName;const js=p.forwardRef(({className:e,...t},r)=>o.jsx(me.SubContent,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));js.displayName=me.SubContent.displayName;const pn=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(me.Portal,{children:o.jsx(me.Content,{ref:n,sideOffset:t,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));pn.displayName=me.Content.displayName;const It=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(me.Item,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));It.displayName=me.Item.displayName;const Ns=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(me.CheckboxItem,{ref:s,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(me.ItemIndicator,{children:o.jsx(I.Check,{className:"h-4 w-4"})})}),t]}));Ns.displayName=me.CheckboxItem.displayName;const Cs=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(me.RadioItem,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(me.ItemIndicator,{children:o.jsx(I.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Cs.displayName=me.RadioItem.displayName;const ks=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(me.Label,{ref:n,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ks.displayName=me.Label.displayName;const Ss=p.forwardRef(({className:e,...t},r)=>o.jsx(me.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Ss.displayName=me.Separator.displayName;const Rs=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Rs.displayName="DropdownMenuShortcut";const jc=$t.Provider,Nc=$t.Root,Cc=$t.Trigger,_s=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx($t.Content,{ref:n,sideOffset:t,className:b("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));_s.displayName=$t.Content.displayName;const hn=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command,{ref:r,className:b("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));hn.displayName=Ee.Command.displayName;const kc=({children:e,...t})=>o.jsx(cs,{...t,children:o.jsx(ln,{className:"overflow-hidden p-0 shadow-lg",children:o.jsx(hn,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Ms=p.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(I.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ee.Command.Input,{ref:r,className:b("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ms.displayName=Ee.Command.Input.displayName;const Ps=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.List,{ref:r,className:b("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ps.displayName=Ee.Command.List.displayName;const Is=p.forwardRef((e,t)=>o.jsx(Ee.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Is.displayName=Ee.Command.Empty.displayName;const Ts=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Group,{ref:r,className:b("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ts.displayName=Ee.Command.Group.displayName;const Ls=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Separator,{ref:r,className:b("-mx-1 h-px bg-border",e),...t}));Ls.displayName=Ee.Command.Separator.displayName;const Ds=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Item,{ref:r,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected='true']:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));Ds.displayName=Ee.Command.Item.displayName;const Es=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Es.displayName="CommandShortcut";const Sc=ze("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),As=p.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:b(Sc({variant:t}),e),...r}));As.displayName="Alert";const Fs=p.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:b("mb-1 font-medium leading-none tracking-tight",e),...t}));Fs.displayName="AlertTitle";const Vs=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("text-sm [&_p]:leading-relaxed",e),...t}));Vs.displayName="AlertDescription";const Rc=Te.Root,_c=Te.Trigger,zs=Te.Portal,xn=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Overlay,{className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));xn.displayName=Te.Overlay.displayName;const $s=p.forwardRef(({className:e,...t},r)=>o.jsxs(zs,{children:[o.jsx(xn,{}),o.jsx(Te.Content,{ref:r,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));$s.displayName=Te.Content.displayName;const Bs=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Bs.displayName="AlertDialogHeader";const Os=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Os.displayName="AlertDialogFooter";const Hs=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Title,{ref:r,className:b("text-lg font-semibold",e),...t}));Hs.displayName=Te.Title.displayName;const Gs=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));Gs.displayName=Te.Description.displayName;const qs=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Action,{ref:r,className:b(Bt(),e),...t}));qs.displayName=Te.Action.displayName;const Ws=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Cancel,{ref:r,className:b(Bt({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ws.displayName=Te.Cancel.displayName;const Us=p.forwardRef(({className:e,value:t,...r},n)=>o.jsx(Lr.Root,{ref:n,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:o.jsx(Lr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Us.displayName=Lr.Root.displayName;function Mc({className:e,...t}){return o.jsx("div",{className:b("animate-pulse rounded-md bg-muted",e),...t})}function Pc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Ic=e=>{switch(e){case"success":return Dc;case"info":return Ac;case"warning":return Ec;case"error":return Fc;default:return null}},Tc=Array(12).fill(0),Lc=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},Tc.map((r,n)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Dc=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ec=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ac=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Fc=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Vc=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zc=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Er=1;class $c{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Er++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=s.then(async d=>{if(i=["resolve",d],E.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Oc(d)&&!d.ok){a=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,f=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,h=typeof u=="object"&&!E.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:f,...h})}else if(d instanceof Error){a=!1;const u=typeof r.error=="function"?await r.error(d):r.error,f=typeof r.description=="function"?await r.description(d):r.description,h=typeof u=="object"&&!E.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:f,...h})}else if(r.success!==void 0){a=!1;const u=typeof r.success=="function"?await r.success(d):r.success,f=typeof r.description=="function"?await r.description(d):r.description,h=typeof u=="object"&&!E.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:f,...h})}}).catch(async d=>{if(i=["reject",d],r.error!==void 0){a=!1;const g=typeof r.error=="function"?await r.error(d):r.error,u=typeof r.description=="function"?await r.description(d):r.description,m=typeof g=="object"&&!E.isValidElement(g)?g:{message:g};this.create({id:n,type:"error",description:u,...m})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((d,g)=>l.then(()=>i[0]==="reject"?g(i[1]):d(i[1])).catch(g));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Er++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Le=new $c,Bc=(e,t)=>{const r=(t==null?void 0:t.id)||Er++;return Le.addToast({title:e,...t,id:r}),r},Oc=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hc=Bc,Gc=()=>Le.toasts,qc=()=>Le.getActiveToasts(),Wc=Object.assign(Hc,{success:Le.success,info:Le.info,warning:Le.warning,error:Le.error,custom:Le.custom,message:Le.message,promise:Le.promise,dismiss:Le.dismiss,loading:Le.loading},{getHistory:Gc,getToasts:qc});Pc("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Zt(e){return e.label!==void 0}const Uc=3,Kc="24px",Xc="16px",$n=4e3,Yc=356,Zc=14,Jc=45,Qc=200;function Je(...e){return e.filter(Boolean).join(" ")}function ed(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const td=e=>{var t,r,n,s,a,i,l,c,d;const{invert:g,toast:u,unstyled:f,interacting:m,setHeights:h,visibleToasts:x,heights:y,index:w,toasts:v,expanded:j,removeToast:R,defaultRichColors:M,closeButton:C,style:k,cancelButtonStyle:N,actionButtonStyle:S,className:_="",descriptionClassName:D="",duration:F,position:B,gap:P,expandByDefault:q,classNames:V,icons:A,closeButtonAriaLabel:T="Close toast"}=e,[oe,K]=E.useState(null),[Y,ee]=E.useState(null),[z,L]=E.useState(!1),[H,Z]=E.useState(!1),[O,X]=E.useState(!1),[ce,ae]=E.useState(!1),[ie,G]=E.useState(!1),[le,de]=E.useState(0),[we,Pe]=E.useState(0),ye=E.useRef(u.duration||F||$n),$e=E.useRef(null),xe=E.useRef(null),Oe=w===0,Qe=w+1<=x,je=u.type,Fe=u.dismissible!==!1,gt=u.className||"",$=u.descriptionClassName||"",re=E.useMemo(()=>y.findIndex(ne=>ne.toastId===u.id)||0,[y,u.id]),Ne=E.useMemo(()=>{var ne;return(ne=u.closeButton)!=null?ne:C},[u.closeButton,C]),Xe=E.useMemo(()=>u.duration||F||$n,[u.duration,F]),Ye=E.useRef(0),_e=E.useRef(0),pt=E.useRef(0),Ze=E.useRef(null),[ht,xr]=B.split("-"),Ht=E.useMemo(()=>y.reduce((ne,be,Ce)=>Ce>=re?ne:ne+be.height,0),[y,re]),Gt=zc(),br=u.invert||g,Nt=je==="loading";_e.current=E.useMemo(()=>re*P+Ht,[re,Ht]),E.useEffect(()=>{ye.current=Xe},[Xe]),E.useEffect(()=>{L(!0)},[]),E.useEffect(()=>{const ne=xe.current;if(ne){const be=ne.getBoundingClientRect().height;return Pe(be),h(Ce=>[{toastId:u.id,height:be,position:u.position},...Ce]),()=>h(Ce=>Ce.filter(Ie=>Ie.toastId!==u.id))}},[h,u.id]),E.useLayoutEffect(()=>{if(!z)return;const ne=xe.current,be=ne.style.height;ne.style.height="auto";const Ce=ne.getBoundingClientRect().height;ne.style.height=be,Pe(Ce),h(Ie=>Ie.find(Re=>Re.toastId===u.id)?Ie.map(Re=>Re.toastId===u.id?{...Re,height:Ce}:Re):[{toastId:u.id,height:Ce,position:u.position},...Ie])},[z,u.title,u.description,h,u.id,u.jsx,u.action,u.cancel]);const He=E.useCallback(()=>{Z(!0),de(_e.current),h(ne=>ne.filter(be=>be.toastId!==u.id)),setTimeout(()=>{R(u)},Qc)},[u,R,h,_e]);E.useEffect(()=>{if(u.promise&&je==="loading"||u.duration===1/0||u.type==="loading")return;let ne;return j||m||Gt?(()=>{if(pt.current<Ye.current){const Ie=new Date().getTime()-Ye.current;ye.current=ye.current-Ie}pt.current=new Date().getTime()})():(()=>{ye.current!==1/0&&(Ye.current=new Date().getTime(),ne=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),He()},ye.current))})(),()=>clearTimeout(ne)},[j,m,u,je,Gt,He]),E.useEffect(()=>{u.delete&&(He(),u.onDismiss==null||u.onDismiss.call(u,u))},[He,u.delete]);function vr(){var ne;if(A!=null&&A.loading){var be;return E.createElement("div",{className:Je(V==null?void 0:V.loader,u==null||(be=u.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":je==="loading"},A.loading)}return E.createElement(Lc,{className:Je(V==null?void 0:V.loader,u==null||(ne=u.classNames)==null?void 0:ne.loader),visible:je==="loading"})}const qt=u.icon||(A==null?void 0:A[je])||Ic(je);var Ct,kt;return E.createElement("li",{tabIndex:0,ref:xe,className:Je(_,gt,V==null?void 0:V.toast,u==null||(t=u.classNames)==null?void 0:t.toast,V==null?void 0:V.default,V==null?void 0:V[je],u==null||(r=u.classNames)==null?void 0:r[je]),"data-sonner-toast":"","data-rich-colors":(Ct=u.richColors)!=null?Ct:M,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":z,"data-promise":!!u.promise,"data-swiped":ie,"data-removed":H,"data-visible":Qe,"data-y-position":ht,"data-x-position":xr,"data-index":w,"data-front":Oe,"data-swiping":O,"data-dismissible":Fe,"data-type":je,"data-invert":br,"data-swipe-out":ce,"data-swipe-direction":Y,"data-expanded":!!(j||q&&z),"data-testid":u.testId,style:{"--index":w,"--toasts-before":w,"--z-index":v.length-w,"--offset":`${H?le:_e.current}px`,"--initial-height":q?"auto":`${we}px`,...k,...u.style},onDragEnd:()=>{X(!1),K(null),Ze.current=null},onPointerDown:ne=>{ne.button!==2&&(Nt||!Fe||($e.current=new Date,de(_e.current),ne.target.setPointerCapture(ne.pointerId),ne.target.tagName!=="BUTTON"&&(X(!0),Ze.current={x:ne.clientX,y:ne.clientY})))},onPointerUp:()=>{var ne,be,Ce;if(ce||!Fe)return;Ze.current=null;const Ie=Number(((ne=xe.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wt=Number(((be=xe.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Re=new Date().getTime()-((Ce=$e.current)==null?void 0:Ce.getTime()),Be=oe==="x"?Ie:Wt,Ut=Math.abs(Be)/Re;if(Math.abs(Be)>=Jc||Ut>.11){de(_e.current),u.onDismiss==null||u.onDismiss.call(u,u),ee(oe==="x"?Ie>0?"right":"left":Wt>0?"down":"up"),He(),ae(!0);return}else{var Ge,qe;(Ge=xe.current)==null||Ge.style.setProperty("--swipe-amount-x","0px"),(qe=xe.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}G(!1),X(!1),K(null)},onPointerMove:ne=>{var be,Ce,Ie;if(!Ze.current||!Fe||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;const Re=ne.clientY-Ze.current.y,Be=ne.clientX-Ze.current.x;var Ut;const Ge=(Ut=e.swipeDirections)!=null?Ut:ed(B);!oe&&(Math.abs(Be)>1||Math.abs(Re)>1)&&K(Math.abs(Be)>Math.abs(Re)?"x":"y");let qe={x:0,y:0};const In=at=>1/(1.5+Math.abs(at)/20);if(oe==="y"){if(Ge.includes("top")||Ge.includes("bottom"))if(Ge.includes("top")&&Re<0||Ge.includes("bottom")&&Re>0)qe.y=Re;else{const at=Re*In(Re);qe.y=Math.abs(at)<Math.abs(Re)?at:Re}}else if(oe==="x"&&(Ge.includes("left")||Ge.includes("right")))if(Ge.includes("left")&&Be<0||Ge.includes("right")&&Be>0)qe.x=Be;else{const at=Be*In(Be);qe.x=Math.abs(at)<Math.abs(Be)?at:Be}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&G(!0),(Ce=xe.current)==null||Ce.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Ie=xe.current)==null||Ie.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Ne&&!u.jsx&&je!=="loading"?E.createElement("button",{"aria-label":T,"data-disabled":Nt,"data-close-button":!0,onClick:Nt||!Fe?()=>{}:()=>{He(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Je(V==null?void 0:V.closeButton,u==null||(n=u.classNames)==null?void 0:n.closeButton)},(kt=A==null?void 0:A.close)!=null?kt:Vc):null,(je||u.icon||u.promise)&&u.icon!==null&&((A==null?void 0:A[je])!==null||u.icon)?E.createElement("div",{"data-icon":"",className:Je(V==null?void 0:V.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||vr():null,u.type!=="loading"?qt:null):null,E.createElement("div",{"data-content":"",className:Je(V==null?void 0:V.content,u==null||(a=u.classNames)==null?void 0:a.content)},E.createElement("div",{"data-title":"",className:Je(V==null?void 0:V.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?E.createElement("div",{"data-description":"",className:Je(D,$,V==null?void 0:V.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),E.isValidElement(u.cancel)?u.cancel:u.cancel&&Zt(u.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||N,onClick:ne=>{Zt(u.cancel)&&Fe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,ne),He())},className:Je(V==null?void 0:V.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,E.isValidElement(u.action)?u.action:u.action&&Zt(u.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||S,onClick:ne=>{Zt(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,ne),!ne.defaultPrevented&&He())},className:Je(V==null?void 0:V.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function Bn(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function rd(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?Xc:Kc;function c(d){["top","right","bottom","left"].forEach(g=>{r[`${i}-${g}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${i}-${d}`]=l:r[`${i}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}const nd=E.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:g,mobileOffset:u,theme:f="light",richColors:m,duration:h,style:x,visibleToasts:y=Uc,toastOptions:w,dir:v=Bn(),gap:j=Zc,icons:R,containerAriaLabel:M="Notifications"}=t,[C,k]=E.useState([]),N=E.useMemo(()=>n?C.filter(z=>z.toasterId===n):C.filter(z=>!z.toasterId),[C,n]),S=E.useMemo(()=>Array.from(new Set([a].concat(N.filter(z=>z.position).map(z=>z.position)))),[N,a]),[_,D]=E.useState([]),[F,B]=E.useState(!1),[P,q]=E.useState(!1),[V,A]=E.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),T=E.useRef(null),oe=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=E.useRef(null),Y=E.useRef(!1),ee=E.useCallback(z=>{k(L=>{var H;return(H=L.find(Z=>Z.id===z.id))!=null&&H.delete||Le.dismiss(z.id),L.filter(({id:Z})=>Z!==z.id)})},[]);return E.useEffect(()=>Le.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{k(L=>L.map(H=>H.id===z.id?{...H,delete:!0}:H))});return}setTimeout(()=>{Hr.flushSync(()=>{k(L=>{const H=L.findIndex(Z=>Z.id===z.id);return H!==-1?[...L.slice(0,H),{...L[H],...z},...L.slice(H+1)]:[z,...L]})})})}),[C]),E.useEffect(()=>{if(f!=="system"){A(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:L})=>{A(L?"dark":"light")})}catch{z.addListener(({matches:H})=>{try{A(H?"dark":"light")}catch(Z){console.error(Z)}})}},[f]),E.useEffect(()=>{C.length<=1&&B(!1)},[C]),E.useEffect(()=>{const z=L=>{var H;if(i.every(X=>L[X]||L.code===X)){var O;B(!0),(O=T.current)==null||O.focus()}L.code==="Escape"&&(document.activeElement===T.current||(H=T.current)!=null&&H.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),E.useEffect(()=>{if(T.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,Y.current=!1)}},[T.current]),E.createElement("section",{ref:r,"aria-label":`${M} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((z,L)=>{var H;const[Z,O]=z.split("-");return N.length?E.createElement("ol",{key:z,dir:v==="auto"?Bn():v,tabIndex:-1,ref:T,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":Z,"data-x-position":O,style:{"--front-toast-height":`${((H=_[0])==null?void 0:H.height)||0}px`,"--width":`${Yc}px`,"--gap":`${j}px`,...x,...rd(g,u)},onBlur:X=>{Y.current&&!X.currentTarget.contains(X.relatedTarget)&&(Y.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,K.current=X.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{P||B(!1)},onDragEnd:()=>B(!1),onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},N.filter(X=>!X.position&&L===0||X.position===z).map((X,ce)=>{var ae,ie;return E.createElement(td,{key:X.id,icons:R,index:ce,toast:X,defaultRichColors:m,duration:(ae=w==null?void 0:w.duration)!=null?ae:h,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:s,visibleToasts:y,closeButton:(ie=w==null?void 0:w.closeButton)!=null?ie:c,interacting:P,position:z,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,closeButtonAriaLabel:w==null?void 0:w.closeButtonAriaLabel,removeToast:ee,toasts:N.filter(G=>G.position==X.position),heights:_.filter(G=>G.position==X.position),setHeights:D,expandByDefault:l,gap:j,expanded:F,swipeDirections:t.swipeDirections})})):null}))}),jr=["light","dark","system"];function od(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function On(e){return e==="system"?od():e}function sd(e){if(typeof document>"u")return()=>{};const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*, *::before, *::after { transition: none !important; animation: none !important; }")),document.head.appendChild(t),window.getComputedStyle(document.body),()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{document.head.removeChild(t)})})}}function ad(e,t){const r=document.documentElement;t==="class"?(r.classList.remove("light","dark"),r.classList.add(e)):r.setAttribute("data-theme",e)}const Ks=E.createContext(void 0);function id({children:e,defaultTheme:t="system",storageKey:r="nui-theme",attribute:n="class",enableSystem:s=!0,disableTransitionOnChange:a=!1,forcedTheme:i,nonce:l}){const[c,d]=E.useState(()=>{if(typeof window>"u")return t;const w=localStorage.getItem(r);return w&&jr.includes(w)?w:t}),[g,u]=E.useState(()=>On(i??c)),f=E.useRef(c);f.current=c;const m=E.useCallback(()=>{const w=i??f.current,v=On(w);u(v);let j;a&&(j=sd(l)),ad(v,n),j==null||j()},[i,n,a,l]);E.useEffect(()=>{m()},[c,i,m]),E.useEffect(()=>{if(!s)return;const w=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{(i??f.current)==="system"&&m()};return w.addEventListener("change",v),()=>w.removeEventListener("change",v)},[s,i,m]),E.useEffect(()=>{const w=v=>{if(v.key===r&&v.newValue){const j=v.newValue;jr.includes(j)&&d(j)}};return window.addEventListener("storage",w),()=>window.removeEventListener("storage",w)},[r]);const h=E.useCallback(w=>{!s&&w==="system"||(localStorage.setItem(r,w),d(w))},[r,s]),x=E.useMemo(()=>s?jr:["light","dark"],[s]),y=E.useMemo(()=>({theme:i??c,resolvedTheme:g,setTheme:h,themes:x}),[i,c,g,h,x]);return o.jsx(Ks.Provider,{value:y,children:e})}function dr(){const e=E.useContext(Ks);if(e===void 0)throw new Error("useTheme must be used within a <ThemeProvider>");return e}const ld=({theme:e,...t})=>{let r=e;try{const{resolvedTheme:n}=dr();e||(r=n)}catch{r||(r="system")}return o.jsx(nd,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};function cd({icon:e,title:t,description:r,action:n,className:s}){return o.jsxs("div",{className:b("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[e&&o.jsx("div",{className:"mb-4 text-muted-foreground",children:e}),o.jsx("h3",{className:"text-lg font-semibold",children:t}),r&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground max-w-sm",children:r}),n&&o.jsx("div",{className:"mt-4",children:n})]})}const Xs=p.forwardRef(({...e},t)=>o.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Xs.displayName="Breadcrumb";const Ys=p.forwardRef(({className:e,...t},r)=>o.jsx("ol",{ref:r,className:b("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Ys.displayName="BreadcrumbList";const Zs=p.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,className:b("inline-flex items-center gap-1.5",e),...t}));Zs.displayName="BreadcrumbItem";const Js=p.forwardRef(({asChild:e,className:t,...r},n)=>{const s=e?to.Slot:"a";return o.jsx(s,{ref:n,className:b("transition-colors hover:text-foreground",t),...r})});Js.displayName="BreadcrumbLink";const Qs=p.forwardRef(({className:e,...t},r)=>o.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:b("font-normal text-foreground",e),...t}));Qs.displayName="BreadcrumbPage";const ea=({children:e,className:t,...r})=>o.jsx("li",{role:"presentation","aria-hidden":"true",className:b("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...r,children:e??o.jsx(I.ChevronRight,{})});ea.displayName="BreadcrumbSeparator";const ta=({className:e,...t})=>{const r=te();return o.jsxs("span",{role:"presentation","aria-hidden":"true",className:b("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx("span",{className:"h-4 w-4",children:"..."}),o.jsx("span",{className:"sr-only",children:r.breadcrumb_more})]})};ta.displayName="BreadcrumbEllipsis";const ra=({className:e,...t})=>o.jsx("nav",{role:"navigation","aria-label":"pagination",className:b("mx-auto flex w-full justify-center",e),...t});ra.displayName="Pagination";const na=p.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,className:b("flex flex-row items-center gap-1",e),...t}));na.displayName="PaginationContent";const oa=p.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,className:b("",e),...t}));oa.displayName="PaginationItem";const ur=({className:e,isActive:t,size:r="icon",...n})=>o.jsx("a",{"aria-current":t?"page":void 0,className:b(Bt({variant:t?"outline":"ghost",size:r}),e),...n});ur.displayName="PaginationLink";const sa=({className:e,...t})=>{const r=te();return o.jsxs(ur,{"aria-label":r.pagination_goToPrevious,size:"default",className:b("gap-1 pl-2.5",e),...t,children:[o.jsx(I.ChevronLeft,{className:"h-4 w-4"}),o.jsx("span",{children:r.pagination_previous})]})};sa.displayName="PaginationPrevious";const aa=({className:e,...t})=>{const r=te();return o.jsxs(ur,{"aria-label":r.pagination_goToNext,size:"default",className:b("gap-1 pr-2.5",e),...t,children:[o.jsx("span",{children:r.pagination_next}),o.jsx(I.ChevronRight,{className:"h-4 w-4"})]})};aa.displayName="PaginationNext";const ia=({className:e,...t})=>{const r=te();return o.jsxs("span",{"aria-hidden":!0,className:b("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx(I.MoreHorizontal,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:r.pagination_morePages})]})};ia.displayName="PaginationEllipsis";function dd({steps:e,activeStep:t,orientation:r="horizontal",className:n}){return o.jsx("div",{className:b("flex",r==="vertical"?"flex-col":"flex-row items-center",n),children:e.map((s,a)=>{const i=a<t,l=a===t,c=a===e.length-1;return o.jsxs(p.Fragment,{children:[o.jsxs("div",{className:b("flex items-center",r==="vertical"&&"flex-row"),children:[o.jsx("div",{className:b("flex h-10 w-10 items-center justify-center rounded-full border-2 font-semibold transition-colors",i&&"border-primary bg-primary text-primary-foreground",l&&"border-primary text-primary",!i&&!l&&"border-muted-foreground/30 text-muted-foreground"),children:i?o.jsx(I.Check,{className:"h-5 w-5"}):a+1}),o.jsxs("div",{className:b("ml-3",r==="horizontal"&&"hidden sm:block"),children:[o.jsx("p",{className:b("text-sm font-medium",l&&"text-foreground",!l&&"text-muted-foreground"),children:s.title}),s.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]})]}),!c&&o.jsx("div",{className:b("flex-1",r==="horizontal"?"mx-4 h-0.5 min-w-[3rem]":"ml-5 my-2 w-0.5 min-h-[2rem]",i?"bg-primary":"bg-muted-foreground/30")})]},a)})})}const la=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Ae.Root,{ref:n,className:b("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,o.jsx(bn,{})]}));la.displayName=Ae.Root.displayName;const ca=p.forwardRef(({className:e,...t},r)=>o.jsx(Ae.List,{ref:r,className:b("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));ca.displayName=Ae.List.displayName;const ud=Ae.Item,da=ze("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),ua=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Ae.Trigger,{ref:n,className:b(da(),"group",e),...r,children:[t," ",o.jsx(I.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));ua.displayName=Ae.Trigger.displayName;const ma=p.forwardRef(({className:e,...t},r)=>o.jsx(Ae.Content,{ref:r,className:b("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));ma.displayName=Ae.Content.displayName;const md=Ae.Link,bn=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:b("absolute left-0 top-full flex justify-center"),children:o.jsx(Ae.Viewport,{className:b("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));bn.displayName=Ae.Viewport.displayName;const fa=p.forwardRef(({className:e,...t},r)=>o.jsx(Ae.Indicator,{ref:r,className:b("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:o.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));fa.displayName=Ae.Indicator.displayName;const fd=fe.Root,gd=fe.Trigger,pd=fe.Group,hd=fe.Portal,xd=fe.Sub,bd=fe.RadioGroup,ga=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(fe.SubTrigger,{ref:s,className:b("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,o.jsx(I.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ga.displayName=fe.SubTrigger.displayName;const pa=p.forwardRef(({className:e,...t},r)=>o.jsx(fe.SubContent,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));pa.displayName=fe.SubContent.displayName;const ha=p.forwardRef(({className:e,...t},r)=>o.jsx(fe.Portal,{children:o.jsx(fe.Content,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));ha.displayName=fe.Content.displayName;const xa=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(fe.Item,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));xa.displayName=fe.Item.displayName;const ba=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(fe.CheckboxItem,{ref:s,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fe.ItemIndicator,{children:o.jsx(I.Check,{className:"h-4 w-4"})})}),t]}));ba.displayName=fe.CheckboxItem.displayName;const va=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(fe.RadioItem,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fe.ItemIndicator,{children:o.jsx(I.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));va.displayName=fe.RadioItem.displayName;const wa=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(fe.Label,{ref:n,className:b("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));wa.displayName=fe.Label.displayName;const ya=p.forwardRef(({className:e,...t},r)=>o.jsx(fe.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-border",e),...t}));ya.displayName=fe.Separator.displayName;const ja=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ja.displayName="ContextMenuShortcut";const vd=ir.Root,wd=ir.Trigger,Na=p.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(ir.Content,{ref:s,align:t,sideOffset:r,className:b("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Na.displayName=ir.Content.displayName;function yd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hn(e){return yd(e)||Array.isArray(e)}function jd(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function vn(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),a=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==a?!1:r.every(i=>{const l=e[i],c=t[i];return typeof l=="function"?`${l}`==`${c}`:!Hn(l)||!Hn(c)?l===c:vn(l,c)})}function Gn(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function Nd(e,t){if(e.length!==t.length)return!1;const r=Gn(e),n=Gn(t);return r.every((s,a)=>{const i=n[a];return vn(s,i)})}function wn(e){return typeof e=="number"}function Ar(e){return typeof e=="string"}function mr(e){return typeof e=="boolean"}function qn(e){return Object.prototype.toString.call(e)==="[object Object]"}function pe(e){return Math.abs(e)}function yn(e){return Math.sign(e)}function Tt(e,t){return pe(e-t)}function Cd(e,t){if(e===0||t===0||pe(e)<=pe(t))return 0;const r=Tt(pe(e),pe(t));return pe(r/e)}function kd(e){return Math.round(e*100)/100}function Ft(e){return Vt(e).map(Number)}function Ue(e){return e[Ot(e)]}function Ot(e){return Math.max(0,e.length-1)}function jn(e,t){return t===Ot(e)}function Wn(e,t=0){return Array.from(Array(e),(r,n)=>t+n)}function Vt(e){return Object.keys(e)}function Ca(e,t){return[e,t].reduce((r,n)=>(Vt(n).forEach(s=>{const a=r[s],i=n[s],l=qn(a)&&qn(i);r[s]=l?Ca(a,i):i}),r),{})}function Fr(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function Sd(e,t){const r={start:n,center:s,end:a};function n(){return 0}function s(c){return a(c)/2}function a(c){return t-c}function i(c,d){return Ar(e)?r[e](c):e(t,c,d)}return{measure:i}}function zt(){let e=[];function t(s,a,i,l={passive:!0}){let c;if("addEventListener"in s)s.addEventListener(a,i,l),c=()=>s.removeEventListener(a,i,l);else{const d=s;d.addListener(i),c=()=>d.removeListener(i)}return e.push(c),n}function r(){e=e.filter(s=>s())}const n={add:t,clear:r};return n}function Rd(e,t,r,n){const s=zt(),a=1e3/60;let i=null,l=0,c=0;function d(){s.add(e,"visibilitychange",()=>{e.hidden&&h()})}function g(){m(),s.clear()}function u(y){if(!c)return;i||(i=y,r(),r());const w=y-i;for(i=y,l+=w;l>=a;)r(),l-=a;const v=l/a;n(v),c&&(c=t.requestAnimationFrame(u))}function f(){c||(c=t.requestAnimationFrame(u))}function m(){t.cancelAnimationFrame(c),i=null,l=0,c=0}function h(){i=null,l=0}return{init:d,destroy:g,start:f,stop:m,update:r,render:n}}function _d(e,t){const r=t==="rtl",n=e==="y",s=n?"y":"x",a=n?"x":"y",i=!n&&r?-1:1,l=g(),c=u();function d(h){const{height:x,width:y}=h;return n?x:y}function g(){return n?"top":r?"right":"left"}function u(){return n?"bottom":r?"left":"right"}function f(h){return h*i}return{scroll:s,cross:a,startEdge:l,endEdge:c,measureSize:d,direction:f}}function ut(e=0,t=0){const r=pe(e-t);function n(d){return d<e}function s(d){return d>t}function a(d){return n(d)||s(d)}function i(d){return a(d)?n(d)?e:t:d}function l(d){return r?d-r*Math.ceil((d-t)/r):d}return{length:r,max:t,min:e,constrain:i,reachedAny:a,reachedMax:s,reachedMin:n,removeOffset:l}}function ka(e,t,r){const{constrain:n}=ut(0,e),s=e+1;let a=i(t);function i(f){return r?pe((s+f)%s):n(f)}function l(){return a}function c(f){return a=i(f),u}function d(f){return g().set(l()+f)}function g(){return ka(e,l(),r)}const u={get:l,set:c,add:d,clone:g};return u}function Md(e,t,r,n,s,a,i,l,c,d,g,u,f,m,h,x,y,w,v){const{cross:j,direction:R}=e,M=["INPUT","SELECT","TEXTAREA"],C={passive:!1},k=zt(),N=zt(),S=ut(50,225).constrain(m.measure(20)),_={mouse:300,touch:400},D={mouse:500,touch:600},F=h?43:25;let B=!1,P=0,q=0,V=!1,A=!1,T=!1,oe=!1;function K(G){if(!v)return;function le(we){(mr(v)||v(G,we))&&Z(we)}const de=t;k.add(de,"dragstart",we=>we.preventDefault(),C).add(de,"touchmove",()=>{},C).add(de,"touchend",()=>{}).add(de,"touchstart",le).add(de,"mousedown",le).add(de,"touchcancel",X).add(de,"contextmenu",X).add(de,"click",ce,!0)}function Y(){k.clear(),N.clear()}function ee(){const G=oe?r:t;N.add(G,"touchmove",O,C).add(G,"touchend",X).add(G,"mousemove",O,C).add(G,"mouseup",X)}function z(G){const le=G.nodeName||"";return M.includes(le)}function L(){return(h?D:_)[oe?"mouse":"touch"]}function H(G,le){const de=u.add(yn(G)*-1),we=g.byDistance(G,!h).distance;return h||pe(G)<S?we:y&&le?we*.5:g.byIndex(de.get(),0).distance}function Z(G){const le=Fr(G,n);oe=le,T=h&&le&&!G.buttons&&B,B=Tt(s.get(),i.get())>=2,!(le&&G.button!==0)&&(z(G.target)||(V=!0,a.pointerDown(G),d.useFriction(0).useDuration(0),s.set(i),ee(),P=a.readPoint(G),q=a.readPoint(G,j),f.emit("pointerDown")))}function O(G){if(!Fr(G,n)&&G.touches.length>=2)return X(G);const de=a.readPoint(G),we=a.readPoint(G,j),Pe=Tt(de,P),ye=Tt(we,q);if(!A&&!oe&&(!G.cancelable||(A=Pe>ye,!A)))return X(G);const $e=a.pointerMove(G);Pe>x&&(T=!0),d.useFriction(.3).useDuration(.75),l.start(),s.add(R($e)),G.preventDefault()}function X(G){const de=g.byDistance(0,!1).index!==u.get(),we=a.pointerUp(G)*L(),Pe=H(R(we),de),ye=Cd(we,Pe),$e=F-10*ye,xe=w+ye/50;A=!1,V=!1,N.clear(),d.useDuration($e).useFriction(xe),c.distance(Pe,!h),oe=!1,f.emit("pointerUp")}function ce(G){T&&(G.stopPropagation(),G.preventDefault(),T=!1)}function ae(){return V}return{init:K,destroy:Y,pointerDown:ae}}function Pd(e,t){let n,s;function a(u){return u.timeStamp}function i(u,f){const h=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(Fr(u,t)?u:u.touches[0])[h]}function l(u){return n=u,s=u,i(u)}function c(u){const f=i(u)-i(s),m=a(u)-a(n)>170;return s=u,m&&(n=u),f}function d(u){if(!n||!s)return 0;const f=i(s)-i(n),m=a(u)-a(n),h=a(u)-a(s)>170,x=f/m;return m&&!h&&pe(x)>.1?x:0}return{pointerDown:l,pointerMove:c,pointerUp:d,readPoint:i}}function Id(){function e(r){const{offsetTop:n,offsetLeft:s,offsetWidth:a,offsetHeight:i}=r;return{top:n,right:s+a,bottom:n+i,left:s,width:a,height:i}}return{measure:e}}function Td(e){function t(n){return e*(n/100)}return{measure:t}}function Ld(e,t,r,n,s,a,i){const l=[e].concat(n);let c,d,g=[],u=!1;function f(y){return s.measureSize(i.measure(y))}function m(y){if(!a)return;d=f(e),g=n.map(f);function w(v){for(const j of v){if(u)return;const R=j.target===e,M=n.indexOf(j.target),C=R?d:g[M],k=f(R?e:n[M]);if(pe(k-C)>=.5){y.reInit(),t.emit("resize");break}}}c=new ResizeObserver(v=>{(mr(a)||a(y,v))&&w(v)}),r.requestAnimationFrame(()=>{l.forEach(v=>c.observe(v))})}function h(){u=!0,c&&c.disconnect()}return{init:m,destroy:h}}function Dd(e,t,r,n,s,a){let i=0,l=0,c=s,d=a,g=e.get(),u=0;function f(){const C=n.get()-e.get(),k=!c;let N=0;return k?(i=0,r.set(n),e.set(n),N=C):(r.set(e),i+=C/c,i*=d,g+=i,e.add(i),N=g-u),l=yn(N),u=g,M}function m(){const C=n.get()-t.get();return pe(C)<.001}function h(){return c}function x(){return l}function y(){return i}function w(){return j(s)}function v(){return R(a)}function j(C){return c=C,M}function R(C){return d=C,M}const M={direction:x,duration:h,velocity:y,seek:f,settled:m,useBaseFriction:v,useBaseDuration:w,useFriction:R,useDuration:j};return M}function Ed(e,t,r,n,s){const a=s.measure(10),i=s.measure(50),l=ut(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}function g(m){if(!d())return;const h=e.reachedMin(t.get())?"min":"max",x=pe(e[h]-t.get()),y=r.get()-t.get(),w=l.constrain(x/i);r.subtract(y*w),!m&&pe(y)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())}function u(m){c=!m}return{shouldConstrain:d,constrain:g,toggleActive:u}}function Ad(e,t,r,n,s){const a=ut(-t+e,0),i=u(),l=g(),c=f();function d(h,x){return Tt(h,x)<=1}function g(){const h=i[0],x=Ue(i),y=i.lastIndexOf(h),w=i.indexOf(x)+1;return ut(y,w)}function u(){return r.map((h,x)=>{const{min:y,max:w}=a,v=a.constrain(h),j=!x,R=jn(r,x);return j?w:R||d(y,v)?y:d(w,v)?w:v}).map(h=>parseFloat(h.toFixed(3)))}function f(){if(t<=e+s)return[a.max];if(n==="keepSnaps")return i;const{min:h,max:x}=l;return i.slice(h,x)}return{snapsContained:c,scrollContainLimit:l}}function Fd(e,t,r){const n=t[0],s=r?n-e:Ue(t);return{limit:ut(s,n)}}function Vd(e,t,r,n){const a=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:c}=ut(a,i);function d(f){return f===1?c(r.get()):f===-1?l(r.get()):!1}function g(f){if(!d(f))return;const m=e*(f*-1);n.forEach(h=>h.add(m))}return{loop:g}}function zd(e){const{max:t,length:r}=e;function n(a){const i=a-t;return r?i/-r:0}return{get:n}}function $d(e,t,r,n,s){const{startEdge:a,endEdge:i}=e,{groupSlides:l}=s,c=u().map(t.measure),d=f(),g=m();function u(){return l(n).map(x=>Ue(x)[i]-x[0][a]).map(pe)}function f(){return n.map(x=>r[a]-x[a]).map(x=>-pe(x))}function m(){return l(d).map(x=>x[0]).map((x,y)=>x+c[y])}return{snaps:d,snapsAligned:g}}function Bd(e,t,r,n,s,a){const{groupSlides:i}=s,{min:l,max:c}=n,d=g();function g(){const f=i(a),m=!e||t==="keepSnaps";return r.length===1?[a]:m?f:f.slice(l,c).map((h,x,y)=>{const w=!x,v=jn(y,x);if(w){const j=Ue(y[0])+1;return Wn(j)}if(v){const j=Ot(a)-Ue(y)[0]+1;return Wn(j,Ue(y)[0])}return h})}return{slideRegistry:d}}function Od(e,t,r,n,s){const{reachedAny:a,removeOffset:i,constrain:l}=n;function c(h){return h.concat().sort((x,y)=>pe(x)-pe(y))[0]}function d(h){const x=e?i(h):l(h),y=t.map((v,j)=>({diff:g(v-x,0),index:j})).sort((v,j)=>pe(v.diff)-pe(j.diff)),{index:w}=y[0];return{index:w,distance:x}}function g(h,x){const y=[h,h+r,h-r];if(!e)return h;if(!x)return c(y);const w=y.filter(v=>yn(v)===x);return w.length?c(w):Ue(y)-r}function u(h,x){const y=t[h]-s.get(),w=g(y,x);return{index:h,distance:w}}function f(h,x){const y=s.get()+h,{index:w,distance:v}=d(y),j=!e&&a(y);if(!x||j)return{index:w,distance:h};const R=t[w]-v,M=h+g(R,0);return{index:w,distance:M}}return{byDistance:f,byIndex:u,shortcut:g}}function Hd(e,t,r,n,s,a,i){function l(u){const f=u.distance,m=u.index!==t.get();a.add(f),f&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),m&&(r.set(t.get()),t.set(u.index),i.emit("select"))}function c(u,f){const m=s.byDistance(u,f);l(m)}function d(u,f){const m=t.clone().set(u),h=s.byIndex(m.get(),f);l(h)}return{distance:c,index:d}}function Gd(e,t,r,n,s,a,i,l){const c={passive:!0,capture:!0};let d=0;function g(m){if(!l)return;function h(x){if(new Date().getTime()-d>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const v=r.findIndex(j=>j.includes(x));wn(v)&&(s.useDuration(0),n.index(v,0),i.emit("slideFocus"))}a.add(document,"keydown",u,!1),t.forEach((x,y)=>{a.add(x,"focus",w=>{(mr(l)||l(m,w))&&h(y)},c)})}function u(m){m.code==="Tab"&&(d=new Date().getTime())}return{init:g}}function Mt(e){let t=e;function r(){return t}function n(c){t=i(c)}function s(c){t+=i(c)}function a(c){t-=i(c)}function i(c){return wn(c)?c:c.get()}return{get:r,set:n,add:s,subtract:a}}function Sa(e,t){const r=e.scroll==="x"?i:l,n=t.style;let s=null,a=!1;function i(f){return`translate3d(${f}px,0px,0px)`}function l(f){return`translate3d(0px,${f}px,0px)`}function c(f){if(a)return;const m=kd(e.direction(f));m!==s&&(n.transform=r(m),s=m)}function d(f){a=!f}function g(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:g,to:c,toggleActive:d}}function qd(e,t,r,n,s,a,i,l,c){const g=Ft(s),u=Ft(s).reverse(),f=w().concat(v());function m(k,N){return k.reduce((S,_)=>S-s[_],N)}function h(k,N){return k.reduce((S,_)=>m(S,N)>0?S.concat([_]):S,[])}function x(k){return a.map((N,S)=>({start:N-n[S]+.5+k,end:N+t-.5+k}))}function y(k,N,S){const _=x(N);return k.map(D=>{const F=S?0:-r,B=S?r:0,P=S?"end":"start",q=_[D][P];return{index:D,loopPoint:q,slideLocation:Mt(-1),translate:Sa(e,c[D]),target:()=>l.get()>q?F:B}})}function w(){const k=i[0],N=h(u,k);return y(N,r,!1)}function v(){const k=t-i[0]-1,N=h(g,k);return y(N,-r,!0)}function j(){return f.every(({index:k})=>{const N=g.filter(S=>S!==k);return m(N,t)<=.1})}function R(){f.forEach(k=>{const{target:N,translate:S,slideLocation:_}=k,D=N();D!==_.get()&&(S.to(D),_.set(D))})}function M(){f.forEach(k=>k.translate.clear())}return{canLoop:j,clear:M,loop:R,loopPoints:f}}function Wd(e,t,r){let n,s=!1;function a(c){if(!r)return;function d(g){for(const u of g)if(u.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(g=>{s||(mr(r)||r(c,g))&&d(g)}),n.observe(e,{childList:!0})}function i(){n&&n.disconnect(),s=!0}return{init:a,destroy:i}}function Ud(e,t,r,n){const s={};let a=null,i=null,l,c=!1;function d(){l=new IntersectionObserver(h=>{c||(h.forEach(x=>{const y=t.indexOf(x.target);s[y]=x}),a=null,i=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(h=>l.observe(h))}function g(){l&&l.disconnect(),c=!0}function u(h){return Vt(s).reduce((x,y)=>{const w=parseInt(y),{isIntersecting:v}=s[w];return(h&&v||!h&&!v)&&x.push(w),x},[])}function f(h=!0){if(h&&a)return a;if(!h&&i)return i;const x=u(h);return h&&(a=x),h||(i=x),x}return{init:d,destroy:g,get:f}}function Kd(e,t,r,n,s,a){const{measureSize:i,startEdge:l,endEdge:c}=e,d=r[0]&&s,g=h(),u=x(),f=r.map(i),m=y();function h(){if(!d)return 0;const v=r[0];return pe(t[l]-v[l])}function x(){if(!d)return 0;const v=a.getComputedStyle(Ue(n));return parseFloat(v.getPropertyValue(`margin-${c}`))}function y(){return r.map((v,j,R)=>{const M=!j,C=jn(R,j);return M?f[j]+g:C?f[j]+u:R[j+1][l]-v[l]}).map(pe)}return{slideSizes:f,slideSizesWithGaps:m,startGap:g,endGap:u}}function Xd(e,t,r,n,s,a,i,l,c){const{startEdge:d,endEdge:g,direction:u}=e,f=wn(r);function m(w,v){return Ft(w).filter(j=>j%v===0).map(j=>w.slice(j,j+v))}function h(w){return w.length?Ft(w).reduce((v,j,R)=>{const M=Ue(v)||0,C=M===0,k=j===Ot(w),N=s[d]-a[M][d],S=s[d]-a[j][g],_=!n&&C?u(i):0,D=!n&&k?u(l):0,F=pe(S-D-(N+_));return R&&F>t+c&&v.push(j),k&&v.push(w.length),v},[]).map((v,j,R)=>{const M=Math.max(R[j-1]||0);return w.slice(M,v)}):[]}function x(w){return f?m(w,r):h(w)}return{groupSlides:x}}function Yd(e,t,r,n,s,a,i){const{align:l,axis:c,direction:d,startIndex:g,loop:u,duration:f,dragFree:m,dragThreshold:h,inViewThreshold:x,slidesToScroll:y,skipSnaps:w,containScroll:v,watchResize:j,watchSlides:R,watchDrag:M,watchFocus:C}=a,k=2,N=Id(),S=N.measure(t),_=r.map(N.measure),D=_d(c,d),F=D.measureSize(S),B=Td(F),P=Sd(l,F),q=!u&&!!v,V=u||!!v,{slideSizes:A,slideSizesWithGaps:T,startGap:oe,endGap:K}=Kd(D,S,_,r,V,s),Y=Xd(D,F,y,u,S,_,oe,K,k),{snaps:ee,snapsAligned:z}=$d(D,P,S,_,Y),L=-Ue(ee)+Ue(T),{snapsContained:H,scrollContainLimit:Z}=Ad(F,L,z,v,k),O=q?H:z,{limit:X}=Fd(L,O,u),ce=ka(Ot(O),g,u),ae=ce.clone(),ie=Ft(r),G=({dragHandler:_e,scrollBody:pt,scrollBounds:Ze,options:{loop:ht}})=>{ht||Ze.constrain(_e.pointerDown()),pt.seek()},le=({scrollBody:_e,translate:pt,location:Ze,offsetLocation:ht,previousLocation:xr,scrollLooper:Ht,slideLooper:Gt,dragHandler:br,animation:Nt,eventHandler:He,scrollBounds:vr,options:{loop:qt}},Ct)=>{const kt=_e.settled(),ne=!vr.shouldConstrain(),be=qt?kt:kt&&ne,Ce=be&&!br.pointerDown();Ce&&Nt.stop();const Ie=Ze.get()*Ct+xr.get()*(1-Ct);ht.set(Ie),qt&&(Ht.loop(_e.direction()),Gt.loop()),pt.to(ht.get()),Ce&&He.emit("settle"),be||He.emit("scroll")},de=Rd(n,s,()=>G(Ye),_e=>le(Ye,_e)),we=.68,Pe=O[ce.get()],ye=Mt(Pe),$e=Mt(Pe),xe=Mt(Pe),Oe=Mt(Pe),Qe=Dd(ye,xe,$e,Oe,f,we),je=Od(u,O,L,X,Oe),Fe=Hd(de,ce,ae,Qe,je,Oe,i),gt=zd(X),$=zt(),re=Ud(t,r,i,x),{slideRegistry:Ne}=Bd(q,v,O,Z,Y,ie),Xe=Gd(e,r,Ne,Fe,Qe,$,i,C),Ye={ownerDocument:n,ownerWindow:s,eventHandler:i,containerRect:S,slideRects:_,animation:de,axis:D,dragHandler:Md(D,e,n,s,Oe,Pd(D,s),ye,de,Fe,Qe,je,ce,i,B,m,h,w,we,M),eventStore:$,percentOfView:B,index:ce,indexPrevious:ae,limit:X,location:ye,offsetLocation:xe,previousLocation:$e,options:a,resizeHandler:Ld(t,i,s,r,D,j,N),scrollBody:Qe,scrollBounds:Ed(X,xe,Oe,Qe,B),scrollLooper:Vd(L,X,xe,[ye,xe,$e,Oe]),scrollProgress:gt,scrollSnapList:O.map(gt.get),scrollSnaps:O,scrollTarget:je,scrollTo:Fe,slideLooper:qd(D,F,L,A,T,ee,O,xe,r),slideFocus:Xe,slidesHandler:Wd(t,i,R),slidesInView:re,slideIndexes:ie,slideRegistry:Ne,slidesToScroll:Y,target:Oe,translate:Sa(D,t)};return Ye}function Zd(){let e={},t;function r(d){t=d}function n(d){return e[d]||[]}function s(d){return n(d).forEach(g=>g(t,d)),c}function a(d,g){return e[d]=n(d).concat([g]),c}function i(d,g){return e[d]=n(d).filter(u=>u!==g),c}function l(){e={}}const c={init:r,emit:s,off:i,on:a,clear:l};return c}const Jd={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Qd(e){function t(a,i){return Ca(a,i||{})}function r(a){const i=a.breakpoints||{},l=Vt(i).filter(c=>e.matchMedia(c).matches).map(c=>i[c]).reduce((c,d)=>t(c,d),{});return t(a,l)}function n(a){return a.map(i=>Vt(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:n}}function eu(e){let t=[];function r(a,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(a,e)),i.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function n(){t=t.filter(a=>a.destroy())}return{init:r,destroy:n}}function sr(e,t,r){const n=e.ownerDocument,s=n.defaultView,a=Qd(s),i=eu(a),l=zt(),c=Zd(),{mergeOptions:d,optionsAtMedia:g,optionsMediaQueries:u}=a,{on:f,off:m,emit:h}=c,x=D;let y=!1,w,v=d(Jd,sr.globalOptions),j=d(v),R=[],M,C,k;function N(){const{container:ie,slides:G}=j;C=(Ar(ie)?e.querySelector(ie):ie)||e.children[0];const de=Ar(G)?C.querySelectorAll(G):G;k=[].slice.call(de||C.children)}function S(ie){const G=Yd(e,C,k,n,s,ie,c);if(ie.loop&&!G.slideLooper.canLoop()){const le=Object.assign({},ie,{loop:!1});return S(le)}return G}function _(ie,G){y||(v=d(v,ie),j=g(v),R=G||R,N(),w=S(j),u([v,...R.map(({options:le})=>le)]).forEach(le=>l.add(le,"change",D)),j.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(ae),w.eventHandler.init(ae),w.resizeHandler.init(ae),w.slidesHandler.init(ae),w.options.loop&&w.slideLooper.loop(),C.offsetParent&&k.length&&w.dragHandler.init(ae),M=i.init(ae,R)))}function D(ie,G){const le=Y();F(),_(d({startIndex:le},ie),G),c.emit("reInit")}function F(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),i.destroy(),l.clear()}function B(){y||(y=!0,l.clear(),F(),c.emit("destroy"),c.clear())}function P(ie,G,le){!j.active||y||(w.scrollBody.useBaseFriction().useDuration(G===!0?0:j.duration),w.scrollTo.index(ie,le||0))}function q(ie){const G=w.index.add(1).get();P(G,ie,-1)}function V(ie){const G=w.index.add(-1).get();P(G,ie,1)}function A(){return w.index.add(1).get()!==Y()}function T(){return w.index.add(-1).get()!==Y()}function oe(){return w.scrollSnapList}function K(){return w.scrollProgress.get(w.offsetLocation.get())}function Y(){return w.index.get()}function ee(){return w.indexPrevious.get()}function z(){return w.slidesInView.get()}function L(){return w.slidesInView.get(!1)}function H(){return M}function Z(){return w}function O(){return e}function X(){return C}function ce(){return k}const ae={canScrollNext:A,canScrollPrev:T,containerNode:X,internalEngine:Z,destroy:B,off:m,on:f,emit:h,plugins:H,previousScrollSnap:ee,reInit:x,rootNode:O,scrollNext:q,scrollPrev:V,scrollProgress:K,scrollSnapList:oe,scrollTo:P,selectedScrollSnap:Y,slideNodes:ce,slidesInView:z,slidesNotInView:L};return _(t,r),setTimeout(()=>c.emit("init"),0),ae}sr.globalOptions=void 0;function Nn(e={},t=[]){const r=E.useRef(e),n=E.useRef(t),[s,a]=E.useState(),[i,l]=E.useState(),c=E.useCallback(()=>{s&&s.reInit(r.current,n.current)},[s]);return E.useEffect(()=>{vn(r.current,e)||(r.current=e,c())},[e,c]),E.useEffect(()=>{Nd(n.current,t)||(n.current=t,c())},[t,c]),E.useEffect(()=>{if(jd()&&i){sr.globalOptions=Nn.globalOptions;const d=sr(i,r.current,n.current);return a(d),()=>d.destroy()}else a(void 0)},[i,a]),[l,s]}Nn.globalOptions=void 0;const Ra=p.createContext(null);function fr(){const e=p.useContext(Ra);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const _a=p.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,plugins:n,className:s,children:a,...i},l)=>{const[c,d]=Nn({...t,axis:e==="horizontal"?"x":"y"},n),[g,u]=p.useState(!1),[f,m]=p.useState(!1),h=p.useCallback(v=>{v&&(u(v.canScrollPrev()),m(v.canScrollNext()))},[]),x=p.useCallback(()=>{d==null||d.scrollPrev()},[d]),y=p.useCallback(()=>{d==null||d.scrollNext()},[d]),w=p.useCallback(v=>{v.key==="ArrowLeft"?(v.preventDefault(),x()):v.key==="ArrowRight"&&(v.preventDefault(),y())},[x,y]);return p.useEffect(()=>{!d||!r||r(d)},[d,r]),p.useEffect(()=>{if(d)return h(d),d.on("reInit",h),d.on("select",h),()=>{d==null||d.off("select",h)}},[d,h]),o.jsx(Ra.Provider,{value:{carouselRef:c,api:d,opts:t,orientation:e,scrollPrev:x,scrollNext:y,canScrollPrev:g,canScrollNext:f},children:o.jsx("div",{ref:l,onKeyDownCapture:w,className:b("relative",s),role:"region","aria-roledescription":"carousel",...i,children:a})})});_a.displayName="Carousel";const Ma=p.forwardRef(({className:e,...t},r)=>{const{carouselRef:n,orientation:s}=fr();return o.jsx("div",{ref:n,className:"overflow-hidden",children:o.jsx("div",{ref:r,className:b("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Ma.displayName="CarouselContent";const Pa=p.forwardRef(({className:e,...t},r)=>{const{orientation:n}=fr();return o.jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:b("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})});Pa.displayName="CarouselItem";const Ia=p.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:a,scrollPrev:i,canScrollPrev:l}=fr(),c=te();return o.jsxs(ve,{ref:s,variant:t,size:r,className:b("absolute h-8 w-8 rounded-full",a==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...n,children:[o.jsx(I.ChevronLeft,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c.carousel_previousSlide})]})});Ia.displayName="CarouselPrevious";const Ta=p.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:a,scrollNext:i,canScrollNext:l}=fr(),c=te();return o.jsxs(ve,{ref:s,variant:t,size:r,className:b("absolute h-8 w-8 rounded-full",a==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...n,children:[o.jsx(I.ChevronRight,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c.carousel_nextSlide})]})});Ta.displayName="CarouselNext";/**
12
+ )`}})]}),n.jsxs("div",{className:"flex gap-2 items-center",children:[n.jsx("div",{className:"h-9 w-9 rounded-md border flex-shrink-0 shadow-inner",style:{backgroundColor:e}}),n.jsx(mt,{value:d,onChange:h=>g(h.target.value),placeholder:"#000000",className:"font-mono text-sm"})]}),n.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:gc.map(h=>n.jsx("button",{onClick:()=>{t==null||t(h),l(er(h)),c(h)},className:v("h-7 w-7 rounded-md border-2 transition-transform hover:scale-110",e===h?"border-primary ring-2 ring-ring":"border-transparent"),style:{backgroundColor:h}},h))})]})})]})}const Wo=f.forwardRef(({className:e,as:t="div",...r},o)=>n.jsx(t,{ref:o,className:v(e),...r}));Wo.displayName="Box";const Uo=f.forwardRef(({className:e,direction:t,wrap:r,justify:o,align:s,gap:a,style:i,...l},d)=>n.jsx("div",{ref:d,className:v("flex",t&&`flex-${t}`,r&&`flex-${r}`,o&&`justify-${o}`,s&&`items-${s}`,typeof a=="number"&&`gap-${a}`,e),style:{...typeof a=="string"?{gap:a}:{},...i},...l}));Uo.displayName="Flex";const Ko=f.forwardRef(({className:e,spacing:t=4,align:r,style:o,...s},a)=>n.jsx("div",{ref:a,className:v("flex flex-col",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...o},...s}));Ko.displayName="VStack";const Xo=f.forwardRef(({className:e,spacing:t=4,align:r="center",style:o,...s},a)=>n.jsx("div",{ref:a,className:v("flex flex-row",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...o},...s}));Xo.displayName="HStack";const Yo=f.forwardRef(({className:e,cols:t=1,gap:r=4,style:o,...s},a)=>{const i=typeof t=="number"?`grid-cols-${t}`:[t.sm&&`sm:grid-cols-${t.sm}`,t.md&&`md:grid-cols-${t.md}`,t.lg&&`lg:grid-cols-${t.lg}`,t.xl&&`xl:grid-cols-${t.xl}`].filter(Boolean).join(" ");return n.jsx("div",{ref:a,className:v("grid",i,typeof r=="number"&&`gap-${r}`,e),style:{...typeof r=="string"?{gap:r}:{},...o},...s})});Yo.displayName="Grid";const xc={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},Zo=f.forwardRef(({className:e,maxWidth:t="lg",centered:r=!0,...o},s)=>n.jsx("div",{ref:s,className:v("w-full px-4",xc[t],r&&"mx-auto",e),...o}));Zo.displayName="Container";const vc=ul.Root,bc=Ur.Root,wc=Ur.CollapsibleTrigger,Jo=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx(Ur.CollapsibleContent,{ref:o,className:v("overflow-hidden transition-all duration-300 ease-in-out","data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",e),...r,children:n.jsx("div",{className:"pb-2",children:t})}));Jo.displayName="CollapsibleContent";const Qo=Le("rounded-xl text-card-foreground transition-all duration-300",{variants:{variant:{default:"border bg-card shadow-sm",elevated:"border border-white/10 bg-gradient-to-br from-card/80 to-card/40 backdrop-blur-xl shadow-2xl shadow-black/20",glass:"border border-white/10 bg-white/5 backdrop-blur-xl shadow-xl",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),en=f.forwardRef(({className:e,variant:t,...r},o)=>n.jsx("div",{ref:o,className:v(Qo({variant:t}),e),...r}));en.displayName="Card";const tn=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",e),...t}));tn.displayName="CardHeader";const rn=f.forwardRef(({className:e,...t},r)=>n.jsx("h3",{ref:r,className:v("text-2xl font-semibold leading-none tracking-tight",e),...t}));rn.displayName="CardTitle";const es=f.forwardRef(({className:e,...t},r)=>n.jsx("p",{ref:r,className:v("text-sm text-muted-foreground",e),...t}));es.displayName="CardDescription";const nn=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("p-6 pt-0",e),...t}));nn.displayName="CardContent";const ts=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",e),...t}));ts.displayName="CardFooter";const on=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{className:"relative w-full overflow-auto",children:n.jsx("table",{ref:r,className:v("w-full caption-bottom text-sm",e),...t})}));on.displayName="Table";const sn=f.forwardRef(({className:e,...t},r)=>n.jsx("thead",{ref:r,className:v("[&_tr]:border-b",e),...t}));sn.displayName="TableHeader";const an=f.forwardRef(({className:e,...t},r)=>n.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",e),...t}));an.displayName="TableBody";const rs=f.forwardRef(({className:e,...t},r)=>n.jsx("tfoot",{ref:r,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));rs.displayName="TableFooter";const At=f.forwardRef(({className:e,...t},r)=>n.jsx("tr",{ref:r,className:v("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));At.displayName="TableRow";const ln=f.forwardRef(({className:e,...t},r)=>n.jsx("th",{ref:r,className:v("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ln.displayName="TableHead";const ir=f.forwardRef(({className:e,...t},r)=>n.jsx("td",{ref:r,className:v("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ir.displayName="TableCell";const ns=f.forwardRef(({className:e,...t},r)=>n.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",e),...t}));ns.displayName="TableCaption";const fr=f.forwardRef(({className:e,children:t,orientation:r="vertical",...o},s)=>n.jsxs(xt.Root,{ref:s,className:v("relative overflow-hidden",e),...o,children:[n.jsx(xt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(r==="vertical"||r==="both")&&n.jsx(lr,{orientation:"vertical"}),(r==="horizontal"||r==="both")&&n.jsx(lr,{orientation:"horizontal"}),n.jsx(xt.Corner,{})]}));fr.displayName=xt.Root.displayName;const lr=f.forwardRef(({className:e,orientation:t="vertical",...r},o)=>n.jsx(xt.ScrollAreaScrollbar,{ref:o,orientation:t,className:v("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:n.jsx(xt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));lr.displayName=xt.ScrollAreaScrollbar.displayName;const yc=wt.Root,os=f.forwardRef(({className:e,...t},r)=>n.jsx(wt.List,{ref:r,className:v("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));os.displayName=wt.List.displayName;const ss=f.forwardRef(({className:e,...t},r)=>n.jsx(wt.Trigger,{ref:r,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ss.displayName=wt.Trigger.displayName;const as=f.forwardRef(({className:e,...t},r)=>n.jsx(wt.Content,{ref:r,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));as.displayName=wt.Content.displayName;const jc=vt.Root,is=f.forwardRef(({className:e,...t},r)=>n.jsx(vt.Item,{ref:r,className:v("border-b",e),...t}));is.displayName="AccordionItem";const ls=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx(vt.Header,{className:"flex",children:n.jsxs(vt.Trigger,{ref:o,className:v("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,n.jsx(P.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));ls.displayName=vt.Trigger.displayName;const cs=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx(vt.Content,{ref:o,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:n.jsx("div",{className:v("pb-4 pt-0",e),children:t})}));cs.displayName=vt.Content.displayName;const ds=ge.Root,Nc=ge.Trigger,us=ge.Portal,kc=ge.Close,cn=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Overlay,{ref:r,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));cn.displayName=ge.Overlay.displayName;const dn=f.forwardRef(({className:e,children:t,...r},o)=>{const s=ce();return n.jsxs(us,{children:[n.jsx(cn,{}),n.jsxs(ge.Content,{ref:o,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,n.jsxs(ge.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsx(P.X,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:s.common_close})]})]})]})});dn.displayName=ge.Content.displayName;const ms=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ms.displayName="DialogHeader";const fs=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fs.displayName="DialogFooter";const gs=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Title,{ref:r,className:v("text-lg font-semibold leading-none tracking-tight",e),...t}));gs.displayName=ge.Title.displayName;const ps=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Description,{ref:r,className:v("text-sm text-muted-foreground",e),...t}));ps.displayName=ge.Description.displayName;const hs=ge.Root,xs=ge.Trigger,vs=ge.Close,bs=ge.Portal,un=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Overlay,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));un.displayName=ge.Overlay.displayName;const Cc=Le("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),mn=f.forwardRef(({side:e="right",className:t,children:r,...o},s)=>{const a=ce();return n.jsxs(bs,{children:[n.jsx(un,{}),n.jsxs(ge.Content,{ref:s,className:v(Cc({side:e}),t),...o,children:[r,n.jsxs(ge.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[n.jsx(P.X,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:a.common_close})]})]})]})});mn.displayName=ge.Content.displayName;const fn=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",e),...t});fn.displayName="SheetHeader";const gn=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gn.displayName="SheetFooter";const pn=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Title,{ref:r,className:v("text-lg font-semibold text-foreground",e),...t}));pn.displayName=ge.Title.displayName;const hn=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Description,{ref:r,className:v("text-sm text-muted-foreground",e),...t}));hn.displayName=ge.Description.displayName;const ws=pe.Root,ys=pe.Trigger,Sc=pe.Group,Rc=pe.Portal,_c=pe.Sub,Mc=pe.RadioGroup,js=f.forwardRef(({className:e,inset:t,children:r,...o},s)=>n.jsxs(pe.SubTrigger,{ref:s,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[r,n.jsx(P.ChevronRight,{className:"ml-auto h-4 w-4"})]}));js.displayName=pe.SubTrigger.displayName;const Ns=f.forwardRef(({className:e,...t},r)=>n.jsx(pe.SubContent,{ref:r,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ns.displayName=pe.SubContent.displayName;const xn=f.forwardRef(({className:e,sideOffset:t=4,...r},o)=>n.jsx(pe.Portal,{children:n.jsx(pe.Content,{ref:o,sideOffset:t,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));xn.displayName=pe.Content.displayName;const Ft=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(pe.Item,{ref:o,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Ft.displayName=pe.Item.displayName;const ks=f.forwardRef(({className:e,children:t,checked:r,...o},s)=>n.jsxs(pe.CheckboxItem,{ref:s,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(pe.ItemIndicator,{children:n.jsx(P.Check,{className:"h-4 w-4"})})}),t]}));ks.displayName=pe.CheckboxItem.displayName;const Cs=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(pe.RadioItem,{ref:o,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(pe.ItemIndicator,{children:n.jsx(P.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Cs.displayName=pe.RadioItem.displayName;const Ss=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(pe.Label,{ref:o,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Ss.displayName=pe.Label.displayName;const Rs=f.forwardRef(({className:e,...t},r)=>n.jsx(pe.Separator,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Rs.displayName=pe.Separator.displayName;const _s=({className:e,...t})=>n.jsx("span",{className:v("ml-auto text-xs tracking-widest opacity-60",e),...t});_s.displayName="DropdownMenuShortcut";const Pc=Wt.Provider,Ic=Wt.Root,Lc=Wt.Trigger,Ms=f.forwardRef(({className:e,sideOffset:t=4,...r},o)=>n.jsx(Wt.Content,{ref:o,sideOffset:t,className:v("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Ms.displayName=Wt.Content.displayName;const vn=f.forwardRef(({className:e,...t},r)=>n.jsx($e.Command,{ref:r,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));vn.displayName=$e.Command.displayName;const Tc=({children:e,...t})=>n.jsx(ds,{...t,children:n.jsx(dn,{className:"overflow-hidden p-0 shadow-lg",children:n.jsx(vn,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Ps=f.forwardRef(({className:e,...t},r)=>n.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsx(P.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsx($e.Command.Input,{ref:r,className:v("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ps.displayName=$e.Command.Input.displayName;const Is=f.forwardRef(({className:e,...t},r)=>n.jsx($e.Command.List,{ref:r,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Is.displayName=$e.Command.List.displayName;const Ls=f.forwardRef((e,t)=>n.jsx($e.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ls.displayName=$e.Command.Empty.displayName;const Ts=f.forwardRef(({className:e,...t},r)=>n.jsx($e.Command.Group,{ref:r,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ts.displayName=$e.Command.Group.displayName;const Es=f.forwardRef(({className:e,...t},r)=>n.jsx($e.Command.Separator,{ref:r,className:v("-mx-1 h-px bg-border",e),...t}));Es.displayName=$e.Command.Separator.displayName;const Ds=f.forwardRef(({className:e,...t},r)=>n.jsx($e.Command.Item,{ref:r,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected='true']:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));Ds.displayName=$e.Command.Item.displayName;const As=({className:e,...t})=>n.jsx("span",{className:v("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});As.displayName="CommandShortcut";const Ec=Le("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Fs=f.forwardRef(({className:e,variant:t,...r},o)=>n.jsx("div",{ref:o,role:"alert",className:v(Ec({variant:t}),e),...r}));Fs.displayName="Alert";const Vs=f.forwardRef(({className:e,...t},r)=>n.jsx("h5",{ref:r,className:v("mb-1 font-medium leading-none tracking-tight",e),...t}));Vs.displayName="AlertTitle";const zs=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("text-sm [&_p]:leading-relaxed",e),...t}));zs.displayName="AlertDescription";const Dc=Ae.Root,Ac=Ae.Trigger,$s=Ae.Portal,bn=f.forwardRef(({className:e,...t},r)=>n.jsx(Ae.Overlay,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));bn.displayName=Ae.Overlay.displayName;const Bs=f.forwardRef(({className:e,...t},r)=>n.jsxs($s,{children:[n.jsx(bn,{}),n.jsx(Ae.Content,{ref:r,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Bs.displayName=Ae.Content.displayName;const Os=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",e),...t});Os.displayName="AlertDialogHeader";const Hs=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hs.displayName="AlertDialogFooter";const Gs=f.forwardRef(({className:e,...t},r)=>n.jsx(Ae.Title,{ref:r,className:v("text-lg font-semibold",e),...t}));Gs.displayName=Ae.Title.displayName;const qs=f.forwardRef(({className:e,...t},r)=>n.jsx(Ae.Description,{ref:r,className:v("text-sm text-muted-foreground",e),...t}));qs.displayName=Ae.Description.displayName;const Ws=f.forwardRef(({className:e,...t},r)=>n.jsx(Ae.Action,{ref:r,className:v(Ut(),e),...t}));Ws.displayName=Ae.Action.displayName;const Us=f.forwardRef(({className:e,...t},r)=>n.jsx(Ae.Cancel,{ref:r,className:v(Ut({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Us.displayName=Ae.Cancel.displayName;const Ks=f.forwardRef(({className:e,value:t,...r},o)=>n.jsx(Er.Root,{ref:o,className:v("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:n.jsx(Er.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Ks.displayName=Er.Root.displayName;function Fc({className:e,...t}){return n.jsx("div",{className:v("animate-pulse rounded-md bg-muted",e),...t})}function Vc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const zc=e=>{switch(e){case"success":return Oc;case"info":return Gc;case"warning":return Hc;case"error":return qc;default:return null}},$c=Array(12).fill(0),Bc=({visible:e,className:t})=>B.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},B.createElement("div",{className:"sonner-spinner"},$c.map((r,o)=>B.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Oc=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Hc=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},B.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Gc=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),qc=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Wc=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},B.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),B.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Uc=()=>{const[e,t]=B.useState(document.hidden);return B.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Ar=1;class Kc{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:o,...s}=t,a=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Ar++,i=this.toasts.find(d=>d.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(d=>d.id===a?(this.publish({...d,...t,id:a,title:o}),{...d,...t,id:a,dismissible:l,title:o}):d):this.addToast({title:o,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=o!==void 0,i;const l=s.then(async c=>{if(i=["resolve",c],B.isValidElement(c))a=!1,this.create({id:o,type:"default",message:c});else if(Yc(c)&&!c.ok){a=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,h=typeof u=="object"&&!B.isValidElement(u)?u:{message:u};this.create({id:o,type:"error",description:m,...h})}else if(c instanceof Error){a=!1;const u=typeof r.error=="function"?await r.error(c):r.error,m=typeof r.description=="function"?await r.description(c):r.description,h=typeof u=="object"&&!B.isValidElement(u)?u:{message:u};this.create({id:o,type:"error",description:m,...h})}else if(r.success!==void 0){a=!1;const u=typeof r.success=="function"?await r.success(c):r.success,m=typeof r.description=="function"?await r.description(c):r.description,h=typeof u=="object"&&!B.isValidElement(u)?u:{message:u};this.create({id:o,type:"success",description:m,...h})}}).catch(async c=>{if(i=["reject",c],r.error!==void 0){a=!1;const p=typeof r.error=="function"?await r.error(c):r.error,u=typeof r.description=="function"?await r.description(c):r.description,g=typeof p=="object"&&!B.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:u,...g})}}).finally(()=>{a&&(this.dismiss(o),o=void 0),r.finally==null||r.finally.call(r)}),d=()=>new Promise((c,p)=>l.then(()=>i[0]==="reject"?p(i[1]):c(i[1])).catch(p));return typeof o!="string"&&typeof o!="number"?{unwrap:d}:Object.assign(o,{unwrap:d})},this.custom=(t,r)=>{const o=(r==null?void 0:r.id)||Ar++;return this.create({jsx:t(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ve=new Kc,Xc=(e,t)=>{const r=(t==null?void 0:t.id)||Ar++;return Ve.addToast({title:e,...t,id:r}),r},Yc=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Zc=Xc,Jc=()=>Ve.toasts,Qc=()=>Ve.getActiveToasts(),ed=Object.assign(Zc,{success:Ve.success,info:Ve.info,warning:Ve.warning,error:Ve.error,custom:Ve.custom,message:Ve.message,promise:Ve.promise,dismiss:Ve.dismiss,loading:Ve.loading},{getHistory:Jc,getToasts:Qc});Vc("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function tr(e){return e.label!==void 0}const td=3,rd="24px",nd="16px",Bn=4e3,od=356,sd=14,ad=45,id=200;function Je(...e){return e.filter(Boolean).join(" ")}function ld(e){const[t,r]=e.split("-"),o=[];return t&&o.push(t),r&&o.push(r),o}const cd=e=>{var t,r,o,s,a,i,l,d,c;const{invert:p,toast:u,unstyled:m,interacting:g,setHeights:h,visibleToasts:x,heights:y,index:b,toasts:w,expanded:j,removeToast:M,defaultRichColors:R,closeButton:_,style:C,cancelButtonStyle:S,actionButtonStyle:T,className:L="",descriptionClassName:V="",duration:O,position:$,gap:k,expandByDefault:z,classNames:A,icons:E,closeButtonAriaLabel:N="Close toast"}=e,[W,q]=B.useState(null),[G,Z]=B.useState(null),[I,F]=B.useState(!1),[U,ee]=B.useState(!1),[X,Y]=B.useState(!1),[ae,te]=B.useState(!1),[ie,K]=B.useState(!1),[H,ne]=B.useState(0),[me,ve]=B.useState(0),fe=B.useRef(u.duration||O||Bn),Re=B.useRef(null),ue=B.useRef(null),Fe=b===0,He=b+1<=x,Ne=u.type,Te=u.dismissible!==!1,nt=u.className||"",jt=u.descriptionClassName||"",ot=B.useMemo(()=>y.findIndex(le=>le.toastId===u.id)||0,[y,u.id]),st=B.useMemo(()=>{var le;return(le=u.closeButton)!=null?le:_},[u.closeButton,_]),Nt=B.useMemo(()=>u.duration||O||Bn,[u.duration,O]),Ze=B.useRef(0),Ee=B.useRef(0),Qe=B.useRef(0),Ge=B.useRef(null),[at,kt]=$.split("-"),Ct=B.useMemo(()=>y.reduce((le,je,Ce)=>Ce>=ot?le:le+je.height,0),[y,ot]),D=Uc(),re=u.invert||p,we=Ne==="loading";Ee.current=B.useMemo(()=>ot*k+Ct,[ot,Ct]),B.useEffect(()=>{fe.current=Nt},[Nt]),B.useEffect(()=>{F(!0)},[]),B.useEffect(()=>{const le=ue.current;if(le){const je=le.getBoundingClientRect().height;return ve(je),h(Ce=>[{toastId:u.id,height:je,position:u.position},...Ce]),()=>h(Ce=>Ce.filter(De=>De.toastId!==u.id))}},[h,u.id]),B.useLayoutEffect(()=>{if(!I)return;const le=ue.current,je=le.style.height;le.style.height="auto";const Ce=le.getBoundingClientRect().height;le.style.height=je,ve(Ce),h(De=>De.find(Me=>Me.toastId===u.id)?De.map(Me=>Me.toastId===u.id?{...Me,height:Ce}:Me):[{toastId:u.id,height:Ce,position:u.position},...De])},[I,u.title,u.description,h,u.id,u.jsx,u.action,u.cancel]);const Pe=B.useCallback(()=>{ee(!0),ne(Ee.current),h(le=>le.filter(je=>je.toastId!==u.id)),setTimeout(()=>{M(u)},id)},[u,M,h,Ee]);B.useEffect(()=>{if(u.promise&&Ne==="loading"||u.duration===1/0||u.type==="loading")return;let le;return j||g||D?(()=>{if(Qe.current<Ze.current){const De=new Date().getTime()-Ze.current;fe.current=fe.current-De}Qe.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(Ze.current=new Date().getTime(),le=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Pe()},fe.current))})(),()=>clearTimeout(le)},[j,g,u,Ne,D,Pe]),B.useEffect(()=>{u.delete&&(Pe(),u.onDismiss==null||u.onDismiss.call(u,u))},[Pe,u.delete]);function et(){var le;if(E!=null&&E.loading){var je;return B.createElement("div",{className:Je(A==null?void 0:A.loader,u==null||(je=u.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":Ne==="loading"},E.loading)}return B.createElement(Bc,{className:Je(A==null?void 0:A.loader,u==null||(le=u.classNames)==null?void 0:le.loader),visible:Ne==="loading"})}const ft=u.icon||(E==null?void 0:E[Ne])||zc(Ne);var it,lt;return B.createElement("li",{tabIndex:0,ref:ue,className:Je(L,nt,A==null?void 0:A.toast,u==null||(t=u.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[Ne],u==null||(r=u.classNames)==null?void 0:r[Ne]),"data-sonner-toast":"","data-rich-colors":(it=u.richColors)!=null?it:R,"data-styled":!(u.jsx||u.unstyled||m),"data-mounted":I,"data-promise":!!u.promise,"data-swiped":ie,"data-removed":U,"data-visible":He,"data-y-position":at,"data-x-position":kt,"data-index":b,"data-front":Fe,"data-swiping":X,"data-dismissible":Te,"data-type":Ne,"data-invert":re,"data-swipe-out":ae,"data-swipe-direction":G,"data-expanded":!!(j||z&&I),"data-testid":u.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${U?H:Ee.current}px`,"--initial-height":z?"auto":`${me}px`,...C,...u.style},onDragEnd:()=>{Y(!1),q(null),Ge.current=null},onPointerDown:le=>{le.button!==2&&(we||!Te||(Re.current=new Date,ne(Ee.current),le.target.setPointerCapture(le.pointerId),le.target.tagName!=="BUTTON"&&(Y(!0),Ge.current={x:le.clientX,y:le.clientY})))},onPointerUp:()=>{var le,je,Ce;if(ae||!Te)return;Ge.current=null;const De=Number(((le=ue.current)==null?void 0:le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Yt=Number(((je=ue.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Me=new Date().getTime()-((Ce=Re.current)==null?void 0:Ce.getTime()),qe=W==="x"?De:Yt,Zt=Math.abs(qe)/Me;if(Math.abs(qe)>=ad||Zt>.11){ne(Ee.current),u.onDismiss==null||u.onDismiss.call(u,u),Z(W==="x"?De>0?"right":"left":Yt>0?"down":"up"),Pe(),te(!0);return}else{var We,Ue;(We=ue.current)==null||We.style.setProperty("--swipe-amount-x","0px"),(Ue=ue.current)==null||Ue.style.setProperty("--swipe-amount-y","0px")}K(!1),Y(!1),q(null)},onPointerMove:le=>{var je,Ce,De;if(!Ge.current||!Te||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;const Me=le.clientY-Ge.current.y,qe=le.clientX-Ge.current.x;var Zt;const We=(Zt=e.swipeDirections)!=null?Zt:ld($);!W&&(Math.abs(qe)>1||Math.abs(Me)>1)&&q(Math.abs(qe)>Math.abs(Me)?"x":"y");let Ue={x:0,y:0};const Ln=gt=>1/(1.5+Math.abs(gt)/20);if(W==="y"){if(We.includes("top")||We.includes("bottom"))if(We.includes("top")&&Me<0||We.includes("bottom")&&Me>0)Ue.y=Me;else{const gt=Me*Ln(Me);Ue.y=Math.abs(gt)<Math.abs(Me)?gt:Me}}else if(W==="x"&&(We.includes("left")||We.includes("right")))if(We.includes("left")&&qe<0||We.includes("right")&&qe>0)Ue.x=qe;else{const gt=qe*Ln(qe);Ue.x=Math.abs(gt)<Math.abs(qe)?gt:qe}(Math.abs(Ue.x)>0||Math.abs(Ue.y)>0)&&K(!0),(Ce=ue.current)==null||Ce.style.setProperty("--swipe-amount-x",`${Ue.x}px`),(De=ue.current)==null||De.style.setProperty("--swipe-amount-y",`${Ue.y}px`)}},st&&!u.jsx&&Ne!=="loading"?B.createElement("button",{"aria-label":N,"data-disabled":we,"data-close-button":!0,onClick:we||!Te?()=>{}:()=>{Pe(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Je(A==null?void 0:A.closeButton,u==null||(o=u.classNames)==null?void 0:o.closeButton)},(lt=E==null?void 0:E.close)!=null?lt:Wc):null,(Ne||u.icon||u.promise)&&u.icon!==null&&((E==null?void 0:E[Ne])!==null||u.icon)?B.createElement("div",{"data-icon":"",className:Je(A==null?void 0:A.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||et():null,u.type!=="loading"?ft:null):null,B.createElement("div",{"data-content":"",className:Je(A==null?void 0:A.content,u==null||(a=u.classNames)==null?void 0:a.content)},B.createElement("div",{"data-title":"",className:Je(A==null?void 0:A.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?B.createElement("div",{"data-description":"",className:Je(V,jt,A==null?void 0:A.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),B.isValidElement(u.cancel)?u.cancel:u.cancel&&tr(u.cancel)?B.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||S,onClick:le=>{tr(u.cancel)&&Te&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,le),Pe())},className:Je(A==null?void 0:A.cancelButton,u==null||(d=u.classNames)==null?void 0:d.cancelButton)},u.cancel.label):null,B.isValidElement(u.action)?u.action:u.action&&tr(u.action)?B.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||T,onClick:le=>{tr(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,le),!le.defaultPrevented&&Pe())},className:Je(A==null?void 0:A.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function On(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function dd(e,t){const r={};return[e,t].forEach((o,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?nd:rd;function d(c){["top","right","bottom","left"].forEach(p=>{r[`${i}-${p}`]=typeof c=="number"?`${c}px`:c})}typeof o=="number"||typeof o=="string"?d(o):typeof o=="object"?["top","right","bottom","left"].forEach(c=>{o[c]===void 0?r[`${i}-${c}`]=l:r[`${i}-${c}`]=typeof o[c]=="number"?`${o[c]}px`:o[c]}):d(l)}),r}const ud=B.forwardRef(function(t,r){const{id:o,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:d,className:c,offset:p,mobileOffset:u,theme:m="light",richColors:g,duration:h,style:x,visibleToasts:y=td,toastOptions:b,dir:w=On(),gap:j=sd,icons:M,containerAriaLabel:R="Notifications"}=t,[_,C]=B.useState([]),S=B.useMemo(()=>o?_.filter(I=>I.toasterId===o):_.filter(I=>!I.toasterId),[_,o]),T=B.useMemo(()=>Array.from(new Set([a].concat(S.filter(I=>I.position).map(I=>I.position)))),[S,a]),[L,V]=B.useState([]),[O,$]=B.useState(!1),[k,z]=B.useState(!1),[A,E]=B.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=B.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=B.useRef(null),G=B.useRef(!1),Z=B.useCallback(I=>{C(F=>{var U;return(U=F.find(ee=>ee.id===I.id))!=null&&U.delete||Ve.dismiss(I.id),F.filter(({id:ee})=>ee!==I.id)})},[]);return B.useEffect(()=>Ve.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{C(F=>F.map(U=>U.id===I.id?{...U,delete:!0}:U))});return}setTimeout(()=>{qr.flushSync(()=>{C(F=>{const U=F.findIndex(ee=>ee.id===I.id);return U!==-1?[...F.slice(0,U),{...F[U],...I},...F.slice(U+1)]:[I,...F]})})})}),[_]),B.useEffect(()=>{if(m!=="system"){E(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:F})=>{E(F?"dark":"light")})}catch{I.addListener(({matches:U})=>{try{E(U?"dark":"light")}catch(ee){console.error(ee)}})}},[m]),B.useEffect(()=>{_.length<=1&&$(!1)},[_]),B.useEffect(()=>{const I=F=>{var U;if(i.every(Y=>F[Y]||F.code===Y)){var X;$(!0),(X=N.current)==null||X.focus()}F.code==="Escape"&&(document.activeElement===N.current||(U=N.current)!=null&&U.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[i]),B.useEffect(()=>{if(N.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,G.current=!1)}},[N.current]),B.createElement("section",{ref:r,"aria-label":`${R} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((I,F)=>{var U;const[ee,X]=I.split("-");return S.length?B.createElement("ol",{key:I,dir:w==="auto"?On():w,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":ee,"data-x-position":X,style:{"--front-toast-height":`${((U=L[0])==null?void 0:U.height)||0}px`,"--width":`${od}px`,"--gap":`${j}px`,...x,...dd(p,u)},onBlur:Y=>{G.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(G.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||G.current||(G.current=!0,q.current=Y.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{k||$(!1)},onDragEnd:()=>$(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},S.filter(Y=>!Y.position&&F===0||Y.position===I).map((Y,ae)=>{var te,ie;return B.createElement(cd,{key:Y.id,icons:M,index:ae,toast:Y,defaultRichColors:g,duration:(te=b==null?void 0:b.duration)!=null?te:h,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:y,closeButton:(ie=b==null?void 0:b.closeButton)!=null?ie:d,interacting:k,position:I,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:Z,toasts:S.filter(K=>K.position==Y.position),heights:L.filter(K=>K.position==Y.position),setHeights:V,expandByDefault:l,gap:j,expanded:O,swipeDirections:t.swipeDirections})})):null}))}),Nr=["light","dark","system"];function md(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Hn(e){return e==="system"?md():e}function fd(e){if(typeof document>"u")return()=>{};const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*, *::before, *::after { transition: none !important; animation: none !important; }")),document.head.appendChild(t),window.getComputedStyle(document.body),()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{document.head.removeChild(t)})})}}function gd(e,t){const r=document.documentElement;t==="class"?(r.classList.remove("light","dark"),r.classList.add(e)):r.setAttribute("data-theme",e)}const Xs=B.createContext(void 0);function pd({children:e,defaultTheme:t="system",storageKey:r="nui-theme",attribute:o="class",enableSystem:s=!0,disableTransitionOnChange:a=!1,forcedTheme:i,nonce:l}){const[d,c]=B.useState(()=>{if(typeof window>"u")return t;const b=localStorage.getItem(r);return b&&Nr.includes(b)?b:t}),[p,u]=B.useState(()=>Hn(i??d)),m=B.useRef(d);m.current=d;const g=B.useCallback(()=>{const b=i??m.current,w=Hn(b);u(w);let j;a&&(j=fd(l)),gd(w,o),j==null||j()},[i,o,a,l]);B.useEffect(()=>{g()},[d,i,g]),B.useEffect(()=>{if(!s)return;const b=window.matchMedia("(prefers-color-scheme: dark)"),w=()=>{(i??m.current)==="system"&&g()};return b.addEventListener("change",w),()=>b.removeEventListener("change",w)},[s,i,g]),B.useEffect(()=>{const b=w=>{if(w.key===r&&w.newValue){const j=w.newValue;Nr.includes(j)&&c(j)}};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[r]);const h=B.useCallback(b=>{!s&&b==="system"||(localStorage.setItem(r,b),c(b))},[r,s]),x=B.useMemo(()=>s?Nr:["light","dark"],[s]),y=B.useMemo(()=>({theme:i??d,resolvedTheme:p,setTheme:h,themes:x}),[i,d,p,h,x]);return n.jsx(Xs.Provider,{value:y,children:e})}function gr(){const e=B.useContext(Xs);if(e===void 0)throw new Error("useTheme must be used within a <ThemeProvider>");return e}const hd=({theme:e,...t})=>{let r=e;try{const{resolvedTheme:o}=gr();e||(r=o)}catch{r||(r="system")}return n.jsx(ud,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};function xd({icon:e,title:t,description:r,action:o,className:s}){return n.jsxs("div",{className:v("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[e&&n.jsx("div",{className:"mb-4 text-muted-foreground",children:e}),n.jsx("h3",{className:"text-lg font-semibold",children:t}),r&&n.jsx("p",{className:"mt-1 text-sm text-muted-foreground max-w-sm",children:r}),o&&n.jsx("div",{className:"mt-4",children:o})]})}const Ys=f.forwardRef(({...e},t)=>n.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Ys.displayName="Breadcrumb";const Zs=f.forwardRef(({className:e,...t},r)=>n.jsx("ol",{ref:r,className:v("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Zs.displayName="BreadcrumbList";const Js=f.forwardRef(({className:e,...t},r)=>n.jsx("li",{ref:r,className:v("inline-flex items-center gap-1.5",e),...t}));Js.displayName="BreadcrumbItem";const Qs=f.forwardRef(({asChild:e,className:t,...r},o)=>{const s=e?ro.Slot:"a";return n.jsx(s,{ref:o,className:v("transition-colors hover:text-foreground",t),...r})});Qs.displayName="BreadcrumbLink";const ea=f.forwardRef(({className:e,...t},r)=>n.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:v("font-normal text-foreground",e),...t}));ea.displayName="BreadcrumbPage";const ta=({children:e,className:t,...r})=>n.jsx("li",{role:"presentation","aria-hidden":"true",className:v("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...r,children:e??n.jsx(P.ChevronRight,{})});ta.displayName="BreadcrumbSeparator";const ra=({className:e,...t})=>{const r=ce();return n.jsxs("span",{role:"presentation","aria-hidden":"true",className:v("flex h-9 w-9 items-center justify-center",e),...t,children:[n.jsx("span",{className:"h-4 w-4",children:"..."}),n.jsx("span",{className:"sr-only",children:r.breadcrumb_more})]})};ra.displayName="BreadcrumbEllipsis";const na=({className:e,...t})=>n.jsx("nav",{role:"navigation","aria-label":"pagination",className:v("mx-auto flex w-full justify-center",e),...t});na.displayName="Pagination";const oa=f.forwardRef(({className:e,...t},r)=>n.jsx("ul",{ref:r,className:v("flex flex-row items-center gap-1",e),...t}));oa.displayName="PaginationContent";const sa=f.forwardRef(({className:e,...t},r)=>n.jsx("li",{ref:r,className:v("",e),...t}));sa.displayName="PaginationItem";const pr=({className:e,isActive:t,size:r="icon",...o})=>n.jsx("a",{"aria-current":t?"page":void 0,className:v(Ut({variant:t?"outline":"ghost",size:r}),e),...o});pr.displayName="PaginationLink";const aa=({className:e,...t})=>{const r=ce();return n.jsxs(pr,{"aria-label":r.pagination_goToPrevious,size:"default",className:v("gap-1 pl-2.5",e),...t,children:[n.jsx(P.ChevronLeft,{className:"h-4 w-4"}),n.jsx("span",{children:r.pagination_previous})]})};aa.displayName="PaginationPrevious";const ia=({className:e,...t})=>{const r=ce();return n.jsxs(pr,{"aria-label":r.pagination_goToNext,size:"default",className:v("gap-1 pr-2.5",e),...t,children:[n.jsx("span",{children:r.pagination_next}),n.jsx(P.ChevronRight,{className:"h-4 w-4"})]})};ia.displayName="PaginationNext";const la=({className:e,...t})=>{const r=ce();return n.jsxs("span",{"aria-hidden":!0,className:v("flex h-9 w-9 items-center justify-center",e),...t,children:[n.jsx(P.MoreHorizontal,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:r.pagination_morePages})]})};la.displayName="PaginationEllipsis";function vd({steps:e,activeStep:t,orientation:r="horizontal",className:o}){return n.jsx("div",{className:v("flex",r==="vertical"?"flex-col":"flex-row items-center",o),children:e.map((s,a)=>{const i=a<t,l=a===t,d=a===e.length-1;return n.jsxs(f.Fragment,{children:[n.jsxs("div",{className:v("flex items-center",r==="vertical"&&"flex-row"),children:[n.jsx("div",{className:v("flex h-10 w-10 items-center justify-center rounded-full border-2 font-semibold transition-colors",i&&"border-primary bg-primary text-primary-foreground",l&&"border-primary text-primary",!i&&!l&&"border-muted-foreground/30 text-muted-foreground"),children:i?n.jsx(P.Check,{className:"h-5 w-5"}):a+1}),n.jsxs("div",{className:v("ml-3",r==="horizontal"&&"hidden sm:block"),children:[n.jsx("p",{className:v("text-sm font-medium",l&&"text-foreground",!l&&"text-muted-foreground"),children:s.title}),s.description&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]})]}),!d&&n.jsx("div",{className:v("flex-1",r==="horizontal"?"mx-4 h-0.5 min-w-[3rem]":"ml-5 my-2 w-0.5 min-h-[2rem]",i?"bg-primary":"bg-muted-foreground/30")})]},a)})})}const ca=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(Be.Root,{ref:o,className:v("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n.jsx(wn,{})]}));ca.displayName=Be.Root.displayName;const da=f.forwardRef(({className:e,...t},r)=>n.jsx(Be.List,{ref:r,className:v("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));da.displayName=Be.List.displayName;const bd=Be.Item,ua=Le("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),ma=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(Be.Trigger,{ref:o,className:v(ua(),"group",e),...r,children:[t," ",n.jsx(P.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));ma.displayName=Be.Trigger.displayName;const fa=f.forwardRef(({className:e,...t},r)=>n.jsx(Be.Content,{ref:r,className:v("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));fa.displayName=Be.Content.displayName;const wd=Be.Link,wn=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{className:v("absolute left-0 top-full flex justify-center"),children:n.jsx(Be.Viewport,{className:v("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));wn.displayName=Be.Viewport.displayName;const ga=f.forwardRef(({className:e,...t},r)=>n.jsx(Be.Indicator,{ref:r,className:v("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:n.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));ga.displayName=Be.Indicator.displayName;const yd=he.Root,jd=he.Trigger,Nd=he.Group,kd=he.Portal,Cd=he.Sub,Sd=he.RadioGroup,pa=f.forwardRef(({className:e,inset:t,children:r,...o},s)=>n.jsxs(he.SubTrigger,{ref:s,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[r,n.jsx(P.ChevronRight,{className:"ml-auto h-4 w-4"})]}));pa.displayName=he.SubTrigger.displayName;const ha=f.forwardRef(({className:e,...t},r)=>n.jsx(he.SubContent,{ref:r,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));ha.displayName=he.SubContent.displayName;const xa=f.forwardRef(({className:e,...t},r)=>n.jsx(he.Portal,{children:n.jsx(he.Content,{ref:r,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));xa.displayName=he.Content.displayName;const va=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(he.Item,{ref:o,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));va.displayName=he.Item.displayName;const ba=f.forwardRef(({className:e,children:t,checked:r,...o},s)=>n.jsxs(he.CheckboxItem,{ref:s,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(he.ItemIndicator,{children:n.jsx(P.Check,{className:"h-4 w-4"})})}),t]}));ba.displayName=he.CheckboxItem.displayName;const wa=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(he.RadioItem,{ref:o,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(he.ItemIndicator,{children:n.jsx(P.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));wa.displayName=he.RadioItem.displayName;const ya=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(he.Label,{ref:o,className:v("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));ya.displayName=he.Label.displayName;const ja=f.forwardRef(({className:e,...t},r)=>n.jsx(he.Separator,{ref:r,className:v("-mx-1 my-1 h-px bg-border",e),...t}));ja.displayName=he.Separator.displayName;const Na=({className:e,...t})=>n.jsx("span",{className:v("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Na.displayName="ContextMenuShortcut";const Rd=ur.Root,_d=ur.Trigger,ka=f.forwardRef(({className:e,align:t="center",sideOffset:r=4,...o},s)=>n.jsx(ur.Content,{ref:s,align:t,sideOffset:r,className:v("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));ka.displayName=ur.Content.displayName;function Md(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gn(e){return Md(e)||Array.isArray(e)}function Pd(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function yn(e,t){const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),a=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==a?!1:r.every(i=>{const l=e[i],d=t[i];return typeof l=="function"?`${l}`==`${d}`:!Gn(l)||!Gn(d)?l===d:yn(l,d)})}function qn(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function Id(e,t){if(e.length!==t.length)return!1;const r=qn(e),o=qn(t);return r.every((s,a)=>{const i=o[a];return yn(s,i)})}function jn(e){return typeof e=="number"}function Fr(e){return typeof e=="string"}function hr(e){return typeof e=="boolean"}function Wn(e){return Object.prototype.toString.call(e)==="[object Object]"}function be(e){return Math.abs(e)}function Nn(e){return Math.sign(e)}function Vt(e,t){return be(e-t)}function Ld(e,t){if(e===0||t===0||be(e)<=be(t))return 0;const r=Vt(be(e),be(t));return be(r/e)}function Td(e){return Math.round(e*100)/100}function Ht(e){return Gt(e).map(Number)}function Xe(e){return e[Kt(e)]}function Kt(e){return Math.max(0,e.length-1)}function kn(e,t){return t===Kt(e)}function Un(e,t=0){return Array.from(Array(e),(r,o)=>t+o)}function Gt(e){return Object.keys(e)}function Ca(e,t){return[e,t].reduce((r,o)=>(Gt(o).forEach(s=>{const a=r[s],i=o[s],l=Wn(a)&&Wn(i);r[s]=l?Ca(a,i):i}),r),{})}function Vr(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function Ed(e,t){const r={start:o,center:s,end:a};function o(){return 0}function s(d){return a(d)/2}function a(d){return t-d}function i(d,c){return Fr(e)?r[e](d):e(t,d,c)}return{measure:i}}function qt(){let e=[];function t(s,a,i,l={passive:!0}){let d;if("addEventListener"in s)s.addEventListener(a,i,l),d=()=>s.removeEventListener(a,i,l);else{const c=s;c.addListener(i),d=()=>c.removeListener(i)}return e.push(d),o}function r(){e=e.filter(s=>s())}const o={add:t,clear:r};return o}function Dd(e,t,r,o){const s=qt(),a=1e3/60;let i=null,l=0,d=0;function c(){s.add(e,"visibilitychange",()=>{e.hidden&&h()})}function p(){g(),s.clear()}function u(y){if(!d)return;i||(i=y,r(),r());const b=y-i;for(i=y,l+=b;l>=a;)r(),l-=a;const w=l/a;o(w),d&&(d=t.requestAnimationFrame(u))}function m(){d||(d=t.requestAnimationFrame(u))}function g(){t.cancelAnimationFrame(d),i=null,l=0,d=0}function h(){i=null,l=0}return{init:c,destroy:p,start:m,stop:g,update:r,render:o}}function Ad(e,t){const r=t==="rtl",o=e==="y",s=o?"y":"x",a=o?"x":"y",i=!o&&r?-1:1,l=p(),d=u();function c(h){const{height:x,width:y}=h;return o?x:y}function p(){return o?"top":r?"right":"left"}function u(){return o?"bottom":r?"left":"right"}function m(h){return h*i}return{scroll:s,cross:a,startEdge:l,endEdge:d,measureSize:c,direction:m}}function bt(e=0,t=0){const r=be(e-t);function o(c){return c<e}function s(c){return c>t}function a(c){return o(c)||s(c)}function i(c){return a(c)?o(c)?e:t:c}function l(c){return r?c-r*Math.ceil((c-t)/r):c}return{length:r,max:t,min:e,constrain:i,reachedAny:a,reachedMax:s,reachedMin:o,removeOffset:l}}function Sa(e,t,r){const{constrain:o}=bt(0,e),s=e+1;let a=i(t);function i(m){return r?be((s+m)%s):o(m)}function l(){return a}function d(m){return a=i(m),u}function c(m){return p().set(l()+m)}function p(){return Sa(e,l(),r)}const u={get:l,set:d,add:c,clone:p};return u}function Fd(e,t,r,o,s,a,i,l,d,c,p,u,m,g,h,x,y,b,w){const{cross:j,direction:M}=e,R=["INPUT","SELECT","TEXTAREA"],_={passive:!1},C=qt(),S=qt(),T=bt(50,225).constrain(g.measure(20)),L={mouse:300,touch:400},V={mouse:500,touch:600},O=h?43:25;let $=!1,k=0,z=0,A=!1,E=!1,N=!1,W=!1;function q(K){if(!w)return;function H(me){(hr(w)||w(K,me))&&ee(me)}const ne=t;C.add(ne,"dragstart",me=>me.preventDefault(),_).add(ne,"touchmove",()=>{},_).add(ne,"touchend",()=>{}).add(ne,"touchstart",H).add(ne,"mousedown",H).add(ne,"touchcancel",Y).add(ne,"contextmenu",Y).add(ne,"click",ae,!0)}function G(){C.clear(),S.clear()}function Z(){const K=W?r:t;S.add(K,"touchmove",X,_).add(K,"touchend",Y).add(K,"mousemove",X,_).add(K,"mouseup",Y)}function I(K){const H=K.nodeName||"";return R.includes(H)}function F(){return(h?V:L)[W?"mouse":"touch"]}function U(K,H){const ne=u.add(Nn(K)*-1),me=p.byDistance(K,!h).distance;return h||be(K)<T?me:y&&H?me*.5:p.byIndex(ne.get(),0).distance}function ee(K){const H=Vr(K,o);W=H,N=h&&H&&!K.buttons&&$,$=Vt(s.get(),i.get())>=2,!(H&&K.button!==0)&&(I(K.target)||(A=!0,a.pointerDown(K),c.useFriction(0).useDuration(0),s.set(i),Z(),k=a.readPoint(K),z=a.readPoint(K,j),m.emit("pointerDown")))}function X(K){if(!Vr(K,o)&&K.touches.length>=2)return Y(K);const ne=a.readPoint(K),me=a.readPoint(K,j),ve=Vt(ne,k),fe=Vt(me,z);if(!E&&!W&&(!K.cancelable||(E=ve>fe,!E)))return Y(K);const Re=a.pointerMove(K);ve>x&&(N=!0),c.useFriction(.3).useDuration(.75),l.start(),s.add(M(Re)),K.preventDefault()}function Y(K){const ne=p.byDistance(0,!1).index!==u.get(),me=a.pointerUp(K)*F(),ve=U(M(me),ne),fe=Ld(me,ve),Re=O-10*fe,ue=b+fe/50;E=!1,A=!1,S.clear(),c.useDuration(Re).useFriction(ue),d.distance(ve,!h),W=!1,m.emit("pointerUp")}function ae(K){N&&(K.stopPropagation(),K.preventDefault(),N=!1)}function te(){return A}return{init:q,destroy:G,pointerDown:te}}function Vd(e,t){let o,s;function a(u){return u.timeStamp}function i(u,m){const h=`client${(m||e.scroll)==="x"?"X":"Y"}`;return(Vr(u,t)?u:u.touches[0])[h]}function l(u){return o=u,s=u,i(u)}function d(u){const m=i(u)-i(s),g=a(u)-a(o)>170;return s=u,g&&(o=u),m}function c(u){if(!o||!s)return 0;const m=i(s)-i(o),g=a(u)-a(o),h=a(u)-a(s)>170,x=m/g;return g&&!h&&be(x)>.1?x:0}return{pointerDown:l,pointerMove:d,pointerUp:c,readPoint:i}}function zd(){function e(r){const{offsetTop:o,offsetLeft:s,offsetWidth:a,offsetHeight:i}=r;return{top:o,right:s+a,bottom:o+i,left:s,width:a,height:i}}return{measure:e}}function $d(e){function t(o){return e*(o/100)}return{measure:t}}function Bd(e,t,r,o,s,a,i){const l=[e].concat(o);let d,c,p=[],u=!1;function m(y){return s.measureSize(i.measure(y))}function g(y){if(!a)return;c=m(e),p=o.map(m);function b(w){for(const j of w){if(u)return;const M=j.target===e,R=o.indexOf(j.target),_=M?c:p[R],C=m(M?e:o[R]);if(be(C-_)>=.5){y.reInit(),t.emit("resize");break}}}d=new ResizeObserver(w=>{(hr(a)||a(y,w))&&b(w)}),r.requestAnimationFrame(()=>{l.forEach(w=>d.observe(w))})}function h(){u=!0,d&&d.disconnect()}return{init:g,destroy:h}}function Od(e,t,r,o,s,a){let i=0,l=0,d=s,c=a,p=e.get(),u=0;function m(){const _=o.get()-e.get(),C=!d;let S=0;return C?(i=0,r.set(o),e.set(o),S=_):(r.set(e),i+=_/d,i*=c,p+=i,e.add(i),S=p-u),l=Nn(S),u=p,R}function g(){const _=o.get()-t.get();return be(_)<.001}function h(){return d}function x(){return l}function y(){return i}function b(){return j(s)}function w(){return M(a)}function j(_){return d=_,R}function M(_){return c=_,R}const R={direction:x,duration:h,velocity:y,seek:m,settled:g,useBaseFriction:w,useBaseDuration:b,useFriction:M,useDuration:j};return R}function Hd(e,t,r,o,s){const a=s.measure(10),i=s.measure(50),l=bt(.1,.99);let d=!1;function c(){return!(d||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}function p(g){if(!c())return;const h=e.reachedMin(t.get())?"min":"max",x=be(e[h]-t.get()),y=r.get()-t.get(),b=l.constrain(x/i);r.subtract(y*b),!g&&be(y)<a&&(r.set(e.constrain(r.get())),o.useDuration(25).useBaseFriction())}function u(g){d=!g}return{shouldConstrain:c,constrain:p,toggleActive:u}}function Gd(e,t,r,o,s){const a=bt(-t+e,0),i=u(),l=p(),d=m();function c(h,x){return Vt(h,x)<=1}function p(){const h=i[0],x=Xe(i),y=i.lastIndexOf(h),b=i.indexOf(x)+1;return bt(y,b)}function u(){return r.map((h,x)=>{const{min:y,max:b}=a,w=a.constrain(h),j=!x,M=kn(r,x);return j?b:M||c(y,w)?y:c(b,w)?b:w}).map(h=>parseFloat(h.toFixed(3)))}function m(){if(t<=e+s)return[a.max];if(o==="keepSnaps")return i;const{min:h,max:x}=l;return i.slice(h,x)}return{snapsContained:d,scrollContainLimit:l}}function qd(e,t,r){const o=t[0],s=r?o-e:Xe(t);return{limit:bt(s,o)}}function Wd(e,t,r,o){const a=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:d}=bt(a,i);function c(m){return m===1?d(r.get()):m===-1?l(r.get()):!1}function p(m){if(!c(m))return;const g=e*(m*-1);o.forEach(h=>h.add(g))}return{loop:p}}function Ud(e){const{max:t,length:r}=e;function o(a){const i=a-t;return r?i/-r:0}return{get:o}}function Kd(e,t,r,o,s){const{startEdge:a,endEdge:i}=e,{groupSlides:l}=s,d=u().map(t.measure),c=m(),p=g();function u(){return l(o).map(x=>Xe(x)[i]-x[0][a]).map(be)}function m(){return o.map(x=>r[a]-x[a]).map(x=>-be(x))}function g(){return l(c).map(x=>x[0]).map((x,y)=>x+d[y])}return{snaps:c,snapsAligned:p}}function Xd(e,t,r,o,s,a){const{groupSlides:i}=s,{min:l,max:d}=o,c=p();function p(){const m=i(a),g=!e||t==="keepSnaps";return r.length===1?[a]:g?m:m.slice(l,d).map((h,x,y)=>{const b=!x,w=kn(y,x);if(b){const j=Xe(y[0])+1;return Un(j)}if(w){const j=Kt(a)-Xe(y)[0]+1;return Un(j,Xe(y)[0])}return h})}return{slideRegistry:c}}function Yd(e,t,r,o,s){const{reachedAny:a,removeOffset:i,constrain:l}=o;function d(h){return h.concat().sort((x,y)=>be(x)-be(y))[0]}function c(h){const x=e?i(h):l(h),y=t.map((w,j)=>({diff:p(w-x,0),index:j})).sort((w,j)=>be(w.diff)-be(j.diff)),{index:b}=y[0];return{index:b,distance:x}}function p(h,x){const y=[h,h+r,h-r];if(!e)return h;if(!x)return d(y);const b=y.filter(w=>Nn(w)===x);return b.length?d(b):Xe(y)-r}function u(h,x){const y=t[h]-s.get(),b=p(y,x);return{index:h,distance:b}}function m(h,x){const y=s.get()+h,{index:b,distance:w}=c(y),j=!e&&a(y);if(!x||j)return{index:b,distance:h};const M=t[b]-w,R=h+p(M,0);return{index:b,distance:R}}return{byDistance:m,byIndex:u,shortcut:p}}function Zd(e,t,r,o,s,a,i){function l(u){const m=u.distance,g=u.index!==t.get();a.add(m),m&&(o.duration()?e.start():(e.update(),e.render(1),e.update())),g&&(r.set(t.get()),t.set(u.index),i.emit("select"))}function d(u,m){const g=s.byDistance(u,m);l(g)}function c(u,m){const g=t.clone().set(u),h=s.byIndex(g.get(),m);l(h)}return{distance:d,index:c}}function Jd(e,t,r,o,s,a,i,l){const d={passive:!0,capture:!0};let c=0;function p(g){if(!l)return;function h(x){if(new Date().getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const w=r.findIndex(j=>j.includes(x));jn(w)&&(s.useDuration(0),o.index(w,0),i.emit("slideFocus"))}a.add(document,"keydown",u,!1),t.forEach((x,y)=>{a.add(x,"focus",b=>{(hr(l)||l(g,b))&&h(y)},d)})}function u(g){g.code==="Tab"&&(c=new Date().getTime())}return{init:p}}function Dt(e){let t=e;function r(){return t}function o(d){t=i(d)}function s(d){t+=i(d)}function a(d){t-=i(d)}function i(d){return jn(d)?d:d.get()}return{get:r,set:o,add:s,subtract:a}}function Ra(e,t){const r=e.scroll==="x"?i:l,o=t.style;let s=null,a=!1;function i(m){return`translate3d(${m}px,0px,0px)`}function l(m){return`translate3d(0px,${m}px,0px)`}function d(m){if(a)return;const g=Td(e.direction(m));g!==s&&(o.transform=r(g),s=g)}function c(m){a=!m}function p(){a||(o.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:p,to:d,toggleActive:c}}function Qd(e,t,r,o,s,a,i,l,d){const p=Ht(s),u=Ht(s).reverse(),m=b().concat(w());function g(C,S){return C.reduce((T,L)=>T-s[L],S)}function h(C,S){return C.reduce((T,L)=>g(T,S)>0?T.concat([L]):T,[])}function x(C){return a.map((S,T)=>({start:S-o[T]+.5+C,end:S+t-.5+C}))}function y(C,S,T){const L=x(S);return C.map(V=>{const O=T?0:-r,$=T?r:0,k=T?"end":"start",z=L[V][k];return{index:V,loopPoint:z,slideLocation:Dt(-1),translate:Ra(e,d[V]),target:()=>l.get()>z?O:$}})}function b(){const C=i[0],S=h(u,C);return y(S,r,!1)}function w(){const C=t-i[0]-1,S=h(p,C);return y(S,-r,!0)}function j(){return m.every(({index:C})=>{const S=p.filter(T=>T!==C);return g(S,t)<=.1})}function M(){m.forEach(C=>{const{target:S,translate:T,slideLocation:L}=C,V=S();V!==L.get()&&(T.to(V),L.set(V))})}function R(){m.forEach(C=>C.translate.clear())}return{canLoop:j,clear:R,loop:M,loopPoints:m}}function eu(e,t,r){let o,s=!1;function a(d){if(!r)return;function c(p){for(const u of p)if(u.type==="childList"){d.reInit(),t.emit("slidesChanged");break}}o=new MutationObserver(p=>{s||(hr(r)||r(d,p))&&c(p)}),o.observe(e,{childList:!0})}function i(){o&&o.disconnect(),s=!0}return{init:a,destroy:i}}function tu(e,t,r,o){const s={};let a=null,i=null,l,d=!1;function c(){l=new IntersectionObserver(h=>{d||(h.forEach(x=>{const y=t.indexOf(x.target);s[y]=x}),a=null,i=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:o}),t.forEach(h=>l.observe(h))}function p(){l&&l.disconnect(),d=!0}function u(h){return Gt(s).reduce((x,y)=>{const b=parseInt(y),{isIntersecting:w}=s[b];return(h&&w||!h&&!w)&&x.push(b),x},[])}function m(h=!0){if(h&&a)return a;if(!h&&i)return i;const x=u(h);return h&&(a=x),h||(i=x),x}return{init:c,destroy:p,get:m}}function ru(e,t,r,o,s,a){const{measureSize:i,startEdge:l,endEdge:d}=e,c=r[0]&&s,p=h(),u=x(),m=r.map(i),g=y();function h(){if(!c)return 0;const w=r[0];return be(t[l]-w[l])}function x(){if(!c)return 0;const w=a.getComputedStyle(Xe(o));return parseFloat(w.getPropertyValue(`margin-${d}`))}function y(){return r.map((w,j,M)=>{const R=!j,_=kn(M,j);return R?m[j]+p:_?m[j]+u:M[j+1][l]-w[l]}).map(be)}return{slideSizes:m,slideSizesWithGaps:g,startGap:p,endGap:u}}function nu(e,t,r,o,s,a,i,l,d){const{startEdge:c,endEdge:p,direction:u}=e,m=jn(r);function g(b,w){return Ht(b).filter(j=>j%w===0).map(j=>b.slice(j,j+w))}function h(b){return b.length?Ht(b).reduce((w,j,M)=>{const R=Xe(w)||0,_=R===0,C=j===Kt(b),S=s[c]-a[R][c],T=s[c]-a[j][p],L=!o&&_?u(i):0,V=!o&&C?u(l):0,O=be(T-V-(S+L));return M&&O>t+d&&w.push(j),C&&w.push(b.length),w},[]).map((w,j,M)=>{const R=Math.max(M[j-1]||0);return b.slice(R,w)}):[]}function x(b){return m?g(b,r):h(b)}return{groupSlides:x}}function ou(e,t,r,o,s,a,i){const{align:l,axis:d,direction:c,startIndex:p,loop:u,duration:m,dragFree:g,dragThreshold:h,inViewThreshold:x,slidesToScroll:y,skipSnaps:b,containScroll:w,watchResize:j,watchSlides:M,watchDrag:R,watchFocus:_}=a,C=2,S=zd(),T=S.measure(t),L=r.map(S.measure),V=Ad(d,c),O=V.measureSize(T),$=$d(O),k=Ed(l,O),z=!u&&!!w,A=u||!!w,{slideSizes:E,slideSizesWithGaps:N,startGap:W,endGap:q}=ru(V,T,L,r,A,s),G=nu(V,O,y,u,T,L,W,q,C),{snaps:Z,snapsAligned:I}=Kd(V,k,T,L,G),F=-Xe(Z)+Xe(N),{snapsContained:U,scrollContainLimit:ee}=Gd(O,F,I,w,C),X=z?U:I,{limit:Y}=qd(F,X,u),ae=Sa(Kt(X),p,u),te=ae.clone(),ie=Ht(r),K=({dragHandler:Ee,scrollBody:Qe,scrollBounds:Ge,options:{loop:at}})=>{at||Ge.constrain(Ee.pointerDown()),Qe.seek()},H=({scrollBody:Ee,translate:Qe,location:Ge,offsetLocation:at,previousLocation:kt,scrollLooper:Ct,slideLooper:D,dragHandler:re,animation:we,eventHandler:Pe,scrollBounds:et,options:{loop:ft}},it)=>{const lt=Ee.settled(),le=!et.shouldConstrain(),je=ft?lt:lt&&le,Ce=je&&!re.pointerDown();Ce&&we.stop();const De=Ge.get()*it+kt.get()*(1-it);at.set(De),ft&&(Ct.loop(Ee.direction()),D.loop()),Qe.to(at.get()),Ce&&Pe.emit("settle"),je||Pe.emit("scroll")},ne=Dd(o,s,()=>K(Ze),Ee=>H(Ze,Ee)),me=.68,ve=X[ae.get()],fe=Dt(ve),Re=Dt(ve),ue=Dt(ve),Fe=Dt(ve),He=Od(fe,ue,Re,Fe,m,me),Ne=Yd(u,X,F,Y,Fe),Te=Zd(ne,ae,te,He,Ne,Fe,i),nt=Ud(Y),jt=qt(),ot=tu(t,r,i,x),{slideRegistry:st}=Xd(z,w,X,ee,G,ie),Nt=Jd(e,r,st,Te,He,jt,i,_),Ze={ownerDocument:o,ownerWindow:s,eventHandler:i,containerRect:T,slideRects:L,animation:ne,axis:V,dragHandler:Fd(V,e,o,s,Fe,Vd(V,s),fe,ne,Te,He,Ne,ae,i,$,g,h,b,me,R),eventStore:jt,percentOfView:$,index:ae,indexPrevious:te,limit:Y,location:fe,offsetLocation:ue,previousLocation:Re,options:a,resizeHandler:Bd(t,i,s,r,V,j,S),scrollBody:He,scrollBounds:Hd(Y,ue,Fe,He,$),scrollLooper:Wd(F,Y,ue,[fe,ue,Re,Fe]),scrollProgress:nt,scrollSnapList:X.map(nt.get),scrollSnaps:X,scrollTarget:Ne,scrollTo:Te,slideLooper:Qd(V,O,F,E,N,Z,X,ue,r),slideFocus:Nt,slidesHandler:eu(t,i,M),slidesInView:ot,slideIndexes:ie,slideRegistry:st,slidesToScroll:G,target:Fe,translate:Ra(V,t)};return Ze}function su(){let e={},t;function r(c){t=c}function o(c){return e[c]||[]}function s(c){return o(c).forEach(p=>p(t,c)),d}function a(c,p){return e[c]=o(c).concat([p]),d}function i(c,p){return e[c]=o(c).filter(u=>u!==p),d}function l(){e={}}const d={init:r,emit:s,off:i,on:a,clear:l};return d}const au={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function iu(e){function t(a,i){return Ca(a,i||{})}function r(a){const i=a.breakpoints||{},l=Gt(i).filter(d=>e.matchMedia(d).matches).map(d=>i[d]).reduce((d,c)=>t(d,c),{});return t(a,l)}function o(a){return a.map(i=>Gt(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:o}}function lu(e){let t=[];function r(a,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(a,e)),i.reduce((l,d)=>Object.assign(l,{[d.name]:d}),{})}function o(){t=t.filter(a=>a.destroy())}return{init:r,destroy:o}}function cr(e,t,r){const o=e.ownerDocument,s=o.defaultView,a=iu(s),i=lu(a),l=qt(),d=su(),{mergeOptions:c,optionsAtMedia:p,optionsMediaQueries:u}=a,{on:m,off:g,emit:h}=d,x=V;let y=!1,b,w=c(au,cr.globalOptions),j=c(w),M=[],R,_,C;function S(){const{container:ie,slides:K}=j;_=(Fr(ie)?e.querySelector(ie):ie)||e.children[0];const ne=Fr(K)?_.querySelectorAll(K):K;C=[].slice.call(ne||_.children)}function T(ie){const K=ou(e,_,C,o,s,ie,d);if(ie.loop&&!K.slideLooper.canLoop()){const H=Object.assign({},ie,{loop:!1});return T(H)}return K}function L(ie,K){y||(w=c(w,ie),j=p(w),M=K||M,S(),b=T(j),u([w,...M.map(({options:H})=>H)]).forEach(H=>l.add(H,"change",V)),j.active&&(b.translate.to(b.location.get()),b.animation.init(),b.slidesInView.init(),b.slideFocus.init(te),b.eventHandler.init(te),b.resizeHandler.init(te),b.slidesHandler.init(te),b.options.loop&&b.slideLooper.loop(),_.offsetParent&&C.length&&b.dragHandler.init(te),R=i.init(te,M)))}function V(ie,K){const H=G();O(),L(c({startIndex:H},ie),K),d.emit("reInit")}function O(){b.dragHandler.destroy(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),b.slidesInView.destroy(),b.animation.destroy(),i.destroy(),l.clear()}function $(){y||(y=!0,l.clear(),O(),d.emit("destroy"),d.clear())}function k(ie,K,H){!j.active||y||(b.scrollBody.useBaseFriction().useDuration(K===!0?0:j.duration),b.scrollTo.index(ie,H||0))}function z(ie){const K=b.index.add(1).get();k(K,ie,-1)}function A(ie){const K=b.index.add(-1).get();k(K,ie,1)}function E(){return b.index.add(1).get()!==G()}function N(){return b.index.add(-1).get()!==G()}function W(){return b.scrollSnapList}function q(){return b.scrollProgress.get(b.offsetLocation.get())}function G(){return b.index.get()}function Z(){return b.indexPrevious.get()}function I(){return b.slidesInView.get()}function F(){return b.slidesInView.get(!1)}function U(){return R}function ee(){return b}function X(){return e}function Y(){return _}function ae(){return C}const te={canScrollNext:E,canScrollPrev:N,containerNode:Y,internalEngine:ee,destroy:$,off:g,on:m,emit:h,plugins:U,previousScrollSnap:Z,reInit:x,rootNode:X,scrollNext:z,scrollPrev:A,scrollProgress:q,scrollSnapList:W,scrollTo:k,selectedScrollSnap:G,slideNodes:ae,slidesInView:I,slidesNotInView:F};return L(t,r),setTimeout(()=>d.emit("init"),0),te}cr.globalOptions=void 0;function Cn(e={},t=[]){const r=B.useRef(e),o=B.useRef(t),[s,a]=B.useState(),[i,l]=B.useState(),d=B.useCallback(()=>{s&&s.reInit(r.current,o.current)},[s]);return B.useEffect(()=>{yn(r.current,e)||(r.current=e,d())},[e,d]),B.useEffect(()=>{Id(o.current,t)||(o.current=t,d())},[t,d]),B.useEffect(()=>{if(Pd()&&i){cr.globalOptions=Cn.globalOptions;const c=cr(i,r.current,o.current);return a(c),()=>c.destroy()}else a(void 0)},[i,a]),[l,s]}Cn.globalOptions=void 0;const _a=f.createContext(null);function xr(){const e=f.useContext(_a);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const Ma=f.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,plugins:o,className:s,children:a,...i},l)=>{const[d,c]=Cn({...t,axis:e==="horizontal"?"x":"y"},o),[p,u]=f.useState(!1),[m,g]=f.useState(!1),h=f.useCallback(w=>{w&&(u(w.canScrollPrev()),g(w.canScrollNext()))},[]),x=f.useCallback(()=>{c==null||c.scrollPrev()},[c]),y=f.useCallback(()=>{c==null||c.scrollNext()},[c]),b=f.useCallback(w=>{w.key==="ArrowLeft"?(w.preventDefault(),x()):w.key==="ArrowRight"&&(w.preventDefault(),y())},[x,y]);return f.useEffect(()=>{!c||!r||r(c)},[c,r]),f.useEffect(()=>{if(c)return h(c),c.on("reInit",h),c.on("select",h),()=>{c==null||c.off("select",h)}},[c,h]),n.jsx(_a.Provider,{value:{carouselRef:d,api:c,opts:t,orientation:e,scrollPrev:x,scrollNext:y,canScrollPrev:p,canScrollNext:m},children:n.jsx("div",{ref:l,onKeyDownCapture:b,className:v("relative",s),role:"region","aria-roledescription":"carousel",...i,children:a})})});Ma.displayName="Carousel";const Pa=f.forwardRef(({className:e,...t},r)=>{const{carouselRef:o,orientation:s}=xr();return n.jsx("div",{ref:o,className:"overflow-hidden",children:n.jsx("div",{ref:r,className:v("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Pa.displayName="CarouselContent";const Ia=f.forwardRef(({className:e,...t},r)=>{const{orientation:o}=xr();return n.jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:v("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});Ia.displayName="CarouselItem";const La=f.forwardRef(({className:e,variant:t="outline",size:r="icon",...o},s)=>{const{orientation:a,scrollPrev:i,canScrollPrev:l}=xr(),d=ce();return n.jsxs(ke,{ref:s,variant:t,size:r,className:v("absolute h-8 w-8 rounded-full",a==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...o,children:[n.jsx(P.ChevronLeft,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:d.carousel_previousSlide})]})});La.displayName="CarouselPrevious";const Ta=f.forwardRef(({className:e,variant:t="outline",size:r="icon",...o},s)=>{const{orientation:a,scrollNext:i,canScrollNext:l}=xr(),d=ce();return n.jsxs(ke,{ref:s,variant:t,size:r,className:v("absolute h-8 w-8 rounded-full",a==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...o,children:[n.jsx(P.ChevronRight,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:d.carousel_nextSlide})]})});Ta.displayName="CarouselNext";/**
13
13
  * table-core
14
14
  *
15
15
  * Copyright (c) TanStack
@@ -18,10 +18,10 @@
18
18
  * LICENSE.md file in the root directory of this source tree.
19
19
  *
20
20
  * @license MIT
21
- */function nt(e,t){return typeof e=="function"?e(t):e}function Ve(e,t){return r=>{t.setState(n=>({...n,[e]:nt(r,n[e])}))}}function gr(e){return e instanceof Function}function tu(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ru(e,t){const r=[],n=s=>{s.forEach(a=>{r.push(a);const i=t(a);i!=null&&i.length&&n(i)})};return n(e),r}function J(e,t,r){let n=[],s;return a=>{let i;r.key&&r.debug&&(i=Date.now());const l=e(a);if(!(l.length!==n.length||l.some((g,u)=>n[u]!==g)))return s;n=l;let d;if(r.key&&r.debug&&(d=Date.now()),s=t(...l),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const g=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-d)*100)/100,f=u/16,m=(h,x)=>{for(h=String(h);h.length<x;)h=" "+h;return h};console.info(`%c⏱ ${m(u,5)} /${m(g,5)} ms`,`
21
+ */function dt(e,t){return typeof e=="function"?e(t):e}function Oe(e,t){return r=>{t.setState(o=>({...o,[e]:dt(r,o[e])}))}}function vr(e){return e instanceof Function}function cu(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function du(e,t){const r=[],o=s=>{s.forEach(a=>{r.push(a);const i=t(a);i!=null&&i.length&&o(i)})};return o(e),r}function oe(e,t,r){let o=[],s;return a=>{let i;r.key&&r.debug&&(i=Date.now());const l=e(a);if(!(l.length!==o.length||l.some((p,u)=>o[u]!==p)))return s;o=l;let c;if(r.key&&r.debug&&(c=Date.now()),s=t(...l),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const p=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-c)*100)/100,m=u/16,g=(h,x)=>{for(h=String(h);h.length<x;)h=" "+h;return h};console.info(`%c⏱ ${g(u,5)} /${g(p,5)} ms`,`
22
22
  font-size: .6rem;
23
23
  font-weight: bold;
24
- color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,r==null?void 0:r.key)}return s}}function Q(e,t,r,n){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:process.env.NODE_ENV==="development"&&r,onChange:n}}function nu(e,t,r,n){const s=()=>{var i;return(i=a.getValue())!=null?i:e.options.renderFallbackValue},a={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(n),renderValue:s,getContext:J(()=>[e,r,t,a],(i,l,c,d)=>({table:i,column:l,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),Q(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(a,r,t,e)},{}),a}function ou(e,t,r,n){var s,a;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let d=(s=(a=l.id)!=null?a:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof l.header=="string"?l.header:void 0,g;if(l.accessorFn?g=l.accessorFn:c&&(c.includes(".")?g=f=>{let m=f;for(const x of c.split(".")){var h;m=(h=m)==null?void 0:h[x],process.env.NODE_ENV!=="production"&&m===void 0&&console.warn(`"${x}" in deeply nested key "${c}" returned undefined.`)}return m}:g=f=>f[l.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let u={id:`${String(d)}`,accessorFn:g,parent:n,depth:r,columnDef:l,columns:[],getFlatColumns:J(()=>[!0],()=>{var f;return[u,...(f=u.columns)==null?void 0:f.flatMap(m=>m.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],f=>{var m;if((m=u.columns)!=null&&m.length){let h=u.columns.flatMap(x=>x.getLeafColumns());return f(h)}return[u]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(u,e);return u}const Me="debugHeaders";function Un(e,t,r){var n;let a={id:(n=r.id)!=null?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(a),i},getContext:()=>({table:e,header:a,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(a,e)}),a}const su={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,s)=>{var a,i;const l=(a=n==null?void 0:n.map(u=>r.find(f=>f.id===u)).filter(Boolean))!=null?a:[],c=(i=s==null?void 0:s.map(u=>r.find(f=>f.id===u)).filter(Boolean))!=null?i:[],d=r.filter(u=>!(n!=null&&n.includes(u.id))&&!(s!=null&&s.includes(u.id)));return Jt(t,[...l,...d,...c],e)},Q(e.options,Me,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,s)=>(r=r.filter(a=>!(n!=null&&n.includes(a.id))&&!(s!=null&&s.includes(a.id))),Jt(t,r,e,"center")),Q(e.options,Me,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,n)=>{var s;const a=(s=n==null?void 0:n.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return Jt(t,a,e,"left")},Q(e.options,Me,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,n)=>{var s;const a=(s=n==null?void 0:n.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return Jt(t,a,e,"right")},Q(e.options,Me,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,n)=>{var s,a,i,l,c,d;return[...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(i=(l=r[0])==null?void 0:l.headers)!=null?i:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[]].map(g=>g.getLeafHeaders()).flat()},Q(e.options,Me,"getLeafHeaders"))}};function Jt(e,t,r,n){var s,a;let i=0;const l=function(f,m){m===void 0&&(m=1),i=Math.max(i,m),f.filter(h=>h.getIsVisible()).forEach(h=>{var x;(x=h.columns)!=null&&x.length&&l(h.columns,m+1)},0)};l(e);let c=[];const d=(f,m)=>{const h={depth:m,id:[n,`${m}`].filter(Boolean).join("_"),headers:[]},x=[];f.forEach(y=>{const w=[...x].reverse()[0],v=y.column.depth===h.depth;let j,R=!1;if(v&&y.column.parent?j=y.column.parent:(j=y.column,R=!0),w&&(w==null?void 0:w.column)===j)w.subHeaders.push(y);else{const M=Un(r,j,{id:[n,m,j.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${x.filter(C=>C.column===j).length}`:void 0,depth:m,index:x.length});M.subHeaders.push(y),x.push(M)}h.headers.push(y),y.headerGroup=h}),c.push(h),m>0&&d(x,m-1)},g=t.map((f,m)=>Un(r,f,{depth:i,index:m}));d(g,i-1),c.reverse();const u=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let x=0,y=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],u(h.subHeaders).forEach(j=>{let{colSpan:R,rowSpan:M}=j;x+=R,w.push(M)})):x=1;const v=Math.min(...w);return y=y+v,h.colSpan=x,h.rowSpan=y,{colSpan:x,rowSpan:y}});return u((s=(a=c[0])==null?void 0:a.headers)!=null?s:[]),c}const Cn=(e,t,r,n,s,a,i)=>{let l={id:t,index:n,original:r,depth:s,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return l._valuesCache[c]=d.accessorFn(l.original,n),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=d.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=l.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ru(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],d=l;for(;;){const g=d.getParentRow();if(!g)break;c.push(g),d=g}return c.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],c=>c.map(d=>nu(e,l,d,d.id)),Q(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[l.getAllCells()],c=>c.reduce((d,g)=>(d[g.column.id]=g,d),{}),Q(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const d=e._features[c];d==null||d.createRow==null||d.createRow(l,e)}return l},au={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},La=(e,t,r)=>{var n,s;const a=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(a))};La.autoRemove=e=>Ke(e);const Da=(e,t,r)=>{var n;return!!(!((n=e.getValue(t))==null||(n=n.toString())==null)&&n.includes(r))};Da.autoRemove=e=>Ke(e);const Ea=(e,t,r)=>{var n;return((n=e.getValue(t))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(r==null?void 0:r.toLowerCase())};Ea.autoRemove=e=>Ke(e);const Aa=(e,t,r)=>{var n;return(n=e.getValue(t))==null?void 0:n.includes(r)};Aa.autoRemove=e=>Ke(e);const Fa=(e,t,r)=>!r.some(n=>{var s;return!((s=e.getValue(t))!=null&&s.includes(n))});Fa.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Va=(e,t,r)=>r.some(n=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(n)});Va.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const za=(e,t,r)=>e.getValue(t)===r;za.autoRemove=e=>Ke(e);const $a=(e,t,r)=>e.getValue(t)==r;$a.autoRemove=e=>Ke(e);const kn=(e,t,r)=>{let[n,s]=r;const a=e.getValue(t);return a>=n&&a<=s};kn.resolveFilterValue=e=>{let[t,r]=e,n=typeof t!="number"?parseFloat(t):t,s=typeof r!="number"?parseFloat(r):r,a=t===null||Number.isNaN(n)?-1/0:n,i=r===null||Number.isNaN(s)?1/0:s;if(a>i){const l=a;a=i,i=l}return[a,i]};kn.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const tt={includesString:La,includesStringSensitive:Da,equalsString:Ea,arrIncludes:Aa,arrIncludesAll:Fa,arrIncludesSome:Va,equals:za,weakEquals:$a,inNumberRange:kn};function Ke(e){return e==null||e===""}const iu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ve("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r==null?void 0:r.getValue(e.id);return typeof n=="string"?tt.includesString:typeof n=="number"?tt.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?tt.equals:Array.isArray(n)?tt.arrIncludes:tt.weakEquals},e.getFilterFn=()=>{var r,n;return gr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(n=t.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?r:tt[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((n=t.options.enableColumnFilters)!=null?n:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(n=>n.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,n;return(r=(n=t.getState().columnFilters)==null?void 0:n.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(n=>{const s=e.getFilterFn(),a=n==null?void 0:n.find(g=>g.id===e.id),i=nt(r,a?a.value:void 0);if(Kn(s,i,e)){var l;return(l=n==null?void 0:n.filter(g=>g.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(a){var d;return(d=n==null?void 0:n.map(g=>g.id===e.id?c:g))!=null?d:[]}return n!=null&&n.length?[...n,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),n=s=>{var a;return(a=nt(t,s))==null?void 0:a.filter(i=>{const l=r.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(Kn(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:(r=(n=e.initialState)==null?void 0:n.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Kn(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const lu=(e,t,r)=>r.reduce((n,s)=>{const a=s.getValue(e);return n+(typeof a=="number"?a:0)},0),cu=(e,t,r)=>{let n;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(n>a||n===void 0&&a>=a)&&(n=a)}),n},du=(e,t,r)=>{let n;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(n<a||n===void 0&&a>=a)&&(n=a)}),n},uu=(e,t,r)=>{let n,s;return r.forEach(a=>{const i=a.getValue(e);i!=null&&(n===void 0?i>=i&&(n=s=i):(n>i&&(n=i),s<i&&(s=i)))}),[n,s]},mu=(e,t)=>{let r=0,n=0;if(t.forEach(s=>{let a=s.getValue(e);a!=null&&(a=+a)>=a&&(++r,n+=a)}),r)return n/r},fu=(e,t)=>{if(!t.length)return;const r=t.map(a=>a.getValue(e));if(!tu(r))return;if(r.length===1)return r[0];const n=Math.floor(r.length/2),s=r.sort((a,i)=>a-i);return r.length%2!==0?s[n]:(s[n-1]+s[n])/2},gu=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),pu=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,hu=(e,t)=>t.length,Nr={sum:lu,min:cu,max:du,extent:uu,mean:mu,median:fu,unique:gu,uniqueCount:pu,count:hu},xu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ve("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(n=>n!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,n;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((n=t.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r==null?void 0:r.getValue(e.id);if(typeof n=="number")return Nr.sum;if(Object.prototype.toString.call(n)==="[object Date]")return Nr.extent},e.getAggregationFn=()=>{var r,n;if(!e)throw new Error;return gr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(n=t.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?r:Nr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:(r=(n=e.initialState)==null?void 0:n.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const n=t.getColumn(r);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function bu(e,t,r){if(!(t!=null&&t.length)||!r)return e;const n=e.filter(a=>!t.includes(a.id));return r==="remove"?n:[...t.map(a=>e.find(i=>i.id===a)).filter(Boolean),...n]}const vu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ve("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(r=>[Lt(t,r)],r=>r.findIndex(n=>n.id===e.id),Q(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var n;return((n=Lt(t,r)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;const s=Lt(t,r);return((n=s[s.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,n)=>s=>{let a=[];if(!(t!=null&&t.length))a=s;else{const i=[...t],l=[...s];for(;l.length&&i.length;){const c=i.shift(),d=l.findIndex(g=>g.id===c);d>-1&&a.push(l.splice(d,1)[0])}a=[...a,...l]}return bu(a,r,n)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},Cr=()=>({left:[],right:[]}),wu={getInitialState:e=>({columnPinning:Cr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ve("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const n=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var a,i;if(r==="right"){var l,c;return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(u=>!(n!=null&&n.includes(u))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(u=>!(n!=null&&n.includes(u))),...n]}}if(r==="left"){var d,g;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(u=>!(n!=null&&n.includes(u))),...n],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(u=>!(n!=null&&n.includes(u)))}}return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(u=>!(n!=null&&n.includes(u))),right:((i=s==null?void 0:s.right)!=null?i:[]).filter(u=>!(n!=null&&n.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var s,a,i;return((s=n.columnDef.enablePinning)!=null?s:!0)&&((a=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?a:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(l=>l.id),{left:n,right:s}=t.getState().columnPinning,a=r.some(l=>n==null?void 0:n.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"left":i?"right":!1},e.getPinnedIndex=()=>{var r,n;const s=e.getIsPinned();return s?(r=(n=t.getState().columnPinning)==null||(n=n[s])==null?void 0:n.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,n,s)=>{const a=[...n??[],...s??[]];return r.filter(i=>!a.includes(i.column.id))},Q(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,n)=>(n??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"left"})),Q(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,n)=>(n??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"right"})),Q(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?Cr():(r=(n=e.initialState)==null?void 0:n.columnPinning)!=null?r:Cr())},e.getIsSomeColumnsPinned=t=>{var r;const n=e.getState().columnPinning;if(!t){var s,a;return!!((s=n.left)!=null&&s.length||(a=n.right)!=null&&a.length)}return!!((r=n[t])!=null&&r.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(n=>t.find(s=>s.id===n)).filter(Boolean),Q(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(n=>t.find(s=>s.id===n)).filter(Boolean),Q(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n)=>{const s=[...r??[],...n??[]];return t.filter(a=>!s.includes(a.id))},Q(e.options,"debugColumns","getCenterLeafColumns"))}};function yu(e){return e||(typeof document<"u"?document:null)}const Qt={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},kr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ju={getDefaultColumnDef:()=>Qt,getInitialState:e=>({columnSizing:{},columnSizingInfo:kr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ve("columnSizing",e),onColumnSizingInfoChange:Ve("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,s;const a=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Qt.minSize,(n=a??e.columnDef.size)!=null?n:Qt.size),(s=e.columnDef.maxSize)!=null?s:Qt.maxSize)},e.getStart=J(r=>[r,Lt(t,r),t.getState().columnSizing],(r,n)=>n.slice(0,e.getIndex(r)).reduce((s,a)=>s+a.getSize(),0),Q(t.options,"debugColumns","getStart")),e.getAfter=J(r=>[r,Lt(t,r),t.getState().columnSizing],(r,n)=>n.slice(e.getIndex(r)+1).reduce((s,a)=>s+a.getSize(),0),Q(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:n,...s}=r;return s})},e.getCanResize=()=>{var r,n;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((n=t.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let r=0;const n=s=>{if(s.subHeaders.length)s.subHeaders.forEach(n);else{var a;r+=(a=s.column.getSize())!=null?a:0}};return n(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const n=t.getColumn(e.column.id),s=n==null?void 0:n.getCanResize();return a=>{if(!n||!s||(a.persist==null||a.persist(),Sr(a)&&a.touches&&a.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[n.id,n.getSize()]],c=Sr(a)?Math.round(a.touches[0].clientX):a.clientX,d={},g=(w,v)=>{typeof v=="number"&&(t.setColumnSizingInfo(j=>{var R,M;const C=t.options.columnResizeDirection==="rtl"?-1:1,k=(v-((R=j==null?void 0:j.startOffset)!=null?R:0))*C,N=Math.max(k/((M=j==null?void 0:j.startSize)!=null?M:0),-.999999);return j.columnSizingStart.forEach(S=>{let[_,D]=S;d[_]=Math.round(Math.max(D+D*N,0)*100)/100}),{...j,deltaOffset:k,deltaPercentage:N}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(j=>({...j,...d})))},u=w=>g("move",w),f=w=>{g("end",w),t.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=yu(r),h={moveHandler:w=>u(w.clientX),upHandler:w=>{m==null||m.removeEventListener("mousemove",h.moveHandler),m==null||m.removeEventListener("mouseup",h.upHandler),f(w.clientX)}},x={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),u(w.touches[0].clientX),!1),upHandler:w=>{var v;m==null||m.removeEventListener("touchmove",x.moveHandler),m==null||m.removeEventListener("touchend",x.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((v=w.touches[0])==null?void 0:v.clientX)}},y=Nu()?{passive:!1}:!1;Sr(a)?(m==null||m.addEventListener("touchmove",x.moveHandler,y),m==null||m.addEventListener("touchend",x.upHandler,y)):(m==null||m.addEventListener("mousemove",h.moveHandler,y),m==null||m.addEventListener("mouseup",h.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?kr():(r=e.initialState.columnSizingInfo)!=null?r:kr())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0}}};let er=null;function Nu(){if(typeof er=="boolean")return er;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return er=e,er}function Sr(e){return e.type==="touchstart"}const Cu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ve("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(n=>({...n,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,n;const s=e.columns;return(r=s.length?s.some(a=>a.getIsVisible()):(n=t.getState().columnVisibility)==null?void 0:n[e.id])!=null?r:!0},e.getCanHide=()=>{var r,n;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((n=t.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(n=>n.column.getIsVisible()),Q(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,n,s)=>[...r,...n,...s],Q(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(r,n)=>J(()=>[n(),n().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(a=>a.getIsVisible==null?void 0:a.getIsVisible()),Q(e.options,"debugColumns",r));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var n;e.setColumnVisibility(r?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=r=>{var n;r=(n=r)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,a)=>({...s,[a.id]:r||!(a.getCanHide!=null&&a.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var n;e.toggleAllColumnsVisible((n=r.target)==null?void 0:n.checked)}}};function Lt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ku={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Su={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ve("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const n=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,s,a;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((n=t.options.enableGlobalFilter)!=null?n:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((a=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?a:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>tt.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:n}=e.options;return gr(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[n])!=null?t:tt[n]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Ru={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ve("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,s;if(!t){e._queue(()=>{t=!0});return}if((n=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var s,a;e.setExpanded(n?{}:(s=(a=e.initialState)==null?void 0:a.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(a=>{const i=a.split(".");n=Math.max(n,i.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded(n=>{var s;const a=n===!0?!0:!!(n!=null&&n[e.id]);let i={};if(n===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=n,r=(s=r)!=null?s:!a,!a&&r)return{...i,[e.id]:!0};if(a&&!r){const{[e.id]:l,...c}=i;return c}return n})},e.getIsExpanded=()=>{var r;const n=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var r,n,s;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((n=t.options.enableExpanding)!=null?n:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)n=t.getRow(n.parentId,!0),r=n.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},Vr=0,zr=10,Rr=()=>({pageIndex:Vr,pageSize:zr}),_u={getInitialState:e=>({...e,pagination:{...Rr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ve("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,s;if(!t){e._queue(()=>{t=!0});return}if((n=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=n=>{const s=a=>nt(n,a);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=n=>{var s;e.setPagination(n?Rr():(s=e.initialState.pagination)!=null?s:Rr())},e.setPageIndex=n=>{e.setPagination(s=>{let a=nt(n,s.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return a=Math.max(0,Math.min(a,i)),{...s,pageIndex:a}})},e.resetPageIndex=n=>{var s,a;e.setPageIndex(n?Vr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?s:Vr)},e.resetPageSize=n=>{var s,a;e.setPageSize(n?zr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?s:zr)},e.setPageSize=n=>{e.setPagination(s=>{const a=Math.max(1,nt(n,s.pageSize)),i=s.pageSize*s.pageIndex,l=Math.floor(i/a);return{...s,pageIndex:l,pageSize:a}})},e.setPageCount=n=>e.setPagination(s=>{var a;let i=nt(n,(a=e.options.pageCount)!=null?a:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...s,pageCount:i}}),e.getPageOptions=J(()=>[e.getPageCount()],n=>{let s=[];return n&&n>0&&(s=[...new Array(n)].fill(null).map((a,i)=>i)),s},Q(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:n<s-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},_r=()=>({top:[],bottom:[]}),Mu={getInitialState:e=>({rowPinning:_r(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ve("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,s)=>{const a=n?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],i=s?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],l=new Set([...i,e.id,...a]);t.setRowPinning(c=>{var d,g;if(r==="bottom"){var u,f;return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(x=>!(l!=null&&l.has(x))),bottom:[...((f=c==null?void 0:c.bottom)!=null?f:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)]}}if(r==="top"){var m,h;return{top:[...((m=c==null?void 0:c.top)!=null?m:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)],bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(x=>!(l!=null&&l.has(x)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(x=>!(l!=null&&l.has(x))),bottom:((g=c==null?void 0:c.bottom)!=null?g:[]).filter(x=>!(l!=null&&l.has(x)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:s}=t.options;return typeof n=="function"?n(e):(r=n??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:n,bottom:s}=t.getState().rowPinning,a=r.some(l=>n==null?void 0:n.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var r,n;const s=e.getIsPinned();if(!s)return-1;const a=(r=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:r.map(i=>{let{id:l}=i;return l});return(n=a==null?void 0:a.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?_r():(r=(n=e.initialState)==null?void 0:n.rowPinning)!=null?r:_r())},e.getIsSomeRowsPinned=t=>{var r;const n=e.getState().rowPinning;if(!t){var s,a;return!!((s=n.top)!=null&&s.length||(a=n.bottom)!=null&&a.length)}return!!((r=n[t])!=null&&r.length)},e._getPinnedRows=(t,r,n)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(r??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:n}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),Q(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),Q(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,n)=>{const s=new Set([...r??[],...n??[]]);return t.filter(a=>!s.has(a.id))},Q(e.options,"debugRows","getCenterRows"))}},Pu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ve("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const n={...r},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(a=>{a.getCanSelect()&&(n[a.id]=!0)}):s.forEach(a=>{delete n[a.id]}),n})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const n=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(a=>{$r(s,a.id,n,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let n=!!(t.length&&Object.keys(r).length);return n&&t.some(s=>s.getCanSelect()&&!r[s.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let n=!!t.length;return n&&t.some(s=>!r[s.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{const s=e.getIsSelected();t.setRowSelection(a=>{var i;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return a;const l={...a};return $r(l,e.id,r,(i=n==null?void 0:n.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return Sn(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Br(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Br(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return n=>{var s;r&&e.toggleSelected((s=n.target)==null?void 0:s.checked)}}}},$r=(e,t,r,n,s)=>{var a;const i=s.getRow(t,!0);r?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],n&&(a=i.subRows)!=null&&a.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>$r(e,l.id,r,n,s))};function Mr(e,t){const r=e.getState().rowSelection,n=[],s={},a=function(i,l){return i.map(c=>{var d;const g=Sn(c,r);if(g&&(n.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:a(c.subRows)}),g)return c}).filter(Boolean)};return{rows:a(t.rows),flatRows:n,rowsById:s}}function Sn(e,t){var r;return(r=t[e.id])!=null?r:!1}function Br(e,t,r){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let s=!0,a=!1;return e.subRows.forEach(i=>{if(!(a&&!s)&&(i.getCanSelect()&&(Sn(i,t)?a=!0:s=!1),i.subRows&&i.subRows.length)){const l=Br(i,t);l==="all"?a=!0:(l==="some"&&(a=!0),s=!1)}}),s?"all":a?"some":!1}const Or=/([0-9]+)/gm,Iu=(e,t,r)=>Ba(ot(e.getValue(r)).toLowerCase(),ot(t.getValue(r)).toLowerCase()),Tu=(e,t,r)=>Ba(ot(e.getValue(r)),ot(t.getValue(r))),Lu=(e,t,r)=>Rn(ot(e.getValue(r)).toLowerCase(),ot(t.getValue(r)).toLowerCase()),Du=(e,t,r)=>Rn(ot(e.getValue(r)),ot(t.getValue(r))),Eu=(e,t,r)=>{const n=e.getValue(r),s=t.getValue(r);return n>s?1:n<s?-1:0},Au=(e,t,r)=>Rn(e.getValue(r),t.getValue(r));function Rn(e,t){return e===t?0:e>t?1:-1}function ot(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ba(e,t){const r=e.split(Or).filter(Boolean),n=t.split(Or).filter(Boolean);for(;r.length&&n.length;){const s=r.shift(),a=n.shift(),i=parseInt(s,10),l=parseInt(a,10),c=[i,l].sort();if(isNaN(c[0])){if(s>a)return 1;if(a>s)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return r.length-n.length}const Rt={alphanumeric:Iu,alphanumericCaseSensitive:Tu,text:Lu,textCaseSensitive:Du,datetime:Eu,basic:Au},Fu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ve("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const s of r){const a=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(a)==="[object Date]")return Rt.datetime;if(typeof a=="string"&&(n=!0,a.split(Or).length>1))return Rt.alphanumeric}return n?Rt.text:Rt.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw new Error;return gr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(n=t.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?r:Rt[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{const s=e.getNextSortingOrder(),a=typeof r<"u"&&r!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(m=>m.id===e.id),c=i==null?void 0:i.findIndex(m=>m.id===e.id);let d=[],g,u=a?r:s==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&n?l?g="toggle":g="add":i!=null&&i.length&&c!==i.length-1?g="replace":l?g="toggle":g="replace",g==="toggle"&&(a||s||(g="remove")),g==="add"){var f;d=[...i,{id:e.id,desc:u}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else g==="toggle"?d=i.map(m=>m.id===e.id?{...m,desc:u}:m):g==="remove"?d=i.filter(m=>m.id!==e.id):d=[{id:e.id,desc:u}];return d})},e.getFirstSortDir=()=>{var r,n;return((r=(n=e.columnDef.sortDescFirst)!=null?n:t.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var n,s;const a=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==a&&((n=t.options.enableSortingRemoval)==null||n)&&(!(r&&(s=t.options.enableMultiRemove)!=null)||s)?!1:i==="desc"?"asc":"desc":a},e.getCanSort=()=>{var r,n;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((n=t.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return(r=(n=e.columnDef.enableMultiSort)!=null?n:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const n=(r=t.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,n;return(r=(n=t.getState().sorting)==null?void 0:n.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.setSorting(r=>r!=null&&r.length?r.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return n=>{r&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:(r=(n=e.initialState)==null?void 0:n.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Vu=[su,Cu,vu,wu,au,iu,ku,Su,Fu,xu,Ru,_u,Mu,Pu,ju];function zu(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const n=[...Vu,...(t=e._features)!=null?t:[]];let s={_features:n};const a=s._features.reduce((f,m)=>Object.assign(f,m.getDefaultOptions==null?void 0:m.getDefaultOptions(s)),{}),i=f=>s.options.mergeOptions?s.options.mergeOptions(a,f):{...a,...f};let c={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(f=>{var m;c=(m=f.getInitialState==null?void 0:f.getInitialState(c))!=null?m:c});const d=[];let g=!1;const u={_features:n,options:{...a,...e},initialState:c,_queue:f=>{d.push(f),g||(g=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();g=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const m=nt(f,s.options);s.options=i(m)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,m,h)=>{var x;return(x=s.options.getRowId==null?void 0:s.options.getRowId(f,m,h))!=null?x:`${h?[h.id,m].join("."):m}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,m)=>{let h=(m?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!h&&(h=s.getCoreRowModel().rowsById[f],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return h},_getDefaultColumnDef:J(()=>[s.options.defaultColumn],f=>{var m;return f=(m=f)!=null?m:{},{header:h=>{const x=h.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:h=>{var x,y;return(x=(y=h.renderValue())==null||y.toString==null?void 0:y.toString())!=null?x:null},...s._features.reduce((h,x)=>Object.assign(h,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...f}},Q(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>s.options.columns,getAllColumns:J(()=>[s._getColumnDefs()],f=>{const m=function(h,x,y){return y===void 0&&(y=0),h.map(w=>{const v=ou(s,w,y,x),j=w;return v.columns=j.columns?m(j.columns,v,y+1):[],v})};return m(f)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[s.getAllColumns()],f=>f.flatMap(m=>m.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[s.getAllFlatColumns()],f=>f.reduce((m,h)=>(m[h.id]=h,m),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,m)=>{let h=f.flatMap(x=>x.getLeafColumns());return m(h)},Q(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const m=s._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!m&&console.error(`[Table] Column with id '${f}' does not exist.`),m}};Object.assign(s,u);for(let f=0;f<s._features.length;f++){const m=s._features[f];m==null||m.createTable==null||m.createTable(s)}return s}function $u(){return e=>J(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(s,a,i){a===void 0&&(a=0);const l=[];for(let d=0;d<s.length;d++){const g=Cn(e,e._getRowId(s[d],d,i),s[d],d,a,void 0,i==null?void 0:i.id);if(r.flatRows.push(g),r.rowsById[g.id]=g,l.push(g),e.options.getSubRows){var c;g.originalSubRows=e.options.getSubRows(s[d],d),(c=g.originalSubRows)!=null&&c.length&&(g.subRows=n(g.originalSubRows,a+1,g))}}return l};return r.rows=n(t),r},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Bu(e){const t=[],r=n=>{var s;t.push(n),(s=n.subRows)!=null&&s.length&&n.getIsExpanded()&&n.subRows.forEach(r)};return e.rows.forEach(r),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Ou(e,t,r){return r.options.filterFromLeafRows?Hu(e,t,r):Gu(e,t,r)}function Hu(e,t,r){var n;const s=[],a={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,l=function(c,d){d===void 0&&(d=0);const g=[];for(let f=0;f<c.length;f++){var u;let m=c[f];const h=Cn(r,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(h.columnFilters=m.columnFilters,(u=m.subRows)!=null&&u.length&&d<i){if(h.subRows=l(m.subRows,d+1),m=h,t(m)&&!h.subRows.length){g.push(m),a[m.id]=m,s.push(m);continue}if(t(m)||h.subRows.length){g.push(m),a[m.id]=m,s.push(m);continue}}else m=h,t(m)&&(g.push(m),a[m.id]=m,s.push(m))}return g};return{rows:l(e),flatRows:s,rowsById:a}}function Gu(e,t,r){var n;const s=[],a={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,l=function(c,d){d===void 0&&(d=0);const g=[];for(let f=0;f<c.length;f++){let m=c[f];if(t(m)){var u;if((u=m.subRows)!=null&&u.length&&d<i){const x=Cn(r,m.id,m.original,m.index,m.depth,void 0,m.parentId);x.subRows=l(m.subRows,d+1),m=x}g.push(m),s.push(m),a[m.id]=m}}return g};return{rows:l(e),flatRows:s,rowsById:a}}function qu(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,n)=>{if(!t.rows.length||!(r!=null&&r.length)&&!n){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const s=[],a=[];(r??[]).forEach(f=>{var m;const h=e.getColumn(f.id);if(!h)return;const x=h.getFilterFn();if(!x){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}s.push({id:f.id,filterFn:x,resolvedValue:(m=x.resolveFilterValue==null?void 0:x.resolveFilterValue(f.value))!=null?m:f.value})});const i=(r??[]).map(f=>f.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());n&&l&&c.length&&(i.push("__global__"),c.forEach(f=>{var m;a.push({id:f.id,filterFn:l,resolvedValue:(m=l.resolveFilterValue==null?void 0:l.resolveFilterValue(n))!=null?m:n})}));let d,g;for(let f=0;f<t.flatRows.length;f++){const m=t.flatRows[f];if(m.columnFilters={},s.length)for(let h=0;h<s.length;h++){d=s[h];const x=d.id;m.columnFilters[x]=d.filterFn(m,x,d.resolvedValue,y=>{m.columnFiltersMeta[x]=y})}if(a.length){for(let h=0;h<a.length;h++){g=a[h];const x=g.id;if(g.filterFn(m,x,g.resolvedValue,y=>{m.columnFiltersMeta[x]=y})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const u=f=>{for(let m=0;m<i.length;m++)if(f.columnFilters[i[m]]===!1)return!1;return!0};return Ou(t.rows,u,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Wu(e){return t=>J(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(r,n)=>{if(!n.rows.length)return n;const{pageSize:s,pageIndex:a}=r;let{rows:i,flatRows:l,rowsById:c}=n;const d=s*a,g=d+s;i=i.slice(d,g);let u;t.options.paginateExpandedRows?u={rows:i,flatRows:l,rowsById:c}:u=Bu({rows:i,flatRows:l,rowsById:c}),u.flatRows=[];const f=m=>{u.flatRows.push(m),m.subRows.length&&m.subRows.forEach(f)};return u.rows.forEach(f),u},Q(t.options,"debugTable","getPaginationRowModel"))}function Uu(){return e=>J(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const n=e.getState().sorting,s=[],a=n.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),i={};a.forEach(c=>{const d=e.getColumn(c.id);d&&(i[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=c=>{const d=c.map(g=>({...g}));return d.sort((g,u)=>{for(let m=0;m<a.length;m+=1){var f;const h=a[m],x=i[h.id],y=x.sortUndefined,w=(f=h==null?void 0:h.desc)!=null?f:!1;let v=0;if(y){const j=g.getValue(h.id),R=u.getValue(h.id),M=j===void 0,C=R===void 0;if(M||C){if(y==="first")return M?-1:1;if(y==="last")return M?1:-1;v=M&&C?0:M?y:-y}}if(v===0&&(v=x.sortingFn(g,u,h.id)),v!==0)return w&&(v*=-1),x.invertSorting&&(v*=-1),v}return g.index-u.index}),d.forEach(g=>{var u;s.push(g),(u=g.subRows)!=null&&u.length&&(g.subRows=l(g.subRows))}),d};return{rows:l(r.rows),flatRows:s,rowsById:r.rowsById}},Q(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
24
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,r==null?void 0:r.key)}return s}}function se(e,t,r,o){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:process.env.NODE_ENV==="development"&&r,onChange:o}}function uu(e,t,r,o){const s=()=>{var i;return(i=a.getValue())!=null?i:e.options.renderFallbackValue},a={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(o),renderValue:s,getContext:oe(()=>[e,r,t,a],(i,l,d,c)=>({table:i,column:l,row:d,cell:c,getValue:c.getValue,renderValue:c.renderValue}),se(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(a,r,t,e)},{}),a}function mu(e,t,r,o){var s,a;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let c=(s=(a=l.id)!=null?a:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?s:typeof l.header=="string"?l.header:void 0,p;if(l.accessorFn?p=l.accessorFn:d&&(d.includes(".")?p=m=>{let g=m;for(const x of d.split(".")){var h;g=(h=g)==null?void 0:h[x],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${x}" in deeply nested key "${d}" returned undefined.`)}return g}:p=m=>m[l.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let u={id:`${String(c)}`,accessorFn:p,parent:o,depth:r,columnDef:l,columns:[],getFlatColumns:oe(()=>[!0],()=>{var m;return[u,...(m=u.columns)==null?void 0:m.flatMap(g=>g.getFlatColumns())]},se(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:oe(()=>[e._getOrderColumnsFn()],m=>{var g;if((g=u.columns)!=null&&g.length){let h=u.columns.flatMap(x=>x.getLeafColumns());return m(h)}return[u]},se(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(u,e);return u}const Ie="debugHeaders";function Kn(e,t,r){var o;let a={id:(o=r.id)!=null?o:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),i.push(d)};return l(a),i},getContext:()=>({table:e,header:a,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(a,e)}),a}const fu={createTable:e=>{e.getHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,o,s)=>{var a,i;const l=(a=o==null?void 0:o.map(u=>r.find(m=>m.id===u)).filter(Boolean))!=null?a:[],d=(i=s==null?void 0:s.map(u=>r.find(m=>m.id===u)).filter(Boolean))!=null?i:[],c=r.filter(u=>!(o!=null&&o.includes(u.id))&&!(s!=null&&s.includes(u.id)));return rr(t,[...l,...c,...d],e)},se(e.options,Ie,"getHeaderGroups")),e.getCenterHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,o,s)=>(r=r.filter(a=>!(o!=null&&o.includes(a.id))&&!(s!=null&&s.includes(a.id))),rr(t,r,e,"center")),se(e.options,Ie,"getCenterHeaderGroups")),e.getLeftHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,o)=>{var s;const a=(s=o==null?void 0:o.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return rr(t,a,e,"left")},se(e.options,Ie,"getLeftHeaderGroups")),e.getRightHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,o)=>{var s;const a=(s=o==null?void 0:o.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return rr(t,a,e,"right")},se(e.options,Ie,"getRightHeaderGroups")),e.getFooterGroups=oe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getFooterGroups")),e.getLeftFooterGroups=oe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getLeftFooterGroups")),e.getCenterFooterGroups=oe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getCenterFooterGroups")),e.getRightFooterGroups=oe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getRightFooterGroups")),e.getFlatHeaders=oe(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ie,"getFlatHeaders")),e.getLeftFlatHeaders=oe(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ie,"getLeftFlatHeaders")),e.getCenterFlatHeaders=oe(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ie,"getCenterFlatHeaders")),e.getRightFlatHeaders=oe(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ie,"getRightFlatHeaders")),e.getCenterLeafHeaders=oe(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),se(e.options,Ie,"getCenterLeafHeaders")),e.getLeftLeafHeaders=oe(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),se(e.options,Ie,"getLeftLeafHeaders")),e.getRightLeafHeaders=oe(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),se(e.options,Ie,"getRightLeafHeaders")),e.getLeafHeaders=oe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,o)=>{var s,a,i,l,d,c;return[...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(i=(l=r[0])==null?void 0:l.headers)!=null?i:[],...(d=(c=o[0])==null?void 0:c.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},se(e.options,Ie,"getLeafHeaders"))}};function rr(e,t,r,o){var s,a;let i=0;const l=function(m,g){g===void 0&&(g=1),i=Math.max(i,g),m.filter(h=>h.getIsVisible()).forEach(h=>{var x;(x=h.columns)!=null&&x.length&&l(h.columns,g+1)},0)};l(e);let d=[];const c=(m,g)=>{const h={depth:g,id:[o,`${g}`].filter(Boolean).join("_"),headers:[]},x=[];m.forEach(y=>{const b=[...x].reverse()[0],w=y.column.depth===h.depth;let j,M=!1;if(w&&y.column.parent?j=y.column.parent:(j=y.column,M=!0),b&&(b==null?void 0:b.column)===j)b.subHeaders.push(y);else{const R=Kn(r,j,{id:[o,g,j.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${x.filter(_=>_.column===j).length}`:void 0,depth:g,index:x.length});R.subHeaders.push(y),x.push(R)}h.headers.push(y),y.headerGroup=h}),d.push(h),g>0&&c(x,g-1)},p=t.map((m,g)=>Kn(r,m,{depth:i,index:g}));c(p,i-1),d.reverse();const u=m=>m.filter(h=>h.column.getIsVisible()).map(h=>{let x=0,y=0,b=[0];h.subHeaders&&h.subHeaders.length?(b=[],u(h.subHeaders).forEach(j=>{let{colSpan:M,rowSpan:R}=j;x+=M,b.push(R)})):x=1;const w=Math.min(...b);return y=y+w,h.colSpan=x,h.rowSpan=y,{colSpan:x,rowSpan:y}});return u((s=(a=d[0])==null?void 0:a.headers)!=null?s:[]),d}const Sn=(e,t,r,o,s,a,i)=>{let l={id:t,index:o,original:r,depth:s,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const c=e.getColumn(d);if(c!=null&&c.accessorFn)return l._valuesCache[d]=c.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const c=e.getColumn(d);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=c.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var c;return(c=l.getValue(d))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>du(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],c=l;for(;;){const p=c.getParentRow();if(!p)break;d.push(p),c=p}return d.reverse()},getAllCells:oe(()=>[e.getAllLeafColumns()],d=>d.map(c=>uu(e,l,c,c.id)),se(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:oe(()=>[l.getAllCells()],d=>d.reduce((c,p)=>(c[p.column.id]=p,c),{}),se(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const c=e._features[d];c==null||c.createRow==null||c.createRow(l,e)}return l},gu={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Ea=(e,t,r)=>{var o,s;const a=r==null||(o=r.toString())==null?void 0:o.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(a))};Ea.autoRemove=e=>Ye(e);const Da=(e,t,r)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(r))};Da.autoRemove=e=>Ye(e);const Aa=(e,t,r)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(r==null?void 0:r.toLowerCase())};Aa.autoRemove=e=>Ye(e);const Fa=(e,t,r)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)};Fa.autoRemove=e=>Ye(e);const Va=(e,t,r)=>!r.some(o=>{var s;return!((s=e.getValue(t))!=null&&s.includes(o))});Va.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const za=(e,t,r)=>r.some(o=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(o)});za.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const $a=(e,t,r)=>e.getValue(t)===r;$a.autoRemove=e=>Ye(e);const Ba=(e,t,r)=>e.getValue(t)==r;Ba.autoRemove=e=>Ye(e);const Rn=(e,t,r)=>{let[o,s]=r;const a=e.getValue(t);return a>=o&&a<=s};Rn.resolveFilterValue=e=>{let[t,r]=e,o=typeof t!="number"?parseFloat(t):t,s=typeof r!="number"?parseFloat(r):r,a=t===null||Number.isNaN(o)?-1/0:o,i=r===null||Number.isNaN(s)?1/0:s;if(a>i){const l=a;a=i,i=l}return[a,i]};Rn.autoRemove=e=>Ye(e)||Ye(e[0])&&Ye(e[1]);const rt={includesString:Ea,includesStringSensitive:Da,equalsString:Aa,arrIncludes:Fa,arrIncludesAll:Va,arrIncludesSome:za,equals:$a,weakEquals:Ba,inNumberRange:Rn};function Ye(e){return e==null||e===""}const pu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Oe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],o=r==null?void 0:r.getValue(e.id);return typeof o=="string"?rt.includesString:typeof o=="number"?rt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?rt.equals:Array.isArray(o)?rt.arrIncludes:rt.weakEquals},e.getFilterFn=()=>{var r,o;return vr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?r:rt[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,o,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(o=>o.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,o;return(r=(o=t.getState().columnFilters)==null?void 0:o.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(o=>{const s=e.getFilterFn(),a=o==null?void 0:o.find(p=>p.id===e.id),i=dt(r,a?a.value:void 0);if(Xn(s,i,e)){var l;return(l=o==null?void 0:o.filter(p=>p.id!==e.id))!=null?l:[]}const d={id:e.id,value:i};if(a){var c;return(c=o==null?void 0:o.map(p=>p.id===e.id?d:p))!=null?c:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),o=s=>{var a;return(a=dt(t,s))==null?void 0:a.filter(i=>{const l=r.find(d=>d.id===i.id);if(l){const d=l.getFilterFn();if(Xn(d,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var r,o;e.setColumnFilters(t?[]:(r=(o=e.initialState)==null?void 0:o.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Xn(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const hu=(e,t,r)=>r.reduce((o,s)=>{const a=s.getValue(e);return o+(typeof a=="number"?a:0)},0),xu=(e,t,r)=>{let o;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(o>a||o===void 0&&a>=a)&&(o=a)}),o},vu=(e,t,r)=>{let o;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(o<a||o===void 0&&a>=a)&&(o=a)}),o},bu=(e,t,r)=>{let o,s;return r.forEach(a=>{const i=a.getValue(e);i!=null&&(o===void 0?i>=i&&(o=s=i):(o>i&&(o=i),s<i&&(s=i)))}),[o,s]},wu=(e,t)=>{let r=0,o=0;if(t.forEach(s=>{let a=s.getValue(e);a!=null&&(a=+a)>=a&&(++r,o+=a)}),r)return o/r},yu=(e,t)=>{if(!t.length)return;const r=t.map(a=>a.getValue(e));if(!cu(r))return;if(r.length===1)return r[0];const o=Math.floor(r.length/2),s=r.sort((a,i)=>a-i);return r.length%2!==0?s[o]:(s[o-1]+s[o])/2},ju=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),Nu=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,ku=(e,t)=>t.length,kr={sum:hu,min:xu,max:vu,extent:bu,mean:wu,median:yu,unique:ju,uniqueCount:Nu,count:ku},Cu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Oe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(o=>o!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,o;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],o=r==null?void 0:r.getValue(e.id);if(typeof o=="number")return kr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return kr.extent},e.getAggregationFn=()=>{var r,o;if(!e)throw new Error;return vr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?r:kr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,o;e.setGrouping(t?[]:(r=(o=e.initialState)==null?void 0:o.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const o=t.getColumn(r);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[r]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function Su(e,t,r){if(!(t!=null&&t.length)||!r)return e;const o=e.filter(a=>!t.includes(a.id));return r==="remove"?o:[...t.map(a=>e.find(i=>i.id===a)).filter(Boolean),...o]}const Ru={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Oe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=oe(r=>[zt(t,r)],r=>r.findIndex(o=>o.id===e.id),se(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var o;return((o=zt(t,r)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=r=>{var o;const s=zt(t,r);return((o=s[s.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=oe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,o)=>s=>{let a=[];if(!(t!=null&&t.length))a=s;else{const i=[...t],l=[...s];for(;l.length&&i.length;){const d=i.shift(),c=l.findIndex(p=>p.id===d);c>-1&&a.push(l.splice(c,1)[0])}a=[...a,...l]}return Su(a,r,o)},se(e.options,"debugTable","_getOrderColumnsFn"))}},Cr=()=>({left:[],right:[]}),_u={getInitialState:e=>({columnPinning:Cr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Oe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const o=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var a,i;if(r==="right"){var l,d;return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(u=>!(o!=null&&o.includes(u))),right:[...((d=s==null?void 0:s.right)!=null?d:[]).filter(u=>!(o!=null&&o.includes(u))),...o]}}if(r==="left"){var c,p;return{left:[...((c=s==null?void 0:s.left)!=null?c:[]).filter(u=>!(o!=null&&o.includes(u))),...o],right:((p=s==null?void 0:s.right)!=null?p:[]).filter(u=>!(o!=null&&o.includes(u)))}}return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(u=>!(o!=null&&o.includes(u))),right:((i=s==null?void 0:s.right)!=null?i:[]).filter(u=>!(o!=null&&o.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var s,a,i;return((s=o.columnDef.enablePinning)!=null?s:!0)&&((a=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?a:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(l=>l.id),{left:o,right:s}=t.getState().columnPinning,a=r.some(l=>o==null?void 0:o.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"left":i?"right":!1},e.getPinnedIndex=()=>{var r,o;const s=e.getIsPinned();return s?(r=(o=t.getState().columnPinning)==null||(o=o[s])==null?void 0:o.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,o,s)=>{const a=[...o??[],...s??[]];return r.filter(i=>!a.includes(i.column.id))},se(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,o)=>(o??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"left"})),se(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,o)=>(o??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"right"})),se(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,o;return e.setColumnPinning(t?Cr():(r=(o=e.initialState)==null?void 0:o.columnPinning)!=null?r:Cr())},e.getIsSomeColumnsPinned=t=>{var r;const o=e.getState().columnPinning;if(!t){var s,a;return!!((s=o.left)!=null&&s.length||(a=o.right)!=null&&a.length)}return!!((r=o[t])!=null&&r.length)},e.getLeftLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(o=>t.find(s=>s.id===o)).filter(Boolean),se(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(o=>t.find(s=>s.id===o)).filter(Boolean),se(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,o)=>{const s=[...r??[],...o??[]];return t.filter(a=>!s.includes(a.id))},se(e.options,"debugColumns","getCenterLeafColumns"))}};function Mu(e){return e||(typeof document<"u"?document:null)}const nr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Sr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Pu={getDefaultColumnDef:()=>nr,getInitialState:e=>({columnSizing:{},columnSizingInfo:Sr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Oe("columnSizing",e),onColumnSizingInfoChange:Oe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,o,s;const a=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:nr.minSize,(o=a??e.columnDef.size)!=null?o:nr.size),(s=e.columnDef.maxSize)!=null?s:nr.maxSize)},e.getStart=oe(r=>[r,zt(t,r),t.getState().columnSizing],(r,o)=>o.slice(0,e.getIndex(r)).reduce((s,a)=>s+a.getSize(),0),se(t.options,"debugColumns","getStart")),e.getAfter=oe(r=>[r,zt(t,r),t.getState().columnSizing],(r,o)=>o.slice(e.getIndex(r)+1).reduce((s,a)=>s+a.getSize(),0),se(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:o,...s}=r;return s})},e.getCanResize=()=>{var r,o;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let r=0;const o=s=>{if(s.subHeaders.length)s.subHeaders.forEach(o);else{var a;r+=(a=s.column.getSize())!=null?a:0}};return o(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const o=t.getColumn(e.column.id),s=o==null?void 0:o.getCanResize();return a=>{if(!o||!s||(a.persist==null||a.persist(),Rr(a)&&a.touches&&a.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[o.id,o.getSize()]],d=Rr(a)?Math.round(a.touches[0].clientX):a.clientX,c={},p=(b,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(j=>{var M,R;const _=t.options.columnResizeDirection==="rtl"?-1:1,C=(w-((M=j==null?void 0:j.startOffset)!=null?M:0))*_,S=Math.max(C/((R=j==null?void 0:j.startSize)!=null?R:0),-.999999);return j.columnSizingStart.forEach(T=>{let[L,V]=T;c[L]=Math.round(Math.max(V+V*S,0)*100)/100}),{...j,deltaOffset:C,deltaPercentage:S}}),(t.options.columnResizeMode==="onChange"||b==="end")&&t.setColumnSizing(j=>({...j,...c})))},u=b=>p("move",b),m=b=>{p("end",b),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=Mu(r),h={moveHandler:b=>u(b.clientX),upHandler:b=>{g==null||g.removeEventListener("mousemove",h.moveHandler),g==null||g.removeEventListener("mouseup",h.upHandler),m(b.clientX)}},x={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),u(b.touches[0].clientX),!1),upHandler:b=>{var w;g==null||g.removeEventListener("touchmove",x.moveHandler),g==null||g.removeEventListener("touchend",x.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),m((w=b.touches[0])==null?void 0:w.clientX)}},y=Iu()?{passive:!1}:!1;Rr(a)?(g==null||g.addEventListener("touchmove",x.moveHandler,y),g==null||g.addEventListener("touchend",x.upHandler,y)):(g==null||g.addEventListener("mousemove",h.moveHandler,y),g==null||g.addEventListener("mouseup",h.upHandler,y)),t.setColumnSizingInfo(b=>({...b,startOffset:d,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?Sr():(r=e.initialState.columnSizingInfo)!=null?r:Sr())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?t:0}}};let or=null;function Iu(){if(typeof or=="boolean")return or;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return or=e,or}function Rr(e){return e.type==="touchstart"}const Lu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Oe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,o;const s=e.columns;return(r=s.length?s.some(a=>a.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?r:!0},e.getCanHide=()=>{var r,o;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=oe(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(o=>o.column.getIsVisible()),se(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=oe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,o,s)=>[...r,...o,...s],se(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(r,o)=>oe(()=>[o(),o().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(a=>a.getIsVisible==null?void 0:a.getIsVisible()),se(e.options,"debugColumns",r));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var o;e.setColumnVisibility(r?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=r=>{var o;r=(o=r)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,a)=>({...s,[a.id]:r||!(a.getCanHide!=null&&a.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var o;e.toggleAllColumnsVisible((o=r.target)==null?void 0:o.checked)}}};function zt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Tu={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Eu={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Oe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const o=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,o,s,a;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((a=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?a:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>rt.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:o}=e.options;return vr(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[o])!=null?t:rt[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Du={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Oe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var o,s;if(!t){e._queue(()=>{t=!0});return}if((o=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var s,a;e.setExpanded(o?{}:(s=(a=e.initialState)==null?void 0:a.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(a=>{const i=a.split(".");o=Math.max(o,i.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded(o=>{var s;const a=o===!0?!0:!!(o!=null&&o[e.id]);let i={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=o,r=(s=r)!=null?s:!a,!a&&r)return{...i,[e.id]:!0};if(a&&!r){const{[e.id]:l,...d}=i;return d}return o})},e.getIsExpanded=()=>{var r;const o=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:o===!0||o!=null&&o[e.id])},e.getCanExpand=()=>{var r,o,s;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((o=t.options.enableExpanding)!=null?o:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,o=e;for(;r&&o.parentId;)o=t.getRow(o.parentId,!0),r=o.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},zr=0,$r=10,_r=()=>({pageIndex:zr,pageSize:$r}),Au={getInitialState:e=>({...e,pagination:{..._r(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Oe("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var o,s;if(!t){e._queue(()=>{t=!0});return}if((o=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=o=>{const s=a=>dt(o,a);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=o=>{var s;e.setPagination(o?_r():(s=e.initialState.pagination)!=null?s:_r())},e.setPageIndex=o=>{e.setPagination(s=>{let a=dt(o,s.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return a=Math.max(0,Math.min(a,i)),{...s,pageIndex:a}})},e.resetPageIndex=o=>{var s,a;e.setPageIndex(o?zr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?s:zr)},e.resetPageSize=o=>{var s,a;e.setPageSize(o?$r:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?s:$r)},e.setPageSize=o=>{e.setPagination(s=>{const a=Math.max(1,dt(o,s.pageSize)),i=s.pageSize*s.pageIndex,l=Math.floor(i/a);return{...s,pageIndex:l,pageSize:a}})},e.setPageCount=o=>e.setPagination(s=>{var a;let i=dt(o,(a=e.options.pageCount)!=null?a:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...s,pageCount:i}}),e.getPageOptions=oe(()=>[e.getPageCount()],o=>{let s=[];return o&&o>0&&(s=[...new Array(o)].fill(null).map((a,i)=>i)),s},se(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:o<s-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Mr=()=>({top:[],bottom:[]}),Fu={getInitialState:e=>({rowPinning:Mr(),...e}),getDefaultOptions:e=>({onRowPinningChange:Oe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,o,s)=>{const a=o?e.getLeafRows().map(d=>{let{id:c}=d;return c}):[],i=s?e.getParentRows().map(d=>{let{id:c}=d;return c}):[],l=new Set([...i,e.id,...a]);t.setRowPinning(d=>{var c,p;if(r==="bottom"){var u,m;return{top:((u=d==null?void 0:d.top)!=null?u:[]).filter(x=>!(l!=null&&l.has(x))),bottom:[...((m=d==null?void 0:d.bottom)!=null?m:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)]}}if(r==="top"){var g,h;return{top:[...((g=d==null?void 0:d.top)!=null?g:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)],bottom:((h=d==null?void 0:d.bottom)!=null?h:[]).filter(x=>!(l!=null&&l.has(x)))}}return{top:((c=d==null?void 0:d.top)!=null?c:[]).filter(x=>!(l!=null&&l.has(x))),bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(x=>!(l!=null&&l.has(x)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:o,enablePinning:s}=t.options;return typeof o=="function"?o(e):(r=o??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:o,bottom:s}=t.getState().rowPinning,a=r.some(l=>o==null?void 0:o.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var r,o;const s=e.getIsPinned();if(!s)return-1;const a=(r=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:r.map(i=>{let{id:l}=i;return l});return(o=a==null?void 0:a.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,o;return e.setRowPinning(t?Mr():(r=(o=e.initialState)==null?void 0:o.rowPinning)!=null?r:Mr())},e.getIsSomeRowsPinned=t=>{var r;const o=e.getState().rowPinning;if(!t){var s,a;return!!((s=o.top)!=null&&s.length||(a=o.bottom)!=null&&a.length)}return!!((r=o[t])!=null&&r.length)},e._getPinnedRows=(t,r,o)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(r??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:o}))},e.getTopRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),se(e.options,"debugRows","getTopRows")),e.getBottomRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),se(e.options,"debugRows","getBottomRows")),e.getCenterRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,o)=>{const s=new Set([...r??[],...o??[]]);return t.filter(a=>!s.has(a.id))},se(e.options,"debugRows","getCenterRows"))}},Vu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Oe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...r},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(a=>{a.getCanSelect()&&(o[a.id]=!0)}):s.forEach(a=>{delete o[a.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(a=>{Br(s,a.id,o,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?Pr(e,r):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Pr(e,r):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Pr(e,r):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let o=!!(t.length&&Object.keys(r).length);return o&&t.some(s=>s.getCanSelect()&&!r[s.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let o=!!t.length;return o&&t.some(s=>!r[s.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,o)=>{const s=e.getIsSelected();t.setRowSelection(a=>{var i;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return a;const l={...a};return Br(l,e.id,r,(i=o==null?void 0:o.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return _n(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Or(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Or(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return o=>{var s;r&&e.toggleSelected((s=o.target)==null?void 0:s.checked)}}}},Br=(e,t,r,o,s)=>{var a;const i=s.getRow(t,!0);r?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(a=i.subRows)!=null&&a.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>Br(e,l.id,r,o,s))};function Pr(e,t){const r=e.getState().rowSelection,o=[],s={},a=function(i,l){return i.map(d=>{var c;const p=_n(d,r);if(p&&(o.push(d),s[d.id]=d),(c=d.subRows)!=null&&c.length&&(d={...d,subRows:a(d.subRows)}),p)return d}).filter(Boolean)};return{rows:a(t.rows),flatRows:o,rowsById:s}}function _n(e,t){var r;return(r=t[e.id])!=null?r:!1}function Or(e,t,r){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let s=!0,a=!1;return e.subRows.forEach(i=>{if(!(a&&!s)&&(i.getCanSelect()&&(_n(i,t)?a=!0:s=!1),i.subRows&&i.subRows.length)){const l=Or(i,t);l==="all"?a=!0:(l==="some"&&(a=!0),s=!1)}}),s?"all":a?"some":!1}const Hr=/([0-9]+)/gm,zu=(e,t,r)=>Oa(ut(e.getValue(r)).toLowerCase(),ut(t.getValue(r)).toLowerCase()),$u=(e,t,r)=>Oa(ut(e.getValue(r)),ut(t.getValue(r))),Bu=(e,t,r)=>Mn(ut(e.getValue(r)).toLowerCase(),ut(t.getValue(r)).toLowerCase()),Ou=(e,t,r)=>Mn(ut(e.getValue(r)),ut(t.getValue(r))),Hu=(e,t,r)=>{const o=e.getValue(r),s=t.getValue(r);return o>s?1:o<s?-1:0},Gu=(e,t,r)=>Mn(e.getValue(r),t.getValue(r));function Mn(e,t){return e===t?0:e>t?1:-1}function ut(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Oa(e,t){const r=e.split(Hr).filter(Boolean),o=t.split(Hr).filter(Boolean);for(;r.length&&o.length;){const s=r.shift(),a=o.shift(),i=parseInt(s,10),l=parseInt(a,10),d=[i,l].sort();if(isNaN(d[0])){if(s>a)return 1;if(a>s)return-1;continue}if(isNaN(d[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return r.length-o.length}const Tt={alphanumeric:zu,alphanumericCaseSensitive:$u,text:Bu,textCaseSensitive:Ou,datetime:Hu,basic:Gu},qu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Oe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const s of r){const a=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(a)==="[object Date]")return Tt.datetime;if(typeof a=="string"&&(o=!0,a.split(Hr).length>1))return Tt.alphanumeric}return o?Tt.text:Tt.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,o;if(!e)throw new Error;return vr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?r:Tt[e.columnDef.sortingFn]},e.toggleSorting=(r,o)=>{const s=e.getNextSortingOrder(),a=typeof r<"u"&&r!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(g=>g.id===e.id),d=i==null?void 0:i.findIndex(g=>g.id===e.id);let c=[],p,u=a?r:s==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&o?l?p="toggle":p="add":i!=null&&i.length&&d!==i.length-1?p="replace":l?p="toggle":p="replace",p==="toggle"&&(a||s||(p="remove")),p==="add"){var m;c=[...i,{id:e.id,desc:u}],c.splice(0,c.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else p==="toggle"?c=i.map(g=>g.id===e.id?{...g,desc:u}:g):p==="remove"?c=i.filter(g=>g.id!==e.id):c=[{id:e.id,desc:u}];return c})},e.getFirstSortDir=()=>{var r,o;return((r=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var o,s;const a=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==a&&((o=t.options.enableSortingRemoval)==null||o)&&(!(r&&(s=t.options.enableMultiRemove)!=null)||s)?!1:i==="desc"?"asc":"desc":a},e.getCanSort=()=>{var r,o;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,o;return(r=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const o=(r=t.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,o;return(r=(o=t.getState().sorting)==null?void 0:o.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.setSorting(r=>r!=null&&r.length?r.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return o=>{r&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,o;e.setSorting(t?[]:(r=(o=e.initialState)==null?void 0:o.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Wu=[fu,Lu,Ru,_u,gu,pu,Tu,Eu,qu,Cu,Du,Au,Fu,Vu,Pu];function Uu(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...Wu,...(t=e._features)!=null?t:[]];let s={_features:o};const a=s._features.reduce((m,g)=>Object.assign(m,g.getDefaultOptions==null?void 0:g.getDefaultOptions(s)),{}),i=m=>s.options.mergeOptions?s.options.mergeOptions(a,m):{...a,...m};let d={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(m=>{var g;d=(g=m.getInitialState==null?void 0:m.getInitialState(d))!=null?g:d});const c=[];let p=!1;const u={_features:o,options:{...a,...e},initialState:d,_queue:m=>{c.push(m),p||(p=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();p=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{s.setState(s.initialState)},setOptions:m=>{const g=dt(m,s.options);s.options=i(g)},getState:()=>s.options.state,setState:m=>{s.options.onStateChange==null||s.options.onStateChange(m)},_getRowId:(m,g,h)=>{var x;return(x=s.options.getRowId==null?void 0:s.options.getRowId(m,g,h))!=null?x:`${h?[h.id,g].join("."):g}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(m,g)=>{let h=(g?s.getPrePaginationRowModel():s.getRowModel()).rowsById[m];if(!h&&(h=s.getCoreRowModel().rowsById[m],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return h},_getDefaultColumnDef:oe(()=>[s.options.defaultColumn],m=>{var g;return m=(g=m)!=null?g:{},{header:h=>{const x=h.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:h=>{var x,y;return(x=(y=h.renderValue())==null||y.toString==null?void 0:y.toString())!=null?x:null},...s._features.reduce((h,x)=>Object.assign(h,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...m}},se(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>s.options.columns,getAllColumns:oe(()=>[s._getColumnDefs()],m=>{const g=function(h,x,y){return y===void 0&&(y=0),h.map(b=>{const w=mu(s,b,y,x),j=b;return w.columns=j.columns?g(j.columns,w,y+1):[],w})};return g(m)},se(e,"debugColumns","getAllColumns")),getAllFlatColumns:oe(()=>[s.getAllColumns()],m=>m.flatMap(g=>g.getFlatColumns()),se(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:oe(()=>[s.getAllFlatColumns()],m=>m.reduce((g,h)=>(g[h.id]=h,g),{}),se(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:oe(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(m,g)=>{let h=m.flatMap(x=>x.getLeafColumns());return g(h)},se(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const g=s._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!g&&console.error(`[Table] Column with id '${m}' does not exist.`),g}};Object.assign(s,u);for(let m=0;m<s._features.length;m++){const g=s._features[m];g==null||g.createTable==null||g.createTable(s)}return s}function Ku(){return e=>oe(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},o=function(s,a,i){a===void 0&&(a=0);const l=[];for(let c=0;c<s.length;c++){const p=Sn(e,e._getRowId(s[c],c,i),s[c],c,a,void 0,i==null?void 0:i.id);if(r.flatRows.push(p),r.rowsById[p.id]=p,l.push(p),e.options.getSubRows){var d;p.originalSubRows=e.options.getSubRows(s[c],c),(d=p.originalSubRows)!=null&&d.length&&(p.subRows=o(p.originalSubRows,a+1,p))}}return l};return r.rows=o(t),r},se(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Xu(e){const t=[],r=o=>{var s;t.push(o),(s=o.subRows)!=null&&s.length&&o.getIsExpanded()&&o.subRows.forEach(r)};return e.rows.forEach(r),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Yu(e,t,r){return r.options.filterFromLeafRows?Zu(e,t,r):Ju(e,t,r)}function Zu(e,t,r){var o;const s=[],a={},i=(o=r.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,c){c===void 0&&(c=0);const p=[];for(let m=0;m<d.length;m++){var u;let g=d[m];const h=Sn(r,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(h.columnFilters=g.columnFilters,(u=g.subRows)!=null&&u.length&&c<i){if(h.subRows=l(g.subRows,c+1),g=h,t(g)&&!h.subRows.length){p.push(g),a[g.id]=g,s.push(g);continue}if(t(g)||h.subRows.length){p.push(g),a[g.id]=g,s.push(g);continue}}else g=h,t(g)&&(p.push(g),a[g.id]=g,s.push(g))}return p};return{rows:l(e),flatRows:s,rowsById:a}}function Ju(e,t,r){var o;const s=[],a={},i=(o=r.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,c){c===void 0&&(c=0);const p=[];for(let m=0;m<d.length;m++){let g=d[m];if(t(g)){var u;if((u=g.subRows)!=null&&u.length&&c<i){const x=Sn(r,g.id,g.original,g.index,g.depth,void 0,g.parentId);x.subRows=l(g.subRows,c+1),g=x}p.push(g),s.push(g),a[g.id]=g}}return p};return{rows:l(e),flatRows:s,rowsById:a}}function Qu(){return e=>oe(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,o)=>{if(!t.rows.length||!(r!=null&&r.length)&&!o){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const s=[],a=[];(r??[]).forEach(m=>{var g;const h=e.getColumn(m.id);if(!h)return;const x=h.getFilterFn();if(!x){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}s.push({id:m.id,filterFn:x,resolvedValue:(g=x.resolveFilterValue==null?void 0:x.resolveFilterValue(m.value))!=null?g:m.value})});const i=(r??[]).map(m=>m.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());o&&l&&d.length&&(i.push("__global__"),d.forEach(m=>{var g;a.push({id:m.id,filterFn:l,resolvedValue:(g=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?g:o})}));let c,p;for(let m=0;m<t.flatRows.length;m++){const g=t.flatRows[m];if(g.columnFilters={},s.length)for(let h=0;h<s.length;h++){c=s[h];const x=c.id;g.columnFilters[x]=c.filterFn(g,x,c.resolvedValue,y=>{g.columnFiltersMeta[x]=y})}if(a.length){for(let h=0;h<a.length;h++){p=a[h];const x=p.id;if(p.filterFn(g,x,p.resolvedValue,y=>{g.columnFiltersMeta[x]=y})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const u=m=>{for(let g=0;g<i.length;g++)if(m.columnFilters[i[g]]===!1)return!1;return!0};return Yu(t.rows,u,e)},se(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function em(e){return t=>oe(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(r,o)=>{if(!o.rows.length)return o;const{pageSize:s,pageIndex:a}=r;let{rows:i,flatRows:l,rowsById:d}=o;const c=s*a,p=c+s;i=i.slice(c,p);let u;t.options.paginateExpandedRows?u={rows:i,flatRows:l,rowsById:d}:u=Xu({rows:i,flatRows:l,rowsById:d}),u.flatRows=[];const m=g=>{u.flatRows.push(g),g.subRows.length&&g.subRows.forEach(m)};return u.rows.forEach(m),u},se(t.options,"debugTable","getPaginationRowModel"))}function tm(){return e=>oe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const o=e.getState().sorting,s=[],a=o.filter(d=>{var c;return(c=e.getColumn(d.id))==null?void 0:c.getCanSort()}),i={};a.forEach(d=>{const c=e.getColumn(d.id);c&&(i[d.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const l=d=>{const c=d.map(p=>({...p}));return c.sort((p,u)=>{for(let g=0;g<a.length;g+=1){var m;const h=a[g],x=i[h.id],y=x.sortUndefined,b=(m=h==null?void 0:h.desc)!=null?m:!1;let w=0;if(y){const j=p.getValue(h.id),M=u.getValue(h.id),R=j===void 0,_=M===void 0;if(R||_){if(y==="first")return R?-1:1;if(y==="last")return R?1:-1;w=R&&_?0:R?y:-y}}if(w===0&&(w=x.sortingFn(p,u,h.id)),w!==0)return b&&(w*=-1),x.invertSorting&&(w*=-1),w}return p.index-u.index}),c.forEach(p=>{var u;s.push(p),(u=p.subRows)!=null&&u.length&&(p.subRows=l(p.subRows))}),c};return{rows:l(r.rows),flatRows:s,rowsById:r.rowsById}},se(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
25
25
  * react-table
26
26
  *
27
27
  * Copyright (c) TanStack
@@ -30,9 +30,9 @@
30
30
  * LICENSE.md file in the root directory of this source tree.
31
31
  *
32
32
  * @license MIT
33
- */function Xn(e,t){return e?Ku(e)?p.createElement(e,t):e:null}function Ku(e){return Xu(e)||typeof e=="function"||Yu(e)}function Xu(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Yu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Zu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=p.useState(()=>({current:zu(t)})),[n,s]=p.useState(()=>r.current.initialState);return r.current.setOptions(a=>({...a,...e,state:{...n,...e.state},onStateChange:i=>{s(i),e.onStateChange==null||e.onStateChange(i)}})),r.current}function Ju({columns:e,data:t,searchKey:r,searchPlaceholder:n,pageSize:s=10}){var y,w;const a=te(),i=n??a.dataTable_searchPlaceholder,[l,c]=p.useState([]),[d,g]=p.useState([]),[u,f]=p.useState({}),[m,h]=p.useState({}),x=Zu({data:t,columns:e,onSortingChange:c,onColumnFiltersChange:g,getCoreRowModel:$u(),getPaginationRowModel:Wu(),getSortedRowModel:Uu(),getFilteredRowModel:qu(),onColumnVisibilityChange:f,onRowSelectionChange:h,state:{sorting:l,columnFilters:d,columnVisibility:u,rowSelection:m},initialState:{pagination:{pageSize:s}}});return o.jsxs("div",{className:"space-y-4",children:[r&&o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(st,{placeholder:i,value:((y=x.getColumn(r))==null?void 0:y.getFilterValue())??"",onChange:v=>{var j;return(j=x.getColumn(r))==null?void 0:j.setFilterValue(v.target.value)},className:"max-w-sm"})}),o.jsx("div",{className:"rounded-md border",children:o.jsxs(rn,{children:[o.jsx(nn,{children:x.getHeaderGroups().map(v=>o.jsx(Pt,{children:v.headers.map(j=>o.jsx(sn,{children:j.isPlaceholder?null:Xn(j.column.columnDef.header,j.getContext())},j.id))},v.id))}),o.jsx(on,{children:(w=x.getRowModel().rows)!=null&&w.length?x.getRowModel().rows.map(v=>o.jsx(Pt,{"data-state":v.getIsSelected()&&"selected",children:v.getVisibleCells().map(j=>o.jsx(nr,{children:Xn(j.column.columnDef.cell,j.getContext())},j.id))},v.id)):o.jsx(Pt,{children:o.jsx(nr,{colSpan:e.length,className:"h-24 text-center",children:a.dataTable_noResults})})})]})}),o.jsxs("div",{className:"flex items-center justify-between px-2",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:De(a.dataTable_pageOf,{page:x.getState().pagination.pageIndex+1,total:x.getPageCount()})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>x.previousPage(),disabled:!x.getCanPreviousPage(),children:[o.jsx(I.ChevronLeft,{className:"h-4 w-4"}),a.dataTable_previous]}),o.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>x.nextPage(),disabled:!x.getCanNextPage(),children:[a.dataTable_next,o.jsx(I.ChevronRight,{className:"h-4 w-4"})]})]})]})]})}function Qu({column:e,title:t,className:r}){return e.getCanSort()?o.jsxs(ve,{variant:"ghost",size:"sm",className:b("-ml-3 h-8",r),onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:[t,o.jsx(I.ArrowUpDown,{className:"ml-2 h-4 w-4"})]}):o.jsx("div",{className:b(r),children:t})}const em=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","instanceof","interface","let","new","null","of","package","private","protected","public","return","set","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]),tm=new Set(["display","flex","grid","none","block","inline","relative","absolute","fixed","sticky","hidden","visible","auto","inherit","initial","unset","important","solid","dashed","dotted","transparent","center","left","right","top","bottom","normal","bold","italic","nowrap","wrap"]);function rm(e,t){const r=e.split(`
34
- `),n=t==="css"||t==="scss"||t==="less",s=t==="html"||t==="xml"||t==="svg",a=t==="json",i=t==="bash"||t==="sh"||t==="shell"||t==="zsh";return r.map(l=>{const c=[];let d=0;const g=l.length*4;let u=0;for(;d<l.length&&u++<g;){if(!n&&!a&&l[d]==="/"&&l[d+1]==="/"){c.push({type:"comment",value:l.slice(d)}),d=l.length;continue}if(i&&l[d]==="#"){c.push({type:"comment",value:l.slice(d)}),d=l.length;continue}if(l[d]==="/"&&l[d+1]==="*"){const f=l.indexOf("*/",d+2);f!==-1?(c.push({type:"comment",value:l.slice(d,f+2)}),d=f+2):(c.push({type:"comment",value:l.slice(d)}),d=l.length);continue}if(l[d]==="`"){let f=d+1;for(;f<l.length&&l[f]!=="`";)l[f]==="\\"&&f++,f++;c.push({type:"string",value:l.slice(d,f+1)}),d=f+1;continue}if(l[d]==='"'||l[d]==="'"){const f=l[d];let m=d+1;for(;m<l.length&&l[m]!==f;)l[m]==="\\"&&m++,m++;c.push({type:"string",value:l.slice(d,m+1)}),d=m+1;continue}if(/[0-9]/.test(l[d])&&(d===0||/[\s,\(\[:=+\-*/<>!&|^~?{]/.test(l[d-1]))){let f=d;for(;f<l.length&&/[0-9a-fA-FxXoObB._eE+\-n]/.test(l[f]);)f++;c.push({type:"number",value:l.slice(d,f)}),d=f;continue}if(l[d]==="<"&&/[a-zA-Z\/!]/.test(l[d+1]||"")||l[d]==="/"&&l[d+1]===">"){if(l[d]==="/"&&l[d+1]===">"){c.push({type:"punctuation",value:"/>"}),d+=2;continue}const f=l[d+1]==="/";let m=f?d+2:d+1;for(;m<l.length&&/[a-zA-Z0-9.\-_]/.test(l[m]);)m++;c.push({type:"punctuation",value:l[d]+(f?"/":"")});const h=l.slice(f?d+2:d+1,m);h&&c.push({type:"tag",value:h}),d=m;continue}if(l[d]===">"){c.push({type:"punctuation",value:">"}),d++;continue}if(/[a-zA-Z_$@]/.test(l[d])){let f=d;for(;f<l.length&&/[a-zA-Z0-9_$@\-]/.test(l[f]);)f++;f===d&&f++;const m=l.slice(d,f);if(n&&tm.has(m))c.push({type:"keyword",value:m});else if(s||n){const h=l.slice(f).trimStart();h[0]==="="||h[0]===":"?c.push({type:"attr",value:m}):c.push({type:"plain",value:m})}else em.has(m)?c.push({type:"keyword",value:m}):!a&&l[f]==="("?c.push({type:"function",value:m}):!a&&/^[A-Z]/.test(m)?c.push({type:"tag",value:m}):c.push({type:"plain",value:m});d=f;continue}if(/[=+\-*/%<>!&|^~?:]/.test(l[d])){let f=d;for(;f<l.length&&/[=+\-*/%<>!&|^~?:]/.test(l[f]);)f++;c.push({type:"operator",value:l.slice(d,f)}),d=f;continue}if(/[{}()\[\],;.]/.test(l[d])){c.push({type:"punctuation",value:l[d]}),d++;continue}if(/\s/.test(l[d])){let f=d;for(;f<l.length&&/\s/.test(l[f]);)f++;c.push({type:"plain",value:l.slice(d,f)}),d=f;continue}c.push({type:"plain",value:l[d]}),d++}return c})}const nm={comment:"var(--cb-comment, #6a9955)",string:"var(--cb-string, #ce9178)",keyword:"var(--cb-keyword, #569cd6)",number:"var(--cb-number, #b5cea8)",function:"var(--cb-function, #dcdcaa)",tag:"var(--cb-tag, #4ec9b0)",attr:"var(--cb-attr, #9cdcfe)",punctuation:"var(--cb-punctuation, #d4d4d4)",operator:"var(--cb-operator, #d4d4d4)",plain:"var(--cb-plain, #d4d4d4)"};function om({code:e,language:t="tsx",showLineNumbers:r=!1,showCopy:n=!0,className:s}){const a=te(),[i,l]=p.useState(!1),c=e.trim(),d=p.useMemo(()=>{try{return rm(c,t)}catch{return c.split(`
35
- `).map(u=>[{type:"plain",value:u}])}},[c,t]),g=async()=>{try{await navigator.clipboard.writeText(c),l(!0),setTimeout(()=>l(!1),2e3)}catch{}};return o.jsxs("div",{className:b("relative group",s),children:[n&&o.jsx("button",{type:"button",onClick:g,className:"absolute top-3 right-3 z-10 p-1.5 rounded-md bg-white/10 backdrop-blur text-white/60 hover:text-white opacity-0 group-hover:opacity-100 transition-opacity text-xs","aria-label":a.common_copyCode,children:i?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"20 6 9 17 4 12"})}):o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2"}),o.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}),o.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:d.map((u,f)=>o.jsxs("div",{children:[r&&o.jsx("span",{className:"inline-block w-8 select-none text-right mr-4 opacity-40",style:{color:"var(--cb-plain, #d4d4d4)"},children:f+1}),u.map((m,h)=>o.jsx("span",{style:{color:nm[m.type]},children:m.value},h))]},f))})]})}const Oa=ze("font-bold tracking-tight",{variants:{level:{1:"text-2xl lg:text-3xl",2:"text-xl lg:text-2xl",3:"text-lg lg:text-xl",4:"text-base lg:text-lg",5:"text-sm lg:text-base",6:"text-xs lg:text-sm"}},defaultVariants:{level:2}});function sm({className:e,level:t=2,as:r,children:n,...s}){const a=r||`h${t}`;return o.jsx(a,{className:b(Oa({level:t}),e),...s,children:n})}const Ha=ze("",{variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},variant:{default:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",destructive:"text-destructive",success:"text-green-600 dark:text-green-400"},leading:{tight:"leading-tight",normal:"leading-normal",relaxed:"leading-relaxed"}},defaultVariants:{size:"base",weight:"normal",variant:"default",leading:"normal"}});function am({className:e,size:t,weight:r,variant:n,leading:s,as:a="p",children:i,...l}){return o.jsx(a,{className:b(Ha({size:t,weight:r,variant:n,leading:s}),e),...l,children:i})}function im({className:e,...t}){return o.jsx("code",{className:b("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm",e),...t})}function lm({className:e,...t}){return o.jsx("blockquote",{className:b("border-l-4 border-primary pl-4 italic text-muted-foreground",e),...t})}function cm({className:e,...t}){return o.jsx("p",{className:b("text-xl text-muted-foreground",e),...t})}function dm({className:e,...t}){return o.jsx("p",{className:b("text-sm text-muted-foreground",e),...t})}const Ga=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("w-full h-full min-h-[300px]",e),...r,children:o.jsx(Gr.ResponsiveContainer,{width:"100%",height:"100%",children:t})}));Ga.displayName="ChartContainer";const um=Gr.Tooltip,mm=Gr.Legend,qa=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex flex-col space-y-4",e),...t}));qa.displayName="Timeline";const Wa=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("relative flex gap-4 pb-4 last:pb-0",e),...t}));Wa.displayName="TimelineItem";const Ua=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border bg-background text-primary shadow-sm",e),...t}));Ua.displayName="TimelineIcon";const Ka=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("absolute left-4 top-8 -bottom-4 w-px bg-border",e),...t}));Ka.displayName="TimelineConnector";const Xa=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex-1 space-y-1 pt-1",e),...t}));Xa.displayName="TimelineContent";const Ya=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("grid min-h-screen w-full lg:grid-cols-[280px_1fr]",e),...r,children:t}));Ya.displayName="AppShell";const Za=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("hidden border-r bg-muted/40 lg:block dark:bg-muted/10",e),...r,children:o.jsx("div",{className:"flex h-full max-h-screen flex-col gap-2",children:t})}));Za.displayName="Sidebar";const Ja=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("header",{ref:n,className:b("flex h-14 items-center gap-4 border-b bg-background px-6 lg:h-[60px]",e),...r,children:t}));Ja.displayName="Header";const Qa=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("main",{ref:n,className:b("flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6",e),...r,children:t}));Qa.displayName="Main";function fm({title:e,value:t,description:r,trend:n,trendLabel:s,icon:a,className:i,...l}){return o.jsxs(Jr,{className:b("overflow-hidden",i),...l,children:[o.jsxs(Qr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(en,{className:"text-sm font-medium text-muted-foreground",children:e}),a&&o.jsx("div",{className:"text-muted-foreground",children:a})]}),o.jsxs(tn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:t}),(r||n!==void 0)&&o.jsxs("div",{className:"text-xs flex items-center gap-1 mt-1 text-muted-foreground",children:[n!==void 0&&o.jsxs("span",{className:b("flex items-center font-medium",n>0?"text-green-500":n<0?"text-red-500":"text-muted-foreground"),children:[n>0?o.jsx(I.TrendingUp,{className:"mr-1 h-3 w-3"}):n<0?o.jsx(I.TrendingDown,{className:"mr-1 h-3 w-3"}):o.jsx(I.Minus,{className:"mr-1 h-3 w-3"}),n>0?"+":"",n,"%"]}),s&&o.jsx("span",{children:s}),r&&!n&&o.jsx("span",{children:r})]})]})]})}const ei=p.forwardRef(({className:e,label:t,value:r,...n},s)=>{const[a,i]=p.useState(!1),l=()=>{navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx(lr,{children:t}),o.jsxs("div",{className:"flex gap-2 relative",children:[o.jsx(st,{ref:s,value:r,readOnly:!0,className:b("pr-10 font-mono text-sm",e),...n}),o.jsx(ve,{size:"icon",variant:"outline",className:"shrink-0",onClick:l,children:a?o.jsx(I.Check,{className:"h-4 w-4 text-green-500"}):o.jsx(I.Copy,{className:"h-4 w-4"})})]})]})});ei.displayName="CopyInput";const ti=p.forwardRef(({className:e,data:t,...r},n)=>o.jsx("pre",{ref:n,className:b("rounded-lg border bg-muted p-4 overflow-auto text-xs font-mono text-muted-foreground",e),...r,children:JSON.stringify(t,null,2)}));ti.displayName="JsonViewer";const gm=ze("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{status:{neutral:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400 hover:bg-green-500/25",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/25",error:"border-transparent bg-red-500/15 text-red-700 dark:text-red-400 hover:bg-red-500/25",info:"border-transparent bg-blue-500/15 text-blue-700 dark:text-blue-400 hover:bg-blue-500/25"}},defaultVariants:{status:"neutral"}});function pm({className:e,status:t,dot:r=!0,children:n,...s}){return o.jsxs("div",{className:b(gm({status:t}),e),...s,children:[r&&o.jsx("span",{className:b("mr-1.5 h-2 w-2 rounded-full",{"bg-current":!0})}),n]})}const pr=p.forwardRef(({src:e,data:t,stream:r,color:n,progressColor:s,progress:a=0,height:i=80,barCount:l=100,barWidth:c=3,barGap:d=1,barRadius:g=2,mirrored:u=!1,onSeek:f,className:m,...h},x)=>{const y=p.useRef(null),[w,v]=p.useState([]),j=p.useRef(0),R=te();p.useEffect(()=>{if(!e)return;const C=new AudioContext;let k=!1;return fetch(e).then(N=>N.arrayBuffer()).then(N=>C.decodeAudioData(N)).then(N=>{if(k)return;const S=N.getChannelData(0),_=Math.floor(S.length/l),D=[];for(let B=0;B<l;B++){let P=0;for(let q=0;q<_;q++)P+=Math.abs(S[B*_+q]);D.push(P/_)}const F=Math.max(...D,.01);v(D.map(B=>B/F))}).catch(()=>{}),()=>{k=!0,C.close()}},[e,l]),p.useEffect(()=>{if(t){const C=Math.max(...t,.01);v(t.map(k=>k/C))}},[t]),p.useEffect(()=>{if(!r)return;const C=new AudioContext,k=C.createMediaStreamSource(r),N=C.createAnalyser();N.fftSize=256,k.connect(N);const S=new Uint8Array(N.frequencyBinCount),_=()=>{N.getByteFrequencyData(S);const D=Math.floor(S.length/l),F=[];for(let B=0;B<l;B++)F.push(S[B*D]/255);v(F),j.current=requestAnimationFrame(_)};return j.current=requestAnimationFrame(_),()=>{cancelAnimationFrame(j.current),k.disconnect(),C.close()}},[r,l]),p.useEffect(()=>{const C=y.current;if(!C||w.length===0)return;const k=C.getContext("2d");if(!k)return;const N=window.devicePixelRatio||1,S=C.getBoundingClientRect();C.width=S.width*N,C.height=S.height*N,k.scale(N,N),k.clearRect(0,0,S.width,S.height);const _=getComputedStyle(C),D=n||_.getPropertyValue("--muted-foreground").trim()||"#888",F=s||_.getPropertyValue("--primary").trim()||"#7c3aed",B=c+d,P=Math.max(0,(S.width-w.length*B)/2);for(let q=0;q<w.length;q++){const V=Math.max(2,w[q]*(u?S.height/2:S.height*.9)),A=P+q*B,T=q/w.length<=a;if(k.fillStyle=T?F:D,u){const oe=S.height/2-V;Pr(k,A,oe,c,V,g),k.fill(),Pr(k,A,S.height/2,c,V,g),k.fill()}else{const oe=S.height-V;Pr(k,A,oe,c,V,g),k.fill()}}},[w,a,n,s,c,d,g,u,i]);const M=C=>{if(!f||!y.current)return;const k=y.current.getBoundingClientRect(),N=(C.clientX-k.left)/k.width;f(Math.max(0,Math.min(1,N)))};return o.jsx("div",{ref:x,className:b("relative w-full",m),role:"img","aria-label":R.audioWaveform_label,...h,children:o.jsx("canvas",{ref:y,style:{width:"100%",height:i},className:b(f&&"cursor-pointer"),onClick:M})})});pr.displayName="AudioWaveform";function Pr(e,t,r,n,s,a){e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+s-a),e.quadraticCurveTo(t+n,r+s,t+n-a,r+s),e.lineTo(t+a,r+s),e.quadraticCurveTo(t,r+s,t,r+s-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}const ri=ze("flex items-center gap-3 rounded-lg border bg-card p-3 text-card-foreground shadow-sm",{variants:{size:{sm:"p-2 gap-2",default:"p-3 gap-3",lg:"p-4 gap-4"}},defaultVariants:{size:"default"}}),hm={sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"};function _n({src:e,title:t,artist:r,albumArt:n,showWaveform:s=!1,showVolume:a=!0,defaultVolume:i=1,autoPlay:l=!1,loop:c=!1,preload:d="metadata",size:g="default",onPlay:u,onPause:f,onEnded:m,onTimeUpdate:h,className:x}){const y=p.useRef(null),w=p.useRef(null),[v,j]=p.useState(!1),[R,M]=p.useState(0),[C,k]=p.useState(0),[N,S]=p.useState(i),[_,D]=p.useState(!1),[F,B]=p.useState(!1),P=te(),q=hm[g??"default"];p.useEffect(()=>{const L=y.current;if(!L)return;const H=()=>k(L.duration),Z=()=>{F||(M(L.currentTime),h==null||h(L.currentTime))},O=()=>{j(!0),u==null||u()},X=()=>{j(!1),f==null||f()},ce=()=>{j(!1),m==null||m()};return L.addEventListener("loadedmetadata",H),L.addEventListener("timeupdate",Z),L.addEventListener("play",O),L.addEventListener("pause",X),L.addEventListener("ended",ce),()=>{L.removeEventListener("loadedmetadata",H),L.removeEventListener("timeupdate",Z),L.removeEventListener("play",O),L.removeEventListener("pause",X),L.removeEventListener("ended",ce)}},[F,u,f,m,h]),p.useEffect(()=>{const L=y.current;L&&(L.volume=_?0:N)},[N,_]);const V=()=>{const L=y.current;L&&(v?L.pause():L.play())},A=L=>{const H=y.current;!H||!C||(H.currentTime=L*C,M(H.currentTime))},T=L=>{if(!w.current)return;const H=w.current.getBoundingClientRect();A((L.clientX-H.left)/H.width)},oe=L=>{var H,Z;B(!0),(Z=(H=L.target).setPointerCapture)==null||Z.call(H,L.pointerId)};p.useEffect(()=>{if(!F)return;const L=Z=>{if(!w.current)return;const O=w.current.getBoundingClientRect(),X=Math.max(0,Math.min(1,(Z.clientX-O.left)/O.width));A(X)},H=()=>B(!1);return document.addEventListener("pointermove",L),document.addEventListener("pointerup",H),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",H)}},[F,C]);const K=L=>{if(!y.current||!C)return;const H=L.shiftKey?10:5;L.key==="ArrowLeft"?(L.preventDefault(),y.current.currentTime=Math.max(0,R-H)):L.key==="ArrowRight"&&(L.preventDefault(),y.current.currentTime=Math.min(C,R+H))},Y=()=>D(L=>!L),ee=_||N===0?I.VolumeX:N<.5?I.Volume1:I.Volume2,z=C?R/C:0;return o.jsxs("div",{className:b(ri({size:g}),x),children:[o.jsx("audio",{ref:y,src:e,autoPlay:l,loop:c,preload:d}),n&&o.jsx("img",{src:n,alt:"",className:b("rounded object-cover shrink-0",g==="sm"?"h-8 w-8":g==="lg"?"h-14 w-14":"h-10 w-10")}),o.jsx("button",{type:"button",onClick:V,className:"shrink-0 flex items-center justify-center rounded-full bg-primary text-primary-foreground hover:bg-primary/90 transition-colors h-8 w-8","aria-label":v?P.audioPlayer_pause:P.audioPlayer_play,children:v?o.jsx(I.Pause,{className:q}):o.jsx(I.Play,{className:b(q,"ml-0.5")})}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[(t||r)&&o.jsxs("div",{className:"flex items-center gap-2 text-xs leading-tight",children:[t&&o.jsx("span",{className:"font-medium truncate",children:t}),r&&o.jsx("span",{className:"text-muted-foreground truncate",children:r})]}),s?o.jsx(pr,{src:e,progress:z,height:g==="sm"?24:g==="lg"?40:32,barCount:60,onSeek:A}):o.jsxs("div",{ref:w,className:"relative h-1.5 bg-muted rounded-full cursor-pointer group",onClick:T,onPointerDown:oe,onKeyDown:K,role:"slider","aria-label":P.audioPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(C),"aria-valuenow":Math.round(R),"aria-valuetext":We(R),tabIndex:0,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full transition-[width] duration-75",style:{width:`${z*100}%`}}),o.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover:opacity-100 transition-opacity",style:{left:`${z*100}%`,transform:"translate(-50%, -50%)"}})]}),o.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground tabular-nums",children:[o.jsx("span",{children:We(R)}),o.jsx("span",{children:We(C)})]})]}),a&&o.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 group/volume",children:[o.jsx("button",{type:"button",onClick:Y,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":_?P.audioPlayer_unmute:P.audioPlayer_mute,children:o.jsx(ee,{className:q})}),o.jsx("input",{type:"range",min:0,max:1,step:.01,value:_?0:N,onChange:L=>{S(Number(L.target.value)),D(!1)},className:"w-16 h-1 accent-primary cursor-pointer opacity-0 group-hover/volume:opacity-100 transition-opacity","aria-label":P.audioPlayer_volume})]})]})}function xm({mimeType:e="audio/webm",maxDuration:t,showWaveform:r=!0,onRecordingComplete:n,onRecordingStart:s,onError:a,className:i}){const[l,c]=p.useState("idle"),[d,g]=p.useState(0),[u,f]=p.useState(null),[m,h]=p.useState(null),x=p.useRef(null),y=p.useRef([]),w=p.useRef(null),v=te(),j=p.useCallback(()=>{w.current&&(clearInterval(w.current),w.current=null),m&&(m.getTracks().forEach(D=>D.stop()),h(null)),u&&URL.revokeObjectURL(u)},[m,u]);p.useEffect(()=>j,[]);const R=()=>{w.current=setInterval(()=>{g(D=>{const F=D+1;return t&&F>=t&&k(),F})},1e3)},M=()=>{w.current&&(clearInterval(w.current),w.current=null)},C=async()=>{try{const D=await navigator.mediaDevices.getUserMedia({audio:!0});h(D),y.current=[],g(0),u&&(URL.revokeObjectURL(u),f(null));const F=MediaRecorder.isTypeSupported(e)?e:"",B=new MediaRecorder(D,F?{mimeType:F}:void 0);B.ondataavailable=P=>{P.data.size>0&&y.current.push(P.data)},B.onstop=()=>{const P=new Blob(y.current,{type:F||"audio/webm"}),q=URL.createObjectURL(P);f(q),n==null||n(P),D.getTracks().forEach(V=>V.stop()),h(null)},x.current=B,B.start(100),c("recording"),R(),s==null||s()}catch(D){a==null||a(D instanceof Error?D:new Error(String(D)))}},k=()=>{x.current&&x.current.state!=="inactive"&&x.current.stop(),M(),c("stopped")},N=()=>{x.current&&x.current.state==="recording"&&(x.current.pause(),M(),c("paused"))},S=()=>{x.current&&x.current.state==="paused"&&(x.current.resume(),R(),c("recording"))},_=()=>{j(),g(0),f(null),c("idle")};return o.jsx("div",{className:b("space-y-3 rounded-lg border bg-card p-4 text-card-foreground shadow-sm",i),children:l==="stopped"&&u?o.jsxs("div",{className:"space-y-3",children:[o.jsx(_n,{src:u,size:"sm"}),o.jsxs("button",{type:"button",onClick:_,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(I.RotateCcw,{className:"h-4 w-4"}),v.audioRecorder_reRecord]})]}):o.jsxs(o.Fragment,{children:[r&&m&&l==="recording"&&o.jsx(pr,{stream:m,height:48,barCount:50,className:"rounded"}),o.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l==="idle"&&o.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors","aria-label":v.audioRecorder_startRecording,children:[o.jsx(I.Mic,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:v.audioRecorder_startRecording})]}),(l==="recording"||l==="paused")&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm font-mono tabular-nums text-muted-foreground min-w-[60px] text-center","aria-live":"off",children:[l==="recording"&&o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-destructive animate-pulse mr-2"}),We(d)]}),l==="recording"?o.jsx("button",{type:"button",onClick:N,className:"p-2 rounded-full hover:bg-accent transition-colors","aria-label":v.audioRecorder_pauseRecording,children:o.jsx(I.Pause,{className:"h-5 w-5"})}):o.jsx("button",{type:"button",onClick:S,className:"p-2 rounded-full hover:bg-accent transition-colors","aria-label":v.audioRecorder_resumeRecording,children:o.jsx(I.Play,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:k,className:"p-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors","aria-label":v.audioRecorder_stopRecording,children:o.jsx(I.Square,{className:"h-5 w-5"})})]})]}),t&&(l==="recording"||l==="paused")&&o.jsx("div",{className:"w-full bg-muted rounded-full h-1",children:o.jsx("div",{className:"bg-destructive rounded-full h-1 transition-[width] duration-1000",style:{width:`${Math.min(100,d/t*100)}%`}})})]})})}function bm({tracks:e,showWaveform:t=!1,defaultRepeatMode:r="none",defaultShuffle:n=!1,autoPlay:s=!1,onTrackChange:a,onPlayStateChange:i,className:l}){const[c,d]=p.useState(0),[g,u]=p.useState(r),[f,m]=p.useState(n),[h,x]=p.useState([]),y=te();p.useEffect(()=>{if(f){const S=Array.from({length:e.length},(_,D)=>D);for(let _=S.length-1;_>0;_--){const D=Math.floor(Math.random()*(_+1));[S[_],S[D]]=[S[D],S[_]]}x(S)}},[f,e.length]);const w=p.useCallback((S,_=1)=>{if(f){const B=h.indexOf(S)+_;return B>=0&&B<h.length?h[B]:g==="all"?_===1?h[0]:h[h.length-1]:null}const D=S+_;return D>=0&&D<e.length?D:g==="all"?_===1?0:e.length-1:null},[f,h,e.length,g]),v=S=>{d(S),a==null||a(e[S],S)},j=()=>{if(g==="one")return;const S=w(c,1);S!==null&&v(S)},R=()=>{const S=w(c,-1);S!==null&&v(S)},M=()=>{const S=w(c,1);S!==null&&v(S)},C=()=>{u(S=>S==="none"?"all":S==="all"?"one":"none")},k=g==="none"?y.audioPlaylist_repeatOff:g==="all"?y.audioPlaylist_repeatAll:y.audioPlaylist_repeatOne,N=e[c];return N?o.jsxs("div",{className:b("rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",l),children:[o.jsxs("div",{className:"p-3 border-b space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3",children:[o.jsx("button",{type:"button",onClick:()=>m(S=>!S),className:b("p-1.5 rounded hover:bg-accent transition-colors",f&&"text-primary"),"aria-label":y.audioPlaylist_shuffle,"aria-pressed":f,children:o.jsx(I.Shuffle,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:R,className:"p-1.5 rounded hover:bg-accent transition-colors","aria-label":y.audioPlaylist_previousTrack,children:o.jsx(I.SkipBack,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:M,className:"p-1.5 rounded hover:bg-accent transition-colors","aria-label":y.audioPlaylist_nextTrack,children:o.jsx(I.SkipForward,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:C,className:b("p-1.5 rounded hover:bg-accent transition-colors",g!=="none"&&"text-primary"),"aria-label":k,children:g==="one"?o.jsx(I.Repeat1,{className:"h-4 w-4"}):o.jsx(I.Repeat,{className:"h-4 w-4"})})]}),o.jsx(_n,{src:N.src,title:N.title,artist:N.artist,albumArt:N.albumArt,showWaveform:t,autoPlay:s||c>0,loop:g==="one",onEnded:j,onPlay:()=>i==null?void 0:i(!0),onPause:()=>i==null?void 0:i(!1),size:"sm",className:"border-0 shadow-none p-0"},N.id)]}),o.jsx(cr,{className:"max-h-64",children:o.jsx("div",{role:"list",className:"divide-y",children:e.map((S,_)=>o.jsxs("button",{type:"button",role:"listitem",onClick:()=>v(_),"aria-current":_===c?"true":void 0,className:b("w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-accent/50 transition-colors",_===c&&"bg-accent"),children:[S.albumArt?o.jsx("img",{src:S.albumArt,alt:"",className:"h-8 w-8 rounded object-cover shrink-0"}):o.jsx("div",{className:"h-8 w-8 rounded bg-muted flex items-center justify-center shrink-0",children:o.jsx(I.Music,{className:"h-4 w-4 text-muted-foreground"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:S.title}),S.artist&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.artist})]}),S.duration!==void 0&&o.jsx("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:We(S.duration)})]},S.id))})}),e.length>1&&o.jsx("div",{className:"px-3 py-1.5 border-t text-xs text-muted-foreground text-center",children:De(y.audioPlaylist_trackOf,{current:String(c+1),total:String(e.length)})})]}):null}function hr({src:e,poster:t,showControls:r=!0,controlsTimeout:n=3e3,enablePiP:s=!0,enableFullscreen:a=!0,enablePlaybackRate:i=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],tracks:c,aspectRatio:d="16/9",autoPlay:g=!1,loop:u=!1,muted:f=!1,preload:m="metadata",onPlay:h,onPause:x,onEnded:y,onTimeUpdate:w,onFullscreenChange:v,className:j}){const R=p.useRef(null),M=p.useRef(null),C=p.useRef(null),k=p.useRef(null),[N,S]=p.useState(!1),[_,D]=p.useState(0),[F,B]=p.useState(0),[P,q]=p.useState(0),[V,A]=p.useState(1),[T,oe]=p.useState(f),[K,Y]=p.useState(!1),[ee,z]=p.useState(!0),[L,H]=p.useState(!1),[Z,O]=p.useState(1),[X,ce]=p.useState(!1),ae=te(),ie=typeof document<"u"&&"pictureInPictureEnabled"in document;p.useEffect(()=>{const $=M.current;if(!$)return;const re=()=>B($.duration),Ne=()=>{X||(D($.currentTime),w==null||w($.currentTime)),$.buffered.length>0&&q($.buffered.end($.buffered.length-1))},Xe=()=>{S(!0),h==null||h()},Ye=()=>{S(!1),x==null||x()},_e=()=>{S(!1),y==null||y()};return $.addEventListener("loadedmetadata",re),$.addEventListener("timeupdate",Ne),$.addEventListener("play",Xe),$.addEventListener("pause",Ye),$.addEventListener("ended",_e),()=>{$.removeEventListener("loadedmetadata",re),$.removeEventListener("timeupdate",Ne),$.removeEventListener("play",Xe),$.removeEventListener("pause",Ye),$.removeEventListener("ended",_e)}},[X,h,x,y,w]),p.useEffect(()=>{const $=M.current;$&&($.volume=T?0:V)},[V,T]),p.useEffect(()=>{const $=()=>{const re=!!document.fullscreenElement;Y(re),v==null||v(re)};return document.addEventListener("fullscreenchange",$),()=>document.removeEventListener("fullscreenchange",$)},[v]);const G=p.useCallback(()=>{z(!0),k.current&&clearTimeout(k.current),N&&(k.current=setTimeout(()=>z(!1),n))},[N,n]),le=()=>{const $=M.current;$&&(N?$.pause():$.play())},de=$=>{const re=M.current;!re||!F||(re.currentTime=$*F,D(re.currentTime))},we=$=>{if(!C.current)return;const re=C.current.getBoundingClientRect();de(($.clientX-re.left)/re.width)},Pe=$=>{var re,Ne;ce(!0),(Ne=(re=$.target).setPointerCapture)==null||Ne.call(re,$.pointerId)};p.useEffect(()=>{if(!X)return;const $=Ne=>{if(!C.current)return;const Xe=C.current.getBoundingClientRect();de(Math.max(0,Math.min(1,(Ne.clientX-Xe.left)/Xe.width)))},re=()=>ce(!1);return document.addEventListener("pointermove",$),document.addEventListener("pointerup",re),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",re)}},[X,F]);const ye=()=>{var $,re;R.current&&(document.fullscreenElement?document.exitFullscreen():(re=($=R.current).requestFullscreen)==null||re.call($))},$e=async()=>{const $=M.current;if($)try{document.pictureInPictureElement?await document.exitPictureInPicture():await $.requestPictureInPicture()}catch{}},xe=()=>oe($=>!$),Oe=$=>{const re=M.current;re&&(re.playbackRate=$),O($),H(!1)},Qe=$=>{const re=M.current;if(re){switch($.key){case" ":case"k":$.preventDefault(),le();break;case"f":$.preventDefault(),ye();break;case"m":$.preventDefault(),xe();break;case"ArrowLeft":$.preventDefault(),re.currentTime=Math.max(0,re.currentTime-5);break;case"ArrowRight":$.preventDefault(),re.currentTime=Math.min(F,re.currentTime+5);break;case"ArrowUp":$.preventDefault(),A(Ne=>Math.min(1,Ne+.1)),oe(!1);break;case"ArrowDown":$.preventDefault(),A(Ne=>Math.max(0,Ne-.1));break;case"c":if($.preventDefault(),re.textTracks.length>0){const Ne=re.textTracks[0];Ne.mode=Ne.mode==="showing"?"hidden":"showing"}break}G()}},je=T||V===0?I.VolumeX:V<.5?I.Volume1:I.Volume2,Fe=F?_/F:0,gt=F?P/F:0;return o.jsxs("div",{ref:R,className:b("relative group bg-black rounded-lg overflow-hidden",j),style:{aspectRatio:d},onMouseMove:G,onMouseLeave:()=>N&&z(!1),onKeyDown:Qe,tabIndex:0,role:"application","aria-label":ae.videoPlayer_label,children:[o.jsx("video",{ref:M,src:e,poster:t,autoPlay:g,loop:u,muted:f,preload:m,className:"w-full h-full object-contain",onClick:le,onDoubleClick:ye,children:c==null?void 0:c.map(($,re)=>o.jsx("track",{src:$.src,kind:$.kind,srcLang:$.srcLang,label:$.label,default:$.default},re))}),!N&&r&&o.jsx("button",{type:"button",onClick:le,className:"absolute inset-0 flex items-center justify-center z-10","aria-label":ae.videoPlayer_play,children:o.jsx("div",{className:"h-16 w-16 rounded-full bg-black/50 flex items-center justify-center backdrop-blur-sm hover:bg-black/70 transition-colors",children:o.jsx(I.Play,{className:"h-8 w-8 text-white ml-1"})})}),r&&o.jsxs("div",{className:b("absolute bottom-0 left-0 right-0 z-20 bg-gradient-to-t from-black/80 to-transparent pt-8 pb-2 px-3 transition-opacity duration-200",ee||!N?"opacity-100":"opacity-0 pointer-events-none"),children:[o.jsxs("div",{ref:C,className:"relative h-1 bg-white/20 rounded-full cursor-pointer mb-2 group/seek",onClick:we,onPointerDown:Pe,role:"slider","aria-label":ae.videoPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(F),"aria-valuenow":Math.round(_),"aria-valuetext":We(_),tabIndex:0,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 bg-white/30 rounded-full",style:{width:`${gt*100}%`}}),o.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full",style:{width:`${Fe*100}%`}}),o.jsx("div",{className:"absolute top-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover/seek:opacity-100 transition-opacity",style:{left:`${Fe*100}%`,transform:"translate(-50%, -50%)"}})]}),o.jsxs("div",{className:"flex items-center gap-2 text-white",children:[o.jsx("button",{type:"button",onClick:le,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":N?ae.videoPlayer_pause:ae.videoPlayer_play,children:N?o.jsx(I.Pause,{className:"h-5 w-5"}):o.jsx(I.Play,{className:"h-5 w-5"})}),o.jsxs("span",{className:"text-xs tabular-nums",children:[We(_)," / ",We(F)]}),o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"flex items-center gap-1 group/vol",children:[o.jsx("button",{type:"button",onClick:xe,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":T?ae.videoPlayer_unmute:ae.videoPlayer_mute,children:o.jsx(je,{className:"h-5 w-5"})}),o.jsx("input",{type:"range",min:0,max:1,step:.01,value:T?0:V,onChange:$=>{A(Number($.target.value)),oe(!1)},className:"w-16 h-1 accent-white cursor-pointer opacity-0 group-hover/vol:opacity-100 transition-opacity","aria-label":ae.videoPlayer_volume})]}),i&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>H($=>!$),className:"px-1.5 py-0.5 text-xs hover:bg-white/10 rounded transition-colors","aria-label":ae.videoPlayer_playbackSpeed,children:[Z,"x"]}),L&&o.jsx("div",{className:"absolute bottom-full right-0 mb-1 bg-black/90 rounded-md border border-white/10 py-1 min-w-[60px]",children:l.map($=>o.jsxs("button",{type:"button",onClick:()=>Oe($),className:b("block w-full px-3 py-1 text-xs text-left hover:bg-white/10 transition-colors",$===Z&&"text-primary"),children:[$,"x"]},$))})]}),c&&c.length>0&&o.jsx("button",{type:"button",onClick:()=>{const $=M.current;if($&&$.textTracks.length>0){const re=$.textTracks[0];re.mode=re.mode==="showing"?"hidden":"showing"}},className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":ae.videoPlayer_subtitles,children:o.jsx(I.Subtitles,{className:"h-5 w-5"})}),s&&ie&&o.jsx("button",{type:"button",onClick:$e,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":ae.videoPlayer_pictureInPicture,children:o.jsx(I.PictureInPicture2,{className:"h-5 w-5"})}),a&&o.jsx("button",{type:"button",onClick:ye,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":K?ae.videoPlayer_exitFullscreen:ae.videoPlayer_fullscreen,children:K?o.jsx(I.Minimize,{className:"h-5 w-5"}):o.jsx(I.Maximize,{className:"h-5 w-5"})})]})]})]})}function vm({source:e="camera",videoConstraints:t,audioConstraints:r=!0,mimeType:n="video/webm",maxDuration:s,showTimer:a=!0,mirrored:i,onRecordingComplete:l,onRecordingStart:c,onError:d,className:g}){const[u,f]=p.useState("idle"),[m,h]=p.useState(0),[x,y]=p.useState(null),[w,v]=p.useState(null),j=p.useRef(null),R=p.useRef(null),M=p.useRef([]),C=p.useRef(null),k=te(),N=i!==void 0?i:e==="camera",S=p.useCallback(()=>{C.current&&(clearInterval(C.current),C.current=null),w&&(w.getTracks().forEach(T=>T.stop()),v(null)),x&&URL.revokeObjectURL(x)},[w,x]);p.useEffect(()=>S,[]);const _=()=>{C.current=setInterval(()=>{h(T=>{const oe=T+1;return s&&oe>=s&&P(),oe})},1e3)},D=()=>{C.current&&(clearInterval(C.current),C.current=null)},F=async()=>{try{let T;e==="screen"?T=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:r}):T=await navigator.mediaDevices.getUserMedia({video:t||!0,audio:r}),T.getVideoTracks().forEach(oe=>{oe.addEventListener("ended",()=>{S(),f("idle")})}),v(T),f("preview"),j.current&&(j.current.srcObject=T)}catch(T){d==null||d(T instanceof Error?T:new Error(String(T)))}};p.useEffect(()=>{j.current&&w&&(u==="preview"||u==="recording"||u==="paused")&&(j.current.srcObject=w)},[w,u]);const B=()=>{if(!w)return;M.current=[],h(0),x&&(URL.revokeObjectURL(x),y(null));const T=MediaRecorder.isTypeSupported(n)?n:"",oe=new MediaRecorder(w,T?{mimeType:T}:void 0);oe.ondataavailable=K=>{K.data.size>0&&M.current.push(K.data)},oe.onstop=()=>{const K=new Blob(M.current,{type:T||"video/webm"}),Y=URL.createObjectURL(K);y(Y),l==null||l(K),w.getTracks().forEach(ee=>ee.stop()),v(null)},R.current=oe,oe.start(100),f("recording"),_(),c==null||c()},P=()=>{R.current&&R.current.state!=="inactive"&&R.current.stop(),D(),f("stopped")},q=()=>{R.current&&R.current.state==="recording"&&(R.current.pause(),D(),f("paused"))},V=()=>{R.current&&R.current.state==="paused"&&(R.current.resume(),_(),f("recording"))},A=()=>{S(),h(0),y(null),f("idle")};return o.jsx("div",{className:b("space-y-3 rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",g),children:u==="stopped"&&x?o.jsxs("div",{className:"space-y-3",children:[o.jsx(hr,{src:x,aspectRatio:"16/9"}),o.jsx("div",{className:"px-4 pb-3",children:o.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(I.RotateCcw,{className:"h-4 w-4"}),k.videoRecorder_reRecord]})})]}):u==="idle"?o.jsx("div",{className:"flex items-center justify-center gap-3 p-8",children:o.jsx("button",{type:"button",onClick:F,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:e==="screen"?o.jsxs(o.Fragment,{children:[o.jsx(I.Monitor,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:k.videoRecorder_shareScreen})]}):o.jsxs(o.Fragment,{children:[o.jsx(I.Camera,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:k.videoRecorder_startCamera})]})})}):o.jsxs("div",{className:"relative",children:[o.jsx("video",{ref:j,autoPlay:!0,muted:!0,playsInline:!0,className:b("w-full",N&&"scale-x-[-1]"),style:{aspectRatio:"16/9"},"aria-label":e==="camera"?k.videoRecorder_cameraPreview:k.videoRecorder_screenPreview}),a&&(u==="recording"||u==="paused")&&o.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 px-2 py-1 rounded bg-black/60 text-white text-sm tabular-nums",children:[u==="recording"&&o.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),We(m)]}),o.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-3",children:[u==="preview"&&o.jsx("button",{type:"button",onClick:B,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":k.videoRecorder_startRecording,children:o.jsx(I.Circle,{className:"h-5 w-5 text-white fill-white"})}),u==="recording"&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:q,className:"p-2 rounded-full bg-black/50 hover:bg-black/70 text-white transition-colors","aria-label":k.videoRecorder_pauseRecording,children:o.jsx(I.Pause,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:P,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":k.videoRecorder_stopRecording,children:o.jsx(I.Square,{className:"h-5 w-5 text-white fill-white"})})]}),u==="paused"&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:V,className:"p-2 rounded-full bg-black/50 hover:bg-black/70 text-white transition-colors","aria-label":k.videoRecorder_resumeRecording,children:o.jsx(I.Play,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:P,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":k.videoRecorder_stopRecording,children:o.jsx(I.Square,{className:"h-5 w-5 text-white fill-white"})})]})]}),s&&(u==="recording"||u==="paused")&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-white/20",children:o.jsx("div",{className:"h-full bg-red-500 transition-[width] duration-1000",style:{width:`${Math.min(100,m/s*100)}%`}})})]})})}const Mn=p.forwardRef(({src:e,poster:t,title:r,duration:n,clickAction:s="inline",aspectRatio:a="16/9",showDuration:i=!0,showPlayButton:l=!0,onPlay:c,className:d,...g},u)=>{const[f,m]=p.useState(!1),[h,x]=p.useState(null),y=te();p.useEffect(()=>{if(t||!e)return;const M=document.createElement("video");M.crossOrigin="anonymous",M.preload="metadata",M.muted=!0;const C=()=>{try{const k=document.createElement("canvas");k.width=M.videoWidth,k.height=M.videoHeight;const N=k.getContext("2d");N&&(N.drawImage(M,0,0),x(k.toDataURL("image/jpeg",.7)))}catch{}M.remove()};return M.addEventListener("seeked",C,{once:!0}),M.addEventListener("loadedmetadata",()=>{M.currentTime=Math.min(1,M.duration*.1)},{once:!0}),M.src=e,()=>{M.removeEventListener("seeked",C),M.remove()}},[e,t]);const w=()=>{s==="inline"?(m(!0),c==null||c()):s==="none"&&(c==null||c())},v=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),w())},j=t||h,R=r?De(y.videoThumbnail_play,{title:r}):y.videoPlayer_play;return f&&s==="inline"?o.jsx("div",{ref:u,className:b("rounded-lg overflow-hidden bg-black",d),style:{aspectRatio:a},...g,children:o.jsx(hr,{src:e,autoPlay:!0,aspectRatio:a})}):o.jsxs("div",{ref:u,className:b("relative rounded-lg overflow-hidden bg-muted cursor-pointer group",d),style:{aspectRatio:a},onClick:w,onKeyDown:v,role:"button",tabIndex:0,"aria-label":R,...g,children:[j?o.jsx("img",{src:j,alt:r||"",className:"w-full h-full object-cover",draggable:!1}):o.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:o.jsx(I.Play,{className:"h-8 w-8 text-muted-foreground"})}),l&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 rounded-full bg-black/50 flex items-center justify-center backdrop-blur-sm group-hover:bg-black/70 group-hover:scale-110 transition-all",children:o.jsx(I.Play,{className:"h-6 w-6 text-white ml-0.5"})})}),i&&n!==void 0&&o.jsx("span",{className:"absolute bottom-2 right-2 px-1.5 py-0.5 rounded bg-black/70 text-white text-xs tabular-nums",children:We(n)}),r&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent p-2 pt-6",children:o.jsx("p",{className:"text-white text-sm font-medium truncate",children:r})})]})});Mn.displayName="VideoThumbnail";const ni=p.forwardRef(({videos:e,columns:t=3,gap:r=4,aspectRatio:n="16/9",clickAction:s="lightbox",onVideoSelect:a,className:i,...l},c)=>{const[d,g]=p.useState(null),u=te(),f=typeof t=="number"?t:t.md||t.sm||3,m=(v,j)=>{a==null||a(v,j),s==="lightbox"&&g(j)},h=()=>g(null),x=()=>{d!==null&&g(d>0?d-1:e.length-1)},y=()=>{d!==null&&g(d<e.length-1?d+1:0)};p.useEffect(()=>{if(d===null)return;const v=j=>{switch(j.key){case"Escape":h();break;case"ArrowLeft":x();break;case"ArrowRight":y();break}};return document.addEventListener("keydown",v),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}},[d]);const w=typeof t=="number"?{gridTemplateColumns:`repeat(${t}, minmax(0, 1fr))`}:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:c,className:b("grid",i),style:{...w,gap:`${r*4}px`},role:"list","aria-label":u.videoGallery_label,...l,children:e.map((v,j)=>o.jsx(Mn,{src:v.src,poster:v.poster,title:v.title,duration:v.duration,aspectRatio:n,clickAction:"none",onPlay:()=>m(v,j),role:"listitem"},v.id))}),s==="lightbox"&&d!==null&&e[d]&&Hr.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/90",onClick:v=>{v.target===v.currentTarget&&h()},role:"dialog","aria-modal":"true","aria-label":u.videoGallery_label,children:[o.jsx("button",{type:"button",onClick:h,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_close,children:o.jsx(I.X,{className:"h-5 w-5"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:x,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_previous,children:o.jsx(I.ChevronLeft,{className:"h-6 w-6"})}),o.jsx("button",{type:"button",onClick:y,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_next,children:o.jsx(I.ChevronRight,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"w-full max-w-4xl px-4",children:[o.jsx(hr,{src:e[d].src,poster:e[d].poster,autoPlay:!0,aspectRatio:n},e[d].id),e[d].title&&o.jsx("p",{className:"text-white text-sm mt-3 text-center",children:e[d].title})]}),o.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/70 text-sm tabular-nums",children:[d+1," / ",e.length]})]}),document.body)]})});ni.displayName="VideoGallery";const wm={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},oi=p.forwardRef(({src:e,alt:t,fallbackSrc:r,placeholder:n,showSkeleton:s=!0,lazy:a=!0,rootMargin:i="200px",aspectRatio:l,zoomOnHover:c=!1,zoomScale:d=1.5,zoomOnClick:g=!1,fit:u="cover",className:f,style:m,onLoad:h,onError:x,...y},w)=>{const[v,j]=p.useState("loading"),[R,M]=p.useState(!a),[C,k]=p.useState(e),[N,S]=p.useState(!1),_=p.useRef(null),D=te();p.useEffect(()=>{k(e),j("loading")},[e]),p.useEffect(()=>{if(!a||!_.current)return;const A=new IntersectionObserver(([T])=>{T.isIntersecting&&(M(!0),A.disconnect())},{rootMargin:i});return A.observe(_.current),()=>A.disconnect()},[a,i]);const F=A=>{j("loaded"),h==null||h(A)},B=A=>{r&&C!==r?k(r):j("error"),x==null||x(A)},P=()=>{g&&S(A=>!A)},q=A=>{g&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),S(T=>!T))},V=l!==void 0?{aspectRatio:typeof l=="number"?`${l}`:l}:{};return o.jsxs("div",{ref:_,className:b("relative overflow-hidden inline-block",g&&"cursor-zoom-in",f),style:{...V,...m},onClick:P,onKeyDown:q,tabIndex:g?0:void 0,role:g?"button":void 0,"aria-label":g?D.image_zoomIn:void 0,children:[R&&C?o.jsx("img",{ref:w,src:C,alt:t,className:b("w-full h-full transition-transform duration-300",wm[u],c&&"hover:scale-[var(--zoom-scale)]",N&&"scale-[var(--zoom-scale)]",v==="loading"&&"opacity-0"),style:{"--zoom-scale":d},onLoad:F,onError:B,...y}):null,v==="loading"&&R&&o.jsx("div",{className:"absolute inset-0",children:n||s&&o.jsx("div",{className:"w-full h-full animate-pulse bg-muted rounded-md"})}),v==="error"&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/50 text-muted-foreground text-sm",children:D.image_failedToLoad}),g&&v==="loaded"&&!N&&o.jsx("div",{className:"absolute bottom-2 right-2 p-1.5 rounded-full bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:o.jsx(I.ZoomIn,{className:"h-4 w-4"})})]})});oi.displayName="NUIImage";function ym({images:e,open:t,defaultIndex:r=0,onClose:n,onIndexChange:s,enableZoom:a=!0,enableKeyboard:i=!0,showCounter:l=!0,showThumbnails:c=!1,className:d,children:g}){const[u,f]=p.useState(!1),[m,h]=p.useState(r),[x,y]=p.useState(!1),[w,v]=p.useState(null),j=p.useRef(null),R=p.useRef(null),M=te(),C=t!==void 0?t:u,k=A=>{j.current=document.activeElement,A!==void 0&&h(A),f(!0)},N=()=>{var A;f(!1),y(!1),n==null||n(),(A=j.current)==null||A.focus()},S=p.useCallback(A=>{h(A),y(!1),s==null||s(A)},[s]),_=p.useCallback(()=>{S(m>0?m-1:e.length-1)},[m,e.length,S]),D=p.useCallback(()=>{S(m<e.length-1?m+1:0)},[m,e.length,S]);p.useEffect(()=>{if(!C||!i)return;const A=T=>{switch(T.key){case"Escape":N();break;case"ArrowLeft":_();break;case"ArrowRight":D();break}};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[C,i,_,D]),p.useEffect(()=>{var A;return C?(document.body.style.overflow="hidden",(A=R.current)==null||A.focus()):document.body.style.overflow="",()=>{document.body.style.overflow=""}},[C]);const F=A=>{A.target===R.current&&N()},B=A=>{v(A.touches[0].clientX)},P=A=>{if(w===null)return;const T=w-A.changedTouches[0].clientX;Math.abs(T)>50&&(T>0?D():_()),v(null)},q=()=>{a&&y(A=>!A)};if(!C)return g?o.jsx("div",{onClick:()=>k(r),className:"cursor-pointer",children:g}):null;const V=e[m];return V?Hr.createPortal(o.jsxs("div",{ref:R,className:b("fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/90",d),onClick:F,onTouchStart:B,onTouchEnd:P,role:"dialog","aria-modal":"true","aria-label":M.lightbox_label,tabIndex:-1,children:[o.jsx("button",{type:"button",onClick:N,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":M.common_close,children:o.jsx(I.X,{className:"h-5 w-5"})}),l&&e.length>1&&o.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 text-white/80 text-sm tabular-nums","aria-live":"polite",children:De(M.lightbox_imageOf,{current:String(m+1),total:String(e.length)})}),a&&o.jsx("button",{type:"button",onClick:()=>y(A=>!A),className:"absolute top-4 right-14 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":x?M.lightbox_zoomOut:M.lightbox_zoomIn,children:x?o.jsx(I.ZoomOut,{className:"h-5 w-5"}):o.jsx(I.ZoomIn,{className:"h-5 w-5"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:_,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":M.common_previous,children:o.jsx(I.ChevronLeft,{className:"h-6 w-6"})}),o.jsx("button",{type:"button",onClick:D,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":M.common_next,children:o.jsx(I.ChevronRight,{className:"h-6 w-6"})})]}),o.jsx("div",{className:b("flex-1 flex items-center justify-center w-full",x?"overflow-auto cursor-zoom-out":"cursor-zoom-in"),onDoubleClick:q,children:o.jsx("img",{src:V.src,alt:V.alt||"",className:b("transition-transform duration-200 select-none",x?"max-w-none max-h-none":"max-h-[85vh] max-w-[90vw] object-contain"),style:x?{transform:"scale(2)"}:void 0,draggable:!1})}),(V.title||V.description)&&o.jsxs("div",{className:"absolute bottom-16 left-1/2 -translate-x-1/2 text-center text-white max-w-lg px-4",children:[V.title&&o.jsx("p",{className:"text-sm font-medium",children:V.title}),V.description&&o.jsx("p",{className:"text-xs text-white/70 mt-1",children:V.description})]}),c&&e.length>1&&o.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 max-w-[90vw] overflow-x-auto px-4 py-2",children:e.map((A,T)=>o.jsx("button",{type:"button",onClick:()=>S(T),className:b("shrink-0 w-12 h-12 rounded overflow-hidden border-2 transition-colors",T===m?"border-white":"border-transparent opacity-60 hover:opacity-100"),children:o.jsx("img",{src:A.src,alt:"",className:"w-full h-full object-cover"})},T))})]}),document.body):null}function jm({src:e,aspectRatio:t,minSize:r=50,maxSize:n,initialCrop:s,outputFormat:a="image/png",outputQuality:i=.92,onCropComplete:l,onCropChange:c,showGrid:d=!0,circular:g=!1,className:u}){const f=p.useRef(null),m=p.useRef(null),[h,x]=p.useState(!1),[y,w]=p.useState({width:0,height:0}),[v,j]=p.useState(s||{x:.15,y:.15,width:.7,height:.7}),[R,M]=p.useState(null),[C,k]=p.useState(null),[N,S]=p.useState({x:0,y:0}),[_,D]=p.useState({x:0,y:0,width:0,height:0}),F=te();p.useEffect(()=>{s&&j(s)},[s]);const B=()=>{m.current&&(w({width:m.current.naturalWidth,height:m.current.naturalHeight}),x(!0))},P=p.useCallback(K=>{let{x:Y,y:ee,width:z,height:L}=K;const H=r/(y.width||1),Z=r/(y.height||1);if(z=Math.max(H,z),L=Math.max(Z,L),n&&(z=Math.min(n/(y.width||1),z),L=Math.min(n/(y.height||1),L)),z=Math.min(1,z),L=Math.min(1,L),t){const O=(y.width||1)/(y.height||1),X=t/O;z/L>X?z=L*X:L=z/X}return Y=Math.max(0,Math.min(1-z,Y)),ee=Math.max(0,Math.min(1-L,ee)),{x:Y,y:ee,width:z,height:L}},[y,r,n,t]);p.useEffect(()=>{if(!R)return;const K=ee=>{ee.preventDefault();const z=f.current;if(!z)return;const L=z.getBoundingClientRect(),H=(ee.clientX-N.x)/L.width,Z=(ee.clientY-N.y)/L.height;let O;if(R==="move")O=P({..._,x:_.x+H,y:_.y+Z});else{switch(O={..._},C){case"se":O.width=_.width+H,O.height=_.height+Z;break;case"sw":O.x=_.x+H,O.width=_.width-H,O.height=_.height+Z;break;case"ne":O.y=_.y+Z,O.width=_.width+H,O.height=_.height-Z;break;case"nw":O.x=_.x+H,O.y=_.y+Z,O.width=_.width-H,O.height=_.height-Z;break;case"n":O.y=_.y+Z,O.height=_.height-Z;break;case"s":O.height=_.height+Z;break;case"w":O.x=_.x+H,O.width=_.width-H;break;case"e":O.width=_.width+H;break}O=P(O)}j(O),c==null||c(O)},Y=()=>{M(null),k(null)};return document.addEventListener("pointermove",K),document.addEventListener("pointerup",Y),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",Y)}},[R,N,_,C,P,c]);const q=(K,Y,ee)=>{K.preventDefault(),K.stopPropagation(),M(Y),k(ee||null),S({x:K.clientX,y:K.clientY}),D({...v})},V=K=>{const Y=K.shiftKey?.05:.01;let ee={...v};if(K.shiftKey&&!K.altKey)switch(K.key){case"ArrowLeft":ee.width-=Y;break;case"ArrowRight":ee.width+=Y;break;case"ArrowUp":ee.height-=Y;break;case"ArrowDown":ee.height+=Y;break;default:return}else switch(K.key){case"ArrowLeft":ee.x-=Y;break;case"ArrowRight":ee.x+=Y;break;case"ArrowUp":ee.y-=Y;break;case"ArrowDown":ee.y+=Y;break;case"Enter":A();return;default:return}K.preventDefault(),ee=P(ee),j(ee),c==null||c(ee)},A=()=>{const K=m.current;if(!K||!l)return;const Y=document.createElement("canvas"),ee=v.x*K.naturalWidth,z=v.y*K.naturalHeight,L=v.width*K.naturalWidth,H=v.height*K.naturalHeight;Y.width=L,Y.height=H;const Z=Y.getContext("2d");if(!Z)return;g&&(Z.beginPath(),Z.arc(L/2,H/2,Math.min(L,H)/2,0,Math.PI*2),Z.closePath(),Z.clip()),Z.drawImage(K,ee,z,L,H,0,0,L,H);const O=Y.toDataURL(a,i);Y.toBlob(X=>{X&&l(X,O)},a,i)},T=()=>{const K=s||{x:.15,y:.15,width:.7,height:.7};j(P(K)),c==null||c(K)},oe=[{handle:"nw",pos:"top-0 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-nw-resize"},{handle:"ne",pos:"top-0 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-ne-resize"},{handle:"sw",pos:"bottom-0 left-0 -translate-x-1/2 translate-y-1/2",cursor:"cursor-sw-resize"},{handle:"se",pos:"bottom-0 right-0 translate-x-1/2 translate-y-1/2",cursor:"cursor-se-resize"},{handle:"n",pos:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-n-resize"},{handle:"s",pos:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",cursor:"cursor-s-resize"},{handle:"w",pos:"top-1/2 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-w-resize"},{handle:"e",pos:"top-1/2 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-e-resize"}];return o.jsxs("div",{className:b("space-y-3",u),children:[o.jsxs("div",{ref:f,className:"relative overflow-hidden rounded-lg select-none",role:"application","aria-label":F.imageCropper_label,tabIndex:0,onKeyDown:V,children:[o.jsx("img",{ref:m,src:e,alt:"",className:"block w-full",onLoad:B,crossOrigin:"anonymous",draggable:!1}),h&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 pointer-events-none"}),o.jsxs("div",{className:b("absolute border-2 border-white shadow-lg cursor-move",g&&"rounded-full"),style:{left:`${v.x*100}%`,top:`${v.y*100}%`,width:`${v.width*100}%`,height:`${v.height*100}%`},onPointerDown:K=>q(K,"move"),children:[o.jsx("div",{className:b("absolute inset-0 overflow-hidden",g&&"rounded-full"),children:o.jsx("img",{src:e,alt:"",className:"block",style:{position:"absolute",left:`-${v.x/v.width*100}%`,top:`-${v.y/v.height*100}%`,width:`${1/v.width*100}%`,height:`${1/v.height*100}%`},draggable:!1})}),d&&!g&&o.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[o.jsx("div",{className:"absolute left-1/3 top-0 bottom-0 w-px bg-white/40"}),o.jsx("div",{className:"absolute left-2/3 top-0 bottom-0 w-px bg-white/40"}),o.jsx("div",{className:"absolute top-1/3 left-0 right-0 h-px bg-white/40"}),o.jsx("div",{className:"absolute top-2/3 left-0 right-0 h-px bg-white/40"})]}),!g&&oe.map(({handle:K,pos:Y,cursor:ee})=>o.jsx("div",{className:b("absolute w-3 h-3 bg-white rounded-full border border-border shadow z-10",Y,ee),onPointerDown:z=>q(z,"resize",K)},K))]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 transition-colors",children:[o.jsx(I.Crop,{className:"h-4 w-4"}),F.imageCropper_crop]}),o.jsxs("button",{type:"button",onClick:T,className:"flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm hover:bg-accent transition-colors",children:[o.jsx(I.RotateCcw,{className:"h-4 w-4"}),F.imageCropper_reset]})]})]})}const si=p.forwardRef(({beforeSrc:e,afterSrc:t,beforeAlt:r="",afterAlt:n="",initialPosition:s=50,orientation:a="horizontal",showLabels:i=!0,beforeLabel:l,afterLabel:c,handleSize:d=4,onPositionChange:g,className:u,...f},m)=>{var _,D;const[h,x]=p.useState(s),[y,w]=p.useState(!1),v=p.useRef(null),j=te(),R=a==="horizontal",M=l??j.imageCompare_before,C=c??j.imageCompare_after,k=p.useCallback((F,B)=>{const P=v.current;if(!P)return;const q=P.getBoundingClientRect();let V;R?V=(F-q.left)/q.width*100:V=(B-q.top)/q.height*100,V=Math.max(0,Math.min(100,V)),x(V),g==null||g(V)},[R,g]);p.useEffect(()=>{if(!y)return;const F=P=>{P.preventDefault(),k(P.clientX,P.clientY)},B=()=>w(!1);return document.addEventListener("pointermove",F),document.addEventListener("pointerup",B),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",B)}},[y,k]);const N=F=>{var B,P;F.preventDefault(),(P=(B=F.target).setPointerCapture)==null||P.call(B,F.pointerId),w(!0)},S=F=>{const B=F.shiftKey?10:1;let P=h;if(R&&F.key==="ArrowLeft"||!R&&F.key==="ArrowUp")P=Math.max(0,h-B);else if(R&&F.key==="ArrowRight"||!R&&F.key==="ArrowDown")P=Math.min(100,h+B);else return;F.preventDefault(),x(P),g==null||g(P)};return o.jsxs("div",{ref:F=>{v.current=F,typeof m=="function"?m(F):m&&(m.current=F)},className:b("relative select-none overflow-hidden rounded-lg",u),...f,children:[o.jsx("img",{src:t,alt:n,className:"block w-full h-full object-cover",draggable:!1}),o.jsx("div",{className:"absolute inset-0 overflow-hidden",style:R?{width:`${h}%`}:{height:`${h}%`},children:o.jsx("img",{src:e,alt:r,className:b("block object-cover",R?"h-full":"w-full"),style:R?{width:`${((_=v.current)==null?void 0:_.offsetWidth)??0}px`,maxWidth:"none",height:"100%"}:{height:`${((D=v.current)==null?void 0:D.offsetHeight)??0}px`,maxHeight:"none",width:"100%"},draggable:!1})}),o.jsxs("div",{className:b("absolute z-10",R?"top-0 bottom-0 cursor-ew-resize":"left-0 right-0 cursor-ns-resize"),style:R?{left:`${h}%`,width:d,transform:"translateX(-50%)"}:{top:`${h}%`,height:d,transform:"translateY(-50%)"},onPointerDown:N,onKeyDown:S,role:"slider","aria-label":j.imageCompare_slider,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),"aria-orientation":R?"horizontal":"vertical",tabIndex:0,children:[o.jsx("div",{className:b("bg-white shadow-lg",R?"w-1 h-full":"h-1 w-full")}),o.jsx("div",{className:b("absolute flex items-center justify-center rounded-full bg-white shadow-lg border border-border","left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8"),children:o.jsx(I.GripVertical,{className:b("h-4 w-4 text-muted-foreground",!R&&"rotate-90")})})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"absolute top-3 left-3 px-2 py-1 rounded bg-black/60 text-white text-xs font-medium pointer-events-none",children:M}),o.jsx("span",{className:"absolute top-3 right-3 px-2 py-1 rounded bg-black/60 text-white text-xs font-medium pointer-events-none",children:C})]})]})});si.displayName="ImageCompare";function Nm({className:e}){const{setTheme:t}=dr(),r=te();return o.jsxs(vs,{children:[o.jsx(ws,{asChild:!0,children:o.jsxs(ve,{variant:"outline",size:"icon",className:e,children:[o.jsx(I.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),o.jsx(I.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),o.jsx("span",{className:"sr-only",children:r.modeToggle_toggleTheme})]})}),o.jsxs(pn,{align:"end",children:[o.jsxs(It,{onClick:()=>t("light"),children:[o.jsx(I.Sun,{className:"mr-2 h-4 w-4"}),r.modeToggle_light]}),o.jsxs(It,{onClick:()=>t("dark"),children:[o.jsx(I.Moon,{className:"mr-2 h-4 w-4"}),r.modeToggle_dark]}),o.jsxs(It,{onClick:()=>t("system"),children:[o.jsx(I.Monitor,{className:"mr-2 h-4 w-4"}),r.modeToggle_system]})]})]})}const Cm=[{value:"light",icon:I.Sun,key:"modeToggle_light"},{value:"dark",icon:I.Moon,key:"modeToggle_dark"},{value:"system",icon:I.Monitor,key:"modeToggle_system"}];function km({className:e}){const{theme:t,setTheme:r,themes:n}=dr(),s=te();return o.jsx("div",{className:b("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",e),role:"radiogroup","aria-label":s.modeToggle_colorTheme,children:Cm.filter(a=>n.includes(a.value)).map(({value:a,icon:i,key:l})=>{const c=s[l];return o.jsxs("button",{role:"radio","aria-checked":t===a,"aria-label":c,onClick:()=>r(a),className:b("inline-flex items-center justify-center rounded-md px-2.5 py-1.5 text-sm font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t===a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/50"),children:[o.jsx(i,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c})]},a)})})}const ai=p.forwardRef(({className:e,variant:t="received",children:r,...n},s)=>o.jsx("div",{ref:s,className:b("group flex gap-2 max-w-[85%]",t==="sent"?"ml-auto flex-row-reverse":"mr-auto",e),"data-variant":t,...n,children:r}));ai.displayName="ChatBubble";const ii=p.forwardRef(({className:e,src:t,fallback:r,...n},s)=>o.jsx("div",{ref:s,className:b("flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",e),...n,children:t?o.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):o.jsx("span",{children:r??"?"})}));ii.displayName="ChatBubbleAvatar";const Sm={sending:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"M12 6v6l4 2"})]}),sent:o.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:o.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:o.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"m15 9-6 6"}),o.jsx("path",{d:"m9 9 6 6"})]})},li=p.forwardRef(({className:e,variant:t="received",isLoading:r,status:n,children:s,...a},i)=>o.jsx("div",{ref:i,className:b("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",t==="sent"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md",e),...a,children:r?o.jsxs("div",{className:"flex items-center gap-1 py-1",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):o.jsxs(o.Fragment,{children:[s,n&&o.jsx("div",{className:"flex justify-end mt-1",children:Sm[n]})]})}));li.displayName="ChatBubbleMessage";const ci=p.forwardRef(({className:e,...t},r)=>o.jsx("span",{ref:r,className:b("text-[10px] text-muted-foreground mt-1 px-1",e),...t}));ci.displayName="ChatBubbleTimestamp";const di=p.forwardRef(({visibility:e="hover",className:t,children:r,...n},s)=>o.jsx("div",{ref:s,className:b("flex items-center gap-0.5 mt-0.5",e==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",t),...n,children:r}));di.displayName="ChatBubbleActions";const ui=p.forwardRef(({onSend:e,placeholder:t,disabled:r,isLoading:n,showAttach:s,onAttach:a,acceptFiles:i="*",onStop:l,value:c,onChange:d,headerSlot:g,footerSlot:u,maxLength:f,className:m},h)=>{const x=te(),y=p.useRef(null),w=p.useRef(null),[v,j]=p.useState(""),R=c!==void 0,M=R?c:v,C=P=>{R?d==null||d(P):j(P)},k=()=>{const P=y.current;P&&(P.style.height="auto",P.style.height=Math.min(P.scrollHeight,160)+"px")},N=()=>{const P=M.trim();!P||r||n||(e==null||e(P),C(""),y.current&&(y.current.style.height="auto"))},S=P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),N())},_=()=>{var P;(P=w.current)==null||P.click()},D=P=>{P.target.files&&P.target.files.length>0&&(a==null||a(P.target.files)),P.target.value=""},F=M.length,B=f?F>f:!1;return o.jsxs("div",{ref:h,className:b("rounded-xl border border-border bg-background",m),children:[g&&o.jsx("div",{className:"px-3 pt-2 pb-1 border-b border-border/40",children:g}),o.jsxs("div",{className:"flex items-end gap-2 p-2",children:[s&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:_,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":x.chatInput_attachFile,disabled:r,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),o.jsx("input",{ref:w,type:"file",multiple:!0,accept:i,onChange:D,className:"hidden","aria-hidden":"true"})]}),o.jsx("textarea",{ref:y,value:M,onChange:P=>{C(P.target.value),k()},onKeyDown:S,placeholder:t??x.chatInput_placeholder,disabled:r||n,rows:1,className:"flex-1 resize-none bg-transparent text-sm outline-none placeholder:text-muted-foreground min-h-[36px] py-2 px-2 max-h-40"}),n&&l?o.jsx("button",{type:"button",onClick:l,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-destructive/10 text-destructive hover:bg-destructive/20 transition-colors","aria-label":x.chatInput_stopGenerating,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):o.jsx("button",{type:"button",onClick:N,disabled:r||n||!M.trim()||B,className:b("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",M.trim()&&!r&&!n&&!B?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),"aria-label":x.chatInput_sendMessage,children:n?o.jsx("svg",{className:"animate-spin",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"m5 12 7-7 7 7"}),o.jsx("path",{d:"M12 19V5"})]})})]}),(u||f)&&o.jsxs("div",{className:"px-3 pb-2 pt-0.5 flex items-center gap-2",children:[o.jsx("div",{className:"flex-1",children:u}),f&&o.jsxs("span",{className:b("text-[10px] tabular-nums shrink-0",B?"text-destructive font-medium":"text-muted-foreground"),children:[F,"/",f]})]})]})});ui.displayName="ChatInput";const mi=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("flex flex-col h-full",e),...r,children:t}));mi.displayName="ChatContainer";const fi=p.forwardRef(({className:e,children:t,autoScroll:r=!0,...n},s)=>{const a=p.useRef(null),i=p.Children.count(t);return p.useEffect(()=>{r&&a.current&&a.current.scrollIntoView({behavior:"smooth"})},[i,r]),o.jsx(cr,{className:"flex-1",orientation:"vertical",children:o.jsxs("div",{ref:s,className:b("flex flex-col gap-4 p-4",e),...n,children:[t,o.jsx("div",{ref:a})]})})});fi.displayName="ChatList";const gi=p.forwardRef(({className:e,variant:t="dots",text:r,...n},s)=>{const a=te(),i=r??a.aiLoading_thinking;return t==="text"?o.jsxs("div",{ref:s,className:b("flex items-center gap-1.5 text-sm text-muted-foreground",e),...n,children:[o.jsx("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),o.jsxs("span",{className:"animate-pulse",children:[i,"…"]})]}):o.jsxs("div",{ref:s,className:b("flex items-center gap-1",e),...n,children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:300ms]"})]})});gi.displayName="AILoading";function lt(e){const t=[],r=/(`[^`]+`)|(\~\~[^~]+\~\~)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(!\[[^\]]*\]\([^)]+\))|(\[[^\]]+\]\([^)]+\))/g;let n=0,s;for(;(s=r.exec(e))!==null;){s.index>n&&t.push(e.slice(n,s.index));const a=s[0];if(a.startsWith("`"))t.push(o.jsx("code",{className:"px-1 py-0.5 rounded bg-muted text-sm font-mono",children:a.slice(1,-1)},s.index));else if(a.startsWith("~~"))t.push(o.jsx("del",{className:"text-muted-foreground",children:a.slice(2,-2)},s.index));else if(a.startsWith("**"))t.push(o.jsx("strong",{children:a.slice(2,-2)},s.index));else if(a.startsWith("*"))t.push(o.jsx("em",{children:a.slice(1,-1)},s.index));else if(a.startsWith("![")){const i=a.indexOf("]"),l=a.slice(2,i),c=a.slice(i+2,-1);t.push(o.jsx("img",{src:c,alt:l,className:"max-w-full rounded-lg my-2 inline-block",loading:"lazy"},s.index))}else if(a.startsWith("[")){const i=a.indexOf("]"),l=a.slice(1,i),c=a.slice(i+2,-1);t.push(o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:l},s.index))}n=s.index+a.length}return n<e.length&&t.push(e.slice(n)),t}function Rm(e){const t=e.split(`
36
- `),r=[];let n=0,s=0;for(;n<t.length;){const a=t[n];if(a.trimStart().startsWith("```")){const l=a.trimStart().slice(3).trim(),c=[];for(n++;n<t.length&&!t[n].trimStart().startsWith("```");)c.push(t[n]),n++;n++,r.push(o.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono my-3",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:o.jsx("code",{"data-language":l||void 0,children:c.join(`
37
- `)})},s++));continue}const i=a.match(/^(#{1,6})\s+(.*)/);if(i){const l=i[1].length,c=i[2],d=`h${l}`,g={1:"text-2xl font-bold mt-6 mb-3",2:"text-xl font-semibold mt-5 mb-2",3:"text-lg font-semibold mt-4 mb-2",4:"text-base font-semibold mt-3 mb-1",5:"text-sm font-semibold mt-2 mb-1",6:"text-sm font-medium mt-2 mb-1"};r.push(o.jsx(d,{className:g[l],children:lt(c)},s++)),n++;continue}if(/^[\s]*[-*]\s/.test(a)){const l=[];for(;n<t.length&&/^[\s]*[-*]\s/.test(t[n]);)l.push(o.jsx("li",{children:lt(t[n].replace(/^[\s]*[-*]\s/,""))},s++)),n++;r.push(o.jsx("ul",{className:"list-disc pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(/^\s*\d+\.\s/.test(a)){const l=[];for(;n<t.length&&/^\s*\d+\.\s/.test(t[n]);)l.push(o.jsx("li",{children:lt(t[n].replace(/^\s*\d+\.\s/,""))},s++)),n++;r.push(o.jsx("ol",{className:"list-decimal pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(a.startsWith(">")){const l=[];for(;n<t.length&&t[n].startsWith(">");)l.push(t[n].replace(/^>\s?/,"")),n++;r.push(o.jsx("blockquote",{className:"border-l-4 border-primary/40 pl-4 italic text-muted-foreground my-3 text-sm",children:lt(l.join(" "))},s++));continue}if(a.includes("|")&&n+1<t.length&&/^\s*\|?[\s\-:|]+\|/.test(t[n+1])){const l=[];for(;n<t.length&&t[n].includes("|");)l.push(t[n]),n++;if(l.length>=2){const c=u=>u.split("|").map(f=>f.trim()).filter((f,m,h)=>m>0&&m<h.length),d=c(l[0]),g=l.slice(2).map(c);r.push(o.jsx("div",{className:"overflow-x-auto my-3",children:o.jsxs("table",{className:"w-full text-sm border-collapse",children:[o.jsx("thead",{children:o.jsx("tr",{className:"border-b border-border",children:d.map((u,f)=>o.jsx("th",{className:"px-3 py-2 text-left font-semibold text-foreground",children:lt(u)},f))})}),o.jsx("tbody",{children:g.map((u,f)=>o.jsx("tr",{className:"border-b border-border/50",children:u.map((m,h)=>o.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:lt(m)},h))},f))})]})},s++));continue}}if(/^[-*_]{3,}\s*$/.test(a)){r.push(o.jsx("hr",{className:"my-4 border-border"},s++)),n++;continue}if(a.trim()===""){n++;continue}r.push(o.jsx("p",{className:"text-sm leading-relaxed my-2",children:lt(a)},s++)),n++}return r}const pi=p.forwardRef(({content:e,streaming:t,className:r,...n},s)=>{const a=t?e:e.trim(),i=p.useMemo(()=>{try{return Rm(a)}catch{return[p.createElement("p",{className:"text-sm"},a)]}},[a]);return o.jsx("div",{ref:s,className:b("markdown-renderer",r),...n,children:i})});pi.displayName="MarkdownRenderer";const hi=p.forwardRef(({suggestions:e,onSelect:t,columns:r=2,className:n,...s},a)=>{const i={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"};return o.jsx("div",{ref:a,className:b("grid gap-3",i[r],n),...s,children:e.map((l,c)=>o.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(l.prompt),className:b("flex flex-col items-start gap-1 rounded-xl border border-border p-4","bg-card text-left transition-colors hover:bg-muted/60 hover:border-primary/30","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:l.title}),l.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description})]},c))})});hi.displayName="PromptSuggestions";const xi=p.forwardRef(({models:e,value:t,onChange:r,placeholder:n,compact:s,className:a,...i},l)=>{const c=te(),[d,g]=p.useState(!1),[u,f]=p.useState(""),m=p.useRef(null),h=p.useRef(null),x=e.find(v=>v.id===t),y=p.useMemo(()=>{if(!u)return e;const v=u.toLowerCase();return e.filter(j=>{var R;return j.name.toLowerCase().includes(v)||((R=j.provider)==null?void 0:R.toLowerCase().includes(v))||j.id.toLowerCase().includes(v)})},[e,u]);p.useEffect(()=>{d&&(f(""),setTimeout(()=>{var v;return(v=h.current)==null?void 0:v.focus()},0))},[d]),p.useEffect(()=>{if(!d)return;const v=j=>{m.current&&!m.current.contains(j.target)&&g(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const w=v=>{v.key==="Escape"&&g(!1)};return o.jsxs("div",{ref:m,className:b("relative",a),...i,children:[o.jsxs("button",{ref:l,type:"button",onClick:()=>g(v=>!v),className:b("flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!x&&"text-muted-foreground"),children:[x?o.jsxs(o.Fragment,{children:[x.icon&&o.jsx("span",{className:"text-base shrink-0",children:x.icon}),o.jsx("span",{className:"font-medium truncate",children:x.name}),!s&&x.provider&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",x.provider,")"]})]}):o.jsx("span",{children:n??c.modelSelector_placeholder}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform",d&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),d&&o.jsxs("div",{className:"absolute z-50 mt-1 w-full min-w-[260px] rounded-xl border border-border bg-popover shadow-lg animate-in fade-in-0 zoom-in-95",onKeyDown:w,children:[o.jsx("div",{className:"p-2 border-b border-border",children:o.jsx("input",{ref:h,value:u,onChange:v=>f(v.target.value),placeholder:c.modelSelector_searchPlaceholder,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground px-2 py-1"})}),o.jsxs("div",{className:"max-h-[280px] overflow-auto p-1",children:[y.length===0&&o.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:c.modelSelector_noResults}),y.map(v=>o.jsxs("button",{type:"button",disabled:v.disabled,onClick:()=>{r==null||r(v.id),g(!1)},className:b("flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left text-sm transition-colors","hover:bg-muted focus-visible:outline-none focus-visible:bg-muted",v.id===t&&"bg-primary/10",v.disabled&&"opacity-50 cursor-not-allowed"),children:[v.icon&&o.jsx("span",{className:"text-lg shrink-0 mt-0.5",children:v.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium truncate",children:v.name}),v.id===t&&o.jsx("svg",{className:"h-4 w-4 text-primary shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})})]}),v.provider&&o.jsx("span",{className:"text-xs text-muted-foreground",children:v.provider}),v.description&&o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:v.description}),v.badges&&v.badges.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:v.badges.map(j=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:j},j))})]})]},v.id))]})]})]})});xi.displayName="ModelSelector";const bi=p.forwardRef(({modes:e,value:t,onChange:r,size:n="default",className:s,...a},i)=>o.jsx("div",{ref:i,className:b("inline-flex items-center gap-1 rounded-lg bg-muted/50 p-1",s),role:"radiogroup",...a,children:e.map(l=>{const c=l.id===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":c,onClick:()=>r==null?void 0:r(l.id),title:l.description,className:b("rounded-md transition-all text-sm font-medium whitespace-nowrap","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",n==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5",c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.icon&&o.jsx("span",{className:"mr-1",children:l.icon}),l.label]},l.id)})}));bi.displayName="ChatModeSelector";const vi=p.forwardRef(({question:e,options:t,onSelect:r,selected:n,allowFreeText:s,onFreeTextSubmit:a,columns:i=1,className:l,...c},d)=>{const g=te(),[u,f]=p.useState(""),m=!!n,h=()=>{const x=u.trim();x&&(a==null||a(x),f(""))};return o.jsxs("div",{ref:d,className:b("rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3 max-w-[85%]",l),...c,children:[o.jsx("p",{className:"text-sm leading-relaxed mb-3",children:e}),o.jsx("div",{className:b("grid gap-2",i===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:t.map(x=>{const y=x.id===n;return o.jsxs("button",{type:"button",disabled:m,onClick:()=>r==null?void 0:r(x.id,x.label),className:b("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-primary/10 text-primary font-medium":m?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[y&&o.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),!y&&o.jsx("span",{className:b("h-4 w-4 shrink-0 rounded-full border-2",m?"border-border/50":"border-border")}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"block truncate",children:x.label}),x.description&&o.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-1",children:x.description})]})]},x.id)})}),s&&!m&&o.jsxs("div",{className:"flex gap-2 mt-2",children:[o.jsx("input",{type:"text",value:u,onChange:x=>f(x.target.value),onKeyDown:x=>{x.key==="Enter"&&h()},placeholder:g.followUp_freeTextPlaceholder,className:"flex-1 bg-background rounded-lg border border-border px-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:border-primary/40"}),o.jsx("button",{type:"button",onClick:h,disabled:!u.trim(),className:b("rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",u.trim()?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:g.followUp_send})]})]})});vi.displayName="ChatFollowUp";const wi=p.forwardRef(({id:e,question:t,options:r,onSelect:n,selectedId:s,disabled:a=!1,allowFreeText:i=!1,onFreeTextSubmit:l,columns:c=1,freeTextValue:d,className:g,...u},f)=>{const[m,h]=p.useState(""),[x,y]=p.useState(null),[w,v]=p.useState(null),j=Array.isArray(r)?r:[],R=t??"",M=s??x,C=d??w,k=a||M!=null&&M!==""||C!=null&&C!=="",N=p.useCallback((_,D)=>{k||(y(_),n==null||n(_,D))},[k,n]),S=p.useCallback(()=>{const _=(m??"").trim();!_||k||(v(_),l==null||l(_),h(""))},[m,k,l]);return o.jsxs("div",{ref:f,"data-question-id":e,className:b("rounded-xl border border-border/60 overflow-hidden","bg-card shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",g),...u,children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border/40 bg-muted/30",children:[o.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-lg bg-primary/15 text-primary",children:o.jsx(I.HelpCircle,{className:"w-4 h-4"})}),o.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:R})]}),o.jsxs("div",{className:"p-3 space-y-3",children:[j.length>0&&o.jsx("div",{className:b("grid gap-2",c===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:j.map((_,D)=>{if(!_)return null;const F=_.id||`opt-${D}`,B=_.label||F,P=M===_.id;return o.jsxs("button",{type:"button",disabled:k,onClick:()=>N(_.id,B),className:b("group relative flex items-center gap-3 w-full p-3 rounded-lg border text-left","transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",P?"border-primary bg-primary/8 ring-1 ring-primary/20":k?"border-border/40 text-muted-foreground/60 cursor-not-allowed":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/50 cursor-pointer active:scale-[0.98]"),children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-5 h-5 rounded-full border-2 transition-all duration-200",P?"border-primary bg-primary scale-110":k?"border-muted-foreground/30":"border-muted-foreground/40 group-hover:border-primary/60"),children:P&&o.jsx(I.Check,{className:"w-3 h-3 text-primary-foreground animate-in zoom-in-50 duration-200"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:b("block text-sm font-medium leading-tight",P?"text-primary":"text-foreground"),children:B}),_.description&&o.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-2",children:_.description})]})]},F)})}),C&&o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-primary/8 border border-primary/20",children:[o.jsx(I.Check,{className:"w-4 h-4 text-primary flex-shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-primary truncate",children:C})]}),i&&!k&&o.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/30",children:[o.jsx("input",{type:"text",value:m,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),S())},placeholder:"Или напишите свой ответ...",className:b("flex-1 rounded-lg border border-border/60 bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground/60","outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/20","transition-colors")}),o.jsx("button",{type:"button",onClick:S,disabled:!(m??"").trim(),className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg transition-all duration-150",(m??"").trim()?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer active:scale-95":"bg-muted text-muted-foreground/50 cursor-not-allowed"),children:o.jsx(I.Send,{className:"w-4 h-4"})})]})]})]})});wi.displayName="ChatQuestion";const Yn={success:{Icon:I.CheckCircle2,border:"border-emerald-500/30",bg:"bg-emerald-500/5",iconBox:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",title:"text-emerald-900 dark:text-emerald-100",btn:"bg-emerald-600 hover:bg-emerald-700 text-white"},info:{Icon:I.Info,border:"border-blue-500/30",bg:"bg-blue-500/5",iconBox:"bg-blue-500/15 text-blue-600 dark:text-blue-400",title:"text-blue-900 dark:text-blue-100",btn:"bg-blue-600 hover:bg-blue-700 text-white"},warning:{Icon:I.AlertTriangle,border:"border-amber-500/30",bg:"bg-amber-500/5",iconBox:"bg-amber-500/15 text-amber-600 dark:text-amber-400",title:"text-amber-900 dark:text-amber-100",btn:"bg-amber-600 hover:bg-amber-700 text-white"},result:{Icon:I.Sparkles,border:"border-violet-500/30",bg:"bg-gradient-to-br from-violet-500/8 to-emerald-500/5",iconBox:"bg-violet-500/15 text-violet-600 dark:text-violet-400",title:"text-violet-900 dark:text-violet-100",btn:"bg-violet-600 hover:bg-violet-700 text-white"}},yi=p.forwardRef(({type:e="info",title:t,description:r,icon:n,action:s,dismissible:a=!1,onDismiss:i,className:l,...c},d)=>{const[g,u]=p.useState(!1),[f,m]=p.useState(!1),h=Yn[e]??Yn.info,x=n??h.Icon,y=p.useCallback(()=>{u(!0),i==null||i()},[i]),w=p.useCallback(()=>{f||!(s!=null&&s.onClick)||(m(!0),s.onClick(),setTimeout(()=>m(!1),1e3))},[s,f]);return g?null:o.jsx("div",{ref:d,className:b("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",h.border,h.bg,l),...c,children:o.jsxs("div",{className:"flex items-start gap-3 p-4",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",h.iconBox),children:o.jsx(x,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[t&&o.jsx("h4",{className:b("text-sm font-semibold leading-tight",h.title),children:t}),r&&o.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:r})]}),s&&s.label&&o.jsxs("button",{type:"button",disabled:f,onClick:w,className:b("flex-shrink-0 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95",f?"opacity-60 cursor-wait":"cursor-pointer",h.btn),children:[s.label,o.jsx(I.ArrowRight,{className:"w-3.5 h-3.5"})]}),a&&o.jsx("button",{type:"button",onClick:y,className:"flex-shrink-0 p-1 rounded-md hover:bg-foreground/10 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Dismiss",children:o.jsx(I.X,{className:"w-4 h-4"})})]})})});yi.displayName="ChatActionCard";const Zn={task:{Icon:I.CheckSquare,color:"text-blue-600 dark:text-blue-400 bg-blue-500/12"},project:{Icon:I.FolderKanban,color:"text-purple-600 dark:text-purple-400 bg-purple-500/12"},file:{Icon:I.FileText,color:"text-orange-600 dark:text-orange-400 bg-orange-500/12"},custom:{Icon:I.FileText,color:"text-primary bg-primary/12"}},ji=p.forwardRef(({type:e="task",title:t,id:r,status:n,properties:s,icon:a,onNavigate:i,className:l,...c},d)=>{const g=Zn[e]??Zn.custom,u=a??g.Icon,f=typeof i=="function",m=s&&typeof s=="object"?s:null,h=p.useCallback(()=>{i==null||i()},[i]),x=p.useCallback(y=>{f&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),i==null||i())},[f,i]);return o.jsxs("div",{ref:d,role:f?"button":void 0,tabIndex:f?0:void 0,onClick:f?h:void 0,onKeyDown:f?x:void 0,className:b("rounded-xl border border-border/60 bg-card overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",f&&"cursor-pointer hover:border-primary/40 hover:shadow-md transition-all active:scale-[0.99]",l),...c,children:[o.jsxs("div",{className:"flex items-start gap-3 p-4",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",g.color),children:o.jsx(u,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground truncate",children:t??"Untitled"}),r&&o.jsx("span",{className:"inline-flex px-1.5 py-0.5 rounded bg-muted text-[11px] font-mono text-muted-foreground leading-none",children:r})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n})]}),f&&o.jsx(I.ExternalLink,{className:"flex-shrink-0 w-4 h-4 text-muted-foreground/50 mt-0.5"})]}),m&&Object.keys(m).length>0&&o.jsx("div",{className:"px-4 pb-4",children:o.jsx("div",{className:"rounded-lg bg-muted/40 divide-y divide-border/30",children:Object.entries(m).map(([y,w])=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[o.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:y}),o.jsx("span",{className:"text-foreground text-right break-words",children:String(w??"")})]},y))})})]})});ji.displayName="ChatEntityPreview";const Ni=p.forwardRef(({title:e,description:t,icon:r,linkLabel:n,onNavigate:s,metadata:a,variant:i="success",className:l,...c},d)=>{const g=r??(i==="highlight"?I.Sparkles:I.CheckCircle2),u=a&&typeof a=="object"?a:null,f=typeof s=="function",m=i==="success";return o.jsx("div",{ref:d,className:b("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-3 duration-300",m?"border-emerald-500/30 bg-gradient-to-br from-emerald-500/8 via-emerald-500/4 to-transparent":"border-violet-500/30 bg-gradient-to-br from-violet-500/8 via-violet-500/4 to-transparent",l),...c,children:o.jsxs("div",{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-xl",m?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-violet-500/15 text-violet-600 dark:text-violet-400"),children:o.jsx(g,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[e&&o.jsx("h4",{className:b("text-sm font-semibold leading-tight",m?"text-emerald-900 dark:text-emerald-100":"text-violet-900 dark:text-violet-100"),children:e}),t&&o.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:t})]}),f&&o.jsxs("button",{type:"button",onClick:s,className:b("flex-shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95 cursor-pointer",m?"bg-emerald-600 hover:bg-emerald-700 text-white":"bg-violet-600 hover:bg-violet-700 text-white"),children:[n??"Перейти",o.jsx(I.ArrowRight,{className:"w-4 h-4"})]})]}),u&&Object.keys(u).length>0&&o.jsx("div",{className:"rounded-lg bg-background/60 border border-border/30 divide-y divide-border/20",children:Object.entries(u).map(([h,x])=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[o.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:h}),o.jsx("span",{className:"text-foreground text-right break-words",children:String(x??"")})]},h))})]})})});Ni.displayName="ChatResultCard";const _m={copy:{path:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2 M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"},retry:{path:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8 M3 3v5h5"},edit:{path:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"},like:{path:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"},dislike:{path:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"},share:{path:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8 M16 6l-4-4-4 4 M12 2v13"}},Ci=p.forwardRef(({actions:e=["copy"],content:t,likeState:r,onCopy:n,onRetry:s,onEdit:a,onLike:i,onDislike:l,onShare:c,visibility:d="hover",className:g,...u},f)=>{const m=te(),[h,x]=p.useState(!1),y={copy:m.messageActions_copy,retry:m.messageActions_retry,edit:m.messageActions_edit,like:m.messageActions_like,dislike:m.messageActions_dislike,share:m.messageActions_share},v={copy:async()=>{if(t)try{await navigator.clipboard.writeText(t),x(!0),setTimeout(()=>x(!1),2e3)}catch{}n==null||n()},retry:s,edit:a,like:i,dislike:l,share:c};return o.jsx("div",{ref:f,className:b("flex items-center gap-0.5",d==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",g),...u,children:e.map(j=>{const R=j==="copy"&&h,k=j==="like"&&r==="liked"||j==="dislike"&&r==="disliked";return o.jsx("button",{type:"button",onClick:v[j],"aria-label":y[j],title:R?m.messageActions_copied:y[j],className:b("inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors","text-muted-foreground hover:text-foreground hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",k&&"text-primary",R&&"text-green-500"),children:R?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:k?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:_m[j].path})})},j)})})});Ci.displayName="MessageActions";const ki=p.forwardRef(({text:e,speed:t=2,onComplete:r,cursor:n=!0,immediate:s=!1,className:a,...i},l)=>{const[c,d]=p.useState(s?e:""),[g,u]=p.useState(s),f=p.useRef(e),m=p.useRef(),h=p.useRef(s?e.length:0);return p.useEffect(()=>{if(e!==f.current){if(f.current=e,s){d(e),u(!0),h.current=e.length;return}e.startsWith(c)||(h.current=0,d("")),u(!1)}},[e,s,c]),p.useEffect(()=>{if(s||g)return;const x=()=>{const y=Math.min(h.current+t,e.length);h.current=y,d(e.slice(0,y)),y>=e.length?(u(!0),r==null||r()):m.current=requestAnimationFrame(x)};return m.current=requestAnimationFrame(x),()=>{m.current&&cancelAnimationFrame(m.current)}},[e,t,s,g,r]),o.jsxs("span",{ref:l,className:b("whitespace-pre-wrap",a),...i,children:[c,n&&!g&&o.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-foreground ml-px align-text-bottom animate-pulse"})]})});ki.displayName="StreamingText";const Si=p.forwardRef(({content:e,isThinking:t,duration:r,defaultOpen:n=!1,title:s,className:a,...i},l)=>{const c=te(),[d,g]=p.useState(n||t===!0),[u,f]=p.useState(r??0),m=p.useRef(Date.now());p.useEffect(()=>{t&&g(!0)},[t]),p.useEffect(()=>{if(!t)return;m.current=Date.now();const y=setInterval(()=>{f(Math.floor((Date.now()-m.current)/1e3))},1e3);return()=>clearInterval(y)},[t]);const h=t?u:r??u,x=y=>y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`;return o.jsxs("div",{ref:l,className:b("rounded-xl border border-border/60 overflow-hidden my-2",t&&"border-primary/30",a),...i,children:[o.jsxs("button",{type:"button",onClick:()=>g(y=>!y),className:b("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"bg-primary/5"),children:[o.jsxs("svg",{className:b("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),o.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),o.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),o.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),o.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),o.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),o.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),o.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),o.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]}),o.jsx("span",{className:b("font-medium",t&&"text-primary animate-pulse"),children:t?c.reasoning_thinking:s??c.reasoning_title}),h>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${x(h)}...`:De(c.reasoning_thoughtFor,{duration:x(h)})}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",d&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),d&&o.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:o.jsx("div",{className:"border-l-2 border-primary/20 pl-3",children:o.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap",children:[e,t&&o.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-muted-foreground ml-px align-text-bottom animate-pulse"})]})})})]})});Si.displayName="ReasoningBlock";const Ri=p.forwardRef(({name:e,args:t,result:r,status:n,error:s,defaultOpen:a=!1,className:i,...l},c)=>{const d=te(),[g,u]=p.useState(a),f={running:o.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),success:o.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),error:o.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})},m={running:De(d.toolCall_calling,{name:e}),success:e,error:De(d.toolCall_failed,{name:e})};return o.jsxs("div",{ref:c,className:b("rounded-xl border overflow-hidden my-1",n==="error"?"border-destructive/30":"border-border/60",i),...l,children:[o.jsxs("button",{type:"button",onClick:()=>u(h=>!h),className:b("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),f[n],o.jsx("span",{className:b("font-medium font-mono text-xs",n==="running"&&"text-primary",n==="error"&&"text-destructive"),children:m[n]}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",g&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),g&&o.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&o.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:d.toolCall_arguments}),o.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&o.jsxs("div",{className:b("px-3 py-2",t&&"border-t border-border/30"),children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:d.toolCall_result}),o.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:r})]}),s&&o.jsxs("div",{className:b("px-3 py-2 bg-destructive/5",t&&"border-t border-border/30"),children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:d.toolCall_error}),o.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})});Ri.displayName="ChatToolCall";function Mm(e,t){const r=new Date,n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(n.getTime()-864e5),a=new Date(n.getTime()-7*864e5),i=[{label:t[0],items:[]},{label:t[1],items:[]},{label:t[2],items:[]},{label:t[3],items:[]}],l=[...e].sort((c,d)=>d.updatedAt.getTime()-c.updatedAt.getTime());for(const c of l){const d=c.updatedAt;d>=n?i[0].items.push(c):d>=s?i[1].items.push(c):d>=a?i[2].items.push(c):i[3].items.push(c)}return i.filter(c=>c.items.length>0)}const _i=p.forwardRef(({conversations:e,activeId:t,onSelect:r,onNew:n,onDelete:s,onRename:a,showSearch:i=!0,className:l,...c},d)=>{const g=te(),[u,f]=p.useState(""),[m,h]=p.useState(null),[x,y]=p.useState(""),w=p.useRef(null),v=p.useMemo(()=>{if(!u)return e;const k=u.toLowerCase();return e.filter(N=>{var S;return N.title.toLowerCase().includes(k)||((S=N.lastMessage)==null?void 0:S.toLowerCase().includes(k))})},[e,u]),j=[g.conversationList_today,g.conversationList_yesterday,g.conversationList_previous7Days,g.conversationList_older],R=p.useMemo(()=>Mm(v,j),[v,j]),M=k=>{h(k.id),y(k.title),setTimeout(()=>{var N;return(N=w.current)==null?void 0:N.focus()},0)},C=()=>{m&&x.trim()&&(a==null||a(m,x.trim())),h(null)};return o.jsxs("div",{ref:d,className:b("flex flex-col h-full",l),...c,children:[n&&o.jsx("div",{className:"p-3 border-b border-border shrink-0",children:o.jsxs("button",{type:"button",onClick:n,className:b("flex items-center justify-center gap-2 w-full rounded-lg border border-border px-3 py-2 text-sm font-medium","transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"M12 5v14"})]}),g.conversationList_newChat]})}),i&&o.jsx("div",{className:"px-3 pt-3 pb-2 shrink-0",children:o.jsxs("div",{className:"relative",children:[o.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),o.jsx("input",{value:u,onChange:k=>f(k.target.value),placeholder:g.conversationList_searchPlaceholder,className:"w-full bg-muted/50 rounded-lg pl-8 pr-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:bg-muted"})]})}),o.jsxs("div",{className:"flex-1 overflow-auto px-2 py-1",children:[R.length===0&&o.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u?g.conversationList_noResults:g.conversationList_empty}),R.map(k=>o.jsxs("div",{className:"mb-3",children:[o.jsx("div",{className:"px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:k.label}),k.items.map(N=>{const S=N.id===t,_=N.id===m;return o.jsxs("div",{className:b("group flex items-center gap-2 rounded-lg px-2 py-2 cursor-pointer transition-colors",S?"bg-primary/10":"hover:bg-muted"),onClick:()=>!_&&(r==null?void 0:r(N.id)),children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"})}),o.jsx("div",{className:"flex-1 min-w-0",children:_?o.jsx("input",{ref:w,value:x,onChange:D=>y(D.target.value),onBlur:C,onKeyDown:D=>{D.key==="Enter"&&C(),D.key==="Escape"&&h(null)},className:"w-full bg-background border border-border rounded px-1 py-0.5 text-sm outline-none",onClick:D=>D.stopPropagation()}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-sm truncate font-medium",children:N.title}),N.lastMessage&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:N.lastMessage})]})}),!_&&o.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[a&&o.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),M(N)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":g.conversationList_rename,children:o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),s&&o.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),s(N.id)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":g.conversationList_delete,children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 6h18"}),o.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]})]},N.id)})]},k.label))]})]})});_i.displayName="ConversationList";const Pm={online:"bg-green-500",offline:"bg-muted-foreground/40",typing:"bg-primary animate-pulse"},Mi=p.forwardRef(({title:e,model:t,modelIcon:r,status:n,onClear:s,onSettings:a,onBack:i,children:l,className:c,...d},g)=>{const u=te(),f={online:u.chatHeader_online,offline:u.chatHeader_offline,typing:u.chatHeader_typing};return o.jsxs("div",{ref:g,className:b("flex items-center gap-3 px-4 h-14 border-b border-border shrink-0 bg-background",c),...d,children:[i&&o.jsx("button",{type:"button",onClick:i,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors -ml-1 shrink-0","aria-label":u.chatHeader_back,children:o.jsx("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m15 18-6-6 6-6"})})}),r&&o.jsx("span",{className:"text-xl shrink-0",children:r}),o.jsxs("div",{className:"flex-1 min-w-0",children:[e&&o.jsx("div",{className:"text-sm font-semibold truncate",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&o.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t}),n&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:b("h-1.5 w-1.5 rounded-full shrink-0",Pm[n])}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:f[n]})]})]})]}),l,o.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_clearConversation,title:u.chatHeader_clearConversation,children:o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 6h18"}),o.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})}),a&&o.jsx("button",{type:"button",onClick:a,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_settings,title:u.chatHeader_settings,children:o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]})});Mi.displayName="ChatHeader";const Pn=p.forwardRef(({citation:e,className:t,...r},n)=>{const[s,a]=p.useState(!1);return o.jsxs("span",{className:"relative inline-block",children:[o.jsx("button",{ref:n,type:"button",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>window.open(e.url,"_blank","noopener"),className:b("inline-flex items-center justify-center h-4 min-w-[16px] px-1 rounded text-[10px] font-medium","bg-primary/15 text-primary hover:bg-primary/25 transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","align-super",t),"aria-label":`Source ${e.index}: ${e.title}`,...r,children:e.index}),s&&o.jsxs("div",{className:"absolute z-50 bottom-full left-1/2 -translate-x-1/2 mb-2 w-64 rounded-lg border border-border bg-popover shadow-lg p-3 text-left animate-in fade-in-0 zoom-in-95",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[e.favicon&&o.jsx("img",{src:e.favicon,alt:"",className:"h-4 w-4 mt-0.5 shrink-0 rounded"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),o.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:e.url}),e.snippet&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.snippet})]})]}),o.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-border"})]})]})});Pn.displayName="CitationBadge";const Pi=p.forwardRef(({citations:e,variant:t="footer",className:r,...n},s)=>{const a=te();return t==="inline"?o.jsx("span",{ref:s,className:b("inline",r),...n,children:e.map(i=>o.jsx(Pn,{citation:i},i.index))}):o.jsxs("div",{ref:s,className:b("border-t border-border/50 pt-3 mt-3 space-y-2",r),...n,children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2",children:a.sourceCitation_sources}),e.map(i=>o.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:b("flex items-start gap-2.5 rounded-lg border border-border/60 p-2.5 transition-colors","hover:bg-muted/50 hover:border-primary/30"),children:[o.jsx("span",{className:"flex items-center justify-center h-5 w-5 rounded bg-primary/15 text-primary text-[10px] font-semibold shrink-0 mt-0.5",children:i.index}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[i.favicon&&o.jsx("img",{src:i.favicon,alt:"",className:"h-3.5 w-3.5 rounded shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title})]}),o.jsx("span",{className:"text-[10px] text-muted-foreground truncate block",children:i.url}),i.snippet&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.snippet})]})]},i.index))]})});Pi.displayName="SourceCitation";function Jn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Qn(e){return e.startsWith("image/")}function eo(e){return e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎬":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("zip")||e.includes("rar")||e.includes("tar")?"📦":e.includes("json")||e.includes("xml")||e.includes("csv")?"📊":e.includes("text")||e.includes("javascript")||e.includes("typescript")?"📝":"📎"}const Ii=p.forwardRef(({files:e,onRemove:t,variant:r="compact",className:n,...s},a)=>{const i=te();return e.length===0?null:r==="grid"?o.jsx("div",{ref:a,className:b("grid grid-cols-2 gap-2",n),...s,children:e.map((l,c)=>o.jsxs("div",{className:"group relative rounded-xl border border-border overflow-hidden bg-muted/30",children:[Qn(l.type)&&(l.thumbnail||l.url)?o.jsx("div",{className:"aspect-square",children:o.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-full w-full object-cover"})}):o.jsx("div",{className:"aspect-square flex items-center justify-center text-3xl bg-muted/50",children:eo(l.type)}),o.jsxs("div",{className:"px-2 py-1.5 border-t border-border/40",children:[o.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:Jn(l.size)})]}),t&&o.jsx("button",{type:"button",onClick:()=>t(c),className:"absolute top-1.5 right-1.5 h-5 w-5 rounded-full bg-background/80 backdrop-blur flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors opacity-0 group-hover:opacity-100","aria-label":De(i.filePreview_remove,{name:l.name}),children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??c))}):o.jsx("div",{ref:a,className:b("flex gap-2 overflow-x-auto pb-1",n),...s,children:e.map((l,c)=>o.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-2.5 py-1.5 shrink-0 max-w-[200px]",children:[Qn(l.type)&&(l.thumbnail||l.url)?o.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-8 w-8 rounded object-cover shrink-0"}):o.jsx("span",{className:"text-lg shrink-0",children:eo(l.type)}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:Jn(l.size)})]}),t&&o.jsx("button",{type:"button",onClick:()=>t(c),className:"h-5 w-5 rounded-full flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors shrink-0 opacity-0 group-hover:opacity-100","aria-label":De(i.filePreview_remove,{name:l.name}),children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??c))})});Ii.displayName="FilePreview";const Im={sending:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"M12 6v6l4 2"})]}),sent:o.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:o.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:o.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"m15 9-6 6"}),o.jsx("path",{d:"m9 9 6 6"})]})},Ti=p.forwardRef(({variant:e="received",avatar:t,avatarFallback:r,content:n,timestamp:s,isLoading:a,status:i,actions:l,textContent:c,likeState:d,onCopy:g,onRetry:u,onEdit:f,onLike:m,onDislike:h,onShare:x,followUp:y,onFollowUpSelect:w,onFollowUpFreeText:v,reasoning:j,toolCalls:R,citations:M,className:C,...k},N)=>{const S=te(),_=e==="sent",[D,F]=p.useState(!1),B=async()=>{if(c)try{await navigator.clipboard.writeText(c),F(!0),setTimeout(()=>F(!1),2e3)}catch{}g==null||g()};return o.jsxs("div",{ref:N,className:b("group flex gap-2 max-w-[85%]",_?"ml-auto flex-row-reverse":"mr-auto",C),...k,children:[(t||r)&&o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",children:t?o.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):o.jsx("span",{children:r??"?"})}),o.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[j&&o.jsx("div",{className:b("rounded-xl border border-border/60 overflow-hidden",j.isThinking&&"border-primary/30"),children:o.jsx(Tm,{...j})}),R==null?void 0:R.map((P,q)=>o.jsx(Lm,{...P},q)),o.jsxs("div",{className:b("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",_?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"),children:[a?o.jsxs("div",{className:"flex items-center gap-1 py-1",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):n,M&&M.length>0&&o.jsxs("div",{className:"border-t border-border/30 pt-2 mt-2 space-y-1.5",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:S.sourceCitation_sources}),M.map(P=>o.jsxs("a",{href:P.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx("span",{className:"h-4 min-w-[16px] px-0.5 rounded bg-primary/15 text-primary text-[10px] font-semibold flex items-center justify-center",children:P.index}),o.jsx("span",{className:"truncate",children:P.title})]},P.index))]})]}),y&&o.jsxs("div",{className:"rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3",children:[o.jsx("p",{className:"text-sm leading-relaxed mb-2.5",children:y.question}),o.jsx("div",{className:"grid gap-1.5",children:y.options.map(P=>{const q=P.id===y.selected,V=!!y.selected;return o.jsxs("button",{type:"button",disabled:V,onClick:()=>w==null?void 0:w(P.id,P.label),className:b("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all",q?"border-primary bg-primary/10 text-primary font-medium":V?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[q?o.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsx("span",{className:b("h-4 w-4 shrink-0 rounded-full border-2",V?"border-border/50":"border-border")}),o.jsx("span",{className:"truncate",children:P.label})]},P.id)})})]}),(s||i)&&o.jsxs("div",{className:b("flex items-center gap-1 px-1",_&&"flex-row-reverse"),children:[s&&o.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),i&&Im[i]]}),l&&l.length>0&&!a&&o.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:l.map(P=>{const q=P==="copy"&&D,V={copy:B,retry:u,edit:f,like:m,dislike:h,share:x},A=P==="like"&&d==="liked"||P==="dislike"&&d==="disliked",T={copy:S.messageActions_copy,retry:S.messageActions_retry,edit:S.messageActions_edit,like:S.messageActions_like,dislike:S.messageActions_dislike,share:S.messageActions_share};return o.jsx("button",{type:"button",onClick:V[P],title:q?S.messageActions_copied:T[P],className:b("h-7 w-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",A&&"text-primary",q&&"text-green-500"),children:q?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):P==="copy"?o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"})]}):P==="retry"?o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),o.jsx("path",{d:"M3 3v5h5"})]}):P==="like"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:A?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})}):P==="dislike"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:A?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})}):P==="edit"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})}):o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),o.jsx("path",{d:"M16 6l-4-4-4 4"}),o.jsx("path",{d:"M12 2v13"})]})},P)})})]})]})});Ti.displayName="ChatMessage";function Tm({content:e,isThinking:t,duration:r}){const n=te(),[s,a]=p.useState(t===!0),[i,l]=p.useState(r??0);p.useEffect(()=>{t&&a(!0)},[t]),p.useEffect(()=>{if(!t)return;const d=Date.now(),g=setInterval(()=>l(Math.floor((Date.now()-d)/1e3)),1e3);return()=>clearInterval(g)},[t]);const c=t?i:r??i;return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[o.jsxs("svg",{className:b("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),o.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"})]}),o.jsx("span",{className:b("font-medium",t&&"text-primary animate-pulse"),children:t?n.reasoning_thinking:n.reasoning_title}),c>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${c}s...`:De(n.reasoning_thoughtFor,{duration:`${c}s`})}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",s&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),s&&o.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap border-l-2 border-primary/20 pl-3",children:e})})]})}function Lm({name:e,args:t,result:r,status:n,error:s}){const a=te(),[i,l]=p.useState(!1);return o.jsxs("div",{className:b("rounded-xl border overflow-hidden",n==="error"?"border-destructive/30":"border-border/60"),children:[o.jsxs("button",{type:"button",onClick:()=>l(c=>!c),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),n==="running"?o.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):n==="success"?o.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]}),o.jsx("span",{className:"font-medium font-mono text-xs",children:n==="running"?De(a.toolCall_calling,{name:e}):e}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",i&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),i&&o.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&o.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_arguments}),o.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&o.jsxs("div",{className:"px-3 py-2 border-t border-border/30",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_result}),o.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:r})]}),s&&o.jsxs("div",{className:"px-3 py-2 bg-destructive/5 border-t border-border/30",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:a.toolCall_error}),o.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})}exports.AILoading=gi;exports.Accordion=gc;exports.AccordionContent=ls;exports.AccordionItem=as;exports.AccordionTrigger=is;exports.Alert=As;exports.AlertDescription=Vs;exports.AlertDialog=Rc;exports.AlertDialogAction=qs;exports.AlertDialogCancel=Ws;exports.AlertDialogContent=$s;exports.AlertDialogDescription=Gs;exports.AlertDialogFooter=Os;exports.AlertDialogHeader=Bs;exports.AlertDialogOverlay=xn;exports.AlertDialogPortal=zs;exports.AlertDialogTitle=Hs;exports.AlertDialogTrigger=_c;exports.AlertTitle=Fs;exports.AppShell=Ya;exports.AspectRatio=dc;exports.AudioPlayer=_n;exports.AudioPlaylist=bm;exports.AudioRecorder=xm;exports.AudioWaveform=pr;exports.Avatar=Co;exports.AvatarFallback=So;exports.AvatarImage=ko;exports.Badge=Ur;exports.Blockquote=lm;exports.Box=qo;exports.Breadcrumb=Xs;exports.BreadcrumbEllipsis=ta;exports.BreadcrumbItem=Zs;exports.BreadcrumbLink=Js;exports.BreadcrumbList=Ys;exports.BreadcrumbPage=Qs;exports.BreadcrumbSeparator=ea;exports.Button=ve;exports.Calendar=Zr;exports.Card=Jr;exports.CardContent=tn;exports.CardDescription=Qo;exports.CardFooter=es;exports.CardHeader=Qr;exports.CardTitle=en;exports.Carousel=_a;exports.CarouselContent=Ma;exports.CarouselItem=Pa;exports.CarouselNext=Ta;exports.CarouselPrevious=Ia;exports.ChartContainer=Ga;exports.ChartLegend=mm;exports.ChartTooltip=um;exports.ChatActionCard=yi;exports.ChatBubble=ai;exports.ChatBubbleActions=di;exports.ChatBubbleAvatar=ii;exports.ChatBubbleMessage=li;exports.ChatBubbleTimestamp=ci;exports.ChatContainer=mi;exports.ChatEntityPreview=ji;exports.ChatFollowUp=vi;exports.ChatHeader=Mi;exports.ChatInput=ui;exports.ChatList=fi;exports.ChatMessage=Ti;exports.ChatModeSelector=bi;exports.ChatQuestion=wi;exports.ChatResultCard=Ni;exports.ChatToolCall=Ri;exports.Checkbox=Ro;exports.CitationBadge=Pn;exports.Code=im;exports.CodeBlock=om;exports.Collapsible=uc;exports.CollapsibleContent=Zo;exports.CollapsibleTrigger=mc;exports.ColorPicker=lc;exports.Combobox=rc;exports.Command=hn;exports.CommandDialog=kc;exports.CommandEmpty=Is;exports.CommandGroup=Ts;exports.CommandInput=Ms;exports.CommandItem=Ds;exports.CommandList=Ps;exports.CommandSeparator=Ls;exports.CommandShortcut=Es;exports.Container=Yo;exports.ContextMenu=fd;exports.ContextMenuCheckboxItem=ba;exports.ContextMenuContent=ha;exports.ContextMenuGroup=pd;exports.ContextMenuItem=xa;exports.ContextMenuLabel=wa;exports.ContextMenuPortal=hd;exports.ContextMenuRadioGroup=bd;exports.ContextMenuRadioItem=va;exports.ContextMenuSeparator=ya;exports.ContextMenuShortcut=ja;exports.ContextMenuSub=xd;exports.ContextMenuSubContent=pa;exports.ContextMenuSubTrigger=ga;exports.ContextMenuTrigger=gd;exports.ConversationList=_i;exports.CopyInput=ei;exports.DataTable=Ju;exports.DataTableColumnHeader=Qu;exports.DatePicker=Jl;exports.Dialog=cs;exports.DialogClose=hc;exports.DialogContent=ln;exports.DialogDescription=gs;exports.DialogFooter=ms;exports.DialogHeader=us;exports.DialogOverlay=an;exports.DialogPortal=ds;exports.DialogTitle=fs;exports.DialogTrigger=pc;exports.Drawer=ps;exports.DrawerClose=xs;exports.DrawerContent=dn;exports.DrawerDescription=gn;exports.DrawerFooter=mn;exports.DrawerHeader=un;exports.DrawerTitle=fn;exports.DrawerTrigger=hs;exports.DropdownMenu=vs;exports.DropdownMenuCheckboxItem=Ns;exports.DropdownMenuContent=pn;exports.DropdownMenuGroup=bc;exports.DropdownMenuItem=It;exports.DropdownMenuLabel=ks;exports.DropdownMenuPortal=vc;exports.DropdownMenuRadioGroup=yc;exports.DropdownMenuRadioItem=Cs;exports.DropdownMenuSeparator=Ss;exports.DropdownMenuShortcut=Rs;exports.DropdownMenuSub=wc;exports.DropdownMenuSubContent=js;exports.DropdownMenuSubTrigger=ys;exports.DropdownMenuTrigger=ws;exports.EmptyState=cd;exports.FilePreview=Ii;exports.FileUpload=sc;exports.Flex=Wo;exports.Grid=Xo;exports.HStack=Ko;exports.Header=Ja;exports.Heading=sm;exports.HoverCard=vd;exports.HoverCardContent=Na;exports.HoverCardTrigger=wd;exports.Image=oi;exports.ImageCompare=si;exports.ImageCropper=jm;exports.Input=st;exports.JsonViewer=ti;exports.Label=lr;exports.Lead=cm;exports.Lightbox=ym;exports.Main=Qa;exports.MarkdownRenderer=pi;exports.MessageActions=Ci;exports.MetricCard=fm;exports.ModeToggle=Nm;exports.ModeToggleGroup=km;exports.ModelSelector=xi;exports.MultiSelect=nc;exports.Muted=dm;exports.NUIProvider=Go;exports.NavigationMenu=la;exports.NavigationMenuContent=ma;exports.NavigationMenuIndicator=fa;exports.NavigationMenuItem=ud;exports.NavigationMenuLink=md;exports.NavigationMenuList=ca;exports.NavigationMenuTrigger=ua;exports.NavigationMenuViewport=bn;exports.NumberInput=ec;exports.OTPInput=oc;exports.Pagination=ra;exports.PaginationContent=na;exports.PaginationEllipsis=ia;exports.PaginationItem=oa;exports.PaginationLink=ur;exports.PaginationNext=aa;exports.PaginationPrevious=sa;exports.Popover=yt;exports.PopoverContent=ft;exports.PopoverTrigger=jt;exports.Progress=Us;exports.PromptSuggestions=hi;exports.RadioGroup=Do;exports.RadioGroupItem=Eo;exports.ReasoningBlock=Si;exports.ScrollArea=cr;exports.ScrollBar=or;exports.Select=Ul;exports.SelectContent=Po;exports.SelectGroup=Kl;exports.SelectItem=To;exports.SelectLabel=Io;exports.SelectScrollDownButton=Xr;exports.SelectScrollUpButton=Kr;exports.SelectSeparator=Lo;exports.SelectTrigger=Mo;exports.SelectValue=Xl;exports.Separator=No;exports.Sheet=ps;exports.SheetClose=xs;exports.SheetContent=dn;exports.SheetDescription=gn;exports.SheetFooter=mn;exports.SheetHeader=un;exports.SheetOverlay=cn;exports.SheetPortal=bs;exports.SheetTitle=fn;exports.SheetTrigger=hs;exports.Sidebar=Za;exports.Skeleton=Mc;exports.Slider=Ao;exports.SourceCitation=Pi;exports.StatusBadge=pm;exports.Stepper=dd;exports.StreamingText=ki;exports.Switch=_o;exports.Table=rn;exports.TableBody=on;exports.TableCaption=rs;exports.TableCell=nr;exports.TableFooter=ts;exports.TableHead=sn;exports.TableHeader=nn;exports.TableRow=Pt;exports.Tabs=fc;exports.TabsContent=ss;exports.TabsList=ns;exports.TabsTrigger=os;exports.TagInput=tc;exports.Text=am;exports.Textarea=yo;exports.ThemeProvider=id;exports.TimePicker=Ql;exports.Timeline=qa;exports.TimelineConnector=Ka;exports.TimelineContent=Xa;exports.TimelineIcon=Ua;exports.TimelineItem=Wa;exports.Toaster=ld;exports.Toggle=Fo;exports.ToggleGroup=Vo;exports.ToggleGroupItem=$o;exports.Tooltip=Nc;exports.TooltipContent=_s;exports.TooltipProvider=jc;exports.TooltipTrigger=Cc;exports.TranslateProvider=Go;exports.VStack=Uo;exports.VideoGallery=ni;exports.VideoPlayer=hr;exports.VideoRecorder=vm;exports.VideoThumbnail=Mn;exports.audioPlayerVariants=ri;exports.badgeVariants=jo;exports.buttonVariants=Bt;exports.cardVariants=Jo;exports.cn=b;exports.en=At;exports.formatTime=We;exports.headingVariants=Oa;exports.inputVariants=wo;exports.navigationMenuTriggerStyle=da;exports.ru=Bo;exports.textVariants=Ha;exports.toast=Wc;exports.toggleVariants=Yr;exports.tpl=De;exports.useLocale=Zl;exports.useNUILocale=te;exports.useTheme=dr;exports.useTranslate=te;
33
+ */function Yn(e,t){return e?rm(e)?f.createElement(e,t):e:null}function rm(e){return nm(e)||typeof e=="function"||om(e)}function nm(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function om(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function sm(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=f.useState(()=>({current:Uu(t)})),[o,s]=f.useState(()=>r.current.initialState);return r.current.setOptions(a=>({...a,...e,state:{...o,...e.state},onStateChange:i=>{s(i),e.onStateChange==null||e.onStateChange(i)}})),r.current}function am({columns:e,data:t,searchKey:r,searchPlaceholder:o,pageSize:s=10}){var y,b;const a=ce(),i=o??a.dataTable_searchPlaceholder,[l,d]=f.useState([]),[c,p]=f.useState([]),[u,m]=f.useState({}),[g,h]=f.useState({}),x=sm({data:t,columns:e,onSortingChange:d,onColumnFiltersChange:p,getCoreRowModel:Ku(),getPaginationRowModel:em(),getSortedRowModel:tm(),getFilteredRowModel:Qu(),onColumnVisibilityChange:m,onRowSelectionChange:h,state:{sorting:l,columnFilters:c,columnVisibility:u,rowSelection:g},initialState:{pagination:{pageSize:s}}});return n.jsxs("div",{className:"space-y-4",children:[r&&n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(mt,{placeholder:i,value:((y=x.getColumn(r))==null?void 0:y.getFilterValue())??"",onChange:w=>{var j;return(j=x.getColumn(r))==null?void 0:j.setFilterValue(w.target.value)},className:"max-w-sm"})}),n.jsx("div",{className:"rounded-md border",children:n.jsxs(on,{children:[n.jsx(sn,{children:x.getHeaderGroups().map(w=>n.jsx(At,{children:w.headers.map(j=>n.jsx(ln,{children:j.isPlaceholder?null:Yn(j.column.columnDef.header,j.getContext())},j.id))},w.id))}),n.jsx(an,{children:(b=x.getRowModel().rows)!=null&&b.length?x.getRowModel().rows.map(w=>n.jsx(At,{"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(j=>n.jsx(ir,{children:Yn(j.column.columnDef.cell,j.getContext())},j.id))},w.id)):n.jsx(At,{children:n.jsx(ir,{colSpan:e.length,className:"h-24 text-center",children:a.dataTable_noResults})})})]})}),n.jsxs("div",{className:"flex items-center justify-between px-2",children:[n.jsx("div",{className:"text-sm text-muted-foreground",children:ze(a.dataTable_pageOf,{page:x.getState().pagination.pageIndex+1,total:x.getPageCount()})}),n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsxs(ke,{variant:"outline",size:"sm",onClick:()=>x.previousPage(),disabled:!x.getCanPreviousPage(),children:[n.jsx(P.ChevronLeft,{className:"h-4 w-4"}),a.dataTable_previous]}),n.jsxs(ke,{variant:"outline",size:"sm",onClick:()=>x.nextPage(),disabled:!x.getCanNextPage(),children:[a.dataTable_next,n.jsx(P.ChevronRight,{className:"h-4 w-4"})]})]})]})]})}function im({column:e,title:t,className:r}){return e.getCanSort()?n.jsxs(ke,{variant:"ghost",size:"sm",className:v("-ml-3 h-8",r),onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:[t,n.jsx(P.ArrowUpDown,{className:"ml-2 h-4 w-4"})]}):n.jsx("div",{className:v(r),children:t})}const lm=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","instanceof","interface","let","new","null","of","package","private","protected","public","return","set","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]),cm=new Set(["display","flex","grid","none","block","inline","relative","absolute","fixed","sticky","hidden","visible","auto","inherit","initial","unset","important","solid","dashed","dotted","transparent","center","left","right","top","bottom","normal","bold","italic","nowrap","wrap"]);function dm(e,t){const r=e.split(`
34
+ `),o=t==="css"||t==="scss"||t==="less",s=t==="html"||t==="xml"||t==="svg",a=t==="json",i=t==="bash"||t==="sh"||t==="shell"||t==="zsh";return r.map(l=>{const d=[];let c=0;const p=l.length*4;let u=0;for(;c<l.length&&u++<p;){if(!o&&!a&&l[c]==="/"&&l[c+1]==="/"){d.push({type:"comment",value:l.slice(c)}),c=l.length;continue}if(i&&l[c]==="#"){d.push({type:"comment",value:l.slice(c)}),c=l.length;continue}if(l[c]==="/"&&l[c+1]==="*"){const m=l.indexOf("*/",c+2);m!==-1?(d.push({type:"comment",value:l.slice(c,m+2)}),c=m+2):(d.push({type:"comment",value:l.slice(c)}),c=l.length);continue}if(l[c]==="`"){let m=c+1;for(;m<l.length&&l[m]!=="`";)l[m]==="\\"&&m++,m++;d.push({type:"string",value:l.slice(c,m+1)}),c=m+1;continue}if(l[c]==='"'||l[c]==="'"){const m=l[c];let g=c+1;for(;g<l.length&&l[g]!==m;)l[g]==="\\"&&g++,g++;d.push({type:"string",value:l.slice(c,g+1)}),c=g+1;continue}if(/[0-9]/.test(l[c])&&(c===0||/[\s,\(\[:=+\-*/<>!&|^~?{]/.test(l[c-1]))){let m=c;for(;m<l.length&&/[0-9a-fA-FxXoObB._eE+\-n]/.test(l[m]);)m++;d.push({type:"number",value:l.slice(c,m)}),c=m;continue}if(l[c]==="<"&&/[a-zA-Z\/!]/.test(l[c+1]||"")||l[c]==="/"&&l[c+1]===">"){if(l[c]==="/"&&l[c+1]===">"){d.push({type:"punctuation",value:"/>"}),c+=2;continue}const m=l[c+1]==="/";let g=m?c+2:c+1;for(;g<l.length&&/[a-zA-Z0-9.\-_]/.test(l[g]);)g++;d.push({type:"punctuation",value:l[c]+(m?"/":"")});const h=l.slice(m?c+2:c+1,g);h&&d.push({type:"tag",value:h}),c=g;continue}if(l[c]===">"){d.push({type:"punctuation",value:">"}),c++;continue}if(/[a-zA-Z_$@]/.test(l[c])){let m=c;for(;m<l.length&&/[a-zA-Z0-9_$@\-]/.test(l[m]);)m++;m===c&&m++;const g=l.slice(c,m);if(o&&cm.has(g))d.push({type:"keyword",value:g});else if(s||o){const h=l.slice(m).trimStart();h[0]==="="||h[0]===":"?d.push({type:"attr",value:g}):d.push({type:"plain",value:g})}else lm.has(g)?d.push({type:"keyword",value:g}):!a&&l[m]==="("?d.push({type:"function",value:g}):!a&&/^[A-Z]/.test(g)?d.push({type:"tag",value:g}):d.push({type:"plain",value:g});c=m;continue}if(/[=+\-*/%<>!&|^~?:]/.test(l[c])){let m=c;for(;m<l.length&&/[=+\-*/%<>!&|^~?:]/.test(l[m]);)m++;d.push({type:"operator",value:l.slice(c,m)}),c=m;continue}if(/[{}()\[\],;.]/.test(l[c])){d.push({type:"punctuation",value:l[c]}),c++;continue}if(/\s/.test(l[c])){let m=c;for(;m<l.length&&/\s/.test(l[m]);)m++;d.push({type:"plain",value:l.slice(c,m)}),c=m;continue}d.push({type:"plain",value:l[c]}),c++}return d})}const um={comment:"var(--cb-comment, #6a9955)",string:"var(--cb-string, #ce9178)",keyword:"var(--cb-keyword, #569cd6)",number:"var(--cb-number, #b5cea8)",function:"var(--cb-function, #dcdcaa)",tag:"var(--cb-tag, #4ec9b0)",attr:"var(--cb-attr, #9cdcfe)",punctuation:"var(--cb-punctuation, #d4d4d4)",operator:"var(--cb-operator, #d4d4d4)",plain:"var(--cb-plain, #d4d4d4)"};function mm({code:e,language:t="tsx",showLineNumbers:r=!1,showCopy:o=!0,className:s}){const a=ce(),[i,l]=f.useState(!1),d=e.trim(),c=f.useMemo(()=>{try{return dm(d,t)}catch{return d.split(`
35
+ `).map(u=>[{type:"plain",value:u}])}},[d,t]),p=async()=>{try{await navigator.clipboard.writeText(d),l(!0),setTimeout(()=>l(!1),2e3)}catch{}};return n.jsxs("div",{className:v("relative group",s),children:[o&&n.jsx("button",{type:"button",onClick:p,className:"absolute top-3 right-3 z-10 p-1.5 rounded-md bg-white/10 backdrop-blur text-white/60 hover:text-white opacity-0 group-hover:opacity-100 transition-opacity text-xs","aria-label":a.common_copyCode,children:i?n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2"}),n.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}),n.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:c.map((u,m)=>n.jsxs("div",{children:[r&&n.jsx("span",{className:"inline-block w-8 select-none text-right mr-4 opacity-40",style:{color:"var(--cb-plain, #d4d4d4)"},children:m+1}),u.map((g,h)=>n.jsx("span",{style:{color:um[g.type]},children:g.value},h))]},m))})]})}const Ha=Le("font-bold tracking-tight",{variants:{level:{1:"text-2xl lg:text-3xl",2:"text-xl lg:text-2xl",3:"text-lg lg:text-xl",4:"text-base lg:text-lg",5:"text-sm lg:text-base",6:"text-xs lg:text-sm"}},defaultVariants:{level:2}});function fm({className:e,level:t=2,as:r,children:o,...s}){const a=r||`h${t}`;return n.jsx(a,{className:v(Ha({level:t}),e),...s,children:o})}const Ga=Le("",{variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},variant:{default:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",destructive:"text-destructive",success:"text-green-600 dark:text-green-400"},leading:{tight:"leading-tight",normal:"leading-normal",relaxed:"leading-relaxed"}},defaultVariants:{size:"base",weight:"normal",variant:"default",leading:"normal"}});function gm({className:e,size:t,weight:r,variant:o,leading:s,as:a="p",children:i,...l}){return n.jsx(a,{className:v(Ga({size:t,weight:r,variant:o,leading:s}),e),...l,children:i})}function pm({className:e,...t}){return n.jsx("code",{className:v("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm",e),...t})}function hm({className:e,...t}){return n.jsx("blockquote",{className:v("border-l-4 border-primary pl-4 italic text-muted-foreground",e),...t})}function xm({className:e,...t}){return n.jsx("p",{className:v("text-xl text-muted-foreground",e),...t})}function vm({className:e,...t}){return n.jsx("p",{className:v("text-sm text-muted-foreground",e),...t})}const qa=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("div",{ref:o,className:v("w-full h-full min-h-[300px]",e),...r,children:n.jsx(Wr.ResponsiveContainer,{width:"100%",height:"100%",children:t})}));qa.displayName="ChartContainer";const bm=Wr.Tooltip,wm=Wr.Legend,Wa=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex flex-col space-y-4",e),...t}));Wa.displayName="Timeline";const Ua=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("relative flex gap-4 pb-4 last:pb-0",e),...t}));Ua.displayName="TimelineItem";const Ka=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border bg-background text-primary shadow-sm",e),...t}));Ka.displayName="TimelineIcon";const Xa=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("absolute left-4 top-8 -bottom-4 w-px bg-border",e),...t}));Xa.displayName="TimelineConnector";const Ya=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex-1 space-y-1 pt-1",e),...t}));Ya.displayName="TimelineContent";const Za=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("div",{ref:o,className:v("grid min-h-screen w-full lg:grid-cols-[280px_1fr]",e),...r,children:t}));Za.displayName="AppShell";const Ja=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("div",{ref:o,className:v("hidden border-r bg-muted/40 lg:block dark:bg-muted/10",e),...r,children:n.jsx("div",{className:"flex h-full max-h-screen flex-col gap-2",children:t})}));Ja.displayName="Sidebar";const Qa=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("header",{ref:o,className:v("flex h-14 items-center gap-4 border-b bg-background px-6 lg:h-[60px]",e),...r,children:t}));Qa.displayName="Header";const ei=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("main",{ref:o,className:v("flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6",e),...r,children:t}));ei.displayName="Main";function ym({title:e,value:t,description:r,trend:o,trendLabel:s,icon:a,className:i,...l}){return n.jsxs(en,{className:v("overflow-hidden",i),...l,children:[n.jsxs(tn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(rn,{className:"text-sm font-medium text-muted-foreground",children:e}),a&&n.jsx("div",{className:"text-muted-foreground",children:a})]}),n.jsxs(nn,{children:[n.jsx("div",{className:"text-2xl font-bold",children:t}),(r||o!==void 0)&&n.jsxs("div",{className:"text-xs flex items-center gap-1 mt-1 text-muted-foreground",children:[o!==void 0&&n.jsxs("span",{className:v("flex items-center font-medium",o>0?"text-green-500":o<0?"text-red-500":"text-muted-foreground"),children:[o>0?n.jsx(P.TrendingUp,{className:"mr-1 h-3 w-3"}):o<0?n.jsx(P.TrendingDown,{className:"mr-1 h-3 w-3"}):n.jsx(P.Minus,{className:"mr-1 h-3 w-3"}),o>0?"+":"",o,"%"]}),s&&n.jsx("span",{children:s}),r&&!o&&n.jsx("span",{children:r})]})]})]})}const ti=f.forwardRef(({className:e,label:t,value:r,...o},s)=>{const[a,i]=f.useState(!1),l=()=>{navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)};return n.jsxs("div",{className:"space-y-2",children:[t&&n.jsx(mr,{children:t}),n.jsxs("div",{className:"flex gap-2 relative",children:[n.jsx(mt,{ref:s,value:r,readOnly:!0,className:v("pr-10 font-mono text-sm",e),...o}),n.jsx(ke,{size:"icon",variant:"outline",className:"shrink-0",onClick:l,children:a?n.jsx(P.Check,{className:"h-4 w-4 text-green-500"}):n.jsx(P.Copy,{className:"h-4 w-4"})})]})]})});ti.displayName="CopyInput";const ri=f.forwardRef(({className:e,data:t,...r},o)=>n.jsx("pre",{ref:o,className:v("rounded-lg border bg-muted p-4 overflow-auto text-xs font-mono text-muted-foreground",e),...r,children:JSON.stringify(t,null,2)}));ri.displayName="JsonViewer";const jm=Le("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{status:{neutral:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400 hover:bg-green-500/25",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/25",error:"border-transparent bg-red-500/15 text-red-700 dark:text-red-400 hover:bg-red-500/25",info:"border-transparent bg-blue-500/15 text-blue-700 dark:text-blue-400 hover:bg-blue-500/25"}},defaultVariants:{status:"neutral"}});function Nm({className:e,status:t,dot:r=!0,children:o,...s}){return n.jsxs("div",{className:v(jm({status:t}),e),...s,children:[r&&n.jsx("span",{className:v("mr-1.5 h-2 w-2 rounded-full",{"bg-current":!0})}),o]})}const br=f.forwardRef(({src:e,data:t,stream:r,color:o,progressColor:s,progress:a=0,height:i=80,barCount:l=100,barWidth:d=3,barGap:c=1,barRadius:p=2,mirrored:u=!1,onSeek:m,className:g,...h},x)=>{const y=f.useRef(null),[b,w]=f.useState([]),[j,M]=f.useState(!1),R=f.useRef(0),_=ce(),[C,S]=f.useState({width:0,height:0}),[T,L]=f.useState(null);f.useEffect(()=>{var z;const $=(z=y.current)==null?void 0:z.parentElement;if(!$)return;const k=new ResizeObserver(A=>{for(const E of A){const{width:N,height:W}=E.contentRect;S({width:N,height:W})}});return k.observe($),()=>k.disconnect()},[]),f.useEffect(()=>{if(!e||r)return;M(!0);const $=new AudioContext;let k=!1;return fetch(e).then(z=>z.arrayBuffer()).then(z=>$.decodeAudioData(z)).then(z=>{if(k)return;const A=z.getChannelData(0),E=Math.floor(A.length/l),N=[];for(let q=0;q<l;q++){let G=0;for(let Z=0;Z<E;Z++)G+=Math.abs(A[q*E+Z]);N.push(G/E)}const W=Math.max(...N,.01);w(N.map(q=>q/W)),M(!1)}).catch(()=>{k||(L(_.audioWaveform_error),M(!1))}),()=>{k=!0,$.close()}},[e,l]),f.useEffect(()=>{if(t){const $=Math.max(...t,.01);w(t.map(k=>k/$))}},[t]),f.useEffect(()=>{if(!r)return;const $=new AudioContext,k=$.createMediaStreamSource(r),z=$.createAnalyser();z.fftSize=256,k.connect(z);const A=new Uint8Array(z.frequencyBinCount),E=()=>{z.getByteFrequencyData(A);const N=Math.floor(A.length/l),W=[];for(let q=0;q<l;q++)W.push(A[q*N]/255);w(W),R.current=requestAnimationFrame(E)};return R.current=requestAnimationFrame(E),()=>{cancelAnimationFrame(R.current),k.disconnect(),$.close()}},[r,l]),f.useEffect(()=>{const $=y.current;if(!$||b.length===0)return;const k=$.getContext("2d");if(!k)return;const z=window.devicePixelRatio||1,A=$.getBoundingClientRect();$.width=A.width*z,$.height=A.height*z,k.scale(z,z),k.clearRect(0,0,A.width,A.height);const E=getComputedStyle($),N=o||E.getPropertyValue("--muted-foreground").trim()||"#888",W=s||E.getPropertyValue("--primary").trim()||"#7c3aed",q=d+c,G=Math.max(0,(A.width-b.length*q)/2);for(let Z=0;Z<b.length;Z++){const I=Math.max(2,b[Z]*(u?A.height/2:A.height*.9)),F=G+Z*q,U=Z/b.length<=a;if(k.fillStyle=U?W:N,u){const ee=A.height/2-I;Ir(k,F,ee,d,I,p),k.fill(),Ir(k,F,A.height/2,d,I,p),k.fill()}else{const ee=A.height-I;Ir(k,F,ee,d,I,p),k.fill()}}},[b,a,o,s,d,c,p,u,i,C]);const V=$=>{if(!m||!y.current)return;const k=y.current.getBoundingClientRect(),z=($.clientX-k.left)/k.width;m(Math.max(0,Math.min(1,z)))},O=$=>{if(!m)return;const k=$.shiftKey?.1:.02;$.key==="ArrowRight"?($.preventDefault(),m(Math.min(1,a+k))):$.key==="ArrowLeft"&&($.preventDefault(),m(Math.max(0,a-k)))};return n.jsxs("div",{ref:x,className:v("relative w-full",g),role:"img","aria-label":_.audioWaveform_label,...h,children:[j&&!r&&n.jsx("div",{className:"absolute inset-0 flex items-center gap-[2px] justify-center",style:{height:i},children:Array.from({length:Math.min(l,30)}).map(($,k)=>n.jsx("div",{className:"bg-muted animate-pulse rounded-full",style:{width:d,height:`${20+Math.random()*60}%`,animationDelay:`${k*50}ms`}},k))}),n.jsx("canvas",{ref:y,style:{width:"100%",height:i},className:v(m&&"cursor-pointer"),onClick:V,onKeyDown:O,tabIndex:m?0:void 0,role:m?"slider":void 0,"aria-valuemin":m?0:void 0,"aria-valuemax":m?100:void 0,"aria-valuenow":m?Math.round(a*100):void 0}),T&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:T})]})});br.displayName="AudioWaveform";function Ir(e,t,r,o,s,a){e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+o-a,r),e.quadraticCurveTo(t+o,r,t+o,r+a),e.lineTo(t+o,r+s-a),e.quadraticCurveTo(t+o,r+s,t+o-a,r+s),e.lineTo(t+a,r+s),e.quadraticCurveTo(t,r+s,t,r+s-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}const ni=Le("flex items-center gap-3 rounded-lg text-card-foreground",{variants:{variant:{default:"border bg-card p-3 shadow-sm",ghost:"bg-transparent p-3",minimal:"bg-transparent p-1 gap-2"},size:{sm:"p-2 gap-2",default:"",lg:"p-4 gap-4"}},defaultVariants:{variant:"default",size:"default"}}),km={sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"},wr=f.forwardRef(({src:e,title:t,artist:r,albumArt:o,showWaveform:s=!1,showVolume:a=!0,defaultVolume:i=1,autoPlay:l=!1,loop:d=!1,preload:c="metadata",variant:p,size:u="default",onPlay:m,onPause:g,onEnded:h,onTimeUpdate:x,className:y},b)=>{const w=f.useRef(null),j=f.useRef(null),M=f.useRef(!1),[R,_]=f.useState(!1),[C,S]=f.useState(0),[T,L]=f.useState(0),[V,O]=f.useState(0),[$,k]=f.useState(i),[z,A]=f.useState(!1),[E,N]=f.useState(!0),[W,q]=f.useState(null),G=ce(),Z=km[u??"default"];f.useEffect(()=>{const H=w.current;if(!H)return;const ne=()=>{L(H.duration),N(!1)},me=()=>N(!0),ve=()=>N(!1),fe=()=>{M.current||(S(H.currentTime),x==null||x(H.currentTime)),H.buffered.length>0&&O(H.buffered.end(H.buffered.length-1))},Re=()=>{_(!0),m==null||m()},ue=()=>{_(!1),g==null||g()},Fe=()=>{_(!1),h==null||h()},He=()=>{_(!1),N(!1),q(G.audioPlayer_error)};return H.addEventListener("loadedmetadata",ne),H.addEventListener("waiting",me),H.addEventListener("canplay",ve),H.addEventListener("timeupdate",fe),H.addEventListener("play",Re),H.addEventListener("pause",ue),H.addEventListener("ended",Fe),H.addEventListener("error",He),()=>{H.removeEventListener("loadedmetadata",ne),H.removeEventListener("waiting",me),H.removeEventListener("canplay",ve),H.removeEventListener("timeupdate",fe),H.removeEventListener("play",Re),H.removeEventListener("pause",ue),H.removeEventListener("ended",Fe),H.removeEventListener("error",He)}},[m,g,h,x,G.audioPlayer_error]),f.useEffect(()=>{const H=w.current;H&&(H.volume=z?0:$)},[$,z]),f.useEffect(()=>{q(null),S(0),L(0),O(0),N(!0)},[e]);const I=()=>{const H=w.current;H&&(R?H.pause():H.play())},F=f.useCallback(H=>{const ne=w.current;!ne||!T||(ne.currentTime=H*T,S(ne.currentTime))},[T]),U=H=>{if(!j.current)return;const ne=j.current.getBoundingClientRect();F((H.clientX-ne.left)/ne.width)},ee=H=>{var ne,me;M.current=!0,(me=(ne=H.target).setPointerCapture)==null||me.call(ne,H.pointerId)};f.useEffect(()=>{const H=j.current;if(!H)return;const ne=ve=>{if(!M.current||!j.current)return;const fe=j.current.getBoundingClientRect(),Re=Math.max(0,Math.min(1,(ve.clientX-fe.left)/fe.width));F(Re)},me=()=>{M.current=!1};return H.addEventListener("pointermove",ne),H.addEventListener("pointerup",me),H.addEventListener("lostpointercapture",me),()=>{H.removeEventListener("pointermove",ne),H.removeEventListener("pointerup",me),H.removeEventListener("lostpointercapture",me)}},[F]);const X=H=>{if(!w.current||!T)return;const ne=H.shiftKey?10:5;H.key==="ArrowLeft"?(H.preventDefault(),w.current.currentTime=Math.max(0,C-ne)):H.key==="ArrowRight"&&(H.preventDefault(),w.current.currentTime=Math.min(T,C+ne))},Y=H=>{H.key==="ArrowUp"||H.key==="+"?(H.preventDefault(),k(ne=>Math.min(1,ne+.1)),A(!1)):(H.key==="ArrowDown"||H.key==="-")&&(H.preventDefault(),k(ne=>Math.max(0,ne-.1)))},ae=()=>A(H=>!H),te=z||$===0?P.VolumeX:$<.5?P.Volume1:P.Volume2,ie=T?C/T:0,K=T?V/T:0;return n.jsxs("div",{ref:b,className:v(ni({variant:p,size:u}),y),children:[n.jsx("audio",{ref:w,src:e,autoPlay:l,loop:d,preload:c}),W&&n.jsx("div",{className:"flex-1 text-sm text-destructive",children:W}),!W&&n.jsxs(n.Fragment,{children:[o&&n.jsx("img",{src:o,alt:"",className:v("rounded object-cover shrink-0",u==="sm"?"h-8 w-8":u==="lg"?"h-14 w-14":"h-10 w-10")}),n.jsx("button",{type:"button",onClick:I,className:"shrink-0 flex items-center justify-center rounded-full bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95 transition-all h-8 w-8 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","aria-label":R?G.audioPlayer_pause:G.audioPlayer_play,children:E&&R?n.jsx(P.Loader2,{className:v(Z,"animate-spin")}):R?n.jsx(P.Pause,{className:Z}):n.jsx(P.Play,{className:v(Z,"ml-0.5")})}),n.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[(t||r)&&n.jsxs("div",{className:"flex items-center gap-2 text-xs leading-tight",children:[t&&n.jsx("span",{className:"font-medium truncate",children:t}),r&&n.jsx("span",{className:"text-muted-foreground truncate",children:r})]}),s?n.jsx(br,{src:e,progress:ie,height:u==="sm"?24:u==="lg"?40:32,barCount:60,onSeek:F}):n.jsxs("div",{ref:j,className:"relative h-1.5 bg-muted rounded-full cursor-pointer group",onClick:U,onPointerDown:ee,onKeyDown:X,role:"slider","aria-label":G.audioPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(T),"aria-valuenow":Math.round(C),"aria-valuetext":Ke(C),tabIndex:0,children:[n.jsx("div",{className:"absolute inset-y-0 left-0 bg-muted-foreground/30 rounded-full",style:{width:`${K*100}%`}}),n.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full transition-[width] duration-75",style:{width:`${ie*100}%`}}),n.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover:opacity-100 transition-opacity",style:{left:`${ie*100}%`,transform:"translate(-50%, -50%)"}})]}),n.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground tabular-nums",children:[n.jsx("span",{children:Ke(C)}),n.jsx("span",{children:Ke(T)})]})]}),a&&n.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 group/volume [&:focus-within>input]:opacity-100",onKeyDown:Y,children:[n.jsx("button",{type:"button",onClick:ae,className:"p-1 rounded hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":z?G.audioPlayer_unmute:G.audioPlayer_mute,children:n.jsx(te,{className:Z})}),n.jsx("input",{type:"range",min:0,max:1,step:.01,value:z?0:$,onChange:H=>{k(Number(H.target.value)),A(!1)},className:"w-16 h-1 accent-primary cursor-pointer opacity-0 group-hover/volume:opacity-100 focus:opacity-100 transition-opacity","aria-label":G.audioPlayer_volume})]})]})]})});wr.displayName="AudioPlayer";const oi=Le("space-y-3 rounded-lg border bg-card text-card-foreground shadow-sm",{variants:{size:{sm:"p-3",default:"p-4",lg:"p-5"}},defaultVariants:{size:"default"}}),si=f.forwardRef(({mimeType:e="audio/webm",maxDuration:t,showWaveform:r=!0,size:o,onRecordingComplete:s,onRecordingStart:a,onError:i,className:l},d)=>{const[c,p]=f.useState("idle"),[u,m]=f.useState(0),[g,h]=f.useState(null),[x,y]=f.useState(null),[b,w]=f.useState(null),j=f.useRef(null),M=f.useRef([]),R=f.useRef(null),_=f.useRef(null),C=f.useRef(null),S=ce(),T=f.useCallback(()=>{R.current&&(clearInterval(R.current),R.current=null),_.current&&(_.current.getTracks().forEach(E=>E.stop()),_.current=null,y(null)),C.current&&(URL.revokeObjectURL(C.current),C.current=null)},[]);f.useEffect(()=>T,[T]);const L=()=>{R.current=setInterval(()=>{m(E=>{const N=E+1;return t&&N>=t&&$(),N})},1e3)},V=()=>{R.current&&(clearInterval(R.current),R.current=null)},O=async()=>{w(null);try{const E=await navigator.mediaDevices.getUserMedia({audio:!0});y(E),_.current=E,m(0),g&&(URL.revokeObjectURL(g),h(null),C.current=null);const N=MediaRecorder.isTypeSupported(e)?e:"",W=new MediaRecorder(E,N?{mimeType:N}:void 0);W.ondataavailable=q=>{q.data.size>0&&M.current.push(q.data)},W.onstop=()=>{const q=new Blob(M.current,{type:N||"audio/webm"}),G=URL.createObjectURL(q);h(G),C.current=G,s==null||s(q),E.getTracks().forEach(Z=>Z.stop()),y(null),_.current=null},W.onerror=()=>{w(S.audioRecorder_error),T(),p("idle")},j.current=W,M.current=[],W.start(100),p("recording"),L(),a==null||a()}catch(E){const N=E instanceof Error?E:new Error(String(E));N.name==="NotAllowedError"||N.name==="PermissionDeniedError"?w(S.audioRecorder_permissionDenied):w(S.audioRecorder_error),i==null||i(N)}},$=()=>{j.current&&j.current.state!=="inactive"&&j.current.stop(),V(),p("stopped")},k=()=>{j.current&&j.current.state==="recording"&&(j.current.pause(),V(),p("paused"))},z=()=>{j.current&&j.current.state==="paused"&&(j.current.resume(),L(),p("recording"))},A=()=>{T(),m(0),h(null),C.current=null,w(null),p("idle")};return n.jsxs("div",{ref:d,className:v(oi({size:o}),l),children:[b&&n.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[n.jsx(P.AlertCircle,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{children:b}),n.jsx("button",{type:"button",onClick:A,className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(P.RotateCcw,{className:"h-4 w-4"})})]}),!b&&c==="stopped"&&g?n.jsxs("div",{className:"space-y-3",children:[n.jsx(wr,{src:g,size:"sm"}),n.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n.jsx(P.RotateCcw,{className:"h-4 w-4"}),S.audioRecorder_reRecord]})]}):b?null:n.jsxs(n.Fragment,{children:[r&&x&&c==="recording"&&n.jsx(br,{stream:x,height:48,barCount:50,className:"rounded"}),n.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c==="idle"&&n.jsxs("button",{type:"button",onClick:O,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","aria-label":S.audioRecorder_startRecording,children:[n.jsx(P.Mic,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm",children:S.audioRecorder_startRecording})]}),(c==="recording"||c==="paused")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-sm font-mono tabular-nums text-muted-foreground min-w-[60px] text-center","aria-live":"off",children:[c==="recording"&&n.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-destructive animate-pulse mr-2"}),Ke(u)]}),c==="recording"?n.jsx("button",{type:"button",onClick:k,className:"p-2 rounded-full hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":S.audioRecorder_pauseRecording,children:n.jsx(P.Pause,{className:"h-5 w-5"})}):n.jsx("button",{type:"button",onClick:z,className:"p-2 rounded-full hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":S.audioRecorder_resumeRecording,children:n.jsx(P.Play,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:$,className:"p-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","aria-label":S.audioRecorder_stopRecording,children:n.jsx(P.Square,{className:"h-5 w-5"})})]})]}),t&&(c==="recording"||c==="paused")&&n.jsx("div",{className:"w-full bg-muted rounded-full h-1",children:n.jsx("div",{className:"bg-destructive rounded-full h-1 transition-[width] duration-1000",style:{width:`${Math.min(100,u/t*100)}%`}})})]})]})});si.displayName="AudioRecorder";const Gr=Le("rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",{variants:{variant:{default:"",compact:"[&_.ap-controls]:gap-2 [&_.ap-controls]:py-1"}},defaultVariants:{variant:"default"}}),ai=f.forwardRef(({tracks:e,showWaveform:t=!1,defaultRepeatMode:r="none",defaultShuffle:o=!1,autoPlay:s=!1,variant:a,onTrackChange:i,onPlayStateChange:l,className:d},c)=>{const[p,u]=f.useState(0),[m,g]=f.useState(r),[h,x]=f.useState(o),[y,b]=f.useState([]),[w,j]=f.useState(new Map),[M,R]=f.useState(null),_=f.useRef(null),C=ce();f.useEffect(()=>{if(h){const N=Array.from({length:e.length},(q,G)=>G);for(let q=N.length-1;q>0;q--){const G=Math.floor(Math.random()*(q+1));[N[q],N[G]]=[N[G],N[q]]}b(N);const W=new Map;N.forEach((q,G)=>W.set(q,G)),j(W)}},[h,e.length]);const S=f.useCallback((N,W=1)=>{if(h){const Z=(w.get(N)??-1)+W;return Z>=0&&Z<y.length?y[Z]:m==="all"?W===1?y[0]:y[y.length-1]:null}const q=N+W;return q>=0&&q<e.length?q:m==="all"?W===1?0:e.length-1:null},[h,y,w,e.length,m]),T=N=>{u(N),i==null||i(e[N],N)},L=()=>{if(m==="one")return;const N=S(p,1);N!==null&&T(N)},V=()=>{const N=S(p,-1);N!==null&&T(N)},O=()=>{const N=S(p,1);N!==null&&T(N)},$=()=>{g(N=>N==="none"?"all":N==="all"?"one":"none")},k=m==="none"?C.audioPlaylist_repeatOff:m==="all"?C.audioPlaylist_repeatAll:C.audioPlaylist_repeatOne,z=N=>{N.key==="ArrowDown"?(N.preventDefault(),R(W=>{const q=W===null?0:Math.min(W+1,e.length-1);return A(q),q})):N.key==="ArrowUp"?(N.preventDefault(),R(W=>{const q=W===null?e.length-1:Math.max(W-1,0);return A(q),q})):N.key==="Enter"||N.key===" "?(N.preventDefault(),M!==null&&T(M)):N.key==="Home"?(N.preventDefault(),R(0),A(0)):N.key==="End"&&(N.preventDefault(),R(e.length-1),A(e.length-1))},A=N=>{const W=_.current;if(!W)return;const q=W.children[N];q==null||q.scrollIntoView({block:"nearest"})},E=e[p];return E?n.jsxs("div",{ref:c,className:v(Gr({variant:a}),d),children:[n.jsxs("div",{className:"p-3 border-b space-y-2",children:[n.jsxs("div",{className:"ap-controls flex items-center justify-center gap-3",children:[n.jsx("button",{type:"button",onClick:()=>x(N=>!N),className:v("p-1.5 rounded hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h&&"text-primary"),"aria-label":C.audioPlaylist_shuffle,"aria-pressed":h,children:n.jsx(P.Shuffle,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:V,className:"p-1.5 rounded hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":C.audioPlaylist_previousTrack,children:n.jsx(P.SkipBack,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:O,className:"p-1.5 rounded hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":C.audioPlaylist_nextTrack,children:n.jsx(P.SkipForward,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:$,className:v("p-1.5 rounded hover:bg-accent active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m!=="none"&&"text-primary"),"aria-label":k,children:m==="one"?n.jsx(P.Repeat1,{className:"h-4 w-4"}):n.jsx(P.Repeat,{className:"h-4 w-4"})})]}),n.jsx(wr,{src:E.src,title:E.title,artist:E.artist,albumArt:E.albumArt,showWaveform:t,autoPlay:s||p>0,loop:m==="one",onEnded:L,onPlay:()=>l==null?void 0:l(!0),onPause:()=>l==null?void 0:l(!1),size:"sm",variant:"ghost",className:"border-0 shadow-none p-0"},E.id)]}),n.jsx(fr,{className:"max-h-64",children:n.jsx("div",{ref:_,role:"listbox","aria-label":C.audioPlaylist_shuffle,tabIndex:0,onKeyDown:z,onBlur:()=>R(null),className:"divide-y focus-visible:outline-none",children:e.map((N,W)=>n.jsxs("button",{type:"button",role:"option","aria-selected":W===p,onClick:()=>T(W),className:v("w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-accent/50 transition-colors",W===p&&"bg-accent",M===W&&"ring-2 ring-inset ring-ring"),children:[N.albumArt?n.jsx("img",{src:N.albumArt,alt:"",className:"h-8 w-8 rounded object-cover shrink-0"}):n.jsx("div",{className:"h-8 w-8 rounded bg-muted flex items-center justify-center shrink-0",children:W===p?n.jsx(P.Volume2,{className:"h-4 w-4 text-primary"}):n.jsx(P.Music,{className:"h-4 w-4 text-muted-foreground"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:v("text-sm font-medium truncate",W===p&&"text-primary"),children:N.title}),N.artist&&n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.artist})]}),N.duration!==void 0&&n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:Ke(N.duration)})]},N.id))})}),e.length>1&&n.jsx("div",{className:"px-3 py-1.5 border-t text-xs text-muted-foreground text-center",children:ze(C.audioPlaylist_trackOf,{current:String(p+1),total:String(e.length)})})]}):n.jsx("div",{ref:c,className:v(Gr({variant:a}),"p-8",d),children:n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 text-muted-foreground",children:[n.jsx(P.Music,{className:"h-8 w-8"}),n.jsx("p",{className:"text-sm",children:C.audioPlaylist_empty})]})})});ai.displayName="AudioPlaylist";const ii=Le("relative group rounded-lg overflow-hidden bg-card dark:bg-black text-card-foreground",{variants:{size:{sm:"[&_button]:p-0.5 [&_.vp-icon]:h-4 [&_.vp-icon]:w-4 [&_.vp-time]:text-[10px]",default:"",lg:"[&_button]:p-1.5 [&_.vp-icon]:h-6 [&_.vp-icon]:w-6 [&_.vp-time]:text-sm"}},defaultVariants:{size:"default"}}),Xt=f.forwardRef(({src:e,poster:t,showControls:r=!0,controlsTimeout:o=3e3,enablePiP:s=!0,enableFullscreen:a=!0,enablePlaybackRate:i=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],tracks:d,aspectRatio:c="16/9",autoPlay:p=!1,loop:u=!1,muted:m=!1,preload:g="metadata",size:h,onPlay:x,onPause:y,onEnded:b,onTimeUpdate:w,onFullscreenChange:j,className:M},R)=>{const _=f.useRef(null),C=f.useRef(null),S=f.useRef(null),T=f.useRef(null),L=f.useRef(!1),[V,O]=f.useState(!1),[$,k]=f.useState(0),[z,A]=f.useState(0),[E,N]=f.useState(0),[W,q]=f.useState(1),[G,Z]=f.useState(m),[I,F]=f.useState(!1),[U,ee]=f.useState(!0),[X,Y]=f.useState(!1),[ae,te]=f.useState(!1),[ie,K]=f.useState(1),[H,ne]=f.useState(-1),[me,ve]=f.useState(!0),[fe,Re]=f.useState(null),ue=ce(),Fe=f.useMemo(()=>D=>{C.current=D,typeof R=="function"?R(D):R&&(R.current=D)},[R]),He=typeof document<"u"&&"pictureInPictureEnabled"in document;f.useEffect(()=>{if(d){const D=d.findIndex(re=>re.default);D>=0&&ne(D)}},[d]),f.useEffect(()=>{const D=C.current;if(!D)return;const re=()=>{A(D.duration),ve(!1)},we=()=>ve(!0),Pe=()=>ve(!1),et=()=>{L.current||(k(D.currentTime),w==null||w(D.currentTime)),D.buffered.length>0&&N(D.buffered.end(D.buffered.length-1))},ft=()=>{O(!0),x==null||x()},it=()=>{O(!1),y==null||y()},lt=()=>{O(!1),b==null||b()},le=()=>{O(!1),ve(!1),Re(ue.videoPlayer_error)};return D.addEventListener("loadedmetadata",re),D.addEventListener("waiting",we),D.addEventListener("canplay",Pe),D.addEventListener("timeupdate",et),D.addEventListener("play",ft),D.addEventListener("pause",it),D.addEventListener("ended",lt),D.addEventListener("error",le),()=>{D.removeEventListener("loadedmetadata",re),D.removeEventListener("waiting",we),D.removeEventListener("canplay",Pe),D.removeEventListener("timeupdate",et),D.removeEventListener("play",ft),D.removeEventListener("pause",it),D.removeEventListener("ended",lt),D.removeEventListener("error",le)}},[x,y,b,w,ue.videoPlayer_error]),f.useEffect(()=>{const D=C.current;D&&(D.volume=G?0:W)},[W,G]),f.useEffect(()=>{Re(null),k(0),A(0),N(0),ve(!0)},[e]),f.useEffect(()=>{const D=()=>{const re=!!document.fullscreenElement;F(re),j==null||j(re)};return document.addEventListener("fullscreenchange",D),()=>document.removeEventListener("fullscreenchange",D)},[j]),f.useEffect(()=>{const D=C.current;if(D)for(let re=0;re<D.textTracks.length;re++)D.textTracks[re].mode=re===H?"showing":"hidden"},[H]),f.useEffect(()=>{if(!X&&!ae)return;const D=()=>{Y(!1),te(!1)},re=setTimeout(()=>{document.addEventListener("click",D,{once:!0})},0);return()=>{clearTimeout(re),document.removeEventListener("click",D)}},[X,ae]);const Ne=f.useCallback(()=>{ee(!0),T.current&&clearTimeout(T.current),V&&(T.current=setTimeout(()=>ee(!1),o))},[V,o]),Te=()=>{const D=C.current;D&&(V?D.pause():D.play())},nt=f.useCallback(D=>{const re=C.current;!re||!z||(re.currentTime=D*z,k(re.currentTime))},[z]),jt=D=>{if(!S.current)return;const re=S.current.getBoundingClientRect();nt((D.clientX-re.left)/re.width)},ot=D=>{var re,we;L.current=!0,(we=(re=D.target).setPointerCapture)==null||we.call(re,D.pointerId)};f.useEffect(()=>{const D=S.current;if(!D)return;const re=Pe=>{if(!L.current||!S.current)return;const et=S.current.getBoundingClientRect();nt(Math.max(0,Math.min(1,(Pe.clientX-et.left)/et.width)))},we=()=>{L.current=!1};return D.addEventListener("pointermove",re),D.addEventListener("pointerup",we),D.addEventListener("lostpointercapture",we),()=>{D.removeEventListener("pointermove",re),D.removeEventListener("pointerup",we),D.removeEventListener("lostpointercapture",we)}},[nt]);const st=()=>{var D,re;_.current&&(document.fullscreenElement?document.exitFullscreen():(re=(D=_.current).requestFullscreen)==null||re.call(D))},Nt=async()=>{const D=C.current;if(D)try{document.pictureInPictureElement?await document.exitPictureInPicture():await D.requestPictureInPicture()}catch{}},Ze=()=>Z(D=>!D),Ee=D=>{const re=C.current;re&&(re.playbackRate=D),K(D),Y(!1)},Qe=D=>{ne(D),te(!1)},Ge=D=>{const re=C.current;if(re){switch(D.key){case" ":case"k":D.preventDefault(),Te();break;case"f":D.preventDefault(),st();break;case"m":D.preventDefault(),Ze();break;case"ArrowLeft":D.preventDefault(),re.currentTime=Math.max(0,re.currentTime-5);break;case"ArrowRight":D.preventDefault(),re.currentTime=Math.min(z,re.currentTime+5);break;case"ArrowUp":D.preventDefault(),q(we=>Math.min(1,we+.1)),Z(!1);break;case"ArrowDown":D.preventDefault(),q(we=>Math.max(0,we-.1));break;case"c":D.preventDefault(),d&&d.length>0&&ne(we=>we>=0?-1:0);break}Ne()}},at=G||W===0?P.VolumeX:W<.5?P.Volume1:P.Volume2,kt=z?$/z:0,Ct=z?E/z:0;return n.jsxs("div",{ref:_,className:v(ii({size:h}),M),style:{aspectRatio:c},onMouseMove:Ne,onMouseLeave:()=>V&&ee(!1),onKeyDown:Ge,tabIndex:0,role:"application","aria-label":ue.videoPlayer_label,children:[n.jsx("video",{ref:Fe,src:e,poster:t,autoPlay:p,loop:u,muted:m,preload:g,className:"w-full h-full object-contain",onClick:Te,onDoubleClick:st,children:d==null?void 0:d.map((D,re)=>n.jsx("track",{src:D.src,kind:D.kind,srcLang:D.srcLang,label:D.label,default:D.default},re))}),fe&&n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-card/90 dark:bg-black/90 z-30",children:[n.jsx(P.AlertCircle,{className:"h-10 w-10 text-destructive"}),n.jsx("p",{className:"text-sm text-destructive font-medium",children:fe})]}),me&&!fe&&V&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:n.jsx(P.Loader2,{className:"h-10 w-10 text-primary animate-spin"})}),!V&&!fe&&r&&n.jsx("button",{type:"button",onClick:Te,className:"absolute inset-0 flex items-center justify-center z-10","aria-label":ue.videoPlayer_play,children:n.jsx("div",{className:"h-16 w-16 rounded-full bg-background/60 dark:bg-black/50 flex items-center justify-center backdrop-blur-sm hover:bg-background/80 dark:hover:bg-black/70 transition-colors",children:n.jsx(P.Play,{className:"h-8 w-8 text-foreground dark:text-white ml-1"})})}),r&&!fe&&n.jsxs("div",{className:v("absolute bottom-0 left-0 right-0 z-20 bg-gradient-to-t from-background/80 dark:from-black/80 to-transparent pt-8 pb-2 px-3 transition-opacity duration-200",U||!V?"opacity-100":"opacity-0 pointer-events-none"),children:[n.jsxs("div",{ref:S,className:"relative h-1 bg-foreground/20 dark:bg-white/20 rounded-full cursor-pointer mb-2 group/seek",onClick:jt,onPointerDown:ot,role:"slider","aria-label":ue.videoPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(z),"aria-valuenow":Math.round($),"aria-valuetext":Ke($),tabIndex:0,children:[n.jsx("div",{className:"absolute inset-y-0 left-0 bg-muted-foreground/30 rounded-full",style:{width:`${Ct*100}%`}}),n.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full",style:{width:`${kt*100}%`}}),n.jsx("div",{className:"absolute top-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover/seek:opacity-100 transition-opacity",style:{left:`${kt*100}%`,transform:"translate(-50%, -50%)"}})]}),n.jsxs("div",{className:"flex items-center gap-2 text-foreground dark:text-white",children:[n.jsx("button",{type:"button",onClick:Te,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":V?ue.videoPlayer_pause:ue.videoPlayer_play,children:V?n.jsx(P.Pause,{className:"vp-icon h-5 w-5"}):n.jsx(P.Play,{className:"vp-icon h-5 w-5"})}),n.jsxs("span",{className:"vp-time text-xs tabular-nums",children:[Ke($)," / ",Ke(z)]}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1 group/vol",children:[n.jsx("button",{type:"button",onClick:Ze,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":G?ue.videoPlayer_unmute:ue.videoPlayer_mute,children:n.jsx(at,{className:"vp-icon h-5 w-5"})}),n.jsx("input",{type:"range",min:0,max:1,step:.01,value:G?0:W,onChange:D=>{q(Number(D.target.value)),Z(!1)},className:"w-16 h-1 accent-primary cursor-pointer opacity-0 group-hover/vol:opacity-100 focus:opacity-100 transition-opacity","aria-label":ue.videoPlayer_volume})]}),i&&n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:D=>{D.stopPropagation(),Y(re=>!re),te(!1)},className:"px-1.5 py-0.5 text-xs hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":ue.videoPlayer_playbackSpeed,children:[ie,"x"]}),X&&n.jsx("div",{className:"absolute bottom-full right-0 mb-1 bg-popover text-popover-foreground rounded-md border shadow-md py-1 min-w-[60px]",onClick:D=>D.stopPropagation(),children:l.map(D=>n.jsxs("button",{type:"button",onClick:()=>Ee(D),className:v("block w-full px-3 py-1 text-xs text-left hover:bg-accent transition-colors",D===ie&&"text-primary"),children:[D,"x"]},D))})]}),d&&d.length>0&&n.jsxs("div",{className:"relative",children:[n.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),te(re=>!re),Y(!1)},className:v("p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors",H>=0&&"text-primary"),"aria-label":ue.videoPlayer_subtitles,children:n.jsx(P.Subtitles,{className:"vp-icon h-5 w-5"})}),ae&&n.jsxs("div",{className:"absolute bottom-full right-0 mb-1 bg-popover text-popover-foreground rounded-md border shadow-md py-1 min-w-[120px]",onClick:D=>D.stopPropagation(),children:[n.jsx("button",{type:"button",onClick:()=>Qe(-1),className:v("block w-full px-3 py-1 text-xs text-left hover:bg-accent transition-colors",H===-1&&"text-primary"),children:ue.videoPlayer_subtitlesOff}),d.map((D,re)=>n.jsx("button",{type:"button",onClick:()=>Qe(re),className:v("block w-full px-3 py-1 text-xs text-left hover:bg-accent transition-colors",re===H&&"text-primary"),children:D.label},re))]})]}),s&&He&&n.jsx("button",{type:"button",onClick:Nt,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":ue.videoPlayer_pictureInPicture,children:n.jsx(P.PictureInPicture2,{className:"vp-icon h-5 w-5"})}),a&&n.jsx("button",{type:"button",onClick:st,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":I?ue.videoPlayer_exitFullscreen:ue.videoPlayer_fullscreen,children:I?n.jsx(P.Minimize,{className:"vp-icon h-5 w-5"}):n.jsx(P.Maximize,{className:"vp-icon h-5 w-5"})})]})]})]})});Xt.displayName="VideoPlayer";const li=f.forwardRef(({source:e="camera",videoConstraints:t,audioConstraints:r=!0,mimeType:o="video/webm",maxDuration:s,showTimer:a=!0,mirrored:i,onRecordingComplete:l,onRecordingStart:d,onError:c,className:p},u)=>{const[m,g]=f.useState("idle"),[h,x]=f.useState(0),[y,b]=f.useState(null),[w,j]=f.useState(null),[M,R]=f.useState(null),_=f.useRef(null),C=f.useRef(null),S=f.useRef([]),T=f.useRef(null),L=f.useRef(null),V=f.useRef(null),O=ce(),$=i!==void 0?i:e==="camera",k=f.useCallback(()=>{T.current&&(clearInterval(T.current),T.current=null),L.current&&(L.current.getTracks().forEach(I=>I.stop()),L.current=null,j(null)),V.current&&(URL.revokeObjectURL(V.current),V.current=null)},[]);f.useEffect(()=>k,[k]);const z=()=>{T.current=setInterval(()=>{x(I=>{const F=I+1;return s&&F>=s&&W(),F})},1e3)},A=()=>{T.current&&(clearInterval(T.current),T.current=null)},E=async()=>{R(null);try{let I;e==="screen"?I=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!!r}):I=await navigator.mediaDevices.getUserMedia({video:t||!0,audio:r}),I.getVideoTracks().forEach(F=>{F.addEventListener("ended",()=>{k(),g("idle")})}),j(I),L.current=I,g("preview"),_.current&&(_.current.srcObject=I)}catch(I){const F=I instanceof Error?I:new Error(String(I));F.name==="NotAllowedError"||F.name==="PermissionDeniedError"?R(O.videoRecorder_permissionDenied):R(O.videoRecorder_error),c==null||c(F)}};f.useEffect(()=>{_.current&&w&&(m==="preview"||m==="recording"||m==="paused")&&(_.current.srcObject=w)},[w,m]);const N=()=>{if(!w)return;S.current=[],x(0),y&&(URL.revokeObjectURL(y),b(null),V.current=null);const I=MediaRecorder.isTypeSupported(o)?o:"",F=new MediaRecorder(w,I?{mimeType:I}:void 0);F.ondataavailable=U=>{U.data.size>0&&S.current.push(U.data)},F.onstop=()=>{const U=new Blob(S.current,{type:I||"video/webm"}),ee=URL.createObjectURL(U);b(ee),V.current=ee,l==null||l(U),w.getTracks().forEach(X=>X.stop()),j(null),L.current=null},F.onerror=()=>{R(O.videoRecorder_error),k(),g("idle")},C.current=F,F.start(100),g("recording"),z(),d==null||d()},W=()=>{C.current&&C.current.state!=="inactive"&&C.current.stop(),A(),g("stopped")},q=()=>{C.current&&C.current.state==="recording"&&(C.current.pause(),A(),g("paused"))},G=()=>{C.current&&C.current.state==="paused"&&(C.current.resume(),z(),g("recording"))},Z=()=>{k(),x(0),b(null),V.current=null,R(null),g("idle")};return n.jsxs("div",{ref:u,className:v("space-y-3 rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",p),children:[M&&n.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-destructive",children:[n.jsx(P.AlertCircle,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{children:M}),n.jsx("button",{type:"button",onClick:Z,className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(P.RotateCcw,{className:"h-4 w-4"})})]}),!M&&m==="stopped"&&y?n.jsxs("div",{className:"space-y-3",children:[n.jsx(Xt,{src:y,aspectRatio:"16/9"}),n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("button",{type:"button",onClick:Z,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n.jsx(P.RotateCcw,{className:"h-4 w-4"}),O.videoRecorder_reRecord]})})]}):!M&&m==="idle"?n.jsx("div",{className:"flex items-center justify-center gap-3 p-8",children:n.jsx("button",{type:"button",onClick:E,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:e==="screen"?n.jsxs(n.Fragment,{children:[n.jsx(P.Monitor,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm",children:O.videoRecorder_shareScreen})]}):n.jsxs(n.Fragment,{children:[n.jsx(P.Camera,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm",children:O.videoRecorder_startCamera})]})})}):M?null:n.jsxs("div",{className:"relative",children:[n.jsx("video",{ref:_,autoPlay:!0,muted:!0,playsInline:!0,className:v("w-full",$&&"scale-x-[-1]"),style:{aspectRatio:"16/9"},"aria-label":e==="camera"?O.videoRecorder_cameraPreview:O.videoRecorder_screenPreview}),a&&(m==="recording"||m==="paused")&&n.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 px-2 py-1 rounded bg-background/60 dark:bg-black/60 text-foreground dark:text-white text-sm tabular-nums backdrop-blur-sm",children:[m==="recording"&&n.jsx("span",{className:"h-2 w-2 rounded-full bg-destructive animate-pulse"}),Ke(h)]}),n.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-3",children:[m==="preview"&&n.jsx("button",{type:"button",onClick:N,className:"h-12 w-12 rounded-full bg-destructive hover:bg-destructive/90 flex items-center justify-center transition-colors border-4 border-background/80 dark:border-white/80 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":O.videoRecorder_startRecording,children:n.jsx(P.Circle,{className:"h-5 w-5 text-destructive-foreground fill-destructive-foreground"})}),m==="recording"&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:q,className:"p-2 rounded-full bg-background/50 dark:bg-black/50 hover:bg-background/70 dark:hover:bg-black/70 text-foreground dark:text-white transition-colors backdrop-blur-sm active:scale-95","aria-label":O.videoRecorder_pauseRecording,children:n.jsx(P.Pause,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:W,className:"h-12 w-12 rounded-full bg-destructive hover:bg-destructive/90 flex items-center justify-center transition-colors border-4 border-background/80 dark:border-white/80 active:scale-95","aria-label":O.videoRecorder_stopRecording,children:n.jsx(P.Square,{className:"h-5 w-5 text-destructive-foreground fill-destructive-foreground"})})]}),m==="paused"&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:G,className:"p-2 rounded-full bg-background/50 dark:bg-black/50 hover:bg-background/70 dark:hover:bg-black/70 text-foreground dark:text-white transition-colors backdrop-blur-sm active:scale-95","aria-label":O.videoRecorder_resumeRecording,children:n.jsx(P.Play,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:W,className:"h-12 w-12 rounded-full bg-destructive hover:bg-destructive/90 flex items-center justify-center transition-colors border-4 border-background/80 dark:border-white/80 active:scale-95","aria-label":O.videoRecorder_stopRecording,children:n.jsx(P.Square,{className:"h-5 w-5 text-destructive-foreground fill-destructive-foreground"})})]})]}),s&&(m==="recording"||m==="paused")&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-foreground/20 dark:bg-white/20",children:n.jsx("div",{className:"h-full bg-destructive transition-[width] duration-1000",style:{width:`${Math.min(100,h/s*100)}%`}})})]})]})});li.displayName="VideoRecorder";const Pn=f.forwardRef(({src:e,poster:t,title:r,duration:o,clickAction:s="inline",aspectRatio:a="16/9",showDuration:i=!0,showPlayButton:l=!0,onPlay:d,className:c,...p},u)=>{const[m,g]=f.useState(!1),[h,x]=f.useState(null),y=ce();f.useEffect(()=>{if(t||!e)return;const R=document.createElement("video");R.crossOrigin="anonymous",R.preload="metadata",R.muted=!0;const _=()=>{try{const S=document.createElement("canvas");S.width=R.videoWidth,S.height=R.videoHeight;const T=S.getContext("2d");T&&(T.drawImage(R,0,0),x(S.toDataURL("image/jpeg",.7)))}catch{}R.remove()};R.addEventListener("seeked",_,{once:!0});const C=()=>{R.currentTime=Math.min(1,R.duration*.1)};return R.addEventListener("loadedmetadata",C,{once:!0}),R.src=e,()=>{R.removeEventListener("seeked",_),R.removeEventListener("loadedmetadata",C),R.src="",R.remove()}},[e,t]);const b=()=>{s==="inline"?(g(!0),d==null||d()):s==="none"&&(d==null||d())},w=R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),b())},j=t||h,M=r?ze(y.videoThumbnail_play,{title:r}):y.videoPlayer_play;return m&&s==="inline"?n.jsx("div",{ref:u,className:v("rounded-lg overflow-hidden bg-card dark:bg-black",c),style:{aspectRatio:a},...p,children:n.jsx(Xt,{src:e,autoPlay:!0,aspectRatio:a})}):n.jsxs("div",{ref:u,className:v("relative rounded-lg overflow-hidden bg-muted cursor-pointer group",c),style:{aspectRatio:a},onClick:b,onKeyDown:w,role:"button",tabIndex:0,"aria-label":M,...p,children:[j?n.jsx("img",{src:j,alt:r||"",className:"w-full h-full object-cover",draggable:!1}):n.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:n.jsx(P.Play,{className:"h-8 w-8 text-muted-foreground"})}),l&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"h-12 w-12 rounded-full bg-background/60 dark:bg-black/50 flex items-center justify-center backdrop-blur-sm group-hover:bg-background/80 dark:group-hover:bg-black/70 group-hover:scale-110 transition-all",children:n.jsx(P.Play,{className:"h-6 w-6 text-foreground dark:text-white ml-0.5"})})}),i&&o!==void 0&&n.jsx("span",{className:"absolute bottom-2 right-2 px-1.5 py-0.5 rounded bg-card/80 dark:bg-black/70 text-card-foreground dark:text-white text-xs tabular-nums backdrop-blur-sm",children:Ke(o)}),r&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-background/60 dark:from-black/60 to-transparent p-2 pt-6",children:n.jsx("p",{className:"text-foreground dark:text-white text-sm font-medium truncate",children:r})})]})});Pn.displayName="VideoThumbnail";const ci=f.forwardRef(({videos:e,columns:t=3,gap:r=4,aspectRatio:o="16/9",clickAction:s="lightbox",onVideoSelect:a,className:i,...l},d)=>{const[c,p]=f.useState(null),[u,m]=f.useState(null),g=f.useRef(null),h=f.useRef(null),x=ce(),y=f.useCallback(()=>{if(typeof t=="number")return t;if(typeof window>"u")return t.sm??3;const L=window.innerWidth;return t.xl&&L>=1280?t.xl:t.lg&&L>=1024?t.lg:t.md&&L>=768?t.md:t.sm??3},[t]),[b,w]=f.useState(typeof t=="number"?t:3);f.useEffect(()=>{const L=()=>w(y());return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[y]);const j=(L,V)=>{a==null||a(L,V),s==="lightbox"&&(g.current=document.activeElement instanceof HTMLElement?document.activeElement:null,p(V))},M=()=>{var L;p(null),(L=g.current)==null||L.focus()},R=f.useCallback(()=>{c!==null&&p(c>0?c-1:e.length-1)},[c,e.length]),_=f.useCallback(()=>{c!==null&&p(c<e.length-1?c+1:0)},[c,e.length]);f.useEffect(()=>{var O;if(c===null)return;const L=document.body.style.overflow;document.body.style.overflow="hidden",(O=h.current)==null||O.focus();const V=$=>{switch($.key){case"Escape":$.preventDefault(),M();break;case"ArrowLeft":$.preventDefault(),R();break;case"ArrowRight":$.preventDefault(),_();break}if($.key==="Tab"&&h.current){const k=h.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(k.length===0)return;const z=k[0],A=k[k.length-1];$.shiftKey?document.activeElement===z&&($.preventDefault(),A.focus()):document.activeElement===A&&($.preventDefault(),z.focus())}};return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V),document.body.style.overflow=L}},[c,R,_]);const C=L=>{m(L.touches[0].clientX)},S=L=>{var $;if(u===null)return;const V=u-L.changedTouches[0].clientX,O=Math.max(30,Math.min(80,((($=h.current)==null?void 0:$.offsetWidth)??300)*.1));Math.abs(V)>O&&(V>0?_():R()),m(null)},T={gridTemplateColumns:`repeat(${b}, minmax(0, 1fr))`};return n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:d,className:v("grid",i),style:{...T,gap:`${r*4}px`},role:"list","aria-label":x.videoGallery_label,...l,children:e.map((L,V)=>n.jsx(Pn,{src:L.src,poster:L.poster,title:L.title,duration:L.duration,aspectRatio:o,clickAction:"none",onPlay:()=>j(L,V),role:"listitem"},L.id))}),s==="lightbox"&&c!==null&&e[c]&&qr.createPortal(n.jsxs("div",{ref:h,className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 dark:bg-black/95",onClick:L=>{L.target===L.currentTarget&&M()},onTouchStart:C,onTouchEnd:S,role:"dialog","aria-modal":"true","aria-label":x.videoGallery_label,tabIndex:-1,children:[n.jsx("button",{type:"button",onClick:M,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":x.common_close,children:n.jsx(P.X,{className:"h-5 w-5"})}),e.length>1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:R,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":x.common_previous,children:n.jsx(P.ChevronLeft,{className:"h-6 w-6"})}),n.jsx("button",{type:"button",onClick:_,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":x.common_next,children:n.jsx(P.ChevronRight,{className:"h-6 w-6"})})]}),n.jsxs("div",{className:"w-full max-w-4xl px-4",children:[n.jsx(Xt,{src:e[c].src,poster:e[c].poster,autoPlay:!0,aspectRatio:o},e[c].id),e[c].title&&n.jsx("p",{className:"text-foreground text-sm mt-3 text-center",children:e[c].title})]}),n.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-muted-foreground text-sm tabular-nums",children:[c+1," / ",e.length]})]}),document.body)]})});ci.displayName="VideoGallery";const Cm={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},di=f.forwardRef(({src:e,alt:t,fallbackSrc:r,placeholder:o,showSkeleton:s=!0,lazy:a=!0,rootMargin:i="200px",aspectRatio:l,zoomOnHover:d=!1,zoomScale:c=1.5,zoomOnClick:p=!1,fit:u="cover",className:m,style:g,onLoad:h,onError:x,...y},b)=>{const[w,j]=f.useState("loading"),[M,R]=f.useState(!a),[_,C]=f.useState(e),[S,T]=f.useState(!1),L=f.useRef(null),V=ce();f.useEffect(()=>{C(e),j("loading")},[e]),f.useEffect(()=>{if(!a||!L.current)return;const E=new IntersectionObserver(([N])=>{N.isIntersecting&&(R(!0),E.disconnect())},{rootMargin:i});return E.observe(L.current),()=>E.disconnect()},[a,i]);const O=E=>{j("loaded"),h==null||h(E)},$=E=>{r&&_!==r?C(r):j("error"),x==null||x(E)},k=()=>{p&&T(E=>!E)},z=E=>{p&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),T(N=>!N))},A=l!==void 0?{aspectRatio:typeof l=="number"?`${l}`:l}:{};return n.jsxs("div",{ref:L,className:v("group relative overflow-hidden inline-block",p&&"cursor-zoom-in focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",m),style:{...A,...g},onClick:k,onKeyDown:z,tabIndex:p?0:void 0,role:p?"button":void 0,"aria-label":p?V.image_zoomIn:void 0,children:[M&&_?n.jsx("img",{ref:b,src:_,alt:t??"",className:v("w-full h-full transition-transform duration-300",Cm[u],d&&"hover:scale-[var(--zoom-scale)]",S&&"scale-[var(--zoom-scale)]",w==="loading"&&"opacity-0"),style:{"--zoom-scale":c},onLoad:O,onError:$,...y}):null,w==="loading"&&M&&n.jsx("div",{className:"absolute inset-0",children:o||s&&n.jsx("div",{className:"w-full h-full animate-pulse bg-muted rounded-md"})}),w==="error"&&n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-muted rounded-md",children:[n.jsx(P.ImageOff,{className:"h-6 w-6 text-muted-foreground"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:V.image_failedToLoad})]}),p&&w==="loaded"&&!S&&n.jsx("div",{className:"absolute bottom-2 right-2 p-1.5 rounded-full bg-background/60 dark:bg-black/50 text-foreground dark:text-white opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none backdrop-blur-sm",children:n.jsx(P.ZoomIn,{className:"h-4 w-4"})})]})});di.displayName="NUIImage";function ui({images:e,open:t,defaultIndex:r=0,onClose:o,onIndexChange:s,enableZoom:a=!0,enableKeyboard:i=!0,enableDownload:l=!1,showCounter:d=!0,showThumbnails:c=!1,className:p,children:u}){const[m,g]=f.useState(!1),[h,x]=f.useState(r),[y,b]=f.useState(!1),[w,j]=f.useState(!0),[M,R]=f.useState(null),_=f.useRef(null),C=f.useRef(null),S=ce(),T=t!==void 0?t:m,L=G=>{_.current=document.activeElement instanceof HTMLElement?document.activeElement:null,G!==void 0&&x(G),j(!0),g(!0)},V=()=>{var G;g(!1),b(!1),o==null||o(),(G=_.current)==null||G.focus()},O=f.useCallback(G=>{x(G),b(!1),j(!0),s==null||s(G)},[s]),$=f.useCallback(()=>{O(h>0?h-1:e.length-1)},[h,e.length,O]),k=f.useCallback(()=>{O(h<e.length-1?h+1:0)},[h,e.length,O]);f.useEffect(()=>{if(!T||!i)return;const G=Z=>{switch(Z.key){case"Escape":Z.preventDefault(),V();break;case"ArrowLeft":Z.preventDefault(),$();break;case"ArrowRight":Z.preventDefault(),k();break}};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[T,i,$,k]),f.useEffect(()=>{var I;if(!T)return;const G=document.body.style.overflow;document.body.style.overflow="hidden",(I=C.current)==null||I.focus();const Z=F=>{if(F.key!=="Tab"||!C.current)return;const U=C.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(U.length===0)return;const ee=U[0],X=U[U.length-1];F.shiftKey?document.activeElement===ee&&(F.preventDefault(),X.focus()):document.activeElement===X&&(F.preventDefault(),ee.focus())};return document.addEventListener("keydown",Z),()=>{document.body.style.overflow=G,document.removeEventListener("keydown",Z)}},[T]);const z=G=>{G.target===C.current&&V()},A=G=>{R(G.touches[0].clientX)},E=G=>{var F;if(M===null)return;const Z=M-G.changedTouches[0].clientX,I=Math.max(30,Math.min(80,(((F=C.current)==null?void 0:F.offsetWidth)??300)*.1));Math.abs(Z)>I&&(Z>0?k():$()),R(null)},N=()=>{a&&b(G=>!G)},W=()=>{const G=e[h];if(!G)return;const Z=document.createElement("a");Z.href=G.src,Z.download=G.alt||"image",Z.click()};if(!T)return u?n.jsx("div",{onClick:()=>L(r),className:"cursor-pointer",children:u}):null;const q=e[h];return q?qr.createPortal(n.jsxs("div",{ref:C,className:v("fixed inset-0 z-50 flex flex-col items-center justify-center bg-background/95 dark:bg-black/95",p),onClick:z,onTouchStart:A,onTouchEnd:E,role:"dialog","aria-modal":"true","aria-label":S.lightbox_label,tabIndex:-1,children:[n.jsxs("div",{className:"absolute top-4 left-0 right-0 z-10 flex items-center justify-between px-4",children:[d&&e.length>1&&n.jsx("div",{className:"text-muted-foreground text-sm tabular-nums","aria-live":"polite",children:ze(S.lightbox_imageOf,{current:String(h+1),total:String(e.length)})}),!d&&n.jsx("div",{}),n.jsxs("div",{className:"flex items-center gap-2",children:[l&&n.jsx("button",{type:"button",onClick:W,className:"p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":S.lightbox_download,children:n.jsx(P.Download,{className:"h-5 w-5"})}),a&&n.jsx("button",{type:"button",onClick:()=>b(G=>!G),className:"p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":y?S.lightbox_zoomOut:S.lightbox_zoomIn,children:y?n.jsx(P.ZoomOut,{className:"h-5 w-5"}):n.jsx(P.ZoomIn,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:V,className:"p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":S.common_close,children:n.jsx(P.X,{className:"h-5 w-5"})})]})]}),e.length>1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:$,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":S.common_previous,children:n.jsx(P.ChevronLeft,{className:"h-6 w-6"})}),n.jsx("button",{type:"button",onClick:k,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":S.common_next,children:n.jsx(P.ChevronRight,{className:"h-6 w-6"})})]}),n.jsxs("div",{className:v("flex-1 flex items-center justify-center w-full",y?"overflow-auto cursor-zoom-out":"cursor-zoom-in"),onDoubleClick:N,children:[w&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsx(P.Loader2,{className:"h-8 w-8 text-primary animate-spin"})}),n.jsx("img",{src:q.src,alt:q.alt||"",className:v("transition-all duration-200 select-none",y?"max-w-none max-h-none":"max-h-[85vh] max-w-[90vw] object-contain",w&&"opacity-0"),style:y?{transform:"scale(2)"}:void 0,draggable:!1,onLoad:()=>j(!1)},q.src)]}),(q.title||q.description)&&n.jsxs("div",{className:"absolute bottom-16 left-1/2 -translate-x-1/2 text-center text-foreground max-w-lg px-4",children:[q.title&&n.jsx("p",{className:"text-sm font-medium",children:q.title}),q.description&&n.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:q.description})]}),c&&e.length>1&&n.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 max-w-[90vw] overflow-x-auto px-4 py-2",children:e.map((G,Z)=>n.jsx("button",{type:"button",onClick:()=>O(Z),className:v("shrink-0 w-12 h-12 rounded overflow-hidden border-2 transition-all",Z===h?"border-primary":"border-transparent opacity-60 hover:opacity-100"),children:n.jsx("img",{src:G.src,alt:"",className:"w-full h-full object-cover"})},Z))})]}),document.body):null}ui.displayName="Lightbox";const mi=f.forwardRef(({src:e,aspectRatio:t,minSize:r=50,maxSize:o,initialCrop:s,outputFormat:a="image/png",outputQuality:i=.92,onCropComplete:l,onCropChange:d,onError:c,showGrid:p=!0,circular:u=!1,className:m},g)=>{const h=f.useRef(null),x=f.useRef(null),[y,b]=f.useState(!1),[w,j]=f.useState({width:0,height:0}),[M,R]=f.useState(s||{x:.15,y:.15,width:.7,height:.7}),[_,C]=f.useState(null),[S,T]=f.useState(null),[L,V]=f.useState({x:0,y:0}),[O,$]=f.useState({x:0,y:0,width:0,height:0}),k=f.useRef(null),z=ce();f.useEffect(()=>{s&&R(s)},[s]);const A=()=>{x.current&&(j({width:x.current.naturalWidth,height:x.current.naturalHeight}),b(!0))},E=f.useCallback(I=>{let{x:F,y:U,width:ee,height:X}=I;const Y=r/(w.width||1),ae=r/(w.height||1);if(ee=Math.max(Y,ee),X=Math.max(ae,X),o&&(ee=Math.min(o/(w.width||1),ee),X=Math.min(o/(w.height||1),X)),ee=Math.min(1,ee),X=Math.min(1,X),t){const te=(w.width||1)/(w.height||1),ie=t/te;ee/X>ie?ee=X*ie:X=ee/ie}return F=Math.max(0,Math.min(1-ee,F)),U=Math.max(0,Math.min(1-X,U)),{x:F,y:U,width:ee,height:X}},[w,r,o,t]);f.useEffect(()=>{if(!_)return;const I=U=>{U.preventDefault();const ee=h.current;if(!ee)return;const X=ee.getBoundingClientRect(),Y=(U.clientX-L.x)/X.width,ae=(U.clientY-L.y)/X.height;let te;if(_==="move")te=E({...O,x:O.x+Y,y:O.y+ae});else{switch(te={...O},S){case"se":te.width=O.width+Y,te.height=O.height+ae;break;case"sw":te.x=O.x+Y,te.width=O.width-Y,te.height=O.height+ae;break;case"ne":te.y=O.y+ae,te.width=O.width+Y,te.height=O.height-ae;break;case"nw":te.x=O.x+Y,te.y=O.y+ae,te.width=O.width-Y,te.height=O.height-ae;break;case"n":te.y=O.y+ae,te.height=O.height-ae;break;case"s":te.height=O.height+ae;break;case"w":te.x=O.x+Y,te.width=O.width-Y;break;case"e":te.width=O.width+Y;break}te=E(te)}R(te),d==null||d(te)},F=()=>{if(C(null),T(null),k.current){try{k.current.target.releasePointerCapture(k.current.pointerId)}catch{}k.current=null}};return document.addEventListener("pointermove",I),document.addEventListener("pointerup",F),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",F)}},[_,L,O,S,E,d]);const N=(I,F,U)=>{I.preventDefault(),I.stopPropagation();const ee=I.currentTarget;try{ee.setPointerCapture(I.pointerId),k.current={target:ee,pointerId:I.pointerId}}catch{}C(F),T(U||null),V({x:I.clientX,y:I.clientY}),$({...M})},W=I=>{const F=I.shiftKey?.05:.01;let U={...M};if(I.shiftKey&&!I.altKey)switch(I.key){case"ArrowLeft":U.width-=F;break;case"ArrowRight":U.width+=F;break;case"ArrowUp":U.height-=F;break;case"ArrowDown":U.height+=F;break;default:return}else switch(I.key){case"ArrowLeft":U.x-=F;break;case"ArrowRight":U.x+=F;break;case"ArrowUp":U.y-=F;break;case"ArrowDown":U.y+=F;break;case"Enter":q();return;default:return}I.preventDefault(),U=E(U),R(U),d==null||d(U)},q=()=>{const I=x.current;if(!I||!l)return;const F=document.createElement("canvas"),U=M.x*I.naturalWidth,ee=M.y*I.naturalHeight,X=M.width*I.naturalWidth,Y=M.height*I.naturalHeight;F.width=X,F.height=Y;const ae=F.getContext("2d");if(!ae)return;u&&(ae.beginPath(),ae.arc(X/2,Y/2,Math.min(X,Y)/2,0,Math.PI*2),ae.closePath(),ae.clip()),ae.drawImage(I,U,ee,X,Y,0,0,X,Y);const te=F.toDataURL(a,i);F.toBlob(ie=>{ie?l(ie,te):c==null||c(new Error(z.imageCropper_cropFailed))},a,i)},G=()=>{const F=E(s||{x:.15,y:.15,width:.7,height:.7});R(F),d==null||d(F)},Z=[{handle:"nw",pos:"top-0 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-[nw-resize]"},{handle:"ne",pos:"top-0 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-[ne-resize]"},{handle:"sw",pos:"bottom-0 left-0 -translate-x-1/2 translate-y-1/2",cursor:"cursor-[sw-resize]"},{handle:"se",pos:"bottom-0 right-0 translate-x-1/2 translate-y-1/2",cursor:"cursor-[se-resize]"},{handle:"n",pos:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-[n-resize]"},{handle:"s",pos:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",cursor:"cursor-[s-resize]"},{handle:"w",pos:"top-1/2 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-[w-resize]"},{handle:"e",pos:"top-1/2 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-[e-resize]"}];return n.jsxs("div",{ref:g,className:v("space-y-3",m),children:[n.jsxs("div",{ref:h,className:"relative overflow-hidden rounded-lg select-none",role:"application","aria-label":z.imageCropper_label,tabIndex:0,onKeyDown:W,children:[n.jsx("img",{ref:x,src:e,alt:"",className:"block w-full",onLoad:A,crossOrigin:"anonymous",draggable:!1}),y&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 pointer-events-none"}),n.jsxs("div",{className:v("absolute border-2 border-white shadow-lg cursor-move",u&&"rounded-full"),style:{left:`${M.x*100}%`,top:`${M.y*100}%`,width:`${M.width*100}%`,height:`${M.height*100}%`},onPointerDown:I=>N(I,"move"),children:[n.jsx("div",{className:v("absolute inset-0 overflow-hidden",u&&"rounded-full"),children:n.jsx("img",{src:e,alt:"",className:"block",style:{position:"absolute",left:`-${M.x/M.width*100}%`,top:`-${M.y/M.height*100}%`,width:`${1/M.width*100}%`,height:`${1/M.height*100}%`},draggable:!1})}),p&&!u&&n.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[n.jsx("div",{className:"absolute left-1/3 top-0 bottom-0 w-px bg-white/40"}),n.jsx("div",{className:"absolute left-2/3 top-0 bottom-0 w-px bg-white/40"}),n.jsx("div",{className:"absolute top-1/3 left-0 right-0 h-px bg-white/40"}),n.jsx("div",{className:"absolute top-2/3 left-0 right-0 h-px bg-white/40"})]}),!u&&Z.map(({handle:I,pos:F,cursor:U})=>n.jsx("div",{className:v("absolute w-3 h-3 bg-white rounded-full border border-border shadow z-10",F,U),onPointerDown:ee=>N(ee,"resize",I)},I))]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:q,className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 transition-colors",children:[n.jsx(P.Crop,{className:"h-4 w-4"}),z.imageCropper_crop]}),n.jsxs("button",{type:"button",onClick:G,className:"flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm hover:bg-accent transition-colors",children:[n.jsx(P.RotateCcw,{className:"h-4 w-4"}),z.imageCropper_reset]})]})]})});mi.displayName="ImageCropper";const fi=f.forwardRef(({beforeSrc:e,afterSrc:t,beforeAlt:r="",afterAlt:o="",initialPosition:s=50,orientation:a="horizontal",showLabels:i=!0,beforeLabel:l,afterLabel:d,handleSize:c=4,onPositionChange:p,className:u,...m},g)=>{const[h,x]=f.useState(Math.max(0,Math.min(100,s))),[y,b]=f.useState(!1),w=f.useRef(null),[j,M]=f.useState({width:0,height:0}),R=f.useRef(null),_=ce(),C=a==="horizontal",S=l??_.imageCompare_before,T=d??_.imageCompare_after;f.useEffect(()=>{const k=w.current;if(!k)return;const z=new ResizeObserver(A=>{for(const E of A){const{width:N,height:W}=E.contentRect;M({width:N,height:W})}});return z.observe(k),M({width:k.offsetWidth,height:k.offsetHeight}),()=>z.disconnect()},[]);const L=f.useCallback((k,z)=>{const A=w.current;if(!A)return;const E=A.getBoundingClientRect();let N;C?N=(k-E.left)/E.width*100:N=(z-E.top)/E.height*100,N=Math.max(0,Math.min(100,N)),x(N),p==null||p(N)},[C,p]);f.useEffect(()=>{if(!y)return;const k=E=>{E.preventDefault(),L(E.clientX,E.clientY)},z=()=>{if(R.current){const{element:E,pointerId:N}=R.current;E.releasePointerCapture(N),R.current=null}b(!1)},A=()=>{if(R.current){const{element:E,pointerId:N}=R.current;E.releasePointerCapture(N),R.current=null}b(!1)};return document.addEventListener("pointermove",k),document.addEventListener("pointerup",z),window.addEventListener("blur",A),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",z),window.removeEventListener("blur",A)}},[y,L]);const V=k=>{k.preventDefault();const z=k.currentTarget;z.setPointerCapture(k.pointerId),R.current={element:z,pointerId:k.pointerId},b(!0)},O=k=>{const z=k.shiftKey?10:1;let A=h;if(C&&k.key==="ArrowLeft"||!C&&k.key==="ArrowUp")A=Math.max(0,h-z);else if(C&&k.key==="ArrowRight"||!C&&k.key==="ArrowDown")A=Math.min(100,h+z);else return;k.preventDefault(),x(A),p==null||p(A)},$=()=>{const k=s;x(k),p==null||p(k)};return n.jsxs("div",{ref:k=>{w.current=k,typeof g=="function"?g(k):g&&(g.current=k)},className:v("relative select-none overflow-hidden rounded-lg",u),...m,children:[n.jsx("img",{src:t,alt:o,className:"block w-full h-full object-cover",draggable:!1}),n.jsx("div",{className:"absolute inset-0 overflow-hidden",style:C?{width:`${h}%`}:{height:`${h}%`},children:n.jsx("img",{src:e,alt:r,className:v("block object-cover",C?"h-full":"w-full"),style:C?{width:`${j.width}px`,maxWidth:"none",height:"100%"}:{height:`${j.height}px`,maxHeight:"none",width:"100%"},draggable:!1})}),n.jsxs("div",{className:v("absolute z-10",C?"top-0 bottom-0 cursor-[ew-resize]":"left-0 right-0 cursor-[ns-resize]"),style:C?{left:`${h}%`,width:c,transform:"translateX(-50%)"}:{top:`${h}%`,height:c,transform:"translateY(-50%)"},onPointerDown:V,onDoubleClick:$,onKeyDown:O,role:"slider","aria-label":_.imageCompare_slider,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),"aria-orientation":C?"horizontal":"vertical",tabIndex:0,children:[n.jsx("div",{className:v("bg-primary shadow-lg",C?"w-0.5 h-full mx-auto":"h-0.5 w-full my-auto")}),n.jsx("div",{className:v("absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg","left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8"),children:n.jsx(P.GripVertical,{className:v("h-4 w-4",!C&&"rotate-90")})})]}),i&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"absolute top-3 left-3 px-2 py-1 rounded bg-card/80 dark:bg-black/60 text-card-foreground dark:text-white text-xs font-medium pointer-events-none backdrop-blur-sm",children:S}),n.jsx("span",{className:"absolute top-3 right-3 px-2 py-1 rounded bg-card/80 dark:bg-black/60 text-card-foreground dark:text-white text-xs font-medium pointer-events-none backdrop-blur-sm",children:T})]})]})});fi.displayName="ImageCompare";function Sm({className:e}){const{setTheme:t}=gr(),r=ce();return n.jsxs(ws,{children:[n.jsx(ys,{asChild:!0,children:n.jsxs(ke,{variant:"outline",size:"icon",className:e,children:[n.jsx(P.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),n.jsx(P.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),n.jsx("span",{className:"sr-only",children:r.modeToggle_toggleTheme})]})}),n.jsxs(xn,{align:"end",children:[n.jsxs(Ft,{onClick:()=>t("light"),children:[n.jsx(P.Sun,{className:"mr-2 h-4 w-4"}),r.modeToggle_light]}),n.jsxs(Ft,{onClick:()=>t("dark"),children:[n.jsx(P.Moon,{className:"mr-2 h-4 w-4"}),r.modeToggle_dark]}),n.jsxs(Ft,{onClick:()=>t("system"),children:[n.jsx(P.Monitor,{className:"mr-2 h-4 w-4"}),r.modeToggle_system]})]})]})}const Rm=[{value:"light",icon:P.Sun,key:"modeToggle_light"},{value:"dark",icon:P.Moon,key:"modeToggle_dark"},{value:"system",icon:P.Monitor,key:"modeToggle_system"}];function _m({className:e}){const{theme:t,setTheme:r,themes:o}=gr(),s=ce();return n.jsx("div",{className:v("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",e),role:"radiogroup","aria-label":s.modeToggle_colorTheme,children:Rm.filter(a=>o.includes(a.value)).map(({value:a,icon:i,key:l})=>{const d=s[l];return n.jsxs("button",{role:"radio","aria-checked":t===a,"aria-label":d,onClick:()=>r(a),className:v("inline-flex items-center justify-center rounded-md px-2.5 py-1.5 text-sm font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t===a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/50"),children:[n.jsx(i,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:d})]},a)})})}const gi=f.forwardRef(({className:e,variant:t="received",children:r,...o},s)=>n.jsx("div",{ref:s,className:v("group flex gap-2 max-w-[85%]",t==="sent"?"ml-auto flex-row-reverse":"mr-auto",e),"data-variant":t,...o,children:r}));gi.displayName="ChatBubble";const pi=f.forwardRef(({className:e,src:t,fallback:r,...o},s)=>n.jsx("div",{ref:s,className:v("flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",e),...o,children:t?n.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):n.jsx("span",{children:r??"?"})}));pi.displayName="ChatBubbleAvatar";const Mm={sending:n.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("path",{d:"M12 6v6l4 2"})]}),sent:n.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:n.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 7 17l-5-5"}),n.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:n.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 7 17l-5-5"}),n.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:n.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("path",{d:"m15 9-6 6"}),n.jsx("path",{d:"m9 9 6 6"})]})},hi=f.forwardRef(({className:e,variant:t="received",isLoading:r,status:o,children:s,...a},i)=>n.jsx("div",{ref:i,className:v("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",t==="sent"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md",e),...a,children:r?n.jsxs("div",{className:"flex items-center gap-1 py-1",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):n.jsxs(n.Fragment,{children:[s,o&&n.jsx("div",{className:"flex justify-end mt-1",children:Mm[o]})]})}));hi.displayName="ChatBubbleMessage";const xi=f.forwardRef(({className:e,...t},r)=>n.jsx("span",{ref:r,className:v("text-[10px] text-muted-foreground mt-1 px-1",e),...t}));xi.displayName="ChatBubbleTimestamp";const vi=f.forwardRef(({visibility:e="hover",className:t,children:r,...o},s)=>n.jsx("div",{ref:s,className:v("flex items-center gap-0.5 mt-0.5",e==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",t),...o,children:r}));vi.displayName="ChatBubbleActions";const bi=f.forwardRef(({onSend:e,placeholder:t,disabled:r,isLoading:o,showAttach:s,onAttach:a,acceptFiles:i="*",onStop:l,value:d,onChange:c,headerSlot:p,footerSlot:u,maxLength:m,className:g},h)=>{const x=ce(),y=f.useRef(null),b=f.useRef(null),[w,j]=f.useState(""),M=d!==void 0,R=M?d:w,_=k=>{M?c==null||c(k):j(k)},C=()=>{const k=y.current;k&&(k.style.height="auto",k.style.height=Math.min(k.scrollHeight,160)+"px")},S=()=>{const k=R.trim();!k||r||o||(e==null||e(k),_(""),y.current&&(y.current.style.height="auto"))},T=k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),S())},L=()=>{var k;(k=b.current)==null||k.click()},V=k=>{k.target.files&&k.target.files.length>0&&(a==null||a(k.target.files)),k.target.value=""},O=R.length,$=m?O>m:!1;return n.jsxs("div",{ref:h,className:v("rounded-xl border border-border bg-background",g),children:[p&&n.jsx("div",{className:"px-3 pt-2 pb-1 border-b border-border/40",children:p}),n.jsxs("div",{className:"flex items-end gap-2 p-2",children:[s&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:L,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":x.chatInput_attachFile,disabled:r,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),n.jsx("input",{ref:b,type:"file",multiple:!0,accept:i,onChange:V,className:"hidden","aria-hidden":"true"})]}),n.jsx("textarea",{ref:y,value:R,onChange:k=>{_(k.target.value),C()},onKeyDown:T,placeholder:t??x.chatInput_placeholder,disabled:r||o,rows:1,className:"flex-1 resize-none bg-transparent text-sm outline-none placeholder:text-muted-foreground min-h-[36px] py-2 px-2 max-h-40"}),o&&l?n.jsx("button",{type:"button",onClick:l,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-destructive/10 text-destructive hover:bg-destructive/20 transition-colors","aria-label":x.chatInput_stopGenerating,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):n.jsx("button",{type:"button",onClick:S,disabled:r||o||!R.trim()||$,className:v("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",R.trim()&&!r&&!o&&!$?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),"aria-label":x.chatInput_sendMessage,children:o?n.jsx("svg",{className:"animate-spin",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"m5 12 7-7 7 7"}),n.jsx("path",{d:"M12 19V5"})]})})]}),(u||m)&&n.jsxs("div",{className:"px-3 pb-2 pt-0.5 flex items-center gap-2",children:[n.jsx("div",{className:"flex-1",children:u}),m&&n.jsxs("span",{className:v("text-[10px] tabular-nums shrink-0",$?"text-destructive font-medium":"text-muted-foreground"),children:[O,"/",m]})]})]})});bi.displayName="ChatInput";const wi=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("div",{ref:o,className:v("flex flex-col h-full",e),...r,children:t}));wi.displayName="ChatContainer";const yi=f.forwardRef(({className:e,children:t,autoScroll:r=!0,...o},s)=>{const a=f.useRef(null),i=f.Children.count(t);return f.useEffect(()=>{r&&a.current&&a.current.scrollIntoView({behavior:"smooth"})},[i,r]),n.jsx(fr,{className:"flex-1",orientation:"vertical",children:n.jsxs("div",{ref:s,className:v("flex flex-col gap-4 p-4",e),...o,children:[t,n.jsx("div",{ref:a})]})})});yi.displayName="ChatList";const ji=f.forwardRef(({className:e,variant:t="dots",text:r,...o},s)=>{const a=ce(),i=r??a.aiLoading_thinking;return t==="text"?n.jsxs("div",{ref:s,className:v("flex items-center gap-1.5 text-sm text-muted-foreground",e),...o,children:[n.jsx("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),n.jsxs("span",{className:"animate-pulse",children:[i,"…"]})]}):n.jsxs("div",{ref:s,className:v("flex items-center gap-1",e),...o,children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:0ms]"}),n.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:150ms]"}),n.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:300ms]"})]})});ji.displayName="AILoading";function ht(e){const t=[],r=/(`[^`]+`)|(\~\~[^~]+\~\~)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(!\[[^\]]*\]\([^)]+\))|(\[[^\]]+\]\([^)]+\))/g;let o=0,s;for(;(s=r.exec(e))!==null;){s.index>o&&t.push(e.slice(o,s.index));const a=s[0];if(a.startsWith("`"))t.push(n.jsx("code",{className:"px-1 py-0.5 rounded bg-muted text-sm font-mono",children:a.slice(1,-1)},s.index));else if(a.startsWith("~~"))t.push(n.jsx("del",{className:"text-muted-foreground",children:a.slice(2,-2)},s.index));else if(a.startsWith("**"))t.push(n.jsx("strong",{children:a.slice(2,-2)},s.index));else if(a.startsWith("*"))t.push(n.jsx("em",{children:a.slice(1,-1)},s.index));else if(a.startsWith("![")){const i=a.indexOf("]"),l=a.slice(2,i),d=a.slice(i+2,-1);t.push(n.jsx("img",{src:d,alt:l,className:"max-w-full rounded-lg my-2 inline-block",loading:"lazy"},s.index))}else if(a.startsWith("[")){const i=a.indexOf("]"),l=a.slice(1,i),d=a.slice(i+2,-1);t.push(n.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:l},s.index))}o=s.index+a.length}return o<e.length&&t.push(e.slice(o)),t}function Pm(e){const t=e.split(`
36
+ `),r=[];let o=0,s=0;for(;o<t.length;){const a=t[o];if(a.trimStart().startsWith("```")){const l=a.trimStart().slice(3).trim(),d=[];for(o++;o<t.length&&!t[o].trimStart().startsWith("```");)d.push(t[o]),o++;o++,r.push(n.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono my-3",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:n.jsx("code",{"data-language":l||void 0,children:d.join(`
37
+ `)})},s++));continue}const i=a.match(/^(#{1,6})\s+(.*)/);if(i){const l=i[1].length,d=i[2],c=`h${l}`,p={1:"text-2xl font-bold mt-6 mb-3",2:"text-xl font-semibold mt-5 mb-2",3:"text-lg font-semibold mt-4 mb-2",4:"text-base font-semibold mt-3 mb-1",5:"text-sm font-semibold mt-2 mb-1",6:"text-sm font-medium mt-2 mb-1"};r.push(n.jsx(c,{className:p[l],children:ht(d)},s++)),o++;continue}if(/^[\s]*[-*]\s/.test(a)){const l=[];for(;o<t.length&&/^[\s]*[-*]\s/.test(t[o]);)l.push(n.jsx("li",{children:ht(t[o].replace(/^[\s]*[-*]\s/,""))},s++)),o++;r.push(n.jsx("ul",{className:"list-disc pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(/^\s*\d+\.\s/.test(a)){const l=[];for(;o<t.length&&/^\s*\d+\.\s/.test(t[o]);)l.push(n.jsx("li",{children:ht(t[o].replace(/^\s*\d+\.\s/,""))},s++)),o++;r.push(n.jsx("ol",{className:"list-decimal pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(a.startsWith(">")){const l=[];for(;o<t.length&&t[o].startsWith(">");)l.push(t[o].replace(/^>\s?/,"")),o++;r.push(n.jsx("blockquote",{className:"border-l-4 border-primary/40 pl-4 italic text-muted-foreground my-3 text-sm",children:ht(l.join(" "))},s++));continue}if(a.includes("|")&&o+1<t.length&&/^\s*\|?[\s\-:|]+\|/.test(t[o+1])){const l=[];for(;o<t.length&&t[o].includes("|");)l.push(t[o]),o++;if(l.length>=2){const d=u=>u.split("|").map(m=>m.trim()).filter((m,g,h)=>g>0&&g<h.length),c=d(l[0]),p=l.slice(2).map(d);r.push(n.jsx("div",{className:"overflow-x-auto my-3",children:n.jsxs("table",{className:"w-full text-sm border-collapse",children:[n.jsx("thead",{children:n.jsx("tr",{className:"border-b border-border",children:c.map((u,m)=>n.jsx("th",{className:"px-3 py-2 text-left font-semibold text-foreground",children:ht(u)},m))})}),n.jsx("tbody",{children:p.map((u,m)=>n.jsx("tr",{className:"border-b border-border/50",children:u.map((g,h)=>n.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:ht(g)},h))},m))})]})},s++));continue}}if(/^[-*_]{3,}\s*$/.test(a)){r.push(n.jsx("hr",{className:"my-4 border-border"},s++)),o++;continue}if(a.trim()===""){o++;continue}r.push(n.jsx("p",{className:"text-sm leading-relaxed my-2",children:ht(a)},s++)),o++}return r}const Ni=f.forwardRef(({content:e,streaming:t,className:r,...o},s)=>{const a=t?e:e.trim(),i=f.useMemo(()=>{try{return Pm(a)}catch{return[f.createElement("p",{className:"text-sm"},a)]}},[a]);return n.jsx("div",{ref:s,className:v("markdown-renderer",r),...o,children:i})});Ni.displayName="MarkdownRenderer";const ki=f.forwardRef(({suggestions:e,onSelect:t,columns:r=2,className:o,...s},a)=>{const i={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"};return n.jsx("div",{ref:a,className:v("grid gap-3",i[r],o),...s,children:e.map((l,d)=>n.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(l.prompt),className:v("flex flex-col items-start gap-1 rounded-xl border border-border p-4","bg-card text-left transition-colors hover:bg-muted/60 hover:border-primary/30","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:l.title}),l.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description})]},d))})});ki.displayName="PromptSuggestions";const Ci=f.forwardRef(({models:e,value:t,onChange:r,placeholder:o,compact:s,className:a,...i},l)=>{const d=ce(),[c,p]=f.useState(!1),[u,m]=f.useState(""),g=f.useRef(null),h=f.useRef(null),x=e.find(w=>w.id===t),y=f.useMemo(()=>{if(!u)return e;const w=u.toLowerCase();return e.filter(j=>{var M;return j.name.toLowerCase().includes(w)||((M=j.provider)==null?void 0:M.toLowerCase().includes(w))||j.id.toLowerCase().includes(w)})},[e,u]);f.useEffect(()=>{c&&(m(""),setTimeout(()=>{var w;return(w=h.current)==null?void 0:w.focus()},0))},[c]),f.useEffect(()=>{if(!c)return;const w=j=>{g.current&&!g.current.contains(j.target)&&p(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);const b=w=>{w.key==="Escape"&&p(!1)};return n.jsxs("div",{ref:g,className:v("relative",a),...i,children:[n.jsxs("button",{ref:l,type:"button",onClick:()=>p(w=>!w),className:v("flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!x&&"text-muted-foreground"),children:[x?n.jsxs(n.Fragment,{children:[x.icon&&n.jsx("span",{className:"text-base shrink-0",children:x.icon}),n.jsx("span",{className:"font-medium truncate",children:x.name}),!s&&x.provider&&n.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",x.provider,")"]})]}):n.jsx("span",{children:o??d.modelSelector_placeholder}),n.jsx("svg",{className:v("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform",c&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m6 9 6 6 6-6"})})]}),c&&n.jsxs("div",{className:"absolute z-50 mt-1 w-full min-w-[260px] rounded-xl border border-border bg-popover shadow-lg animate-in fade-in-0 zoom-in-95",onKeyDown:b,children:[n.jsx("div",{className:"p-2 border-b border-border",children:n.jsx("input",{ref:h,value:u,onChange:w=>m(w.target.value),placeholder:d.modelSelector_searchPlaceholder,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground px-2 py-1"})}),n.jsxs("div",{className:"max-h-[280px] overflow-auto p-1",children:[y.length===0&&n.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:d.modelSelector_noResults}),y.map(w=>n.jsxs("button",{type:"button",disabled:w.disabled,onClick:()=>{r==null||r(w.id),p(!1)},className:v("flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left text-sm transition-colors","hover:bg-muted focus-visible:outline-none focus-visible:bg-muted",w.id===t&&"bg-primary/10",w.disabled&&"opacity-50 cursor-not-allowed"),children:[w.icon&&n.jsx("span",{className:"text-lg shrink-0 mt-0.5",children:w.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"font-medium truncate",children:w.name}),w.id===t&&n.jsx("svg",{className:"h-4 w-4 text-primary shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})})]}),w.provider&&n.jsx("span",{className:"text-xs text-muted-foreground",children:w.provider}),w.description&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:w.description}),w.badges&&w.badges.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:w.badges.map(j=>n.jsx("span",{className:"inline-flex items-center rounded-full border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:j},j))})]})]},w.id))]})]})]})});Ci.displayName="ModelSelector";const Si=f.forwardRef(({modes:e,value:t,onChange:r,size:o="default",className:s,...a},i)=>n.jsx("div",{ref:i,className:v("inline-flex items-center gap-1 rounded-lg bg-muted/50 p-1",s),role:"radiogroup",...a,children:e.map(l=>{const d=l.id===t;return n.jsxs("button",{type:"button",role:"radio","aria-checked":d,onClick:()=>r==null?void 0:r(l.id),title:l.description,className:v("rounded-md transition-all text-sm font-medium whitespace-nowrap","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",o==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5",d?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.icon&&n.jsx("span",{className:"mr-1",children:l.icon}),l.label]},l.id)})}));Si.displayName="ChatModeSelector";const Ri=f.forwardRef(({question:e,options:t,onSelect:r,selected:o,allowFreeText:s,onFreeTextSubmit:a,columns:i=1,className:l,...d},c)=>{const p=ce(),[u,m]=f.useState(""),g=!!o,h=()=>{const x=u.trim();x&&(a==null||a(x),m(""))};return n.jsxs("div",{ref:c,className:v("rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3 max-w-[85%]",l),...d,children:[n.jsx("p",{className:"text-sm leading-relaxed mb-3",children:e}),n.jsx("div",{className:v("grid gap-2",i===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:t.map(x=>{const y=x.id===o;return n.jsxs("button",{type:"button",disabled:g,onClick:()=>r==null?void 0:r(x.id,x.label),className:v("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-primary/10 text-primary font-medium":g?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[y&&n.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}),!y&&n.jsx("span",{className:v("h-4 w-4 shrink-0 rounded-full border-2",g?"border-border/50":"border-border")}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:"block truncate",children:x.label}),x.description&&n.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-1",children:x.description})]})]},x.id)})}),s&&!g&&n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("input",{type:"text",value:u,onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Enter"&&h()},placeholder:p.followUp_freeTextPlaceholder,className:"flex-1 bg-background rounded-lg border border-border px-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:border-primary/40"}),n.jsx("button",{type:"button",onClick:h,disabled:!u.trim(),className:v("rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",u.trim()?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:p.followUp_send})]})]})});Ri.displayName="ChatFollowUp";const _i=f.forwardRef(({id:e,question:t,options:r,onSelect:o,selectedId:s,disabled:a=!1,allowFreeText:i=!1,onFreeTextSubmit:l,columns:d=1,freeTextValue:c,className:p,...u},m)=>{const[g,h]=f.useState(""),[x,y]=f.useState(null),[b,w]=f.useState(null),j=Array.isArray(r)?r:[],M=t??"",R=s??x,_=c??b,C=a||R!=null&&R!==""||_!=null&&_!=="",S=f.useCallback((L,V)=>{C||(y(L),o==null||o(L,V))},[C,o]),T=f.useCallback(()=>{const L=(g??"").trim();!L||C||(w(L),l==null||l(L),h(""))},[g,C,l]);return n.jsxs("div",{ref:m,"data-question-id":e,className:v("rounded-xl border border-border/60 overflow-hidden","bg-card shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",p),...u,children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border/40 bg-muted/30",children:[n.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-lg bg-primary/15 text-primary",children:n.jsx(P.HelpCircle,{className:"w-4 h-4"})}),n.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:M})]}),n.jsxs("div",{className:"p-3 space-y-3",children:[j.length>0&&n.jsx("div",{className:v("grid gap-2",d===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:j.map((L,V)=>{if(!L)return null;const O=L.id||`opt-${V}`,$=L.label||O,k=R===L.id;return n.jsxs("button",{type:"button",disabled:C,onClick:()=>S(L.id,$),className:v("group relative flex items-center gap-3 w-full p-3 rounded-lg border text-left","transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",k?"border-primary bg-primary/8 ring-1 ring-primary/20":C?"border-border/40 text-muted-foreground/60 cursor-not-allowed":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/50 cursor-pointer active:scale-[0.98]"),children:[n.jsx("div",{className:v("flex-shrink-0 flex items-center justify-center w-5 h-5 rounded-full border-2 transition-all duration-200",k?"border-primary bg-primary scale-110":C?"border-muted-foreground/30":"border-muted-foreground/40 group-hover:border-primary/60"),children:k&&n.jsx(P.Check,{className:"w-3 h-3 text-primary-foreground animate-in zoom-in-50 duration-200"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:v("block text-sm font-medium leading-tight",k?"text-primary":"text-foreground"),children:$}),L.description&&n.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-2",children:L.description})]})]},O)})}),_&&n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-primary/8 border border-primary/20",children:[n.jsx(P.Check,{className:"w-4 h-4 text-primary flex-shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-primary truncate",children:_})]}),i&&!C&&n.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/30",children:[n.jsx("input",{type:"text",value:g,onChange:L=>h(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),T())},placeholder:"Или напишите свой ответ...",className:v("flex-1 rounded-lg border border-border/60 bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground/60","outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/20","transition-colors")}),n.jsx("button",{type:"button",onClick:T,disabled:!(g??"").trim(),className:v("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg transition-all duration-150",(g??"").trim()?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer active:scale-95":"bg-muted text-muted-foreground/50 cursor-not-allowed"),children:n.jsx(P.Send,{className:"w-4 h-4"})})]})]})]})});_i.displayName="ChatQuestion";const Zn={success:{Icon:P.CheckCircle2,border:"border-emerald-500/30",bg:"bg-emerald-500/5",iconBox:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",title:"text-emerald-900 dark:text-emerald-100",btn:"bg-emerald-600 hover:bg-emerald-700 text-white"},info:{Icon:P.Info,border:"border-blue-500/30",bg:"bg-blue-500/5",iconBox:"bg-blue-500/15 text-blue-600 dark:text-blue-400",title:"text-blue-900 dark:text-blue-100",btn:"bg-blue-600 hover:bg-blue-700 text-white"},warning:{Icon:P.AlertTriangle,border:"border-amber-500/30",bg:"bg-amber-500/5",iconBox:"bg-amber-500/15 text-amber-600 dark:text-amber-400",title:"text-amber-900 dark:text-amber-100",btn:"bg-amber-600 hover:bg-amber-700 text-white"},result:{Icon:P.Sparkles,border:"border-violet-500/30",bg:"bg-gradient-to-br from-violet-500/8 to-emerald-500/5",iconBox:"bg-violet-500/15 text-violet-600 dark:text-violet-400",title:"text-violet-900 dark:text-violet-100",btn:"bg-violet-600 hover:bg-violet-700 text-white"}},Mi=f.forwardRef(({type:e="info",title:t,description:r,icon:o,action:s,dismissible:a=!1,onDismiss:i,className:l,...d},c)=>{const[p,u]=f.useState(!1),[m,g]=f.useState(!1),h=Zn[e]??Zn.info,x=o??h.Icon,y=f.useCallback(()=>{u(!0),i==null||i()},[i]),b=f.useCallback(()=>{m||!(s!=null&&s.onClick)||(g(!0),s.onClick(),setTimeout(()=>g(!1),1e3))},[s,m]);return p?null:n.jsx("div",{ref:c,className:v("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",h.border,h.bg,l),...d,children:n.jsxs("div",{className:"flex items-start gap-3 p-4",children:[n.jsx("div",{className:v("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",h.iconBox),children:n.jsx(x,{className:"w-5 h-5"})}),n.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[t&&n.jsx("h4",{className:v("text-sm font-semibold leading-tight",h.title),children:t}),r&&n.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:r})]}),s&&s.label&&n.jsxs("button",{type:"button",disabled:m,onClick:b,className:v("flex-shrink-0 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95",m?"opacity-60 cursor-wait":"cursor-pointer",h.btn),children:[s.label,n.jsx(P.ArrowRight,{className:"w-3.5 h-3.5"})]}),a&&n.jsx("button",{type:"button",onClick:y,className:"flex-shrink-0 p-1 rounded-md hover:bg-foreground/10 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Dismiss",children:n.jsx(P.X,{className:"w-4 h-4"})})]})})});Mi.displayName="ChatActionCard";const Jn={task:{Icon:P.CheckSquare,color:"text-blue-600 dark:text-blue-400 bg-blue-500/12"},project:{Icon:P.FolderKanban,color:"text-purple-600 dark:text-purple-400 bg-purple-500/12"},file:{Icon:P.FileText,color:"text-orange-600 dark:text-orange-400 bg-orange-500/12"},custom:{Icon:P.FileText,color:"text-primary bg-primary/12"}},Pi=f.forwardRef(({type:e="task",title:t,id:r,status:o,properties:s,icon:a,onNavigate:i,className:l,...d},c)=>{const p=Jn[e]??Jn.custom,u=a??p.Icon,m=typeof i=="function",g=s&&typeof s=="object"?s:null,h=f.useCallback(()=>{i==null||i()},[i]),x=f.useCallback(y=>{m&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),i==null||i())},[m,i]);return n.jsxs("div",{ref:c,role:m?"button":void 0,tabIndex:m?0:void 0,onClick:m?h:void 0,onKeyDown:m?x:void 0,className:v("rounded-xl border border-border/60 bg-card overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",m&&"cursor-pointer hover:border-primary/40 hover:shadow-md transition-all active:scale-[0.99]",l),...d,children:[n.jsxs("div",{className:"flex items-start gap-3 p-4",children:[n.jsx("div",{className:v("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",p.color),children:n.jsx(u,{className:"w-5 h-5"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-sm font-semibold text-foreground truncate",children:t??"Untitled"}),r&&n.jsx("span",{className:"inline-flex px-1.5 py-0.5 rounded bg-muted text-[11px] font-mono text-muted-foreground leading-none",children:r})]}),o&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o})]}),m&&n.jsx(P.ExternalLink,{className:"flex-shrink-0 w-4 h-4 text-muted-foreground/50 mt-0.5"})]}),g&&Object.keys(g).length>0&&n.jsx("div",{className:"px-4 pb-4",children:n.jsx("div",{className:"rounded-lg bg-muted/40 divide-y divide-border/30",children:Object.entries(g).map(([y,b])=>n.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[n.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:y}),n.jsx("span",{className:"text-foreground text-right break-words",children:String(b??"")})]},y))})})]})});Pi.displayName="ChatEntityPreview";const Ii=f.forwardRef(({title:e,description:t,icon:r,linkLabel:o,onNavigate:s,metadata:a,variant:i="success",className:l,...d},c)=>{const p=r??(i==="highlight"?P.Sparkles:P.CheckCircle2),u=a&&typeof a=="object"?a:null,m=typeof s=="function",g=i==="success";return n.jsx("div",{ref:c,className:v("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-3 duration-300",g?"border-emerald-500/30 bg-gradient-to-br from-emerald-500/8 via-emerald-500/4 to-transparent":"border-violet-500/30 bg-gradient-to-br from-violet-500/8 via-violet-500/4 to-transparent",l),...d,children:n.jsxs("div",{className:"p-4 space-y-3",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:v("flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-xl",g?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-violet-500/15 text-violet-600 dark:text-violet-400"),children:n.jsx(p,{className:"w-5 h-5"})}),n.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[e&&n.jsx("h4",{className:v("text-sm font-semibold leading-tight",g?"text-emerald-900 dark:text-emerald-100":"text-violet-900 dark:text-violet-100"),children:e}),t&&n.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:t})]}),m&&n.jsxs("button",{type:"button",onClick:s,className:v("flex-shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95 cursor-pointer",g?"bg-emerald-600 hover:bg-emerald-700 text-white":"bg-violet-600 hover:bg-violet-700 text-white"),children:[o??"Перейти",n.jsx(P.ArrowRight,{className:"w-4 h-4"})]})]}),u&&Object.keys(u).length>0&&n.jsx("div",{className:"rounded-lg bg-background/60 border border-border/30 divide-y divide-border/20",children:Object.entries(u).map(([h,x])=>n.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[n.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:h}),n.jsx("span",{className:"text-foreground text-right break-words",children:String(x??"")})]},h))})]})})});Ii.displayName="ChatResultCard";const Im={copy:{path:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2 M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"},retry:{path:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8 M3 3v5h5"},edit:{path:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"},like:{path:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"},dislike:{path:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"},share:{path:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8 M16 6l-4-4-4 4 M12 2v13"}},Li=f.forwardRef(({actions:e=["copy"],content:t,likeState:r,onCopy:o,onRetry:s,onEdit:a,onLike:i,onDislike:l,onShare:d,visibility:c="hover",className:p,...u},m)=>{const g=ce(),[h,x]=f.useState(!1),y={copy:g.messageActions_copy,retry:g.messageActions_retry,edit:g.messageActions_edit,like:g.messageActions_like,dislike:g.messageActions_dislike,share:g.messageActions_share},w={copy:async()=>{if(t)try{await navigator.clipboard.writeText(t),x(!0),setTimeout(()=>x(!1),2e3)}catch{}o==null||o()},retry:s,edit:a,like:i,dislike:l,share:d};return n.jsx("div",{ref:m,className:v("flex items-center gap-0.5",c==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",p),...u,children:e.map(j=>{const M=j==="copy"&&h,C=j==="like"&&r==="liked"||j==="dislike"&&r==="disliked";return n.jsx("button",{type:"button",onClick:w[j],"aria-label":y[j],title:M?g.messageActions_copied:y[j],className:v("inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors","text-muted-foreground hover:text-foreground hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",C&&"text-primary",M&&"text-green-500"),children:M?n.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}):n.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:C?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:Im[j].path})})},j)})})});Li.displayName="MessageActions";const Ti=f.forwardRef(({text:e,speed:t=2,onComplete:r,cursor:o=!0,immediate:s=!1,className:a,...i},l)=>{const[d,c]=f.useState(s?e:""),[p,u]=f.useState(s),m=f.useRef(e),g=f.useRef(),h=f.useRef(s?e.length:0);return f.useEffect(()=>{if(e!==m.current){if(m.current=e,s){c(e),u(!0),h.current=e.length;return}e.startsWith(d)||(h.current=0,c("")),u(!1)}},[e,s,d]),f.useEffect(()=>{if(s||p)return;const x=()=>{const y=Math.min(h.current+t,e.length);h.current=y,c(e.slice(0,y)),y>=e.length?(u(!0),r==null||r()):g.current=requestAnimationFrame(x)};return g.current=requestAnimationFrame(x),()=>{g.current&&cancelAnimationFrame(g.current)}},[e,t,s,p,r]),n.jsxs("span",{ref:l,className:v("whitespace-pre-wrap",a),...i,children:[d,o&&!p&&n.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-foreground ml-px align-text-bottom animate-pulse"})]})});Ti.displayName="StreamingText";const Ei=f.forwardRef(({content:e,isThinking:t,duration:r,defaultOpen:o=!1,title:s,className:a,...i},l)=>{const d=ce(),[c,p]=f.useState(o||t===!0),[u,m]=f.useState(r??0),g=f.useRef(Date.now());f.useEffect(()=>{t&&p(!0)},[t]),f.useEffect(()=>{if(!t)return;g.current=Date.now();const y=setInterval(()=>{m(Math.floor((Date.now()-g.current)/1e3))},1e3);return()=>clearInterval(y)},[t]);const h=t?u:r??u,x=y=>y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`;return n.jsxs("div",{ref:l,className:v("rounded-xl border border-border/60 overflow-hidden my-2",t&&"border-primary/30",a),...i,children:[n.jsxs("button",{type:"button",onClick:()=>p(y=>!y),className:v("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"bg-primary/5"),children:[n.jsxs("svg",{className:v("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),n.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),n.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),n.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),n.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),n.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),n.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),n.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),n.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]}),n.jsx("span",{className:v("font-medium",t&&"text-primary animate-pulse"),children:t?d.reasoning_thinking:s??d.reasoning_title}),h>0&&n.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${x(h)}...`:ze(d.reasoning_thoughtFor,{duration:x(h)})}),n.jsx("svg",{className:v("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",c&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m6 9 6 6 6-6"})})]}),c&&n.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:n.jsx("div",{className:"border-l-2 border-primary/20 pl-3",children:n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap",children:[e,t&&n.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-muted-foreground ml-px align-text-bottom animate-pulse"})]})})})]})});Ei.displayName="ReasoningBlock";const Di=f.forwardRef(({name:e,args:t,result:r,status:o,error:s,defaultOpen:a=!1,className:i,...l},d)=>{const c=ce(),[p,u]=f.useState(a),m={running:n.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),success:n.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}),error:n.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]})},g={running:ze(c.toolCall_calling,{name:e}),success:e,error:ze(c.toolCall_failed,{name:e})};return n.jsxs("div",{ref:d,className:v("rounded-xl border overflow-hidden my-1",o==="error"?"border-destructive/30":"border-border/60",i),...l,children:[n.jsxs("button",{type:"button",onClick:()=>u(h=>!h),className:v("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[n.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),m[o],n.jsx("span",{className:v("font-medium font-mono text-xs",o==="running"&&"text-primary",o==="error"&&"text-destructive"),children:g[o]}),n.jsx("svg",{className:v("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",p&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m6 9 6 6 6-6"})})]}),p&&n.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&n.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:c.toolCall_arguments}),n.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&n.jsxs("div",{className:v("px-3 py-2",t&&"border-t border-border/30"),children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:c.toolCall_result}),n.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:r})]}),s&&n.jsxs("div",{className:v("px-3 py-2 bg-destructive/5",t&&"border-t border-border/30"),children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:c.toolCall_error}),n.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})});Di.displayName="ChatToolCall";function Lm(e,t){const r=new Date,o=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(o.getTime()-864e5),a=new Date(o.getTime()-7*864e5),i=[{label:t[0],items:[]},{label:t[1],items:[]},{label:t[2],items:[]},{label:t[3],items:[]}],l=[...e].sort((d,c)=>c.updatedAt.getTime()-d.updatedAt.getTime());for(const d of l){const c=d.updatedAt;c>=o?i[0].items.push(d):c>=s?i[1].items.push(d):c>=a?i[2].items.push(d):i[3].items.push(d)}return i.filter(d=>d.items.length>0)}const Ai=f.forwardRef(({conversations:e,activeId:t,onSelect:r,onNew:o,onDelete:s,onRename:a,showSearch:i=!0,className:l,...d},c)=>{const p=ce(),[u,m]=f.useState(""),[g,h]=f.useState(null),[x,y]=f.useState(""),b=f.useRef(null),w=f.useMemo(()=>{if(!u)return e;const C=u.toLowerCase();return e.filter(S=>{var T;return S.title.toLowerCase().includes(C)||((T=S.lastMessage)==null?void 0:T.toLowerCase().includes(C))})},[e,u]),j=[p.conversationList_today,p.conversationList_yesterday,p.conversationList_previous7Days,p.conversationList_older],M=f.useMemo(()=>Lm(w,j),[w,j]),R=C=>{h(C.id),y(C.title),setTimeout(()=>{var S;return(S=b.current)==null?void 0:S.focus()},0)},_=()=>{g&&x.trim()&&(a==null||a(g,x.trim())),h(null)};return n.jsxs("div",{ref:c,className:v("flex flex-col h-full",l),...d,children:[o&&n.jsx("div",{className:"p-3 border-b border-border shrink-0",children:n.jsxs("button",{type:"button",onClick:o,className:v("flex items-center justify-center gap-2 w-full rounded-lg border border-border px-3 py-2 text-sm font-medium","transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[n.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M5 12h14"}),n.jsx("path",{d:"M12 5v14"})]}),p.conversationList_newChat]})}),i&&n.jsx("div",{className:"px-3 pt-3 pb-2 shrink-0",children:n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("path",{d:"m21 21-4.3-4.3"})]}),n.jsx("input",{value:u,onChange:C=>m(C.target.value),placeholder:p.conversationList_searchPlaceholder,className:"w-full bg-muted/50 rounded-lg pl-8 pr-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:bg-muted"})]})}),n.jsxs("div",{className:"flex-1 overflow-auto px-2 py-1",children:[M.length===0&&n.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u?p.conversationList_noResults:p.conversationList_empty}),M.map(C=>n.jsxs("div",{className:"mb-3",children:[n.jsx("div",{className:"px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:C.label}),C.items.map(S=>{const T=S.id===t,L=S.id===g;return n.jsxs("div",{className:v("group flex items-center gap-2 rounded-lg px-2 py-2 cursor-pointer transition-colors",T?"bg-primary/10":"hover:bg-muted"),onClick:()=>!L&&(r==null?void 0:r(S.id)),children:[n.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"})}),n.jsx("div",{className:"flex-1 min-w-0",children:L?n.jsx("input",{ref:b,value:x,onChange:V=>y(V.target.value),onBlur:_,onKeyDown:V=>{V.key==="Enter"&&_(),V.key==="Escape"&&h(null)},className:"w-full bg-background border border-border rounded px-1 py-0.5 text-sm outline-none",onClick:V=>V.stopPropagation()}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-sm truncate font-medium",children:S.title}),S.lastMessage&&n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:S.lastMessage})]})}),!L&&n.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[a&&n.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),R(S)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":p.conversationList_rename,children:n.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),s&&n.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),s(S.id)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":p.conversationList_delete,children:n.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 6h18"}),n.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),n.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]})]},S.id)})]},C.label))]})]})});Ai.displayName="ConversationList";const Tm={online:"bg-green-500",offline:"bg-muted-foreground/40",typing:"bg-primary animate-pulse"},Fi=f.forwardRef(({title:e,model:t,modelIcon:r,status:o,onClear:s,onSettings:a,onBack:i,children:l,className:d,...c},p)=>{const u=ce(),m={online:u.chatHeader_online,offline:u.chatHeader_offline,typing:u.chatHeader_typing};return n.jsxs("div",{ref:p,className:v("flex items-center gap-3 px-4 h-14 border-b border-border shrink-0 bg-background",d),...c,children:[i&&n.jsx("button",{type:"button",onClick:i,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors -ml-1 shrink-0","aria-label":u.chatHeader_back,children:n.jsx("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m15 18-6-6 6-6"})})}),r&&n.jsx("span",{className:"text-xl shrink-0",children:r}),n.jsxs("div",{className:"flex-1 min-w-0",children:[e&&n.jsx("div",{className:"text-sm font-semibold truncate",children:e}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t}),o&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:v("h-1.5 w-1.5 rounded-full shrink-0",Tm[o])}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[o]})]})]})]}),l,n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s&&n.jsx("button",{type:"button",onClick:s,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_clearConversation,title:u.chatHeader_clearConversation,children:n.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 6h18"}),n.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),n.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})}),a&&n.jsx("button",{type:"button",onClick:a,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_settings,title:u.chatHeader_settings,children:n.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]})});Fi.displayName="ChatHeader";const In=f.forwardRef(({citation:e,className:t,...r},o)=>{const[s,a]=f.useState(!1);return n.jsxs("span",{className:"relative inline-block",children:[n.jsx("button",{ref:o,type:"button",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>window.open(e.url,"_blank","noopener"),className:v("inline-flex items-center justify-center h-4 min-w-[16px] px-1 rounded text-[10px] font-medium","bg-primary/15 text-primary hover:bg-primary/25 transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","align-super",t),"aria-label":`Source ${e.index}: ${e.title}`,...r,children:e.index}),s&&n.jsxs("div",{className:"absolute z-50 bottom-full left-1/2 -translate-x-1/2 mb-2 w-64 rounded-lg border border-border bg-popover shadow-lg p-3 text-left animate-in fade-in-0 zoom-in-95",children:[n.jsxs("div",{className:"flex items-start gap-2",children:[e.favicon&&n.jsx("img",{src:e.favicon,alt:"",className:"h-4 w-4 mt-0.5 shrink-0 rounded"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),n.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:e.url}),e.snippet&&n.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.snippet})]})]}),n.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-border"})]})]})});In.displayName="CitationBadge";const Vi=f.forwardRef(({citations:e,variant:t="footer",className:r,...o},s)=>{const a=ce();return t==="inline"?n.jsx("span",{ref:s,className:v("inline",r),...o,children:e.map(i=>n.jsx(In,{citation:i},i.index))}):n.jsxs("div",{ref:s,className:v("border-t border-border/50 pt-3 mt-3 space-y-2",r),...o,children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2",children:a.sourceCitation_sources}),e.map(i=>n.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:v("flex items-start gap-2.5 rounded-lg border border-border/60 p-2.5 transition-colors","hover:bg-muted/50 hover:border-primary/30"),children:[n.jsx("span",{className:"flex items-center justify-center h-5 w-5 rounded bg-primary/15 text-primary text-[10px] font-semibold shrink-0 mt-0.5",children:i.index}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[i.favicon&&n.jsx("img",{src:i.favicon,alt:"",className:"h-3.5 w-3.5 rounded shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground truncate block",children:i.url}),i.snippet&&n.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.snippet})]})]},i.index))]})});Vi.displayName="SourceCitation";function Qn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function eo(e){return e.startsWith("image/")}function to(e){return e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎬":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("zip")||e.includes("rar")||e.includes("tar")?"📦":e.includes("json")||e.includes("xml")||e.includes("csv")?"📊":e.includes("text")||e.includes("javascript")||e.includes("typescript")?"📝":"📎"}const zi=f.forwardRef(({files:e,onRemove:t,variant:r="compact",className:o,...s},a)=>{const i=ce();return e.length===0?null:r==="grid"?n.jsx("div",{ref:a,className:v("grid grid-cols-2 gap-2",o),...s,children:e.map((l,d)=>n.jsxs("div",{className:"group relative rounded-xl border border-border overflow-hidden bg-muted/30",children:[eo(l.type)&&(l.thumbnail||l.url)?n.jsx("div",{className:"aspect-square",children:n.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-full w-full object-cover"})}):n.jsx("div",{className:"aspect-square flex items-center justify-center text-3xl bg-muted/50",children:to(l.type)}),n.jsxs("div",{className:"px-2 py-1.5 border-t border-border/40",children:[n.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),n.jsx("div",{className:"text-[10px] text-muted-foreground",children:Qn(l.size)})]}),t&&n.jsx("button",{type:"button",onClick:()=>t(d),className:"absolute top-1.5 right-1.5 h-5 w-5 rounded-full bg-background/80 backdrop-blur flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors opacity-0 group-hover:opacity-100","aria-label":ze(i.filePreview_remove,{name:l.name}),children:n.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??d))}):n.jsx("div",{ref:a,className:v("flex gap-2 overflow-x-auto pb-1",o),...s,children:e.map((l,d)=>n.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-2.5 py-1.5 shrink-0 max-w-[200px]",children:[eo(l.type)&&(l.thumbnail||l.url)?n.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-8 w-8 rounded object-cover shrink-0"}):n.jsx("span",{className:"text-lg shrink-0",children:to(l.type)}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),n.jsx("div",{className:"text-[10px] text-muted-foreground",children:Qn(l.size)})]}),t&&n.jsx("button",{type:"button",onClick:()=>t(d),className:"h-5 w-5 rounded-full flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors shrink-0 opacity-0 group-hover:opacity-100","aria-label":ze(i.filePreview_remove,{name:l.name}),children:n.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??d))})});zi.displayName="FilePreview";const Em={sending:n.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("path",{d:"M12 6v6l4 2"})]}),sent:n.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:n.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 7 17l-5-5"}),n.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:n.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 7 17l-5-5"}),n.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:n.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("path",{d:"m15 9-6 6"}),n.jsx("path",{d:"m9 9 6 6"})]})},$i=f.forwardRef(({variant:e="received",avatar:t,avatarFallback:r,content:o,timestamp:s,isLoading:a,status:i,actions:l,textContent:d,likeState:c,onCopy:p,onRetry:u,onEdit:m,onLike:g,onDislike:h,onShare:x,followUp:y,onFollowUpSelect:b,onFollowUpFreeText:w,reasoning:j,toolCalls:M,citations:R,className:_,...C},S)=>{const T=ce(),L=e==="sent",[V,O]=f.useState(!1),$=async()=>{if(d)try{await navigator.clipboard.writeText(d),O(!0),setTimeout(()=>O(!1),2e3)}catch{}p==null||p()};return n.jsxs("div",{ref:S,className:v("group flex gap-2 max-w-[85%]",L?"ml-auto flex-row-reverse":"mr-auto",_),...C,children:[(t||r)&&n.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",children:t?n.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):n.jsx("span",{children:r??"?"})}),n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[j&&n.jsx("div",{className:v("rounded-xl border border-border/60 overflow-hidden",j.isThinking&&"border-primary/30"),children:n.jsx(Dm,{...j})}),M==null?void 0:M.map((k,z)=>n.jsx(Am,{...k},z)),n.jsxs("div",{className:v("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",L?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"),children:[a?n.jsxs("div",{className:"flex items-center gap-1 py-1",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):o,R&&R.length>0&&n.jsxs("div",{className:"border-t border-border/30 pt-2 mt-2 space-y-1.5",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:T.sourceCitation_sources}),R.map(k=>n.jsxs("a",{href:k.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[n.jsx("span",{className:"h-4 min-w-[16px] px-0.5 rounded bg-primary/15 text-primary text-[10px] font-semibold flex items-center justify-center",children:k.index}),n.jsx("span",{className:"truncate",children:k.title})]},k.index))]})]}),y&&n.jsxs("div",{className:"rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3",children:[n.jsx("p",{className:"text-sm leading-relaxed mb-2.5",children:y.question}),n.jsx("div",{className:"grid gap-1.5",children:y.options.map(k=>{const z=k.id===y.selected,A=!!y.selected;return n.jsxs("button",{type:"button",disabled:A,onClick:()=>b==null?void 0:b(k.id,k.label),className:v("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all",z?"border-primary bg-primary/10 text-primary font-medium":A?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[z?n.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}):n.jsx("span",{className:v("h-4 w-4 shrink-0 rounded-full border-2",A?"border-border/50":"border-border")}),n.jsx("span",{className:"truncate",children:k.label})]},k.id)})})]}),(s||i)&&n.jsxs("div",{className:v("flex items-center gap-1 px-1",L&&"flex-row-reverse"),children:[s&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),i&&Em[i]]}),l&&l.length>0&&!a&&n.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:l.map(k=>{const z=k==="copy"&&V,A={copy:$,retry:u,edit:m,like:g,dislike:h,share:x},E=k==="like"&&c==="liked"||k==="dislike"&&c==="disliked",N={copy:T.messageActions_copy,retry:T.messageActions_retry,edit:T.messageActions_edit,like:T.messageActions_like,dislike:T.messageActions_dislike,share:T.messageActions_share};return n.jsx("button",{type:"button",onClick:A[k],title:z?T.messageActions_copied:N[k],className:v("h-7 w-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",E&&"text-primary",z&&"text-green-500"),children:z?n.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}):k==="copy"?n.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),n.jsx("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"})]}):k==="retry"?n.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),n.jsx("path",{d:"M3 3v5h5"})]}):k==="like"?n.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:E?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})}):k==="dislike"?n.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:E?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})}):k==="edit"?n.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})}):n.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),n.jsx("path",{d:"M16 6l-4-4-4 4"}),n.jsx("path",{d:"M12 2v13"})]})},k)})})]})]})});$i.displayName="ChatMessage";function Dm({content:e,isThinking:t,duration:r}){const o=ce(),[s,a]=f.useState(t===!0),[i,l]=f.useState(r??0);f.useEffect(()=>{t&&a(!0)},[t]),f.useEffect(()=>{if(!t)return;const c=Date.now(),p=setInterval(()=>l(Math.floor((Date.now()-c)/1e3)),1e3);return()=>clearInterval(p)},[t]);const d=t?i:r??i;return n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>a(c=>!c),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[n.jsxs("svg",{className:v("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),n.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"})]}),n.jsx("span",{className:v("font-medium",t&&"text-primary animate-pulse"),children:t?o.reasoning_thinking:o.reasoning_title}),d>0&&n.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${d}s...`:ze(o.reasoning_thoughtFor,{duration:`${d}s`})}),n.jsx("svg",{className:v("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",s&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m6 9 6 6 6-6"})})]}),s&&n.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap border-l-2 border-primary/20 pl-3",children:e})})]})}function Am({name:e,args:t,result:r,status:o,error:s}){const a=ce(),[i,l]=f.useState(!1);return n.jsxs("div",{className:v("rounded-xl border overflow-hidden",o==="error"?"border-destructive/30":"border-border/60"),children:[n.jsxs("button",{type:"button",onClick:()=>l(d=>!d),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[n.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),o==="running"?n.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):o==="success"?n.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M20 6 9 17l-5-5"})}):n.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]}),n.jsx("span",{className:"font-medium font-mono text-xs",children:o==="running"?ze(a.toolCall_calling,{name:e}):e}),n.jsx("svg",{className:v("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",i&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m6 9 6 6 6-6"})})]}),i&&n.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&n.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_arguments}),n.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&n.jsxs("div",{className:"px-3 py-2 border-t border-border/30",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_result}),n.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:r})]}),s&&n.jsxs("div",{className:"px-3 py-2 bg-destructive/5 border-t border-border/30",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:a.toolCall_error}),n.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})}exports.AILoading=ji;exports.Accordion=jc;exports.AccordionContent=cs;exports.AccordionItem=is;exports.AccordionTrigger=ls;exports.Alert=Fs;exports.AlertDescription=zs;exports.AlertDialog=Dc;exports.AlertDialogAction=Ws;exports.AlertDialogCancel=Us;exports.AlertDialogContent=Bs;exports.AlertDialogDescription=qs;exports.AlertDialogFooter=Hs;exports.AlertDialogHeader=Os;exports.AlertDialogOverlay=bn;exports.AlertDialogPortal=$s;exports.AlertDialogTitle=Gs;exports.AlertDialogTrigger=Ac;exports.AlertTitle=Vs;exports.AppShell=Za;exports.AspectRatio=vc;exports.AudioPlayer=wr;exports.AudioPlaylist=ai;exports.AudioRecorder=si;exports.AudioWaveform=br;exports.Avatar=Co;exports.AvatarFallback=Ro;exports.AvatarImage=So;exports.Badge=Xr;exports.Blockquote=hm;exports.Box=Wo;exports.Breadcrumb=Ys;exports.BreadcrumbEllipsis=ra;exports.BreadcrumbItem=Js;exports.BreadcrumbLink=Qs;exports.BreadcrumbList=Zs;exports.BreadcrumbPage=ea;exports.BreadcrumbSeparator=ta;exports.Button=ke;exports.Calendar=Qr;exports.Card=en;exports.CardContent=nn;exports.CardDescription=es;exports.CardFooter=ts;exports.CardHeader=tn;exports.CardTitle=rn;exports.Carousel=Ma;exports.CarouselContent=Pa;exports.CarouselItem=Ia;exports.CarouselNext=Ta;exports.CarouselPrevious=La;exports.ChartContainer=qa;exports.ChartLegend=wm;exports.ChartTooltip=bm;exports.ChatActionCard=Mi;exports.ChatBubble=gi;exports.ChatBubbleActions=vi;exports.ChatBubbleAvatar=pi;exports.ChatBubbleMessage=hi;exports.ChatBubbleTimestamp=xi;exports.ChatContainer=wi;exports.ChatEntityPreview=Pi;exports.ChatFollowUp=Ri;exports.ChatHeader=Fi;exports.ChatInput=bi;exports.ChatList=yi;exports.ChatMessage=$i;exports.ChatModeSelector=Si;exports.ChatQuestion=_i;exports.ChatResultCard=Ii;exports.ChatToolCall=Di;exports.Checkbox=_o;exports.CitationBadge=In;exports.Code=pm;exports.CodeBlock=mm;exports.Collapsible=bc;exports.CollapsibleContent=Jo;exports.CollapsibleTrigger=wc;exports.ColorPicker=hc;exports.Combobox=dc;exports.Command=vn;exports.CommandDialog=Tc;exports.CommandEmpty=Ls;exports.CommandGroup=Ts;exports.CommandInput=Ps;exports.CommandItem=Ds;exports.CommandList=Is;exports.CommandSeparator=Es;exports.CommandShortcut=As;exports.Container=Zo;exports.ContextMenu=yd;exports.ContextMenuCheckboxItem=ba;exports.ContextMenuContent=xa;exports.ContextMenuGroup=Nd;exports.ContextMenuItem=va;exports.ContextMenuLabel=ya;exports.ContextMenuPortal=kd;exports.ContextMenuRadioGroup=Sd;exports.ContextMenuRadioItem=wa;exports.ContextMenuSeparator=ja;exports.ContextMenuShortcut=Na;exports.ContextMenuSub=Cd;exports.ContextMenuSubContent=ha;exports.ContextMenuSubTrigger=pa;exports.ContextMenuTrigger=jd;exports.ConversationList=Ai;exports.CopyInput=ti;exports.DataTable=am;exports.DataTableColumnHeader=im;exports.DatePicker=ac;exports.Dialog=ds;exports.DialogClose=kc;exports.DialogContent=dn;exports.DialogDescription=ps;exports.DialogFooter=fs;exports.DialogHeader=ms;exports.DialogOverlay=cn;exports.DialogPortal=us;exports.DialogTitle=gs;exports.DialogTrigger=Nc;exports.Drawer=hs;exports.DrawerClose=vs;exports.DrawerContent=mn;exports.DrawerDescription=hn;exports.DrawerFooter=gn;exports.DrawerHeader=fn;exports.DrawerTitle=pn;exports.DrawerTrigger=xs;exports.DropdownMenu=ws;exports.DropdownMenuCheckboxItem=ks;exports.DropdownMenuContent=xn;exports.DropdownMenuGroup=Sc;exports.DropdownMenuItem=Ft;exports.DropdownMenuLabel=Ss;exports.DropdownMenuPortal=Rc;exports.DropdownMenuRadioGroup=Mc;exports.DropdownMenuRadioItem=Cs;exports.DropdownMenuSeparator=Rs;exports.DropdownMenuShortcut=_s;exports.DropdownMenuSub=_c;exports.DropdownMenuSubContent=Ns;exports.DropdownMenuSubTrigger=js;exports.DropdownMenuTrigger=ys;exports.EmptyState=xd;exports.FilePreview=zi;exports.FileUpload=fc;exports.Flex=Uo;exports.Grid=Yo;exports.HStack=Xo;exports.Header=Qa;exports.Heading=fm;exports.HoverCard=Rd;exports.HoverCardContent=ka;exports.HoverCardTrigger=_d;exports.Image=di;exports.ImageCompare=fi;exports.ImageCropper=mi;exports.Input=mt;exports.JsonViewer=ri;exports.Label=mr;exports.Lead=xm;exports.Lightbox=ui;exports.Main=ei;exports.MarkdownRenderer=Ni;exports.MessageActions=Li;exports.MetricCard=ym;exports.ModeToggle=Sm;exports.ModeToggleGroup=_m;exports.ModelSelector=Ci;exports.MultiSelect=uc;exports.Muted=vm;exports.NUIProvider=qo;exports.NavigationMenu=ca;exports.NavigationMenuContent=fa;exports.NavigationMenuIndicator=ga;exports.NavigationMenuItem=bd;exports.NavigationMenuLink=wd;exports.NavigationMenuList=da;exports.NavigationMenuTrigger=ma;exports.NavigationMenuViewport=wn;exports.NumberInput=lc;exports.OTPInput=mc;exports.Pagination=na;exports.PaginationContent=oa;exports.PaginationEllipsis=la;exports.PaginationItem=sa;exports.PaginationLink=pr;exports.PaginationNext=ia;exports.PaginationPrevious=aa;exports.Popover=Pt;exports.PopoverContent=yt;exports.PopoverTrigger=It;exports.Progress=Ks;exports.PromptSuggestions=ki;exports.RadioGroup=Do;exports.RadioGroupItem=Ao;exports.ReasoningBlock=Ei;exports.ScrollArea=fr;exports.ScrollBar=lr;exports.Select=tc;exports.SelectContent=Io;exports.SelectGroup=rc;exports.SelectItem=To;exports.SelectLabel=Lo;exports.SelectScrollDownButton=Zr;exports.SelectScrollUpButton=Yr;exports.SelectSeparator=Eo;exports.SelectTrigger=Po;exports.SelectValue=nc;exports.Separator=ko;exports.Sheet=hs;exports.SheetClose=vs;exports.SheetContent=mn;exports.SheetDescription=hn;exports.SheetFooter=gn;exports.SheetHeader=fn;exports.SheetOverlay=un;exports.SheetPortal=bs;exports.SheetTitle=pn;exports.SheetTrigger=xs;exports.Sidebar=Ja;exports.Skeleton=Fc;exports.Slider=Fo;exports.SourceCitation=Vi;exports.StatusBadge=Nm;exports.Stepper=vd;exports.StreamingText=Ti;exports.Switch=Mo;exports.Table=on;exports.TableBody=an;exports.TableCaption=ns;exports.TableCell=ir;exports.TableFooter=rs;exports.TableHead=ln;exports.TableHeader=sn;exports.TableRow=At;exports.Tabs=yc;exports.TabsContent=as;exports.TabsList=os;exports.TabsTrigger=ss;exports.TagInput=cc;exports.Text=gm;exports.Textarea=jo;exports.ThemeProvider=pd;exports.TimePicker=ic;exports.Timeline=Wa;exports.TimelineConnector=Xa;exports.TimelineContent=Ya;exports.TimelineIcon=Ka;exports.TimelineItem=Ua;exports.Toaster=hd;exports.Toggle=Vo;exports.ToggleGroup=zo;exports.ToggleGroupItem=Bo;exports.Tooltip=Ic;exports.TooltipContent=Ms;exports.TooltipProvider=Pc;exports.TooltipTrigger=Lc;exports.TranslateProvider=qo;exports.VStack=Ko;exports.VideoGallery=ci;exports.VideoPlayer=Xt;exports.VideoRecorder=li;exports.VideoThumbnail=Pn;exports.audioPlayerVariants=ni;exports.audioPlaylistVariants=Gr;exports.audioRecorderVariants=oi;exports.badgeVariants=No;exports.buttonVariants=Ut;exports.cardVariants=Qo;exports.cn=v;exports.en=Ot;exports.formatTime=Ke;exports.headingVariants=Ha;exports.inputVariants=yo;exports.navigationMenuTriggerStyle=ua;exports.ru=Oo;exports.textVariants=Ga;exports.toast=ed;exports.toggleVariants=Jr;exports.tpl=ze;exports.useLocale=sc;exports.useNUILocale=ce;exports.useTheme=gr;exports.useTranslate=ce;exports.videoPlayerVariants=ii;
38
38
  //# sourceMappingURL=index.cjs.js.map