@nicorp/nui 0.11.2 → 0.11.3
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 +15 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.es.js +3503 -3367
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),$=require("react"),io=require("@radix-ui/react-slot"),Wi=require("@radix-ui/react-label"),Ui=require("@radix-ui/react-separator"),Ki=require("@radix-ui/react-avatar"),Xi=require("@radix-ui/react-checkbox"),I=require("lucide-react"),Yi=require("@radix-ui/react-switch"),Zi=require("@radix-ui/react-select"),Ji=require("@radix-ui/react-radio-group"),Qi=require("@radix-ui/react-slider"),el=require("@radix-ui/react-toggle"),tl=require("@radix-ui/react-toggle-group"),Ie=require("date-fns"),rl=require("@radix-ui/react-popover"),nl=require("@radix-ui/react-aspect-ratio"),ol=require("@radix-ui/react-collapsible"),sl=require("@radix-ui/react-scroll-area"),al=require("@radix-ui/react-tabs"),il=require("@radix-ui/react-accordion"),ll=require("@radix-ui/react-dialog"),cl=require("@radix-ui/react-dropdown-menu"),dl=require("@radix-ui/react-tooltip"),qe=require("cmdk"),ul=require("@radix-ui/react-alert-dialog"),ml=require("@radix-ui/react-progress"),Ur=require("react-dom"),fl=require("@radix-ui/react-navigation-menu"),gl=require("@radix-ui/react-context-menu"),pl=require("@radix-ui/react-hover-card"),Kr=require("recharts");function be(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=be($),lo=be(Wi),co=be(Ui),Mt=be(Ki),Dr=be(Xi),Er=be(Yi),ke=be(Zi),Gt=be(Ji),Vt=be(Qi),uo=be(el),mr=be(tl),qt=be(rl),hl=be(nl),Xr=be(ol),xt=be(sl),wt=be(al),vt=be(il),ge=be(ll),xe=be(cl),Yt=be(dl),ze=be(ul),Ar=be(ml),We=be(fl),ve=be(gl),fr=be(pl);function mo(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=mo(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function fo(){for(var e,t,r=0,o="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=mo(e))&&(o&&(o+=" "),o+=t);return o}const xl=(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},vl=(e,t)=>({classGroupId:e,validator:t}),go=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),lr="-",Vn=[],bl="arbitrary..",wl=e=>{const t=jl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return yl(i);const l=i.split(lr),d=l[0]===""&&l.length>1?1:0;return po(l,d,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const d=o[i],c=r[i];return d?c?xl(c,d):d:c||Vn}return r[i]||Vn}}},po=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const c=po(e,t+1,a);if(c)return c}const i=r.validators;if(i===null)return;const l=t===0?e.join(lr):e.slice(t).join(lr),d=i.length;for(let c=0;c<d;c++){const p=i[c];if(p.validator(l))return p.classGroupId}},yl=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?bl+o:void 0})(),jl=e=>{const{theme:t,classGroups:r}=e;return Nl(r,t)},Nl=(e,t)=>{const r=go();for(const o in e){const s=e[o];Yr(s,r,o,t)}return r},Yr=(e,t,r,o)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];kl(i,t,r,o)}},kl=(e,t,r,o)=>{if(typeof e=="string"){Cl(e,t,r);return}if(typeof e=="function"){Sl(e,t,r,o);return}Rl(e,t,r,o)},Cl=(e,t,r)=>{const o=e===""?t:ho(t,e);o.classGroupId=r},Sl=(e,t,r,o)=>{if(_l(e)){Yr(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(vl(r,e))},Rl=(e,t,r,o)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,d]=s[i];Yr(d,ho(t,l),r,o)}},ho=(e,t)=>{let r=e;const o=t.split(lr),s=o.length;for(let a=0;a<s;a++){const i=o[a];let l=r.nextPart.get(i);l||(l=go(),r.nextPart.set(i,l)),r=l}return r},_l=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ml=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)}}},Fr="!",zn=":",Pl=[],$n=(e,t,r,o,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:s}),Il=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===zn){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(Fr)?(m=u.slice(0,-1),g=!0):u.startsWith(Fr)&&(m=u.slice(1),g=!0);const h=c&&c>d?c-d:void 0;return $n(a,g,m,h)};if(t){const s=t+zn,a=o;o=i=>i.startsWith(s)?a(i.slice(s.length)):$n(Pl,!1,i,void 0,!0)}if(r){const s=o;o=a=>r({className:a,parseClassName:s})}return o},Ll=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}},Tl=e=>({cache:Ml(e.cacheSize),parseClassName:Il(e),sortModifiers:Ll(e),...wl(e)}),Dl=/\s+/,El=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(Dl);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+Fr:w,P=j+b;if(i.indexOf(P)>-1)continue;i.push(P);const _=s(b,y);for(let M=0;M<_.length;++M){const S=_[M];i.push(j+S)}d=p+(d.length>0?" "+d:d)}return d},Al=(...e)=>{let t=0,r,o,s="";for(;t<e.length;)(r=e[t++])&&(o=xo(r))&&(s&&(s+=" "),s+=o);return s},xo=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=xo(e[o]))&&(r&&(r+=" "),r+=t);return r},Fl=(e,...t)=>{let r,o,s,a;const i=d=>{const c=t.reduce((p,u)=>u(p),e());return r=Tl(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=El(d,r);return s(d,p),p};return a=i,(...d)=>a(Al(...d))},Vl=[],Me=e=>{const t=r=>r[e]||Vl;return t.isThemeGetter=!0,t},vo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zl=/^\d+\/\d+$/,$l=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bl=/\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$/,Ol=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_t=e=>zl.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),st=e=>!!e&&Number.isInteger(Number(e)),Nr=e=>e.endsWith("%")&&de(e.slice(0,-1)),tt=e=>$l.test(e),ql=()=>!0,Wl=e=>Bl.test(e)&&!Ol.test(e),wo=()=>!1,Ul=e=>Hl.test(e),Kl=e=>Gl.test(e),Xl=e=>!J(e)&&!Q(e),Yl=e=>Pt(e,No,wo),J=e=>vo.test(e),pt=e=>Pt(e,ko,Wl),kr=e=>Pt(e,tc,de),Bn=e=>Pt(e,yo,wo),Zl=e=>Pt(e,jo,Kl),er=e=>Pt(e,Co,Ul),Q=e=>bo.test(e),At=e=>It(e,ko),Jl=e=>It(e,rc),On=e=>It(e,yo),Ql=e=>It(e,No),ec=e=>It(e,jo),tr=e=>It(e,Co,!0),Pt=(e,t,r)=>{const o=vo.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},It=(e,t,r=!1)=>{const o=bo.exec(e);return o?o[1]?t(o[1]):r:!1},yo=e=>e==="position"||e==="percentage",jo=e=>e==="image"||e==="url",No=e=>e==="length"||e==="size"||e==="bg-size",ko=e=>e==="length",tc=e=>e==="number",rc=e=>e==="family-name",Co=e=>e==="shadow",nc=()=>{const e=Me("color"),t=Me("font"),r=Me("text"),o=Me("font-weight"),s=Me("tracking"),a=Me("leading"),i=Me("breakpoint"),l=Me("container"),d=Me("spacing"),c=Me("radius"),p=Me("shadow"),u=Me("inset-shadow"),m=Me("text-shadow"),g=Me("drop-shadow"),h=Me("blur"),x=Me("perspective"),y=Me("aspect"),b=Me("ease"),w=Me("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...P(),Q,J],M=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],N=()=>[Q,J,d],L=()=>[_t,"full","auto",...N()],T=()=>[st,"none","subgrid",Q,J],B=()=>["auto",{span:["full",st,Q,J]},st,Q,J],V=()=>[st,"auto",Q,J],z=()=>["auto","min","max","fr",Q,J],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...N()],A=()=>[_t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],C=()=>[e,Q,J],K=()=>[...P(),On,Bn,{position:[Q,J]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",Ql,Yl,{size:[Q,J]}],ee=()=>[Nr,At,pt],E=()=>["","none","full",c,Q,J],F=()=>["",de,At,pt],U=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[de,Nr,On,Bn],Z=()=>["","none",h,Q,J],ae=()=>["none",de,Q,J],re=()=>["none",de,Q,J],ie=()=>[de,Q,J],X=()=>[_t,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tt],breakpoint:[tt],color:[ql],container:[tt],"drop-shadow":[tt],ease:["in","out","in-out"],font:[Xl],"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",_t,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:_()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[st,"auto",Q,J]}],basis:[{basis:[_t,"full","auto",l,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,_t,"auto","initial","none",J]}],grow:[{grow:["",de,Q,J]}],shrink:[{shrink:["",de,Q,J]}],order:[{order:[st,"first","last","none",Q,J]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],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:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"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,At,pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Q,kr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nr,J]}],"font-family":[{font:[Jl,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,kr]}],leading:[{leading:[a,...N()]}],"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:C()}],"text-color":[{text:C()}],"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:C()}],"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:N()}],"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:K()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},st,Q,J],radial:["",Q,J],conic:[st,Q,J]},ec,Zl]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"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:C()}],"border-color-x":[{"border-x":C()}],"border-color-y":[{"border-y":C()}],"border-color-s":[{"border-s":C()}],"border-color-e":[{"border-e":C()}],"border-color-t":[{"border-t":C()}],"border-color-r":[{"border-r":C()}],"border-color-b":[{"border-b":C()}],"border-color-l":[{"border-l":C()}],"divide-color":[{divide:C()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,Q,J]}],"outline-w":[{outline:["",de,At,pt]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",p,tr,er]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",u,tr,er]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[de,pt]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",m,tr,er]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[de,Q,J]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":C()}],"mask-image-linear-to-color":[{"mask-linear-to":C()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":C()}],"mask-image-t-to-color":[{"mask-t-to":C()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":C()}],"mask-image-r-to-color":[{"mask-r-to":C()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":C()}],"mask-image-b-to-color":[{"mask-b-to":C()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":C()}],"mask-image-l-to-color":[{"mask-l-to":C()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":C()}],"mask-image-x-to-color":[{"mask-x-to":C()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[Q,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":C()}],"mask-image-radial-to-color":[{"mask-radial-to":C()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":C()}],"mask-image-conic-to-color":[{"mask-conic-to":C()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Q,J]}],filter:[{filter:["","none",Q,J]}],blur:[{blur:Z()}],brightness:[{brightness:[de,Q,J]}],contrast:[{contrast:[de,Q,J]}],"drop-shadow":[{"drop-shadow":["","none",g,tr,er]}],"drop-shadow-color":[{"drop-shadow":C()}],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":Z()}],"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":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",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":_()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"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:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:C()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:C()}],"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":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",Q,J]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[de,At,pt,kr]}],stroke:[{stroke:["none",...C()]}],"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"]}},oc=Fl(nc);function v(...e){return oc(fo(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 Hn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Gn=fo,Ae=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return Gn(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=Hn(p)||Hn(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 Gn(e,i,d,r==null?void 0:r.class,r==null?void 0:r.className)},Zt=Ae("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"}}),_e=f.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...s},a)=>{const i=o?io.Slot:"button";return n.jsx(i,{className:v(Zt({variant:t,size:r,className:e})),ref:a,...s})});_e.displayName="Button";const So=Ae("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"}}),lt=f.forwardRef(({className:e,type:t,variant:r,inputSize:o,...s},a)=>n.jsx("input",{type:t,className:v(So({variant:r,inputSize:o}),e),ref:a,...s}));lt.displayName="Input";const Ro=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}));Ro.displayName="Textarea";const sc=Ae("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gr=f.forwardRef(({className:e,...t},r)=>n.jsx(lo.Root,{ref:r,className:v(sc(),e),...t}));gr.displayName=lo.Root.displayName;const _o=Ae("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 Zr({className:e,variant:t,...r}){return n.jsx("div",{className:v(_o({variant:t}),e),...r})}const Mo=f.forwardRef(({className:e,orientation:t="horizontal",...r},o)=>n.jsx(co.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}));Mo.displayName=co.Root.displayName;const Po=f.forwardRef(({className:e,...t},r)=>n.jsx(Mt.Root,{ref:r,className:v("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Po.displayName=Mt.Root.displayName;const Io=f.forwardRef(({className:e,...t},r)=>n.jsx(Mt.Image,{ref:r,className:v("aspect-square h-full w-full",e),...t}));Io.displayName=Mt.Image.displayName;const Lo=f.forwardRef(({className:e,...t},r)=>n.jsx(Mt.Fallback,{ref:r,className:v("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Lo.displayName=Mt.Fallback.displayName;const To=f.forwardRef(({className:e,...t},r)=>n.jsx(Dr.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(Dr.Indicator,{className:v("flex items-center justify-center text-current"),children:n.jsx(I.Check,{className:"h-4 w-4"})})}));To.displayName=Dr.Root.displayName;const Do=f.forwardRef(({className:e,...t},r)=>n.jsx(Er.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(Er.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")})}));Do.displayName=Er.Root.displayName;const ac=ke.Root,ic=ke.Group,lc=ke.Value,Eo=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(ke.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(ke.Icon,{asChild:!0,children:n.jsx(I.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Eo.displayName=ke.Trigger.displayName;const Jr=f.forwardRef(({className:e,...t},r)=>n.jsx(ke.ScrollUpButton,{ref:r,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(I.ChevronUp,{className:"h-4 w-4"})}));Jr.displayName=ke.ScrollUpButton.displayName;const Qr=f.forwardRef(({className:e,...t},r)=>n.jsx(ke.ScrollDownButton,{ref:r,className:v("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(I.ChevronDown,{className:"h-4 w-4"})}));Qr.displayName=ke.ScrollDownButton.displayName;const Ao=f.forwardRef(({className:e,children:t,position:r="popper",...o},s)=>n.jsx(ke.Portal,{children:n.jsxs(ke.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(Jr,{}),n.jsx(ke.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(Qr,{})]})}));Ao.displayName=ke.Content.displayName;const Fo=f.forwardRef(({className:e,...t},r)=>n.jsx(ke.Label,{ref:r,className:v("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Fo.displayName=ke.Label.displayName;const Vo=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(ke.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(ke.ItemIndicator,{children:n.jsx(I.Check,{className:"h-4 w-4"})})}),n.jsx(ke.ItemText,{children:t})]}));Vo.displayName=ke.Item.displayName;const zo=f.forwardRef(({className:e,...t},r)=>n.jsx(ke.Separator,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));zo.displayName=ke.Separator.displayName;const $o=f.forwardRef(({className:e,...t},r)=>n.jsx(Gt.Root,{className:v("grid gap-2",e),...t,ref:r}));$o.displayName=Gt.Root.displayName;const Bo=f.forwardRef(({className:e,...t},r)=>n.jsx(Gt.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(Gt.Indicator,{className:"flex items-center justify-center",children:n.jsx(I.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Bo.displayName=Gt.Item.displayName;const Oo=f.forwardRef(({className:e,...t},r)=>n.jsxs(Vt.Root,{ref:r,className:v("relative flex w-full touch-none select-none items-center",e),...t,children:[n.jsx(Vt.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:n.jsx(Vt.Range,{className:"absolute h-full bg-primary"})}),n.jsx(Vt.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"})]}));Oo.displayName=Vt.Root.displayName;const en=Ae("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"}}),Ho=f.forwardRef(({className:e,variant:t,size:r,...o},s)=>n.jsx(uo.Root,{ref:s,className:v(en({variant:t,size:r,className:e})),...o}));Ho.displayName=uo.Root.displayName;const Go=f.forwardRef(({className:e,variant:t,size:r,children:o,...s},a)=>n.jsx(mr.Root,{ref:a,className:v("flex items-center justify-center gap-1",e),...s,children:n.jsx(qo.Provider,{value:{variant:t,size:r},children:o})}));Go.displayName=mr.Root.displayName;const qo=f.createContext({size:"default",variant:"default"}),Wo=f.forwardRef(({className:e,children:t,variant:r,size:o,...s},a)=>{const i=f.useContext(qo);return n.jsx(mr.Item,{ref:a,className:v(en({variant:i.variant||r,size:i.size||o}),e),...s,children:t})});Wo.displayName=mr.Item.displayName;function tn({selected:e,onSelect:t,className:r,disabled:o}){const[s,a]=f.useState(()=>e?Ie.startOfMonth(e):Ie.startOfMonth(new Date)),i=Ie.startOfMonth(s),l=Ie.endOfMonth(s),d=Ie.startOfWeek(i,{weekStartsOn:1}),c=Ie.endOfWeek(l,{weekStartsOn:1}),p=Ie.eachDayOfInterval({start:d,end:c}),u=["Mo","Tu","We","Th","Fr","Sa","Su"],m=()=>{a(Ie.subMonths(s,1))},g=()=>{a(Ie.addMonths(s,1))},h=x=>{o!=null&&o(x)||t==null||t(Ie.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(_e,{variant:"ghost",size:"icon",onClick:m,className:"h-8 w-8 rounded-full hover:bg-accent",children:n.jsx(I.ChevronLeft,{className:"h-4 w-4"})}),n.jsx("h2",{className:"text-base font-semibold",children:Ie.format(s,"MMMM yyyy")}),n.jsx(_e,{variant:"ghost",size:"icon",onClick:g,className:"h-8 w-8 rounded-full hover:bg-accent",children:n.jsx(I.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=Ie.isSameMonth(x,s),w=e&&Ie.isSameDay(x,e),j=Ie.isToday(x),P=o==null?void 0:o(x);return n.jsx("button",{onClick:()=>h(x),disabled:P,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",P&&"opacity-30 cursor-not-allowed hover:bg-transparent"),children:Ie.format(x,"d")},y)})}),n.jsxs("div",{className:"mt-4 pt-3 border-t flex justify-between items-center",children:[n.jsx(_e,{variant:"ghost",size:"sm",onClick:()=>{const x=new Date;a(Ie.startOfMonth(x)),t==null||t(x)},className:"text-xs",children:"Today"}),e&&n.jsx("span",{className:"text-xs text-muted-foreground",children:Ie.format(e,"MMM d, yyyy")})]})]})}tn.displayName="Calendar";const Lt=qt.Root,Tt=qt.Trigger,yt=f.forwardRef(({className:e,align:t="center",sideOffset:r=4,...o},s)=>n.jsx(qt.Portal,{children:n.jsx(qt.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=qt.Content.displayName;const Wt={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",videoPlayer_chapter:"Chapter",videoPlayer_skipForward:"Skip forward",videoPlayer_skipBackward:"Skip backward",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"},Uo={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:"Не удалось загрузить видео",videoPlayer_chapter:"Глава",videoPlayer_skipForward:"Вперёд",videoPlayer_skipBackward:"Назад",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 qn(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 ir(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 cc={en:Wt,ru:Uo},Ko=f.createContext(Wt),Xo=f.createContext({lang:"en",messages:{}});function Yo({locale:e="en",messages:t,children:r}){const o=typeof e=="string"?e:"en",s=f.useMemo(()=>typeof e=="string"?cc[e]??Wt:{...Wt,...e},[e]),a=f.useMemo(()=>({lang:o,messages:t??{}}),[o,t]);return n.jsx(Xo.Provider,{value:a,children:n.jsx(Ko.Provider,{value:s,children:r})})}function ce(){return f.useContext(Ko)}function dc(){const{lang:e,messages:t}=f.useContext(Xo);return{t:f.useCallback((o,s)=>{const a=qn(t[e],o);if(a!==void 0)return ir(a,s);if(e!=="en"){const i=qn(t.en,o);if(i!==void 0)return ir(i,s)}return ir(o,s)},[e,t]),lang:e}}function Ge(e,t){return ir(e,t)}function uc({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(Lt,{open:l,onOpenChange:d,children:[n.jsx(Tt,{asChild:!0,children:n.jsxs(_e,{variant:"outline",disabled:o,className:v("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",s),children:[n.jsx(I.CalendarIcon,{className:"mr-2 h-4 w-4"}),e?Ie.format(e,"PPP"):n.jsx("span",{children:i})]})}),n.jsx(yt,{className:"w-auto p-0",align:"start",children:n.jsx(tn,{selected:e,onSelect:c=>{t==null||t(c),d(!1)}})})]})}function mc({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(Lt,{open:a,onOpenChange:i,children:[n.jsx(Tt,{asChild:!0,children:n.jsxs(_e,{variant:"outline",disabled:o,className:v("w-full justify-start font-normal",s),children:[n.jsx(I.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 fc({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(_e,{type:"button",variant:"outline",size:"icon",onClick:d,disabled:a||e<=r,className:"h-9 w-9",children:n.jsx(I.Minus,{className:"h-4 w-4"})}),n.jsx(lt,{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(_e,{type:"button",variant:"outline",size:"icon",onClick:l,disabled:a||e>=o,className:"h-9 w-9",children:n.jsx(I.Plus,{className:"h-4 w-4"})})]})}function gc({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(Zr,{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(I.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 pc({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(Lt,{open:m,onOpenChange:g,children:[n.jsx(Tt,{asChild:!0,children:n.jsxs(_e,{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(I.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(lt,{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(I.Check,{className:"h-4 w-4"})}),w.label]},w.value))})]})]})}function hc({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(M=>M.label.toLowerCase().includes(x.toLowerCase())),w=e.filter(M=>t.includes(M.value)),j=M=>{const S=t.includes(M)?t.filter(N=>N!==M):[...t,M];r==null||r(S)},P=(M,S)=>{S.stopPropagation(),r==null||r(t.filter(N=>N!==M))},_=()=>t.length===0?p:t.length<=d?w.map(M=>M.label).join(", "):Ge(c.multiselect_selected,{count:t.length});return n.jsxs(Lt,{open:g,onOpenChange:h,children:[n.jsx(Tt,{asChild:!0,children:n.jsxs(_e,{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:_()}),n.jsx(I.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(lt,{placeholder:u,value:x,onChange:M=>y(M.target.value),className:"h-8"})}),t.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1 p-2 border-b",children:w.map(M=>n.jsxs(Zr,{variant:"secondary",className:"pr-1",children:[M.label,n.jsx("button",{onClick:S=>P(M.value,S),className:"ml-1 rounded-full hover:bg-muted",children:n.jsx(I.X,{className:"h-3 w-3"})})]},M.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(M=>{const S=t.includes(M.value);return n.jsxs("button",{onClick:()=>j(M.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",S&&"bg-accent"),children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S&&n.jsx(I.Check,{className:"h-4 w-4"})}),M.label]},M.value)})})]})]})}function xc({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 vc({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(_=>!(t&&_.size>t)),P=r?[...i,...j]:j.slice(0,1);l(P),o==null||o(P)},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((P,_)=>_!==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(I.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:Ge(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(I.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(_e,{type:"button",variant:"ghost",size:"icon",onClick:()=>y(j),className:"h-8 w-8",children:n.jsx(I.X,{className:"h-4 w-4"})})]},j))})]})}const bc=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#8b5cf6","#ec4899","#000000","#ffffff"];function rr(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 wc(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 yc({value:e="#3b82f6",onChange:t,disabled:r,className:o}){const[s,a]=f.useState(!1),[i,l]=f.useState(()=>rr(e)),[d,c]=f.useState(e),p=f.useRef(null);f.useEffect(()=>{l(rr(e)),c(e)},[e]);const u=h=>{l(h);const x=wc(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=rr(h);l(x),t==null||t(h)}};return n.jsxs(Lt,{open:s,onOpenChange:a,children:[n.jsx(Tt,{asChild:!0,children:n.jsxs(_e,{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: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(
|
|
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(gr,{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
|
-
)`}})]}),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";/**
|
|
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(lt,{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:bc.map(h=>n.jsx("button",{onClick:()=>{t==null||t(h),l(rr(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 Zo=f.forwardRef(({className:e,as:t="div",...r},o)=>n.jsx(t,{ref:o,className:v(e),...r}));Zo.displayName="Box";const Jo=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}));Jo.displayName="Flex";const Qo=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}));Qo.displayName="VStack";const es=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}));es.displayName="HStack";const ts=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})});ts.displayName="Grid";const jc={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"},rs=f.forwardRef(({className:e,maxWidth:t="lg",centered:r=!0,...o},s)=>n.jsx("div",{ref:s,className:v("w-full px-4",jc[t],r&&"mx-auto",e),...o}));rs.displayName="Container";const Nc=hl.Root,kc=Xr.Root,Cc=Xr.CollapsibleTrigger,ns=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx(Xr.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})}));ns.displayName="CollapsibleContent";const os=Ae("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"}}),rn=f.forwardRef(({className:e,variant:t,...r},o)=>n.jsx("div",{ref:o,className:v(os({variant:t}),e),...r}));rn.displayName="Card";const nn=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",e),...t}));nn.displayName="CardHeader";const on=f.forwardRef(({className:e,...t},r)=>n.jsx("h3",{ref:r,className:v("text-2xl font-semibold leading-none tracking-tight",e),...t}));on.displayName="CardTitle";const ss=f.forwardRef(({className:e,...t},r)=>n.jsx("p",{ref:r,className:v("text-sm text-muted-foreground",e),...t}));ss.displayName="CardDescription";const sn=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("p-6 pt-0",e),...t}));sn.displayName="CardContent";const as=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",e),...t}));as.displayName="CardFooter";const an=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})}));an.displayName="Table";const ln=f.forwardRef(({className:e,...t},r)=>n.jsx("thead",{ref:r,className:v("[&_tr]:border-b",e),...t}));ln.displayName="TableHeader";const cn=f.forwardRef(({className:e,...t},r)=>n.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",e),...t}));cn.displayName="TableBody";const is=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}));is.displayName="TableFooter";const $t=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}));$t.displayName="TableRow";const dn=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}));dn.displayName="TableHead";const cr=f.forwardRef(({className:e,...t},r)=>n.jsx("td",{ref:r,className:v("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));cr.displayName="TableCell";const ls=f.forwardRef(({className:e,...t},r)=>n.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",e),...t}));ls.displayName="TableCaption";const pr=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(dr,{orientation:"vertical"}),(r==="horizontal"||r==="both")&&n.jsx(dr,{orientation:"horizontal"}),n.jsx(xt.Corner,{})]}));pr.displayName=xt.Root.displayName;const dr=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"})}));dr.displayName=xt.ScrollAreaScrollbar.displayName;const Sc=wt.Root,cs=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}));cs.displayName=wt.List.displayName;const ds=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}));ds.displayName=wt.Trigger.displayName;const us=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}));us.displayName=wt.Content.displayName;const Rc=vt.Root,ms=f.forwardRef(({className:e,...t},r)=>n.jsx(vt.Item,{ref:r,className:v("border-b",e),...t}));ms.displayName="AccordionItem";const fs=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(I.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));fs.displayName=vt.Trigger.displayName;const gs=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})}));gs.displayName=vt.Content.displayName;const ps=ge.Root,_c=ge.Trigger,hs=ge.Portal,Mc=ge.Close,un=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}));un.displayName=ge.Overlay.displayName;const mn=f.forwardRef(({className:e,children:t,...r},o)=>{const s=ce();return n.jsxs(hs,{children:[n.jsx(un,{}),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(I.X,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:s.common_close})]})]})]})});mn.displayName=ge.Content.displayName;const xs=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xs.displayName="DialogHeader";const vs=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vs.displayName="DialogFooter";const bs=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Title,{ref:r,className:v("text-lg font-semibold leading-none tracking-tight",e),...t}));bs.displayName=ge.Title.displayName;const ws=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Description,{ref:r,className:v("text-sm text-muted-foreground",e),...t}));ws.displayName=ge.Description.displayName;const ys=ge.Root,js=ge.Trigger,Ns=ge.Close,ks=ge.Portal,fn=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}));fn.displayName=ge.Overlay.displayName;const Pc=Ae("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"}}),gn=f.forwardRef(({side:e="right",className:t,children:r,...o},s)=>{const a=ce();return n.jsxs(ks,{children:[n.jsx(fn,{}),n.jsxs(ge.Content,{ref:s,className:v(Pc({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(I.X,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:a.common_close})]})]})]})});gn.displayName=ge.Content.displayName;const pn=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",e),...t});pn.displayName="SheetHeader";const hn=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hn.displayName="SheetFooter";const xn=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Title,{ref:r,className:v("text-lg font-semibold text-foreground",e),...t}));xn.displayName=ge.Title.displayName;const vn=f.forwardRef(({className:e,...t},r)=>n.jsx(ge.Description,{ref:r,className:v("text-sm text-muted-foreground",e),...t}));vn.displayName=ge.Description.displayName;const Cs=xe.Root,Ss=xe.Trigger,Ic=xe.Group,Lc=xe.Portal,Tc=xe.Sub,Dc=xe.RadioGroup,Rs=f.forwardRef(({className:e,inset:t,children:r,...o},s)=>n.jsxs(xe.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(I.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Rs.displayName=xe.SubTrigger.displayName;const _s=f.forwardRef(({className:e,...t},r)=>n.jsx(xe.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}));_s.displayName=xe.SubContent.displayName;const bn=f.forwardRef(({className:e,sideOffset:t=4,...r},o)=>n.jsx(xe.Portal,{children:n.jsx(xe.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})}));bn.displayName=xe.Content.displayName;const Bt=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(xe.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}));Bt.displayName=xe.Item.displayName;const Ms=f.forwardRef(({className:e,children:t,checked:r,...o},s)=>n.jsxs(xe.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(xe.ItemIndicator,{children:n.jsx(I.Check,{className:"h-4 w-4"})})}),t]}));Ms.displayName=xe.CheckboxItem.displayName;const Ps=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(xe.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(xe.ItemIndicator,{children:n.jsx(I.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Ps.displayName=xe.RadioItem.displayName;const Is=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(xe.Label,{ref:o,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Is.displayName=xe.Label.displayName;const Ls=f.forwardRef(({className:e,...t},r)=>n.jsx(xe.Separator,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",e),...t}));Ls.displayName=xe.Separator.displayName;const Ts=({className:e,...t})=>n.jsx("span",{className:v("ml-auto text-xs tracking-widest opacity-60",e),...t});Ts.displayName="DropdownMenuShortcut";const Ec=Yt.Provider,Ac=Yt.Root,Fc=Yt.Trigger,Ds=f.forwardRef(({className:e,sideOffset:t=4,...r},o)=>n.jsx(Yt.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}));Ds.displayName=Yt.Content.displayName;const wn=f.forwardRef(({className:e,...t},r)=>n.jsx(qe.Command,{ref:r,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));wn.displayName=qe.Command.displayName;const Vc=({children:e,...t})=>n.jsx(ps,{...t,children:n.jsx(mn,{className:"overflow-hidden p-0 shadow-lg",children:n.jsx(wn,{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})})}),Es=f.forwardRef(({className:e,...t},r)=>n.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsx(I.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsx(qe.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})]}));Es.displayName=qe.Command.Input.displayName;const As=f.forwardRef(({className:e,...t},r)=>n.jsx(qe.Command.List,{ref:r,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));As.displayName=qe.Command.List.displayName;const Fs=f.forwardRef((e,t)=>n.jsx(qe.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Fs.displayName=qe.Command.Empty.displayName;const Vs=f.forwardRef(({className:e,...t},r)=>n.jsx(qe.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}));Vs.displayName=qe.Command.Group.displayName;const zs=f.forwardRef(({className:e,...t},r)=>n.jsx(qe.Command.Separator,{ref:r,className:v("-mx-1 h-px bg-border",e),...t}));zs.displayName=qe.Command.Separator.displayName;const $s=f.forwardRef(({className:e,...t},r)=>n.jsx(qe.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}));$s.displayName=qe.Command.Item.displayName;const Bs=({className:e,...t})=>n.jsx("span",{className:v("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Bs.displayName="CommandShortcut";const zc=Ae("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"}}),Os=f.forwardRef(({className:e,variant:t,...r},o)=>n.jsx("div",{ref:o,role:"alert",className:v(zc({variant:t}),e),...r}));Os.displayName="Alert";const Hs=f.forwardRef(({className:e,...t},r)=>n.jsx("h5",{ref:r,className:v("mb-1 font-medium leading-none tracking-tight",e),...t}));Hs.displayName="AlertTitle";const Gs=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("text-sm [&_p]:leading-relaxed",e),...t}));Gs.displayName="AlertDescription";const $c=ze.Root,Bc=ze.Trigger,qs=ze.Portal,yn=f.forwardRef(({className:e,...t},r)=>n.jsx(ze.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}));yn.displayName=ze.Overlay.displayName;const Ws=f.forwardRef(({className:e,...t},r)=>n.jsxs(qs,{children:[n.jsx(yn,{}),n.jsx(ze.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})]}));Ws.displayName=ze.Content.displayName;const Us=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",e),...t});Us.displayName="AlertDialogHeader";const Ks=({className:e,...t})=>n.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ks.displayName="AlertDialogFooter";const Xs=f.forwardRef(({className:e,...t},r)=>n.jsx(ze.Title,{ref:r,className:v("text-lg font-semibold",e),...t}));Xs.displayName=ze.Title.displayName;const Ys=f.forwardRef(({className:e,...t},r)=>n.jsx(ze.Description,{ref:r,className:v("text-sm text-muted-foreground",e),...t}));Ys.displayName=ze.Description.displayName;const Zs=f.forwardRef(({className:e,...t},r)=>n.jsx(ze.Action,{ref:r,className:v(Zt(),e),...t}));Zs.displayName=ze.Action.displayName;const Js=f.forwardRef(({className:e,...t},r)=>n.jsx(ze.Cancel,{ref:r,className:v(Zt({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Js.displayName=ze.Cancel.displayName;const Qs=f.forwardRef(({className:e,value:t,...r},o)=>n.jsx(Ar.Root,{ref:o,className:v("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:n.jsx(Ar.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Qs.displayName=Ar.Root.displayName;function Oc({className:e,...t}){return n.jsx("div",{className:v("animate-pulse rounded-md bg-muted",e),...t})}function Hc(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 Gc=e=>{switch(e){case"success":return Uc;case"info":return Xc;case"warning":return Kc;case"error":return Yc;default:return null}},qc=Array(12).fill(0),Wc=({visible:e,className:t})=>$.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},$.createElement("div",{className:"sonner-spinner"},qc.map((r,o)=>$.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Uc=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),Kc=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},$.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"})),Xc=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),Yc=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),Zc=$.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"},$.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),$.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Jc=()=>{const[e,t]=$.useState(document.hidden);return $.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Vr=1;class Qc{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:Vr++,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],$.isValidElement(c))a=!1,this.create({id:o,type:"default",message:c});else if(td(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"&&!$.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"&&!$.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"&&!$.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"&&!$.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)||Vr++;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 He=new Qc,ed=(e,t)=>{const r=(t==null?void 0:t.id)||Vr++;return He.addToast({title:e,...t,id:r}),r},td=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rd=ed,nd=()=>He.toasts,od=()=>He.getActiveToasts(),sd=Object.assign(rd,{success:He.success,info:He.info,warning:He.warning,error:He.error,custom:He.custom,message:He.message,promise:He.promise,dismiss:He.dismiss,loading:He.loading},{getHistory:nd,getToasts:od});Hc("[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 nr(e){return e.label!==void 0}const ad=3,id="24px",ld="16px",Wn=4e3,cd=356,dd=14,ud=45,md=200;function et(...e){return e.filter(Boolean).join(" ")}function fd(e){const[t,r]=e.split("-"),o=[];return t&&o.push(t),r&&o.push(r),o}const gd=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:P,defaultRichColors:_,closeButton:M,style:S,cancelButtonStyle:N,actionButtonStyle:L,className:T="",descriptionClassName:B="",duration:V,position:z,gap:k,expandByDefault:O,classNames:D,icons:A,closeButtonAriaLabel:C="Close toast"}=e,[K,G]=$.useState(null),[W,ee]=$.useState(null),[E,F]=$.useState(!1),[U,te]=$.useState(!1),[Y,Z]=$.useState(!1),[ae,re]=$.useState(!1),[ie,X]=$.useState(!1),[H,ne]=$.useState(0),[ue,we]=$.useState(0),pe=$.useRef(u.duration||V||Wn),Le=$.useRef(null),fe=$.useRef(null),Pe=b===0,Ue=b+1<=x,ye=u.type,$e=u.dismissible!==!1,Qe=u.className||"",ct=u.descriptionClassName||"",he=$.useMemo(()=>y.findIndex(le=>le.toastId===u.id)||0,[y,u.id]),jt=$.useMemo(()=>{var le;return(le=u.closeButton)!=null?le:M},[u.closeButton,M]),Nt=$.useMemo(()=>u.duration||V||Wn,[u.duration,V]),Ce=$.useRef(0),Te=$.useRef(0),nt=$.useRef(0),Be=$.useRef(null),[Ye,dt]=z.split("-"),kt=$.useMemo(()=>y.reduce((le,je,Se)=>Se>=he?le:le+je.height,0),[y,he]),Ct=Jc(),Dt=u.invert||p,ut=ye==="loading";Te.current=$.useMemo(()=>he*k+kt,[he,kt]),$.useEffect(()=>{pe.current=Nt},[Nt]),$.useEffect(()=>{F(!0)},[]),$.useEffect(()=>{const le=fe.current;if(le){const je=le.getBoundingClientRect().height;return we(je),h(Se=>[{toastId:u.id,height:je,position:u.position},...Se]),()=>h(Se=>Se.filter(De=>De.toastId!==u.id))}},[h,u.id]),$.useLayoutEffect(()=>{if(!E)return;const le=fe.current,je=le.style.height;le.style.height="auto";const Se=le.getBoundingClientRect().height;le.style.height=je,we(Se),h(De=>De.find(Re=>Re.toastId===u.id)?De.map(Re=>Re.toastId===u.id?{...Re,height:Se}:Re):[{toastId:u.id,height:Se,position:u.position},...De])},[E,u.title,u.description,h,u.id,u.jsx,u.action,u.cancel]);const Fe=$.useCallback(()=>{te(!0),ne(Te.current),h(le=>le.filter(je=>je.toastId!==u.id)),setTimeout(()=>{P(u)},md)},[u,P,h,Te]);$.useEffect(()=>{if(u.promise&&ye==="loading"||u.duration===1/0||u.type==="loading")return;let le;return j||g||Ct?(()=>{if(nt.current<Ce.current){const De=new Date().getTime()-Ce.current;pe.current=pe.current-De}nt.current=new Date().getTime()})():(()=>{pe.current!==1/0&&(Ce.current=new Date().getTime(),le=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Fe()},pe.current))})(),()=>clearTimeout(le)},[j,g,u,ye,Ct,Fe]),$.useEffect(()=>{u.delete&&(Fe(),u.onDismiss==null||u.onDismiss.call(u,u))},[Fe,u.delete]);function Et(){var le;if(A!=null&&A.loading){var je;return $.createElement("div",{className:et(D==null?void 0:D.loader,u==null||(je=u.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":ye==="loading"},A.loading)}return $.createElement(Wc,{className:et(D==null?void 0:D.loader,u==null||(le=u.classNames)==null?void 0:le.loader),visible:ye==="loading"})}const mt=u.icon||(A==null?void 0:A[ye])||Gc(ye);var ft,ot;return $.createElement("li",{tabIndex:0,ref:fe,className:et(T,Qe,D==null?void 0:D.toast,u==null||(t=u.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[ye],u==null||(r=u.classNames)==null?void 0:r[ye]),"data-sonner-toast":"","data-rich-colors":(ft=u.richColors)!=null?ft:_,"data-styled":!(u.jsx||u.unstyled||m),"data-mounted":E,"data-promise":!!u.promise,"data-swiped":ie,"data-removed":U,"data-visible":Ue,"data-y-position":Ye,"data-x-position":dt,"data-index":b,"data-front":Pe,"data-swiping":Y,"data-dismissible":$e,"data-type":ye,"data-invert":Dt,"data-swipe-out":ae,"data-swipe-direction":W,"data-expanded":!!(j||O&&E),"data-testid":u.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${U?H:Te.current}px`,"--initial-height":O?"auto":`${ue}px`,...S,...u.style},onDragEnd:()=>{Z(!1),G(null),Be.current=null},onPointerDown:le=>{le.button!==2&&(ut||!$e||(Le.current=new Date,ne(Te.current),le.target.setPointerCapture(le.pointerId),le.target.tagName!=="BUTTON"&&(Z(!0),Be.current={x:le.clientX,y:le.clientY})))},onPointerUp:()=>{var le,je,Se;if(ae||!$e)return;Be.current=null;const De=Number(((le=fe.current)==null?void 0:le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),St=Number(((je=fe.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Re=new Date().getTime()-((Se=Le.current)==null?void 0:Se.getTime()),Oe=K==="x"?De:St,gt=Math.abs(Oe)/Re;if(Math.abs(Oe)>=ud||gt>.11){ne(Te.current),u.onDismiss==null||u.onDismiss.call(u,u),ee(K==="x"?De>0?"right":"left":St>0?"down":"up"),Fe(),re(!0);return}else{var R,q;(R=fe.current)==null||R.style.setProperty("--swipe-amount-x","0px"),(q=fe.current)==null||q.style.setProperty("--swipe-amount-y","0px")}X(!1),Z(!1),G(null)},onPointerMove:le=>{var je,Se,De;if(!Be.current||!$e||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;const Re=le.clientY-Be.current.y,Oe=le.clientX-Be.current.x;var gt;const R=(gt=e.swipeDirections)!=null?gt:fd(z);!K&&(Math.abs(Oe)>1||Math.abs(Re)>1)&&G(Math.abs(Oe)>Math.abs(Re)?"x":"y");let q={x:0,y:0};const me=Ve=>1/(1.5+Math.abs(Ve)/20);if(K==="y"){if(R.includes("top")||R.includes("bottom"))if(R.includes("top")&&Re<0||R.includes("bottom")&&Re>0)q.y=Re;else{const Ve=Re*me(Re);q.y=Math.abs(Ve)<Math.abs(Re)?Ve:Re}}else if(K==="x"&&(R.includes("left")||R.includes("right")))if(R.includes("left")&&Oe<0||R.includes("right")&&Oe>0)q.x=Oe;else{const Ve=Oe*me(Oe);q.x=Math.abs(Ve)<Math.abs(Oe)?Ve:Oe}(Math.abs(q.x)>0||Math.abs(q.y)>0)&&X(!0),(Se=fe.current)==null||Se.style.setProperty("--swipe-amount-x",`${q.x}px`),(De=fe.current)==null||De.style.setProperty("--swipe-amount-y",`${q.y}px`)}},jt&&!u.jsx&&ye!=="loading"?$.createElement("button",{"aria-label":C,"data-disabled":ut,"data-close-button":!0,onClick:ut||!$e?()=>{}:()=>{Fe(),u.onDismiss==null||u.onDismiss.call(u,u)},className:et(D==null?void 0:D.closeButton,u==null||(o=u.classNames)==null?void 0:o.closeButton)},(ot=A==null?void 0:A.close)!=null?ot:Zc):null,(ye||u.icon||u.promise)&&u.icon!==null&&((A==null?void 0:A[ye])!==null||u.icon)?$.createElement("div",{"data-icon":"",className:et(D==null?void 0:D.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"?mt:null):null,$.createElement("div",{"data-content":"",className:et(D==null?void 0:D.content,u==null||(a=u.classNames)==null?void 0:a.content)},$.createElement("div",{"data-title":"",className:et(D==null?void 0:D.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?$.createElement("div",{"data-description":"",className:et(B,ct,D==null?void 0:D.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),$.isValidElement(u.cancel)?u.cancel:u.cancel&&nr(u.cancel)?$.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||N,onClick:le=>{nr(u.cancel)&&$e&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,le),Fe())},className:et(D==null?void 0:D.cancelButton,u==null||(d=u.classNames)==null?void 0:d.cancelButton)},u.cancel.label):null,$.isValidElement(u.action)?u.action:u.action&&nr(u.action)?$.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||L,onClick:le=>{nr(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,le),!le.defaultPrevented&&Fe())},className:et(D==null?void 0:D.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Un(){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 pd(e,t){const r={};return[e,t].forEach((o,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?ld:id;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 hd=$.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=ad,toastOptions:b,dir:w=Un(),gap:j=dd,icons:P,containerAriaLabel:_="Notifications"}=t,[M,S]=$.useState([]),N=$.useMemo(()=>o?M.filter(E=>E.toasterId===o):M.filter(E=>!E.toasterId),[M,o]),L=$.useMemo(()=>Array.from(new Set([a].concat(N.filter(E=>E.position).map(E=>E.position)))),[N,a]),[T,B]=$.useState([]),[V,z]=$.useState(!1),[k,O]=$.useState(!1),[D,A]=$.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),C=$.useRef(null),K=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=$.useRef(null),W=$.useRef(!1),ee=$.useCallback(E=>{S(F=>{var U;return(U=F.find(te=>te.id===E.id))!=null&&U.delete||He.dismiss(E.id),F.filter(({id:te})=>te!==E.id)})},[]);return $.useEffect(()=>He.subscribe(E=>{if(E.dismiss){requestAnimationFrame(()=>{S(F=>F.map(U=>U.id===E.id?{...U,delete:!0}:U))});return}setTimeout(()=>{Ur.flushSync(()=>{S(F=>{const U=F.findIndex(te=>te.id===E.id);return U!==-1?[...F.slice(0,U),{...F[U],...E},...F.slice(U+1)]:[E,...F]})})})}),[M]),$.useEffect(()=>{if(m!=="system"){A(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;const E=window.matchMedia("(prefers-color-scheme: dark)");try{E.addEventListener("change",({matches:F})=>{A(F?"dark":"light")})}catch{E.addListener(({matches:U})=>{try{A(U?"dark":"light")}catch(te){console.error(te)}})}},[m]),$.useEffect(()=>{M.length<=1&&z(!1)},[M]),$.useEffect(()=>{const E=F=>{var U;if(i.every(Z=>F[Z]||F.code===Z)){var Y;z(!0),(Y=C.current)==null||Y.focus()}F.code==="Escape"&&(document.activeElement===C.current||(U=C.current)!=null&&U.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[i]),$.useEffect(()=>{if(C.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,W.current=!1)}},[C.current]),$.createElement("section",{ref:r,"aria-label":`${_} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((E,F)=>{var U;const[te,Y]=E.split("-");return N.length?$.createElement("ol",{key:E,dir:w==="auto"?Un():w,tabIndex:-1,ref:C,className:c,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":te,"data-x-position":Y,style:{"--front-toast-height":`${((U=T[0])==null?void 0:U.height)||0}px`,"--width":`${cd}px`,"--gap":`${j}px`,...x,...pd(p,u)},onBlur:Z=>{W.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(W.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||W.current||(W.current=!0,G.current=Z.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{k||z(!1)},onDragEnd:()=>z(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},N.filter(Z=>!Z.position&&F===0||Z.position===E).map((Z,ae)=>{var re,ie;return $.createElement(gd,{key:Z.id,icons:P,index:ae,toast:Z,defaultRichColors:g,duration:(re=b==null?void 0:b.duration)!=null?re: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:E,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:ee,toasts:N.filter(X=>X.position==Z.position),heights:T.filter(X=>X.position==Z.position),setHeights:B,expandByDefault:l,gap:j,expanded:V,swipeDirections:t.swipeDirections})})):null}))}),Cr=["light","dark","system"];function xd(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Kn(e){return e==="system"?xd():e}function vd(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 bd(e,t){const r=document.documentElement;t==="class"?(r.classList.remove("light","dark"),r.classList.add(e)):r.setAttribute("data-theme",e)}const ea=$.createContext(void 0);function wd({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]=$.useState(()=>{if(typeof window>"u")return t;const b=localStorage.getItem(r);return b&&Cr.includes(b)?b:t}),[p,u]=$.useState(()=>Kn(i??d)),m=$.useRef(d);m.current=d;const g=$.useCallback(()=>{const b=i??m.current,w=Kn(b);u(w);let j;a&&(j=vd(l)),bd(w,o),j==null||j()},[i,o,a,l]);$.useEffect(()=>{g()},[d,i,g]),$.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]),$.useEffect(()=>{const b=w=>{if(w.key===r&&w.newValue){const j=w.newValue;Cr.includes(j)&&c(j)}};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[r]);const h=$.useCallback(b=>{!s&&b==="system"||(localStorage.setItem(r,b),c(b))},[r,s]),x=$.useMemo(()=>s?Cr:["light","dark"],[s]),y=$.useMemo(()=>({theme:i??d,resolvedTheme:p,setTheme:h,themes:x}),[i,d,p,h,x]);return n.jsx(ea.Provider,{value:y,children:e})}function hr(){const e=$.useContext(ea);if(e===void 0)throw new Error("useTheme must be used within a <ThemeProvider>");return e}const yd=({theme:e,...t})=>{let r=e;try{const{resolvedTheme:o}=hr();e||(r=o)}catch{r||(r="system")}return n.jsx(hd,{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 jd({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 ta=f.forwardRef(({...e},t)=>n.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));ta.displayName="Breadcrumb";const ra=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}));ra.displayName="BreadcrumbList";const na=f.forwardRef(({className:e,...t},r)=>n.jsx("li",{ref:r,className:v("inline-flex items-center gap-1.5",e),...t}));na.displayName="BreadcrumbItem";const oa=f.forwardRef(({asChild:e,className:t,...r},o)=>{const s=e?io.Slot:"a";return n.jsx(s,{ref:o,className:v("transition-colors hover:text-foreground",t),...r})});oa.displayName="BreadcrumbLink";const sa=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}));sa.displayName="BreadcrumbPage";const aa=({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(I.ChevronRight,{})});aa.displayName="BreadcrumbSeparator";const ia=({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})]})};ia.displayName="BreadcrumbEllipsis";const la=({className:e,...t})=>n.jsx("nav",{role:"navigation","aria-label":"pagination",className:v("mx-auto flex w-full justify-center",e),...t});la.displayName="Pagination";const ca=f.forwardRef(({className:e,...t},r)=>n.jsx("ul",{ref:r,className:v("flex flex-row items-center gap-1",e),...t}));ca.displayName="PaginationContent";const da=f.forwardRef(({className:e,...t},r)=>n.jsx("li",{ref:r,className:v("",e),...t}));da.displayName="PaginationItem";const xr=({className:e,isActive:t,size:r="icon",...o})=>n.jsx("a",{"aria-current":t?"page":void 0,className:v(Zt({variant:t?"outline":"ghost",size:r}),e),...o});xr.displayName="PaginationLink";const ua=({className:e,...t})=>{const r=ce();return n.jsxs(xr,{"aria-label":r.pagination_goToPrevious,size:"default",className:v("gap-1 pl-2.5",e),...t,children:[n.jsx(I.ChevronLeft,{className:"h-4 w-4"}),n.jsx("span",{children:r.pagination_previous})]})};ua.displayName="PaginationPrevious";const ma=({className:e,...t})=>{const r=ce();return n.jsxs(xr,{"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(I.ChevronRight,{className:"h-4 w-4"})]})};ma.displayName="PaginationNext";const fa=({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(I.MoreHorizontal,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:r.pagination_morePages})]})};fa.displayName="PaginationEllipsis";function Nd({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(I.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 ga=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(We.Root,{ref:o,className:v("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n.jsx(jn,{})]}));ga.displayName=We.Root.displayName;const pa=f.forwardRef(({className:e,...t},r)=>n.jsx(We.List,{ref:r,className:v("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));pa.displayName=We.List.displayName;const kd=We.Item,ha=Ae("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"),xa=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(We.Trigger,{ref:o,className:v(ha(),"group",e),...r,children:[t," ",n.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"})]}));xa.displayName=We.Trigger.displayName;const va=f.forwardRef(({className:e,...t},r)=>n.jsx(We.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}));va.displayName=We.Content.displayName;const Cd=We.Link,jn=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{className:v("absolute left-0 top-full flex justify-center"),children:n.jsx(We.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})}));jn.displayName=We.Viewport.displayName;const ba=f.forwardRef(({className:e,...t},r)=>n.jsx(We.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"})}));ba.displayName=We.Indicator.displayName;const Sd=ve.Root,Rd=ve.Trigger,_d=ve.Group,Md=ve.Portal,Pd=ve.Sub,Id=ve.RadioGroup,wa=f.forwardRef(({className:e,inset:t,children:r,...o},s)=>n.jsxs(ve.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(I.ChevronRight,{className:"ml-auto h-4 w-4"})]}));wa.displayName=ve.SubTrigger.displayName;const ya=f.forwardRef(({className:e,...t},r)=>n.jsx(ve.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}));ya.displayName=ve.SubContent.displayName;const ja=f.forwardRef(({className:e,...t},r)=>n.jsx(ve.Portal,{children:n.jsx(ve.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})}));ja.displayName=ve.Content.displayName;const Na=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(ve.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}));Na.displayName=ve.Item.displayName;const ka=f.forwardRef(({className:e,children:t,checked:r,...o},s)=>n.jsxs(ve.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(ve.ItemIndicator,{children:n.jsx(I.Check,{className:"h-4 w-4"})})}),t]}));ka.displayName=ve.CheckboxItem.displayName;const Ca=f.forwardRef(({className:e,children:t,...r},o)=>n.jsxs(ve.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(ve.ItemIndicator,{children:n.jsx(I.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Ca.displayName=ve.RadioItem.displayName;const Sa=f.forwardRef(({className:e,inset:t,...r},o)=>n.jsx(ve.Label,{ref:o,className:v("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));Sa.displayName=ve.Label.displayName;const Ra=f.forwardRef(({className:e,...t},r)=>n.jsx(ve.Separator,{ref:r,className:v("-mx-1 my-1 h-px bg-border",e),...t}));Ra.displayName=ve.Separator.displayName;const _a=({className:e,...t})=>n.jsx("span",{className:v("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});_a.displayName="ContextMenuShortcut";const Ld=fr.Root,Td=fr.Trigger,Ma=f.forwardRef(({className:e,align:t="center",sideOffset:r=4,...o},s)=>n.jsx(fr.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}));Ma.displayName=fr.Content.displayName;function Dd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xn(e){return Dd(e)||Array.isArray(e)}function Ed(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Nn(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}`:!Xn(l)||!Xn(d)?l===d:Nn(l,d)})}function Yn(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function Ad(e,t){if(e.length!==t.length)return!1;const r=Yn(e),o=Yn(t);return r.every((s,a)=>{const i=o[a];return Nn(s,i)})}function kn(e){return typeof e=="number"}function zr(e){return typeof e=="string"}function vr(e){return typeof e=="boolean"}function Zn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ne(e){return Math.abs(e)}function Cn(e){return Math.sign(e)}function Ot(e,t){return Ne(e-t)}function Fd(e,t){if(e===0||t===0||Ne(e)<=Ne(t))return 0;const r=Ot(Ne(e),Ne(t));return Ne(r/e)}function Vd(e){return Math.round(e*100)/100}function Ut(e){return Kt(e).map(Number)}function Ze(e){return e[Jt(e)]}function Jt(e){return Math.max(0,e.length-1)}function Sn(e,t){return t===Jt(e)}function Jn(e,t=0){return Array.from(Array(e),(r,o)=>t+o)}function Kt(e){return Object.keys(e)}function Pa(e,t){return[e,t].reduce((r,o)=>(Kt(o).forEach(s=>{const a=r[s],i=o[s],l=Zn(a)&&Zn(i);r[s]=l?Pa(a,i):i}),r),{})}function $r(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function zd(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 zr(e)?r[e](d):e(t,d,c)}return{measure:i}}function Xt(){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 $d(e,t,r,o){const s=Xt(),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 Bd(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=Ne(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 Ia(e,t,r){const{constrain:o}=bt(0,e),s=e+1;let a=i(t);function i(m){return r?Ne((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 Ia(e,l(),r)}const u={get:l,set:d,add:c,clone:p};return u}function Od(e,t,r,o,s,a,i,l,d,c,p,u,m,g,h,x,y,b,w){const{cross:j,direction:P}=e,_=["INPUT","SELECT","TEXTAREA"],M={passive:!1},S=Xt(),N=Xt(),L=bt(50,225).constrain(g.measure(20)),T={mouse:300,touch:400},B={mouse:500,touch:600},V=h?43:25;let z=!1,k=0,O=0,D=!1,A=!1,C=!1,K=!1;function G(X){if(!w)return;function H(ue){(vr(w)||w(X,ue))&&te(ue)}const ne=t;S.add(ne,"dragstart",ue=>ue.preventDefault(),M).add(ne,"touchmove",()=>{},M).add(ne,"touchend",()=>{}).add(ne,"touchstart",H).add(ne,"mousedown",H).add(ne,"touchcancel",Z).add(ne,"contextmenu",Z).add(ne,"click",ae,!0)}function W(){S.clear(),N.clear()}function ee(){const X=K?r:t;N.add(X,"touchmove",Y,M).add(X,"touchend",Z).add(X,"mousemove",Y,M).add(X,"mouseup",Z)}function E(X){const H=X.nodeName||"";return _.includes(H)}function F(){return(h?B:T)[K?"mouse":"touch"]}function U(X,H){const ne=u.add(Cn(X)*-1),ue=p.byDistance(X,!h).distance;return h||Ne(X)<L?ue:y&&H?ue*.5:p.byIndex(ne.get(),0).distance}function te(X){const H=$r(X,o);K=H,C=h&&H&&!X.buttons&&z,z=Ot(s.get(),i.get())>=2,!(H&&X.button!==0)&&(E(X.target)||(D=!0,a.pointerDown(X),c.useFriction(0).useDuration(0),s.set(i),ee(),k=a.readPoint(X),O=a.readPoint(X,j),m.emit("pointerDown")))}function Y(X){if(!$r(X,o)&&X.touches.length>=2)return Z(X);const ne=a.readPoint(X),ue=a.readPoint(X,j),we=Ot(ne,k),pe=Ot(ue,O);if(!A&&!K&&(!X.cancelable||(A=we>pe,!A)))return Z(X);const Le=a.pointerMove(X);we>x&&(C=!0),c.useFriction(.3).useDuration(.75),l.start(),s.add(P(Le)),X.preventDefault()}function Z(X){const ne=p.byDistance(0,!1).index!==u.get(),ue=a.pointerUp(X)*F(),we=U(P(ue),ne),pe=Fd(ue,we),Le=V-10*pe,fe=b+pe/50;A=!1,D=!1,N.clear(),c.useDuration(Le).useFriction(fe),d.distance(we,!h),K=!1,m.emit("pointerUp")}function ae(X){C&&(X.stopPropagation(),X.preventDefault(),C=!1)}function re(){return D}return{init:G,destroy:W,pointerDown:re}}function Hd(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($r(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&&Ne(x)>.1?x:0}return{pointerDown:l,pointerMove:d,pointerUp:c,readPoint:i}}function Gd(){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 qd(e){function t(o){return e*(o/100)}return{measure:t}}function Wd(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 P=j.target===e,_=o.indexOf(j.target),M=P?c:p[_],S=m(P?e:o[_]);if(Ne(S-M)>=.5){y.reInit(),t.emit("resize");break}}}d=new ResizeObserver(w=>{(vr(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 Ud(e,t,r,o,s,a){let i=0,l=0,d=s,c=a,p=e.get(),u=0;function m(){const M=o.get()-e.get(),S=!d;let N=0;return S?(i=0,r.set(o),e.set(o),N=M):(r.set(e),i+=M/d,i*=c,p+=i,e.add(i),N=p-u),l=Cn(N),u=p,_}function g(){const M=o.get()-t.get();return Ne(M)<.001}function h(){return d}function x(){return l}function y(){return i}function b(){return j(s)}function w(){return P(a)}function j(M){return d=M,_}function P(M){return c=M,_}const _={direction:x,duration:h,velocity:y,seek:m,settled:g,useBaseFriction:w,useBaseDuration:b,useFriction:P,useDuration:j};return _}function Kd(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=Ne(e[h]-t.get()),y=r.get()-t.get(),b=l.constrain(x/i);r.subtract(y*b),!g&&Ne(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 Xd(e,t,r,o,s){const a=bt(-t+e,0),i=u(),l=p(),d=m();function c(h,x){return Ot(h,x)<=1}function p(){const h=i[0],x=Ze(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,P=Sn(r,x);return j?b:P||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 Yd(e,t,r){const o=t[0],s=r?o-e:Ze(t);return{limit:bt(s,o)}}function Zd(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 Jd(e){const{max:t,length:r}=e;function o(a){const i=a-t;return r?i/-r:0}return{get:o}}function Qd(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=>Ze(x)[i]-x[0][a]).map(Ne)}function m(){return o.map(x=>r[a]-x[a]).map(x=>-Ne(x))}function g(){return l(c).map(x=>x[0]).map((x,y)=>x+d[y])}return{snaps:c,snapsAligned:p}}function eu(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=Sn(y,x);if(b){const j=Ze(y[0])+1;return Jn(j)}if(w){const j=Jt(a)-Ze(y)[0]+1;return Jn(j,Ze(y)[0])}return h})}return{slideRegistry:c}}function tu(e,t,r,o,s){const{reachedAny:a,removeOffset:i,constrain:l}=o;function d(h){return h.concat().sort((x,y)=>Ne(x)-Ne(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)=>Ne(w.diff)-Ne(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=>Cn(w)===x);return b.length?d(b):Ze(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 P=t[b]-w,_=h+p(P,0);return{index:b,distance:_}}return{byDistance:m,byIndex:u,shortcut:p}}function ru(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 nu(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));kn(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=>{(vr(l)||l(g,b))&&h(y)},d)})}function u(g){g.code==="Tab"&&(c=new Date().getTime())}return{init:p}}function zt(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 kn(d)?d:d.get()}return{get:r,set:o,add:s,subtract:a}}function La(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=Vd(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 ou(e,t,r,o,s,a,i,l,d){const p=Ut(s),u=Ut(s).reverse(),m=b().concat(w());function g(S,N){return S.reduce((L,T)=>L-s[T],N)}function h(S,N){return S.reduce((L,T)=>g(L,N)>0?L.concat([T]):L,[])}function x(S){return a.map((N,L)=>({start:N-o[L]+.5+S,end:N+t-.5+S}))}function y(S,N,L){const T=x(N);return S.map(B=>{const V=L?0:-r,z=L?r:0,k=L?"end":"start",O=T[B][k];return{index:B,loopPoint:O,slideLocation:zt(-1),translate:La(e,d[B]),target:()=>l.get()>O?V:z}})}function b(){const S=i[0],N=h(u,S);return y(N,r,!1)}function w(){const S=t-i[0]-1,N=h(p,S);return y(N,-r,!0)}function j(){return m.every(({index:S})=>{const N=p.filter(L=>L!==S);return g(N,t)<=.1})}function P(){m.forEach(S=>{const{target:N,translate:L,slideLocation:T}=S,B=N();B!==T.get()&&(L.to(B),T.set(B))})}function _(){m.forEach(S=>S.translate.clear())}return{canLoop:j,clear:_,loop:P,loopPoints:m}}function su(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||(vr(r)||r(d,p))&&c(p)}),o.observe(e,{childList:!0})}function i(){o&&o.disconnect(),s=!0}return{init:a,destroy:i}}function au(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 Kt(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 iu(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 Ne(t[l]-w[l])}function x(){if(!c)return 0;const w=a.getComputedStyle(Ze(o));return parseFloat(w.getPropertyValue(`margin-${d}`))}function y(){return r.map((w,j,P)=>{const _=!j,M=Sn(P,j);return _?m[j]+p:M?m[j]+u:P[j+1][l]-w[l]}).map(Ne)}return{slideSizes:m,slideSizesWithGaps:g,startGap:p,endGap:u}}function lu(e,t,r,o,s,a,i,l,d){const{startEdge:c,endEdge:p,direction:u}=e,m=kn(r);function g(b,w){return Ut(b).filter(j=>j%w===0).map(j=>b.slice(j,j+w))}function h(b){return b.length?Ut(b).reduce((w,j,P)=>{const _=Ze(w)||0,M=_===0,S=j===Jt(b),N=s[c]-a[_][c],L=s[c]-a[j][p],T=!o&&M?u(i):0,B=!o&&S?u(l):0,V=Ne(L-B-(N+T));return P&&V>t+d&&w.push(j),S&&w.push(b.length),w},[]).map((w,j,P)=>{const _=Math.max(P[j-1]||0);return b.slice(_,w)}):[]}function x(b){return m?g(b,r):h(b)}return{groupSlides:x}}function cu(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:P,watchDrag:_,watchFocus:M}=a,S=2,N=Gd(),L=N.measure(t),T=r.map(N.measure),B=Bd(d,c),V=B.measureSize(L),z=qd(V),k=zd(l,V),O=!u&&!!w,D=u||!!w,{slideSizes:A,slideSizesWithGaps:C,startGap:K,endGap:G}=iu(B,L,T,r,D,s),W=lu(B,V,y,u,L,T,K,G,S),{snaps:ee,snapsAligned:E}=Qd(B,k,L,T,W),F=-Ze(ee)+Ze(C),{snapsContained:U,scrollContainLimit:te}=Xd(V,F,E,w,S),Y=O?U:E,{limit:Z}=Yd(F,Y,u),ae=Ia(Jt(Y),p,u),re=ae.clone(),ie=Ut(r),X=({dragHandler:Te,scrollBody:nt,scrollBounds:Be,options:{loop:Ye}})=>{Ye||Be.constrain(Te.pointerDown()),nt.seek()},H=({scrollBody:Te,translate:nt,location:Be,offsetLocation:Ye,previousLocation:dt,scrollLooper:kt,slideLooper:Ct,dragHandler:Dt,animation:ut,eventHandler:Fe,scrollBounds:Et,options:{loop:mt}},ft)=>{const ot=Te.settled(),le=!Et.shouldConstrain(),je=mt?ot:ot&&le,Se=je&&!Dt.pointerDown();Se&&ut.stop();const De=Be.get()*ft+dt.get()*(1-ft);Ye.set(De),mt&&(kt.loop(Te.direction()),Ct.loop()),nt.to(Ye.get()),Se&&Fe.emit("settle"),je||Fe.emit("scroll")},ne=$d(o,s,()=>X(Ce),Te=>H(Ce,Te)),ue=.68,we=Y[ae.get()],pe=zt(we),Le=zt(we),fe=zt(we),Pe=zt(we),Ue=Ud(pe,fe,Le,Pe,m,ue),ye=tu(u,Y,F,Z,Pe),$e=ru(ne,ae,re,Ue,ye,Pe,i),Qe=Jd(Z),ct=Xt(),he=au(t,r,i,x),{slideRegistry:jt}=eu(O,w,Y,te,W,ie),Nt=nu(e,r,jt,$e,Ue,ct,i,M),Ce={ownerDocument:o,ownerWindow:s,eventHandler:i,containerRect:L,slideRects:T,animation:ne,axis:B,dragHandler:Od(B,e,o,s,Pe,Hd(B,s),pe,ne,$e,Ue,ye,ae,i,z,g,h,b,ue,_),eventStore:ct,percentOfView:z,index:ae,indexPrevious:re,limit:Z,location:pe,offsetLocation:fe,previousLocation:Le,options:a,resizeHandler:Wd(t,i,s,r,B,j,N),scrollBody:Ue,scrollBounds:Kd(Z,fe,Pe,Ue,z),scrollLooper:Zd(F,Z,fe,[pe,fe,Le,Pe]),scrollProgress:Qe,scrollSnapList:Y.map(Qe.get),scrollSnaps:Y,scrollTarget:ye,scrollTo:$e,slideLooper:ou(B,V,F,A,C,ee,Y,fe,r),slideFocus:Nt,slidesHandler:su(t,i,P),slidesInView:he,slideIndexes:ie,slideRegistry:jt,slidesToScroll:W,target:Pe,translate:La(B,t)};return Ce}function du(){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 uu={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 mu(e){function t(a,i){return Pa(a,i||{})}function r(a){const i=a.breakpoints||{},l=Kt(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=>Kt(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:o}}function fu(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 ur(e,t,r){const o=e.ownerDocument,s=o.defaultView,a=mu(s),i=fu(a),l=Xt(),d=du(),{mergeOptions:c,optionsAtMedia:p,optionsMediaQueries:u}=a,{on:m,off:g,emit:h}=d,x=B;let y=!1,b,w=c(uu,ur.globalOptions),j=c(w),P=[],_,M,S;function N(){const{container:ie,slides:X}=j;M=(zr(ie)?e.querySelector(ie):ie)||e.children[0];const ne=zr(X)?M.querySelectorAll(X):X;S=[].slice.call(ne||M.children)}function L(ie){const X=cu(e,M,S,o,s,ie,d);if(ie.loop&&!X.slideLooper.canLoop()){const H=Object.assign({},ie,{loop:!1});return L(H)}return X}function T(ie,X){y||(w=c(w,ie),j=p(w),P=X||P,N(),b=L(j),u([w,...P.map(({options:H})=>H)]).forEach(H=>l.add(H,"change",B)),j.active&&(b.translate.to(b.location.get()),b.animation.init(),b.slidesInView.init(),b.slideFocus.init(re),b.eventHandler.init(re),b.resizeHandler.init(re),b.slidesHandler.init(re),b.options.loop&&b.slideLooper.loop(),M.offsetParent&&S.length&&b.dragHandler.init(re),_=i.init(re,P)))}function B(ie,X){const H=W();V(),T(c({startIndex:H},ie),X),d.emit("reInit")}function V(){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 z(){y||(y=!0,l.clear(),V(),d.emit("destroy"),d.clear())}function k(ie,X,H){!j.active||y||(b.scrollBody.useBaseFriction().useDuration(X===!0?0:j.duration),b.scrollTo.index(ie,H||0))}function O(ie){const X=b.index.add(1).get();k(X,ie,-1)}function D(ie){const X=b.index.add(-1).get();k(X,ie,1)}function A(){return b.index.add(1).get()!==W()}function C(){return b.index.add(-1).get()!==W()}function K(){return b.scrollSnapList}function G(){return b.scrollProgress.get(b.offsetLocation.get())}function W(){return b.index.get()}function ee(){return b.indexPrevious.get()}function E(){return b.slidesInView.get()}function F(){return b.slidesInView.get(!1)}function U(){return _}function te(){return b}function Y(){return e}function Z(){return M}function ae(){return S}const re={canScrollNext:A,canScrollPrev:C,containerNode:Z,internalEngine:te,destroy:z,off:g,on:m,emit:h,plugins:U,previousScrollSnap:ee,reInit:x,rootNode:Y,scrollNext:O,scrollPrev:D,scrollProgress:G,scrollSnapList:K,scrollTo:k,selectedScrollSnap:W,slideNodes:ae,slidesInView:E,slidesNotInView:F};return T(t,r),setTimeout(()=>d.emit("init"),0),re}ur.globalOptions=void 0;function Rn(e={},t=[]){const r=$.useRef(e),o=$.useRef(t),[s,a]=$.useState(),[i,l]=$.useState(),d=$.useCallback(()=>{s&&s.reInit(r.current,o.current)},[s]);return $.useEffect(()=>{Nn(r.current,e)||(r.current=e,d())},[e,d]),$.useEffect(()=>{Ad(o.current,t)||(o.current=t,d())},[t,d]),$.useEffect(()=>{if(Ed()&&i){ur.globalOptions=Rn.globalOptions;const c=ur(i,r.current,o.current);return a(c),()=>c.destroy()}else a(void 0)},[i,a]),[l,s]}Rn.globalOptions=void 0;const Ta=f.createContext(null);function br(){const e=f.useContext(Ta);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const Da=f.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,plugins:o,className:s,children:a,...i},l)=>{const[d,c]=Rn({...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(Ta.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})})});Da.displayName="Carousel";const Ea=f.forwardRef(({className:e,...t},r)=>{const{carouselRef:o,orientation:s}=br();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})})});Ea.displayName="CarouselContent";const Aa=f.forwardRef(({className:e,...t},r)=>{const{orientation:o}=br();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})});Aa.displayName="CarouselItem";const Fa=f.forwardRef(({className:e,variant:t="outline",size:r="icon",...o},s)=>{const{orientation:a,scrollPrev:i,canScrollPrev:l}=br(),d=ce();return n.jsxs(_e,{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(I.ChevronLeft,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:d.carousel_previousSlide})]})});Fa.displayName="CarouselPrevious";const Va=f.forwardRef(({className:e,variant:t="outline",size:r="icon",...o},s)=>{const{orientation:a,scrollNext:i,canScrollNext:l}=br(),d=ce();return n.jsxs(_e,{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(I.ChevronRight,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:d.carousel_nextSlide})]})});Va.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
|
|
21
|
+
*/function at(e,t){return typeof e=="function"?e(t):e}function Xe(e,t){return r=>{t.setState(o=>({...o,[e]:at(r,o[e])}))}}function wr(e){return e instanceof Function}function gu(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function pu(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*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()))}/**
|
|
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 hu(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 xu(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 Ee="debugHeaders";function Qn(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 vu={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 or(t,[...l,...c,...d],e)},se(e.options,Ee,"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))),or(t,r,e,"center")),se(e.options,Ee,"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 or(t,a,e,"left")},se(e.options,Ee,"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 or(t,a,e,"right")},se(e.options,Ee,"getRightHeaderGroups")),e.getFooterGroups=oe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),se(e.options,Ee,"getFooterGroups")),e.getLeftFooterGroups=oe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),se(e.options,Ee,"getLeftFooterGroups")),e.getCenterFooterGroups=oe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),se(e.options,Ee,"getCenterFooterGroups")),e.getRightFooterGroups=oe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),se(e.options,Ee,"getRightFooterGroups")),e.getFlatHeaders=oe(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ee,"getFlatHeaders")),e.getLeftFlatHeaders=oe(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ee,"getLeftFlatHeaders")),e.getCenterFlatHeaders=oe(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ee,"getCenterFlatHeaders")),e.getRightFlatHeaders=oe(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),se(e.options,Ee,"getRightFlatHeaders")),e.getCenterLeafHeaders=oe(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),se(e.options,Ee,"getCenterLeafHeaders")),e.getLeftLeafHeaders=oe(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),se(e.options,Ee,"getLeftLeafHeaders")),e.getRightLeafHeaders=oe(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),se(e.options,Ee,"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,Ee,"getLeafHeaders"))}};function or(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,P=!1;if(w&&y.column.parent?j=y.column.parent:(j=y.column,P=!0),b&&(b==null?void 0:b.column)===j)b.subHeaders.push(y);else{const _=Qn(r,j,{id:[o,g,j.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:P,placeholderId:P?`${x.filter(M=>M.column===j).length}`:void 0,depth:g,index:x.length});_.subHeaders.push(y),x.push(_)}h.headers.push(y),y.headerGroup=h}),d.push(h),g>0&&c(x,g-1)},p=t.map((m,g)=>Qn(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:P,rowSpan:_}=j;x+=P,b.push(_)})):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 _n=(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:()=>pu(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=>hu(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},bu={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()}}},za=(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))};za.autoRemove=e=>Je(e);const $a=(e,t,r)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(r))};$a.autoRemove=e=>Je(e);const Ba=(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())};Ba.autoRemove=e=>Je(e);const Oa=(e,t,r)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)};Oa.autoRemove=e=>Je(e);const Ha=(e,t,r)=>!r.some(o=>{var s;return!((s=e.getValue(t))!=null&&s.includes(o))});Ha.autoRemove=e=>Je(e)||!(e!=null&&e.length);const Ga=(e,t,r)=>r.some(o=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(o)});Ga.autoRemove=e=>Je(e)||!(e!=null&&e.length);const qa=(e,t,r)=>e.getValue(t)===r;qa.autoRemove=e=>Je(e);const Wa=(e,t,r)=>e.getValue(t)==r;Wa.autoRemove=e=>Je(e);const Mn=(e,t,r)=>{let[o,s]=r;const a=e.getValue(t);return a>=o&&a<=s};Mn.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]};Mn.autoRemove=e=>Je(e)||Je(e[0])&&Je(e[1]);const rt={includesString:za,includesStringSensitive:$a,equalsString:Ba,arrIncludes:Oa,arrIncludesAll:Ha,arrIncludesSome:Ga,equals:qa,weakEquals:Wa,inNumberRange:Mn};function Je(e){return e==null||e===""}const wu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xe("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 wr(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=at(r,a?a.value:void 0);if(eo(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=at(t,s))==null?void 0:a.filter(i=>{const l=r.find(d=>d.id===i.id);if(l){const d=l.getFilterFn();if(eo(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 eo(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const yu=(e,t,r)=>r.reduce((o,s)=>{const a=s.getValue(e);return o+(typeof a=="number"?a:0)},0),ju=(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},Nu=(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},ku=(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]},Cu=(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},Su=(e,t)=>{if(!t.length)return;const r=t.map(a=>a.getValue(e));if(!gu(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},Ru=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),_u=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,Mu=(e,t)=>t.length,Sr={sum:yu,min:ju,max:Nu,extent:ku,mean:Cu,median:Su,unique:Ru,uniqueCount:_u,count:Mu},Pu={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:Xe("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 Sr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Sr.extent},e.getAggregationFn=()=>{var r,o;if(!e)throw new Error;return wr(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:Sr[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 Iu(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 Lu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=oe(r=>[Ht(t,r)],r=>r.findIndex(o=>o.id===e.id),se(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var o;return((o=Ht(t,r)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=r=>{var o;const s=Ht(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 Iu(a,r,o)},se(e.options,"debugTable","_getOrderColumnsFn"))}},Rr=()=>({left:[],right:[]}),Tu={getInitialState:e=>({columnPinning:Rr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xe("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?Rr():(r=(o=e.initialState)==null?void 0:o.columnPinning)!=null?r:Rr())},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 Du(e){return e||(typeof document<"u"?document:null)}const sr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},_r=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Eu={getDefaultColumnDef:()=>sr,getInitialState:e=>({columnSizing:{},columnSizingInfo:_r(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Xe("columnSizing",e),onColumnSizingInfoChange:Xe("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:sr.minSize,(o=a??e.columnDef.size)!=null?o:sr.size),(s=e.columnDef.maxSize)!=null?s:sr.maxSize)},e.getStart=oe(r=>[r,Ht(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,Ht(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(),Mr(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=Mr(a)?Math.round(a.touches[0].clientX):a.clientX,c={},p=(b,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(j=>{var P,_;const M=t.options.columnResizeDirection==="rtl"?-1:1,S=(w-((P=j==null?void 0:j.startOffset)!=null?P:0))*M,N=Math.max(S/((_=j==null?void 0:j.startSize)!=null?_:0),-.999999);return j.columnSizingStart.forEach(L=>{let[T,B]=L;c[T]=Math.round(Math.max(B+B*N,0)*100)/100}),{...j,deltaOffset:S,deltaPercentage:N}}),(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=Du(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=Au()?{passive:!1}:!1;Mr(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?_r():(r=e.initialState.columnSizingInfo)!=null?r:_r())},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 ar=null;function Au(){if(typeof ar=="boolean")return ar;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 ar=e,ar}function Mr(e){return e.type==="touchstart"}const Fu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xe("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 Ht(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Vu={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()}}},zu={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Xe("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 wr(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)}}},$u={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xe("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()}}}},Br=0,Or=10,Pr=()=>({pageIndex:Br,pageSize:Or}),Bu={getInitialState:e=>({...e,pagination:{...Pr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xe("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=>at(o,a);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=o=>{var s;e.setPagination(o?Pr():(s=e.initialState.pagination)!=null?s:Pr())},e.setPageIndex=o=>{e.setPagination(s=>{let a=at(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?Br:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?s:Br)},e.resetPageSize=o=>{var s,a;e.setPageSize(o?Or:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?s:Or)},e.setPageSize=o=>{e.setPagination(s=>{const a=Math.max(1,at(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=at(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}}},Ir=()=>({top:[],bottom:[]}),Ou={getInitialState:e=>({rowPinning:Ir(),...e}),getDefaultOptions:e=>({onRowPinningChange:Xe("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?Ir():(r=(o=e.initialState)==null?void 0:o.rowPinning)!=null?r:Ir())},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"))}},Hu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xe("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=>{Hr(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?Lr(e,r):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Lr(e,r):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Lr(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 Hr(l,e.id,r,(i=o==null?void 0:o.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return Pn(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Gr(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Gr(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)}}}},Hr=(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=>Hr(e,l.id,r,o,s))};function Lr(e,t){const r=e.getState().rowSelection,o=[],s={},a=function(i,l){return i.map(d=>{var c;const p=Pn(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 Pn(e,t){var r;return(r=t[e.id])!=null?r:!1}function Gr(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()&&(Pn(i,t)?a=!0:s=!1),i.subRows&&i.subRows.length)){const l=Gr(i,t);l==="all"?a=!0:(l==="some"&&(a=!0),s=!1)}}),s?"all":a?"some":!1}const qr=/([0-9]+)/gm,Gu=(e,t,r)=>Ua(it(e.getValue(r)).toLowerCase(),it(t.getValue(r)).toLowerCase()),qu=(e,t,r)=>Ua(it(e.getValue(r)),it(t.getValue(r))),Wu=(e,t,r)=>In(it(e.getValue(r)).toLowerCase(),it(t.getValue(r)).toLowerCase()),Uu=(e,t,r)=>In(it(e.getValue(r)),it(t.getValue(r))),Ku=(e,t,r)=>{const o=e.getValue(r),s=t.getValue(r);return o>s?1:o<s?-1:0},Xu=(e,t,r)=>In(e.getValue(r),t.getValue(r));function In(e,t){return e===t?0:e>t?1:-1}function it(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ua(e,t){const r=e.split(qr).filter(Boolean),o=t.split(qr).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 Ft={alphanumeric:Gu,alphanumericCaseSensitive:qu,text:Wu,textCaseSensitive:Uu,datetime:Ku,basic:Xu},Yu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xe("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 Ft.datetime;if(typeof a=="string"&&(o=!0,a.split(qr).length>1))return Ft.alphanumeric}return o?Ft.text:Ft.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 wr(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:Ft[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())}},Zu=[vu,Fu,Lu,Tu,bu,wu,Vu,zu,Yu,Pu,$u,Bu,Ou,Hu,Eu];function Ju(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...Zu,...(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=at(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=xu(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 Qu(){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=_n(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 em(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 tm(e,t,r){return r.options.filterFromLeafRows?rm(e,t,r):nm(e,t,r)}function rm(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=_n(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 nm(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=_n(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 om(){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 tm(t.rows,u,e)},se(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function sm(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=em({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 am(){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),P=u.getValue(h.id),_=j===void 0,M=P===void 0;if(_||M){if(y==="first")return _?-1:1;if(y==="last")return _?1:-1;w=_&&M?0:_?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,15 @@
|
|
|
30
30
|
* LICENSE.md file in the root directory of this source tree.
|
|
31
31
|
*
|
|
32
32
|
* @license MIT
|
|
33
|
-
*/function
|
|
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&&
|
|
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(`
|
|
33
|
+
*/function to(e,t){return e?im(e)?f.createElement(e,t):e:null}function im(e){return lm(e)||typeof e=="function"||cm(e)}function lm(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function cm(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function dm(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=f.useState(()=>({current:Ju(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 um({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=dm({data:t,columns:e,onSortingChange:d,onColumnFiltersChange:p,getCoreRowModel:Qu(),getPaginationRowModel:sm(),getSortedRowModel:am(),getFilteredRowModel:om(),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(lt,{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(an,{children:[n.jsx(ln,{children:x.getHeaderGroups().map(w=>n.jsx($t,{children:w.headers.map(j=>n.jsx(dn,{children:j.isPlaceholder?null:to(j.column.columnDef.header,j.getContext())},j.id))},w.id))}),n.jsx(cn,{children:(b=x.getRowModel().rows)!=null&&b.length?x.getRowModel().rows.map(w=>n.jsx($t,{"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(j=>n.jsx(cr,{children:to(j.column.columnDef.cell,j.getContext())},j.id))},w.id)):n.jsx($t,{children:n.jsx(cr,{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:Ge(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(_e,{variant:"outline",size:"sm",onClick:()=>x.previousPage(),disabled:!x.getCanPreviousPage(),children:[n.jsx(I.ChevronLeft,{className:"h-4 w-4"}),a.dataTable_previous]}),n.jsxs(_e,{variant:"outline",size:"sm",onClick:()=>x.nextPage(),disabled:!x.getCanNextPage(),children:[a.dataTable_next,n.jsx(I.ChevronRight,{className:"h-4 w-4"})]})]})]})]})}function mm({column:e,title:t,className:r}){return e.getCanSort()?n.jsxs(_e,{variant:"ghost",size:"sm",className:v("-ml-3 h-8",r),onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:[t,n.jsx(I.ArrowUpDown,{className:"ml-2 h-4 w-4"})]}):n.jsx("div",{className:v(r),children:t})}const fm=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"]),gm=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 pm(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&&gm.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 fm.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 hm={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 xm({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 pm(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:hm[g.type]},children:g.value},h))]},m))})]})}const Ka=Ae("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 vm({className:e,level:t=2,as:r,children:o,...s}){const a=r||`h${t}`;return n.jsx(a,{className:v(Ka({level:t}),e),...s,children:o})}const Xa=Ae("",{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 bm({className:e,size:t,weight:r,variant:o,leading:s,as:a="p",children:i,...l}){return n.jsx(a,{className:v(Xa({size:t,weight:r,variant:o,leading:s}),e),...l,children:i})}function wm({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 ym({className:e,...t}){return n.jsx("blockquote",{className:v("border-l-4 border-primary pl-4 italic text-muted-foreground",e),...t})}function jm({className:e,...t}){return n.jsx("p",{className:v("text-xl text-muted-foreground",e),...t})}function Nm({className:e,...t}){return n.jsx("p",{className:v("text-sm text-muted-foreground",e),...t})}const Ya=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(Kr.ResponsiveContainer,{width:"100%",height:"100%",children:t})}));Ya.displayName="ChartContainer";const km=Kr.Tooltip,Cm=Kr.Legend,Za=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex flex-col space-y-4",e),...t}));Za.displayName="Timeline";const Ja=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("relative flex gap-4 pb-4 last:pb-0",e),...t}));Ja.displayName="TimelineItem";const Qa=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}));Qa.displayName="TimelineIcon";const ei=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}));ei.displayName="TimelineConnector";const ti=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:v("flex-1 space-y-1 pt-1",e),...t}));ti.displayName="TimelineContent";const ri=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}));ri.displayName="AppShell";const ni=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})}));ni.displayName="Sidebar";const oi=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}));oi.displayName="Header";const si=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}));si.displayName="Main";function Sm({title:e,value:t,description:r,trend:o,trendLabel:s,icon:a,className:i,...l}){return n.jsxs(rn,{className:v("overflow-hidden",i),...l,children:[n.jsxs(nn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(on,{className:"text-sm font-medium text-muted-foreground",children:e}),a&&n.jsx("div",{className:"text-muted-foreground",children:a})]}),n.jsxs(sn,{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(I.TrendingUp,{className:"mr-1 h-3 w-3"}):o<0?n.jsx(I.TrendingDown,{className:"mr-1 h-3 w-3"}):n.jsx(I.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 ai=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(gr,{children:t}),n.jsxs("div",{className:"flex gap-2 relative",children:[n.jsx(lt,{ref:s,value:r,readOnly:!0,className:v("pr-10 font-mono text-sm",e),...o}),n.jsx(_e,{size:"icon",variant:"outline",className:"shrink-0",onClick:l,children:a?n.jsx(I.Check,{className:"h-4 w-4 text-green-500"}):n.jsx(I.Copy,{className:"h-4 w-4"})})]})]})});ai.displayName="CopyInput";const ii=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)}));ii.displayName="JsonViewer";const Rm=Ae("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 _m({className:e,status:t,dot:r=!0,children:o,...s}){return n.jsxs("div",{className:v(Rm({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 yr=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,P]=f.useState(!1),_=f.useRef(0),M=ce(),[S,N]=f.useState({width:0,height:0}),[L,T]=f.useState(null);f.useEffect(()=>{var O;const z=(O=y.current)==null?void 0:O.parentElement;if(!z)return;const k=new ResizeObserver(D=>{for(const A of D){const{width:C,height:K}=A.contentRect;N({width:C,height:K})}});return k.observe(z),()=>k.disconnect()},[]),f.useEffect(()=>{if(!e||r)return;P(!0);const z=new AudioContext;let k=!1;return fetch(e).then(O=>O.arrayBuffer()).then(O=>z.decodeAudioData(O)).then(O=>{if(k)return;const D=O.getChannelData(0),A=Math.floor(D.length/l),C=[];for(let G=0;G<l;G++){let W=0;for(let ee=0;ee<A;ee++)W+=Math.abs(D[G*A+ee]);C.push(W/A)}const K=Math.max(...C,.01);w(C.map(G=>G/K)),P(!1)}).catch(()=>{k||(T(M.audioWaveform_error),P(!1))}),()=>{k=!0,z.close()}},[e,l]),f.useEffect(()=>{if(t){const z=Math.max(...t,.01);w(t.map(k=>k/z))}},[t]),f.useEffect(()=>{if(!r)return;const z=new AudioContext,k=z.createMediaStreamSource(r),O=z.createAnalyser();O.fftSize=256,k.connect(O);const D=new Uint8Array(O.frequencyBinCount),A=()=>{O.getByteFrequencyData(D);const C=Math.floor(D.length/l),K=[];for(let G=0;G<l;G++)K.push(D[G*C]/255);w(K),_.current=requestAnimationFrame(A)};return _.current=requestAnimationFrame(A),()=>{cancelAnimationFrame(_.current),k.disconnect(),z.close()}},[r,l]),f.useEffect(()=>{const z=y.current;if(!z||b.length===0)return;const k=z.getContext("2d");if(!k)return;const O=window.devicePixelRatio||1,D=z.getBoundingClientRect();z.width=D.width*O,z.height=D.height*O,k.scale(O,O),k.clearRect(0,0,D.width,D.height);const A=getComputedStyle(z),C=A.getPropertyValue("--muted-foreground").trim(),K=A.getPropertyValue("--primary").trim(),G=o||(C?`hsl(${C})`:"#888"),W=s||(K?`hsl(${K})`:"#7c3aed"),ee=d+c,E=Math.max(0,(D.width-b.length*ee)/2);for(let F=0;F<b.length;F++){const U=Math.max(2,b[F]*(u?D.height/2:D.height*.9)),te=E+F*ee,Y=F/b.length<=a;if(k.fillStyle=Y?W:G,u){const Z=D.height/2-U;Tr(k,te,Z,d,U,p),k.fill(),Tr(k,te,D.height/2,d,U,p),k.fill()}else{const Z=D.height-U;Tr(k,te,Z,d,U,p),k.fill()}}},[b,a,o,s,d,c,p,u,i,S]);const B=z=>{if(!m||!y.current)return;const k=y.current.getBoundingClientRect(),O=(z.clientX-k.left)/k.width;m(Math.max(0,Math.min(1,O)))},V=z=>{if(!m)return;const k=z.shiftKey?.1:.02;z.key==="ArrowRight"?(z.preventDefault(),m(Math.min(1,a+k))):z.key==="ArrowLeft"&&(z.preventDefault(),m(Math.max(0,a-k)))};return n.jsxs("div",{ref:x,className:v("relative w-full",g),role:"img","aria-label":M.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((z,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:B,onKeyDown:V,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}),L&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:L})]})});yr.displayName="AudioWaveform";function Tr(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 li=Ae("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"}}),Mm={sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"},jr=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),P=f.useRef(!1),[_,M]=f.useState(!1),[S,N]=f.useState(0),[L,T]=f.useState(0),[B,V]=f.useState(0),[z,k]=f.useState(i),[O,D]=f.useState(!1),[A,C]=f.useState(!0),[K,G]=f.useState(null),W=ce(),ee=Mm[u??"default"];f.useEffect(()=>{const H=w.current;if(!H)return;const ne=()=>{T(H.duration),C(!1)},ue=()=>C(!0),we=()=>C(!1),pe=()=>{P.current||(N(H.currentTime),x==null||x(H.currentTime)),H.buffered.length>0&&V(H.buffered.end(H.buffered.length-1))},Le=()=>{M(!0),m==null||m()},fe=()=>{M(!1),g==null||g()},Pe=()=>{M(!1),h==null||h()},Ue=()=>{M(!1),C(!1),G(W.audioPlayer_error)};return H.addEventListener("loadedmetadata",ne),H.addEventListener("waiting",ue),H.addEventListener("canplay",we),H.addEventListener("timeupdate",pe),H.addEventListener("play",Le),H.addEventListener("pause",fe),H.addEventListener("ended",Pe),H.addEventListener("error",Ue),()=>{H.removeEventListener("loadedmetadata",ne),H.removeEventListener("waiting",ue),H.removeEventListener("canplay",we),H.removeEventListener("timeupdate",pe),H.removeEventListener("play",Le),H.removeEventListener("pause",fe),H.removeEventListener("ended",Pe),H.removeEventListener("error",Ue)}},[m,g,h,x,W.audioPlayer_error]),f.useEffect(()=>{const H=w.current;H&&(H.volume=O?0:z)},[z,O]),f.useEffect(()=>{G(null),N(0),T(0),V(0),C(!0)},[e]);const E=()=>{const H=w.current;H&&(_?H.pause():H.play())},F=f.useCallback(H=>{const ne=w.current;!ne||!L||(ne.currentTime=H*L,N(ne.currentTime))},[L]),U=H=>{if(!j.current)return;const ne=j.current.getBoundingClientRect();F((H.clientX-ne.left)/ne.width)},te=H=>{var ne,ue;P.current=!0,(ue=(ne=H.target).setPointerCapture)==null||ue.call(ne,H.pointerId)};f.useEffect(()=>{const H=j.current;if(!H)return;const ne=we=>{if(!P.current||!j.current)return;const pe=j.current.getBoundingClientRect(),Le=Math.max(0,Math.min(1,(we.clientX-pe.left)/pe.width));F(Le)},ue=()=>{P.current=!1};return H.addEventListener("pointermove",ne),H.addEventListener("pointerup",ue),H.addEventListener("lostpointercapture",ue),()=>{H.removeEventListener("pointermove",ne),H.removeEventListener("pointerup",ue),H.removeEventListener("lostpointercapture",ue)}},[F]);const Y=H=>{if(!w.current||!L)return;const ne=H.shiftKey?10:5;H.key==="ArrowLeft"?(H.preventDefault(),w.current.currentTime=Math.max(0,S-ne)):H.key==="ArrowRight"&&(H.preventDefault(),w.current.currentTime=Math.min(L,S+ne))},Z=H=>{H.key==="ArrowUp"||H.key==="+"?(H.preventDefault(),k(ne=>Math.min(1,ne+.1)),D(!1)):(H.key==="ArrowDown"||H.key==="-")&&(H.preventDefault(),k(ne=>Math.max(0,ne-.1)))},ae=()=>D(H=>!H),re=O||z===0?I.VolumeX:z<.5?I.Volume1:I.Volume2,ie=L?S/L:0,X=L?B/L:0;return n.jsxs("div",{ref:b,className:v(li({variant:p,size:u}),y),children:[n.jsx("audio",{ref:w,src:e,autoPlay:l,loop:d,preload:c}),K&&n.jsx("div",{className:"flex-1 text-sm text-destructive",children:K}),!K&&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:E,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":_?W.audioPlayer_pause:W.audioPlayer_play,children:A&&_?n.jsx(I.Loader2,{className:v(ee,"animate-spin")}):_?n.jsx(I.Pause,{className:ee}):n.jsx(I.Play,{className:v(ee,"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(yr,{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:te,onKeyDown:Y,role:"slider","aria-label":W.audioPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(L),"aria-valuenow":Math.round(S),"aria-valuetext":Ke(S),tabIndex:0,children:[n.jsx("div",{className:"absolute inset-y-0 left-0 bg-muted-foreground/30 rounded-full",style:{width:`${X*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(S)}),n.jsx("span",{children:Ke(L)})]})]}),a&&n.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 group/volume [&:focus-within>input]:opacity-100",onKeyDown:Z,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":O?W.audioPlayer_unmute:W.audioPlayer_mute,children:n.jsx(re,{className:ee})}),n.jsx("input",{type:"range",min:0,max:1,step:.01,value:O?0:z,onChange:H=>{k(Number(H.target.value)),D(!1)},className:"w-16 h-1 accent-primary cursor-pointer","aria-label":W.audioPlayer_volume})]})]})]})});jr.displayName="AudioPlayer";const ci=Ae("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"}}),di=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),P=f.useRef([]),_=f.useRef(null),M=f.useRef(null),S=f.useRef(null),N=ce(),L=f.useCallback(()=>{_.current&&(clearInterval(_.current),_.current=null),M.current&&(M.current.getTracks().forEach(A=>A.stop()),M.current=null,y(null)),S.current&&(URL.revokeObjectURL(S.current),S.current=null)},[]);f.useEffect(()=>L,[L]);const T=()=>{_.current=setInterval(()=>{m(A=>{const C=A+1;return t&&C>=t&&z(),C})},1e3)},B=()=>{_.current&&(clearInterval(_.current),_.current=null)},V=async()=>{w(null);try{const A=await navigator.mediaDevices.getUserMedia({audio:!0});y(A),M.current=A,m(0),g&&(URL.revokeObjectURL(g),h(null),S.current=null);const C=MediaRecorder.isTypeSupported(e)?e:"",K=new MediaRecorder(A,C?{mimeType:C}:void 0);K.ondataavailable=G=>{G.data.size>0&&P.current.push(G.data)},K.onstop=()=>{const G=new Blob(P.current,{type:C||"audio/webm"}),W=URL.createObjectURL(G);h(W),S.current=W,s==null||s(G),A.getTracks().forEach(ee=>ee.stop()),y(null),M.current=null},K.onerror=()=>{w(N.audioRecorder_error),L(),p("idle")},j.current=K,P.current=[],K.start(100),p("recording"),T(),a==null||a()}catch(A){const C=A instanceof Error?A:new Error(String(A));C.name==="NotAllowedError"||C.name==="PermissionDeniedError"?w(N.audioRecorder_permissionDenied):w(N.audioRecorder_error),i==null||i(C)}},z=()=>{j.current&&j.current.state!=="inactive"&&j.current.stop(),B(),p("stopped")},k=()=>{j.current&&j.current.state==="recording"&&(j.current.pause(),B(),p("paused"))},O=()=>{j.current&&j.current.state==="paused"&&(j.current.resume(),T(),p("recording"))},D=()=>{L(),m(0),h(null),S.current=null,w(null),p("idle")};return n.jsxs("div",{ref:d,className:v(ci({size:o}),l),children:[b&&n.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[n.jsx(I.AlertCircle,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{children:b}),n.jsx("button",{type:"button",onClick:D,className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(I.RotateCcw,{className:"h-4 w-4"})})]}),!b&&c==="stopped"&&g?n.jsxs("div",{className:"space-y-3",children:[n.jsx(jr,{src:g,size:"sm"}),n.jsxs("button",{type:"button",onClick:D,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n.jsx(I.RotateCcw,{className:"h-4 w-4"}),N.audioRecorder_reRecord]})]}):b?null:n.jsxs(n.Fragment,{children:[r&&x&&c==="recording"&&n.jsx(yr,{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:V,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":N.audioRecorder_startRecording,children:[n.jsx(I.Mic,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm",children:N.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":N.audioRecorder_pauseRecording,children:n.jsx(I.Pause,{className:"h-5 w-5"})}):n.jsx("button",{type:"button",onClick:O,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":N.audioRecorder_resumeRecording,children:n.jsx(I.Play,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:z,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":N.audioRecorder_stopRecording,children:n.jsx(I.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)}%`}})})]})]})});di.displayName="AudioRecorder";const Wr=Ae("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"}}),ui=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),[P,_]=f.useState(null),M=f.useRef(null),S=ce();f.useEffect(()=>{if(h){const C=Array.from({length:e.length},(G,W)=>W);for(let G=C.length-1;G>0;G--){const W=Math.floor(Math.random()*(G+1));[C[G],C[W]]=[C[W],C[G]]}b(C);const K=new Map;C.forEach((G,W)=>K.set(G,W)),j(K)}},[h,e.length]);const N=f.useCallback((C,K=1)=>{if(h){const ee=(w.get(C)??-1)+K;return ee>=0&&ee<y.length?y[ee]:m==="all"?K===1?y[0]:y[y.length-1]:null}const G=C+K;return G>=0&&G<e.length?G:m==="all"?K===1?0:e.length-1:null},[h,y,w,e.length,m]),L=C=>{u(C),i==null||i(e[C],C)},T=()=>{if(m==="one")return;const C=N(p,1);C!==null&&L(C)},B=()=>{const C=N(p,-1);C!==null&&L(C)},V=()=>{const C=N(p,1);C!==null&&L(C)},z=()=>{g(C=>C==="none"?"all":C==="all"?"one":"none")},k=m==="none"?S.audioPlaylist_repeatOff:m==="all"?S.audioPlaylist_repeatAll:S.audioPlaylist_repeatOne,O=C=>{C.key==="ArrowDown"?(C.preventDefault(),_(K=>{const G=K===null?0:Math.min(K+1,e.length-1);return D(G),G})):C.key==="ArrowUp"?(C.preventDefault(),_(K=>{const G=K===null?e.length-1:Math.max(K-1,0);return D(G),G})):C.key==="Enter"||C.key===" "?(C.preventDefault(),P!==null&&L(P)):C.key==="Home"?(C.preventDefault(),_(0),D(0)):C.key==="End"&&(C.preventDefault(),_(e.length-1),D(e.length-1))},D=C=>{const K=M.current;if(!K)return;const G=K.children[C];G==null||G.scrollIntoView({block:"nearest"})},A=e[p];return A?n.jsxs("div",{ref:c,className:v(Wr({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(C=>!C),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":S.audioPlaylist_shuffle,"aria-pressed":h,children:n.jsx(I.Shuffle,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:B,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":S.audioPlaylist_previousTrack,children:n.jsx(I.SkipBack,{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":S.audioPlaylist_nextTrack,children:n.jsx(I.SkipForward,{className:"h-4 w-4"})}),n.jsx("button",{type:"button",onClick:z,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(I.Repeat1,{className:"h-4 w-4"}):n.jsx(I.Repeat,{className:"h-4 w-4"})})]}),n.jsx(jr,{src:A.src,title:A.title,artist:A.artist,albumArt:A.albumArt,showWaveform:t,autoPlay:s||p>0,loop:m==="one",onEnded:T,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"},A.id)]}),n.jsx(pr,{className:"max-h-64",children:n.jsx("div",{ref:M,role:"listbox","aria-label":S.audioPlaylist_shuffle,tabIndex:0,onKeyDown:O,onBlur:()=>_(null),className:"divide-y focus-visible:outline-none",children:e.map((C,K)=>n.jsxs("button",{type:"button",role:"option","aria-selected":K===p,onClick:()=>L(K),className:v("w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-accent/50 transition-colors",K===p&&"bg-accent",P===K&&"ring-2 ring-inset ring-ring"),children:[C.albumArt?n.jsx("img",{src:C.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:K===p?n.jsx(I.Volume2,{className:"h-4 w-4 text-primary"}):n.jsx(I.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",K===p&&"text-primary"),children:C.title}),C.artist&&n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.artist})]}),C.duration!==void 0&&n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:Ke(C.duration)})]},C.id))})}),e.length>1&&n.jsx("div",{className:"px-3 py-1.5 border-t text-xs text-muted-foreground text-center",children:Ge(S.audioPlaylist_trackOf,{current:String(p+1),total:String(e.length)})})]}):n.jsx("div",{ref:c,className:v(Wr({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(I.Music,{className:"h-8 w-8"}),n.jsx("p",{className:"text-sm",children:S.audioPlaylist_empty})]})})});ui.displayName="AudioPlaylist";const mi=Ae("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"}}),Qt=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,chapters:c,aspectRatio:p="16/9",autoPlay:u=!1,loop:m=!1,muted:g=!1,preload:h="metadata",size:x,onPlay:y,onPause:b,onEnded:w,onTimeUpdate:j,onFullscreenChange:P,className:_},M)=>{const S=f.useRef(null),N=f.useRef(null),L=f.useRef(null),T=f.useRef(null),B=f.useRef(!1),[V,z]=f.useState(!1),[k,O]=f.useState(0),[D,A]=f.useState(0),[C,K]=f.useState(0),[G,W]=f.useState(1),[ee,E]=f.useState(g),[F,U]=f.useState(!1),[te,Y]=f.useState(!0),[Z,ae]=f.useState(!1),[re,ie]=f.useState(!1),[X,H]=f.useState(!1),[ne,ue]=f.useState(1),[we,pe]=f.useState(-1),[Le,fe]=f.useState(!0),[Pe,Ue]=f.useState(null),[ye,$e]=f.useState(null),[Qe,ct]=f.useState(null),he=ce(),jt=f.useMemo(()=>R=>{N.current=R,typeof M=="function"?M(R):M&&(M.current=R)},[M]),Nt=typeof document<"u"&&"pictureInPictureEnabled"in document,Ce=f.useMemo(()=>c?[...c].sort((R,q)=>R.time-q.time):[],[c]),Te=f.useMemo(()=>{if(Ce.length===0)return null;let R=Ce[0];for(const q of Ce)if(q.time<=k)R=q;else break;return R},[Ce,k]),nt=f.useCallback(R=>{if(Ce.length===0)return null;let q=Ce[0];for(const me of Ce)if(me.time<=R)q=me;else break;return q},[Ce]);f.useEffect(()=>{if(d){const R=d.findIndex(q=>q.default);R>=0&&pe(R)}},[d]),f.useEffect(()=>{const R=N.current;if(!R)return;const q=()=>{A(R.duration),fe(!1)},me=()=>fe(!0),Ve=()=>fe(!1),Rt=()=>{B.current||(O(R.currentTime),j==null||j(R.currentTime)),R.buffered.length>0&&K(R.buffered.end(R.buffered.length-1))},Dn=()=>{z(!0),y==null||y()},En=()=>{z(!1),b==null||b()},An=()=>{z(!1),w==null||w()},Fn=()=>{z(!1),fe(!1),Ue(he.videoPlayer_error)};return R.addEventListener("loadedmetadata",q),R.addEventListener("waiting",me),R.addEventListener("canplay",Ve),R.addEventListener("timeupdate",Rt),R.addEventListener("play",Dn),R.addEventListener("pause",En),R.addEventListener("ended",An),R.addEventListener("error",Fn),()=>{R.removeEventListener("loadedmetadata",q),R.removeEventListener("waiting",me),R.removeEventListener("canplay",Ve),R.removeEventListener("timeupdate",Rt),R.removeEventListener("play",Dn),R.removeEventListener("pause",En),R.removeEventListener("ended",An),R.removeEventListener("error",Fn)}},[y,b,w,j,he.videoPlayer_error]),f.useEffect(()=>{const R=N.current;R&&(R.volume=ee?0:G)},[G,ee]),f.useEffect(()=>{Ue(null),O(0),A(0),K(0),fe(!0)},[e]),f.useEffect(()=>{const R=()=>{const q=!!document.fullscreenElement;U(q),P==null||P(q)};return document.addEventListener("fullscreenchange",R),()=>document.removeEventListener("fullscreenchange",R)},[P]),f.useEffect(()=>{const R=N.current;if(R)for(let q=0;q<R.textTracks.length;q++)R.textTracks[q].mode=q===we?"showing":"hidden"},[we]),f.useEffect(()=>{if(!Z&&!re&&!X)return;const R=()=>{ae(!1),ie(!1),H(!1)},q=setTimeout(()=>{document.addEventListener("click",R,{once:!0})},0);return()=>{clearTimeout(q),document.removeEventListener("click",R)}},[Z,re,X]);const Be=f.useCallback(()=>{Y(!0),T.current&&clearTimeout(T.current),V&&(T.current=setTimeout(()=>Y(!1),o))},[V,o]),Ye=()=>{const R=N.current;R&&(V?R.pause():R.play())},dt=f.useCallback(R=>{const q=N.current;!q||!D||(q.currentTime=R*D,O(q.currentTime))},[D]),kt=R=>{if(!L.current)return;const q=L.current.getBoundingClientRect();dt((R.clientX-q.left)/q.width)},Ct=R=>{var q,me;B.current=!0,(me=(q=R.target).setPointerCapture)==null||me.call(q,R.pointerId)},Dt=R=>{if(!L.current||!D)return;const q=L.current.getBoundingClientRect(),me=Math.max(0,Math.min(1,(R.clientX-q.left)/q.width));ct({x:R.clientX-q.left,time:me*D})},ut=()=>{ct(null)};f.useEffect(()=>{const R=L.current;if(!R)return;const q=Ve=>{if(!B.current||!L.current)return;const Rt=L.current.getBoundingClientRect();dt(Math.max(0,Math.min(1,(Ve.clientX-Rt.left)/Rt.width)))},me=()=>{B.current=!1};return R.addEventListener("pointermove",q),R.addEventListener("pointerup",me),R.addEventListener("lostpointercapture",me),()=>{R.removeEventListener("pointermove",q),R.removeEventListener("pointerup",me),R.removeEventListener("lostpointercapture",me)}},[dt]);const Fe=()=>{var R,q;S.current&&(document.fullscreenElement?document.exitFullscreen():(q=(R=S.current).requestFullscreen)==null||q.call(R))},Et=async()=>{const R=N.current;if(R)try{document.pictureInPictureElement?await document.exitPictureInPicture():await R.requestPictureInPicture()}catch{}},mt=()=>E(R=>!R),ft=R=>{const q=N.current;q&&(q.playbackRate=R),ue(R),ae(!1)},ot=R=>{pe(R),ie(!1)},le=f.useCallback(R=>{const q=N.current;q&&(q.currentTime=Math.max(0,Math.min(q.duration||0,q.currentTime+R)),O(q.currentTime))},[]),je=R=>{const q=S.current;if(!q)return;const me=q.getBoundingClientRect(),Ve=(R.clientX-me.left)/me.width;Ve<.3?(le(-10),$e({side:"left",key:Date.now()})):Ve>.7?(le(10),$e({side:"right",key:Date.now()})):Fe()};f.useEffect(()=>{if(!ye)return;const R=setTimeout(()=>$e(null),600);return()=>clearTimeout(R)},[ye]);const Se=R=>{if(N.current){switch(R.key){case" ":case"k":R.preventDefault(),Ye();break;case"f":R.preventDefault(),Fe();break;case"m":R.preventDefault(),mt();break;case"ArrowLeft":R.preventDefault(),le(-5);break;case"ArrowRight":R.preventDefault(),le(5);break;case"ArrowUp":R.preventDefault(),W(me=>Math.min(1,me+.1)),E(!1);break;case"ArrowDown":R.preventDefault(),W(me=>Math.max(0,me-.1));break;case"c":R.preventDefault(),d&&d.length>0&&pe(me=>me>=0?-1:0);break}Be()}},De=R=>{const q=N.current;q&&(q.currentTime=R.time,O(R.time),H(!1),Be())},St=ee||G===0?I.VolumeX:G<.5?I.Volume1:I.Volume2,Re=D?k/D:0,Oe=D?C/D:0,gt=Qe?nt(Qe.time):null;return n.jsxs("div",{ref:S,className:v(mi({size:x}),_),style:{aspectRatio:p},onMouseMove:Be,onMouseLeave:()=>V&&Y(!1),onKeyDown:Se,tabIndex:0,role:"application","aria-label":he.videoPlayer_label,children:[n.jsx("video",{ref:jt,src:e,poster:t,autoPlay:u,loop:m,muted:g,preload:h,className:"w-full h-full object-contain",onClick:Ye,onDoubleClick:je,children:d==null?void 0:d.map((R,q)=>n.jsx("track",{src:R.src,kind:R.kind,srcLang:R.srcLang,label:R.label,default:R.default},q))}),ye&&n.jsx("div",{className:v("absolute top-0 bottom-0 z-20 flex items-center justify-center pointer-events-none animate-[vp-skip-fade_0.6s_ease-out_forwards]",ye.side==="left"?"left-0 w-[30%] rounded-r-[50%]":"right-0 w-[30%] rounded-l-[50%]"),style:{background:"radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%)"},children:n.jsxs("div",{className:"flex flex-col items-center gap-1 text-white drop-shadow-lg",children:[ye.side==="left"?n.jsx(I.ChevronsLeft,{className:"h-8 w-8"}):n.jsx(I.ChevronsRight,{className:"h-8 w-8"}),n.jsx("span",{className:"text-sm font-medium",children:"10s"})]})},ye.key),Pe&&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(I.AlertCircle,{className:"h-10 w-10 text-destructive"}),n.jsx("p",{className:"text-sm text-destructive font-medium",children:Pe})]}),Le&&!Pe&&V&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:n.jsx(I.Loader2,{className:"h-10 w-10 text-primary animate-spin"})}),!V&&!Pe&&r&&n.jsx("button",{type:"button",onClick:Ye,className:"absolute inset-0 flex items-center justify-center z-10","aria-label":he.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(I.Play,{className:"h-8 w-8 text-foreground dark:text-white ml-1"})})}),r&&!Pe&&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",te||!V?"opacity-100":"opacity-0 pointer-events-none"),children:[Te&&Ce.length>0&&n.jsx("div",{className:"text-xs text-foreground/80 dark:text-white/80 mb-1 truncate",children:Te.title}),n.jsxs("div",{ref:L,className:"relative h-1 bg-foreground/20 dark:bg-white/20 rounded-full cursor-pointer mb-2 group/seek hover:h-1.5 transition-all",onClick:kt,onPointerDown:Ct,onMouseMove:Dt,onMouseLeave:ut,role:"slider","aria-label":he.videoPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(D),"aria-valuenow":Math.round(k),"aria-valuetext":Ke(k),tabIndex:0,children:[n.jsx("div",{className:"absolute inset-y-0 left-0 bg-muted-foreground/30 rounded-full",style:{width:`${Oe*100}%`}}),n.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full",style:{width:`${Re*100}%`}}),Ce.length>0&&D>0&&Ce.map((R,q)=>n.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-0.5 h-full bg-foreground/60 dark:bg-white/60 rounded-full z-[1]",style:{left:`${R.time/D*100}%`}},q)),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:`${Re*100}%`,transform:"translate(-50%, -50%)"}}),Qe&&D>0&&n.jsxs("div",{className:"absolute bottom-full mb-2 -translate-x-1/2 bg-popover text-popover-foreground border rounded px-2 py-1 text-xs whitespace-nowrap shadow-md pointer-events-none z-30",style:{left:Qe.x},children:[n.jsx("div",{className:"font-medium tabular-nums",children:Ke(Qe.time)}),gt&&n.jsx("div",{className:"text-muted-foreground text-[10px]",children:gt.title})]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-foreground dark:text-white",children:[n.jsx("button",{type:"button",onClick:Ye,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":V?he.videoPlayer_pause:he.videoPlayer_play,children:V?n.jsx(I.Pause,{className:"vp-icon h-5 w-5"}):n.jsx(I.Play,{className:"vp-icon h-5 w-5"})}),n.jsxs("span",{className:"vp-time text-xs tabular-nums",children:[Ke(k)," / ",Ke(D)]}),n.jsx("div",{className:"flex-1"}),Ce.length>0&&n.jsxs("div",{className:"relative",children:[n.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),H(q=>!q),ae(!1),ie(!1)},className:"px-1.5 py-0.5 text-xs hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":he.videoPlayer_chapter,children:he.videoPlayer_chapter}),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-[180px] max-h-[240px] overflow-y-auto",onClick:R=>R.stopPropagation(),children:Ce.map((R,q)=>{const me=Te===R;return n.jsxs("button",{type:"button",onClick:()=>De(R),className:v("flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent transition-colors",me&&"text-primary"),children:[n.jsx("span",{className:"tabular-nums text-muted-foreground shrink-0 w-10",children:Ke(R.time)}),n.jsx("span",{className:"truncate",children:R.title})]},q)})})]}),n.jsxs("div",{className:"flex items-center gap-1 group/vol",children:[n.jsx("button",{type:"button",onClick:mt,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":ee?he.videoPlayer_unmute:he.videoPlayer_mute,children:n.jsx(St,{className:"vp-icon h-5 w-5"})}),n.jsx("input",{type:"range",min:0,max:1,step:.01,value:ee?0:G,onChange:R=>{W(Number(R.target.value)),E(!1)},className:"w-16 h-1 accent-primary cursor-pointer","aria-label":he.videoPlayer_volume})]}),i&&n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:R=>{R.stopPropagation(),ae(q=>!q),ie(!1),H(!1)},className:"px-1.5 py-0.5 text-xs hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":he.videoPlayer_playbackSpeed,children:[ne,"x"]}),Z&&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:R=>R.stopPropagation(),children:l.map(R=>n.jsxs("button",{type:"button",onClick:()=>ft(R),className:v("block w-full px-3 py-1 text-xs text-left hover:bg-accent transition-colors",R===ne&&"text-primary"),children:[R,"x"]},R))})]}),d&&d.length>0&&n.jsxs("div",{className:"relative",children:[n.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),ie(q=>!q),ae(!1),H(!1)},className:v("p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors",we>=0&&"text-primary"),"aria-label":he.videoPlayer_subtitles,children:n.jsx(I.Subtitles,{className:"vp-icon h-5 w-5"})}),re&&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:R=>R.stopPropagation(),children:[n.jsx("button",{type:"button",onClick:()=>ot(-1),className:v("block w-full px-3 py-1 text-xs text-left hover:bg-accent transition-colors",we===-1&&"text-primary"),children:he.videoPlayer_subtitlesOff}),d.map((R,q)=>n.jsx("button",{type:"button",onClick:()=>ot(q),className:v("block w-full px-3 py-1 text-xs text-left hover:bg-accent transition-colors",q===we&&"text-primary"),children:R.label},q))]})]}),s&&Nt&&n.jsx("button",{type:"button",onClick:Et,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":he.videoPlayer_pictureInPicture,children:n.jsx(I.PictureInPicture2,{className:"vp-icon h-5 w-5"})}),a&&n.jsx("button",{type:"button",onClick:Fe,className:"p-1 hover:bg-foreground/10 dark:hover:bg-white/10 rounded transition-colors","aria-label":F?he.videoPlayer_exitFullscreen:he.videoPlayer_fullscreen,children:F?n.jsx(I.Minimize,{className:"vp-icon h-5 w-5"}):n.jsx(I.Maximize,{className:"vp-icon h-5 w-5"})})]})]}),n.jsx("style",{children:`
|
|
36
|
+
@keyframes vp-skip-fade {
|
|
37
|
+
0% { opacity: 0; }
|
|
38
|
+
30% { opacity: 1; }
|
|
39
|
+
100% { opacity: 0; }
|
|
40
|
+
}
|
|
41
|
+
`})]})});Qt.displayName="VideoPlayer";const fi=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),[P,_]=f.useState(null),M=f.useRef(null),S=f.useRef(null),N=f.useRef([]),L=f.useRef(null),T=f.useRef(null),B=f.useRef(null),V=ce(),z=i!==void 0?i:e==="camera",k=f.useCallback(()=>{L.current&&(clearInterval(L.current),L.current=null),T.current&&(T.current.getTracks().forEach(E=>E.stop()),T.current=null,j(null)),B.current&&(URL.revokeObjectURL(B.current),B.current=null)},[]);f.useEffect(()=>k,[k]);const O=()=>{L.current=setInterval(()=>{x(E=>{const F=E+1;return s&&F>=s&&K(),F})},1e3)},D=()=>{L.current&&(clearInterval(L.current),L.current=null)},A=async()=>{_(null);try{let E;e==="screen"?E=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!!r}):E=await navigator.mediaDevices.getUserMedia({video:t||!0,audio:r}),E.getVideoTracks().forEach(F=>{F.addEventListener("ended",()=>{k(),g("idle")})}),j(E),T.current=E,g("preview"),M.current&&(M.current.srcObject=E)}catch(E){const F=E instanceof Error?E:new Error(String(E));F.name==="NotAllowedError"||F.name==="PermissionDeniedError"?_(V.videoRecorder_permissionDenied):_(V.videoRecorder_error),c==null||c(F)}};f.useEffect(()=>{M.current&&w&&(m==="preview"||m==="recording"||m==="paused")&&(M.current.srcObject=w)},[w,m]);const C=()=>{if(!w)return;N.current=[],x(0),y&&(URL.revokeObjectURL(y),b(null),B.current=null);const E=MediaRecorder.isTypeSupported(o)?o:"",F=new MediaRecorder(w,E?{mimeType:E}:void 0);F.ondataavailable=U=>{U.data.size>0&&N.current.push(U.data)},F.onstop=()=>{const U=new Blob(N.current,{type:E||"video/webm"}),te=URL.createObjectURL(U);b(te),B.current=te,l==null||l(U),w.getTracks().forEach(Y=>Y.stop()),j(null),T.current=null},F.onerror=()=>{_(V.videoRecorder_error),k(),g("idle")},S.current=F,F.start(100),g("recording"),O(),d==null||d()},K=()=>{S.current&&S.current.state!=="inactive"&&S.current.stop(),D(),g("stopped")},G=()=>{S.current&&S.current.state==="recording"&&(S.current.pause(),D(),g("paused"))},W=()=>{S.current&&S.current.state==="paused"&&(S.current.resume(),O(),g("recording"))},ee=()=>{k(),x(0),b(null),B.current=null,_(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:[P&&n.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-destructive",children:[n.jsx(I.AlertCircle,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{children:P}),n.jsx("button",{type:"button",onClick:ee,className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(I.RotateCcw,{className:"h-4 w-4"})})]}),!P&&m==="stopped"&&y?n.jsxs("div",{className:"space-y-3",children:[n.jsx(Qt,{src:y,aspectRatio:"16/9"}),n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("button",{type:"button",onClick:ee,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n.jsx(I.RotateCcw,{className:"h-4 w-4"}),V.videoRecorder_reRecord]})})]}):!P&&m==="idle"?n.jsx("div",{className:"flex items-center justify-center gap-3 p-8",children:n.jsx("button",{type:"button",onClick:A,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(I.Monitor,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm",children:V.videoRecorder_shareScreen})]}):n.jsxs(n.Fragment,{children:[n.jsx(I.Camera,{className:"h-4 w-4"}),n.jsx("span",{className:"text-sm",children:V.videoRecorder_startCamera})]})})}):P?null:n.jsxs("div",{className:"relative",children:[n.jsx("video",{ref:M,autoPlay:!0,muted:!0,playsInline:!0,className:v("w-full",z&&"scale-x-[-1]"),style:{aspectRatio:"16/9"},"aria-label":e==="camera"?V.videoRecorder_cameraPreview:V.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:C,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":V.videoRecorder_startRecording,children:n.jsx(I.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: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":V.videoRecorder_pauseRecording,children:n.jsx(I.Pause,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:K,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":V.videoRecorder_stopRecording,children:n.jsx(I.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:W,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":V.videoRecorder_resumeRecording,children:n.jsx(I.Play,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:K,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":V.videoRecorder_stopRecording,children:n.jsx(I.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)}%`}})})]})]})});fi.displayName="VideoRecorder";const Ln=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 _=document.createElement("video");_.crossOrigin="anonymous",_.preload="metadata",_.muted=!0;const M=()=>{try{const N=document.createElement("canvas");N.width=_.videoWidth,N.height=_.videoHeight;const L=N.getContext("2d");L&&(L.drawImage(_,0,0),x(N.toDataURL("image/jpeg",.7)))}catch{}_.remove()};_.addEventListener("seeked",M,{once:!0});const S=()=>{_.currentTime=Math.min(1,_.duration*.1)};return _.addEventListener("loadedmetadata",S,{once:!0}),_.src=e,()=>{_.removeEventListener("seeked",M),_.removeEventListener("loadedmetadata",S),_.src="",_.remove()}},[e,t]);const b=()=>{s==="inline"?(g(!0),d==null||d()):s==="none"&&(d==null||d())},w=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),b())},j=t||h,P=r?Ge(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(Qt,{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":P,...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(I.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(I.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})})]})});Ln.displayName="VideoThumbnail";const gi=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 T=window.innerWidth;return t.xl&&T>=1280?t.xl:t.lg&&T>=1024?t.lg:t.md&&T>=768?t.md:t.sm??3},[t]),[b,w]=f.useState(typeof t=="number"?t:3);f.useEffect(()=>{const T=()=>w(y());return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[y]);const j=(T,B)=>{a==null||a(T,B),s==="lightbox"&&(g.current=document.activeElement instanceof HTMLElement?document.activeElement:null,p(B))},P=()=>{var T;p(null),(T=g.current)==null||T.focus()},_=f.useCallback(()=>{c!==null&&p(c>0?c-1:e.length-1)},[c,e.length]),M=f.useCallback(()=>{c!==null&&p(c<e.length-1?c+1:0)},[c,e.length]);f.useEffect(()=>{var V;if(c===null)return;const T=document.body.style.overflow;document.body.style.overflow="hidden",(V=h.current)==null||V.focus();const B=z=>{switch(z.key){case"Escape":z.preventDefault(),P();break;case"ArrowLeft":z.preventDefault(),_();break;case"ArrowRight":z.preventDefault(),M();break}if(z.key==="Tab"&&h.current){const k=h.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(k.length===0)return;const O=k[0],D=k[k.length-1];z.shiftKey?document.activeElement===O&&(z.preventDefault(),D.focus()):document.activeElement===D&&(z.preventDefault(),O.focus())}};return document.addEventListener("keydown",B),()=>{document.removeEventListener("keydown",B),document.body.style.overflow=T}},[c,_,M]);const S=T=>{m(T.touches[0].clientX)},N=T=>{var z;if(u===null)return;const B=u-T.changedTouches[0].clientX,V=Math.max(30,Math.min(80,(((z=h.current)==null?void 0:z.offsetWidth)??300)*.1));Math.abs(B)>V&&(B>0?M():_()),m(null)},L={gridTemplateColumns:`repeat(${b}, minmax(0, 1fr))`};return n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:d,className:v("grid",i),style:{...L,gap:`${r*4}px`},role:"list","aria-label":x.videoGallery_label,...l,children:e.map((T,B)=>n.jsx(Ln,{src:T.src,poster:T.poster,title:T.title,duration:T.duration,aspectRatio:o,clickAction:"none",onPlay:()=>j(T,B),role:"listitem"},T.id))}),s==="lightbox"&&c!==null&&e[c]&&Ur.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:T=>{T.target===T.currentTarget&&P()},onTouchStart:S,onTouchEnd:N,role:"dialog","aria-modal":"true","aria-label":x.videoGallery_label,tabIndex:-1,children:[n.jsx("button",{type:"button",onClick:P,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(I.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":x.common_previous,children:n.jsx(I.ChevronLeft,{className:"h-6 w-6"})}),n.jsx("button",{type:"button",onClick:M,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(I.ChevronRight,{className:"h-6 w-6"})})]}),n.jsxs("div",{className:"w-full max-w-4xl px-4",children:[n.jsx(Qt,{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)]})});gi.displayName="VideoGallery";const Pm={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},pi=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"),[P,_]=f.useState(!a),[M,S]=f.useState(e),[N,L]=f.useState(!1),T=f.useRef(null),B=ce();f.useEffect(()=>{S(e),j("loading")},[e]),f.useEffect(()=>{if(!a||!T.current)return;const A=new IntersectionObserver(([C])=>{C.isIntersecting&&(_(!0),A.disconnect())},{rootMargin:i});return A.observe(T.current),()=>A.disconnect()},[a,i]);const V=A=>{j("loaded"),h==null||h(A)},z=A=>{r&&M!==r?S(r):j("error"),x==null||x(A)},k=()=>{p&&L(A=>!A)},O=A=>{p&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),L(C=>!C))},D=l!==void 0?{aspectRatio:typeof l=="number"?`${l}`:l}:{};return n.jsxs("div",{ref:T,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:{...D,...g},onClick:k,onKeyDown:O,tabIndex:p?0:void 0,role:p?"button":void 0,"aria-label":p?B.image_zoomIn:void 0,children:[P&&M?n.jsx("img",{ref:b,src:M,alt:t??"",className:v("w-full h-full transition-transform duration-300",Pm[u],d&&"hover:scale-[var(--zoom-scale)]",N&&"scale-[var(--zoom-scale)]",w==="loading"&&"opacity-0"),style:{"--zoom-scale":c},onLoad:V,onError:z,...y}):null,w==="loading"&&P&&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(I.ImageOff,{className:"h-6 w-6 text-muted-foreground"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:B.image_failedToLoad})]}),p&&w==="loaded"&&!N&&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(I.ZoomIn,{className:"h-4 w-4"})})]})});pi.displayName="NUIImage";function hi({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),[P,_]=f.useState(null),M=f.useRef(null),S=f.useRef(null),N=ce(),L=t!==void 0?t:m,T=W=>{M.current=document.activeElement instanceof HTMLElement?document.activeElement:null,W!==void 0&&x(W),j(!0),g(!0)},B=()=>{var W;g(!1),b(!1),o==null||o(),(W=M.current)==null||W.focus()},V=f.useCallback(W=>{x(W),b(!1),j(!0),s==null||s(W)},[s]),z=f.useCallback(()=>{V(h>0?h-1:e.length-1)},[h,e.length,V]),k=f.useCallback(()=>{V(h<e.length-1?h+1:0)},[h,e.length,V]);f.useEffect(()=>{if(!L||!i)return;const W=ee=>{switch(ee.key){case"Escape":ee.preventDefault(),B();break;case"ArrowLeft":ee.preventDefault(),z();break;case"ArrowRight":ee.preventDefault(),k();break}};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[L,i,z,k]),f.useEffect(()=>{var E;if(!L)return;const W=document.body.style.overflow;document.body.style.overflow="hidden",(E=S.current)==null||E.focus();const ee=F=>{if(F.key!=="Tab"||!S.current)return;const U=S.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(U.length===0)return;const te=U[0],Y=U[U.length-1];F.shiftKey?document.activeElement===te&&(F.preventDefault(),Y.focus()):document.activeElement===Y&&(F.preventDefault(),te.focus())};return document.addEventListener("keydown",ee),()=>{document.body.style.overflow=W,document.removeEventListener("keydown",ee)}},[L]);const O=W=>{W.target===S.current&&B()},D=W=>{_(W.touches[0].clientX)},A=W=>{var F;if(P===null)return;const ee=P-W.changedTouches[0].clientX,E=Math.max(30,Math.min(80,(((F=S.current)==null?void 0:F.offsetWidth)??300)*.1));Math.abs(ee)>E&&(ee>0?k():z()),_(null)},C=()=>{a&&b(W=>!W)},K=()=>{const W=e[h];if(!W)return;const ee=document.createElement("a");ee.href=W.src,ee.download=W.alt||"image",ee.click()};if(!L)return u?n.jsx("div",{onClick:()=>T(r),className:"cursor-pointer",children:u}):null;const G=e[h];return G?Ur.createPortal(n.jsxs("div",{ref:S,className:v("fixed inset-0 z-50 flex flex-col items-center justify-center bg-background/95 dark:bg-black/95",p),onClick:O,onTouchStart:D,onTouchEnd:A,role:"dialog","aria-modal":"true","aria-label":N.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:Ge(N.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:K,className:"p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":N.lightbox_download,children:n.jsx(I.Download,{className:"h-5 w-5"})}),a&&n.jsx("button",{type:"button",onClick:()=>b(W=>!W),className:"p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":y?N.lightbox_zoomOut:N.lightbox_zoomIn,children:y?n.jsx(I.ZoomOut,{className:"h-5 w-5"}):n.jsx(I.ZoomIn,{className:"h-5 w-5"})}),n.jsx("button",{type:"button",onClick:B,className:"p-2 rounded-full bg-foreground/10 hover:bg-foreground/20 text-foreground transition-colors","aria-label":N.common_close,children:n.jsx(I.X,{className:"h-5 w-5"})})]})]}),e.length>1&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:z,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":N.common_previous,children:n.jsx(I.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":N.common_next,children:n.jsx(I.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:C,children:[w&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsx(I.Loader2,{className:"h-8 w-8 text-primary animate-spin"})}),n.jsx("img",{src:G.src,alt:G.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)},G.src)]}),(G.title||G.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:[G.title&&n.jsx("p",{className:"text-sm font-medium",children:G.title}),G.description&&n.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:G.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((W,ee)=>n.jsx("button",{type:"button",onClick:()=>V(ee),className:v("shrink-0 w-12 h-12 rounded overflow-hidden border-2 transition-all",ee===h?"border-primary":"border-transparent opacity-60 hover:opacity-100"),children:n.jsx("img",{src:W.src,alt:"",className:"w-full h-full object-cover"})},ee))})]}),document.body):null}hi.displayName="Lightbox";const xi=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}),[P,_]=f.useState(s||{x:.15,y:.15,width:.7,height:.7}),[M,S]=f.useState(null),[N,L]=f.useState(null),[T,B]=f.useState({x:0,y:0}),[V,z]=f.useState({x:0,y:0,width:0,height:0}),k=f.useRef(null),O=ce();f.useEffect(()=>{s&&_(s)},[s]);const D=()=>{x.current&&(j({width:x.current.naturalWidth,height:x.current.naturalHeight}),b(!0))},A=f.useCallback(E=>{let{x:F,y:U,width:te,height:Y}=E;const Z=r/(w.width||1),ae=r/(w.height||1);if(te=Math.max(Z,te),Y=Math.max(ae,Y),o&&(te=Math.min(o/(w.width||1),te),Y=Math.min(o/(w.height||1),Y)),te=Math.min(1,te),Y=Math.min(1,Y),t){const re=(w.width||1)/(w.height||1),ie=t/re;te/Y>ie?te=Y*ie:Y=te/ie}return F=Math.max(0,Math.min(1-te,F)),U=Math.max(0,Math.min(1-Y,U)),{x:F,y:U,width:te,height:Y}},[w,r,o,t]);f.useEffect(()=>{if(!M)return;const E=U=>{U.preventDefault();const te=h.current;if(!te)return;const Y=te.getBoundingClientRect(),Z=(U.clientX-T.x)/Y.width,ae=(U.clientY-T.y)/Y.height;let re;if(M==="move")re=A({...V,x:V.x+Z,y:V.y+ae});else{switch(re={...V},N){case"se":re.width=V.width+Z,re.height=V.height+ae;break;case"sw":re.x=V.x+Z,re.width=V.width-Z,re.height=V.height+ae;break;case"ne":re.y=V.y+ae,re.width=V.width+Z,re.height=V.height-ae;break;case"nw":re.x=V.x+Z,re.y=V.y+ae,re.width=V.width-Z,re.height=V.height-ae;break;case"n":re.y=V.y+ae,re.height=V.height-ae;break;case"s":re.height=V.height+ae;break;case"w":re.x=V.x+Z,re.width=V.width-Z;break;case"e":re.width=V.width+Z;break}re=A(re)}_(re),d==null||d(re)},F=()=>{if(S(null),L(null),k.current){try{k.current.target.releasePointerCapture(k.current.pointerId)}catch{}k.current=null}};return document.addEventListener("pointermove",E),document.addEventListener("pointerup",F),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",F)}},[M,T,V,N,A,d]);const C=(E,F,U)=>{E.preventDefault(),E.stopPropagation();const te=E.currentTarget;try{te.setPointerCapture(E.pointerId),k.current={target:te,pointerId:E.pointerId}}catch{}S(F),L(U||null),B({x:E.clientX,y:E.clientY}),z({...P})},K=E=>{const F=E.shiftKey?.05:.01;let U={...P};if(E.shiftKey&&!E.altKey)switch(E.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(E.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":G();return;default:return}E.preventDefault(),U=A(U),_(U),d==null||d(U)},G=()=>{const E=x.current;if(!E||!l)return;const F=document.createElement("canvas"),U=P.x*E.naturalWidth,te=P.y*E.naturalHeight,Y=P.width*E.naturalWidth,Z=P.height*E.naturalHeight;F.width=Y,F.height=Z;const ae=F.getContext("2d");if(!ae)return;u&&(ae.beginPath(),ae.arc(Y/2,Z/2,Math.min(Y,Z)/2,0,Math.PI*2),ae.closePath(),ae.clip()),ae.drawImage(E,U,te,Y,Z,0,0,Y,Z);const re=F.toDataURL(a,i);F.toBlob(ie=>{ie?l(ie,re):c==null||c(new Error(O.imageCropper_cropFailed))},a,i)},W=()=>{const F=A(s||{x:.15,y:.15,width:.7,height:.7});_(F),d==null||d(F)},ee=[{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":O.imageCropper_label,tabIndex:0,onKeyDown:K,children:[n.jsx("img",{ref:x,src:e,alt:"",className:"block w-full",onLoad:D,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:`${P.x*100}%`,top:`${P.y*100}%`,width:`${P.width*100}%`,height:`${P.height*100}%`},onPointerDown:E=>C(E,"move"),children:[n.jsx("div",{className:v("absolute inset-0 overflow-hidden",u&&"rounded-full"),children:n.jsx("img",{src:e,alt:"",className:"block max-w-none",crossOrigin:"anonymous",style:{position:"absolute",left:`-${P.x/P.width*100}%`,top:`-${P.y/P.height*100}%`,width:`${1/P.width*100}%`,height:`${1/P.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&&ee.map(({handle:E,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:te=>C(te,"resize",E)},E))]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:G,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(I.Crop,{className:"h-4 w-4"}),O.imageCropper_crop]}),n.jsxs("button",{type:"button",onClick:W,className:"flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm hover:bg-accent transition-colors",children:[n.jsx(I.RotateCcw,{className:"h-4 w-4"}),O.imageCropper_reset]})]})]})});xi.displayName="ImageCropper";const vi=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,P]=f.useState({width:0,height:0}),_=f.useRef(null),M=ce(),S=a==="horizontal",N=l??M.imageCompare_before,L=d??M.imageCompare_after;f.useEffect(()=>{const k=w.current;if(!k)return;const O=new ResizeObserver(D=>{for(const A of D){const{width:C,height:K}=A.contentRect;P({width:C,height:K})}});return O.observe(k),P({width:k.offsetWidth,height:k.offsetHeight}),()=>O.disconnect()},[]);const T=f.useCallback((k,O)=>{const D=w.current;if(!D)return;const A=D.getBoundingClientRect();let C;S?C=(k-A.left)/A.width*100:C=(O-A.top)/A.height*100,C=Math.max(0,Math.min(100,C)),x(C),p==null||p(C)},[S,p]);f.useEffect(()=>{if(!y)return;const k=A=>{A.preventDefault(),T(A.clientX,A.clientY)},O=()=>{if(_.current){const{element:A,pointerId:C}=_.current;A.releasePointerCapture(C),_.current=null}b(!1)},D=()=>{if(_.current){const{element:A,pointerId:C}=_.current;A.releasePointerCapture(C),_.current=null}b(!1)};return document.addEventListener("pointermove",k),document.addEventListener("pointerup",O),window.addEventListener("blur",D),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",O),window.removeEventListener("blur",D)}},[y,T]);const B=k=>{k.preventDefault();const O=k.currentTarget;O.setPointerCapture(k.pointerId),_.current={element:O,pointerId:k.pointerId},b(!0)},V=k=>{const O=k.shiftKey?10:1;let D=h;if(S&&k.key==="ArrowLeft"||!S&&k.key==="ArrowUp")D=Math.max(0,h-O);else if(S&&k.key==="ArrowRight"||!S&&k.key==="ArrowDown")D=Math.min(100,h+O);else return;k.preventDefault(),x(D),p==null||p(D)},z=()=>{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:S?{width:`${h}%`}:{height:`${h}%`},children:n.jsx("img",{src:e,alt:r,className:v("block object-cover",S?"h-full":"w-full"),style:S?{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",S?"top-0 bottom-0 cursor-[ew-resize]":"left-0 right-0 cursor-[ns-resize]"),style:S?{left:`${h}%`,width:c,transform:"translateX(-50%)"}:{top:`${h}%`,height:c,transform:"translateY(-50%)"},onPointerDown:B,onDoubleClick:z,onKeyDown:V,role:"slider","aria-label":M.imageCompare_slider,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),"aria-orientation":S?"horizontal":"vertical",tabIndex:0,children:[n.jsx("div",{className:v("bg-primary shadow-lg",S?"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(I.GripVertical,{className:v("h-4 w-4",!S&&"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:N}),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:L})]})]})});vi.displayName="ImageCompare";function Im({className:e}){const{setTheme:t}=hr(),r=ce();return n.jsxs(Cs,{children:[n.jsx(Ss,{asChild:!0,children:n.jsxs(_e,{variant:"outline",size:"icon",className:e,children:[n.jsx(I.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),n.jsx(I.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(bn,{align:"end",children:[n.jsxs(Bt,{onClick:()=>t("light"),children:[n.jsx(I.Sun,{className:"mr-2 h-4 w-4"}),r.modeToggle_light]}),n.jsxs(Bt,{onClick:()=>t("dark"),children:[n.jsx(I.Moon,{className:"mr-2 h-4 w-4"}),r.modeToggle_dark]}),n.jsxs(Bt,{onClick:()=>t("system"),children:[n.jsx(I.Monitor,{className:"mr-2 h-4 w-4"}),r.modeToggle_system]})]})]})}const Lm=[{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 Tm({className:e}){const{theme:t,setTheme:r,themes:o}=hr(),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:Lm.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 bi=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}));bi.displayName="ChatBubble";const wi=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??"?"})}));wi.displayName="ChatBubbleAvatar";const Dm={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"})]})},yi=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:Dm[o]})]})}));yi.displayName="ChatBubbleMessage";const ji=f.forwardRef(({className:e,...t},r)=>n.jsx("span",{ref:r,className:v("text-[10px] text-muted-foreground mt-1 px-1",e),...t}));ji.displayName="ChatBubbleTimestamp";const Ni=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}));Ni.displayName="ChatBubbleActions";const ki=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(""),P=d!==void 0,_=P?d:w,M=k=>{P?c==null||c(k):j(k)},S=()=>{const k=y.current;k&&(k.style.height="auto",k.style.height=Math.min(k.scrollHeight,160)+"px")},N=()=>{const k=_.trim();!k||r||o||(e==null||e(k),M(""),y.current&&(y.current.style.height="auto"))},L=k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),N())},T=()=>{var k;(k=b.current)==null||k.click()},B=k=>{k.target.files&&k.target.files.length>0&&(a==null||a(k.target.files)),k.target.value=""},V=_.length,z=m?V>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:T,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:B,className:"hidden","aria-hidden":"true"})]}),n.jsx("textarea",{ref:y,value:_,onChange:k=>{M(k.target.value),S()},onKeyDown:L,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:N,disabled:r||o||!_.trim()||z,className:v("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",_.trim()&&!r&&!o&&!z?"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",z?"text-destructive font-medium":"text-muted-foreground"),children:[V,"/",m]})]})]})});ki.displayName="ChatInput";const Ci=f.forwardRef(({className:e,children:t,...r},o)=>n.jsx("div",{ref:o,className:v("flex flex-col h-full",e),...r,children:t}));Ci.displayName="ChatContainer";const Si=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(pr,{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})]})})});Si.displayName="ChatList";const Ri=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]"})]})});Ri.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 Em(e){const t=e.split(`
|
|
36
42
|
`),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;
|
|
43
|
+
`)})},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 _i=f.forwardRef(({content:e,streaming:t,className:r,...o},s)=>{const a=t?e:e.trim(),i=f.useMemo(()=>{try{return Em(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})});_i.displayName="MarkdownRenderer";const Mi=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))})});Mi.displayName="PromptSuggestions";const Pi=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 P;return j.name.toLowerCase().includes(w)||((P=j.provider)==null?void 0:P.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))]})]})]})});Pi.displayName="ModelSelector";const Ii=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)})}));Ii.displayName="ChatModeSelector";const Li=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})]})]})});Li.displayName="ChatFollowUp";const Ti=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:[],P=t??"",_=s??x,M=c??b,S=a||_!=null&&_!==""||M!=null&&M!=="",N=f.useCallback((T,B)=>{S||(y(T),o==null||o(T,B))},[S,o]),L=f.useCallback(()=>{const T=(g??"").trim();!T||S||(w(T),l==null||l(T),h(""))},[g,S,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(I.HelpCircle,{className:"w-4 h-4"})}),n.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:P})]}),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((T,B)=>{if(!T)return null;const V=T.id||`opt-${B}`,z=T.label||V,k=_===T.id;return n.jsxs("button",{type:"button",disabled:S,onClick:()=>N(T.id,z),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":S?"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":S?"border-muted-foreground/30":"border-muted-foreground/40 group-hover:border-primary/60"),children:k&&n.jsx(I.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:z}),T.description&&n.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-2",children:T.description})]})]},V)})}),M&&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(I.Check,{className:"w-4 h-4 text-primary flex-shrink-0"}),n.jsx("span",{className:"text-sm font-medium text-primary truncate",children:M})]}),i&&!S&&n.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/30",children:[n.jsx("input",{type:"text",value:g,onChange:T=>h(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),L())},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:L,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(I.Send,{className:"w-4 h-4"})})]})]})]})});Ti.displayName="ChatQuestion";const ro={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"}},Di=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=ro[e]??ro.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(I.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(I.X,{className:"w-4 h-4"})})]})})});Di.displayName="ChatActionCard";const no={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"}},Ei=f.forwardRef(({type:e="task",title:t,id:r,status:o,properties:s,icon:a,onNavigate:i,className:l,...d},c)=>{const p=no[e]??no.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(I.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))})})]})});Ei.displayName="ChatEntityPreview";const Ai=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"?I.Sparkles:I.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(I.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))})]})})});Ai.displayName="ChatResultCard";const Am={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"}},Fi=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 P=j==="copy"&&h,S=j==="like"&&r==="liked"||j==="dislike"&&r==="disliked";return n.jsx("button",{type:"button",onClick:w[j],"aria-label":y[j],title:P?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",S&&"text-primary",P&&"text-green-500"),children:P?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:S?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:Am[j].path})})},j)})})});Fi.displayName="MessageActions";const Vi=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"})]})});Vi.displayName="StreamingText";const zi=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)}...`:Ge(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"})]})})})]})});zi.displayName="ReasoningBlock";const $i=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:Ge(c.toolCall_calling,{name:e}),success:e,error:Ge(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})]})]})]})});$i.displayName="ChatToolCall";function Fm(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 Bi=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 S=u.toLowerCase();return e.filter(N=>{var L;return N.title.toLowerCase().includes(S)||((L=N.lastMessage)==null?void 0:L.toLowerCase().includes(S))})},[e,u]),j=[p.conversationList_today,p.conversationList_yesterday,p.conversationList_previous7Days,p.conversationList_older],P=f.useMemo(()=>Fm(w,j),[w,j]),_=S=>{h(S.id),y(S.title),setTimeout(()=>{var N;return(N=b.current)==null?void 0:N.focus()},0)},M=()=>{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:S=>m(S.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:[P.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}),P.map(S=>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:S.label}),S.items.map(N=>{const L=N.id===t,T=N.id===g;return n.jsxs("div",{className:v("group flex items-center gap-2 rounded-lg px-2 py-2 cursor-pointer transition-colors",L?"bg-primary/10":"hover:bg-muted"),onClick:()=>!T&&(r==null?void 0:r(N.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:T?n.jsx("input",{ref:b,value:x,onChange:B=>y(B.target.value),onBlur:M,onKeyDown:B=>{B.key==="Enter"&&M(),B.key==="Escape"&&h(null)},className:"w-full bg-background border border-border rounded px-1 py-0.5 text-sm outline-none",onClick:B=>B.stopPropagation()}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-sm truncate font-medium",children:N.title}),N.lastMessage&&n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:N.lastMessage})]})}),!T&&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:B=>{B.stopPropagation(),_(N)},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:B=>{B.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":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"})]})})]})]},N.id)})]},S.label))]})]})});Bi.displayName="ConversationList";const Vm={online:"bg-green-500",offline:"bg-muted-foreground/40",typing:"bg-primary animate-pulse"},Oi=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",Vm[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"})]})})]})]})});Oi.displayName="ChatHeader";const Tn=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"})]})]})});Tn.displayName="CitationBadge";const Hi=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(Tn,{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))]})});Hi.displayName="SourceCitation";function oo(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function so(e){return e.startsWith("image/")}function ao(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 Gi=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:[so(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:ao(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:oo(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":Ge(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:[so(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:ao(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:oo(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":Ge(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))})});Gi.displayName="FilePreview";const zm={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"})]})},qi=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:P,citations:_,className:M,...S},N)=>{const L=ce(),T=e==="sent",[B,V]=f.useState(!1),z=async()=>{if(d)try{await navigator.clipboard.writeText(d),V(!0),setTimeout(()=>V(!1),2e3)}catch{}p==null||p()};return n.jsxs("div",{ref:N,className:v("group flex gap-2 max-w-[85%]",T?"ml-auto flex-row-reverse":"mr-auto",M),...S,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($m,{...j})}),P==null?void 0:P.map((k,O)=>n.jsx(Bm,{...k},O)),n.jsxs("div",{className:v("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",T?"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,_&&_.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:L.sourceCitation_sources}),_.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 O=k.id===y.selected,D=!!y.selected;return n.jsxs("button",{type:"button",disabled:D,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",O?"border-primary bg-primary/10 text-primary font-medium":D?"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:[O?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",D?"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",T&&"flex-row-reverse"),children:[s&&n.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),i&&zm[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 O=k==="copy"&&B,D={copy:z,retry:u,edit:m,like:g,dislike:h,share:x},A=k==="like"&&c==="liked"||k==="dislike"&&c==="disliked",C={copy:L.messageActions_copy,retry:L.messageActions_retry,edit:L.messageActions_edit,like:L.messageActions_like,dislike:L.messageActions_dislike,share:L.messageActions_share};return n.jsx("button",{type:"button",onClick:D[k],title:O?L.messageActions_copied:C[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",A&&"text-primary",O&&"text-green-500"),children:O?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:A?"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:A?"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)})})]})]})});qi.displayName="ChatMessage";function $m({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...`:Ge(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 Bm({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"?Ge(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=Ri;exports.Accordion=Rc;exports.AccordionContent=gs;exports.AccordionItem=ms;exports.AccordionTrigger=fs;exports.Alert=Os;exports.AlertDescription=Gs;exports.AlertDialog=$c;exports.AlertDialogAction=Zs;exports.AlertDialogCancel=Js;exports.AlertDialogContent=Ws;exports.AlertDialogDescription=Ys;exports.AlertDialogFooter=Ks;exports.AlertDialogHeader=Us;exports.AlertDialogOverlay=yn;exports.AlertDialogPortal=qs;exports.AlertDialogTitle=Xs;exports.AlertDialogTrigger=Bc;exports.AlertTitle=Hs;exports.AppShell=ri;exports.AspectRatio=Nc;exports.AudioPlayer=jr;exports.AudioPlaylist=ui;exports.AudioRecorder=di;exports.AudioWaveform=yr;exports.Avatar=Po;exports.AvatarFallback=Lo;exports.AvatarImage=Io;exports.Badge=Zr;exports.Blockquote=ym;exports.Box=Zo;exports.Breadcrumb=ta;exports.BreadcrumbEllipsis=ia;exports.BreadcrumbItem=na;exports.BreadcrumbLink=oa;exports.BreadcrumbList=ra;exports.BreadcrumbPage=sa;exports.BreadcrumbSeparator=aa;exports.Button=_e;exports.Calendar=tn;exports.Card=rn;exports.CardContent=sn;exports.CardDescription=ss;exports.CardFooter=as;exports.CardHeader=nn;exports.CardTitle=on;exports.Carousel=Da;exports.CarouselContent=Ea;exports.CarouselItem=Aa;exports.CarouselNext=Va;exports.CarouselPrevious=Fa;exports.ChartContainer=Ya;exports.ChartLegend=Cm;exports.ChartTooltip=km;exports.ChatActionCard=Di;exports.ChatBubble=bi;exports.ChatBubbleActions=Ni;exports.ChatBubbleAvatar=wi;exports.ChatBubbleMessage=yi;exports.ChatBubbleTimestamp=ji;exports.ChatContainer=Ci;exports.ChatEntityPreview=Ei;exports.ChatFollowUp=Li;exports.ChatHeader=Oi;exports.ChatInput=ki;exports.ChatList=Si;exports.ChatMessage=qi;exports.ChatModeSelector=Ii;exports.ChatQuestion=Ti;exports.ChatResultCard=Ai;exports.ChatToolCall=$i;exports.Checkbox=To;exports.CitationBadge=Tn;exports.Code=wm;exports.CodeBlock=xm;exports.Collapsible=kc;exports.CollapsibleContent=ns;exports.CollapsibleTrigger=Cc;exports.ColorPicker=yc;exports.Combobox=pc;exports.Command=wn;exports.CommandDialog=Vc;exports.CommandEmpty=Fs;exports.CommandGroup=Vs;exports.CommandInput=Es;exports.CommandItem=$s;exports.CommandList=As;exports.CommandSeparator=zs;exports.CommandShortcut=Bs;exports.Container=rs;exports.ContextMenu=Sd;exports.ContextMenuCheckboxItem=ka;exports.ContextMenuContent=ja;exports.ContextMenuGroup=_d;exports.ContextMenuItem=Na;exports.ContextMenuLabel=Sa;exports.ContextMenuPortal=Md;exports.ContextMenuRadioGroup=Id;exports.ContextMenuRadioItem=Ca;exports.ContextMenuSeparator=Ra;exports.ContextMenuShortcut=_a;exports.ContextMenuSub=Pd;exports.ContextMenuSubContent=ya;exports.ContextMenuSubTrigger=wa;exports.ContextMenuTrigger=Rd;exports.ConversationList=Bi;exports.CopyInput=ai;exports.DataTable=um;exports.DataTableColumnHeader=mm;exports.DatePicker=uc;exports.Dialog=ps;exports.DialogClose=Mc;exports.DialogContent=mn;exports.DialogDescription=ws;exports.DialogFooter=vs;exports.DialogHeader=xs;exports.DialogOverlay=un;exports.DialogPortal=hs;exports.DialogTitle=bs;exports.DialogTrigger=_c;exports.Drawer=ys;exports.DrawerClose=Ns;exports.DrawerContent=gn;exports.DrawerDescription=vn;exports.DrawerFooter=hn;exports.DrawerHeader=pn;exports.DrawerTitle=xn;exports.DrawerTrigger=js;exports.DropdownMenu=Cs;exports.DropdownMenuCheckboxItem=Ms;exports.DropdownMenuContent=bn;exports.DropdownMenuGroup=Ic;exports.DropdownMenuItem=Bt;exports.DropdownMenuLabel=Is;exports.DropdownMenuPortal=Lc;exports.DropdownMenuRadioGroup=Dc;exports.DropdownMenuRadioItem=Ps;exports.DropdownMenuSeparator=Ls;exports.DropdownMenuShortcut=Ts;exports.DropdownMenuSub=Tc;exports.DropdownMenuSubContent=_s;exports.DropdownMenuSubTrigger=Rs;exports.DropdownMenuTrigger=Ss;exports.EmptyState=jd;exports.FilePreview=Gi;exports.FileUpload=vc;exports.Flex=Jo;exports.Grid=ts;exports.HStack=es;exports.Header=oi;exports.Heading=vm;exports.HoverCard=Ld;exports.HoverCardContent=Ma;exports.HoverCardTrigger=Td;exports.Image=pi;exports.ImageCompare=vi;exports.ImageCropper=xi;exports.Input=lt;exports.JsonViewer=ii;exports.Label=gr;exports.Lead=jm;exports.Lightbox=hi;exports.Main=si;exports.MarkdownRenderer=_i;exports.MessageActions=Fi;exports.MetricCard=Sm;exports.ModeToggle=Im;exports.ModeToggleGroup=Tm;exports.ModelSelector=Pi;exports.MultiSelect=hc;exports.Muted=Nm;exports.NUIProvider=Yo;exports.NavigationMenu=ga;exports.NavigationMenuContent=va;exports.NavigationMenuIndicator=ba;exports.NavigationMenuItem=kd;exports.NavigationMenuLink=Cd;exports.NavigationMenuList=pa;exports.NavigationMenuTrigger=xa;exports.NavigationMenuViewport=jn;exports.NumberInput=fc;exports.OTPInput=xc;exports.Pagination=la;exports.PaginationContent=ca;exports.PaginationEllipsis=fa;exports.PaginationItem=da;exports.PaginationLink=xr;exports.PaginationNext=ma;exports.PaginationPrevious=ua;exports.Popover=Lt;exports.PopoverContent=yt;exports.PopoverTrigger=Tt;exports.Progress=Qs;exports.PromptSuggestions=Mi;exports.RadioGroup=$o;exports.RadioGroupItem=Bo;exports.ReasoningBlock=zi;exports.ScrollArea=pr;exports.ScrollBar=dr;exports.Select=ac;exports.SelectContent=Ao;exports.SelectGroup=ic;exports.SelectItem=Vo;exports.SelectLabel=Fo;exports.SelectScrollDownButton=Qr;exports.SelectScrollUpButton=Jr;exports.SelectSeparator=zo;exports.SelectTrigger=Eo;exports.SelectValue=lc;exports.Separator=Mo;exports.Sheet=ys;exports.SheetClose=Ns;exports.SheetContent=gn;exports.SheetDescription=vn;exports.SheetFooter=hn;exports.SheetHeader=pn;exports.SheetOverlay=fn;exports.SheetPortal=ks;exports.SheetTitle=xn;exports.SheetTrigger=js;exports.Sidebar=ni;exports.Skeleton=Oc;exports.Slider=Oo;exports.SourceCitation=Hi;exports.StatusBadge=_m;exports.Stepper=Nd;exports.StreamingText=Vi;exports.Switch=Do;exports.Table=an;exports.TableBody=cn;exports.TableCaption=ls;exports.TableCell=cr;exports.TableFooter=is;exports.TableHead=dn;exports.TableHeader=ln;exports.TableRow=$t;exports.Tabs=Sc;exports.TabsContent=us;exports.TabsList=cs;exports.TabsTrigger=ds;exports.TagInput=gc;exports.Text=bm;exports.Textarea=Ro;exports.ThemeProvider=wd;exports.TimePicker=mc;exports.Timeline=Za;exports.TimelineConnector=ei;exports.TimelineContent=ti;exports.TimelineIcon=Qa;exports.TimelineItem=Ja;exports.Toaster=yd;exports.Toggle=Ho;exports.ToggleGroup=Go;exports.ToggleGroupItem=Wo;exports.Tooltip=Ac;exports.TooltipContent=Ds;exports.TooltipProvider=Ec;exports.TooltipTrigger=Fc;exports.TranslateProvider=Yo;exports.VStack=Qo;exports.VideoGallery=gi;exports.VideoPlayer=Qt;exports.VideoRecorder=fi;exports.VideoThumbnail=Ln;exports.audioPlayerVariants=li;exports.audioPlaylistVariants=Wr;exports.audioRecorderVariants=ci;exports.badgeVariants=_o;exports.buttonVariants=Zt;exports.cardVariants=os;exports.cn=v;exports.en=Wt;exports.formatTime=Ke;exports.headingVariants=Ka;exports.inputVariants=So;exports.navigationMenuTriggerStyle=ha;exports.ru=Uo;exports.textVariants=Xa;exports.toast=sd;exports.toggleVariants=en;exports.tpl=Ge;exports.useLocale=dc;exports.useNUILocale=ce;exports.useTheme=hr;exports.useTranslate=ce;exports.videoPlayerVariants=mi;
|
|
38
44
|
//# sourceMappingURL=index.cjs.js.map
|