diff --git a/webui/dist/assets/icons-Bw5y5Hqz.js b/webui/dist/assets/icons-Bw5y5Hqz.js deleted file mode 100644 index 03fb32a7..00000000 --- a/webui/dist/assets/icons-Bw5y5Hqz.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s}from"./router-CWhjJi2n.js";const _=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),h=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},k=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),m=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:r,...d},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",y),...!n&&!m(d)&&{"aria-hidden":"true"},...d},[...r.map(([i,l])=>s.createElement(i,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},n)=>s.createElement(x,{ref:n,iconNode:a,className:k(`lucide-${_(h(t))}`,`lucide-${t}`,o),...y}));return c.displayName=h(t),c};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],y2=e("activity",f);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],d2=e("arrow-left",u);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],h2=e("arrow-right",g);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],k2=e("ban",$);const N=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],r2=e("book-open",N);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],p2=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],i2=e("boxes",z);const b=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],l2=e("bug",b);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],_2=e("calendar",q);const C=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],M2=e("chart-column",C);const j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],m2=e("check",j);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],v2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],x2=e("chevron-left",A);const L=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],f2=e("chevron-right",L);const H=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],u2=e("chevron-up",H);const S=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],g2=e("chevrons-left",S);const P=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],$2=e("chevrons-right",P);const U=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],N2=e("chevrons-up-down",U);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],w2=e("circle-alert",T);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],z2=e("circle-check",Z);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],b2=e("circle-question-mark",B);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],q2=e("circle-user",D);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],C2=e("circle-x",R);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],j2=e("circle",E);const O=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],V2=e("clock",O);const F=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],A2=e("code-xml",F);const I=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],L2=e("container",I);const W=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],H2=e("copy",W);const G=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],S2=e("database",G);const K=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],P2=e("dollar-sign",K);const X=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],U2=e("download",X);const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],T2=e("external-link",Q);const J=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Z2=e("eye-off",J);const Y=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],B2=e("eye",Y);const e1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],D2=e("file-search",e1);const a1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],R2=e("file-text",a1);const t1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],E2=e("folder-open",t1);const c1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],O2=e("funnel",c1);const o1=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],F2=e("graduation-cap",o1);const n1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],I2=e("grip-vertical",n1);const s1=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],W2=e("hard-drive",s1);const y1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],G2=e("hash",y1);const d1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],K2=e("house",d1);const h1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],X2=e("image",h1);const k1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Q2=e("info",k1);const r1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],J2=e("key",r1);const p1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Y2=e("loader-circle",p1);const i1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],e0=e("lock",i1);const l1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],a0=e("log-out",l1);const _1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],t0=e("menu",_1);const M1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],c0=e("message-square",M1);const m1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],o0=e("moon",m1);const v1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],n0=e("network",v1);const x1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],s0=e("package",x1);const f1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],y0=e("palette",f1);const u1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],d0=e("panels-top-left",u1);const g1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],h0=e("pause",g1);const $1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],k0=e("pen",$1);const N1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],r0=e("pencil",N1);const w1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],p0=e("play",w1);const z1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],i0=e("plus",z1);const b1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],l0=e("power",b1);const q1=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],_0=e("puzzle",q1);const C1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],M0=e("refresh-cw",C1);const j1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],m0=e("rotate-ccw",j1);const V1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],v0=e("rotate-cw",V1);const A1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],x0=e("save",A1);const L1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f0=e("search",L1);const H1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],u0=e("send",H1);const S1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],g0=e("server",S1);const P1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],$0=e("settings-2",P1);const U1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],N0=e("settings",U1);const T1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],w0=e("shield",T1);const Z1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],z0=e("skip-forward",Z1);const B1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],b0=e("sliders-vertical",B1);const D1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],q0=e("smile",D1);const R1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],C0=e("sparkles",R1);const E1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],j0=e("square-pen",E1);const O1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],V0=e("star",O1);const F1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],A0=e("sun",F1);const I1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],L0=e("terminal",I1);const W1=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"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 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],H0=e("thumbs-up",W1);const G1=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"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 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],S0=e("thumbs-down",G1);const K1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],P0=e("trash-2",K1);const X1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],U0=e("trending-up",X1);const Q1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],T0=e("triangle-alert",Q1);const J1=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Z0=e("type",J1);const Y1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],B0=e("upload",Y1);const e2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],D0=e("user",e2);const a2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],R0=e("users",a2);const t2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],E0=e("wifi-off",t2);const c2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],O0=e("wifi",c2);const o2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],F0=e("x",o2);const n2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],I0=e("zap",n2);export{r0 as $,y2 as A,p2 as B,z2 as C,P2 as D,Z2 as E,R2 as F,K2 as G,W2 as H,Q2 as I,d2 as J,J2 as K,e0 as L,c0 as M,v2 as N,u2 as O,l0 as P,d0 as Q,M0 as R,N0 as S,U0 as T,B0 as U,A2 as V,x0 as W,F0 as X,i0 as Y,I0 as Z,D2 as _,w2 as a,g2 as a0,x2 as a1,f2 as a2,$2 as a3,N2 as a4,I2 as a5,F2 as a6,L2 as a7,s0 as a8,E2 as a9,r2 as aA,a0 as aB,v0 as aC,l2 as aD,O2 as aa,j0 as ab,k2 as ac,X2 as ad,G2 as ae,R0 as af,n0 as ag,_2 as ah,h0 as ai,p0 as aj,Z0 as ak,V0 as al,H0 as am,S0 as an,$0 as ao,O0 as ap,E0 as aq,k0 as ar,u0 as as,g0 as at,i2 as au,q2 as av,M2 as aw,j2 as ax,b0 as ay,t0 as az,m0 as b,_0 as c,S2 as d,V2 as e,y0 as f,w0 as g,T0 as h,m2 as i,H2 as j,B2 as k,C2 as l,P0 as m,U2 as n,A0 as o,o0 as p,b2 as q,L0 as r,T2 as s,Y2 as t,C0 as u,D0 as v,q0 as w,z0 as x,h2 as y,f0 as z}; diff --git a/webui/dist/assets/icons-y1PBa0Co.js b/webui/dist/assets/icons-y1PBa0Co.js new file mode 100644 index 00000000..a7774649 --- /dev/null +++ b/webui/dist/assets/icons-y1PBa0Co.js @@ -0,0 +1 @@ +import{r as s}from"./router-CWhjJi2n.js";const _=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},k=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),m=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:r,...h},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",y),...!n&&!m(h)&&{"aria-hidden":"true"},...h},[...r.map(([i,l])=>s.createElement(i,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},n)=>s.createElement(x,{ref:n,iconNode:a,className:k(`lucide-${_(d(t))}`,`lucide-${t}`,o),...y}));return c.displayName=d(t),c};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],n2=e("activity",f);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],s2=e("arrow-left",u);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],y2=e("arrow-right",g);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h2=e("ban",$);const N=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],d2=e("book-open",N);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],k2=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],r2=e("boxes",z);const b=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],p2=e("bug",b);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],i2=e("calendar",q);const j=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],l2=e("chart-column",j);const C=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_2=e("check",C);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],M2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],m2=e("chevron-left",A);const H=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],v2=e("chevron-right",H);const L=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],x2=e("chevron-up",L);const S=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],f2=e("chevrons-left",S);const P=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],u2=e("chevrons-right",P);const U=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],g2=e("chevrons-up-down",U);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$2=e("circle-alert",T);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],N2=e("circle-check",Z);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],w2=e("circle-question-mark",B);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],z2=e("circle-user",D);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],b2=e("circle-x",E);const R=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],q2=e("clock",R);const O=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],j2=e("code-xml",O);const F=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],C2=e("container",F);const I=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],V2=e("copy",I);const W=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],A2=e("database",W);const G=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],H2=e("dollar-sign",G);const K=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],L2=e("download",K);const X=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],S2=e("external-link",X);const Q=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],P2=e("eye-off",Q);const J=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],U2=e("eye",J);const Y=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],T2=e("file-search",Y);const e1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Z2=e("file-text",e1);const a1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],B2=e("folder-open",a1);const t1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],D2=e("funnel",t1);const c1=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],E2=e("graduation-cap",c1);const o1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],R2=e("grip-vertical",o1);const n1=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],O2=e("hard-drive",n1);const s1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],F2=e("hash",s1);const y1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],I2=e("house",y1);const h1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],W2=e("image",h1);const d1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],G2=e("info",d1);const k1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],K2=e("key",k1);const r1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],X2=e("loader-circle",r1);const p1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Q2=e("lock",p1);const i1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],J2=e("log-out",i1);const l1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Y2=e("menu",l1);const _1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],e0=e("message-square",_1);const M1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],a0=e("moon",M1);const m1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],t0=e("network",m1);const v1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],c0=e("package",v1);const x1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],o0=e("palette",x1);const f1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],n0=e("panels-top-left",f1);const u1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],s0=e("pause",u1);const g1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],y0=e("pen",g1);const $1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],h0=e("pencil",$1);const N1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],d0=e("play",N1);const w1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],k0=e("plus",w1);const z1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],r0=e("power",z1);const b1=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],p0=e("puzzle",b1);const q1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],i0=e("refresh-cw",q1);const j1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],l0=e("rotate-ccw",j1);const C1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],_0=e("save",C1);const V1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],M0=e("search",V1);const A1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],m0=e("send",A1);const H1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],v0=e("server",H1);const L1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],x0=e("settings-2",L1);const S1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],f0=e("settings",S1);const P1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],u0=e("shield",P1);const U1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],g0=e("skip-forward",U1);const T1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],$0=e("sliders-vertical",T1);const Z1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],N0=e("smile",Z1);const B1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],w0=e("sparkles",B1);const D1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],z0=e("square-pen",D1);const E1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],b0=e("star",E1);const R1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],q0=e("sun",R1);const O1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],j0=e("terminal",O1);const F1=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"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 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],C0=e("thumbs-up",F1);const I1=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"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 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],V0=e("thumbs-down",I1);const W1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],A0=e("trash-2",W1);const G1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],H0=e("trending-up",G1);const K1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],L0=e("triangle-alert",K1);const X1=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],S0=e("type",X1);const Q1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],P0=e("upload",Q1);const J1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],U0=e("user",J1);const Y1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],T0=e("users",Y1);const e2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Z0=e("wifi-off",e2);const a2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],B0=e("wifi",a2);const t2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],D0=e("x",t2);const c2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],E0=e("zap",c2);export{h0 as $,n2 as A,k2 as B,N2 as C,H2 as D,P2 as E,Z2 as F,I2 as G,O2 as H,G2 as I,s2 as J,K2 as K,Q2 as L,e0 as M,M2 as N,x2 as O,r0 as P,_0 as Q,i0 as R,f0 as S,H0 as T,P0 as U,n0 as V,j2 as W,D0 as X,k0 as Y,E0 as Z,T2 as _,$2 as a,f2 as a0,m2 as a1,v2 as a2,u2 as a3,g2 as a4,R2 as a5,E2 as a6,C2 as a7,c0 as a8,B2 as a9,J2 as aA,p2 as aB,W2 as aa,D2 as ab,z0 as ac,h2 as ad,F2 as ae,T0 as af,t0 as ag,i2 as ah,s0 as ai,d0 as aj,S0 as ak,b0 as al,C0 as am,V0 as an,x0 as ao,B0 as ap,Z0 as aq,y0 as ar,m0 as as,v0 as at,r2 as au,z2 as av,l2 as aw,$0 as ax,Y2 as ay,d2 as az,l0 as b,p0 as c,A2 as d,q2 as e,o0 as f,u0 as g,L0 as h,_2 as i,V2 as j,U2 as k,b2 as l,A0 as m,L2 as n,q0 as o,a0 as p,w2 as q,j0 as r,S2 as s,X2 as t,w0 as u,U0 as v,N0 as w,g0 as x,y2 as y,M0 as z}; diff --git a/webui/dist/assets/index-B31Ybn7V.js b/webui/dist/assets/index-B31Ybn7V.js deleted file mode 100644 index 06eeb156..00000000 --- a/webui/dist/assets/index-B31Ybn7V.js +++ /dev/null @@ -1,52 +0,0 @@ -import{r as u,j as e,L as Kc,e as Jt,b as fy,f as py,g as gy,h as jy,k as lt,l as vy,m as yy,O as Np,n as Ny}from"./router-CWhjJi2n.js";import{a as by,b as wy,g as _y}from"./react-vendor-Dtc2IqVY.js";import{I as Sy,c as Cy,J as ai,K as qc,L as wu,M as ky,N as er,O as sr,P as Ty,n as _u}from"./utils-CCeOswSm.js";import{L as bp,T as wp,C as _p,R as Ey,a as Sp,V as zy,b as My,S as Cp,c as Ay,d as kp,I as Dy,e as Tp,f as Oy,g as Ep,h as Ry,i as Ly,j as Uy,O as zp,P as By,k as Mp,l as Ap,D as Dp,A as Op,m as Rp,n as Hy,o as qy,p as Lp,q as Gy,r as Up,s as Vy,t as Fy,u as $y,v as Qy,w as Yy,x as Bp,y as Hp,F as qp,z as Gp,B as Vp,E as Xy,G as Fp,H as $p,J as Qp,K as Yp,M as Xp,N as Kp,Q as Zp,U as Ky,W as Zy,X as Jy}from"./radix-extra-Cw1azsjZ.js";import{aj as Iy,ak as Py,al as Wy,am as eN,an as Gc,ao as Vc,ap as tr,aq as sN,ar as Su,as as Fc,at as tN,au as aN,av as lN}from"./charts-Dhri-zxi.js";import{S as nN,H as Jp,O as Ip,o as iN,C as Pp,p as Wp,T as eg,D as sg,R as rN,q as cN,I as tg,J as oN,K as ag,L as lg,M as dN,N as ng,V as uN,Q as ig,U as rg,X as mN,Y as hN,Z as cg,_ as xN,$ as fN,a0 as og,a1 as pN,a2 as gN,a3 as dg,a4 as jN,a5 as vN,a6 as yN,a7 as ug,a8 as mg,a9 as hg,aa as xg,ab as fg,ac as pg,ad as NN}from"./radix-core-BlBHu_Lw.js";import{R as pt,P as Nr,C as pa,a as Da,Z as ln,b as Wc,F as Aa,c as bN,S as Rl,A as wN,D as _N,d as eo,e as Wn,M as si,T as SN,X as li,f as gg,g as CN,I as Xt,h as ba,i as fa,j as so,E as mr,k as Zt,l as jg,H as kN,m as es,n as nl,U as hr,o as Ou,p as Ru,L as Yf,K as vg,q as ro,r as TN,s as dr,t as vt,u as EN,B as ir,v as to,w as $u,x as zN,y as MN,z as _t,G as xr,J as ti,N as Ll,O as fr,Q as AN,V as DN,W as br,Y as ot,_ as ao,$ as nn,a0 as wr,a1 as cn,a2 as il,a3 as _r,a4 as Qu,a5 as ON,a6 as RN,a7 as LN,a8 as rn,a9 as UN,aa as Lu,ab as pr,ac as BN,ad as HN,ae as Uu,af as qN,ag as yg,ah as Xf,ai as GN,aj as VN,ak as FN,al as Ol,am as Cu,an as Kf,ao as $N,ap as QN,aq as YN,ar as XN,as as KN,at as Ng,au as bg,av as wg,aw as ZN,ax as JN,ay as Zf,az as IN,aA as PN,aB as Jf,aC as WN,aD as eb}from"./icons-Bw5y5Hqz.js";import{S as sb,p as tb,j as ab,a as lb,E as If,R as nb,o as ib}from"./codemirror-BHeANvwm.js";import{_ as Lt,c as rb,g as _g,D as cb}from"./misc-Ii-X5qWA.js";import{u as ob,a as Pf,D as db,c as ub,S as mb,h as hb,b as xb,s as fb,K as pb,P as gb,d as jb,C as vb}from"./dnd-Dyi3CnuX.js";import{D as yb,U as Nb}from"./uppy-DSH7n_-V.js";import{M as bb,r as wb,a as _b,b as Sb}from"./markdown-A1ShuLvG.js";import{r as Cb,H as lo,P as no,u as kb,a as Tb,R as Eb,B as zb,b as Mb,C as Ab,M as Db,c as Ob}from"./reactflow-B3n3_Vkw.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))d(h);new MutationObserver(h=>{for(const x of h)if(x.type==="childList")for(const f of x.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&d(f)}).observe(document,{childList:!0,subtree:!0});function c(h){const x={};return h.integrity&&(x.integrity=h.integrity),h.referrerPolicy&&(x.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?x.credentials="include":h.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function d(h){if(h.ep)return;h.ep=!0;const x=c(h);fetch(h.href,x)}})();var ku={exports:{}},ar={},Tu={exports:{}},Eu={};var Wf;function Rb(){return Wf||(Wf=1,(function(n){function r(N,G){var q=N.length;N.push(G);e:for(;0>>1,_=N[ie];if(0>>1;ieh($,q))de<_&&0>h(ge,$)?(N[ie]=ge,N[de]=q,ie=de):(N[ie]=$,N[xe]=q,ie=xe);else if(de<_&&0>h(ge,q))N[ie]=ge,N[de]=q,ie=de;else break e}}return G}function h(N,G){var q=N.sortIndex-G.sortIndex;return q!==0?q:N.id-G.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;n.unstable_now=function(){return x.now()}}else{var f=Date,j=f.now();n.unstable_now=function(){return f.now()-j}}var p=[],w=[],v=1,k=null,T=3,E=!1,R=!1,K=!1,U=!1,A=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function z(N){for(var G=c(w);G!==null;){if(G.callback===null)d(w);else if(G.startTime<=N)d(w),G.sortIndex=G.expirationTime,r(p,G);else break;G=c(w)}}function B(N){if(K=!1,z(N),!R)if(c(p)!==null)R=!0,X||(X=!0,ye());else{var G=c(w);G!==null&&_e(B,G.startTime-N)}}var X=!1,S=-1,O=5,te=-1;function he(){return U?!0:!(n.unstable_now()-teN&&he());){var ie=k.callback;if(typeof ie=="function"){k.callback=null,T=k.priorityLevel;var _=ie(k.expirationTime<=N);if(N=n.unstable_now(),typeof _=="function"){k.callback=_,z(N),G=!0;break s}k===c(p)&&d(p),z(N)}else d(p);k=c(p)}if(k!==null)G=!0;else{var me=c(w);me!==null&&_e(B,me.startTime-N),G=!1}}break e}finally{k=null,T=q,E=!1}G=void 0}}finally{G?ye():X=!1}}}var ye;if(typeof H=="function")ye=function(){H(Ne)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,je=pe.port2;pe.port1.onmessage=Ne,ye=function(){je.postMessage(null)}}else ye=function(){A(Ne,0)};function _e(N,G){S=A(function(){N(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(N){N.callback=null},n.unstable_forceFrameRate=function(N){0>N||125ie?(N.sortIndex=q,r(w,N),c(p)===null&&N===c(w)&&(K?(Z(S),S=-1):K=!0,_e(B,q-ie))):(N.sortIndex=_,r(p,N),R||E||(R=!0,X||(X=!0,ye()))),N},n.unstable_shouldYield=he,n.unstable_wrapCallback=function(N){var G=T;return function(){var q=T;T=G;try{return N.apply(this,arguments)}finally{T=q}}}})(Eu)),Eu}var ep;function Lb(){return ep||(ep=1,Tu.exports=Rb()),Tu.exports}var sp;function Ub(){if(sp)return ar;sp=1;var n=Lb(),r=by(),c=wy();function d(s){var t="https://react.dev/errors/"+s;if(1_||(s.current=ie[_],ie[_]=null,_--)}function $(s,t){_++,ie[_]=s.current,s.current=t}var de=me(null),ge=me(null),le=me(null),L=me(null);function F(s,t){switch($(le,t),$(ge,s),$(de,null),t.nodeType){case 9:case 11:s=(s=t.documentElement)&&(s=s.namespaceURI)?ff(s):0;break;default:if(s=t.tagName,t=t.namespaceURI)t=ff(t),s=pf(t,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}xe(de),$(de,s)}function D(){xe(de),xe(ge),xe(le)}function ee(s){s.memoizedState!==null&&$(L,s);var t=de.current,a=pf(t,s.type);t!==a&&($(ge,s),$(de,a))}function we(s){ge.current===s&&(xe(de),xe(ge)),L.current===s&&(xe(L),Ji._currentValue=q)}var ze,ss;function Ze(s){if(ze===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ze=t&&t[1]||"",ss=-1)":-1i||C[l]!==I[i]){var ae=` -`+C[l].replace(" at new "," at ");return s.displayName&&ae.includes("")&&(ae=ae.replace("",s.displayName)),ae}while(1<=l&&0<=i);break}}}finally{Ls=!1,Error.prepareStackTrace=a}return(a=s?s.displayName||s.name:"")?Ze(a):""}function re(s,t){switch(s.tag){case 26:case 27:case 5:return Ze(s.type);case 16:return Ze("Lazy");case 13:return s.child!==t&&t!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return Gs(s.type,!1);case 11:return Gs(s.type.render,!1);case 1:return Gs(s.type,!0);case 31:return Ze("Activity");default:return""}}function be(s){try{var t="",a=null;do t+=re(s,a),a=s,s=s.return;while(s);return t}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}var Xe=Object.prototype.hasOwnProperty,Ue=n.unstable_scheduleCallback,st=n.unstable_cancelCallback,It=n.unstable_shouldYield,bt=n.unstable_requestPaint,Je=n.unstable_now,Be=n.unstable_getCurrentPriorityLevel,jt=n.unstable_ImmediatePriority,nt=n.unstable_UserBlockingPriority,St=n.unstable_NormalPriority,Ct=n.unstable_LowPriority,rl=n.unstable_IdlePriority,cl=n.log,ol=n.unstable_setDisableYieldValue,Se=null,Oe=null;function it(s){if(typeof cl=="function"&&ol(s),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Se,s)}catch{}}var dt=Math.clz32?Math.clz32:ut,di=Math.log,on=Math.LN2;function ut(s){return s>>>=0,s===0?32:31-(di(s)/on|0)|0}var Pt=256,Wt=262144,Ua=4194304;function Ut(s){var t=s&42;if(t!==0)return t;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ba(s,t,a){var l=s.pendingLanes;if(l===0)return 0;var i=0,o=s.suspendedLanes,m=s.pingedLanes;s=s.warmLanes;var g=l&134217727;return g!==0?(l=g&~o,l!==0?i=Ut(l):(m&=g,m!==0?i=Ut(m):a||(a=g&~s,a!==0&&(i=Ut(a))))):(g=l&~o,g!==0?i=Ut(g):m!==0?i=Ut(m):a||(a=l&~s,a!==0&&(i=Ut(a)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:i}function _a(s,t){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&t)===0}function W(s,t){switch(s){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ve(){var s=Ua;return Ua<<=1,(Ua&62914560)===0&&(Ua=4194304),s}function Me(s){for(var t=[],a=0;31>a;a++)t.push(s);return t}function tt(s,t){s.pendingLanes|=t,t!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Bt(s,t,a,l,i,o){var m=s.pendingLanes;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=a,s.entangledLanes&=a,s.errorRecoveryDisabledLanes&=a,s.shellSuspendCounter=0;var g=s.entanglements,C=s.expirationTimes,I=s.hiddenUpdates;for(a=m&~a;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var oj=/[\n"\\]/g;function aa(s){return s.replace(oj,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function go(s,t,a,l,i,o,m,g){s.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?s.type=m:s.removeAttribute("type"),t!=null?m==="number"?(t===0&&s.value===""||s.value!=t)&&(s.value=""+ta(t)):s.value!==""+ta(t)&&(s.value=""+ta(t)):m!=="submit"&&m!=="reset"||s.removeAttribute("value"),t!=null?jo(s,m,ta(t)):a!=null?jo(s,m,ta(a)):l!=null&&s.removeAttribute("value"),i==null&&o!=null&&(s.defaultChecked=!!o),i!=null&&(s.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?s.name=""+ta(g):s.removeAttribute("name")}function cm(s,t,a,l,i,o,m,g){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(s.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){po(s);return}a=a!=null?""+ta(a):"",t=t!=null?""+ta(t):a,g||t===s.value||(s.value=t),s.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,s.checked=g?s.checked:!!l,s.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(s.name=m),po(s)}function jo(s,t,a){t==="number"&&zr(s.ownerDocument)===s||s.defaultValue===""+a||(s.defaultValue=""+a)}function pn(s,t,a,l){if(s=s.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wo=!1;if(Ga)try{var xi={};Object.defineProperty(xi,"passive",{get:function(){wo=!0}}),window.addEventListener("test",xi,xi),window.removeEventListener("test",xi,xi)}catch{wo=!1}var ul=null,_o=null,Ar=null;function fm(){if(Ar)return Ar;var s,t=_o,a=t.length,l,i="value"in ul?ul.value:ul.textContent,o=i.length;for(s=0;s=gi),Nm=" ",bm=!1;function wm(s,t){switch(s){case"keyup":return Uj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _m(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var yn=!1;function Hj(s,t){switch(s){case"compositionend":return _m(t);case"keypress":return t.which!==32?null:(bm=!0,Nm);case"textInput":return s=t.data,s===Nm&&bm?null:s;default:return null}}function qj(s,t){if(yn)return s==="compositionend"||!Eo&&wm(s,t)?(s=fm(),Ar=_o=ul=null,yn=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-s};s=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Am(a)}}function Om(s,t){return s&&t?s===t?!0:s&&s.nodeType===3?!1:t&&t.nodeType===3?Om(s,t.parentNode):"contains"in s?s.contains(t):s.compareDocumentPosition?!!(s.compareDocumentPosition(t)&16):!1:!1}function Rm(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var t=zr(s.document);t instanceof s.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)s=t.contentWindow;else break;t=zr(s.document)}return t}function Ao(s){var t=s&&s.nodeName&&s.nodeName.toLowerCase();return t&&(t==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||t==="textarea"||s.contentEditable==="true")}var Kj=Ga&&"documentMode"in document&&11>=document.documentMode,Nn=null,Do=null,Ni=null,Oo=!1;function Lm(s,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Oo||Nn==null||Nn!==zr(l)||(l=Nn,"selectionStart"in l&&Ao(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ni&&yi(Ni,l)||(Ni=l,l=Sc(Do,"onSelect"),0>=m,i-=m,Ca=1<<32-dt(t)+i|a<Ie?(is=Te,Te=null):is=Te.sibling;var ys=P(V,Te,J[Ie],oe);if(ys===null){Te===null&&(Te=is);break}s&&Te&&ys.alternate===null&&t(V,Te),M=o(ys,M,Ie),vs===null?Ee=ys:vs.sibling=ys,vs=ys,Te=is}if(Ie===J.length)return a(V,Te),fs&&Fa(V,Ie),Ee;if(Te===null){for(;IeIe?(is=Te,Te=null):is=Te.sibling;var Dl=P(V,Te,ys.value,oe);if(Dl===null){Te===null&&(Te=is);break}s&&Te&&Dl.alternate===null&&t(V,Te),M=o(Dl,M,Ie),vs===null?Ee=Dl:vs.sibling=Dl,vs=Dl,Te=is}if(ys.done)return a(V,Te),fs&&Fa(V,Ie),Ee;if(Te===null){for(;!ys.done;Ie++,ys=J.next())ys=ue(V,ys.value,oe),ys!==null&&(M=o(ys,M,Ie),vs===null?Ee=ys:vs.sibling=ys,vs=ys);return fs&&Fa(V,Ie),Ee}for(Te=l(Te);!ys.done;Ie++,ys=J.next())ys=se(Te,V,Ie,ys.value,oe),ys!==null&&(s&&ys.alternate!==null&&Te.delete(ys.key===null?Ie:ys.key),M=o(ys,M,Ie),vs===null?Ee=ys:vs.sibling=ys,vs=ys);return s&&Te.forEach(function(xy){return t(V,xy)}),fs&&Fa(V,Ie),Ee}function ks(V,M,J,oe){if(typeof J=="object"&&J!==null&&J.type===K&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case E:e:{for(var Ee=J.key;M!==null;){if(M.key===Ee){if(Ee=J.type,Ee===K){if(M.tag===7){a(V,M.sibling),oe=i(M,J.props.children),oe.return=V,V=oe;break e}}else if(M.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===O&&Jl(Ee)===M.type){a(V,M.sibling),oe=i(M,J.props),ki(oe,J),oe.return=V,V=oe;break e}a(V,M);break}else t(V,M);M=M.sibling}J.type===K?(oe=Ql(J.props.children,V.mode,oe,J.key),oe.return=V,V=oe):(oe=Vr(J.type,J.key,J.props,null,V.mode,oe),ki(oe,J),oe.return=V,V=oe)}return m(V);case R:e:{for(Ee=J.key;M!==null;){if(M.key===Ee)if(M.tag===4&&M.stateNode.containerInfo===J.containerInfo&&M.stateNode.implementation===J.implementation){a(V,M.sibling),oe=i(M,J.children||[]),oe.return=V,V=oe;break e}else{a(V,M);break}else t(V,M);M=M.sibling}oe=Go(J,V.mode,oe),oe.return=V,V=oe}return m(V);case O:return J=Jl(J),ks(V,M,J,oe)}if(_e(J))return Ce(V,M,J,oe);if(ye(J)){if(Ee=ye(J),typeof Ee!="function")throw Error(d(150));return J=Ee.call(J),De(V,M,J,oe)}if(typeof J.then=="function")return ks(V,M,Zr(J),oe);if(J.$$typeof===H)return ks(V,M,Qr(V,J),oe);Jr(V,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,M!==null&&M.tag===6?(a(V,M.sibling),oe=i(M,J),oe.return=V,V=oe):(a(V,M),oe=qo(J,V.mode,oe),oe.return=V,V=oe),m(V)):a(V,M)}return function(V,M,J,oe){try{Ci=0;var Ee=ks(V,M,J,oe);return An=null,Ee}catch(Te){if(Te===Mn||Te===Xr)throw Te;var vs=qt(29,Te,null,V.mode);return vs.lanes=oe,vs.return=V,vs}finally{}}}var Pl=nh(!0),ih=nh(!1),pl=!1;function Wo(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ed(s,t){s=s.updateQueue,t.updateQueue===s&&(t.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function gl(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function jl(s,t,a){var l=s.updateQueue;if(l===null)return null;if(l=l.shared,(Ns&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Gr(s),Fm(s,null,a),t}return qr(s,l,t,a),Gr(s)}function Ti(s,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=s.pendingLanes,a|=l,t.lanes=a,dl(s,a)}}function sd(s,t){var a=s.updateQueue,l=s.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var i=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var m={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?i=o=m:o=o.next=m,a=a.next}while(a!==null);o===null?i=o=t:o=o.next=t}else i=o=t;a={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},s.updateQueue=a;return}s=a.lastBaseUpdate,s===null?a.firstBaseUpdate=t:s.next=t,a.lastBaseUpdate=t}var td=!1;function Ei(){if(td){var s=zn;if(s!==null)throw s}}function zi(s,t,a,l){td=!1;var i=s.updateQueue;pl=!1;var o=i.firstBaseUpdate,m=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var C=g,I=C.next;C.next=null,m===null?o=I:m.next=I,m=C;var ae=s.alternate;ae!==null&&(ae=ae.updateQueue,g=ae.lastBaseUpdate,g!==m&&(g===null?ae.firstBaseUpdate=I:g.next=I,ae.lastBaseUpdate=C))}if(o!==null){var ue=i.baseState;m=0,ae=I=C=null,g=o;do{var P=g.lane&-536870913,se=P!==g.lane;if(se?(ns&P)===P:(l&P)===P){P!==0&&P===En&&(td=!0),ae!==null&&(ae=ae.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var Ce=s,De=g;P=t;var ks=a;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){ue=Ce.call(ks,ue,P);break e}ue=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,P=typeof Ce=="function"?Ce.call(ks,ue,P):Ce,P==null)break e;ue=k({},ue,P);break e;case 2:pl=!0}}P=g.callback,P!==null&&(s.flags|=64,se&&(s.flags|=8192),se=i.callbacks,se===null?i.callbacks=[P]:se.push(P))}else se={lane:P,tag:g.tag,payload:g.payload,callback:g.callback,next:null},ae===null?(I=ae=se,C=ue):ae=ae.next=se,m|=P;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;se=g,g=se.next,se.next=null,i.lastBaseUpdate=se,i.shared.pending=null}}while(!0);ae===null&&(C=ue),i.baseState=C,i.firstBaseUpdate=I,i.lastBaseUpdate=ae,o===null&&(i.shared.lanes=0),wl|=m,s.lanes=m,s.memoizedState=ue}}function rh(s,t){if(typeof s!="function")throw Error(d(191,s));s.call(t)}function ch(s,t){var a=s.callbacks;if(a!==null)for(s.callbacks=null,s=0;so?o:8;var m=N.T,g={};N.T=g,Nd(s,!1,t,a);try{var C=i(),I=N.S;if(I!==null&&I(g,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var ae=av(C,l);Di(s,t,ae,Qt(s))}else Di(s,t,l,Qt(s))}catch(ue){Di(s,t,{then:function(){},status:"rejected",reason:ue},Qt())}finally{G.p=o,m!==null&&g.types!==null&&(m.types=g.types),N.T=m}}function ov(){}function vd(s,t,a,l){if(s.tag!==5)throw Error(d(476));var i=qh(s).queue;Hh(s,i,t,q,a===null?ov:function(){return Gh(s),a(l)})}function qh(s){var t=s.memoizedState;if(t!==null)return t;t={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:q},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:a},next:null},s.memoizedState=t,s=s.alternate,s!==null&&(s.memoizedState=t),t}function Gh(s){var t=qh(s);t.next===null&&(t=s.alternate.memoizedState),Di(s,t.next.queue,{},Qt())}function yd(){return ht(Ji)}function Vh(){return Ks().memoizedState}function Fh(){return Ks().memoizedState}function dv(s){for(var t=s.return;t!==null;){switch(t.tag){case 24:case 3:var a=Qt();s=gl(a);var l=jl(t,s,a);l!==null&&(Dt(l,t,a),Ti(l,t,a)),t={cache:Zo()},s.payload=t;return}t=t.return}}function uv(s,t,a){var l=Qt();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ic(s)?Qh(t,a):(a=Bo(s,t,a,l),a!==null&&(Dt(a,s,l),Yh(a,t,l)))}function $h(s,t,a){var l=Qt();Di(s,t,a,l)}function Di(s,t,a,l){var i={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ic(s))Qh(t,i);else{var o=s.alternate;if(s.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,g=o(m,a);if(i.hasEagerState=!0,i.eagerState=g,Ht(g,m))return qr(s,t,i,0),Es===null&&Hr(),!1}catch{}finally{}if(a=Bo(s,t,i,l),a!==null)return Dt(a,s,l),Yh(a,t,l),!0}return!1}function Nd(s,t,a,l){if(l={lane:2,revertLane:Wd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ic(s)){if(t)throw Error(d(479))}else t=Bo(s,a,l,2),t!==null&&Dt(t,s,2)}function ic(s){var t=s.alternate;return s===Ke||t!==null&&t===Ke}function Qh(s,t){On=Wr=!0;var a=s.pending;a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t}function Yh(s,t,a){if((a&4194048)!==0){var l=t.lanes;l&=s.pendingLanes,a|=l,t.lanes=a,dl(s,a)}}var Oi={readContext:ht,use:tc,useCallback:Vs,useContext:Vs,useEffect:Vs,useImperativeHandle:Vs,useLayoutEffect:Vs,useInsertionEffect:Vs,useMemo:Vs,useReducer:Vs,useRef:Vs,useState:Vs,useDebugValue:Vs,useDeferredValue:Vs,useTransition:Vs,useSyncExternalStore:Vs,useId:Vs,useHostTransitionStatus:Vs,useFormState:Vs,useActionState:Vs,useOptimistic:Vs,useMemoCache:Vs,useCacheRefresh:Vs};Oi.useEffectEvent=Vs;var Xh={readContext:ht,use:tc,useCallback:function(s,t){return wt().memoizedState=[s,t===void 0?null:t],s},useContext:ht,useEffect:zh,useImperativeHandle:function(s,t,a){a=a!=null?a.concat([s]):null,lc(4194308,4,Oh.bind(null,t,s),a)},useLayoutEffect:function(s,t){return lc(4194308,4,s,t)},useInsertionEffect:function(s,t){lc(4,2,s,t)},useMemo:function(s,t){var a=wt();t=t===void 0?null:t;var l=s();if(Wl){it(!0);try{s()}finally{it(!1)}}return a.memoizedState=[l,t],l},useReducer:function(s,t,a){var l=wt();if(a!==void 0){var i=a(t);if(Wl){it(!0);try{a(t)}finally{it(!1)}}}else i=t;return l.memoizedState=l.baseState=i,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:i},l.queue=s,s=s.dispatch=uv.bind(null,Ke,s),[l.memoizedState,s]},useRef:function(s){var t=wt();return s={current:s},t.memoizedState=s},useState:function(s){s=xd(s);var t=s.queue,a=$h.bind(null,Ke,t);return t.dispatch=a,[s.memoizedState,a]},useDebugValue:gd,useDeferredValue:function(s,t){var a=wt();return jd(a,s,t)},useTransition:function(){var s=xd(!1);return s=Hh.bind(null,Ke,s.queue,!0,!1),wt().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,t,a){var l=Ke,i=wt();if(fs){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),Es===null)throw Error(d(349));(ns&127)!==0||xh(l,t,a)}i.memoizedState=a;var o={value:a,getSnapshot:t};return i.queue=o,zh(ph.bind(null,l,o,s),[s]),l.flags|=2048,Ln(9,{destroy:void 0},fh.bind(null,l,o,a,t),null),a},useId:function(){var s=wt(),t=Es.identifierPrefix;if(fs){var a=ka,l=Ca;a=(l&~(1<<32-dt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ec++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?m.createElement(i,{is:l.is}):m.createElement(i)}}o[Ge]=t,o[xs]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(ft(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Za(t)}}return Os(t),Rd(t,t.type,s===null?null:s.memoizedProps,t.pendingProps,a),null;case 6:if(s&&t.stateNode!=null)s.memoizedProps!==l&&Za(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(d(166));if(s=le.current,kn(t)){if(s=t.stateNode,a=t.memoizedProps,l=null,i=mt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}s[Ge]=t,s=!!(s.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||hf(s.nodeValue,a)),s||xl(t,!0)}else s=Cc(s).createTextNode(l),s[Ge]=t,t.stateNode=s}return Os(t),null;case 31:if(a=t.memoizedState,s===null||s.memoizedState!==null){if(l=kn(t),a!==null){if(s===null){if(!l)throw Error(d(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(d(557));s[Ge]=t}else Yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Os(t),s=!1}else a=Qo(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=a),s=!0;if(!s)return t.flags&256?(Vt(t),t):(Vt(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Os(t),null;case 13:if(l=t.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(i=kn(t),l!==null&&l.dehydrated!==null){if(s===null){if(!i)throw Error(d(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(d(317));i[Ge]=t}else Yl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Os(t),i=!1}else i=Qo(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Vt(t),t):(Vt(t),null)}return Vt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,s=s!==null&&s.memoizedState!==null,a&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),a!==s&&a&&(t.child.flags|=8192),uc(t,t.updateQueue),Os(t),null);case 4:return D(),s===null&&au(t.stateNode.containerInfo),Os(t),null;case 10:return Qa(t.type),Os(t),null;case 19:if(xe(Xs),l=t.memoizedState,l===null)return Os(t),null;if(i=(t.flags&128)!==0,o=l.rendering,o===null)if(i)Li(l,!1);else{if(Fs!==0||s!==null&&(s.flags&128)!==0)for(s=t.child;s!==null;){if(o=Pr(s),o!==null){for(t.flags|=128,Li(l,!1),s=o.updateQueue,t.updateQueue=s,uc(t,s),t.subtreeFlags=0,s=a,a=t.child;a!==null;)$m(a,s),a=a.sibling;return $(Xs,Xs.current&1|2),fs&&Fa(t,l.treeForkCount),t.child}s=s.sibling}l.tail!==null&&Je()>pc&&(t.flags|=128,i=!0,Li(l,!1),t.lanes=4194304)}else{if(!i)if(s=Pr(o),s!==null){if(t.flags|=128,i=!0,s=s.updateQueue,t.updateQueue=s,uc(t,s),Li(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!fs)return Os(t),null}else 2*Je()-l.renderingStartTime>pc&&a!==536870912&&(t.flags|=128,i=!0,Li(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(s=l.last,s!==null?s.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(s=l.tail,l.rendering=s,l.tail=s.sibling,l.renderingStartTime=Je(),s.sibling=null,a=Xs.current,$(Xs,i?a&1|2:a&1),fs&&Fa(t,l.treeForkCount),s):(Os(t),null);case 22:case 23:return Vt(t),ld(),l=t.memoizedState!==null,s!==null?s.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Os(t),t.subtreeFlags&6&&(t.flags|=8192)):Os(t),a=t.updateQueue,a!==null&&uc(t,a.retryQueue),a=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),s!==null&&xe(Zl),null;case 24:return a=null,s!==null&&(a=s.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Qa(Is),Os(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function pv(s,t){switch(Fo(t),t.tag){case 1:return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 3:return Qa(Is),D(),s=t.flags,(s&65536)!==0&&(s&128)===0?(t.flags=s&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(Vt(t),t.alternate===null)throw Error(d(340));Yl()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 13:if(Vt(t),s=t.memoizedState,s!==null&&s.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Yl()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 19:return xe(Xs),null;case 4:return D(),null;case 10:return Qa(t.type),null;case 22:case 23:return Vt(t),ld(),s!==null&&xe(Zl),s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 24:return Qa(Is),null;case 25:return null;default:return null}}function gx(s,t){switch(Fo(t),t.tag){case 3:Qa(Is),D();break;case 26:case 27:case 5:we(t);break;case 4:D();break;case 31:t.memoizedState!==null&&Vt(t);break;case 13:Vt(t);break;case 19:xe(Xs);break;case 10:Qa(t.type);break;case 22:case 23:Vt(t),ld(),s!==null&&xe(Zl);break;case 24:Qa(Is)}}function Ui(s,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&s)===s){l=void 0;var o=a.create,m=a.inst;l=o(),m.destroy=l}a=a.next}while(a!==i)}}catch(g){_s(t,t.return,g)}}function Nl(s,t,a){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&s)===s){var m=l.inst,g=m.destroy;if(g!==void 0){m.destroy=void 0,i=t;var C=a,I=g;try{I()}catch(ae){_s(i,C,ae)}}}l=l.next}while(l!==o)}}catch(ae){_s(t,t.return,ae)}}function jx(s){var t=s.updateQueue;if(t!==null){var a=s.stateNode;try{ch(t,a)}catch(l){_s(s,s.return,l)}}}function vx(s,t,a){a.props=en(s.type,s.memoizedProps),a.state=s.memoizedState;try{a.componentWillUnmount()}catch(l){_s(s,t,l)}}function Bi(s,t){try{var a=s.ref;if(a!==null){switch(s.tag){case 26:case 27:case 5:var l=s.stateNode;break;case 30:l=s.stateNode;break;default:l=s.stateNode}typeof a=="function"?s.refCleanup=a(l):a.current=l}}catch(i){_s(s,t,i)}}function Ta(s,t){var a=s.ref,l=s.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(i){_s(s,t,i)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){_s(s,t,i)}else a.current=null}function yx(s){var t=s.type,a=s.memoizedProps,l=s.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(i){_s(s,s.return,i)}}function Ld(s,t,a){try{var l=s.stateNode;Bv(l,s.type,a,t),l[xs]=t}catch(i){_s(s,s.return,i)}}function Nx(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Tl(s.type)||s.tag===4}function Ud(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Nx(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Tl(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Bd(s,t,a){var l=s.tag;if(l===5||l===6)s=s.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(s,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(s),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=qa));else if(l!==4&&(l===27&&Tl(s.type)&&(a=s.stateNode,t=null),s=s.child,s!==null))for(Bd(s,t,a),s=s.sibling;s!==null;)Bd(s,t,a),s=s.sibling}function mc(s,t,a){var l=s.tag;if(l===5||l===6)s=s.stateNode,t?a.insertBefore(s,t):a.appendChild(s);else if(l!==4&&(l===27&&Tl(s.type)&&(a=s.stateNode),s=s.child,s!==null))for(mc(s,t,a),s=s.sibling;s!==null;)mc(s,t,a),s=s.sibling}function bx(s){var t=s.stateNode,a=s.memoizedProps;try{for(var l=s.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ft(t,l,a),t[Ge]=s,t[xs]=a}catch(o){_s(s,s.return,o)}}var Ja=!1,et=!1,Hd=!1,wx=typeof WeakSet=="function"?WeakSet:Set,ct=null;function gv(s,t){if(s=s.containerInfo,iu=Dc,s=Rm(s),Ao(s)){if("selectionStart"in s)var a={start:s.selectionStart,end:s.selectionEnd};else e:{a=(a=s.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var m=0,g=-1,C=-1,I=0,ae=0,ue=s,P=null;s:for(;;){for(var se;ue!==a||i!==0&&ue.nodeType!==3||(g=m+i),ue!==o||l!==0&&ue.nodeType!==3||(C=m+l),ue.nodeType===3&&(m+=ue.nodeValue.length),(se=ue.firstChild)!==null;)P=ue,ue=se;for(;;){if(ue===s)break s;if(P===a&&++I===i&&(g=m),P===o&&++ae===l&&(C=m),(se=ue.nextSibling)!==null)break;ue=P,P=ue.parentNode}ue=se}a=g===-1||C===-1?null:{start:g,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(ru={focusedElem:s,selectionRange:a},Dc=!1,ct=t;ct!==null;)if(t=ct,s=t.child,(t.subtreeFlags&1028)!==0&&s!==null)s.return=t,ct=s;else for(;ct!==null;){switch(t=ct,o=t.alternate,s=t.flags,t.tag){case 0:if((s&4)!==0&&(s=t.updateQueue,s=s!==null?s.events:null,s!==null))for(a=0;a title"))),ft(o,l,a),o[Ge]=s,rt(o),l=o;break e;case"link":var m=zf("link","href",i).get(l+(a.href||""));if(m){for(var g=0;gks&&(m=ks,ks=De,De=m);var V=Dm(g,De),M=Dm(g,ks);if(V&&M&&(se.rangeCount!==1||se.anchorNode!==V.node||se.anchorOffset!==V.offset||se.focusNode!==M.node||se.focusOffset!==M.offset)){var J=ue.createRange();J.setStart(V.node,V.offset),se.removeAllRanges(),De>ks?(se.addRange(J),se.extend(M.node,M.offset)):(J.setEnd(M.node,M.offset),se.addRange(J))}}}}for(ue=[],se=g;se=se.parentNode;)se.nodeType===1&&ue.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;ga?32:a,N.T=null,a=Yd,Yd=null;var o=Sl,m=sl;if(at=0,Gn=Sl=null,sl=0,(Ns&6)!==0)throw Error(d(331));var g=Ns;if(Ns|=4,Ox(o.current),Mx(o,o.current,m,a),Ns=g,$i(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Se,o)}catch{}return!0}finally{G.p=i,N.T=l,Px(s,t)}}function ef(s,t,a){t=na(a,t),t=Sd(s.stateNode,t,2),s=jl(s,t,2),s!==null&&(tt(s,2),Ea(s))}function _s(s,t,a){if(s.tag===3)ef(s,s,a);else for(;t!==null;){if(t.tag===3){ef(t,s,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(_l===null||!_l.has(l))){s=na(a,s),a=sx(2),l=jl(t,a,2),l!==null&&(tx(a,l,t,s),tt(l,2),Ea(l));break}}t=t.return}}function Jd(s,t,a){var l=s.pingCache;if(l===null){l=s.pingCache=new yv;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(a)||(Vd=!0,i.add(a),s=Sv.bind(null,s,t,a),t.then(s,s))}function Sv(s,t,a){var l=s.pingCache;l!==null&&l.delete(t),s.pingedLanes|=s.suspendedLanes&a,s.warmLanes&=~a,Es===s&&(ns&a)===a&&(Fs===4||Fs===3&&(ns&62914560)===ns&&300>Je()-fc?(Ns&2)===0&&Vn(s,0):Fd|=a,qn===ns&&(qn=0)),Ea(s)}function sf(s,t){t===0&&(t=ve()),s=$l(s,t),s!==null&&(tt(s,t),Ea(s))}function Cv(s){var t=s.memoizedState,a=0;t!==null&&(a=t.retryLane),sf(s,a)}function kv(s,t){var a=0;switch(s.tag){case 31:case 13:var l=s.stateNode,i=s.memoizedState;i!==null&&(a=i.retryLane);break;case 19:l=s.stateNode;break;case 22:l=s.stateNode._retryCache;break;default:throw Error(d(314))}l!==null&&l.delete(t),sf(s,a)}function Tv(s,t){return Ue(s,t)}var bc=null,$n=null,Id=!1,wc=!1,Pd=!1,kl=0;function Ea(s){s!==$n&&s.next===null&&($n===null?bc=$n=s:$n=$n.next=s),wc=!0,Id||(Id=!0,zv())}function $i(s,t){if(!Pd&&wc){Pd=!0;do for(var a=!1,l=bc;l!==null;){if(s!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var m=l.suspendedLanes,g=l.pingedLanes;o=(1<<31-dt(42|s)+1)-1,o&=i&~(m&~g),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,nf(l,o))}else o=ns,o=Ba(l,l===Es?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||_a(l,o)||(a=!0,nf(l,o));l=l.next}while(a);Pd=!1}}function Ev(){tf()}function tf(){wc=Id=!1;var s=0;kl!==0&&qv()&&(s=kl);for(var t=Je(),a=null,l=bc;l!==null;){var i=l.next,o=af(l,t);o===0?(l.next=null,a===null?bc=i:a.next=i,i===null&&($n=a)):(a=l,(s!==0||(o&3)!==0)&&(wc=!0)),l=i}at!==0&&at!==5||$i(s),kl!==0&&(kl=0)}function af(s,t){for(var a=s.suspendedLanes,l=s.pingedLanes,i=s.expirationTimes,o=s.pendingLanes&-62914561;0g)break;var ae=C.transferSize,ue=C.initiatorType;ae&&xf(ue)&&(C=C.responseEnd,m+=ae*(C"u"?null:document;function Cf(s,t,a){var l=Qn;if(l&&typeof t=="string"&&t){var i=aa(t);i='link[rel="'+s+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Sf.has(i)||(Sf.add(i),s={rel:s,crossOrigin:a,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),ft(t,"link",s),rt(t),l.head.appendChild(t)))}}function Zv(s){tl.D(s),Cf("dns-prefetch",s,null)}function Jv(s,t){tl.C(s,t),Cf("preconnect",s,t)}function Iv(s,t,a){tl.L(s,t,a);var l=Qn;if(l&&s&&t){var i='link[rel="preload"][as="'+aa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+aa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+aa(a.imageSizes)+'"]')):i+='[href="'+aa(s)+'"]';var o=i;switch(t){case"style":o=Yn(s);break;case"script":o=Xn(s)}ua.has(o)||(s=k({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:s,as:t},a),ua.set(o,s),l.querySelector(i)!==null||t==="style"&&l.querySelector(Ki(o))||t==="script"&&l.querySelector(Zi(o))||(t=l.createElement("link"),ft(t,"link",s),rt(t),l.head.appendChild(t)))}}function Pv(s,t){tl.m(s,t);var a=Qn;if(a&&s){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+aa(l)+'"][href="'+aa(s)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Xn(s)}if(!ua.has(o)&&(s=k({rel:"modulepreload",href:s},t),ua.set(o,s),a.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Zi(o)))return}l=a.createElement("link"),ft(l,"link",s),rt(l),a.head.appendChild(l)}}}function Wv(s,t,a){tl.S(s,t,a);var l=Qn;if(l&&s){var i=xn(l).hoistableStyles,o=Yn(s);t=t||"default";var m=i.get(o);if(!m){var g={loading:0,preload:null};if(m=l.querySelector(Ki(o)))g.loading=5;else{s=k({rel:"stylesheet",href:s,"data-precedence":t},a),(a=ua.get(o))&&xu(s,a);var C=m=l.createElement("link");rt(C),ft(C,"link",s),C._p=new Promise(function(I,ae){C.onload=I,C.onerror=ae}),C.addEventListener("load",function(){g.loading|=1}),C.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Tc(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:g},i.set(o,m)}}}function ey(s,t){tl.X(s,t);var a=Qn;if(a&&s){var l=xn(a).hoistableScripts,i=Xn(s),o=l.get(i);o||(o=a.querySelector(Zi(i)),o||(s=k({src:s,async:!0},t),(t=ua.get(i))&&fu(s,t),o=a.createElement("script"),rt(o),ft(o,"link",s),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function sy(s,t){tl.M(s,t);var a=Qn;if(a&&s){var l=xn(a).hoistableScripts,i=Xn(s),o=l.get(i);o||(o=a.querySelector(Zi(i)),o||(s=k({src:s,async:!0,type:"module"},t),(t=ua.get(i))&&fu(s,t),o=a.createElement("script"),rt(o),ft(o,"link",s),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function kf(s,t,a,l){var i=(i=le.current)?kc(i):null;if(!i)throw Error(d(446));switch(s){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Yn(a.href),a=xn(i).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){s=Yn(a.href);var o=xn(i).hoistableStyles,m=o.get(s);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(s,m),(o=i.querySelector(Ki(s)))&&!o._p&&(m.instance=o,m.state.loading=5),ua.has(s)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ua.set(s,a),o||ty(i,s,a,m.state))),t&&l===null)throw Error(d(528,""));return m}if(t&&l!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xn(a),a=xn(i).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,s))}}function Yn(s){return'href="'+aa(s)+'"'}function Ki(s){return'link[rel="stylesheet"]['+s+"]"}function Tf(s){return k({},s,{"data-precedence":s.precedence,precedence:null})}function ty(s,t,a,l){s.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=s.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ft(t,"link",a),rt(t),s.head.appendChild(t))}function Xn(s){return'[src="'+aa(s)+'"]'}function Zi(s){return"script[async]"+s}function Ef(s,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=s.querySelector('style[data-href~="'+aa(a.href)+'"]');if(l)return t.instance=l,rt(l),l;var i=k({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(s.ownerDocument||s).createElement("style"),rt(l),ft(l,"style",i),Tc(l,a.precedence,s),t.instance=l;case"stylesheet":i=Yn(a.href);var o=s.querySelector(Ki(i));if(o)return t.state.loading|=4,t.instance=o,rt(o),o;l=Tf(a),(i=ua.get(i))&&xu(l,i),o=(s.ownerDocument||s).createElement("link"),rt(o);var m=o;return m._p=new Promise(function(g,C){m.onload=g,m.onerror=C}),ft(o,"link",l),t.state.loading|=4,Tc(o,a.precedence,s),t.instance=o;case"script":return o=Xn(a.src),(i=s.querySelector(Zi(o)))?(t.instance=i,rt(i),i):(l=a,(i=ua.get(o))&&(l=k({},a),fu(l,i)),s=s.ownerDocument||s,i=s.createElement("script"),rt(i),ft(i,"link",l),s.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Tc(l,a.precedence,s));return t.instance}function Tc(s,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,m=0;m title"):null)}function ay(s,t,a){if(a===1||t.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return s=t.disabled,typeof t.precedence=="string"&&s==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Af(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function ly(s,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=Yn(l.href),o=t.querySelector(Ki(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(s.count++,s=zc.bind(s),t.then(s,s)),a.state.loading|=4,a.instance=o,rt(o);return}o=t.ownerDocument||t,l=Tf(l),(i=ua.get(i))&&xu(l,i),o=o.createElement("link"),rt(o);var m=o;m._p=new Promise(function(g,C){m.onload=g,m.onerror=C}),ft(o,"link",l),a.instance=o}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(s.count++,a=zc.bind(s),t.addEventListener("load",a),t.addEventListener("error",a))}}var pu=0;function ny(s,t){return s.stylesheets&&s.count===0&&Ac(s,s.stylesheets),0pu?50:800)+t);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function zc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Mc=null;function Ac(s,t){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Mc=new Map,t.forEach(iy,s),Mc=null,zc.call(s))}function iy(s,t){if(!(t.state.loading&4)){var a=Mc.get(s);if(a)var l=a.get(null);else{a=new Map,Mc.set(s,a);for(var i=s.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),ku.exports=Ub(),ku.exports}var Hb=Bb();function Q(...n){return Sy(Cy(n))}const Fe=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("rounded-xl border bg-card text-card-foreground shadow",n),...r}));Fe.displayName="Card";const gs=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("flex flex-col space-y-1.5 p-6",n),...r}));gs.displayName="CardHeader";const js=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("font-semibold leading-none tracking-tight",n),...r}));js.displayName="CardTitle";const Zs=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("text-sm text-muted-foreground",n),...r}));Zs.displayName="CardDescription";const bs=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("p-6 pt-0",n),...r}));bs.displayName="CardContent";const Sg=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("flex items-center p-6 pt-0",n),...r}));Sg.displayName="CardFooter";const Kt=Ey,Rt=u.forwardRef(({className:n,...r},c)=>e.jsx(bp,{ref:c,className:Q("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...r}));Rt.displayName=bp.displayName;const $e=u.forwardRef(({className:n,...r},c)=>e.jsx(wp,{ref:c,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 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",n),...r}));$e.displayName=wp.displayName;const We=u.forwardRef(({className:n,...r},c)=>e.jsx(_p,{ref:c,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",n),...r}));We.displayName=_p.displayName;const Pe=u.forwardRef(({className:n,children:r,viewportRef:c,...d},h)=>e.jsxs(Sp,{ref:h,className:Q("relative overflow-hidden",n),...d,children:[e.jsx(zy,{ref:c,className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Bu,{}),e.jsx(Bu,{orientation:"horizontal"}),e.jsx(My,{})]}));Pe.displayName=Sp.displayName;const Bu=u.forwardRef(({className:n,orientation:r="vertical",...c},d)=>e.jsx(Cp,{ref:d,orientation:r,className:Q("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...c,children:e.jsx(Ay,{className:"relative flex-1 rounded-full bg-border"})}));Bu.displayName=Cp.displayName;function qb({className:n,...r}){return e.jsx("div",{className:Q("animate-pulse rounded-md bg-primary/10",n),...r})}const Sr=u.forwardRef(({className:n,value:r,...c},d)=>e.jsx(kp,{ref:d,className:Q("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...c,children:e.jsx(Dy,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));Sr.displayName=kp.displayName;const Gb={light:"",dark:".dark"},Cg=u.createContext(null);function kg(){const n=u.useContext(Cg);if(!n)throw new Error("useChart must be used within a ");return n}const Zn=u.forwardRef(({id:n,className:r,children:c,config:d,...h},x)=>{const f=u.useId(),j=`chart-${n||f.replace(/:/g,"")}`;return e.jsx(Cg.Provider,{value:{config:d},children:e.jsxs("div",{"data-chart":j,ref:x,className:Q("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",r),...h,children:[e.jsx(Vb,{id:j,config:d}),e.jsx(Iy,{children:c})]})})});Zn.displayName="Chart";const Vb=({id:n,config:r})=>{const c=Object.entries(r).filter(([,d])=>d.theme||d.color);return c.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Gb).map(([d,h])=>` -${h} [data-chart=${n}] { -${c.map(([x,f])=>{const j=f.theme?.[d]||f.color;return j?` --color-${x}: ${j};`:null}).join(` -`)} -} -`).join(` -`)}}):null},lr=Py,Jn=u.forwardRef(({active:n,payload:r,className:c,indicator:d="dot",hideLabel:h=!1,hideIndicator:x=!1,label:f,labelFormatter:j,labelClassName:p,formatter:w,color:v,nameKey:k,labelKey:T},E)=>{const{config:R}=kg(),K=u.useMemo(()=>{if(h||!r?.length)return null;const[A]=r,Z=`${T||A?.dataKey||A?.name||"value"}`,H=Hu(R,A,Z),z=!T&&typeof f=="string"?R[f]?.label||f:H?.label;return j?e.jsx("div",{className:Q("font-medium",p),children:j(z,r)}):z?e.jsx("div",{className:Q("font-medium",p),children:z}):null},[f,j,r,h,p,R,T]);if(!n||!r?.length)return null;const U=r.length===1&&d!=="dot";return e.jsxs("div",{ref:E,className:Q("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",c),children:[U?null:K,e.jsx("div",{className:"grid gap-1.5",children:r.filter(A=>A.type!=="none").map((A,Z)=>{const H=`${k||A.name||A.dataKey||"value"}`,z=Hu(R,A,H),B=v||A.payload.fill||A.color;return e.jsx("div",{className:Q("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",d==="dot"&&"items-center"),children:w&&A?.value!==void 0&&A.name?w(A.value,A.name,A,Z,A.payload):e.jsxs(e.Fragment,{children:[z?.icon?e.jsx(z.icon,{}):!x&&e.jsx("div",{className:Q("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":d==="dot","w-1":d==="line","w-0 border-[1.5px] border-dashed bg-transparent":d==="dashed","my-0.5":U&&d==="dashed"}),style:{"--color-bg":B,"--color-border":B}}),e.jsxs("div",{className:Q("flex flex-1 justify-between leading-none",U?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[U?K:null,e.jsx("span",{className:"text-muted-foreground",children:z?.label||A.name})]}),A.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:A.value.toLocaleString()})]})]})},A.dataKey)})})]})});Jn.displayName="ChartTooltip";const Fb=Wy,Tg=u.forwardRef(({className:n,hideIcon:r=!1,payload:c,verticalAlign:d="bottom",nameKey:h},x)=>{const{config:f}=kg();return c?.length?e.jsx("div",{ref:x,className:Q("flex items-center justify-center gap-4",d==="top"?"pb-3":"pt-3",n),children:c.filter(j=>j.type!=="none").map(j=>{const p=`${h||j.dataKey||"value"}`,w=Hu(f,j,p);return e.jsxs("div",{className:Q("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[w?.icon&&!r?e.jsx(w.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:j.color}}),w?.label]},j.value)})}):null});Tg.displayName="ChartLegend";function Hu(n,r,c){if(typeof r!="object"||r===null)return;const d="payload"in r&&typeof r.payload=="object"&&r.payload!==null?r.payload:void 0;let h=c;return c in r&&typeof r[c]=="string"?h=r[c]:d&&c in d&&typeof d[c]=="string"&&(h=d[c]),h in n?n[h]:n[c]}const gr=ai("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),y=u.forwardRef(({className:n,variant:r,size:c,asChild:d=!1,...h},x)=>{const f=d?nN:"button";return e.jsx(f,{className:Q(gr({variant:r,size:c,className:n})),ref:x,...h})});y.displayName="Button";const $b=ai("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ye({className:n,variant:r,...c}){return e.jsx("div",{className:Q($b({variant:r}),n),...c})}const Qb=5,Yb=5e3;let zu=0;function Xb(){return zu=(zu+1)%Number.MAX_SAFE_INTEGER,zu.toString()}const Mu=new Map,ap=n=>{if(Mu.has(n))return;const r=setTimeout(()=>{Mu.delete(n),ur({type:"REMOVE_TOAST",toastId:n})},Yb);Mu.set(n,r)},Kb=(n,r)=>{switch(r.type){case"ADD_TOAST":return{...n,toasts:[r.toast,...n.toasts].slice(0,Qb)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(c=>c.id===r.toast.id?{...c,...r.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=r;return c?ap(c):n.toasts.forEach(d=>{ap(d.id)}),{...n,toasts:n.toasts.map(d=>d.id===c||c===void 0?{...d,open:!1}:d)}}case"REMOVE_TOAST":return r.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(c=>c.id!==r.toastId)}}},Zc=[];let Jc={toasts:[]};function ur(n){Jc=Kb(Jc,n),Zc.forEach(r=>{r(Jc)})}function Zb({...n}){const r=Xb(),c=h=>ur({type:"UPDATE_TOAST",toast:{...h,id:r}}),d=()=>ur({type:"DISMISS_TOAST",toastId:r});return ur({type:"ADD_TOAST",toast:{...n,id:r,open:!0,onOpenChange:h=>{h||d()}}}),{id:r,dismiss:d,update:c}}function Hs(){const[n,r]=u.useState(Jc);return u.useEffect(()=>(Zc.push(r),()=>{const c=Zc.indexOf(r);c>-1&&Zc.splice(c,1)}),[n]),{...n,toast:Zb,dismiss:c=>ur({type:"DISMISS_TOAST",toastId:c})}}const Jb=n=>{const r=[];for(let c=0;c{try{E(!0);const q=await qc.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");k({hitokoto:q.data.hitokoto,from:q.data.from||q.data.from_who||"未知"})}catch(q){console.error("获取一言失败:",q),k({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{E(!1)}},[]),z=u.useCallback(async()=>{try{const q=localStorage.getItem("access-token"),ie=await qc.get("/api/webui/system/status",{headers:{Authorization:`Bearer ${q}`}});K(ie.data)}catch(q){console.error("获取机器人状态失败:",q),K(null)}},[]),B=async()=>{if(!U)try{A(!0);const q=localStorage.getItem("access-token");await qc.post("/api/webui/system/restart",{},{headers:{Authorization:`Bearer ${q}`}}),Z({title:"重启中",description:"麦麦正在重启,请稍候..."}),setTimeout(()=>{z(),A(!1)},3e3)}catch(q){console.error("重启失败:",q),Z({title:"重启失败",description:"无法重启麦麦,请检查控制台",variant:"destructive"}),A(!1)}},X=u.useCallback(async()=>{try{const q=localStorage.getItem("access-token"),ie=await qc.get(`/api/webui/statistics/dashboard?hours=${f}`,{headers:{Authorization:`Bearer ${q}`}});r(ie.data),d(!1),x(100)}catch(q){console.error("Failed to fetch dashboard data:",q),d(!1),x(100)}},[f]);if(u.useEffect(()=>{if(!c)return;x(0);const q=setTimeout(()=>x(15),200),ie=setTimeout(()=>x(30),800),_=setTimeout(()=>x(45),2e3),me=setTimeout(()=>x(60),4e3),xe=setTimeout(()=>x(75),6500),$=setTimeout(()=>x(85),9e3),de=setTimeout(()=>x(92),11e3);return()=>{clearTimeout(q),clearTimeout(ie),clearTimeout(_),clearTimeout(me),clearTimeout(xe),clearTimeout($),clearTimeout(de)}},[c]),u.useEffect(()=>{X(),H(),z()},[X,H,z]),u.useEffect(()=>{if(!p)return;const q=setInterval(()=>{X(),z()},3e4);return()=>clearInterval(q)},[p,X,z]),c||!n)return e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:e.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[e.jsx(pt,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Sr,{value:h,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h,"%"]})]})]})});const{summary:S,model_stats:O=[],hourly_data:te=[],daily_data:he=[],recent_activity:Ne=[]}=n,ye=S??{total_requests:0,total_cost:0,total_tokens:0,online_time:0,total_messages:0,total_replies:0,avg_response_time:0,cost_per_hour:0,tokens_per_hour:0},pe=q=>{const ie=Math.floor(q/3600),_=Math.floor(q%3600/60);return`${ie}小时${_}分钟`},je=q=>new Date(q).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),_e=Jb(O.length),N=O.map((q,ie)=>({name:q.model_name,value:q.request_count,fill:_e[ie]})),G={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Kt,{value:f.toString(),onValueChange:q=>j(Number(q)),children:e.jsxs(Rt,{className:"grid grid-cols-3 w-full sm:w-auto",children:[e.jsx($e,{value:"24",children:"24小时"}),e.jsx($e,{value:"168",children:"7天"}),e.jsx($e,{value:"720",children:"30天"})]})}),e.jsxs(y,{variant:p?"default":"outline",size:"sm",onClick:()=>w(!p),className:"gap-2",children:[e.jsx(pt,{className:`h-4 w-4 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:X,children:e.jsx(pt,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[T?e.jsx(qb,{className:"h-5 flex-1"}):v?e.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',v.hitokoto,'" —— ',v.from]}):null,e.jsx(y,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:H,disabled:T,children:e.jsx(pt,{className:`h-3.5 w-3.5 ${T?"animate-spin":""}`})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[e.jsxs(Fe,{className:"lg:col-span-1",children:[e.jsx(gs,{className:"pb-3",children:e.jsxs(js,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Nr,{className:"h-4 w-4"}),"麦麦状态"]})}),e.jsx(bs,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:R?.running?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),e.jsxs(Ye,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[e.jsx(pa,{className:"h-3 w-3 mr-1"}),"运行中"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-red-500"}),e.jsxs(Ye,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[e.jsx(Da,{className:"h-3 w-3 mr-1"}),"已停止"]})]})}),R&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("span",{children:["v",R.version]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsxs("span",{children:["运行 ",pe(R.uptime)]})]})]})})]}),e.jsxs(Fe,{className:"lg:col-span-2",children:[e.jsx(gs,{className:"pb-3",children:e.jsxs(js,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ln,{className:"h-4 w-4"}),"快速操作"]})}),e.jsx(bs,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:B,disabled:U,className:"gap-2",children:[e.jsx(Wc,{className:`h-4 w-4 ${U?"animate-spin":""}`}),U?"重启中...":"重启麦麦"]}),e.jsx(y,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Kc,{to:"/logs",children:[e.jsx(Aa,{className:"h-4 w-4"}),"查看日志"]})}),e.jsx(y,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Kc,{to:"/plugins",children:[e.jsx(bN,{className:"h-4 w-4"}),"插件管理"]})}),e.jsx(y,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Kc,{to:"/settings",children:[e.jsx(Rl,{className:"h-4 w-4"}),"系统设置"]})})]})})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"总请求数"}),e.jsx(wN,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:ye.total_requests.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",f<48?f+"小时":Math.floor(f/24)+"天"]})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"总花费"}),e.jsx(_N,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["¥",ye.total_cost.toFixed(2)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ye.cost_per_hour>0?`¥${ye.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"Token消耗"}),e.jsx(eo,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[(ye.total_tokens/1e3).toFixed(1),"K"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ye.tokens_per_hour>0?`${(ye.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"平均响应"}),e.jsx(ln,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[ye.avg_response_time.toFixed(2),"s"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"在线时长"}),e.jsx(Wn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(bs,{children:e.jsx("div",{className:"text-xl font-bold",children:pe(ye.online_time)})})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"消息处理"}),e.jsx(si,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-xl font-bold",children:ye.total_messages.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",ye.total_replies.toLocaleString()," 条"]})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"成本效率"}),e.jsx(SN,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-xl font-bold",children:ye.total_messages>0?`¥${(ye.total_cost/ye.total_messages*100).toFixed(2)}`:"¥0.00"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),e.jsxs(Kt,{defaultValue:"trends",className:"space-y-4",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[e.jsx($e,{value:"trends",children:"趋势"}),e.jsx($e,{value:"models",children:"模型"}),e.jsx($e,{value:"activity",children:"活动"}),e.jsx($e,{value:"daily",children:"日统计"})]}),e.jsxs(We,{value:"trends",className:"space-y-4",children:[e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"请求趋势"}),e.jsxs(Zs,{children:["最近",f,"小时的请求量变化"]})]}),e.jsx(bs,{children:e.jsx(Zn,{config:G,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(eN,{data:te,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:q=>je(q),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(Jn,{labelFormatter:q=>je(q)})}),e.jsx(sN,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"花费趋势"}),e.jsx(Zs,{children:"API调用成本变化"})]}),e.jsx(bs,{children:e.jsx(Zn,{config:G,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(Su,{data:te,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:q=>je(q),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(Jn,{labelFormatter:q=>je(q)})}),e.jsx(Fc,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"Token消耗"}),e.jsx(Zs,{children:"Token使用量变化"})]}),e.jsx(bs,{children:e.jsx(Zn,{config:G,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(Su,{data:te,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:q=>je(q),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(Jn,{labelFormatter:q=>je(q)})}),e.jsx(Fc,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),e.jsx(We,{value:"models",className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"模型请求分布"}),e.jsxs(Zs,{children:["各模型使用占比 (共 ",O.length," 个模型)"]})]}),e.jsx(bs,{children:e.jsx(Zn,{config:Object.fromEntries(O.map((q,ie)=>[q.model_name,{label:q.model_name,color:_e[ie]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(tN,{children:[e.jsx(lr,{content:e.jsx(Jn,{})}),e.jsx(aN,{data:N,cx:"50%",cy:"50%",labelLine:!1,label:({name:q,percent:ie})=>ie&&ie<.05?"":`${q} ${ie?(ie*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:N.map((q,ie)=>e.jsx(lN,{fill:q.fill},`cell-${ie}`))})]})})})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"模型详细统计"}),e.jsx(Zs,{children:"请求数、花费和性能"})]}),e.jsx(bs,{children:e.jsx(Pe,{className:"h-[300px] sm:h-[400px]",children:e.jsx("div",{className:"space-y-3",children:O.map((q,ie)=>e.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:q.model_name}),e.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${ie%5+1}))`}})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),e.jsx("span",{className:"ml-1 font-medium",children:q.request_count.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1 font-medium",children:["¥",q.total_cost.toFixed(2)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[(q.total_tokens/1e3).toFixed(1),"K"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[q.avg_response_time.toFixed(2),"s"]})]})]})]},ie))})})})]})]})}),e.jsx(We,{value:"activity",children:e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"最近活动"}),e.jsx(Zs,{children:"最新的API调用记录"})]}),e.jsx(bs,{children:e.jsx(Pe,{className:"h-[400px] sm:h-[500px]",children:e.jsx("div",{className:"space-y-2",children:Ne.map((q,ie)=>e.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:q.model}),e.jsx("div",{className:"text-xs text-muted-foreground",children:q.request_type})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:je(q.timestamp)})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsx("span",{className:"ml-1",children:q.tokens})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1",children:["¥",q.cost.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),e.jsxs("span",{className:"ml-1",children:[q.time_cost.toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"状态:"}),e.jsx("span",{className:`ml-1 ${q.status==="success"?"text-green-600":"text-red-600"}`,children:q.status})]})]})]},ie))})})})]})}),e.jsx(We,{value:"daily",children:e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"每日统计"}),e.jsx(Zs,{children:"最近7天的数据汇总"})]}),e.jsx(bs,{children:e.jsx(Zn,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:e.jsxs(Su,{data:he,children:[e.jsx(Gc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Vc,{dataKey:"timestamp",tickFormatter:q=>{const ie=new Date(q);return`${ie.getMonth()+1}/${ie.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(lr,{content:e.jsx(Jn,{labelFormatter:q=>new Date(q).toLocaleDateString("zh-CN")})}),e.jsx(Fb,{content:e.jsx(Tg,{})}),e.jsx(Fc,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),e.jsx(Fc,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Pb={theme:"system",setTheme:()=>null},Eg=u.createContext(Pb),Yu=()=>{const n=u.useContext(Eg);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},Wb=(n,r,c)=>{const d=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||d){r(n);return}const h=c.clientX,x=c.clientY,f=Math.hypot(Math.max(h,innerWidth-h),Math.max(x,innerHeight-x));document.startViewTransition(()=>{r(n)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${h}px ${x}px)`,`circle(${f}px at ${h}px ${x}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},zg=u.createContext(void 0),Mg=()=>{const n=u.useContext(zg);if(n===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return n},Ve=u.forwardRef(({className:n,...r},c)=>e.jsx(Tp,{className:Q("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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",n),...r,ref:c,children:e.jsx(Oy,{className:Q("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ve.displayName=Tp.displayName;const e0=ai("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),b=u.forwardRef(({className:n,...r},c)=>e.jsx(Jp,{ref:c,className:Q(e0(),n),...r}));b.displayName=Jp.displayName;const ce=u.forwardRef(({className:n,type:r,...c},d)=>e.jsx("input",{type:r,className:Q("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:d,...c}));ce.displayName="Input";const s0=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:n=>n.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:n=>/[A-Z]/.test(n)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:n=>/[a-z]/.test(n)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:n=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(n)}];function t0(n){const r=s0.map(d=>({id:d.id,label:d.label,description:d.description,passed:d.validate(n)}));return{isValid:r.every(d=>d.passed),rules:r}}const Xu="0.11.6 Beta",Ku="MaiBot Dashboard",a0=`${Ku} v${Xu}`,l0=(n="v")=>`${n}${Xu}`,Ot={THEME:"maibot-ui-theme",ACCENT_COLOR:"accent-color",ENABLE_ANIMATIONS:"maibot-animations",ENABLE_WAVES_BACKGROUND:"maibot-waves-background",LOG_CACHE_SIZE:"maibot-log-cache-size",LOG_AUTO_SCROLL:"maibot-log-auto-scroll",LOG_FONT_SIZE:"maibot-log-font-size",LOG_LINE_SPACING:"maibot-log-line-spacing",DATA_SYNC_INTERVAL:"maibot-data-sync-interval",WS_RECONNECT_INTERVAL:"maibot-ws-reconnect-interval",WS_MAX_RECONNECT_ATTEMPTS:"maibot-ws-max-reconnect-attempts",COMPLETED_TOURS:"maibot-completed-tours"},za={theme:"system",accentColor:"blue",enableAnimations:!0,enableWavesBackground:!0,logCacheSize:1e3,logAutoScroll:!0,logFontSize:"xs",logLineSpacing:4,dataSyncInterval:30,wsReconnectInterval:3e3,wsMaxReconnectAttempts:10};function $s(n){const r=Ag(n),c=localStorage.getItem(r);if(c===null)return za[n];const d=za[n];if(typeof d=="boolean")return c==="true";if(typeof d=="number"){const h=parseFloat(c);return isNaN(h)?d:h}return c}function Pn(n,r){const c=Ag(n);localStorage.setItem(c,String(r)),window.dispatchEvent(new CustomEvent("maibot-settings-change",{detail:{key:n,value:r}}))}function n0(){return{theme:$s("theme"),accentColor:$s("accentColor"),enableAnimations:$s("enableAnimations"),enableWavesBackground:$s("enableWavesBackground"),logCacheSize:$s("logCacheSize"),logAutoScroll:$s("logAutoScroll"),logFontSize:$s("logFontSize"),logLineSpacing:$s("logLineSpacing"),dataSyncInterval:$s("dataSyncInterval"),wsReconnectInterval:$s("wsReconnectInterval"),wsMaxReconnectAttempts:$s("wsMaxReconnectAttempts")}}function i0(){const n=n0(),r=localStorage.getItem(Ot.COMPLETED_TOURS),c=r?JSON.parse(r):[];return{...n,completedTours:c}}function r0(n){const r=[],c=[];for(const[d,h]of Object.entries(n)){if(d==="completedTours"){Array.isArray(h)?(localStorage.setItem(Ot.COMPLETED_TOURS,JSON.stringify(h)),r.push("completedTours")):c.push("completedTours");continue}if(d in za){const x=d,f=za[x];if(typeof h==typeof f){if(x==="theme"&&!["light","dark","system"].includes(h)){c.push(d);continue}if(x==="logFontSize"&&!["xs","sm","base"].includes(h)){c.push(d);continue}Pn(x,h),r.push(d)}else c.push(d)}else c.push(d)}return{success:r.length>0,imported:r,skipped:c}}function c0(){for(const n of Object.keys(za))Pn(n,za[n]);localStorage.removeItem(Ot.COMPLETED_TOURS),window.dispatchEvent(new CustomEvent("maibot-settings-reset"))}function o0(){const n=[],r=[],c=[];for(let d=0;dd.size-c.size),{used:n,items:localStorage.length,details:r}}function d0(n){if(n===0)return"0 B";const r=1024,c=["B","KB","MB"],d=Math.floor(Math.log(n)/Math.log(r));return parseFloat((n/Math.pow(r,d)).toFixed(2))+" "+c[d]}function Ag(n){return{theme:Ot.THEME,accentColor:Ot.ACCENT_COLOR,enableAnimations:Ot.ENABLE_ANIMATIONS,enableWavesBackground:Ot.ENABLE_WAVES_BACKGROUND,logCacheSize:Ot.LOG_CACHE_SIZE,logAutoScroll:Ot.LOG_AUTO_SCROLL,logFontSize:Ot.LOG_FONT_SIZE,logLineSpacing:Ot.LOG_LINE_SPACING,dataSyncInterval:Ot.DATA_SYNC_INTERVAL,wsReconnectInterval:Ot.WS_RECONNECT_INTERVAL,wsMaxReconnectAttempts:Ot.WS_MAX_RECONNECT_ATTEMPTS}[n]}const Ma=u.forwardRef(({className:n,...r},c)=>e.jsxs(Ep,{ref:c,className:Q("relative flex w-full touch-none select-none items-center",n),...r,children:[e.jsx(Ry,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(Ly,{className:"absolute h-full bg-primary"})}),e.jsx(Uy,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));Ma.displayName=Ep.displayName;class u0{ws=null;reconnectTimeout=null;reconnectAttempts=0;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];getMaxCacheSize(){return $s("logCacheSize")}getMaxReconnectAttempts(){return $s("wsMaxReconnectAttempts")}getReconnectInterval(){return $s("wsReconnectInterval")}getWebSocketUrl(){{const r=window.location.protocol==="https:"?"wss:":"ws:",c=window.location.host;return`${r}//${c}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const r=this.getWebSocketUrl();try{this.ws=new WebSocket(r),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=c=>{try{if(c.data==="pong")return;const d=JSON.parse(c.data);this.notifyLog(d)}catch(d){console.error("解析日志消息失败:",d)}},this.ws.onerror=c=>{console.error("❌ WebSocket 错误:",c),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(c){console.error("创建 WebSocket 连接失败:",c),this.attemptReconnect()}}attemptReconnect(){const r=this.getMaxReconnectAttempts();if(this.reconnectAttempts>=r)return;this.reconnectAttempts+=1;const c=this.getReconnectInterval(),d=Math.min(c*this.reconnectAttempts,3e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},d)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(r){return this.logCallbacks.add(r),()=>this.logCallbacks.delete(r)}onConnectionChange(r){return this.connectionCallbacks.add(r),r(this.isConnected),()=>this.connectionCallbacks.delete(r)}notifyLog(r){if(!this.logCache.some(d=>d.id===r.id)){this.logCache.push(r);const d=this.getMaxCacheSize();this.logCache.length>d&&(this.logCache=this.logCache.slice(-d)),this.logCallbacks.forEach(h=>{try{h(r)}catch(x){console.error("日志回调执行失败:",x)}})}}notifyConnection(r){this.connectionCallbacks.forEach(c=>{try{c(r)}catch(d){console.error("连接状态回调执行失败:",d)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const an=new u0;typeof window<"u"&&an.connect();const Rs=rN,ni=cN,m0=iN,Zu=Wp,Dg=u.forwardRef(({className:n,...r},c)=>e.jsx(Ip,{ref:c,className:Q("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",n),...r}));Dg.displayName=Ip.displayName;const zs=u.forwardRef(({className:n,children:r,preventOutsideClose:c=!1,...d},h)=>e.jsxs(m0,{children:[e.jsx(Dg,{}),e.jsxs(Pp,{ref:h,className:Q("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",n),onPointerDownOutside:c?x=>x.preventDefault():void 0,onInteractOutside:c?x=>x.preventDefault():void 0,...d,children:[r,e.jsxs(Wp,{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:[e.jsx(li,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zs.displayName=Pp.displayName;const Ms=({className:n,...r})=>e.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",n),...r});Ms.displayName="DialogHeader";const Js=({className:n,...r})=>e.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});Js.displayName="DialogFooter";const As=u.forwardRef(({className:n,...r},c)=>e.jsx(eg,{ref:c,className:Q("text-lg font-semibold leading-none tracking-tight",n),...r}));As.displayName=eg.displayName;const Ys=u.forwardRef(({className:n,...r},c)=>e.jsx(sg,{ref:c,className:Q("text-sm text-muted-foreground",n),...r}));Ys.displayName=sg.displayName;const ps=Hy,Qs=qy,h0=By,Og=u.forwardRef(({className:n,...r},c)=>e.jsx(zp,{className:Q("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",n),...r,ref:c}));Og.displayName=zp.displayName;const rs=u.forwardRef(({className:n,...r},c)=>e.jsxs(h0,{children:[e.jsx(Og,{}),e.jsx(Mp,{ref:c,className:Q("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",n),...r})]}));rs.displayName=Mp.displayName;const cs=({className:n,...r})=>e.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",n),...r});cs.displayName="AlertDialogHeader";const os=({className:n,...r})=>e.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});os.displayName="AlertDialogFooter";const ds=u.forwardRef(({className:n,...r},c)=>e.jsx(Ap,{ref:c,className:Q("text-lg font-semibold",n),...r}));ds.displayName=Ap.displayName;const us=u.forwardRef(({className:n,...r},c)=>e.jsx(Dp,{ref:c,className:Q("text-sm text-muted-foreground",n),...r}));us.displayName=Dp.displayName;const ms=u.forwardRef(({className:n,...r},c)=>e.jsx(Op,{ref:c,className:Q(gr(),n),...r}));ms.displayName=Op.displayName;const hs=u.forwardRef(({className:n,...r},c)=>e.jsx(Rp,{ref:c,className:Q(gr({variant:"outline"}),"mt-2 sm:mt-0",n),...r}));hs.displayName=Rp.displayName;function x0(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),e.jsxs(Kt,{defaultValue:"appearance",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs($e,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(gg,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"外观"})]}),e.jsxs($e,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(CN,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"安全"})]}),e.jsxs($e,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Rl,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"其他"})]}),e.jsxs($e,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Xt,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"关于"})]})]}),e.jsxs(Pe,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(We,{value:"appearance",className:"mt-0",children:e.jsx(f0,{})}),e.jsx(We,{value:"security",className:"mt-0",children:e.jsx(p0,{})}),e.jsx(We,{value:"other",className:"mt-0",children:e.jsx(g0,{})}),e.jsx(We,{value:"about",className:"mt-0",children:e.jsx(j0,{})})]})]})]})}function np(n){const r=document.documentElement,d={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[n];if(d)r.style.setProperty("--primary",d.hsl),d.gradient?(r.style.setProperty("--primary-gradient",d.gradient),r.classList.add("has-gradient")):(r.style.removeProperty("--primary-gradient"),r.classList.remove("has-gradient"));else if(n.startsWith("#")){const h=x=>{x=x.replace("#","");const f=parseInt(x.substring(0,2),16)/255,j=parseInt(x.substring(2,4),16)/255,p=parseInt(x.substring(4,6),16)/255,w=Math.max(f,j,p),v=Math.min(f,j,p);let k=0,T=0;const E=(w+v)/2;if(w!==v){const R=w-v;switch(T=E>.5?R/(2-w-v):R/(w+v),w){case f:k=((j-p)/R+(jlocalStorage.getItem("accent-color")||"blue");u.useEffect(()=>{const w=localStorage.getItem("accent-color")||"blue";np(w)},[]);const p=w=>{j(w),localStorage.setItem("accent-color",w),np(w)};return e.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[e.jsx(Au,{value:"light",current:n,onChange:r,label:"浅色",description:"始终使用浅色主题"}),e.jsx(Au,{value:"dark",current:n,onChange:r,label:"深色",description:"始终使用深色主题"}),e.jsx(Au,{value:"system",current:n,onChange:r,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(ma,{value:"blue",current:f,onChange:p,label:"蓝色",colorClass:"bg-blue-500"}),e.jsx(ma,{value:"purple",current:f,onChange:p,label:"紫色",colorClass:"bg-purple-500"}),e.jsx(ma,{value:"green",current:f,onChange:p,label:"绿色",colorClass:"bg-green-500"}),e.jsx(ma,{value:"orange",current:f,onChange:p,label:"橙色",colorClass:"bg-orange-500"}),e.jsx(ma,{value:"pink",current:f,onChange:p,label:"粉色",colorClass:"bg-pink-500"}),e.jsx(ma,{value:"red",current:f,onChange:p,label:"红色",colorClass:"bg-red-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(ma,{value:"gradient-sunset",current:f,onChange:p,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),e.jsx(ma,{value:"gradient-ocean",current:f,onChange:p,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsx(ma,{value:"gradient-forest",current:f,onChange:p,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),e.jsx(ma,{value:"gradient-aurora",current:f,onChange:p,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),e.jsx(ma,{value:"gradient-fire",current:f,onChange:p,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),e.jsx(ma,{value:"gradient-twilight",current:f,onChange:p,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx("input",{type:"color",value:f.startsWith("#")?f:"#3b82f6",onChange:w=>p(w.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),e.jsx("div",{className:"flex-1",children:e.jsx(ce,{type:"text",value:f,onChange:w=>p(w.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),e.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[e.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(b,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),e.jsx(Ve,{id:"animations",checked:c,onCheckedChange:d})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(b,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),e.jsx(Ve,{id:"waves-background",checked:h,onCheckedChange:x})]})})]})]})]})}function p0(){const n=Jt(),[r,c]=u.useState(""),[d,h]=u.useState(""),[x,f]=u.useState(!1),[j,p]=u.useState(!1),[w,v]=u.useState(!1),[k,T]=u.useState(!1),[E,R]=u.useState(!1),[K,U]=u.useState(!1),[A,Z]=u.useState(""),[H,z]=u.useState(!1),{toast:B}=Hs(),X=u.useMemo(()=>t0(d),[d]),S=async pe=>{if(!r){B({title:"无法复制",description:"Token 存储在安全 Cookie 中,请重新生成以获取新 Token",variant:"destructive"});return}try{await navigator.clipboard.writeText(pe),R(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>R(!1),2e3)}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},O=async()=>{if(!d.trim()){B({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!X.isValid){const pe=X.rules.filter(je=>!je.passed).map(je=>je.label).join(", ");B({title:"格式错误",description:`Token 不符合要求: ${pe}`,variant:"destructive"});return}v(!0);try{const pe=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({new_token:d.trim()})}),je=await pe.json();pe.ok&&je.success?(h(""),c(d.trim()),B({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{n({to:"/auth"})},1500)):B({title:"更新失败",description:je.message||"无法更新 Token",variant:"destructive"})}catch(pe){console.error("更新 Token 错误:",pe),B({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{v(!1)}},te=async()=>{T(!0);try{const pe=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"}),je=await pe.json();pe.ok&&je.success?(c(je.token),Z(je.token),U(!0),z(!1),B({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):B({title:"生成失败",description:je.message||"无法生成新 Token",variant:"destructive"})}catch(pe){console.error("生成 Token 错误:",pe),B({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{T(!1)}},he=async()=>{try{await navigator.clipboard.writeText(A),z(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},Ne=()=>{U(!1),setTimeout(()=>{Z(""),z(!1)},300),setTimeout(()=>{n({to:"/auth"})},500)},ye=pe=>{pe||Ne()};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(Rs,{open:K,onOpenChange:ye,children:e.jsxs(zs,{className:"sm:max-w-md",children:[e.jsxs(Ms,{children:[e.jsxs(As,{className:"flex items-center gap-2",children:[e.jsx(ba,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),e.jsx(Ys,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[e.jsx(b,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),e.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:A})]}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ba,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"重要提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),e.jsx("li",{children:"请立即复制并保存到安全的位置"}),e.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),e.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),e.jsxs(Js,{className:"gap-2 sm:gap-0",children:[e.jsx(y,{variant:"outline",onClick:he,className:"gap-2",children:H?e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"h-4 w-4 text-green-500"}),"已复制"]}):e.jsxs(e.Fragment,{children:[e.jsx(so,{className:"h-4 w-4"}),"复制 Token"]})}),e.jsx(y,{onClick:Ne,children:"我已保存,关闭"})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),e.jsx("div",{className:"space-y-3 sm:space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ce,{id:"current-token",type:x?"text":"password",value:r||"••••••••••••••••••••••••••••••••",readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"Token 存储在安全 Cookie 中"}),e.jsx("button",{onClick:()=>{r?f(!x):B({title:"无法查看",description:'Token 存储在安全 Cookie 中,如需新 Token 请点击"重新生成"'})},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:x?"隐藏":"显示",children:x?e.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(y,{variant:"outline",size:"icon",onClick:()=>S(r),title:"复制到剪贴板",className:"flex-shrink-0",disabled:!r,children:E?e.jsx(fa,{className:"h-4 w-4 text-green-500"}):e.jsx(so,{className:"h-4 w-4"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{variant:"outline",disabled:k,className:"gap-2 flex-1 sm:flex-none",children:[e.jsx(pt,{className:Q("h-4 w-4",k&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),e.jsx("span",{className:"sm:hidden",children:"生成"})]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认重新生成 Token"}),e.jsx(us,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:te,children:"确认生成"})]})]})]})]})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{id:"new-token",type:j?"text":"password",value:d,onChange:pe=>h(pe.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),e.jsx("button",{onClick:()=>p(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:j?"隐藏":"显示",children:j?e.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground"})})]}),d&&e.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),e.jsx("div",{className:"space-y-1.5",children:X.rules.map(pe=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[pe.passed?e.jsx(pa,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):e.jsx(jg,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:Q(pe.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:pe.label})]},pe.id))}),X.isValid&&e.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[e.jsx(fa,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),e.jsx(y,{onClick:O,disabled:w||!X.isValid||!d,className:"w-full sm:w-auto",children:w?"更新中...":"更新自定义 Token"})]})]}),e.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[e.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),e.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),e.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),e.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),e.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),e.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),e.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function g0(){const n=Jt(),{toast:r}=Hs(),[c,d]=u.useState(!1),[h,x]=u.useState(!1),[f,j]=u.useState(()=>$s("logCacheSize")),[p,w]=u.useState(()=>$s("wsReconnectInterval")),[v,k]=u.useState(()=>$s("wsMaxReconnectAttempts")),[T,E]=u.useState(()=>$s("dataSyncInterval")),[R,K]=u.useState(()=>lp()),[U,A]=u.useState(!1),[Z,H]=u.useState(!1),z=u.useRef(null);if(h)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const B=()=>{K(lp())},X=N=>{const G=N[0];j(G),Pn("logCacheSize",G)},S=N=>{const G=N[0];w(G),Pn("wsReconnectInterval",G)},O=N=>{const G=N[0];k(G),Pn("wsMaxReconnectAttempts",G)},te=N=>{const G=N[0];E(G),Pn("dataSyncInterval",G)},he=()=>{an.clearLogs(),r({title:"日志已清除",description:"日志缓存已清空"})},Ne=()=>{const N=o0();B(),r({title:"缓存已清除",description:`已清除 ${N.clearedKeys.length} 项缓存数据`})},ye=()=>{A(!0);try{const N=i0(),G=JSON.stringify(N,null,2),q=new Blob([G],{type:"application/json"}),ie=URL.createObjectURL(q),_=document.createElement("a");_.href=ie,_.download=`maibot-webui-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(_),_.click(),document.body.removeChild(_),URL.revokeObjectURL(ie),r({title:"导出成功",description:"设置已导出为 JSON 文件"})}catch(N){console.error("导出设置失败:",N),r({title:"导出失败",description:"无法导出设置",variant:"destructive"})}finally{A(!1)}},pe=N=>{const G=N.target.files?.[0];if(!G)return;H(!0);const q=new FileReader;q.onload=ie=>{try{const _=ie.target?.result,me=JSON.parse(_),xe=r0(me);xe.success?(j($s("logCacheSize")),w($s("wsReconnectInterval")),k($s("wsMaxReconnectAttempts")),E($s("dataSyncInterval")),B(),r({title:"导入成功",description:`成功导入 ${xe.imported.length} 项设置${xe.skipped.length>0?`,跳过 ${xe.skipped.length} 项`:""}`}),(xe.imported.includes("theme")||xe.imported.includes("accentColor"))&&r({title:"提示",description:"部分设置需要刷新页面才能完全生效"})):r({title:"导入失败",description:"没有有效的设置项可导入",variant:"destructive"})}catch(_){console.error("导入设置失败:",_),r({title:"导入失败",description:"文件格式无效",variant:"destructive"})}finally{H(!1),z.current&&(z.current.value="")}},q.readAsText(G)},je=()=>{c0(),j(za.logCacheSize),w(za.wsReconnectInterval),k(za.wsMaxReconnectAttempts),E(za.dataSyncInterval),B(),r({title:"已重置",description:"所有设置已恢复为默认值,刷新页面以应用更改"})},_e=async()=>{d(!0);try{const N=localStorage.getItem("access-token"),G=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${N}`}}),q=await G.json();G.ok&&q.success?(r({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{n({to:"/setup"})},1e3)):r({title:"重置失败",description:q.message||"无法重置配置状态",variant:"destructive"})}catch(N){console.error("重置配置状态错误:",N),r({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{d(!1)}};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(eo,{className:"h-5 w-5"}),"性能与存储"]}),e.jsxs("div",{className:"space-y-4 sm:space-y-5",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(kN,{className:"h-4 w-4"}),"本地存储使用"]}),e.jsx(y,{variant:"ghost",size:"sm",onClick:B,className:"h-7 px-2",children:e.jsx(pt,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"text-2xl font-bold text-primary",children:d0(R.used)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[R.items," 个存储项"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"日志缓存大小"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[f," 条"]})]}),e.jsx(Ma,{value:[f],onValueChange:X,min:100,max:5e3,step:100,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"控制日志查看器最多缓存的日志条数,较大的值会占用更多内存"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"首页数据刷新间隔"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[T," 秒"]})]}),e.jsx(Ma,{value:[T],onValueChange:te,min:10,max:120,step:5,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"控制首页统计数据的自动刷新间隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"WebSocket 重连间隔"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[p/1e3," 秒"]})]}),e.jsx(Ma,{value:[p],onValueChange:S,min:1e3,max:1e4,step:500,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"日志 WebSocket 连接断开后的重连基础间隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-sm font-medium",children:"WebSocket 最大重连次数"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[v," 次"]})]}),e.jsx(Ma,{value:[v],onValueChange:O,min:3,max:30,step:1,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"连接失败后的最大重连尝试次数"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:he,className:"gap-2",children:[e.jsx(es,{className:"h-4 w-4"}),"清除日志缓存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(es,{className:"h-4 w-4"}),"清除本地缓存"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认清除本地缓存"}),e.jsx(us,{children:"这将清除所有本地缓存的设置和数据(不包括登录凭证)。 您可能需要重新配置部分偏好设置。确定要继续吗?"})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:Ne,children:"确认清除"})]})]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(nl,{className:"h-5 w-5"}),"导入/导出设置"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"导出当前的界面设置以便备份,或从之前导出的文件中恢复设置。"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(y,{variant:"outline",onClick:ye,disabled:U,className:"gap-2",children:[e.jsx(nl,{className:"h-4 w-4"}),U?"导出中...":"导出设置"]}),e.jsx("input",{ref:z,type:"file",accept:".json",onChange:pe,className:"hidden"}),e.jsxs(y,{variant:"outline",onClick:()=>z.current?.click(),disabled:Z,className:"gap-2",children:[e.jsx(hr,{className:"h-4 w-4"}),Z?"导入中...":"导入设置"]})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",className:"gap-2 text-destructive hover:text-destructive",children:[e.jsx(Wc,{className:"h-4 w-4"}),"重置所有设置为默认值"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认重置所有设置"}),e.jsx(us,{children:"这将把所有界面设置恢复为默认值,包括主题、颜色、动画等偏好设置。 此操作不会影响您的登录状态。确定要继续吗?"})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:je,children:"确认重置"})]})]})]})})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{variant:"outline",disabled:c,className:"gap-2",children:[e.jsx(Wc,{className:Q("h-4 w-4",c&&"animate-spin")}),"重新进行初次配置"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认重新配置"}),e.jsx(us,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:_e,children:"确认重置"})]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(ba,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{variant:"destructive",className:"gap-2",children:[e.jsx(ba,{className:"h-4 w-4"}),"触发测试错误"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认触发错误"}),e.jsx(us,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>x(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function j0(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:e.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:e.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),e.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:Q("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Ku]}),e.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("p",{children:["版本: ",Xu]}),e.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",e.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"React 19.2.0"}),e.jsx("li",{children:"TypeScript 5.7.2"}),e.jsx("li",{children:"Vite 6.0.7"}),e.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"shadcn/ui"}),e.jsx("li",{children:"Radix UI"}),e.jsx("li",{children:"Tailwind CSS 3.4.17"}),e.jsx("li",{children:"Lucide Icons"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"后端"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Python 3.12+"}),e.jsx("li",{children:"FastAPI"}),e.jsx("li",{children:"Uvicorn"}),e.jsx("li",{children:"WebSocket"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Bun / npm"}),e.jsx("li",{children:"ESLint 9.17.0"}),e.jsx("li",{children:"PostCSS"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),e.jsx(Pe,{className:"h-[300px] sm:h-[400px]",children:e.jsxs("div",{className:"space-y-4 pr-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"React",description:"用户界面构建库",license:"MIT"}),e.jsx(qs,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),e.jsx(qs,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),e.jsx(qs,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),e.jsx(qs,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),e.jsx(qs,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),e.jsx(qs,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),e.jsx(qs,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),e.jsx(qs,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),e.jsx(qs,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),e.jsx(qs,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),e.jsx(qs,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),e.jsx(qs,{name:"Pydantic",description:"数据验证库",license:"MIT"}),e.jsx(qs,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qs,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),e.jsx(qs,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),e.jsx(qs,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),e.jsx(qs,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:e.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function qs({name:n,description:r,license:c}){return e.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:n}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:r})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:c})]})}function Au({value:n,current:r,onChange:c,label:d,description:h}){const x=r===n;return e.jsxs("button",{onClick:()=>c(n),className:Q("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",x?"border-primary bg-accent":"border-border"),children:[x&&e.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm sm:text-base font-medium",children:d}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:h})]}),e.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[n==="light"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),n==="dark"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),n==="system"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ma({value:n,current:r,onChange:c,label:d,colorClass:h}){const x=r===n;return e.jsxs("button",{onClick:()=>c(n),className:Q("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",x?"border-primary bg-accent":"border-border"),children:[x&&e.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[e.jsx("div",{className:Q("h-8 w-8 sm:h-10 sm:w-10 rounded-full",h)}),e.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:d})]})]})}class v0{grad3;p;perm;constructor(r=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let c=0;c<256;c++)this.p[c]=Math.floor(Math.random()*256);this.perm=[];for(let c=0;c<512;c++)this.perm[c]=this.p[c&255]}dot(r,c,d){return r[0]*c+r[1]*d}mix(r,c,d){return(1-d)*r+d*c}fade(r){return r*r*r*(r*(r*6-15)+10)}perlin2(r,c){const d=Math.floor(r)&255,h=Math.floor(c)&255;r-=Math.floor(r),c-=Math.floor(c);const x=this.fade(r),f=this.fade(c),j=this.perm[d]+h,p=this.perm[j],w=this.perm[j+1],v=this.perm[d+1]+h,k=this.perm[v],T=this.perm[v+1];return this.mix(this.mix(this.dot(this.grad3[p%12],r,c),this.dot(this.grad3[k%12],r-1,c),x),this.mix(this.dot(this.grad3[w%12],r,c-1),this.dot(this.grad3[T%12],r-1,c-1),x),f)}}function ip(){const n=u.useRef(null),r=u.useRef(null),c=u.useRef(void 0),d=u.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new v0(Math.random()),bounding:null});return u.useEffect(()=>{const h=r.current,x=n.current;if(!h||!x)return;const f=d.current,j=()=>{const K=h.getBoundingClientRect();f.bounding=K,x.style.width=`${K.width}px`,x.style.height=`${K.height}px`},p=()=>{if(!f.bounding)return;const{width:K,height:U}=f.bounding;f.lines=[],f.paths.forEach(te=>te.remove()),f.paths=[];const A=10,Z=32,H=K+200,z=U+30,B=Math.ceil(H/A),X=Math.ceil(z/Z),S=(K-A*B)/2,O=(U-Z*X)/2;for(let te=0;te<=B;te++){const he=[];for(let ye=0;ye<=X;ye++){const pe={x:S+A*te,y:O+Z*ye,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};he.push(pe)}const Ne=document.createElementNS("http://www.w3.org/2000/svg","path");x.appendChild(Ne),f.paths.push(Ne),f.lines.push(he)}},w=K=>{const{lines:U,mouse:A,noise:Z}=f;U.forEach(H=>{H.forEach(z=>{const B=Z.perlin2((z.x+K*.0125)*.002,(z.y+K*.005)*.0015)*12;z.wave.x=Math.cos(B)*32,z.wave.y=Math.sin(B)*16;const X=z.x-A.sx,S=z.y-A.sy,O=Math.hypot(X,S),te=Math.max(175,A.vs);if(O{const A={x:K.x+K.wave.x+(U?K.cursor.x:0),y:K.y+K.wave.y+(U?K.cursor.y:0)};return A.x=Math.round(A.x*10)/10,A.y=Math.round(A.y*10)/10,A},k=()=>{const{lines:K,paths:U}=f;K.forEach((A,Z)=>{let H=v(A[0],!1),z=`M ${H.x} ${H.y}`;A.forEach((B,X)=>{const S=X===A.length-1;H=v(B,!S),z+=`L ${H.x} ${H.y}`}),U[Z].setAttribute("d",z)})},T=K=>{const{mouse:U}=f;U.sx+=(U.x-U.sx)*.1,U.sy+=(U.y-U.sy)*.1;const A=U.x-U.lx,Z=U.y-U.ly,H=Math.hypot(A,Z);U.v=H,U.vs+=(H-U.vs)*.1,U.vs=Math.min(100,U.vs),U.lx=U.x,U.ly=U.y,U.a=Math.atan2(Z,A),h&&(h.style.setProperty("--x",`${U.sx}px`),h.style.setProperty("--y",`${U.sy}px`)),w(K),k(),c.current=requestAnimationFrame(T)},E=K=>{if(!f.bounding)return;const{mouse:U}=f;U.x=K.pageX-f.bounding.left,U.y=K.pageY-f.bounding.top+window.scrollY,U.set||(U.sx=U.x,U.sy=U.y,U.lx=U.x,U.ly=U.y,U.set=!0)},R=()=>{j(),p()};return j(),p(),window.addEventListener("resize",R),window.addEventListener("mousemove",E),c.current=requestAnimationFrame(T),()=>{window.removeEventListener("resize",R),window.removeEventListener("mousemove",E),c.current&&cancelAnimationFrame(c.current)}},[]),e.jsxs("div",{ref:r,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[e.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),e.jsx("svg",{ref:n,style:{display:"block",width:"100%",height:"100%"},children:e.jsx("style",{children:` - path { - fill: none; - stroke: hsl(var(--primary) / 0.20); - stroke-width: 1px; - } - `})})]})}async function ke(n,r){const c={...r,credentials:"include",headers:{"Content-Type":"application/json",...r?.headers}},d=await fetch(n,c);if(d.status===401)throw window.location.href="/auth",new Error("认证失败,请重新登录");return d}function Ts(){return{"Content-Type":"application/json"}}async function y0(){try{await fetch("/api/webui/auth/logout",{method:"POST",credentials:"include"})}catch(n){console.error("登出请求失败:",n)}window.location.href="/auth"}async function Ju(){try{return(await(await fetch("/api/webui/auth/check",{method:"GET",credentials:"include"})).json()).authenticated===!0}catch{return!1}}function N0(){const[n,r]=u.useState(""),[c,d]=u.useState(!1),[h,x]=u.useState(""),[f,j]=u.useState(!0),p=Jt(),{enableWavesBackground:w,setEnableWavesBackground:v}=Mg(),{theme:k,setTheme:T}=Yu();u.useEffect(()=>{(async()=>{try{await Ju()&&p({to:"/"})}catch{}finally{j(!1)}})()},[p]);const R=k==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":k,K=()=>{T(R==="dark"?"light":"dark")},U=async A=>{if(A.preventDefault(),x(""),!n.trim()){x("请输入 Access Token");return}d(!0);try{const Z=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n.trim()})}),H=await Z.json();Z.ok&&H.valid?H.is_first_setup?p({to:"/setup"}):p({to:"/"}):x(H.message||"Token 验证失败,请检查后重试")}catch(Z){console.error("Token 验证错误:",Z),x("连接服务器失败,请检查网络连接")}finally{d(!1)}};return f?e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[w&&e.jsx(ip,{}),e.jsx("div",{className:"text-muted-foreground",children:"正在检查登录状态..."})]}):e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[w&&e.jsx(ip,{}),e.jsxs(Fe,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[e.jsx("button",{onClick:K,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:R==="dark"?"切换到浅色模式":"切换到深色模式",children:R==="dark"?e.jsx(Ou,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):e.jsx(Ru,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),e.jsxs(gs,{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(Yf,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(js,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),e.jsx(Zs,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),e.jsx(bs,{children:e.jsxs("form",{onSubmit:U,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),e.jsxs("div",{className:"relative",children:[e.jsx(vg,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),e.jsx(ce,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:n,onChange:A=>r(A.target.value),className:Q("pl-10",h&&"border-red-500 focus-visible:ring-red-500"),disabled:c,autoFocus:!0,autoComplete:"off"})]})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[e.jsx(Da,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{children:h})]}),e.jsx(y,{type:"submit",className:"w-full",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),e.jsxs(Rs,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(ro,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),e.jsxs(zs,{className:"sm:max-w-md",children:[e.jsxs(Ms,{children:[e.jsxs(As,{className:"flex items-center gap-2",children:[e.jsx(Yf,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),e.jsx(Ys,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(TN,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),e.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),e.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Aa,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),e.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:e.jsx("code",{className:"text-primary",children:"data/webui.json"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",e.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Da,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"安全提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),e.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(ln,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsxs(ds,{className:"flex items-center gap-2",children:[e.jsx(ln,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),e.jsx(us,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>v(!1),children:"关闭动画"})]})]})]})]})})]}),e.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:e.jsx("p",{children:a0})})]})}const Bs=u.forwardRef(({className:n,...r},c)=>e.jsx("textarea",{className:Q("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:c,...r}));Bs.displayName="Textarea";const jr=u.forwardRef(({className:n,orientation:r="horizontal",decorative:c=!0,...d},h)=>e.jsx(Lp,{ref:h,decorative:c,orientation:r,className:Q("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...d}));jr.displayName=Lp.displayName;function b0({config:n,onChange:r}){const c=h=>{h.trim()&&!n.alias_names.includes(h.trim())&&r({...n,alias_names:[...n.alias_names,h.trim()]})},d=h=>{r({...n,alias_names:n.alias_names.filter((x,f)=>f!==h)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"qq_account",children:"QQ账号 *"}),e.jsx(ce,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:n.qq_account||"",onChange:h=>r({...n,qq_account:Number(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"nickname",children:"昵称 *"}),e.jsx(ce,{id:"nickname",placeholder:"请输入机器人的昵称",value:n.nickname,onChange:h=>r({...n,nickname:h.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{children:"别名"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:n.alias_names.map((h,x)=>e.jsxs(Ye,{variant:"secondary",className:"gap-1",children:[h,e.jsx("button",{type:"button",onClick:()=>d(x),className:"ml-1 hover:text-destructive",children:e.jsx(li,{className:"h-3 w-3"})})]},x))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:h=>{h.key==="Enter"&&(c(h.target.value),h.target.value="")}}),e.jsx(y,{type:"button",variant:"outline",onClick:()=>{const h=document.getElementById("alias_input");h&&(c(h.value),h.value="")},children:"添加"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function w0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"personality",children:"人格特征 *"}),e.jsx(Bs,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:n.personality,onChange:c=>r({...n,personality:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"reply_style",children:"表达风格 *"}),e.jsx(Bs,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:n.reply_style,onChange:c=>r({...n,reply_style:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"interest",children:"兴趣 *"}),e.jsx(Bs,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:n.interest,onChange:c=>r({...n,interest:c.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),e.jsx(jr,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"plan_style",children:"群聊说话规则 *"}),e.jsx(Bs,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:n.plan_style,onChange:c=>r({...n,plan_style:c.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),e.jsx(Bs,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:n.private_plan_style,onChange:c=>r({...n,private_plan_style:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function _0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(n.emoji_chance*100).toFixed(0),"%"]})]}),e.jsx(ce,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:n.emoji_chance,onChange:c=>r({...n,emoji_chance:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"max_reg_num",children:"最大表情包数量"}),e.jsx(ce,{id:"max_reg_num",type:"number",min:"1",max:"200",value:n.max_reg_num,onChange:c=>r({...n,max_reg_num:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"do_replace",children:"达到最大数量时替换"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),e.jsx(Ve,{id:"do_replace",checked:n.do_replace,onCheckedChange:c=>r({...n,do_replace:c})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(ce,{id:"check_interval",type:"number",min:"1",max:"120",value:n.check_interval,onChange:c=>r({...n,check_interval:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),e.jsx(jr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"steal_emoji",children:"偷取表情包"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),e.jsx(Ve,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:c=>r({...n,steal_emoji:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"content_filtration",children:"启用表情包过滤"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),e.jsx(Ve,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:c=>r({...n,content_filtration:c})})]}),n.content_filtration&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(ce,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:n.filtration_prompt,onChange:c=>r({...n,filtration_prompt:c.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function S0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"enable_tool",children:"启用工具系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),e.jsx(Ve,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:c=>r({...n,enable_tool:c})})]}),e.jsx(jr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"enable_mood",children:"启用情绪系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),e.jsx(Ve,{id:"enable_mood",checked:n.enable_mood,onCheckedChange:c=>r({...n,enable_mood:c})})]}),n.enable_mood&&e.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),e.jsx(ce,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:n.mood_update_threshold||1,onChange:c=>r({...n,mood_update_threshold:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"emotion_style",children:"情感特征"}),e.jsx(Bs,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:n.emotion_style||"",onChange:c=>r({...n,emotion_style:c.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),e.jsx(jr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{htmlFor:"all_global",children:"启用全局黑话模式"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),e.jsx(Ve,{id:"all_global",checked:n.all_global,onCheckedChange:c=>r({...n,all_global:c})})]})]})}function C0({config:n,onChange:r}){const[c,d]=u.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:e.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"flex-1 text-sm",children:[e.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),e.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),e.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",e.jsx(dr,{className:"h-3 w-3"})]})]})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(b,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{id:"siliconflow_api_key",type:c?"text":"password",placeholder:"sk-...",value:n.api_key,onChange:h=>r({api_key:h.target.value}),className:"font-mono pr-10"}),e.jsx(y,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>d(!c),children:c?e.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Zt,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[e.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[e.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),e.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),e.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),e.jsx("li",{children:"SenseVoice - 语音识别"}),e.jsx("li",{children:"BGE-M3 - 文本嵌入"}),e.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),e.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:e.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[e.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function k0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Ts()});if(!n.ok)throw new Error("读取Bot配置失败");const c=(await n.json()).config.bot||{};return{qq_account:c.qq_account||0,nickname:c.nickname||"",alias_names:c.alias_names||[]}}async function T0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Ts()});if(!n.ok)throw new Error("读取人格配置失败");const c=(await n.json()).config.personality||{};return{personality:c.personality||"",reply_style:c.reply_style||"",interest:c.interest||"",plan_style:c.plan_style||"",private_plan_style:c.private_plan_style||""}}async function E0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Ts()});if(!n.ok)throw new Error("读取表情包配置失败");const c=(await n.json()).config.emoji||{};return{emoji_chance:c.emoji_chance??.4,max_reg_num:c.max_reg_num??40,do_replace:c.do_replace??!0,check_interval:c.check_interval??10,steal_emoji:c.steal_emoji??!0,content_filtration:c.content_filtration??!1,filtration_prompt:c.filtration_prompt||""}}async function z0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Ts()});if(!n.ok)throw new Error("读取其他配置失败");const c=(await n.json()).config,d=c.tool||{},h=c.mood||{},x=c.jargon||{};return{enable_tool:d.enable_tool??!0,enable_mood:h.enable_mood??!1,mood_update_threshold:h.mood_update_threshold,emotion_style:h.emotion_style,all_global:x.all_global??!0}}async function M0(){const n=await ke("/api/webui/config/model",{method:"GET",headers:Ts()});if(!n.ok)throw new Error("读取模型配置失败");return{api_key:((await n.json()).config.api_providers||[]).find(x=>x.name==="SiliconFlow")?.api_key||""}}async function A0(n){const r=await ke("/api/webui/config/bot/section/bot",{method:"POST",headers:Ts(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存Bot基础配置失败")}return await r.json()}async function D0(n){const r=await ke("/api/webui/config/bot/section/personality",{method:"POST",headers:Ts(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存人格配置失败")}return await r.json()}async function O0(n){const r=await ke("/api/webui/config/bot/section/emoji",{method:"POST",headers:Ts(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存表情包配置失败")}return await r.json()}async function R0(n){const r=[];r.push(ke("/api/webui/config/bot/section/tool",{method:"POST",headers:Ts(),body:JSON.stringify({enable_tool:n.enable_tool})})),r.push(ke("/api/webui/config/bot/section/jargon",{method:"POST",headers:Ts(),body:JSON.stringify({all_global:n.all_global})}));const c={enable_mood:n.enable_mood};n.enable_mood&&(c.mood_update_threshold=n.mood_update_threshold||1,c.emotion_style=n.emotion_style||""),r.push(ke("/api/webui/config/bot/section/mood",{method:"POST",headers:Ts(),body:JSON.stringify(c)}));const d=await Promise.all(r);for(const h of d)if(!h.ok){const x=await h.json();throw new Error(x.detail||"保存其他配置失败")}return{success:!0}}async function L0(n){const r=await ke("/api/webui/config/model",{method:"GET",headers:Ts()});if(!r.ok)throw new Error("读取模型配置失败");const d=(await r.json()).config,h=d.api_providers||[],x=h.findIndex(p=>p.name==="SiliconFlow");x>=0?h[x]={...h[x],api_key:n.api_key}:h.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:n.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const f={...d,api_providers:h},j=await ke("/api/webui/config/model",{method:"POST",headers:Ts(),body:JSON.stringify(f)});if(!j.ok){const p=await j.json();throw new Error(p.detail||"保存模型配置失败")}return await j.json()}async function rp(){const n=localStorage.getItem("access-token"),r=await ke("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${n}`}});if(!r.ok){const c=await r.json();throw new Error(c.message||"标记配置完成失败")}return await r.json()}async function co(){const n=await ke("/api/webui/system/restart",{method:"POST",headers:Ts()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"重启失败")}return await n.json()}async function U0(){const n=await ke("/api/webui/system/status",{method:"GET",headers:Ts()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取状态失败")}return await n.json()}function B0(){const n=Jt(),{toast:r}=Hs(),[c,d]=u.useState(0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!0),[v,k]=u.useState({qq_account:0,nickname:"",alias_names:[]}),[T,E]=u.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 -2.如果相同的内容已经被执行,请不要重复执行 -3.请控制你的发言频率,不要太过频繁的发言 -4.如果有人对你感到厌烦,请减少回复 -5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 -2.如果相同的内容已经被执行,请不要重复执行 -3.某句话如果已经被回复过,不要重复回复`}),[R,K]=u.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[U,A]=u.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[Z,H]=u.useState({api_key:""}),[z,B]=u.useState(!1),[X,S]=u.useState(""),O=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:ir},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:to},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:$u},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Rl},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:vg}],te=(c+1)/O.length*100;u.useEffect(()=>{(async()=>{try{w(!0);const[G,q,ie,_,me]=await Promise.all([k0(),T0(),E0(),z0(),M0()]);k(G),E(q),K(ie),A(_),H(me)}catch(G){r({title:"加载配置失败",description:G instanceof Error?G.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{w(!1)}})()},[r]);const he=async()=>{j(!0);try{switch(c){case 0:await A0(v);break;case 1:await D0(T);break;case 2:await O0(R);break;case 3:await R0(U);break;case 4:await L0(Z);break}return r({title:"保存成功",description:`${O[c].title}配置已保存`}),!0}catch(N){return r({title:"保存失败",description:N instanceof Error?N.message:"未知错误",variant:"destructive"}),!1}finally{j(!1)}},Ne=async()=>{await he()&&c{c>0&&d(c-1)},pe=async()=>{x(!0),B(!0);try{if(S("正在保存API配置..."),!await he()){x(!1),B(!1);return}S("正在完成初始化..."),await rp(),S("正在重启麦麦..."),await co(),r({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),S("等待麦麦重启完成...");const G=60;let q=0,ie=!1;for(;qsetTimeout(_,1e3));try{(await U0()).running&&(ie=!0,S("重启成功!正在跳转..."))}catch{q++}}if(!ie)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{n({to:"/"})},1e3)}catch(N){B(!1),r({title:"配置失败",description:N instanceof Error?N.message:"未知错误",variant:"destructive"})}finally{x(!1)}},je=async()=>{try{await rp(),n({to:"/"})}catch(N){r({title:"跳过失败",description:N instanceof Error?N.message:"未知错误",variant:"destructive"})}},_e=()=>{switch(c){case 0:return e.jsx(b0,{config:v,onChange:k});case 1:return e.jsx(w0,{config:T,onChange:E});case 2:return e.jsx(_0,{config:R,onChange:K});case 3:return e.jsx(S0,{config:U,onChange:A});case 4:return e.jsx(C0,{config:Z,onChange:H});default:return null}};return e.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[z&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[e.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:e.jsx(vt,{className:"h-10 w-10 animate-spin text-primary"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground",children:X})]}),e.jsx("div",{className:"w-full",children:e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:e.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),p?e.jsxs("div",{className:"relative z-10 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:e.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),e.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[e.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(EN,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Ku," 的初始配置"]})]}),e.jsxs("div",{className:"mb-6 md:mb-8",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",c+1," / ",O.length]}),e.jsxs("span",{className:"font-medium text-primary",children:[Math.round(te),"%"]})]}),e.jsx(Sr,{value:te,className:"h-2"})]}),e.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:O.map((N,G)=>{const q=N.icon;return e.jsxs("div",{className:Q("flex flex-1 flex-col items-center gap-1 md:gap-2",Gn({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[e.jsx(xr,{className:"h-4 w-4"}),"返回首页"]}),e.jsxs(y,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[e.jsx(ti,{className:"h-4 w-4"}),"返回上一页"]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}const He=xN,qe=fN,Re=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(tg,{ref:d,className:Q("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...c,children:[r,e.jsx(oN,{asChild:!0,children:e.jsx(Ll,{className:"h-4 w-4 opacity-50"})})]}));Re.displayName=tg.displayName;const Lg=u.forwardRef(({className:n,...r},c)=>e.jsx(ag,{ref:c,className:Q("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(fr,{className:"h-4 w-4"})}));Lg.displayName=ag.displayName;const Ug=u.forwardRef(({className:n,...r},c)=>e.jsx(lg,{ref:c,className:Q("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(Ll,{className:"h-4 w-4"})}));Ug.displayName=lg.displayName;const Le=u.forwardRef(({className:n,children:r,position:c="popper",...d},h)=>e.jsx(dN,{children:e.jsxs(ng,{ref:h,className:Q("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 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 origin-[--radix-select-content-transform-origin]",c==="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",n),position:c,...d,children:[e.jsx(Lg,{}),e.jsx(uN,{className:Q("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),e.jsx(Ug,{})]})}));Le.displayName=ng.displayName;const H0=u.forwardRef(({className:n,...r},c)=>e.jsx(ig,{ref:c,className:Q("px-2 py-1.5 text-sm font-semibold",n),...r}));H0.displayName=ig.displayName;const ne=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(rg,{ref:d,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...c,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(mN,{children:e.jsx(fa,{className:"h-4 w-4"})})}),e.jsx(hN,{children:r})]}));ne.displayName=rg.displayName;const q0=u.forwardRef(({className:n,...r},c)=>e.jsx(cg,{ref:c,className:Q("-mx-1 my-1 h-px bg-muted",n),...r}));q0.displayName=cg.displayName;const Oa=Vy,Ra=Fy,wa=u.forwardRef(({className:n,align:r="center",sideOffset:c=4,...d},h)=>e.jsx(Gy,{children:e.jsx(Up,{ref:h,align:r,sideOffset:c,className:Q("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 origin-[--radix-popover-content-transform-origin]",n),...d})}));wa.displayName=Up.displayName;const Ul="/api/webui/config";async function cp(){const r=await(await ke(`${Ul}/bot`)).json();if(!r.success)throw new Error("获取配置数据失败");return r.config}async function ei(){const r=await(await ke(`${Ul}/model`)).json();if(!r.success)throw new Error("获取模型配置数据失败");return r.config}async function op(n){const c=await(await ke(`${Ul}/bot`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function G0(){const r=await(await ke(`${Ul}/bot/raw`)).json();if(!r.success)throw new Error("获取配置源代码失败");return r.content}async function V0(n){const c=await(await ke(`${Ul}/bot/raw`,{method:"POST",body:JSON.stringify({raw_content:n})})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function io(n){const c=await(await ke(`${Ul}/model`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function F0(n,r){const d=await(await ke(`${Ul}/bot/section/${n}`,{method:"POST",body:JSON.stringify(r)})).json();if(!d.success)throw new Error(d.message||`保存配置节 ${n} 失败`)}async function qu(n,r){const d=await(await ke(`${Ul}/model/section/${n}`,{method:"POST",body:JSON.stringify(r)})).json();if(!d.success)throw new Error(d.message||`保存配置节 ${n} 失败`)}async function $0(n,r="openai",c="/models"){const d=new URLSearchParams({provider_name:n,parser:r,endpoint:c}),h=await ke(`/api/webui/models/list?${d}`);if(!h.ok){const f=await h.json().catch(()=>({}));throw new Error(f.detail||`获取模型列表失败 (${h.status})`)}const x=await h.json();if(!x.success)throw new Error("获取模型列表失败");return x.models}async function Q0(n){const r=new URLSearchParams({provider_name:n}),c=await ke(`/api/webui/models/test-connection-by-name?${r}`,{method:"POST"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.detail||`测试连接失败 (${c.status})`)}return await c.json()}const Y0=ai("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ha=u.forwardRef(({className:n,variant:r,...c},d)=>e.jsx("div",{ref:d,role:"alert",className:Q(Y0({variant:r}),n),...c}));ha.displayName="Alert";const X0=u.forwardRef(({className:n,...r},c)=>e.jsx("h5",{ref:c,className:Q("mb-1 font-medium leading-none tracking-tight",n),...r}));X0.displayName="AlertTitle";const xa=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:Q("text-sm [&_p]:leading-relaxed",n),...r}));xa.displayName="AlertDescription";function Iu({onRestartComplete:n,onRestartFailed:r}){const[c,d]=u.useState(0),[h,x]=u.useState("restarting"),[f,j]=u.useState(0),[p,w]=u.useState(0);u.useEffect(()=>{const T=setInterval(()=>{d(K=>K>=90?K:K+1)},200),E=setInterval(()=>{j(K=>K+1)},1e3),R=setTimeout(()=>{x("checking"),v()},3e3);return()=>{clearInterval(T),clearInterval(E),clearTimeout(R)}},[]);const v=()=>{const E=async()=>{try{if(w(K=>K+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)d(100),x("success"),setTimeout(()=>{n?.()},1500);else throw new Error("Status check failed")}catch{p<60?setTimeout(E,2e3):(x("failed"),r?.())}};E()},k=T=>{const E=Math.floor(T/60),R=T%60;return`${E}:${R.toString().padStart(2,"0")}`};return e.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:e.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[h==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx(vt,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),h==="checking"&&e.jsxs(e.Fragment,{children:[e.jsx(vt,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),e.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",p,"/60)"]})]}),h==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(pa,{className:"h-16 w-16 text-green-500"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),h==="failed"&&e.jsxs(e.Fragment,{children:[e.jsx(Da,{className:"h-16 w-16 text-destructive"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),h!=="failed"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Sr,{value:c,className:"h-2"}),e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[c,"%"]}),e.jsxs("span",{children:["已用时: ",k(f)]})]})]}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[h==="restarting"&&"🔄 配置已保存,正在重启主程序...",h==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",h==="success"&&"✅ 配置已生效,服务运行正常",h==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),e.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:e.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),h==="failed"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),e.jsx("button",{onClick:()=>{x("checking"),w(0),v()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}const K0={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(n,r){let c;if(!r.inString&&(c=n.match(/^('''|"""|'|")/))&&(r.stringType=c[0],r.inString=!0),n.sol()&&!r.inString&&r.inArray===0&&(r.lhs=!0),r.inString){for(;r.inString;)if(n.match(r.stringType))r.inString=!1;else if(n.peek()==="\\")n.next(),n.next();else{if(n.eol())break;n.match(/^.[^\\\"\']*/)}return r.lhs?"property":"string"}else{if(r.inArray&&n.peek()==="]")return n.next(),r.inArray--,"bracket";if(r.lhs&&n.peek()==="["&&n.skipTo("]"))return n.next(),n.peek()==="]"&&n.next(),"atom";if(n.peek()==="#")return n.skipToEnd(),"comment";if(n.eatSpace())return null;if(r.lhs&&n.eatWhile(function(d){return d!="="&&d!=" "}))return"property";if(r.lhs&&n.peek()==="=")return n.next(),r.lhs=!1,null;if(!r.lhs&&n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!r.lhs&&(n.match("true")||n.match("false")))return"atom";if(!r.lhs&&n.peek()==="[")return r.inArray++,n.next(),"bracket";if(!r.lhs&&n.match(/^\-?\d+(?:\.\d+)?/))return"number";n.eatSpace()||n.next()}return null},languageData:{commentTokens:{line:"#"}}},Z0={python:[tb()],json:[ab(),lb()],toml:[sb.define(K0)],text:[]};function J0({value:n,onChange:r,language:c="text",readOnly:d=!1,height:h="400px",minHeight:x,maxHeight:f,placeholder:j,theme:p="dark",className:w=""}){const[v,k]=u.useState(!1);if(u.useEffect(()=>{k(!0)},[]),!v)return e.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${w}`,style:{height:h,minHeight:x,maxHeight:f}});const T=[...Z0[c]||[],If.lineWrapping];return d&&T.push(If.editable.of(!1)),e.jsx("div",{className:`rounded-md overflow-hidden border ${w}`,children:e.jsx(nb,{value:n,height:h,minHeight:x,maxHeight:f,theme:p==="dark"?ib:void 0,extensions:T,onChange:r,placeholder:j,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function I0(){const[n,r]=u.useState(!0),[c,d]=u.useState(!1),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!1),[T,E]=u.useState("visual"),[R,K]=u.useState(""),[U,A]=u.useState(!1),{toast:Z}=Hs(),[H,z]=u.useState(null),[B,X]=u.useState(null),[S,O]=u.useState(null),[te,he]=u.useState(null),[Ne,ye]=u.useState(null),[pe,je]=u.useState(null),[_e,N]=u.useState(null),[G,q]=u.useState(null),[ie,_]=u.useState(null),[me,xe]=u.useState(null),[$,de]=u.useState(null),[ge,le]=u.useState(null),[L,F]=u.useState(null),[D,ee]=u.useState(null),[we,ze]=u.useState(null),[ss,Ze]=u.useState(null),[Ls,Gs]=u.useState(null),[re,be]=u.useState(null),Xe=u.useRef(null),Ue=u.useRef(!0),st=u.useRef({}),It=u.useCallback(async()=>{try{const Se=await G0();K(Se),A(!1)}catch(Se){Z({variant:"destructive",title:"加载失败",description:Se instanceof Error?Se.message:"加载源代码失败"})}},[Z]),bt=u.useCallback(async()=>{try{r(!0);const Se=await cp();st.current=Se,z(Se.bot),X(Se.personality);const Oe=Se.chat;Oe.talk_value_rules||(Oe.talk_value_rules=[]),O(Oe),he(Se.expression),ye(Se.emoji),je(Se.memory),N(Se.tool),q(Se.mood),_(Se.voice),xe(Se.lpmm_knowledge),de(Se.keyword_reaction),le(Se.response_post_process),F(Se.chinese_typo),ee(Se.response_splitter),ze(Se.log),Ze(Se.debug),Gs(Se.maim_message),be(Se.telemetry),j(!1),Ue.current=!1,await It()}catch(Se){console.error("加载配置失败:",Se),Z({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{r(!1)}},[Z,It]);u.useEffect(()=>{bt()},[bt]);const Je=u.useCallback(async(Se,Oe)=>{if(!Ue.current)try{x(!0),await F0(Se,Oe),j(!1)}catch(it){console.error(`自动保存 ${Se} 失败:`,it),j(!0)}finally{x(!1)}},[]),Be=u.useCallback((Se,Oe)=>{Ue.current||(j(!0),Xe.current&&clearTimeout(Xe.current),Xe.current=setTimeout(()=>{Je(Se,Oe)},2e3))},[Je]);u.useEffect(()=>{H&&!Ue.current&&Be("bot",H)},[H,Be]),u.useEffect(()=>{B&&!Ue.current&&Be("personality",B)},[B,Be]),u.useEffect(()=>{S&&!Ue.current&&Be("chat",S)},[S,Be]),u.useEffect(()=>{te&&!Ue.current&&Be("expression",te)},[te,Be]),u.useEffect(()=>{Ne&&!Ue.current&&Be("emoji",Ne)},[Ne,Be]),u.useEffect(()=>{pe&&!Ue.current&&Be("memory",pe)},[pe,Be]),u.useEffect(()=>{_e&&!Ue.current&&Be("tool",_e)},[_e,Be]),u.useEffect(()=>{G&&!Ue.current&&Be("mood",G)},[G,Be]),u.useEffect(()=>{ie&&!Ue.current&&Be("voice",ie)},[ie,Be]),u.useEffect(()=>{me&&!Ue.current&&Be("lpmm_knowledge",me)},[me,Be]),u.useEffect(()=>{$&&!Ue.current&&Be("keyword_reaction",$)},[$,Be]),u.useEffect(()=>{ge&&!Ue.current&&Be("response_post_process",ge)},[ge,Be]),u.useEffect(()=>{L&&!Ue.current&&Be("chinese_typo",L)},[L,Be]),u.useEffect(()=>{D&&!Ue.current&&Be("response_splitter",D)},[D,Be]),u.useEffect(()=>{we&&!Ue.current&&Be("log",we)},[we,Be]),u.useEffect(()=>{ss&&!Ue.current&&Be("debug",ss)},[ss,Be]),u.useEffect(()=>{Ls&&!Ue.current&&Be("maim_message",Ls)},[Ls,Be]),u.useEffect(()=>{re&&!Ue.current&&Be("telemetry",re)},[re,Be]);const jt=async()=>{try{d(!0),await V0(R),j(!1),A(!1),Z({title:"保存成功",description:"配置已保存"}),await bt()}catch(Se){A(!0),Z({variant:"destructive",title:"保存失败",description:Se instanceof Error?Se.message:"保存配置失败"})}finally{d(!1)}},nt=async Se=>{if(f){Z({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(E(Se),Se==="source")await It();else try{const Oe=await cp();st.current=Oe,z(Oe.bot),X(Oe.personality);const it=Oe.chat;it.talk_value_rules||(it.talk_value_rules=[]),O(it),he(Oe.expression),ye(Oe.emoji),je(Oe.memory),N(Oe.tool),q(Oe.mood),_(Oe.voice),xe(Oe.lpmm_knowledge),de(Oe.keyword_reaction),le(Oe.response_post_process),F(Oe.chinese_typo),ee(Oe.response_splitter),ze(Oe.log),Ze(Oe.debug),Gs(Oe.maim_message),be(Oe.telemetry),j(!1)}catch(Oe){console.error("加载配置失败:",Oe),Z({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},St=async()=>{try{d(!0),Xe.current&&clearTimeout(Xe.current);const Se={...st.current,bot:H,personality:B,chat:S,expression:te,emoji:Ne,memory:pe,tool:_e,mood:G,voice:ie,lpmm_knowledge:me,keyword_reaction:$,response_post_process:ge,chinese_typo:L,response_splitter:D,log:we,debug:ss,maim_message:Ls,telemetry:re};await op(Se),j(!1),Z({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Se){console.error("保存配置失败:",Se),Z({title:"保存失败",description:Se.message,variant:"destructive"})}finally{d(!1)}},Ct=async()=>{try{w(!0),co().catch(()=>{}),k(!0)}catch(Se){console.error("重启失败:",Se),k(!1),Z({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),w(!1)}},rl=async()=>{try{d(!0),Xe.current&&clearTimeout(Xe.current);const Se={...st.current,bot:H,personality:B,chat:S,expression:te,emoji:Ne,memory:pe,tool:_e,mood:G,voice:ie,lpmm_knowledge:me,keyword_reaction:$,response_post_process:ge,chinese_typo:L,response_splitter:D,log:we,debug:ss,maim_message:Ls,telemetry:re};await op(Se),j(!1),Z({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Oe=>setTimeout(Oe,500)),await Ct()}catch(Se){console.error("保存失败:",Se),Z({title:"保存失败",description:Se.message,variant:"destructive"})}finally{d(!1)}},cl=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ol=()=>{k(!1),w(!1),Z({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return n?e.jsx(Pe,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[e.jsx(Kt,{value:T,onValueChange:Se=>nt(Se),className:"w-auto",children:e.jsxs(Rt,{className:"h-9",children:[e.jsxs($e,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[e.jsx(AN,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),e.jsxs($e,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[e.jsx(DN,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),e.jsxs(y,{onClick:T==="visual"?St:jt,disabled:c||h||!f||p,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[e.jsx(br,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),c?"保存中...":h?"自动保存中...":f?"保存配置":"已保存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{disabled:c||h||p,size:"sm",className:"flex-1 sm:flex-none",children:[e.jsx(Nr,{className:"mr-2 h-4 w-4"}),p?"重启中...":f?"保存并重启":"重启麦麦"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认重启麦麦?"}),e.jsx(us,{className:"space-y-3",asChild:!0,children:e.jsxs("div",{children:[e.jsx("p",{children:f?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),e.jsxs(ha,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Xt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",e.jsxs(Rs,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[e.jsx(ro,{className:"h-3 w-3"}),"如何结束程序?"]})}),e.jsxs(zs,{className:"max-w-2xl",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"如何结束使用重启功能后的麦麦程序"}),e.jsx(Ys,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),e.jsxs(Kt,{defaultValue:"windows",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsx($e,{value:"windows",children:"Windows"}),e.jsx($e,{value:"macos",children:"macOS"}),e.jsx($e,{value:"linux",children:"Linux"})]}),e.jsxs(We,{value:"windows",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),e.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),e.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),e.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),e.jsxs(We,{value:"macos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),e.jsxs("li",{children:["在进程列表中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),e.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]})]}),e.jsxs(We,{value:"linux",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),e.jsx("p",{children:'pkill -9 -f "bot.py"'}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["在终端输入 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),e.jsx(Js,{children:e.jsx(Zu,{asChild:!0,children:e.jsx(y,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:f?rl:Ct,children:f?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(ha,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(xa,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),T==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(ha,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(xa,{children:[e.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",U&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),e.jsx(J0,{value:R,onChange:Se=>{K(Se),j(!0),U&&A(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),T==="visual"&&e.jsx(e.Fragment,{children:e.jsxs(Kt,{defaultValue:"bot",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs(Rt,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[e.jsx($e,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),e.jsx($e,{value:"personality",className:"flex-shrink-0",children:"人格"}),e.jsx($e,{value:"chat",className:"flex-shrink-0",children:"聊天"}),e.jsx($e,{value:"expression",className:"flex-shrink-0",children:"表达"}),e.jsx($e,{value:"features",className:"flex-shrink-0",children:"功能"}),e.jsx($e,{value:"processing",className:"flex-shrink-0",children:"处理"}),e.jsx($e,{value:"mood",className:"flex-shrink-0",children:"情绪"}),e.jsx($e,{value:"voice",className:"flex-shrink-0",children:"语音"}),e.jsx($e,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),e.jsx($e,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),e.jsx(We,{value:"bot",className:"space-y-4",children:H&&e.jsx(P0,{config:H,onChange:z})}),e.jsx(We,{value:"personality",className:"space-y-4",children:B&&e.jsx(W0,{config:B,onChange:X})}),e.jsx(We,{value:"chat",className:"space-y-4",children:S&&e.jsx(ew,{config:S,onChange:O})}),e.jsx(We,{value:"expression",className:"space-y-4",children:te&&e.jsx(tw,{config:te,onChange:he})}),e.jsx(We,{value:"features",className:"space-y-4",children:Ne&&pe&&_e&&e.jsx(aw,{emojiConfig:Ne,memoryConfig:pe,toolConfig:_e,onEmojiChange:ye,onMemoryChange:je,onToolChange:N})}),e.jsx(We,{value:"processing",className:"space-y-4",children:$&&ge&&L&&D&&e.jsx(lw,{keywordReactionConfig:$,responsePostProcessConfig:ge,chineseTypoConfig:L,responseSplitterConfig:D,onKeywordReactionChange:de,onResponsePostProcessChange:le,onChineseTypoChange:F,onResponseSplitterChange:ee})}),e.jsx(We,{value:"mood",className:"space-y-4",children:G&&e.jsx(nw,{config:G,onChange:q})}),e.jsx(We,{value:"voice",className:"space-y-4",children:ie&&e.jsx(iw,{config:ie,onChange:_})}),e.jsx(We,{value:"lpmm",className:"space-y-4",children:me&&e.jsx(rw,{config:me,onChange:xe})}),e.jsxs(We,{value:"other",className:"space-y-4",children:[we&&e.jsx(cw,{config:we,onChange:ze}),ss&&e.jsx(ow,{config:ss,onChange:Ze}),Ls&&e.jsx(dw,{config:Ls,onChange:Gs}),re&&e.jsx(uw,{config:re,onChange:be})]})]})}),v&&e.jsx(Iu,{onRestartComplete:cl,onRestartFailed:ol})]})})}function P0({config:n,onChange:r}){const c=()=>{r({...n,platforms:[...n.platforms,""]})},d=p=>{r({...n,platforms:n.platforms.filter((w,v)=>v!==p)})},h=(p,w)=>{const v=[...n.platforms];v[p]=w,r({...n,platforms:v})},x=()=>{r({...n,alias_names:[...n.alias_names,""]})},f=p=>{r({...n,alias_names:n.alias_names.filter((w,v)=>v!==p)})},j=(p,w)=>{const v=[...n.alias_names];v[p]=w,r({...n,alias_names:v})};return e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"platform",children:"平台"}),e.jsx(ce,{id:"platform",value:n.platform,onChange:p=>r({...n,platform:p.target.value}),placeholder:"qq"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"qq_account",children:"QQ账号"}),e.jsx(ce,{id:"qq_account",value:n.qq_account,onChange:p=>r({...n,qq_account:p.target.value}),placeholder:"123456789"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"nickname",children:"昵称"}),e.jsx(ce,{id:"nickname",value:n.nickname,onChange:p=>r({...n,nickname:p.target.value}),placeholder:"麦麦"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"其他平台账号"}),e.jsxs(y,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.platforms.map((p,w)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:p,onChange:v=>h(w,v.target.value),placeholder:"wx:114514"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除平台账号 "',p||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d(w),children:"删除"})]})]})]})]},w)),n.platforms.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"别名"}),e.jsxs(y,{onClick:x,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.alias_names.map((p,w)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:p,onChange:v=>j(w,v.target.value),placeholder:"小麦"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除别名 "',p||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>f(w),children:"删除"})]})]})]})]},w)),n.alias_names.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function W0({config:n,onChange:r}){const c=()=>{r({...n,states:[...n.states,""]})},d=x=>{r({...n,states:n.states.filter((f,j)=>j!==x)})},h=(x,f)=>{const j=[...n.states];j[x]=f,r({...n,states:j})};return e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"personality",children:"人格特质"}),e.jsx(Bs,{id:"personality",value:n.personality,onChange:x=>r({...n,personality:x.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"reply_style",children:"表达风格"}),e.jsx(Bs,{id:"reply_style",value:n.reply_style,onChange:x=>r({...n,reply_style:x.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"interest",children:"兴趣"}),e.jsx(Bs,{id:"interest",value:n.interest,onChange:x=>r({...n,interest:x.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"plan_style",children:"说话规则与行为风格"}),e.jsx(Bs,{id:"plan_style",value:n.plan_style,onChange:x=>r({...n,plan_style:x.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"visual_style",children:"识图规则"}),e.jsx(Bs,{id:"visual_style",value:n.visual_style,onChange:x=>r({...n,visual_style:x.target.value}),placeholder:"识图时的处理规则",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"private_plan_style",children:"私聊规则"}),e.jsx(Bs,{id:"private_plan_style",value:n.private_plan_style,onChange:x=>r({...n,private_plan_style:x.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"状态列表(人格多样性)"}),e.jsxs(y,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),e.jsx("div",{className:"space-y-2",children:n.states.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Bs,{value:x,onChange:j=>h(f,j.target.value),placeholder:"描述一个人格状态",rows:2}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsx(us,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d(f),children:"删除"})]})]})]})]},f))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"state_probability",children:"状态替换概率"}),e.jsx(ce,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:n.state_probability,onChange:x=>r({...n,state_probability:parseFloat(x.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function ew({config:n,onChange:r}){const c=()=>{r({...n,talk_value_rules:[...n.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},d=j=>{r({...n,talk_value_rules:n.talk_value_rules.filter((p,w)=>w!==j)})},h=(j,p,w)=>{const v=[...n.talk_value_rules];v[j]={...v[j],[p]:w},r({...n,talk_value_rules:v})},x=({value:j,onChange:p})=>{const[w,v]=u.useState("00"),[k,T]=u.useState("00"),[E,R]=u.useState("23"),[K,U]=u.useState("59");u.useEffect(()=>{const Z=j.split("-");if(Z.length===2){const[H,z]=Z,[B,X]=H.split(":"),[S,O]=z.split(":");B&&v(B.padStart(2,"0")),X&&T(X.padStart(2,"0")),S&&R(S.padStart(2,"0")),O&&U(O.padStart(2,"0"))}},[j]);const A=(Z,H,z,B)=>{const X=`${Z}:${H}-${z}:${B}`;p(X)};return e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[e.jsx(Wn,{className:"h-4 w-4 mr-2"}),j||"选择时间段"]})}),e.jsx(wa,{className:"w-80",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"小时"}),e.jsxs(He,{value:w,onValueChange:Z=>{v(Z),A(Z,k,E,K)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:Array.from({length:24},(Z,H)=>H).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"分钟"}),e.jsxs(He,{value:k,onValueChange:Z=>{T(Z),A(w,Z,E,K)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:Array.from({length:60},(Z,H)=>H).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"小时"}),e.jsxs(He,{value:E,onValueChange:Z=>{R(Z),A(w,k,Z,K)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:Array.from({length:24},(Z,H)=>H).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-xs",children:"分钟"}),e.jsxs(He,{value:K,onValueChange:Z=>{U(Z),A(w,k,E,Z)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:Array.from({length:60},(Z,H)=>H).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]})]})]})]})})]})},f=({rule:j})=>{const p=`{ target = "${j.target}", time = "${j.time}", value = ${j.value.toFixed(1)} }`;return e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(wa,{className:"w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:p}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),e.jsx(ce,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:n.talk_value,onChange:j=>r({...n,talk_value:parseFloat(j.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"mentioned_bot_reply",checked:n.mentioned_bot_reply,onCheckedChange:j=>r({...n,mentioned_bot_reply:j})}),e.jsx(b,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_context_size",children:"上下文长度"}),e.jsx(ce,{id:"max_context_size",type:"number",min:"1",value:n.max_context_size,onChange:j=>r({...n,max_context_size:parseInt(j.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"planner_smooth",children:"规划器平滑"}),e.jsx(ce,{id:"planner_smooth",type:"number",step:"1",min:"0",value:n.planner_smooth,onChange:j=>r({...n,planner_smooth:parseFloat(j.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_talk_value_rules",checked:n.enable_talk_value_rules,onCheckedChange:j=>r({...n,enable_talk_value_rules:j})}),e.jsx(b,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"include_planner_reasoning",checked:n.include_planner_reasoning,onCheckedChange:j=>r({...n,include_planner_reasoning:j})}),e.jsx(b,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),n.enable_talk_value_rules&&e.jsxs("div",{className:"border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),e.jsxs(y,{onClick:c,size:"sm",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),n.talk_value_rules&&n.talk_value_rules.length>0?e.jsx("div",{className:"space-y-4",children:n.talk_value_rules.map((j,p)=>e.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",p+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{rule:j}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{variant:"ghost",size:"sm",children:e.jsx(es,{className:"h-4 w-4 text-destructive"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除规则 #",p+1," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d(p),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(He,{value:j.target===""?"global":"specific",onValueChange:w=>{w==="global"?h(p,"target",""):h(p,"target","qq::group")},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"global",children:"全局配置"}),e.jsx(ne,{value:"specific",children:"详细配置"})]})]})]}),j.target!==""&&(()=>{const w=j.target.split(":"),v=w[0]||"qq",k=w[1]||"",T=w[2]||"group";return e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"平台"}),e.jsxs(He,{value:v,onValueChange:E=>{h(p,"target",`${E}:${k}:${T}`)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(ce,{value:k,onChange:E=>{h(p,"target",`${v}:${E.target.value}:${T}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"类型"}),e.jsxs(He,{value:T,onValueChange:E=>{h(p,"target",`${v}:${k}:${E}`)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"group",children:"群组(group)"}),e.jsx(ne,{value:"private",children:"私聊(private)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",j.target||"(未设置)"]})]})})(),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"时间段 (Time)"}),e.jsx(x,{value:j.time,onChange:w=>h(p,"time",w)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{htmlFor:`rule-value-${p}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),e.jsx(ce,{id:`rule-value-${p}`,type:"number",step:"0.01",min:"0.01",max:"1",value:j.value,onChange:w=>{const v=parseFloat(w.target.value);isNaN(v)||h(p,"value",Math.max(.01,Math.min(1,v)))},className:"w-20 h-8 text-xs"})]}),e.jsx(Ma,{value:[j.value],onValueChange:w=>h(p,"value",w[0]),min:.01,max:1,step:.01,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0.01 (极少发言)"}),e.jsx("span",{children:"0.5"}),e.jsx("span",{children:"1.0 (正常)"})]})]})]})]},p))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),e.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),e.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function sw({member:n,groupIndex:r,memberIndex:c,availableChatIds:d,onUpdate:h,onRemove:x}){const f=d.includes(n)||n==="*",[j,p]=u.useState(!f);return e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 flex gap-2",children:j?e.jsxs(e.Fragment,{children:[e.jsx(ce,{value:n,onChange:w=>h(r,c,w.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),d.length>0&&e.jsx(y,{size:"sm",variant:"outline",onClick:()=>p(!1),title:"切换到下拉选择",children:"下拉"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(He,{value:n,onValueChange:w=>h(r,c,w),children:[e.jsx(Re,{className:"flex-1",children:e.jsx(qe,{placeholder:"选择聊天流"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"*",children:"* (全局共享)"}),d.map((w,v)=>e.jsx(ne,{value:w,children:w},v))]})]}),e.jsx(y,{size:"sm",variant:"outline",onClick:()=>p(!0),title:"切换到手动输入",children:"输入"})]})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除组成员 "',n||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>x(r,c),children:"删除"})]})]})]})]})}function tw({config:n,onChange:r}){const c=()=>{r({...n,learning_list:[...n.learning_list,["","enable","enable","1.0"]]})},d=k=>{r({...n,learning_list:n.learning_list.filter((T,E)=>E!==k)})},h=(k,T,E)=>{const R=[...n.learning_list];R[k][T]=E,r({...n,learning_list:R})},x=({rule:k})=>{const T=`["${k[0]}", "${k[1]}", "${k[2]}", "${k[3]}"]`;return e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(wa,{className:"w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},f=()=>{r({...n,expression_groups:[...n.expression_groups,[]]})},j=k=>{r({...n,expression_groups:n.expression_groups.filter((T,E)=>E!==k)})},p=k=>{const T=[...n.expression_groups];T[k]=[...T[k],""],r({...n,expression_groups:T})},w=(k,T)=>{const E=[...n.expression_groups];E[k]=E[k].filter((R,K)=>K!==T),r({...n,expression_groups:E})},v=(k,T,E)=>{const R=[...n.expression_groups];R[k][T]=E,r({...n,expression_groups:R})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),e.jsxs(y,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.learning_list.map((k,T)=>{const E=n.learning_list.some((H,z)=>z!==T&&H[0]===""),R=k[0]==="",K=k[0].split(":"),U=K[0]||"qq",A=K[1]||"",Z=K[2]||"group";return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["规则 ",T+1," ",R&&"(全局配置)"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{rule:k}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"sm",variant:"ghost",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除学习规则 ",T+1," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d(T),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(He,{value:R?"global":"specific",onValueChange:H=>{H==="global"?h(T,0,""):h(T,0,"qq::group")},disabled:E&&!R,children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"global",children:"全局配置"}),e.jsx(ne,{value:"specific",disabled:E&&!R,children:"详细配置"})]})]}),E&&!R&&e.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!R&&e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"平台"}),e.jsxs(He,{value:U,onValueChange:H=>{h(T,0,`${H}:${A}:${Z}`)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(ce,{value:A,onChange:H=>{h(T,0,`${U}:${H.target.value}:${Z}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"类型"}),e.jsxs(He,{value:Z,onValueChange:H=>{h(T,0,`${U}:${A}:${H}`)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"group",children:"群组(group)"}),e.jsx(ne,{value:"private",children:"私聊(private)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",k[0]||"(未设置)"]})]}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs font-medium",children:"使用学到的表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),e.jsx(Ve,{checked:k[1]==="enable",onCheckedChange:H=>h(T,1,H?"enable":"disable")})]})}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xs font-medium",children:"学习表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),e.jsx(Ve,{checked:k[2]==="enable",onCheckedChange:H=>h(T,2,H?"enable":"disable")})]})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-xs font-medium",children:"学习强度"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"5",value:k[3],onChange:H=>{const z=parseFloat(H.target.value);isNaN(z)||h(T,3,Math.max(0,Math.min(5,z)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),e.jsx(Ma,{value:[parseFloat(k[3])||1],onValueChange:H=>h(T,3,H[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0 (不学习)"}),e.jsx("span",{children:"2.5"}),e.jsx("span",{children:"5.0 (快速学习)"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},T)}),n.learning_list.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达反思配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦主动向管理员询问表达方式是否合适的功能"})]}),e.jsx(Ve,{checked:n.reflect,onCheckedChange:k=>r({...n,reflect:k})})]}),n.reflect&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-sm font-medium",children:"反思操作员"})}),e.jsx("div",{className:"space-y-4",children:(()=>{const T=(n.reflect_operator_id||"").split(":"),E=T[0]||"qq",R=T[1]||"",K=T[2]||"private";return e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"平台"}),e.jsxs(He,{value:E,onValueChange:U=>{r({...n,reflect_operator_id:`${U}:${R}:${K}`})},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"用户/群 ID"}),e.jsx(ce,{value:R,onChange:U=>{r({...n,reflect_operator_id:`${E}:${U.target.value}:${K}`})},placeholder:"输入 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"类型"}),e.jsxs(He,{value:K,onValueChange:U=>{r({...n,reflect_operator_id:`${E}:${R}:${U}`})},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"private",children:"私聊(private)"}),e.jsx(ne,{value:"group",children:"群组(group)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前操作员 ID:",n.reflect_operator_id||"(未设置)"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦会向此操作员询问表达方式是否合适"})]})})()})]}),e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:"允许反思的聊天流"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"只有在此列表中的聊天流才会提出问题并跟踪。如果列表为空,则所有聊天流都可以进行表达反思"})]}),e.jsxs(y,{onClick:()=>{r({...n,allow_reflect:[...n.allow_reflect||[],"qq::group"]})},size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加聊天流"]})]}),e.jsxs("div",{className:"space-y-2",children:[(n.allow_reflect||[]).map((k,T)=>{const E=k.split(":"),R=E[0]||"qq",K=E[1]||"",U=E[2]||"group";return e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50",children:[e.jsxs(He,{value:R,onValueChange:A=>{const Z=[...n.allow_reflect];Z[T]=`${A}:${K}:${U}`,r({...n,allow_reflect:Z})},children:[e.jsx(Re,{className:"w-24",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]}),e.jsx(ce,{value:K,onChange:A=>{const Z=[...n.allow_reflect];Z[T]=`${R}:${A.target.value}:${U}`,r({...n,allow_reflect:Z})},placeholder:"ID",className:"flex-1 font-mono text-sm"}),e.jsxs(He,{value:U,onValueChange:A=>{const Z=[...n.allow_reflect];Z[T]=`${R}:${K}:${A}`,r({...n,allow_reflect:Z})},children:[e.jsx(Re,{className:"w-32",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"group",children:"群组"}),e.jsx(ne,{value:"private",children:"私聊"})]})]}),e.jsx(y,{onClick:()=>{r({...n,allow_reflect:n.allow_reflect.filter((A,Z)=>Z!==T)})},size:"sm",variant:"ghost",children:e.jsx(es,{className:"h-4 w-4"})})]},T)}),(!n.allow_reflect||n.allow_reflect.length===0)&&e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"列表为空,所有聊天流都可以进行表达反思"})]})]})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),e.jsxs(y,{onClick:f,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.expression_groups.map((k,T)=>{const E=n.learning_list.map(R=>R[0]).filter(R=>R!=="");return e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",T+1,k.length===1&&k[0]==="*"&&"(全局共享)"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(y,{onClick:()=>p(T),size:"sm",variant:"outline",children:e.jsx(ot,{className:"h-4 w-4"})}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"sm",variant:"ghost",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除共享组 ",T+1," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>j(T),children:"删除"})]})]})]})]})]}),e.jsx("div",{className:"space-y-2",children:k.map((R,K)=>e.jsx(sw,{member:R,groupIndex:T,memberIndex:K,availableChatIds:E,onUpdate:v,onRemove:w},`${T}-${K}`))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},T)}),n.expression_groups.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function aw({emojiConfig:n,memoryConfig:r,toolConfig:c,onEmojiChange:d,onMemoryChange:h,onToolChange:x}){return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_tool",checked:c.enable_tool,onCheckedChange:f=>x({...c,enable_tool:f})}),e.jsx(b,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),e.jsx(ce,{id:"max_agent_iterations",type:"number",min:"1",value:r.max_agent_iterations,onChange:f=>h({...r,max_agent_iterations:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsx(ce,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:n.emoji_chance,onChange:f=>d({...n,emoji_chance:parseFloat(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_reg_num",children:"最大注册数量"}),e.jsx(ce,{id:"max_reg_num",type:"number",min:"1",value:n.max_reg_num,onChange:f=>d({...n,max_reg_num:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(ce,{id:"check_interval",type:"number",min:"1",value:n.check_interval,onChange:f=>d({...n,check_interval:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"do_replace",checked:n.do_replace,onCheckedChange:f=>d({...n,do_replace:f})}),e.jsx(b,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:f=>d({...n,steal_emoji:f})}),e.jsx(b,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:f=>d({...n,content_filtration:f})}),e.jsx(b,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),n.content_filtration&&e.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[e.jsx(b,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(ce,{id:"filtration_prompt",value:n.filtration_prompt,onChange:f=>d({...n,filtration_prompt:f.target.value}),placeholder:"符合公序良俗"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function lw({keywordReactionConfig:n,responsePostProcessConfig:r,chineseTypoConfig:c,responseSplitterConfig:d,onKeywordReactionChange:h,onResponsePostProcessChange:x,onChineseTypoChange:f,onResponseSplitterChange:j}){const p=()=>{h({...n,regex_rules:[...n.regex_rules,{regex:[""],reaction:""}]})},w=z=>{h({...n,regex_rules:n.regex_rules.filter((B,X)=>X!==z)})},v=(z,B,X)=>{const S=[...n.regex_rules];B==="regex"&&typeof X=="string"?S[z]={...S[z],regex:[X]}:B==="reaction"&&typeof X=="string"&&(S[z]={...S[z],reaction:X}),h({...n,regex_rules:S})},k=({regex:z,reaction:B,onRegexChange:X,onReactionChange:S})=>{const[O,te]=u.useState(!1),[he,Ne]=u.useState(""),[ye,pe]=u.useState(null),[je,_e]=u.useState(""),[N,G]=u.useState({}),[q,ie]=u.useState(""),_=u.useRef(null),[me,xe]=u.useState("build"),$=L=>L.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),de=(L,F=0)=>{const D=_.current;if(!D)return;const ee=D.selectionStart||0,we=D.selectionEnd||0,ze=z.substring(0,ee)+L+z.substring(we);X(ze),setTimeout(()=>{const ss=ee+L.length+F;D.setSelectionRange(ss,ss),D.focus()},0)};u.useEffect(()=>{if(!z||!he){pe(null),G({}),ie(B),_e("");return}try{const L=$(z),F=new RegExp(L,"g"),D=he.match(F);pe(D),_e("");const we=new RegExp(L).exec(he);if(we&&we.groups){G(we.groups);let ze=B;Object.entries(we.groups).forEach(([ss,Ze])=>{ze=ze.replace(new RegExp(`\\[${ss}\\]`,"g"),Ze||"")}),ie(ze)}else G({}),ie(B)}catch(L){_e(L.message),pe(null),G({}),ie(B)}},[z,he,B]);const ge=()=>{if(!he||!ye||ye.length===0)return e.jsx("span",{className:"text-muted-foreground",children:he||"请输入测试文本"});try{const L=$(z),F=new RegExp(L,"g");let D=0;const ee=[];let we;for(;(we=F.exec(he))!==null;)we.index>D&&ee.push(e.jsx("span",{children:he.substring(D,we.index)},`text-${D}`)),ee.push(e.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:we[0]},`match-${we.index}`)),D=we.index+we[0].length;return D)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return e.jsxs(Rs,{open:O,onOpenChange:te,children:[e.jsx(ni,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",children:[e.jsx(ao,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),e.jsxs(zs,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"正则表达式编辑器"}),e.jsx(Ys,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),e.jsx(Pe,{className:"max-h-[calc(90vh-120px)]",children:e.jsxs(Kt,{value:me,onValueChange:L=>xe(L),className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-2",children:[e.jsx($e,{value:"build",children:"🔧 构建器"}),e.jsx($e,{value:"test",children:"🧪 测试器"})]}),e.jsxs(We,{value:"build",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"正则表达式"}),e.jsx(ce,{ref:_,value:z,onChange:L=>X(L.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"Reaction 内容"}),e.jsx(Bs,{value:B,onChange:L=>S(L.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[le.map(L=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:L.category}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:L.items.map(F=>e.jsx(y,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>de(F.pattern,F.moveCursor||0),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("span",{className:"text-xs font-medium",children:F.label}),e.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:F.pattern})]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:F.desc})]})},F.label))})]},L.category)),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("^(?P\\S{1,20})是这样的$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),e.jsx(y,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),e.jsx(y,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("(?P.+?)(?:是|为什么|怎么)"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),e.jsxs("li",{children:["命名捕获组格式:",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),e.jsxs("li",{children:["在 reaction 中使用 ",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),e.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),e.jsxs(We,{value:"test",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"当前正则表达式"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:z||"(未设置)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),e.jsx(Bs,{id:"test-text",value:he,onChange:L=>Ne(L.target.value),placeholder:`在此输入要测试的文本... -例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),je&&e.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[e.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),e.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:je})]}),!je&&he&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:ye&&ye.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),e.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",ye.length," 处)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"匹配高亮"}),e.jsx(Pe,{className:"h-40 rounded-md bg-muted p-3",children:e.jsx("div",{className:"text-sm break-words",children:ge()})})]}),Object.keys(N).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"命名捕获组"}),e.jsx(Pe,{className:"h-32 rounded-md border p-3",children:e.jsx("div",{className:"space-y-2",children:Object.entries(N).map(([L,F])=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",L,"]"]}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:F})]},L))})})]}),Object.keys(N).length>0&&B&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"text-sm font-medium",children:"Reaction 替换预览"}),e.jsx(Pe,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:e.jsx("div",{className:"text-sm break-words",children:q})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),e.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),e.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),e.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},T=()=>{h({...n,keyword_rules:[...n.keyword_rules,{keywords:[],reaction:""}]})},E=z=>{h({...n,keyword_rules:n.keyword_rules.filter((B,X)=>X!==z)})},R=(z,B,X)=>{const S=[...n.keyword_rules];typeof X=="string"&&(S[z]={...S[z],reaction:X}),h({...n,keyword_rules:S})},K=z=>{const B=[...n.keyword_rules];B[z]={...B[z],keywords:[...B[z].keywords||[],""]},h({...n,keyword_rules:B})},U=(z,B)=>{const X=[...n.keyword_rules];X[z]={...X[z],keywords:(X[z].keywords||[]).filter((S,O)=>O!==B)},h({...n,keyword_rules:X})},A=(z,B,X)=>{const S=[...n.keyword_rules],O=[...S[z].keywords||[]];O[B]=X,S[z]={...S[z],keywords:O},h({...n,keyword_rules:S})},Z=({rule:z})=>{const B=`{ regex = [${(z.regex||[]).map(X=>`"${X}"`).join(", ")}], reaction = "${z.reaction}" }`;return e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(wa,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(Pe,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs break-all",children:B})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},H=({rule:z})=>{const B=`[[keyword_reaction.keyword_rules]] -keywords = [${(z.keywords||[]).map(X=>`"${X}"`).join(", ")}] -reaction = "${z.reaction}"`;return e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(wa,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(Pe,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:B})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),e.jsxs(y,{onClick:p,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.regex_rules.map((z,B)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",B+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{regex:z.regex&&z.regex[0]||"",reaction:z.reaction,onRegexChange:X=>v(B,"regex",X),onReactionChange:X=>v(B,"reaction",X)}),e.jsx(Z,{rule:z}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"sm",variant:"ghost",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除正则规则 ",B+1," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>w(B),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),e.jsx(ce,{value:z.regex&&z.regex[0]||"",onChange:X=>v(B,"regex",X.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Bs,{value:z.reaction,onChange:X=>v(B,"reaction",X.target.value),placeholder:`触发后麦麦的反应... -可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},B)),n.regex_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),e.jsxs("div",{className:"space-y-4 border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),e.jsxs(y,{onClick:T,size:"sm",variant:"outline",children:[e.jsx(ot,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.keyword_rules.map((z,B)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",B+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{rule:z}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"sm",variant:"ghost",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除关键词规则 ",B+1," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>E(B),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{className:"text-xs font-medium",children:"关键词列表"}),e.jsxs(y,{onClick:()=>K(B),size:"sm",variant:"ghost",children:[e.jsx(ot,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),e.jsxs("div",{className:"space-y-2",children:[(z.keywords||[]).map((X,S)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{value:X,onChange:O=>A(B,S,O.target.value),placeholder:"关键词",className:"flex-1"}),e.jsx(y,{onClick:()=>U(B,S),size:"sm",variant:"ghost",children:e.jsx(es,{className:"h-4 w-4"})})]},S)),(!z.keywords||z.keywords.length===0)&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Bs,{value:z.reaction,onChange:X=>R(B,"reaction",X.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},B)),n.keyword_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_response_post_process",checked:r.enable_response_post_process,onCheckedChange:z=>x({...r,enable_response_post_process:z})}),e.jsx(b,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),r.enable_response_post_process&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(Ve,{id:"enable_chinese_typo",checked:c.enable,onCheckedChange:z=>f({...c,enable:z})}),e.jsx(b,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),c.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),e.jsx(ce,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.error_rate,onChange:z=>f({...c,error_rate:parseFloat(z.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),e.jsx(ce,{id:"min_freq",type:"number",min:"0",value:c.min_freq,onChange:z=>f({...c,min_freq:parseInt(z.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),e.jsx(ce,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:c.tone_error_rate,onChange:z=>f({...c,tone_error_rate:parseFloat(z.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),e.jsx(ce,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.word_replace_rate,onChange:z=>f({...c,word_replace_rate:parseFloat(z.target.value)})})]})]})]})}),e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(Ve,{id:"enable_response_splitter",checked:d.enable,onCheckedChange:z=>j({...d,enable:z})}),e.jsx(b,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),d.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),e.jsx(ce,{id:"max_length",type:"number",min:"1",value:d.max_length,onChange:z=>j({...d,max_length:parseInt(z.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),e.jsx(ce,{id:"max_sentence_num",type:"number",min:"1",value:d.max_sentence_num,onChange:z=>j({...d,max_sentence_num:parseInt(z.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_kaomoji_protection",checked:d.enable_kaomoji_protection,onCheckedChange:z=>j({...d,enable_kaomoji_protection:z})}),e.jsx(b,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_overflow_return_all",checked:d.enable_overflow_return_all,onCheckedChange:z=>j({...d,enable_overflow_return_all:z})}),e.jsx(b,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function nw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.enable_mood,onCheckedChange:c=>r({...n,enable_mood:c})}),e.jsx(b,{className:"cursor-pointer",children:"启用情绪系统"})]}),n.enable_mood&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"情绪更新阈值"}),e.jsx(ce,{type:"number",min:"1",value:n.mood_update_threshold,onChange:c=>r({...n,mood_update_threshold:parseInt(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"情感特征"}),e.jsx(Bs,{value:n.emotion_style,onChange:c=>r({...n,emotion_style:c.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function iw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.enable_asr,onCheckedChange:c=>r({...n,enable_asr:c})}),e.jsx(b,{className:"cursor-pointer",children:"启用语音识别"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function rw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.enable,onCheckedChange:c=>r({...n,enable:c})}),e.jsx(b,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),n.enable&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"LPMM 模式"}),e.jsxs(He,{value:n.lpmm_mode,onValueChange:c=>r({...n,lpmm_mode:c}),children:[e.jsx(Re,{children:e.jsx(qe,{placeholder:"选择 LPMM 模式"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"classic",children:"经典模式"}),e.jsx(ne,{value:"agent",children:"Agent 模式"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"同义词搜索 TopK"}),e.jsx(ce,{type:"number",min:"1",value:n.rag_synonym_search_top_k,onChange:c=>r({...n,rag_synonym_search_top_k:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"同义词阈值"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",value:n.rag_synonym_threshold,onChange:c=>r({...n,rag_synonym_threshold:parseFloat(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"实体提取线程数"}),e.jsx(ce,{type:"number",min:"1",value:n.info_extraction_workers,onChange:c=>r({...n,info_extraction_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"嵌入向量维度"}),e.jsx(ce,{type:"number",min:"1",value:n.embedding_dimension,onChange:c=>r({...n,embedding_dimension:parseInt(c.target.value)})})]})]})]})]})]})}function cw({config:n,onChange:r}){const[c,d]=u.useState(""),[h,x]=u.useState("WARNING"),f=()=>{c&&!n.suppress_libraries.includes(c)&&(r({...n,suppress_libraries:[...n.suppress_libraries,c]}),d(""))},j=E=>{r({...n,suppress_libraries:n.suppress_libraries.filter(R=>R!==E)})},p=()=>{c&&!n.library_log_levels[c]&&(r({...n,library_log_levels:{...n.library_log_levels,[c]:h}}),d(""),x("WARNING"))},w=E=>{const R={...n.library_log_levels};delete R[E],r({...n,library_log_levels:R})},v=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],k=["FULL","compact","lite"],T=["none","title","full"];return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"日期格式"}),e.jsx(ce,{value:n.date_style,onChange:E=>r({...n,date_style:E.target.value}),placeholder:"例如: m-d H:i:s"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"日志级别样式"}),e.jsxs(He,{value:n.log_level_style,onValueChange:E=>r({...n,log_level_style:E}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:k.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"日志文本颜色"}),e.jsxs(He,{value:n.color_text,onValueChange:E=>r({...n,color_text:E}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:T.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"全局日志级别"}),e.jsxs(He,{value:n.log_level,onValueChange:E=>r({...n,log_level:E}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"控制台日志级别"}),e.jsxs(He,{value:n.console_log_level,onValueChange:E=>r({...n,console_log_level:E}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"文件日志级别"}),e.jsxs(He,{value:n.file_log_level,onValueChange:E=>r({...n,file_log_level:E}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"mb-2 block",children:"完全屏蔽的库"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:E=>d(E.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),f())}}),e.jsx(y,{onClick:f,size:"sm",className:"flex-shrink-0",children:e.jsx(ot,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.suppress_libraries.map(E=>e.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[e.jsx("span",{className:"text-sm",children:E}),e.jsx(y,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>j(E),children:e.jsx(es,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},E))})]}),e.jsxs("div",{children:[e.jsx(b,{className:"mb-2 block",children:"特定库的日志级别"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:E=>d(E.target.value),placeholder:"输入库名",className:"flex-1"}),e.jsxs(He,{value:h,onValueChange:x,children:[e.jsx(Re,{className:"w-32",children:e.jsx(qe,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]}),e.jsx(y,{onClick:p,size:"sm",children:e.jsx(ot,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(n.library_log_levels).map(([E,R])=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-medium",children:E}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:R}),e.jsx(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>w(E),children:e.jsx(es,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},E))})]})]})}function ow({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),e.jsx(Ve,{checked:n.show_prompt,onCheckedChange:c=>r({...n,show_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示回复器 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),e.jsx(Ve,{checked:n.show_replyer_prompt,onCheckedChange:c=>r({...n,show_replyer_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示回复器推理"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),e.jsx(Ve,{checked:n.show_replyer_reasoning,onCheckedChange:c=>r({...n,show_replyer_reasoning:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 Jargon Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),e.jsx(Ve,{checked:n.show_jargon_prompt,onCheckedChange:c=>r({...n,show_jargon_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示记忆检索 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),e.jsx(Ve,{checked:n.show_memory_prompt,onCheckedChange:c=>r({...n,show_memory_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 Planner Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),e.jsx(Ve,{checked:n.show_planner_prompt,onCheckedChange:c=>r({...n,show_planner_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"显示 LPMM 相关文段"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),e.jsx(Ve,{checked:n.show_lpmm_paragraph,onCheckedChange:c=>r({...n,show_lpmm_paragraph:c})})]})]})]})}function dw({config:n,onChange:r}){const[c,d]=u.useState(""),h=()=>{c&&!n.auth_token.includes(c)&&(r({...n,auth_token:[...n.auth_token,c]}),d(""))},x=f=>{r({...n,auth_token:n.auth_token.filter((j,p)=>p!==f)})};return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"启用自定义服务器"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),e.jsx(Ve,{checked:n.use_custom,onCheckedChange:f=>r({...n,use_custom:f})})]}),n.use_custom&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"主机地址"}),e.jsx(ce,{value:n.host,onChange:f=>r({...n,host:f.target.value}),placeholder:"127.0.0.1"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"端口号"}),e.jsx(ce,{type:"number",value:n.port,onChange:f=>r({...n,port:parseInt(f.target.value)}),placeholder:"8090"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"连接模式"}),e.jsxs(He,{value:n.mode,onValueChange:f=>r({...n,mode:f}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"ws",children:"WebSocket (ws)"}),e.jsx(ne,{value:"tcp",children:"TCP"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.use_wss,onCheckedChange:f=>r({...n,use_wss:f}),disabled:n.mode!=="ws"}),e.jsx(b,{children:"使用 WSS 安全连接"})]})]}),n.use_wss&&n.mode==="ws"&&e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"SSL 证书文件路径"}),e.jsx(ce,{value:n.cert_file,onChange:f=>r({...n,cert_file:f.target.value}),placeholder:"cert.pem"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"SSL 密钥文件路径"}),e.jsx(ce,{value:n.key_file,onChange:f=>r({...n,key_file:f.target.value}),placeholder:"key.pem"})]})]})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"mb-2 block",children:"认证令牌"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:f=>d(f.target.value),placeholder:"输入认证令牌",onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),h())}}),e.jsx(y,{onClick:h,size:"sm",children:e.jsx(ot,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.auth_token.map((f,j)=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-mono",children:f}),e.jsx(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>x(j),children:e.jsx(es,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},j))})]})]})}function uw({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:"启用统计信息发送"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),e.jsx(Ve,{checked:n.enable,onCheckedChange:c=>r({...n,enable:c})})]})]})}const ii=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:c,className:Q("w-full caption-bottom text-sm",n),...r})}));ii.displayName="Table";const ri=u.forwardRef(({className:n,...r},c)=>e.jsx("thead",{ref:c,className:Q("[&_tr]:border-b",n),...r}));ri.displayName="TableHeader";const ci=u.forwardRef(({className:n,...r},c)=>e.jsx("tbody",{ref:c,className:Q("[&_tr:last-child]:border-0",n),...r}));ci.displayName="TableBody";const mw=u.forwardRef(({className:n,...r},c)=>e.jsx("tfoot",{ref:c,className:Q("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",n),...r}));mw.displayName="TableFooter";const gt=u.forwardRef(({className:n,...r},c)=>e.jsx("tr",{ref:c,className:Q("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...r}));gt.displayName="TableRow";const ls=u.forwardRef(({className:n,...r},c)=>e.jsx("th",{ref:c,className:Q("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r}));ls.displayName="TableHead";const Qe=u.forwardRef(({className:n,...r},c)=>e.jsx("td",{ref:c,className:Q("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r}));Qe.displayName="TableCell";const hw=u.forwardRef(({className:n,...r},c)=>e.jsx("caption",{ref:c,className:Q("mt-4 text-sm text-muted-foreground",n),...r}));hw.displayName="TableCaption";const oo=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt,{ref:c,className:Q("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),...r}));oo.displayName=Lt.displayName;const uo=u.forwardRef(({className:n,...r},c)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(_t,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Lt.Input,{ref:c,className:Q("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...r})]}));uo.displayName=Lt.Input.displayName;const mo=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.List,{ref:c,className:Q("max-h-[300px] overflow-y-auto overflow-x-hidden",n),...r}));mo.displayName=Lt.List.displayName;const ho=u.forwardRef((n,r)=>e.jsx(Lt.Empty,{ref:r,className:"py-6 text-center text-sm",...n}));ho.displayName=Lt.Empty.displayName;const vr=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.Group,{ref:c,className:Q("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",n),...r}));vr.displayName=Lt.Group.displayName;const xw=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.Separator,{ref:c,className:Q("-mx-1 h-px bg-border",n),...r}));xw.displayName=Lt.Separator.displayName;const yr=u.forwardRef(({className:n,...r},c)=>e.jsx(Lt.Item,{ref:c,className:Q("relative flex cursor-default gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n),...r}));yr.displayName=Lt.Item.displayName;const yt=u.forwardRef(({className:n,...r},c)=>e.jsx(og,{ref:c,className:Q("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...r,children:e.jsx(pN,{className:Q("grid place-content-center text-current"),children:e.jsx(fa,{className:"h-4 w-4"})})}));yt.displayName=og.displayName;const Bg=u.createContext(null),Hg="maibot-completed-tours";function fw(){try{const n=localStorage.getItem(Hg);return n?new Set(JSON.parse(n)):new Set}catch{return new Set}}function dp(n){localStorage.setItem(Hg,JSON.stringify([...n]))}function pw({children:n}){const[r,c]=u.useState({activeTourId:null,stepIndex:0,isRunning:!1}),d=u.useRef(new Map),[,h]=u.useState(0),[x,f]=u.useState(fw),j=u.useCallback((H,z)=>{d.current.set(H,z),h(B=>B+1)},[]),p=u.useCallback(H=>{d.current.delete(H),c(z=>z.activeTourId===H?{...z,activeTourId:null,isRunning:!1,stepIndex:0}:z)},[]),w=u.useCallback((H,z=0)=>{d.current.has(H)&&c({activeTourId:H,stepIndex:z,isRunning:!0})},[]),v=u.useCallback(()=>{c(H=>({...H,isRunning:!1}))},[]),k=u.useCallback(H=>{c(z=>({...z,stepIndex:H}))},[]),T=u.useCallback(()=>{c(H=>({...H,stepIndex:H.stepIndex+1}))},[]),E=u.useCallback(()=>{c(H=>({...H,stepIndex:Math.max(0,H.stepIndex-1)}))},[]),R=u.useCallback(()=>r.activeTourId?d.current.get(r.activeTourId)||[]:[],[r.activeTourId]),K=u.useCallback(H=>{f(z=>{const B=new Set(z);return B.add(H),dp(B),B})},[]),U=u.useCallback(H=>{const{action:z,index:B,status:X,type:S}=H,O=["finished","skipped"];if(z==="close"){c(te=>({...te,isRunning:!1,stepIndex:0}));return}O.includes(X)?c(te=>(X==="finished"&&te.activeTourId&&setTimeout(()=>K(te.activeTourId),0),{...te,isRunning:!1,stepIndex:0})):S==="step:after"&&(z==="next"?c(te=>({...te,stepIndex:B+1})):z==="prev"&&c(te=>({...te,stepIndex:B-1})))},[K]),A=u.useCallback(H=>x.has(H),[x]),Z=u.useCallback(H=>{f(z=>{const B=new Set(z);return B.delete(H),dp(B),B})},[]);return e.jsx(Bg.Provider,{value:{state:r,tours:d.current,registerTour:j,unregisterTour:p,startTour:w,stopTour:v,goToStep:k,nextStep:T,prevStep:E,getCurrentSteps:R,handleJoyrideCallback:U,isTourCompleted:A,markTourCompleted:K,resetTourCompleted:Z},children:n})}function Pu(){const n=u.useContext(Bg);if(!n)throw new Error("useTour must be used within a TourProvider");return n}const gw={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},jw={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function vw(){const{state:n,getCurrentSteps:r,handleJoyrideCallback:c}=Pu(),d=r(),[h,x]=u.useState(!1),f=u.useRef(n.stepIndex),j=u.useRef(null);u.useEffect(()=>{f.current!==n.stepIndex&&(x(!1),f.current=n.stepIndex)},[n.stepIndex]),u.useEffect(()=>{if(!n.isRunning||d.length===0){x(!1);return}const v=d[n.stepIndex];if(!v){x(!1);return}const k=v.target;if(k==="body"){x(!0);return}x(!1);const T=setTimeout(()=>{const E=()=>{const A=document.querySelector(k);if(A){const Z=A.getBoundingClientRect();if(Z.width>0&&Z.height>0)return!0}return!1};if(E()){setTimeout(()=>x(!0),100);return}const R=setInterval(()=>{E()&&(clearInterval(R),setTimeout(()=>x(!0),100))},100),K=setTimeout(()=>{clearInterval(R),x(!0)},5e3),U=()=>{clearInterval(R),clearTimeout(K)};j.current=U},150);return()=>{clearTimeout(T),j.current&&(j.current(),j.current=null)}},[n.isRunning,n.stepIndex,d]);const p=u.useRef(null);if(u.useEffect(()=>{let v=document.getElementById("tour-portal-container");return v||(v=document.createElement("div"),v.id="tour-portal-container",v.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(v)),p.current=v,()=>{}},[]),!n.isRunning||d.length===0||!h)return null;const w=e.jsx(rb,{steps:d,stepIndex:n.stepIndex,run:n.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:c,styles:gw,locale:jw,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${n.stepIndex}`);return p.current?fy.createPortal(w,p.current):w}const ll="model-assignment-tour",qg=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],Gg={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},rr=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function up(n){return n?n.replace(/\/+$/,"").toLowerCase():""}function yw(n){if(!n)return null;const r=up(n);return rr.find(c=>c.id!=="custom"&&up(c.base_url)===r)||null}function Nw(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!1),[T,E]=u.useState(!1),[R,K]=u.useState(!1),[U,A]=u.useState(null),[Z,H]=u.useState(null),[z,B]=u.useState("custom"),[X,S]=u.useState(!1),[O,te]=u.useState(!1),[he,Ne]=u.useState(null),[ye,pe]=u.useState(!1),[je,_e]=u.useState(""),[N,G]=u.useState(new Set),[q,ie]=u.useState(!1),[_,me]=u.useState(1),[xe,$]=u.useState(20),[de,ge]=u.useState(""),[le,L]=u.useState({}),[F,D]=u.useState(new Set),[ee,we]=u.useState(new Map),{toast:ze}=Hs(),ss=Jt(),{state:Ze,goToStep:Ls,registerTour:Gs}=Pu(),re=u.useRef(null),be=u.useRef(!0);u.useEffect(()=>{Gs(ll,qg)},[Gs]),u.useEffect(()=>{if(Ze.activeTourId===ll&&Ze.isRunning){const W=Gg[Ze.stepIndex];W&&!window.location.pathname.endsWith(W.replace("/config/",""))&&ss({to:W})}},[Ze.stepIndex,Ze.activeTourId,Ze.isRunning,ss]);const Xe=u.useRef(Ze.stepIndex);u.useEffect(()=>{if(Ze.activeTourId===ll&&Ze.isRunning){const W=Xe.current,ve=Ze.stepIndex;W>=3&&W<=9&&ve<3&&K(!1),W>=10&&ve>=3&&ve<=9&&(L({}),B("custom"),A({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),H(null),pe(!1),K(!0)),Xe.current=ve}},[Ze.stepIndex,Ze.activeTourId,Ze.isRunning]),u.useEffect(()=>{if(Ze.activeTourId!==ll||!Ze.isRunning)return;const W=ve=>{const Me=ve.target,tt=Ze.stepIndex;tt===2&&Me.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Ls(3),300):tt===9&&Me.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>Ls(10),300)};return document.addEventListener("click",W,!0),()=>document.removeEventListener("click",W,!0)},[Ze,Ls]),u.useEffect(()=>{Ue()},[]);const Ue=async()=>{try{d(!0);const W=await ei();r(W.api_providers||[]),w(!1),be.current=!1}catch(W){console.error("加载配置失败:",W)}finally{d(!1)}},st=async()=>{try{k(!0),co().catch(()=>{}),E(!0)}catch(W){console.error("重启失败:",W),E(!1),ze({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),k(!1)}},It=async()=>{try{x(!0),re.current&&clearTimeout(re.current);const W=await ei();W.api_providers=n,await io(W),w(!1),ze({title:"保存成功",description:"正在重启麦麦..."}),await st()}catch(W){console.error("保存配置失败:",W),ze({title:"保存失败",description:W.message,variant:"destructive"}),x(!1)}},bt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Je=()=>{E(!1),k(!1),ze({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Be=u.useCallback(async W=>{if(!be.current)try{j(!0),await qu("api_providers",W),w(!1)}catch(ve){console.error("自动保存失败:",ve),w(!0)}finally{j(!1)}},[]);u.useEffect(()=>{if(!be.current)return w(!0),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{Be(n)},2e3),()=>{re.current&&clearTimeout(re.current)}},[n,Be]);const jt=async()=>{try{x(!0),re.current&&clearTimeout(re.current);const W=await ei();W.api_providers=n,await io(W),w(!1),ze({title:"保存成功",description:"模型提供商配置已保存"})}catch(W){console.error("保存配置失败:",W),ze({title:"保存失败",description:W.message,variant:"destructive"})}finally{x(!1)}},nt=(W,ve)=>{if(L({}),W){const Me=rr.find(tt=>tt.base_url===W.base_url&&tt.client_type===W.client_type);B(Me?.id||"custom"),A(W)}else B("custom"),A({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});H(ve),pe(!1),K(!0)},St=W=>{B(W),S(!1);const ve=rr.find(Me=>Me.id===W);ve&&ve.id!=="custom"?A(Me=>({...Me,name:ve.name,base_url:ve.base_url,client_type:ve.client_type})):ve?.id==="custom"&&A(Me=>({...Me,name:"",base_url:"",client_type:"openai"}))},Ct=u.useMemo(()=>z!=="custom",[z]),rl=async()=>{if(U?.api_key)try{await navigator.clipboard.writeText(U.api_key),ze({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ze({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},cl=()=>{if(!U)return;const W={};if(U.name?.trim()||(W.name="请输入提供商名称"),U.base_url?.trim()||(W.base_url="请输入基础 URL"),U.api_key?.trim()||(W.api_key="请输入 API Key"),Object.keys(W).length>0){L(W);return}L({});const ve={...U,max_retry:U.max_retry??2,timeout:U.timeout??30,retry_interval:U.retry_interval??10};if(Z!==null){const Me=[...n];Me[Z]=ve,r(Me)}else r([...n,ve]);K(!1),A(null),H(null)},ol=W=>{if(!W&&U){const ve={...U,max_retry:U.max_retry??2,timeout:U.timeout??30,retry_interval:U.retry_interval??10};A(ve)}K(W)},Se=W=>{Ne(W),te(!0)},Oe=()=>{if(he!==null){const W=n.filter((ve,Me)=>Me!==he);r(W),ze({title:"删除成功",description:"提供商已从列表中移除"})}te(!1),Ne(null)},it=W=>{const ve=new Set(N);ve.has(W)?ve.delete(W):ve.add(W),G(ve)},dt=()=>{if(N.size===ut.length)G(new Set);else{const W=ut.map((ve,Me)=>n.findIndex(tt=>tt===ut[Me]));G(new Set(W))}},di=()=>{if(N.size===0){ze({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}ie(!0)},on=()=>{const W=n.filter((ve,Me)=>!N.has(Me));r(W),G(new Set),ie(!1),ze({title:"批量删除成功",description:`已删除 ${N.size} 个提供商`})},ut=n.filter(W=>{if(!je)return!0;const ve=je.toLowerCase();return W.name.toLowerCase().includes(ve)||W.base_url.toLowerCase().includes(ve)||W.client_type.toLowerCase().includes(ve)}),Pt=Math.ceil(ut.length/xe),Wt=ut.slice((_-1)*xe,_*xe),Ua=()=>{const W=parseInt(de);W>=1&&W<=Pt&&(me(W),ge(""))},Ut=async W=>{D(ve=>new Set(ve).add(W));try{const ve=await Q0(W);we(Me=>new Map(Me).set(W,ve)),ve.network_ok?ve.api_key_valid===!0?ze({title:"连接正常",description:`${W} 网络连接正常,API Key 有效 (${ve.latency_ms}ms)`}):ve.api_key_valid===!1?ze({title:"连接正常但 Key 无效",description:`${W} 网络连接正常,但 API Key 无效或已过期`,variant:"destructive"}):ze({title:"网络连接正常",description:`${W} 可以访问 (${ve.latency_ms}ms)`}):ze({title:"连接失败",description:ve.error||"无法连接到提供商",variant:"destructive"})}catch(ve){ze({title:"测试失败",description:ve.message,variant:"destructive"})}finally{D(ve=>{const Me=new Set(ve);return Me.delete(W),Me})}},Ba=async()=>{for(const W of n)await Ut(W.name)},_a=W=>{const ve=F.has(W),Me=ee.get(W);return ve?e.jsxs(Ye,{variant:"secondary",className:"gap-1",children:[e.jsx(vt,{className:"h-3 w-3 animate-spin"}),"测试中"]}):Me?Me.network_ok?Me.api_key_valid===!0?e.jsxs(Ye,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[e.jsx(pa,{className:"h-3 w-3"}),"正常"]}):Me.api_key_valid===!1?e.jsxs(Ye,{variant:"destructive",className:"gap-1",children:[e.jsx(Da,{className:"h-3 w-3"}),"Key无效"]}):e.jsxs(Ye,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[e.jsx(pa,{className:"h-3 w-3"}),"可访问"]}):e.jsxs(Ye,{variant:"destructive",className:"gap-1",children:[e.jsx(jg,{className:"h-3 w-3"}),"离线"]}):null};return c?e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[N.size>0&&e.jsxs(y,{onClick:di,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(es,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",N.size,")"]}),e.jsxs(y,{onClick:Ba,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:n.length===0||F.size>0,children:[e.jsx(ln,{className:"mr-2 h-4 w-4"}),F.size>0?`测试中 (${F.size})`:"测试全部"]}),e.jsxs(y,{onClick:()=>nt(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[e.jsx(ot,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),e.jsxs(y,{onClick:jt,disabled:h||f||!p||v,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(br,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),h?"保存中...":f?"自动保存中...":p?"保存配置":"已保存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{disabled:h||f||v,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(Nr,{className:"mr-2 h-4 w-4"}),v?"重启中...":p?"保存并重启":"重启麦麦"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认重启麦麦?"}),e.jsx(us,{className:"space-y-3",asChild:!0,children:e.jsxs("div",{children:[e.jsx("p",{children:p?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),e.jsxs(ha,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Xt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",e.jsxs(Rs,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[e.jsx(ro,{className:"h-3 w-3"}),"如何结束程序?"]})}),e.jsxs(zs,{className:"max-w-2xl",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"如何结束使用重启功能后的麦麦程序"}),e.jsx(Ys,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),e.jsxs(Kt,{defaultValue:"windows",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsx($e,{value:"windows",children:"Windows"}),e.jsx($e,{value:"macos",children:"macOS"}),e.jsx($e,{value:"linux",children:"Linux"})]}),e.jsxs(We,{value:"windows",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),e.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),e.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),e.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),e.jsxs(We,{value:"macos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),e.jsxs("li",{children:["在进程列表中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),e.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]})]}),e.jsxs(We,{value:"linux",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),e.jsx("p",{children:'pkill -9 -f "bot.py"'}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["在终端输入 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),e.jsx(Js,{children:e.jsx(Zu,{asChild:!0,children:e.jsx(y,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:p?It:st,children:p?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(ha,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(xa,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(Pe,{className:"h-[calc(100vh-260px)]",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索提供商名称、URL 或类型...",value:je,onChange:W=>_e(W.target.value),className:"pl-9"})]}),je&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",ut.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:ut.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:je?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):Wt.map((W,ve)=>{const Me=n.findIndex(tt=>tt===W);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-base truncate",children:W.name}),_a(W.name)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:W.base_url})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>Ut(W.name),disabled:F.has(W.name),title:"测试连接",children:F.has(W.name)?e.jsx(vt,{className:"h-4 w-4 animate-spin"}):e.jsx(ln,{className:"h-4 w-4"})}),e.jsx(y,{variant:"default",size:"sm",onClick:()=>nt(W,Me),children:e.jsx(nn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),e.jsx(y,{size:"sm",onClick:()=>Se(Me),className:"bg-red-600 hover:bg-red-700 text-white",children:e.jsx(es,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),e.jsx("p",{className:"font-medium",children:W.client_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),e.jsx("p",{className:"font-medium",children:W.max_retry})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),e.jsx("p",{className:"font-medium",children:W.timeout})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),e.jsx("p",{className:"font-medium",children:W.retry_interval})]})]})]},ve)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(gt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:N.size===ut.length&&ut.length>0,onCheckedChange:dt})}),e.jsx(ls,{children:"状态"}),e.jsx(ls,{children:"名称"}),e.jsx(ls,{children:"基础URL"}),e.jsx(ls,{children:"客户端类型"}),e.jsx(ls,{className:"text-right",children:"最大重试"}),e.jsx(ls,{className:"text-right",children:"超时(秒)"}),e.jsx(ls,{className:"text-right",children:"重试间隔(秒)"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:Wt.length===0?e.jsx(gt,{children:e.jsx(Qe,{colSpan:9,className:"text-center text-muted-foreground py-8",children:je?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):Wt.map((W,ve)=>{const Me=n.findIndex(tt=>tt===W);return e.jsxs(gt,{children:[e.jsx(Qe,{children:e.jsx(yt,{checked:N.has(Me),onCheckedChange:()=>it(Me)})}),e.jsx(Qe,{children:_a(W.name)||e.jsx(Ye,{variant:"outline",className:"text-muted-foreground",children:"未测试"})}),e.jsx(Qe,{className:"font-medium",children:W.name}),e.jsx(Qe,{className:"max-w-xs truncate",title:W.base_url,children:W.base_url}),e.jsx(Qe,{children:W.client_type}),e.jsx(Qe,{className:"text-right",children:W.max_retry}),e.jsx(Qe,{className:"text-right",children:W.timeout}),e.jsx(Qe,{className:"text-right",children:W.retry_interval}),e.jsx(Qe,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>Ut(W.name),disabled:F.has(W.name),title:"测试连接",children:F.has(W.name)?e.jsx(vt,{className:"h-4 w-4 animate-spin"}):e.jsx(ln,{className:"h-4 w-4"})}),e.jsxs(y,{variant:"default",size:"sm",onClick:()=>nt(W,Me),children:[e.jsx(nn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(y,{size:"sm",onClick:()=>Se(Me),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(es,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},ve)})})]})})}),ut.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(He,{value:xe.toString(),onValueChange:W=>{$(parseInt(W)),me(1),G(new Set)},children:[e.jsx(Re,{id:"page-size-provider",className:"w-20",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(_-1)*xe+1," 到"," ",Math.min(_*xe,ut.length)," 条,共 ",ut.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>me(1),disabled:_===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>me(W=>Math.max(1,W-1)),disabled:_===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:de,onChange:W=>ge(W.target.value),onKeyDown:W=>W.key==="Enter"&&Ua(),placeholder:_.toString(),className:"w-16 h-8 text-center",min:1,max:Pt}),e.jsx(y,{variant:"outline",size:"sm",onClick:Ua,disabled:!de,className:"h-8",children:"跳转"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>me(W=>W+1),disabled:_>=Pt,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>me(Pt),disabled:_>=Pt,className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]}),e.jsx(Rs,{open:R,onOpenChange:ol,children:e.jsxs(zs,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Ze.isRunning,children:[e.jsxs(Ms,{children:[e.jsx(As,{children:Z!==null?"编辑提供商":"添加提供商"}),e.jsx(Ys,{children:"配置 API 提供商的连接信息和参数"})]}),e.jsxs("form",{onSubmit:W=>{W.preventDefault(),cl()},autoComplete:"off",children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[e.jsx(b,{htmlFor:"template",children:"提供商模板"}),e.jsxs(Oa,{open:X,onOpenChange:S,children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",role:"combobox","aria-expanded":X,className:"w-full justify-between",children:[z?rr.find(W=>W.id===z)?.display_name:"选择提供商模板...",e.jsx(Qu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(wa,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(oo,{children:[e.jsx(uo,{placeholder:"搜索提供商模板..."}),e.jsx(Pe,{className:"h-[300px]",children:e.jsxs(mo,{className:"max-h-none overflow-visible",children:[e.jsx(ho,{children:"未找到匹配的模板"}),e.jsx(vr,{children:rr.map(W=>e.jsxs(yr,{value:W.display_name,onSelect:()=>St(W.id),children:[e.jsx(fa,{className:`mr-2 h-4 w-4 ${z===W.id?"opacity-100":"opacity-0"}`}),W.display_name]},W.id))})]})})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[e.jsx(b,{htmlFor:"name",className:le.name?"text-destructive":"",children:"名称 *"}),e.jsx(ce,{id:"name",value:U?.name||"",onChange:W=>{A(ve=>ve?{...ve,name:W.target.value}:null),le.name&&L(ve=>({...ve,name:void 0}))},placeholder:"例如: DeepSeek, SiliconFlow",className:le.name?"border-destructive focus-visible:ring-destructive":""}),le.name&&e.jsx("p",{className:"text-xs text-destructive",children:le.name})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[e.jsx(b,{htmlFor:"base_url",className:le.base_url?"text-destructive":"",children:"基础 URL *"}),e.jsx(ce,{id:"base_url",value:U?.base_url||"",onChange:W=>{A(ve=>ve?{...ve,base_url:W.target.value}:null),le.base_url&&L(ve=>({...ve,base_url:void 0}))},placeholder:"https://api.example.com/v1",disabled:Ct,className:`${Ct?"bg-muted cursor-not-allowed":""} ${le.base_url?"border-destructive focus-visible:ring-destructive":""}`}),le.base_url&&e.jsx("p",{className:"text-xs text-destructive",children:le.base_url}),Ct&&!le.base_url&&e.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[e.jsx(b,{htmlFor:"api_key",className:le.api_key?"text-destructive":"",children:"API Key *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{id:"api_key",type:ye?"text":"password",value:U?.api_key||"",onChange:W=>{A(ve=>ve?{...ve,api_key:W.target.value}:null),le.api_key&&L(ve=>({...ve,api_key:void 0}))},placeholder:"sk-...",className:`flex-1 ${le.api_key?"border-destructive focus-visible:ring-destructive":""}`}),e.jsx(y,{type:"button",variant:"outline",size:"icon",onClick:()=>pe(!ye),title:ye?"隐藏密钥":"显示密钥",children:ye?e.jsx(mr,{className:"h-4 w-4"}):e.jsx(Zt,{className:"h-4 w-4"})}),e.jsx(y,{type:"button",variant:"outline",size:"icon",onClick:rl,title:"复制密钥",children:e.jsx(so,{className:"h-4 w-4"})})]}),le.api_key&&e.jsx("p",{className:"text-xs text-destructive",children:le.api_key})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"client_type",children:"客户端类型"}),e.jsxs(He,{value:U?.client_type||"openai",onValueChange:W=>A(ve=>ve?{...ve,client_type:W}:null),disabled:Ct,children:[e.jsx(Re,{id:"client_type",className:Ct?"bg-muted cursor-not-allowed":"",children:e.jsx(qe,{placeholder:"选择客户端类型"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"openai",children:"OpenAI"}),e.jsx(ne,{value:"gemini",children:"Gemini"})]})]}),Ct&&e.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"max_retry",children:"最大重试"}),e.jsx(ce,{id:"max_retry",type:"number",min:"0",value:U?.max_retry??"",onChange:W=>{const ve=W.target.value===""?null:parseInt(W.target.value);A(Me=>Me?{...Me,max_retry:ve}:null)},placeholder:"默认: 2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"timeout",children:"超时(秒)"}),e.jsx(ce,{id:"timeout",type:"number",min:"1",value:U?.timeout??"",onChange:W=>{const ve=W.target.value===""?null:parseInt(W.target.value);A(Me=>Me?{...Me,timeout:ve}:null)},placeholder:"默认: 30"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),e.jsx(ce,{id:"retry_interval",type:"number",min:"1",value:U?.retry_interval??"",onChange:W=>{const ve=W.target.value===""?null:parseInt(W.target.value);A(Me=>Me?{...Me,retry_interval:ve}:null)},placeholder:"默认: 10"})]})]})]}),e.jsxs(Js,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>K(!1),"data-tour":"provider-cancel-button",children:"取消"}),e.jsx(y,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),e.jsx(ps,{open:O,onOpenChange:te,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除提供商 "',he!==null?n[he]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:Oe,children:"删除"})]})]})}),e.jsx(ps,{open:q,onOpenChange:ie,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认批量删除"}),e.jsxs(us,{children:["确定要删除选中的 ",N.size," 个提供商吗? 此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:on,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&e.jsx(Iu,{onRestartComplete:bt,onRestartFailed:Je})]})}function bw({value:n,label:r,onRemove:c}){const{attributes:d,listeners:h,setNodeRef:x,transform:f,transition:j,isDragging:p}=jb({id:n}),w={transform:vb.Transform.toString(f),transition:j,opacity:p?.5:1};return e.jsx("div",{ref:x,style:w,className:Q("inline-flex items-center gap-1",p&&"shadow-lg"),children:e.jsxs(Ye,{variant:"secondary",className:"cursor-move hover:bg-secondary/80 flex items-center gap-1",children:[e.jsx("div",{...d,...h,className:"cursor-grab active:cursor-grabbing flex items-center",children:e.jsx(ON,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("span",{children:r}),e.jsx(li,{className:"ml-1 h-3 w-3 cursor-pointer hover:text-destructive",strokeWidth:2,fill:"none",onClick:v=>{v.stopPropagation(),c(n)}})]})})}function ww({options:n,selected:r,onChange:c,placeholder:d="选择选项...",emptyText:h="未找到选项",className:x}){const[f,j]=u.useState(!1),p=ob(Pf(gb,{activationConstraint:{distance:8}}),Pf(pb,{coordinateGetter:fb})),w=T=>{r.includes(T)?c(r.filter(E=>E!==T)):c([...r,T])},v=T=>{c(r.filter(E=>E!==T))},k=T=>{const{active:E,over:R}=T;if(R&&E.id!==R.id){const K=r.indexOf(E.id),U=r.indexOf(R.id);c(xb(r,K,U))}};return e.jsxs(Oa,{open:f,onOpenChange:j,children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",role:"combobox","aria-expanded":f,className:Q("w-full justify-between min-h-10 h-auto",x),children:[e.jsx(db,{sensors:p,collisionDetection:ub,onDragEnd:k,children:e.jsx(mb,{items:r,strategy:hb,children:e.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:r.length===0?e.jsx("span",{className:"text-muted-foreground",children:d}):r.map(T=>{const E=n.find(R=>R.value===T);return e.jsx(bw,{value:T,label:E?.label||T,onRemove:v},T)})})})}),e.jsx(Qu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),e.jsx(wa,{className:"w-full p-0",align:"start",children:e.jsxs(oo,{children:[e.jsx(uo,{placeholder:"搜索...",className:"h-9"}),e.jsxs(mo,{children:[e.jsx(ho,{children:h}),e.jsx(vr,{children:n.map(T=>{const E=r.includes(T.value);return e.jsxs(yr,{value:T.value,onSelect:()=>w(T.value),children:[e.jsx("div",{className:Q("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",E?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(fa,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),e.jsx("span",{children:T.label})]},T.value)})})]})]})})]})}const mp=new Map,_w=300*1e3;function Sw(){const[n,r]=u.useState([]),[c,d]=u.useState([]),[h,x]=u.useState([]),[f,j]=u.useState([]),[p,w]=u.useState(null),[v,k]=u.useState(!0),[T,E]=u.useState(!1),[R,K]=u.useState(!1),[U,A]=u.useState(!1),[Z,H]=u.useState(!1),[z,B]=u.useState(!1),[X,S]=u.useState(!1),[O,te]=u.useState(null),[he,Ne]=u.useState(null),[ye,pe]=u.useState(!1),[je,_e]=u.useState(null),[N,G]=u.useState(""),[q,ie]=u.useState(new Set),[_,me]=u.useState(!1),[xe,$]=u.useState(1),[de,ge]=u.useState(20),[le,L]=u.useState(""),[F,D]=u.useState([]),[ee,we]=u.useState(!1),[ze,ss]=u.useState(null),[Ze,Ls]=u.useState(!1),[Gs,re]=u.useState(null),[be,Xe]=u.useState({}),{toast:Ue}=Hs(),st=Jt(),{registerTour:It,startTour:bt,state:Je,goToStep:Be}=Pu(),jt=u.useRef(null),nt=u.useRef(null),St=u.useRef(!0);u.useEffect(()=>{It(ll,qg)},[It]),u.useEffect(()=>{if(Je.activeTourId===ll&&Je.isRunning){const Y=Gg[Je.stepIndex];Y&&!window.location.pathname.endsWith(Y.replace("/config/",""))&&st({to:Y})}},[Je.stepIndex,Je.activeTourId,Je.isRunning,st]);const Ct=u.useRef(Je.stepIndex);u.useEffect(()=>{if(Je.activeTourId===ll&&Je.isRunning){const Y=Ct.current,fe=Je.stepIndex;Y>=12&&Y<=17&&fe<12&&S(!1),Ct.current=fe}},[Je.stepIndex,Je.activeTourId,Je.isRunning]),u.useEffect(()=>{if(Je.activeTourId!==ll||!Je.isRunning)return;const Y=fe=>{const Ae=fe.target,Ge=Je.stepIndex;Ge===2&&Ae.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Be(3),300):Ge===9&&Ae.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>Be(10),300):Ge===11&&Ae.closest('[data-tour="add-model-button"]')?setTimeout(()=>Be(12),300):Ge===17&&Ae.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>Be(18),300):Ge===18&&Ae.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>Be(19),300)};return document.addEventListener("click",Y,!0),()=>document.removeEventListener("click",Y,!0)},[Je,Be]);const rl=()=>{bt(ll)};u.useEffect(()=>{cl()},[]);const cl=async()=>{try{k(!0);const Y=await ei(),fe=Y.models||[];r(fe),j(fe.map(Ge=>Ge.name));const Ae=Y.api_providers||[];d(Ae.map(Ge=>Ge.name)),x(Ae),w(Y.model_task_config||null),A(!1),St.current=!1}catch(Y){console.error("加载配置失败:",Y)}finally{k(!1)}},ol=u.useCallback(Y=>h.find(fe=>fe.name===Y),[h]),Se=u.useCallback(async(Y,fe=!1)=>{const Ae=ol(Y);if(!Ae?.base_url){D([]),re(null),ss('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Ae.api_key){D([]),re(null),ss('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const Ge=yw(Ae.base_url);if(re(Ge),!Ge?.modelFetcher){D([]),ss(null);return}const xs=`${Y}:${Ae.base_url}`,ea=mp.get(xs);if(!fe&&ea&&Date.now()-ea.timestamp<_w){D(ea.models),ss(null);return}we(!0),ss(null);try{const sa=await $0(Y,Ge.modelFetcher.parser,Ge.modelFetcher.endpoint);D(sa),mp.set(xs,{models:sa,timestamp:Date.now()})}catch(sa){console.error("获取模型列表失败:",sa);const Sa=sa.message||"获取模型列表失败";Sa.includes("无效")||Sa.includes("过期")||Sa.includes("API Key")?ss('API Key 无效或已过期,请检查"模型提供商配置"中的密钥'):Sa.includes("权限")?ss("没有权限获取模型列表,请检查 API Key 权限"):Sa.includes("timeout")||Sa.includes("超时")?ss("请求超时,请检查网络连接后重试"):Sa.includes("不支持")?ss("该提供商不支持自动获取模型列表,请手动输入"):ss(Sa),D([])}finally{we(!1)}},[ol]);u.useEffect(()=>{X&&O?.api_provider&&Se(O.api_provider)},[X,O?.api_provider,Se]);const Oe=async()=>{try{H(!0),co().catch(()=>{}),B(!0)}catch(Y){console.error("重启失败:",Y),B(!1),Ue({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),H(!1)}},it=async()=>{try{E(!0),jt.current&&clearTimeout(jt.current),nt.current&&clearTimeout(nt.current);const Y=await ei();Y.models=n,Y.model_task_config=p,await io(Y),A(!1),Ue({title:"保存成功",description:"正在重启麦麦..."}),await Oe()}catch(Y){console.error("保存配置失败:",Y),Ue({title:"保存失败",description:Y.message,variant:"destructive"}),E(!1)}},dt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},di=()=>{B(!1),H(!1),Ue({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},on=u.useCallback(async Y=>{if(!St.current)try{K(!0),await qu("models",Y),A(!1)}catch(fe){console.error("自动保存模型列表失败:",fe),A(!0)}finally{K(!1)}},[]),ut=u.useCallback(async Y=>{if(!St.current)try{K(!0),await qu("model_task_config",Y),A(!1)}catch(fe){console.error("自动保存任务配置失败:",fe),A(!0)}finally{K(!1)}},[]);u.useEffect(()=>{if(!St.current)return A(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{on(n)},2e3),()=>{jt.current&&clearTimeout(jt.current)}},[n,on]),u.useEffect(()=>{if(!(St.current||!p))return A(!0),nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>{ut(p)},2e3),()=>{nt.current&&clearTimeout(nt.current)}},[p,ut]);const Pt=async()=>{try{E(!0),jt.current&&clearTimeout(jt.current),nt.current&&clearTimeout(nt.current);const Y=await ei();Y.models=n,Y.model_task_config=p,await io(Y),A(!1),Ue({title:"保存成功",description:"模型配置已保存"}),await cl()}catch(Y){console.error("保存配置失败:",Y),Ue({title:"保存失败",description:Y.message,variant:"destructive"})}finally{E(!1)}},Wt=(Y,fe)=>{Xe({}),te(Y||{model_identifier:"",name:"",api_provider:c[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),Ne(fe),S(!0)},Ua=()=>{if(!O)return;const Y={};if(O.name?.trim()||(Y.name="请输入模型名称"),O.api_provider?.trim()||(Y.api_provider="请选择 API 提供商"),O.model_identifier?.trim()||(Y.model_identifier="请输入模型标识符"),Object.keys(Y).length>0){Xe(Y);return}Xe({});const fe={...O,price_in:O.price_in??0,price_out:O.price_out??0};let Ae,Ge=null;if(he!==null?(Ge=n[he].name,Ae=[...n],Ae[he]=fe):Ae=[...n,fe],r(Ae),j(Ae.map(xs=>xs.name)),Ge&&Ge!==fe.name&&p){const xs=ea=>ea.map(sa=>sa===Ge?fe.name:sa);w({...p,utils:{...p.utils,model_list:xs(p.utils?.model_list||[])},utils_small:{...p.utils_small,model_list:xs(p.utils_small?.model_list||[])},tool_use:{...p.tool_use,model_list:xs(p.tool_use?.model_list||[])},replyer:{...p.replyer,model_list:xs(p.replyer?.model_list||[])},planner:{...p.planner,model_list:xs(p.planner?.model_list||[])},vlm:{...p.vlm,model_list:xs(p.vlm?.model_list||[])},voice:{...p.voice,model_list:xs(p.voice?.model_list||[])},embedding:{...p.embedding,model_list:xs(p.embedding?.model_list||[])},lpmm_entity_extract:{...p.lpmm_entity_extract,model_list:xs(p.lpmm_entity_extract?.model_list||[])},lpmm_rdf_build:{...p.lpmm_rdf_build,model_list:xs(p.lpmm_rdf_build?.model_list||[])},lpmm_qa:{...p.lpmm_qa,model_list:xs(p.lpmm_qa?.model_list||[])}})}S(!1),te(null),Ne(null)},Ut=Y=>{if(!Y&&O){const fe={...O,price_in:O.price_in??0,price_out:O.price_out??0};te(fe)}S(Y)},Ba=Y=>{_e(Y),pe(!0)},_a=()=>{if(je!==null){const Y=n.filter((fe,Ae)=>Ae!==je);r(Y),j(Y.map(fe=>fe.name)),Ue({title:"删除成功",description:"模型已从列表中移除"})}pe(!1),_e(null)},W=Y=>{const fe=new Set(q);fe.has(Y)?fe.delete(Y):fe.add(Y),ie(fe)},ve=()=>{if(q.size===kt.length)ie(new Set);else{const Y=kt.map((fe,Ae)=>n.findIndex(Ge=>Ge===kt[Ae]));ie(new Set(Y))}},Me=()=>{if(q.size===0){Ue({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}me(!0)},tt=()=>{const Y=n.filter((fe,Ae)=>!q.has(Ae));r(Y),j(Y.map(fe=>fe.name)),ie(new Set),me(!1),Ue({title:"批量删除成功",description:`已删除 ${q.size} 个模型`})},Bt=(Y,fe,Ae)=>{p&&w({...p,[Y]:{...p[Y],[fe]:Ae}})},kt=n.filter(Y=>{if(!N)return!0;const fe=N.toLowerCase();return Y.name.toLowerCase().includes(fe)||Y.model_identifier.toLowerCase().includes(fe)||Y.api_provider.toLowerCase().includes(fe)}),dl=Math.ceil(kt.length/de),Hl=kt.slice((xe-1)*de,xe*de),dn=()=>{const Y=parseInt(le);Y>=1&&Y<=dl&&($(Y),L(""))},un=Y=>p?[p.utils?.model_list||[],p.utils_small?.model_list||[],p.tool_use?.model_list||[],p.replyer?.model_list||[],p.planner?.model_list||[],p.vlm?.model_list||[],p.voice?.model_list||[],p.embedding?.model_list||[],p.lpmm_entity_extract?.model_list||[],p.lpmm_rdf_build?.model_list||[],p.lpmm_qa?.model_list||[]].some(Ae=>Ae.includes(Y)):!1;return v?e.jsx(Pe,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsxs(y,{onClick:Pt,disabled:T||R||!U||Z,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(br,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),T?"保存中...":R?"自动保存中...":U?"保存配置":"已保存"]}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsxs(y,{disabled:T||R||Z,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(Nr,{className:"mr-2 h-4 w-4"}),Z?"重启中...":U?"保存并重启":"重启麦麦"]})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认重启麦麦?"}),e.jsx(us,{className:"space-y-3",asChild:!0,children:e.jsxs("div",{children:[e.jsx("p",{children:U?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),e.jsxs(ha,{className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Xt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[e.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",e.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",e.jsxs(Rs,{children:[e.jsx(ni,{asChild:!0,children:e.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[e.jsx(ro,{className:"h-3 w-3"}),"如何结束程序?"]})}),e.jsxs(zs,{className:"max-w-2xl",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"如何结束使用重启功能后的麦麦程序"}),e.jsx(Ys,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),e.jsxs(Kt,{defaultValue:"windows",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsx($e,{value:"windows",children:"Windows"}),e.jsx($e,{value:"macos",children:"macOS"}),e.jsx($e,{value:"linux",children:"Linux"})]}),e.jsxs(We,{value:"windows",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),e.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),e.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),e.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),e.jsxs(We,{value:"macos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),e.jsxs("li",{children:["在进程列表中找到 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),e.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]})]}),e.jsxs(We,{value:"linux",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),e.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[e.jsx("p",{children:"# 查找麦麦进程"}),e.jsx("p",{children:"ps aux | grep python | grep -v grep"}),e.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),e.jsx("p",{children:"kill -9 "}),e.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),e.jsx("p",{children:'pkill -9 -f "bot.py"'}),e.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),e.jsx("p",{children:"pkill -9 python"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[e.jsxs("li",{children:["在终端输入 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),e.jsxs("li",{children:["按 ",e.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),e.jsx(Js,{children:e.jsx(Zu,{asChild:!0,children:e.jsx(y,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:U?it:Oe,children:U?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(ha,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsxs(xa,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(ha,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:rl,children:[e.jsx(RN,{className:"h-4 w-4 text-primary"}),e.jsxs(xa,{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),e.jsx(y,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),e.jsxs(Kt,{defaultValue:"models",className:"w-full",children:[e.jsxs(Rt,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[e.jsx($e,{value:"models",children:"添加模型"}),e.jsx($e,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),e.jsxs(We,{value:"models",className:"space-y-4 mt-0",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[q.size>0&&e.jsxs(y,{onClick:Me,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(es,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",q.size,")"]}),e.jsxs(y,{onClick:()=>Wt(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[e.jsx(ot,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索模型名称、标识符或提供商...",value:N,onChange:Y=>G(Y.target.value),className:"pl-9"})]}),N&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",kt.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:Hl.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:N?"未找到匹配的模型":"暂无模型配置"}):Hl.map((Y,fe)=>{const Ae=n.findIndex(xs=>xs===Y),Ge=un(Y.name);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-base",children:Y.name}),e.jsx(Ye,{variant:Ge?"default":"secondary",className:Ge?"bg-green-600 hover:bg-green-700":"",children:Ge?"已使用":"未使用"})]}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",title:Y.model_identifier,children:Y.model_identifier})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(y,{variant:"default",size:"sm",onClick:()=>Wt(Y,Ae),children:[e.jsx(nn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(y,{size:"sm",onClick:()=>Ba(Ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(es,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),e.jsx("p",{className:"font-medium",children:Y.api_provider})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),e.jsx("p",{className:"font-medium",children:Y.force_stream_mode?"是":"否"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),e.jsxs("p",{className:"font-medium",children:["¥",Y.price_in,"/M"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),e.jsxs("p",{className:"font-medium",children:["¥",Y.price_out,"/M"]})]})]})]},fe)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(gt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:q.size===kt.length&&kt.length>0,onCheckedChange:ve})}),e.jsx(ls,{className:"w-24",children:"使用状态"}),e.jsx(ls,{children:"模型名称"}),e.jsx(ls,{children:"模型标识符"}),e.jsx(ls,{children:"提供商"}),e.jsx(ls,{className:"text-right",children:"输入价格"}),e.jsx(ls,{className:"text-right",children:"输出价格"}),e.jsx(ls,{className:"text-center",children:"强制流式"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:Hl.length===0?e.jsx(gt,{children:e.jsx(Qe,{colSpan:9,className:"text-center text-muted-foreground py-8",children:N?"未找到匹配的模型":"暂无模型配置"})}):Hl.map((Y,fe)=>{const Ae=n.findIndex(xs=>xs===Y),Ge=un(Y.name);return e.jsxs(gt,{children:[e.jsx(Qe,{children:e.jsx(yt,{checked:q.has(Ae),onCheckedChange:()=>W(Ae)})}),e.jsx(Qe,{children:e.jsx(Ye,{variant:Ge?"default":"secondary",className:Ge?"bg-green-600 hover:bg-green-700":"",children:Ge?"已使用":"未使用"})}),e.jsx(Qe,{className:"font-medium",children:Y.name}),e.jsx(Qe,{className:"max-w-xs truncate",title:Y.model_identifier,children:Y.model_identifier}),e.jsx(Qe,{children:Y.api_provider}),e.jsxs(Qe,{className:"text-right",children:["¥",Y.price_in,"/M"]}),e.jsxs(Qe,{className:"text-right",children:["¥",Y.price_out,"/M"]}),e.jsx(Qe,{className:"text-center",children:Y.force_stream_mode?"是":"否"}),e.jsx(Qe,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(y,{variant:"default",size:"sm",onClick:()=>Wt(Y,Ae),children:[e.jsx(nn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(y,{size:"sm",onClick:()=>Ba(Ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(es,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},fe)})})]})})}),kt.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(He,{value:de.toString(),onValueChange:Y=>{ge(parseInt(Y)),$(1),ie(new Set)},children:[e.jsx(Re,{id:"page-size-model",className:"w-20",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(xe-1)*de+1," 到"," ",Math.min(xe*de,kt.length)," 条,共 ",kt.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>$(1),disabled:xe===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>$(Y=>Math.max(1,Y-1)),disabled:xe===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:le,onChange:Y=>L(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&dn(),placeholder:xe.toString(),className:"w-16 h-8 text-center",min:1,max:dl}),e.jsx(y,{variant:"outline",size:"sm",onClick:dn,disabled:!le,className:"h-8",children:"跳转"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>$(Y=>Y+1),disabled:xe>=dl,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>$(dl),disabled:xe>=dl,className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]}),e.jsxs(We,{value:"tasks",className:"space-y-6 mt-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),p&&e.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[e.jsx(ya,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:p.utils,modelNames:f,onChange:(Y,fe)=>Bt("utils",Y,fe),dataTour:"task-model-select"}),e.jsx(ya,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:p.utils_small,modelNames:f,onChange:(Y,fe)=>Bt("utils_small",Y,fe)}),e.jsx(ya,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:p.tool_use,modelNames:f,onChange:(Y,fe)=>Bt("tool_use",Y,fe)}),e.jsx(ya,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:p.replyer,modelNames:f,onChange:(Y,fe)=>Bt("replyer",Y,fe)}),e.jsx(ya,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:p.planner,modelNames:f,onChange:(Y,fe)=>Bt("planner",Y,fe)}),e.jsx(ya,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:p.vlm,modelNames:f,onChange:(Y,fe)=>Bt("vlm",Y,fe),hideTemperature:!0}),e.jsx(ya,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:p.voice,modelNames:f,onChange:(Y,fe)=>Bt("voice",Y,fe),hideTemperature:!0,hideMaxTokens:!0}),e.jsx(ya,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:p.embedding,modelNames:f,onChange:(Y,fe)=>Bt("embedding",Y,fe),hideTemperature:!0,hideMaxTokens:!0}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),e.jsx(ya,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:p.lpmm_entity_extract,modelNames:f,onChange:(Y,fe)=>Bt("lpmm_entity_extract",Y,fe)}),e.jsx(ya,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:p.lpmm_rdf_build,modelNames:f,onChange:(Y,fe)=>Bt("lpmm_rdf_build",Y,fe)}),e.jsx(ya,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:p.lpmm_qa,modelNames:f,onChange:(Y,fe)=>Bt("lpmm_qa",Y,fe)})]})]})]})]}),e.jsx(Rs,{open:X,onOpenChange:Ut,children:e.jsxs(zs,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:Je.isRunning,children:[e.jsxs(Ms,{children:[e.jsx(As,{children:he!==null?"编辑模型":"添加模型"}),e.jsx(Ys,{children:"配置模型的基本信息和参数"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[e.jsx(b,{htmlFor:"model_name",className:be.name?"text-destructive":"",children:"模型名称 *"}),e.jsx(ce,{id:"model_name",value:O?.name||"",onChange:Y=>{te(fe=>fe?{...fe,name:Y.target.value}:null),be.name&&Xe(fe=>({...fe,name:void 0}))},placeholder:"例如: qwen3-30b",className:be.name?"border-destructive focus-visible:ring-destructive":""}),be.name?e.jsx("p",{className:"text-xs text-destructive",children:be.name}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[e.jsx(b,{htmlFor:"api_provider",className:be.api_provider?"text-destructive":"",children:"API 提供商 *"}),e.jsxs(He,{value:O?.api_provider||"",onValueChange:Y=>{te(fe=>fe?{...fe,api_provider:Y}:null),D([]),ss(null),be.api_provider&&Xe(fe=>({...fe,api_provider:void 0}))},children:[e.jsx(Re,{id:"api_provider",className:be.api_provider?"border-destructive focus-visible:ring-destructive":"",children:e.jsx(qe,{placeholder:"选择提供商"})}),e.jsx(Le,{children:c.map(Y=>e.jsx(ne,{value:Y,children:Y},Y))})]}),be.api_provider&&e.jsx("p",{className:"text-xs text-destructive",children:be.api_provider})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{htmlFor:"model_identifier",className:be.model_identifier?"text-destructive":"",children:"模型标识符 *"}),Gs?.modelFetcher&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ye,{variant:"secondary",className:"text-xs",children:Gs.display_name}),e.jsx(y,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>O?.api_provider&&Se(O.api_provider,!0),disabled:ee,children:ee?e.jsx(vt,{className:"h-3 w-3 animate-spin"}):e.jsx(pt,{className:"h-3 w-3"})})]})]}),Gs?.modelFetcher?e.jsxs(Oa,{open:Ze,onOpenChange:Ls,children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",role:"combobox","aria-expanded":Ze,className:"w-full justify-between font-normal",disabled:ee||!!ze,children:[ee?e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(vt,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):ze?e.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):O?.model_identifier?e.jsx("span",{className:"truncate",children:O.model_identifier}):e.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),e.jsx(Qu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(wa,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(oo,{children:[e.jsx(uo,{placeholder:"搜索模型..."}),e.jsx(Pe,{className:"h-[300px]",children:e.jsxs(mo,{className:"max-h-none overflow-visible",children:[e.jsx(ho,{children:ze?e.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[e.jsx("p",{className:"text-sm text-destructive",children:ze}),!ze.includes("API Key")&&e.jsx(y,{variant:"link",size:"sm",onClick:()=>O?.api_provider&&Se(O.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),e.jsx(vr,{heading:"可用模型",children:F.map(Y=>e.jsxs(yr,{value:Y.id,onSelect:()=>{te(fe=>fe?{...fe,model_identifier:Y.id}:null),Ls(!1)},children:[e.jsx(fa,{className:`mr-2 h-4 w-4 ${O?.model_identifier===Y.id?"opacity-100":"opacity-0"}`}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:Y.id}),Y.name!==Y.id&&e.jsx("span",{className:"text-xs text-muted-foreground",children:Y.name})]})]},Y.id))}),e.jsx(vr,{heading:"手动输入",children:e.jsxs(yr,{value:"__manual_input__",onSelect:()=>{Ls(!1)},children:[e.jsx(nn,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):e.jsx(ce,{id:"model_identifier",value:O?.model_identifier||"",onChange:Y=>{te(fe=>fe?{...fe,model_identifier:Y.target.value}:null),be.model_identifier&&Xe(fe=>({...fe,model_identifier:void 0}))},placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507",className:be.model_identifier?"border-destructive focus-visible:ring-destructive":""}),be.model_identifier&&e.jsx("p",{className:"text-xs text-destructive",children:be.model_identifier}),ze&&Gs?.modelFetcher&&!be.model_identifier&&e.jsxs(ha,{variant:"destructive",className:"mt-2 py-2",children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsx(xa,{className:"text-xs",children:ze})]}),Gs?.modelFetcher&&e.jsx(ce,{value:O?.model_identifier||"",onChange:Y=>{te(fe=>fe?{...fe,model_identifier:Y.target.value}:null),be.model_identifier&&Xe(fe=>({...fe,model_identifier:void 0}))},placeholder:"或手动输入模型标识符",className:`mt-2 ${be.model_identifier?"border-destructive focus-visible:ring-destructive":""}`}),!be.model_identifier&&e.jsx("p",{className:"text-xs text-muted-foreground",children:ze?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':Gs?.modelFetcher?`已识别为 ${Gs.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),e.jsx(ce,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in??"",onChange:Y=>{const fe=Y.target.value===""?null:parseFloat(Y.target.value);te(Ae=>Ae?{...Ae,price_in:fe}:null)},placeholder:"默认: 0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),e.jsx(ce,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out??"",onChange:Y=>{const fe=Y.target.value===""?null:parseFloat(Y.target.value);te(Ae=>Ae?{...Ae,price_out:fe}:null)},placeholder:"默认: 0"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:Y=>te(fe=>fe?{...fe,force_stream_mode:Y}:null)}),e.jsx(b,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>S(!1),"data-tour":"model-cancel-button",children:"取消"}),e.jsx(y,{onClick:Ua,"data-tour":"model-save-button",children:"保存"})]})]})}),e.jsx(ps,{open:ye,onOpenChange:pe,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除模型 "',je!==null?n[je]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:_a,children:"删除"})]})]})}),e.jsx(ps,{open:_,onOpenChange:me,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认批量删除"}),e.jsxs(us,{children:["确定要删除选中的 ",q.size," 个模型吗? 此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:tt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),z&&e.jsx(Iu,{onRestartComplete:dt,onRestartFailed:di})]})})}function ya({title:n,description:r,taskConfig:c,modelNames:d,onChange:h,hideTemperature:x=!1,hideMaxTokens:f=!1,dataTour:j}){const p=w=>{h("model_list",w)};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:n}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:r})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":j,children:[e.jsx(b,{children:"模型列表"}),e.jsx(ww,{options:d.map(w=>({label:w,value:w})),selected:c.model_list||[],onChange:p,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!x&&e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:"温度"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",value:c.temperature??.3,onChange:w=>{const v=parseFloat(w.target.value);!isNaN(v)&&v>=0&&v<=1&&h("temperature",v)},className:"w-20 h-8 text-sm"})]}),e.jsx(Ma,{value:[c.temperature??.3],onValueChange:w=>h("temperature",w[0]),min:0,max:1,step:.1,className:"w-full"})]}),!f&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"最大 Token"}),e.jsx(ce,{type:"number",step:"1",min:"1",value:c.max_tokens??1024,onChange:w=>h("max_tokens",parseInt(w.target.value))})]})]})]})]})}const xo="/api/webui/config";async function Cw(){const r=await(await ke(`${xo}/adapter-config/path`)).json();return!r.success||!r.path?null:{path:r.path,lastModified:r.lastModified}}async function hp(n){const c=await(await ke(`${xo}/adapter-config/path`,{method:"POST",headers:Ts(),body:JSON.stringify({path:n})})).json();if(!c.success)throw new Error(c.message||"保存路径失败")}async function xp(n){const c=await(await ke(`${xo}/adapter-config?path=${encodeURIComponent(n)}`)).json();if(!c.success)throw new Error("读取配置文件失败");return c.content}async function fp(n,r){const d=await(await ke(`${xo}/adapter-config`,{method:"POST",headers:Ts(),body:JSON.stringify({path:n,content:r})})).json();if(!d.success)throw new Error(d.message||"保存配置失败")}const Yt={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}},Du={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:rn},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:LN}};function kw(){const[n,r]=u.useState("upload"),[c,d]=u.useState(null),[h,x]=u.useState(""),[f,j]=u.useState(""),[p,w]=u.useState("oneclick"),[v,k]=u.useState(""),[T,E]=u.useState(!1),[R,K]=u.useState(!1),[U,A]=u.useState(!1),[Z,H]=u.useState(!1),[z,B]=u.useState(null),X=u.useRef(null),{toast:S}=Hs(),O=u.useRef(null),te=L=>{if(!L.trim())return{valid:!1,error:"路径不能为空"};if(!L.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const F=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,D=/^(\/|~\/).+\.toml$/i,ee=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,we=F.test(L),ze=D.test(L),ss=ee.test(L);return!we&&!ze&&!ss?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(L)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},he=L=>{if(j(L),L.trim()){const F=te(L);k(F.error)}else k("")},Ne=u.useCallback(async L=>{const F=Du[L];K(!0);try{const D=await xp(F.path),ee=xe(D);d(ee),w(L),j(F.path),await hp(F.path),S({title:"加载成功",description:`已从${F.name}预设加载配置`})}catch(D){console.error("加载预设配置失败:",D),S({title:"加载失败",description:D instanceof Error?D.message:"无法读取预设配置文件",variant:"destructive"})}finally{K(!1)}},[S]),ye=u.useCallback(async L=>{const F=te(L);if(!F.valid){k(F.error),S({title:"路径无效",description:F.error,variant:"destructive"});return}k(""),K(!0);try{const D=await xp(L),ee=xe(D);d(ee),j(L),await hp(L),S({title:"加载成功",description:"已从配置文件加载"})}catch(D){console.error("加载配置失败:",D),S({title:"加载失败",description:D instanceof Error?D.message:"无法读取配置文件",variant:"destructive"})}finally{K(!1)}},[S]);u.useEffect(()=>{(async()=>{try{const F=await Cw();if(F&&F.path){j(F.path);const D=Object.entries(Du).find(([,ee])=>ee.path===F.path);D?(r("preset"),w(D[0]),await Ne(D[0])):(r("path"),await ye(F.path))}}catch(F){console.error("加载保存的路径失败:",F)}})()},[ye,Ne]);const pe=u.useCallback(L=>{n!=="path"&&n!=="preset"||!f||(O.current&&clearTimeout(O.current),O.current=setTimeout(async()=>{E(!0);try{const F=$(L);await fp(f,F),S({title:"自动保存成功",description:"配置已保存到文件"})}catch(F){console.error("自动保存失败:",F),S({title:"自动保存失败",description:F instanceof Error?F.message:"保存配置失败",variant:"destructive"})}finally{E(!1)}},1e3))},[n,f,S]),je=async()=>{if(!c||!f)return;const L=te(f);if(!L.valid){S({title:"保存失败",description:L.error,variant:"destructive"});return}E(!0);try{const F=$(c);await fp(f,F),S({title:"保存成功",description:"配置已保存到文件"})}catch(F){console.error("保存失败:",F),S({title:"保存失败",description:F instanceof Error?F.message:"保存配置失败",variant:"destructive"})}finally{E(!1)}},_e=async()=>{f&&await ye(f)},N=L=>{if(L!==n){if(c){B(L),A(!0);return}G(L)}},G=L=>{d(null),x(""),k(""),r(L),L==="preset"&&Ne("oneclick"),S({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[L]})},q=()=>{z&&(G(z),B(null)),A(!1)},ie=()=>{if(c){H(!0);return}_()},_=()=>{j(""),d(null),k(""),S({title:"已清空",description:"路径和配置已清空"})},me=()=>{_(),H(!1)},xe=L=>{const F=JSON.parse(JSON.stringify(Yt)),D=L.split(` -`);let ee="";for(const we of D){const ze=we.trim();if(!ze||ze.startsWith("#"))continue;const ss=ze.match(/^\[(\w+)\]/);if(ss){ee=ss[1];continue}const Ze=ze.match(/^(\w+)\s*=\s*(.+)$/);if(Ze&&ee){const[,Ls,Gs]=Ze;let re=Gs.trim();const be=re.match(/^("[^"]*")/);if(be)re=be[1];else{const Ue=re.indexOf("#");Ue!==-1&&(re=re.substring(0,Ue).trim())}let Xe;if(re==="true")Xe=!0;else if(re==="false")Xe=!1;else if(re.startsWith("[")&&re.endsWith("]")){const Ue=re.slice(1,-1).trim();if(Ue){const st=Ue.split(",").map(bt=>{const Je=bt.trim();return isNaN(Number(Je))?Je.replace(/"/g,""):Number(Je)}),It=typeof st[0];Xe=st.every(bt=>typeof bt===It)?st:st.filter(bt=>typeof bt=="number")}else Xe=[]}else re.startsWith('"')&&re.endsWith('"')?Xe=re.slice(1,-1):isNaN(Number(re))?Xe=re.replace(/"/g,""):Xe=Number(re);if(ee in F){const Ue=F[ee];Ue[Ls]=Xe}}}return F},$=L=>{const F=[],D=(ee,we)=>ee===""||ee===null||ee===void 0?we:ee;return F.push("[inner]"),F.push(`version = "${D(L.inner.version,Yt.inner.version)}" # 版本号`),F.push("# 请勿修改版本号,除非你知道自己在做什么"),F.push(""),F.push("[nickname] # 现在没用"),F.push(`nickname = "${D(L.nickname.nickname,Yt.nickname.nickname)}"`),F.push(""),F.push("[napcat_server] # Napcat连接的ws服务设置"),F.push(`host = "${D(L.napcat_server.host,Yt.napcat_server.host)}" # Napcat设定的主机地址`),F.push(`port = ${D(L.napcat_server.port||0,Yt.napcat_server.port)} # Napcat设定的端口`),F.push(`token = "${D(L.napcat_server.token,Yt.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),F.push(`heartbeat_interval = ${D(L.napcat_server.heartbeat_interval||0,Yt.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),F.push(""),F.push("[maibot_server] # 连接麦麦的ws服务设置"),F.push(`host = "${D(L.maibot_server.host,Yt.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),F.push(`port = ${D(L.maibot_server.port||0,Yt.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),F.push(""),F.push("[chat] # 黑白名单功能"),F.push(`group_list_type = "${D(L.chat.group_list_type,Yt.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),F.push(`group_list = [${L.chat.group_list.join(", ")}] # 群组名单`),F.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),F.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),F.push(`private_list_type = "${D(L.chat.private_list_type,Yt.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),F.push(`private_list = [${L.chat.private_list.join(", ")}] # 私聊名单`),F.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),F.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),F.push(`ban_user_id = [${L.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),F.push(`ban_qq_bot = ${L.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),F.push(`enable_poke = ${L.chat.enable_poke} # 是否启用戳一戳功能`),F.push(""),F.push("[voice] # 发送语音设置"),F.push(`use_tts = ${L.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),F.push(""),F.push("[debug]"),F.push(`level = "${D(L.debug.level,Yt.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),F.join(` -`)},de=L=>{const F=L.target.files?.[0];if(!F)return;const D=new FileReader;D.onload=ee=>{try{const we=ee.target?.result,ze=xe(we);d(ze),x(F.name),S({title:"上传成功",description:`已加载配置文件:${F.name}`})}catch(we){console.error("解析配置文件失败:",we),S({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},D.readAsText(F)},ge=()=>{if(!c)return;const L=$(c),F=new Blob([L],{type:"text/plain;charset=utf-8"}),D=URL.createObjectURL(F),ee=document.createElement("a");ee.href=D,ee.download=h||"config.toml",document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(D),S({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},le=()=>{d(JSON.parse(JSON.stringify(Yt))),x("config.toml"),S({title:"已加载默认配置",description:"可以开始编辑配置"})};return e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[e.jsx(Da,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"工作模式"}),e.jsx(Zs,{children:"选择配置文件的管理方式"})]}),e.jsxs(bs,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>N("preset"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(rn,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>N("upload"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(hr,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>N("path"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(UN,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),n==="preset"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsx(b,{className:"text-sm md:text-base",children:"选择部署方式"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(Du).map(([L,F])=>{const D=F.icon,ee=p===L;return e.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${ee?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{w(L),Ne(L)},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(D,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"font-semibold text-sm",children:F.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:F.description}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:F.path})]})]})},L)})})]}),n==="path"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(ce,{id:"config-path",value:f,onChange:L=>he(L.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${v?"border-destructive":""}`}),v&&e.jsx("p",{className:"text-xs text-destructive",children:v})]}),e.jsx(y,{onClick:()=>ye(f),disabled:R||!f||!!v,className:"w-full sm:w-auto",children:R?e.jsxs(e.Fragment,{children:[e.jsx(pt,{className:"h-4 w-4 animate-spin mr-2"}),e.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sm:hidden",children:"加载配置"}),e.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),e.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[e.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[e.jsx("span",{children:"路径格式说明"}),e.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),e.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[e.jsx("div",{children:"C:\\Adapter\\config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),e.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[e.jsx("div",{children:"/opt/adapter/config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),e.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),e.jsxs(ha,{children:[e.jsx(Xt,{className:"h-4 w-4"}),e.jsx(xa,{children:n==="preset"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",T&&" (正在保存...)"]}):n==="upload"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",T&&" (正在保存...)"]})})]}),n==="upload"&&!c&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsx("input",{ref:X,type:"file",accept:".toml",className:"hidden",onChange:de}),e.jsxs(y,{onClick:()=>X.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(hr,{className:"mr-2 h-4 w-4"}),"上传配置"]}),e.jsxs(y,{onClick:le,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Aa,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),n==="upload"&&c&&e.jsx("div",{className:"flex gap-2",children:e.jsxs(y,{onClick:ge,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(nl,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(n==="preset"||n==="path")&&c&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs(y,{onClick:je,size:"sm",disabled:T||!!v,className:"w-full sm:w-auto",children:[e.jsx(br,{className:"mr-2 h-4 w-4"}),T?"保存中...":"立即保存"]}),e.jsxs(y,{onClick:_e,size:"sm",variant:"outline",disabled:R,className:"w-full sm:w-auto",children:[e.jsx(pt,{className:`mr-2 h-4 w-4 ${R?"animate-spin":""}`}),"刷新"]}),n==="path"&&e.jsxs(y,{onClick:ie,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(es,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),c?e.jsxs(Kt,{defaultValue:"napcat",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs(Rt,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[e.jsxs($e,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),e.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),e.jsxs($e,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),e.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),e.jsxs($e,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),e.jsx("span",{className:"sm:hidden",children:"聊天"})]}),e.jsxs($e,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),e.jsx("span",{className:"sm:hidden",children:"语音"})]}),e.jsx($e,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),e.jsx(We,{value:"napcat",className:"space-y-4",children:e.jsx(Tw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(We,{value:"maibot",className:"space-y-4",children:e.jsx(Ew,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(We,{value:"chat",className:"space-y-4",children:e.jsx(zw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(We,{value:"voice",className:"space-y-4",children:e.jsx(Mw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(We,{value:"debug",className:"space-y-4",children:e.jsx(Aw,{config:c,onChange:L=>{d(L),pe(L)}})})]}):e.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:e.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[e.jsx(Aa,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:n==="preset"?"请选择预设的部署方式":n==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),e.jsx(ps,{open:U,onOpenChange:A,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认切换模式"}),e.jsxs(us,{children:["切换模式将清空当前配置,确定要继续吗?",e.jsx("br",{}),e.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),e.jsxs(os,{children:[e.jsx(hs,{onClick:()=>{A(!1),B(null)},children:"取消"}),e.jsx(ms,{onClick:q,children:"确认切换"})]})]})}),e.jsx(ps,{open:Z,onOpenChange:H,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认清空路径"}),e.jsxs(us,{children:["清空路径将清除当前配置,确定要继续吗?",e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),e.jsxs(os,{children:[e.jsx(hs,{onClick:()=>H(!1),children:"取消"}),e.jsx(ms,{onClick:me,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Tw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),e.jsxs("div",{className:"grid gap-3 md:gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),e.jsx(ce,{id:"napcat-host",value:n.napcat_server.host,onChange:c=>r({...n,napcat_server:{...n.napcat_server,host:c.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),e.jsx(ce,{id:"napcat-port",type:"number",value:n.napcat_server.port||"",onChange:c=>r({...n,napcat_server:{...n.napcat_server,port:c.target.value?parseInt(c.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),e.jsx(ce,{id:"napcat-token",type:"password",value:n.napcat_server.token,onChange:c=>r({...n,napcat_server:{...n.napcat_server,token:c.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),e.jsx(ce,{id:"napcat-heartbeat",type:"number",value:n.napcat_server.heartbeat_interval||"",onChange:c=>r({...n,napcat_server:{...n.napcat_server,heartbeat_interval:c.target.value?parseInt(c.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Ew({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),e.jsxs("div",{className:"grid gap-3 md:gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),e.jsx(ce,{id:"maibot-host",value:n.maibot_server.host,onChange:c=>r({...n,maibot_server:{...n.maibot_server,host:c.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),e.jsx(ce,{id:"maibot-port",type:"number",value:n.maibot_server.port||"",onChange:c=>r({...n,maibot_server:{...n.maibot_server,port:c.target.value?parseInt(c.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function zw({config:n,onChange:r}){const c=x=>{const f={...n};x==="group"?f.chat.group_list=[...f.chat.group_list,0]:x==="private"?f.chat.private_list=[...f.chat.private_list,0]:f.chat.ban_user_id=[...f.chat.ban_user_id,0],r(f)},d=(x,f)=>{const j={...n};x==="group"?j.chat.group_list=j.chat.group_list.filter((p,w)=>w!==f):x==="private"?j.chat.private_list=j.chat.private_list.filter((p,w)=>w!==f):j.chat.ban_user_id=j.chat.ban_user_id.filter((p,w)=>w!==f),r(j)},h=(x,f,j)=>{const p={...n};x==="group"?p.chat.group_list[f]=j:x==="private"?p.chat.private_list[f]=j:p.chat.ban_user_id[f]=j,r(p)};return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),e.jsxs("div",{className:"grid gap-4 md:gap-6",children:[e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-sm md:text-base",children:"群组名单类型"}),e.jsxs(He,{value:n.chat.group_list_type,onValueChange:x=>r({...n,chat:{...n.chat,group_list_type:x}}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),e.jsx(ne,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsx(b,{className:"text-sm md:text-base",children:"群组列表"}),e.jsxs(y,{onClick:()=>c("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Aa,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),n.chat.group_list.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("group",f,parseInt(j.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除群号 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d("group",f),children:"删除"})]})]})]})]},f)),n.chat.group_list.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-sm md:text-base",children:"私聊名单类型"}),e.jsxs(He,{value:n.chat.private_list_type,onValueChange:x=>r({...n,chat:{...n.chat,private_list_type:x}}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),e.jsx(ne,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsx(b,{className:"text-sm md:text-base",children:"私聊列表"}),e.jsxs(y,{onClick:()=>c("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Aa,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.private_list.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("private",f,parseInt(j.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要删除用户 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d("private",f),children:"删除"})]})]})]})]},f)),n.chat.private_list.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"全局禁止名单"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),e.jsxs(y,{onClick:()=>c("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Aa,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.ban_user_id.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("ban",f,parseInt(j.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),e.jsxs(ps,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(y,{size:"icon",variant:"outline",children:e.jsx(es,{className:"h-4 w-4"})})}),e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:["确定要从全局禁止名单中删除用户 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>d("ban",f),children:"删除"})]})]})]})]},f)),n.chat.ban_user_id.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),e.jsx(Ve,{checked:n.chat.ban_qq_bot,onCheckedChange:x=>r({...n,chat:{...n.chat,ban_qq_bot:x}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),e.jsx(Ve,{checked:n.chat.enable_poke,onCheckedChange:x=>r({...n,chat:{...n.chat,enable_poke:x}})})]})]})]})})}function Mw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),e.jsx(Ve,{checked:n.voice.use_tts,onCheckedChange:c=>r({...n,voice:{use_tts:c}})})]})]})})}function Aw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),e.jsx("div",{className:"grid gap-3 md:gap-4",children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{className:"text-sm md:text-base",children:"日志等级"}),e.jsxs(He,{value:n.debug.level,onValueChange:c=>r({...n,debug:{level:c}}),children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"DEBUG",children:"DEBUG(调试)"}),e.jsx(ne,{value:"INFO",children:"INFO(信息)"}),e.jsx(ne,{value:"WARNING",children:"WARNING(警告)"}),e.jsx(ne,{value:"ERROR",children:"ERROR(错误)"}),e.jsx(ne,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}const Dw=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Ow=/^(aria-|data-)/,Vg=n=>Object.fromEntries(Object.entries(n).filter(([r])=>Ow.test(r)||Dw.includes(r)));function Rw(n,r){const c=Vg(n);return Object.keys(n).some(d=>!Object.hasOwn(c,d)&&n[d]!==r[d])}class Lw extends u.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(r){if(r.uppy!==this.props.uppy)this.uninstallPlugin(r),this.installPlugin();else if(Rw(this.props,r)){const{uppy:c,...d}={...this.props,target:this.container};this.plugin.setOptions(d)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:r,...c}={id:"Dashboard",...this.props,inline:!0,target:this.container};r.use(yb,c),this.plugin=r.getPlugin(c.id)}uninstallPlugin(r=this.props){const{uppy:c}=r;c.removePlugin(this.plugin)}render(){return u.createElement("div",{className:"uppy-Container",ref:r=>{this.container=r},...Vg(this.props)})}}function Uw({content:n,className:r=""}){return e.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${r}`,children:e.jsx(bb,{remarkPlugins:[_b,Sb],rehypePlugins:[wb],components:{code({inline:c,className:d,children:h,...x}){return c?e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...x,children:h}):e.jsx("code",{className:`${d} block bg-muted p-4 rounded-lg overflow-x-auto`,...x,children:h})},table({children:c,...d}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{className:"border-collapse border border-border",...d,children:c})})},th({children:c,...d}){return e.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...d,children:c})},td({children:c,...d}){return e.jsx("td",{className:"border border-border px-4 py-2",...d,children:c})},a({children:c,...d}){return e.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...d,children:c})},blockquote({children:c,...d}){return e.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...d,children:c})},h1({children:c,...d}){return e.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...d,children:c})},h2({children:c,...d}){return e.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...d,children:c})},h3({children:c,...d}){return e.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...d,children:c})},h4({children:c,...d}){return e.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...d,children:c})},ul({children:c,...d}){return e.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...d,children:c})},ol({children:c,...d}){return e.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...d,children:c})},p({children:c,...d}){return e.jsx("p",{className:"my-2 leading-relaxed",...d,children:c})},hr({...c}){return e.jsx("hr",{className:"my-4 border-border",...c})}},children:n})})}function Bw({children:n,className:r}){return e.jsx(Uw,{content:n,className:r})}const La="/api/webui/emoji";async function Hw(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.is_registered!==void 0&&r.append("is_registered",n.is_registered.toString()),n.is_banned!==void 0&&r.append("is_banned",n.is_banned.toString()),n.format&&r.append("format",n.format),n.sort_by&&r.append("sort_by",n.sort_by),n.sort_order&&r.append("sort_order",n.sort_order);const c=await ke(`${La}/list?${r}`,{});if(!c.ok)throw new Error(`获取表情包列表失败: ${c.statusText}`);return c.json()}async function qw(n){const r=await ke(`${La}/${n}`,{});if(!r.ok)throw new Error(`获取表情包详情失败: ${r.statusText}`);return r.json()}async function Gw(n,r){const c=await ke(`${La}/${n}`,{method:"PATCH",body:JSON.stringify(r)});if(!c.ok)throw new Error(`更新表情包失败: ${c.statusText}`);return c.json()}async function Vw(n){const r=await ke(`${La}/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(`删除表情包失败: ${r.statusText}`);return r.json()}async function Fw(){const n=await ke(`${La}/stats/summary`,{});if(!n.ok)throw new Error(`获取统计数据失败: ${n.statusText}`);return n.json()}async function $w(n){const r=await ke(`${La}/${n}/register`,{method:"POST"});if(!r.ok)throw new Error(`注册表情包失败: ${r.statusText}`);return r.json()}async function Qw(n){const r=await ke(`${La}/${n}/ban`,{method:"POST"});if(!r.ok)throw new Error(`封禁表情包失败: ${r.statusText}`);return r.json()}function Fg(n){return`${La}/${n}/thumbnail`}async function Yw(n){const r=await ke(`${La}/batch/delete`,{method:"POST",body:JSON.stringify({emoji_ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除失败")}return r.json()}function Xw(){return`${La}/upload`}function Kw(){const[n,r]=u.useState([]),[c,d]=u.useState(null),[h,x]=u.useState(!1),[f,j]=u.useState(1),[p,w]=u.useState(0),[v,k]=u.useState(20),[T,E]=u.useState("all"),[R,K]=u.useState("all"),[U,A]=u.useState("all"),[Z,H]=u.useState("usage_count"),[z,B]=u.useState("desc"),[X,S]=u.useState(null),[O,te]=u.useState(!1),[he,Ne]=u.useState(!1),[ye,pe]=u.useState(!1),[je,_e]=u.useState(new Set),[N,G]=u.useState(!1),[q,ie]=u.useState(""),[_,me]=u.useState("medium"),[xe,$]=u.useState(!1),{toast:de}=Hs(),ge=u.useCallback(async()=>{try{x(!0);const re=await Hw({page:f,page_size:v,is_registered:T==="all"?void 0:T==="registered",is_banned:R==="all"?void 0:R==="banned",format:U==="all"?void 0:U,sort_by:Z,sort_order:z});r(re.data),w(re.total)}catch(re){const be=re instanceof Error?re.message:"加载表情包列表失败";de({title:"错误",description:be,variant:"destructive"})}finally{x(!1)}},[f,v,T,R,U,Z,z,de]),le=async()=>{try{const re=await Fw();d(re.data)}catch(re){console.error("加载统计数据失败:",re)}};u.useEffect(()=>{ge()},[ge]),u.useEffect(()=>{le()},[]);const L=async re=>{try{const be=await qw(re.id);S(be.data),te(!0)}catch(be){const Xe=be instanceof Error?be.message:"加载详情失败";de({title:"错误",description:Xe,variant:"destructive"})}},F=re=>{S(re),Ne(!0)},D=re=>{S(re),pe(!0)},ee=async()=>{if(X)try{await Vw(X.id),de({title:"成功",description:"表情包已删除"}),pe(!1),S(null),ge(),le()}catch(re){const be=re instanceof Error?re.message:"删除失败";de({title:"错误",description:be,variant:"destructive"})}},we=async re=>{try{await $w(re.id),de({title:"成功",description:"表情包已注册"}),ge(),le()}catch(be){const Xe=be instanceof Error?be.message:"注册失败";de({title:"错误",description:Xe,variant:"destructive"})}},ze=async re=>{try{await Qw(re.id),de({title:"成功",description:"表情包已封禁"}),ge(),le()}catch(be){const Xe=be instanceof Error?be.message:"封禁失败";de({title:"错误",description:Xe,variant:"destructive"})}},ss=re=>{const be=new Set(je);be.has(re)?be.delete(re):be.add(re),_e(be)},Ze=async()=>{try{const re=await Yw(Array.from(je));de({title:"批量删除完成",description:re.message}),_e(new Set),G(!1),ge(),le()}catch(re){de({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},Ls=()=>{const re=parseInt(q),be=Math.ceil(p/v);re>=1&&re<=be?(j(re),ie("")):de({title:"无效的页码",description:`请输入1-${be}之间的页码`,variant:"destructive"})},Gs=c?.formats?Object.keys(c.formats):[];return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-4 sm:mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),e.jsxs(y,{onClick:()=>$(!0),className:"gap-2",children:[e.jsx(hr,{className:"h-4 w-4"}),"上传表情包"]})]}),e.jsx(Pe,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[c&&e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e.jsx(Fe,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"总数"}),e.jsx(js,{className:"text-2xl",children:c.total})]})}),e.jsx(Fe,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"已注册"}),e.jsx(js,{className:"text-2xl text-green-600",children:c.registered})]})}),e.jsx(Fe,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"已封禁"}),e.jsx(js,{className:"text-2xl text-red-600",children:c.banned})]})}),e.jsx(Fe,{children:e.jsxs(gs,{className:"pb-2",children:[e.jsx(Zs,{children:"未注册"}),e.jsx(js,{className:"text-2xl text-gray-600",children:c.unregistered})]})})]}),e.jsxs(Fe,{children:[e.jsx(gs,{children:e.jsxs(js,{className:"flex items-center gap-2",children:[e.jsx(Lu,{className:"h-5 w-5"}),"筛选和排序"]})}),e.jsxs(bs,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"排序方式"}),e.jsxs(He,{value:`${Z}-${z}`,onValueChange:re=>{const[be,Xe]=re.split("-");H(be),B(Xe),j(1)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"usage_count-desc",children:"使用次数 (多→少)"}),e.jsx(ne,{value:"usage_count-asc",children:"使用次数 (少→多)"}),e.jsx(ne,{value:"register_time-desc",children:"注册时间 (新→旧)"}),e.jsx(ne,{value:"register_time-asc",children:"注册时间 (旧→新)"}),e.jsx(ne,{value:"record_time-desc",children:"记录时间 (新→旧)"}),e.jsx(ne,{value:"record_time-asc",children:"记录时间 (旧→新)"}),e.jsx(ne,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),e.jsx(ne,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"注册状态"}),e.jsxs(He,{value:T,onValueChange:re=>{E(re),j(1)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),e.jsx(ne,{value:"registered",children:"已注册"}),e.jsx(ne,{value:"unregistered",children:"未注册"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"封禁状态"}),e.jsxs(He,{value:R,onValueChange:re=>{K(re),j(1)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),e.jsx(ne,{value:"banned",children:"已封禁"}),e.jsx(ne,{value:"unbanned",children:"未封禁"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"格式"}),e.jsxs(He,{value:U,onValueChange:re=>{A(re),j(1)},children:[e.jsx(Re,{children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),Gs.map(re=>e.jsxs(ne,{value:re,children:[re.toUpperCase()," (",c?.formats[re],")"]},re))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[je.size>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",je.size," 个表情包"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),e.jsxs(He,{value:_,onValueChange:re=>me(re),children:[e.jsx(Re,{className:"w-24",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"small",children:"小"}),e.jsx(ne,{value:"medium",children:"中"}),e.jsx(ne,{value:"large",children:"大"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(He,{value:v.toString(),onValueChange:re=>{k(parseInt(re)),j(1),_e(new Set)},children:[e.jsx(Re,{id:"emoji-page-size",className:"w-20",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"40",children:"40"}),e.jsx(ne,{value:"60",children:"60"}),e.jsx(ne,{value:"100",children:"100"})]})]}),je.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>_e(new Set),children:"取消选择"}),e.jsxs(y,{variant:"destructive",size:"sm",onClick:()=>G(!0),children:[e.jsx(es,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t",children:e.jsxs(y,{variant:"outline",size:"sm",onClick:ge,disabled:h,children:[e.jsx(pt,{className:`h-4 w-4 mr-2 ${h?"animate-spin":""}`}),"刷新"]})})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"表情包列表"}),e.jsxs(Zs,{children:["共 ",p," 个表情包,当前第 ",f," 页"]})]}),e.jsxs(bs,{children:[n.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):e.jsx("div",{className:`grid gap-3 ${_==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":_==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:n.map(re=>e.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${je.has(re.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>ss(re.id),children:[e.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${je.has(re.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:e.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${je.has(re.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:je.has(re.id)&&e.jsx(pa,{className:"h-3 w-3"})})}),e.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[re.is_registered&&e.jsx(Ye,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),re.is_banned&&e.jsx(Ye,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),e.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${_==="small"?"p-1":_==="medium"?"p-2":"p-3"}`,children:e.jsx("img",{src:Fg(re.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:be=>{const Xe=be.target;Xe.style.display="none";const Ue=Xe.parentElement;Ue&&(Ue.innerHTML='')}})}),e.jsxs("div",{className:`border-t bg-card ${_==="small"?"p-1":"p-2"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[e.jsx(Ye,{variant:"outline",className:"text-[10px] px-1 py-0",children:re.format.toUpperCase()}),e.jsxs("span",{className:"font-mono",children:[re.usage_count,"次"]})]}),e.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${_==="small"?"flex-wrap":""}`,children:[e.jsx(y,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:be=>{be.stopPropagation(),F(re)},title:"编辑",children:e.jsx(pr,{className:"h-3 w-3"})}),e.jsx(y,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:be=>{be.stopPropagation(),L(re)},title:"详情",children:e.jsx(Xt,{className:"h-3 w-3"})}),!re.is_registered&&e.jsx(y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:be=>{be.stopPropagation(),we(re)},title:"注册",children:e.jsx(pa,{className:"h-3 w-3"})}),!re.is_banned&&e.jsx(y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:be=>{be.stopPropagation(),ze(re)},title:"封禁",children:e.jsx(BN,{className:"h-3 w-3"})}),e.jsx(y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:be=>{be.stopPropagation(),D(re)},title:"删除",children:e.jsx(es,{className:"h-3 w-3"})})]})]})]},re.id))}),p>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(f-1)*v+1," 到"," ",Math.min(f*v,p)," 条,共 ",p," 条"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>j(re=>Math.max(1,re-1)),disabled:f===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:q,onChange:re=>ie(re.target.value),onKeyDown:re=>re.key==="Enter"&&Ls(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(p/v)}),e.jsx(y,{variant:"outline",size:"sm",onClick:Ls,disabled:!q,className:"h-8",children:"跳转"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>j(re=>re+1),disabled:f>=Math.ceil(p/v),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(p/v)),disabled:f>=Math.ceil(p/v),className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(Zw,{emoji:X,open:O,onOpenChange:te}),e.jsx(Jw,{emoji:X,open:he,onOpenChange:Ne,onSuccess:()=>{ge(),le()}}),e.jsx(Iw,{open:xe,onOpenChange:$,onSuccess:()=>{ge(),le()}})]})}),e.jsx(ps,{open:N,onOpenChange:G,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认批量删除"}),e.jsxs(us,{children:["你确定要删除选中的 ",je.size," 个表情包吗?此操作不可撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:Ze,children:"确认删除"})]})]})}),e.jsx(Rs,{open:ye,onOpenChange:pe,children:e.jsxs(zs,{children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"确认删除"}),e.jsx(Ys,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>pe(!1),children:"取消"}),e.jsx(y,{variant:"destructive",onClick:ee,children:"删除"})]})]})})]})}function Zw({emoji:n,open:r,onOpenChange:c}){if(!n)return null;const d=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Rs,{open:r,onOpenChange:c,children:e.jsxs(zs,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(Ms,{children:e.jsx(As,{children:"表情包详情"})}),e.jsx(Pe,{className:"max-h-[calc(90vh-8rem)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Fg(n.id),alt:n.description||"表情包",className:"w-full h-full object-cover",onError:h=>{const x=h.target;x.style.display="none";const f=x.parentElement;f&&(f.innerHTML='')}})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"ID"}),e.jsx("div",{className:"mt-1 font-mono",children:n.id})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"格式"}),e.jsx("div",{className:"mt-1",children:e.jsx(Ye,{variant:"outline",children:n.format.toUpperCase()})})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"文件路径"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.full_path})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"哈希值"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.emoji_hash})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"描述"}),n.description?e.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:e.jsx(Bw,{className:"prose-sm",children:n.description})}):e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"情绪"}),e.jsx("div",{className:"mt-1",children:n.emotion?e.jsx("span",{className:"text-sm",children:n.emotion}):e.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"状态"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[n.is_registered&&e.jsx(Ye,{variant:"default",className:"bg-green-600",children:"已注册"}),n.is_banned&&e.jsx(Ye,{variant:"destructive",children:"已封禁"}),!n.is_registered&&!n.is_banned&&e.jsx(Ye,{variant:"outline",children:"未注册"})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"使用次数"}),e.jsx("div",{className:"mt-1 font-mono text-lg",children:n.usage_count})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"记录时间"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.record_time)})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"注册时间"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.register_time)})]})]}),e.jsxs("div",{children:[e.jsx(b,{className:"text-muted-foreground",children:"最后使用"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.last_used_time)})]})]})})]})})}function Jw({emoji:n,open:r,onOpenChange:c,onSuccess:d}){const[h,x]=u.useState(""),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!1),{toast:T}=Hs();u.useEffect(()=>{n&&(x(n.emotion||""),j(n.is_registered),w(n.is_banned))},[n]);const E=async()=>{if(n)try{k(!0);const R=h.split(/[,,]/).map(K=>K.trim()).filter(Boolean).join(",");await Gw(n.id,{emotion:R||void 0,is_registered:f,is_banned:p}),T({title:"成功",description:"表情包信息已更新"}),c(!1),d()}catch(R){const K=R instanceof Error?R.message:"保存失败";T({title:"错误",description:K,variant:"destructive"})}finally{k(!1)}};return n?e.jsx(Rs,{open:r,onOpenChange:c,children:e.jsxs(zs,{className:"max-w-2xl",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"编辑表情包"}),e.jsx(Ys,{children:"修改表情包的情绪和状态信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(b,{children:"情绪"}),e.jsx(Bs,{value:h,onChange:R=>x(R.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"is_registered",checked:f,onCheckedChange:R=>{R===!0?(j(!0),w(!1)):j(!1)}}),e.jsx(b,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"is_banned",checked:p,onCheckedChange:R=>{R===!0?(w(!0),j(!1)):w(!1)}}),e.jsx(b,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(y,{onClick:E,disabled:v,children:v?"保存中...":"保存"})]})]})}):null}function Iw({open:n,onOpenChange:r,onSuccess:c}){const[d,h]=u.useState("select"),[x,f]=u.useState([]),[j,p]=u.useState(null),[w,v]=u.useState(!1),{toast:k}=Hs(),T=u.useMemo(()=>new Nb({id:"emoji-uploader",autoProceed:!1,restrictions:{maxFileSize:10485760,allowedFileTypes:["image/jpeg","image/png","image/gif","image/webp"],maxNumberOfFiles:20},locale:{pluralize:()=>0,strings:{addMoreFiles:"添加更多文件",addingMoreFiles:"正在添加更多文件",allowedFileTypes:"允许的文件类型:%{types}",cancel:"取消",closeModal:"关闭",complete:"完成",connectedToInternet:"已连接到互联网",copyLink:"复制链接",copyLinkToClipboardFallback:"复制下方链接",copyLinkToClipboardSuccess:"链接已复制到剪贴板",dashboardTitle:"选择文件",dashboardWindowTitle:"文件选择窗口(按 ESC 关闭)",done:"完成",dropHereOr:"拖放文件到这里或 %{browse}",dropHint:"将文件拖放到此处",dropPasteFiles:"将文件拖放到这里或 %{browseFiles}",dropPasteFolders:"将文件拖放到这里或 %{browseFolders}",dropPasteBoth:"将文件拖放到这里,%{browseFiles} 或 %{browseFolders}",dropPasteImportFiles:"将文件拖放到这里,%{browseFiles} 或从以下位置导入:",dropPasteImportFolders:"将文件拖放到这里,%{browseFolders} 或从以下位置导入:",dropPasteImportBoth:"将文件拖放到这里,%{browseFiles},%{browseFolders} 或从以下位置导入:",editFile:"编辑文件",editing:"正在编辑 %{file}",emptyFolderAdded:"未从空文件夹添加文件",exceedsSize:"%{file} 超过了最大允许大小 %{size}",failedToUpload:"上传 %{file} 失败",fileSource:"文件来源:%{name}",filesUploadedOfTotal:{0:"已上传 %{complete} / %{smart_count} 个文件",1:"已上传 %{complete} / %{smart_count} 个文件"},filter:"筛选",finishEditingFile:"完成编辑文件",folderAdded:{0:"已从 %{folder} 添加 %{smart_count} 个文件",1:"已从 %{folder} 添加 %{smart_count} 个文件"},generatingThumbnails:"正在生成缩略图...",import:"导入",importFiles:"从以下位置导入文件:",importFrom:"从 %{name} 导入",loading:"加载中...",logOut:"登出",myDevice:"我的设备",noFilesFound:"这里没有文件或文件夹",noInternetConnection:"无网络连接",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",pauseUpload:"暂停上传",paused:"已暂停",poweredBy:"技术支持:%{uppy}",processingXFiles:{0:"正在处理 %{smart_count} 个文件",1:"正在处理 %{smart_count} 个文件"},recording:"录制中",removeFile:"移除文件",resetFilter:"重置筛选",resume:"继续",resumeUpload:"继续上传",retry:"重试",retryUpload:"重试上传",save:"保存",saveChanges:"保存更改",selectFileNamed:"选择文件 %{name}",selectX:{0:"选择 %{smart_count}",1:"选择 %{smart_count}"},smile:"笑一个!",startRecording:"开始录制视频",stopRecording:"停止录制视频",takePicture:"拍照",timedOut:"上传已停滞 %{seconds} 秒,正在中止。",upload:"下一步",uploadComplete:"上传完成",uploadFailed:"上传失败",uploadPaused:"上传已暂停",uploadXFiles:{0:"下一步(%{smart_count} 个文件)",1:"下一步(%{smart_count} 个文件)"},uploadXNewFiles:{0:"下一步(+%{smart_count} 个文件)",1:"下一步(+%{smart_count} 个文件)"},uploading:"正在上传",uploadingXFiles:{0:"正在上传 %{smart_count} 个文件",1:"正在上传 %{smart_count} 个文件"},xFilesSelected:{0:"已选择 %{smart_count} 个文件",1:"已选择 %{smart_count} 个文件"},xMoreFilesAdded:{0:"又添加了 %{smart_count} 个文件",1:"又添加了 %{smart_count} 个文件"},xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传:%{types}",youCanOnlyUploadX:{0:"您只能上传 %{smart_count} 个文件",1:"您只能上传 %{smart_count} 个文件"},youHaveToAtLeastSelectX:{0:"您至少需要选择 %{smart_count} 个文件",1:"您至少需要选择 %{smart_count} 个文件"},browseFiles:"浏览文件",browseFolders:"浏览文件夹",cancelUpload:"取消上传",addMore:"添加更多",back:"返回",editFileWithFilename:"编辑文件 %{file}"}}}),[]);u.useEffect(()=>{const X=()=>{const S=T.getFiles();if(S.length===0)return;const O=S.map(te=>({id:te.id,name:te.name,previewUrl:te.preview||URL.createObjectURL(te.data),emotion:"",description:"",isRegistered:!0,file:te.data}));f(O),S.length===1?(p(O[0].id),h("edit-single")):h("edit-multiple")};return T.on("upload",X),()=>{T.off("upload",X)}},[T]),u.useEffect(()=>{n||(T.cancelAll(),h("select"),f([]),p(null),v(!1))},[n,T]);const E=u.useCallback((X,S)=>{f(O=>O.map(te=>te.id===X?{...te,...S}:te))},[]),R=u.useCallback(X=>X.emotion.trim().length>0,[]),K=u.useMemo(()=>x.length>0&&x.every(R),[x,R]),U=u.useMemo(()=>x.find(X=>X.id===j)||null,[x,j]),A=u.useCallback(()=>{(d==="edit-single"||d==="edit-multiple")&&(h("select"),f([]),p(null))},[d]),Z=u.useCallback(async()=>{if(!K){k({title:"请填写必填项",description:"每个表情包的情感标签都是必填的",variant:"destructive"});return}v(!0);const X=localStorage.getItem("access-token")||"";let S=0,O=0;try{for(const te of x){const he=new FormData;he.append("file",te.file),he.append("emotion",te.emotion),he.append("description",te.description),he.append("is_registered",te.isRegistered.toString());try{(await fetch(Xw(),{method:"POST",headers:{Authorization:`Bearer ${X}`},body:he})).ok?S++:O++}catch{O++}}O===0?(k({title:"上传成功",description:`成功上传 ${S} 个表情包`}),r(!1),c()):(k({title:"部分上传失败",description:`成功 ${S} 个,失败 ${O} 个`,variant:"destructive"}),c())}finally{v(!1)}},[K,x,k,r,c]),H=()=>e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"border rounded-lg overflow-hidden w-full",children:e.jsx(Lw,{uppy:T,proudlyDisplayPoweredByUppy:!1,hideProgressDetails:!0,height:350,width:"100%",theme:"auto",note:"支持 JPG、PNG、GIF、WebP 格式,最多 20 个文件"})})}),z=()=>{const X=x[0];return X?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(y,{variant:"ghost",size:"sm",onClick:A,children:[e.jsx(ti,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"编辑表情包信息"})]}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex-shrink-0",children:[e.jsx("div",{className:"w-32 h-32 rounded-lg border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:X.previewUrl,alt:X.name,className:"max-w-full max-h-full object-contain"})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2 text-center truncate max-w-32",children:X.name})]}),e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"single-emotion",children:["情感标签 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"single-emotion",value:X.emotion,onChange:S=>E(X.id,{emotion:S.target.value}),placeholder:"多个标签用逗号分隔,如:开心,高兴",className:X.emotion.trim()?"":"border-destructive"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于情感匹配,多个标签用逗号分隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"single-description",children:"描述"}),e.jsx(ce,{id:"single-description",value:X.description,onChange:S=>E(X.id,{description:S.target.value}),placeholder:"输入表情包描述..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"single-is-registered",checked:X.isRegistered,onCheckedChange:S=>E(X.id,{isRegistered:S===!0})}),e.jsx(b,{htmlFor:"single-is-registered",className:"cursor-pointer",children:"上传后立即注册(可被麦麦使用)"})]})]})]}),e.jsx(Js,{children:e.jsx(y,{onClick:Z,disabled:!K||w,children:w?"上传中...":"上传"})})]}):null},B=()=>{const X=x.filter(R).length,S=x.length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(y,{variant:"ghost",size:"sm",onClick:A,children:[e.jsx(ti,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["编辑表情包信息(",X,"/",S," 已完成)"]})]}),e.jsx(Ye,{variant:K?"default":"secondary",children:K?e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"h-3 w-3 mr-1"}),"全部完成"]}):e.jsxs(e.Fragment,{children:[e.jsx(li,{className:"h-3 w-3 mr-1"}),"未完成"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Pe,{className:"h-[350px] pr-2",children:e.jsx("div",{className:"space-y-2",children:x.map(O=>{const te=R(O),he=j===O.id;return e.jsxs("div",{onClick:()=>p(O.id),className:` - flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-all - ${he?"ring-2 ring-primary":""} - ${te?"border-green-500 bg-green-50 dark:bg-green-950/20":"border-border hover:border-muted-foreground/50"} - `,children:[e.jsx("div",{className:"w-12 h-12 rounded border overflow-hidden bg-muted flex-shrink-0 flex items-center justify-center",children:e.jsx("img",{src:O.previewUrl,alt:O.name,className:"max-w-full max-h-full object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:O.emotion||"未填写情感标签"})]}),te?e.jsx(pa,{className:"h-5 w-5 text-green-500 flex-shrink-0"}):e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-muted-foreground/30 flex-shrink-0"})]},O.id)})})}),e.jsx("div",{className:"border rounded-lg p-4",children:U?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-16 h-16 rounded border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:U.previewUrl,alt:U.name,className:"max-w-full max-h-full object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:U.name}),R(U)&&e.jsxs(Ye,{variant:"outline",className:"text-green-600 border-green-600",children:[e.jsx(fa,{className:"h-3 w-3 mr-1"}),"已完成"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"multi-emotion",children:["情感标签 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"multi-emotion",value:U.emotion,onChange:O=>E(U.id,{emotion:O.target.value}),placeholder:"多个标签用逗号分隔,如:开心,高兴",className:U.emotion.trim()?"":"border-destructive"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"multi-description",children:"描述"}),e.jsx(ce,{id:"multi-description",value:U.description,onChange:O=>E(U.id,{description:O.target.value}),placeholder:"输入表情包描述..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"multi-is-registered",checked:U.isRegistered,onCheckedChange:O=>E(U.id,{isRegistered:O===!0})}),e.jsx(b,{htmlFor:"multi-is-registered",className:"cursor-pointer text-sm",children:"上传后立即注册"})]})]}):e.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(HN,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"点击左侧卡片编辑"})]})})})]}),e.jsx(Js,{children:e.jsx(y,{onClick:Z,disabled:!K||w,children:w?"上传中...":`上传全部 (${S})`})})]})};return e.jsx(Rs,{open:n,onOpenChange:r,children:e.jsxs(zs,{className:"max-w-3xl max-h-[90vh] overflow-hidden",children:[e.jsxs(Ms,{children:[e.jsxs(As,{className:"flex items-center gap-2",children:[e.jsx(hr,{className:"h-5 w-5"}),d==="select"&&"上传表情包 - 选择文件",d==="edit-single"&&"上传表情包 - 填写信息",d==="edit-multiple"&&"上传表情包 - 批量编辑"]}),e.jsxs(Ys,{children:[d==="select"&&"支持 JPG、PNG、GIF、WebP 格式,单个文件最大 10MB,可同时上传多个文件",d==="edit-single"&&"请填写表情包的情感标签(必填)和描述",d==="edit-multiple"&&"点击左侧卡片编辑每个表情包的信息,情感标签为必填项"]})]}),e.jsxs("div",{className:"overflow-y-auto pr-1",children:[d==="select"&&H(),d==="edit-single"&&z(),d==="edit-multiple"&&B()]})]})})}const Bl="/api/webui/expression";async function Pw(){const n=await ke(`${Bl}/chats`,{});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取聊天列表失败")}return n.json()}async function Ww(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.chat_id&&r.append("chat_id",n.chat_id);const c=await ke(`${Bl}/list?${r}`,{});if(!c.ok){const d=await c.json();throw new Error(d.detail||"获取表达方式列表失败")}return c.json()}async function e1(n){const r=await ke(`${Bl}/${n}`,{});if(!r.ok){const c=await r.json();throw new Error(c.detail||"获取表达方式详情失败")}return r.json()}async function s1(n){const r=await ke(`${Bl}/`,{method:"POST",body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"创建表达方式失败")}return r.json()}async function t1(n,r){const c=await ke(`${Bl}/${n}`,{method:"PATCH",body:JSON.stringify(r)});if(!c.ok){const d=await c.json();throw new Error(d.detail||"更新表达方式失败")}return c.json()}async function a1(n){const r=await ke(`${Bl}/${n}`,{method:"DELETE"});if(!r.ok){const c=await r.json();throw new Error(c.detail||"删除表达方式失败")}return r.json()}async function l1(n){const r=await ke(`${Bl}/batch/delete`,{method:"POST",body:JSON.stringify({ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除表达方式失败")}return r.json()}async function n1(){const n=await ke(`${Bl}/stats/summary`,{});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取统计数据失败")}return n.json()}function i1(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(0),[f,j]=u.useState(1),[p,w]=u.useState(20),[v,k]=u.useState(""),[T,E]=u.useState(null),[R,K]=u.useState(!1),[U,A]=u.useState(!1),[Z,H]=u.useState(!1),[z,B]=u.useState(null),[X,S]=u.useState(new Set),[O,te]=u.useState(!1),[he,Ne]=u.useState(""),[ye,pe]=u.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[je,_e]=u.useState([]),[N,G]=u.useState(new Map),{toast:q}=Hs(),ie=async()=>{try{d(!0);const ee=await Ww({page:f,page_size:p,search:v||void 0});r(ee.data),x(ee.total)}catch(ee){q({title:"加载失败",description:ee instanceof Error?ee.message:"无法加载表达方式",variant:"destructive"})}finally{d(!1)}},_=async()=>{try{const ee=await n1();ee?.data&&pe(ee.data)}catch(ee){console.error("加载统计数据失败:",ee)}},me=async()=>{try{const ee=await Pw();if(ee?.data){_e(ee.data);const we=new Map;ee.data.forEach(ze=>{we.set(ze.chat_id,ze.chat_name)}),G(we)}}catch(ee){console.error("加载聊天列表失败:",ee)}},xe=ee=>N.get(ee)||ee;u.useEffect(()=>{ie(),_(),me()},[f,p,v]);const $=async ee=>{try{const we=await e1(ee.id);E(we.data),K(!0)}catch(we){q({title:"加载详情失败",description:we instanceof Error?we.message:"无法加载表达方式详情",variant:"destructive"})}},de=ee=>{E(ee),A(!0)},ge=async ee=>{try{await a1(ee.id),q({title:"删除成功",description:`已删除表达方式: ${ee.situation}`}),B(null),ie(),_()}catch(we){q({title:"删除失败",description:we instanceof Error?we.message:"无法删除表达方式",variant:"destructive"})}},le=ee=>{const we=new Set(X);we.has(ee)?we.delete(ee):we.add(ee),S(we)},L=()=>{X.size===n.length&&n.length>0?S(new Set):S(new Set(n.map(ee=>ee.id)))},F=async()=>{try{await l1(Array.from(X)),q({title:"批量删除成功",description:`已删除 ${X.size} 个表达方式`}),S(new Set),te(!1),ie(),_()}catch(ee){q({title:"批量删除失败",description:ee instanceof Error?ee.message:"无法批量删除表达方式",variant:"destructive"})}},D=()=>{const ee=parseInt(he),we=Math.ceil(h/p);ee>=1&&ee<=we?(j(ee),Ne("")):q({title:"无效的页码",description:`请输入1-${we}之间的页码`,variant:"destructive"})};return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(si,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),e.jsxs(y,{onClick:()=>H(!0),className:"gap-2",children:[e.jsx(ot,{className:"h-4 w-4"}),"新增表达方式"]})]})}),e.jsx(Pe,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:ye.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:ye.recent_7days})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:ye.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx(b,{htmlFor:"search",children:"搜索"}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(_t,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{id:"search",placeholder:"搜索情境、风格或上下文...",value:v,onChange:ee=>k(ee.target.value),className:"pl-9"})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:X.size>0&&e.jsxs("span",{children:["已选择 ",X.size," 个表达方式"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(He,{value:p.toString(),onValueChange:ee=>{w(parseInt(ee)),j(1),S(new Set)},children:[e.jsx(Re,{id:"page-size",className:"w-20",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),X.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>S(new Set),children:"取消选择"}),e.jsxs(y,{variant:"destructive",size:"sm",onClick:()=>te(!0),children:[e.jsx(es,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(gt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:X.size===n.length&&n.length>0,onCheckedChange:L})}),e.jsx(ls,{children:"情境"}),e.jsx(ls,{children:"风格"}),e.jsx(ls,{children:"聊天"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:c?e.jsx(gt,{children:e.jsx(Qe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?e.jsx(gt,{children:e.jsx(Qe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(ee=>e.jsxs(gt,{children:[e.jsx(Qe,{children:e.jsx(yt,{checked:X.has(ee.id),onCheckedChange:()=>le(ee.id)})}),e.jsx(Qe,{className:"font-medium max-w-xs truncate",children:ee.situation}),e.jsx(Qe,{className:"max-w-xs truncate",children:ee.style}),e.jsx(Qe,{className:"max-w-[200px] truncate",title:xe(ee.chat_id),style:{wordBreak:"keep-all"},children:e.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:xe(ee.chat_id)})}),e.jsx(Qe,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(y,{variant:"default",size:"sm",onClick:()=>de(ee),children:[e.jsx(pr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(y,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>$(ee),title:"查看详情",children:e.jsx(Zt,{className:"h-4 w-4"})}),e.jsxs(y,{size:"sm",onClick:()=>B(ee),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(es,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ee.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:c?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(ee=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(yt,{checked:X.has(ee.id),onCheckedChange:()=>le(ee.id),className:"mt-1"}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:ee.situation,children:ee.situation})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),e.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:ee.style,children:ee.style})]})]})]}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),e.jsx("p",{className:"text-sm truncate",title:xe(ee.chat_id),style:{wordBreak:"keep-all"},children:xe(ee.chat_id)})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>de(ee),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(pr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>$(ee),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:e.jsx(Zt,{className:"h-3 w-3"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>B(ee),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(es,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ee.id))}),h>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",h," 条记录,第 ",f," / ",Math.ceil(h/p)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>j(f-1),disabled:f===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:he,onChange:ee=>Ne(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&D(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(h/p)}),e.jsx(y,{variant:"outline",size:"sm",onClick:D,disabled:!he,className:"h-8",children:"跳转"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>j(f+1),disabled:f>=Math.ceil(h/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(h/p)),disabled:f>=Math.ceil(h/p),className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(r1,{expression:T,open:R,onOpenChange:K,chatNameMap:N}),e.jsx(c1,{open:Z,onOpenChange:H,chatList:je,onSuccess:()=>{ie(),_(),H(!1)}}),e.jsx(o1,{expression:T,open:U,onOpenChange:A,chatList:je,onSuccess:()=>{ie(),_(),A(!1)}}),e.jsx(ps,{open:!!z,onOpenChange:()=>B(null),children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除表达方式 "',z?.situation,'" 吗? 此操作不可撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>z&&ge(z),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(d1,{open:O,onOpenChange:te,onConfirm:F,count:X.size})]})}function r1({expression:n,open:r,onOpenChange:c,chatNameMap:d}){if(!n)return null;const h=f=>f?new Date(f*1e3).toLocaleString("zh-CN"):"-",x=f=>d.get(f)||f;return e.jsx(Rs,{open:r,onOpenChange:c,children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"表达方式详情"}),e.jsx(Ys,{children:"查看表达方式的完整信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(nr,{label:"情境",value:n.situation}),e.jsx(nr,{label:"风格",value:n.style}),e.jsx(nr,{label:"聊天",value:x(n.chat_id)}),e.jsx(nr,{icon:Uu,label:"记录ID",value:n.id.toString(),mono:!0})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsx(nr,{icon:Wn,label:"创建时间",value:h(n.create_date)})})]}),e.jsx(Js,{children:e.jsx(y,{onClick:()=>c(!1),children:"关闭"})})]})})}function nr({icon:n,label:r,value:c,mono:d=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(b,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&e.jsx(n,{className:"h-3 w-3"}),r]}),e.jsx("div",{className:Q("text-sm",d&&"font-mono",!c&&"text-muted-foreground"),children:c||"-"})]})}function c1({open:n,onOpenChange:r,chatList:c,onSuccess:d}){const[h,x]=u.useState({situation:"",style:"",chat_id:""}),[f,j]=u.useState(!1),{toast:p}=Hs(),w=async()=>{if(!h.situation||!h.style||!h.chat_id){p({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{j(!0),await s1(h),p({title:"创建成功",description:"表达方式已创建"}),x({situation:"",style:"",chat_id:""}),d()}catch(v){p({title:"创建失败",description:v instanceof Error?v.message:"无法创建表达方式",variant:"destructive"})}finally{j(!1)}};return e.jsx(Rs,{open:n,onOpenChange:r,children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"新增表达方式"}),e.jsx(Ys,{children:"创建新的表达方式记录"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"situation",children:["情境 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"situation",value:h.situation,onChange:v=>x({...h,situation:v.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"style",children:["风格 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"style",value:h.style,onChange:v=>x({...h,style:v.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(b,{htmlFor:"chat_id",children:["聊天 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(He,{value:h.chat_id,onValueChange:v=>x({...h,chat_id:v}),children:[e.jsx(Re,{children:e.jsx(qe,{placeholder:"选择关联的聊天"})}),e.jsx(Le,{children:c.map(v=>e.jsx(ne,{value:v.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[v.chat_name,v.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},v.chat_id))})]})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>r(!1),children:"取消"}),e.jsx(y,{onClick:w,disabled:f,children:f?"创建中...":"创建"})]})]})})}function o1({expression:n,open:r,onOpenChange:c,chatList:d,onSuccess:h}){const[x,f]=u.useState({}),[j,p]=u.useState(!1),{toast:w}=Hs();u.useEffect(()=>{n&&f({situation:n.situation,style:n.style,chat_id:n.chat_id})},[n]);const v=async()=>{if(n)try{p(!0),await t1(n.id,x),w({title:"保存成功",description:"表达方式已更新"}),h()}catch(k){w({title:"保存失败",description:k instanceof Error?k.message:"无法更新表达方式",variant:"destructive"})}finally{p(!1)}};return n?e.jsx(Rs,{open:r,onOpenChange:c,children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"编辑表达方式"}),e.jsx(Ys,{children:"修改表达方式的信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit_situation",children:"情境"}),e.jsx(ce,{id:"edit_situation",value:x.situation||"",onChange:k=>f({...x,situation:k.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit_style",children:"风格"}),e.jsx(ce,{id:"edit_style",value:x.style||"",onChange:k=>f({...x,style:k.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit_chat_id",children:"聊天"}),e.jsxs(He,{value:x.chat_id||"",onValueChange:k=>f({...x,chat_id:k}),children:[e.jsx(Re,{children:e.jsx(qe,{placeholder:"选择关联的聊天"})}),e.jsx(Le,{children:d.map(k=>e.jsx(ne,{value:k.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[k.chat_name,k.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},k.chat_id))})]})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(y,{onClick:v,disabled:j,children:j?"保存中...":"保存"})]})]})}):null}function d1({open:n,onOpenChange:r,onConfirm:c,count:d}){return e.jsx(ps,{open:n,onOpenChange:r,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认批量删除"}),e.jsxs(us,{children:["您即将删除 ",d," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const oi="/api/webui/person";async function u1(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.is_known!==void 0&&r.append("is_known",n.is_known.toString()),n.platform&&r.append("platform",n.platform);const c=await ke(`${oi}/list?${r}`,{headers:Ts()});if(!c.ok){const d=await c.json();throw new Error(d.detail||"获取人物列表失败")}return c.json()}async function m1(n){const r=await ke(`${oi}/${n}`,{headers:Ts()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"获取人物详情失败")}return r.json()}async function h1(n,r){const c=await ke(`${oi}/${n}`,{method:"PATCH",headers:Ts(),body:JSON.stringify(r)});if(!c.ok){const d=await c.json();throw new Error(d.detail||"更新人物信息失败")}return c.json()}async function x1(n){const r=await ke(`${oi}/${n}`,{method:"DELETE",headers:Ts()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"删除人物信息失败")}return r.json()}async function f1(){const n=await ke(`${oi}/stats/summary`,{headers:Ts()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取统计数据失败")}return n.json()}async function p1(n){const r=await ke(`${oi}/batch/delete`,{method:"POST",headers:Ts(),body:JSON.stringify({person_ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除失败")}return r.json()}function g1(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(0),[f,j]=u.useState(1),[p,w]=u.useState(20),[v,k]=u.useState(""),[T,E]=u.useState(void 0),[R,K]=u.useState(void 0),[U,A]=u.useState(null),[Z,H]=u.useState(!1),[z,B]=u.useState(!1),[X,S]=u.useState(null),[O,te]=u.useState({total:0,known:0,unknown:0,platforms:{}}),[he,Ne]=u.useState(new Set),[ye,pe]=u.useState(!1),[je,_e]=u.useState(""),{toast:N}=Hs(),G=async()=>{try{d(!0);const D=await u1({page:f,page_size:p,search:v||void 0,is_known:T,platform:R});r(D.data),x(D.total)}catch(D){N({title:"加载失败",description:D instanceof Error?D.message:"无法加载人物信息",variant:"destructive"})}finally{d(!1)}},q=async()=>{try{const D=await f1();D?.data&&te(D.data)}catch(D){console.error("加载统计数据失败:",D)}};u.useEffect(()=>{G(),q()},[f,p,v,T,R]);const ie=async D=>{try{const ee=await m1(D.person_id);A(ee.data),H(!0)}catch(ee){N({title:"加载详情失败",description:ee instanceof Error?ee.message:"无法加载人物详情",variant:"destructive"})}},_=D=>{A(D),B(!0)},me=async D=>{try{await x1(D.person_id),N({title:"删除成功",description:`已删除人物信息: ${D.person_name||D.nickname||D.user_id}`}),S(null),G(),q()}catch(ee){N({title:"删除失败",description:ee instanceof Error?ee.message:"无法删除人物信息",variant:"destructive"})}},xe=u.useMemo(()=>Object.keys(O.platforms),[O.platforms]),$=D=>{const ee=new Set(he);ee.has(D)?ee.delete(D):ee.add(D),Ne(ee)},de=()=>{he.size===n.length&&n.length>0?Ne(new Set):Ne(new Set(n.map(D=>D.person_id)))},ge=()=>{if(he.size===0){N({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}pe(!0)},le=async()=>{try{const D=await p1(Array.from(he));N({title:"批量删除完成",description:D.message}),Ne(new Set),pe(!1),G(),q()}catch(D){N({title:"批量删除失败",description:D instanceof Error?D.message:"批量删除失败",variant:"destructive"})}},L=()=>{const D=parseInt(je),ee=Math.ceil(h/p);D>=1&&D<=ee?(j(D),_e("")):N({title:"无效的页码",description:`请输入1-${ee}之间的页码`,variant:"destructive"})},F=D=>D?new Date(D*1e3).toLocaleString("zh-CN"):"-";return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(qN,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),e.jsx(Pe,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:O.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:O.known})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:O.unknown})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(b,{htmlFor:"search",children:"搜索"}),e.jsxs("div",{className:"relative mt-1.5",children:[e.jsx(_t,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:v,onChange:D=>k(D.target.value),className:"pl-9"})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"filter-known",children:"认识状态"}),e.jsxs(He,{value:T===void 0?"all":T.toString(),onValueChange:D=>{E(D==="all"?void 0:D==="true"),j(1)},children:[e.jsx(Re,{id:"filter-known",className:"mt-1.5",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),e.jsx(ne,{value:"true",children:"已认识"}),e.jsx(ne,{value:"false",children:"未认识"})]})]})]}),e.jsxs("div",{children:[e.jsx(b,{htmlFor:"filter-platform",children:"平台"}),e.jsxs(He,{value:R||"all",onValueChange:D=>{K(D==="all"?void 0:D),j(1)},children:[e.jsx(Re,{id:"filter-platform",className:"mt-1.5",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部平台"}),xe.map(D=>e.jsxs(ne,{value:D,children:[D," (",O.platforms[D],")"]},D))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:he.size>0&&e.jsxs("span",{children:["已选择 ",he.size," 个人物"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(He,{value:p.toString(),onValueChange:D=>{w(parseInt(D)),j(1),Ne(new Set)},children:[e.jsx(Re,{id:"page-size",className:"w-20",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),he.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>Ne(new Set),children:"取消选择"}),e.jsxs(y,{variant:"destructive",size:"sm",onClick:ge,children:[e.jsx(es,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(gt,{children:[e.jsx(ls,{className:"w-12",children:e.jsx(yt,{checked:n.length>0&&he.size===n.length,onCheckedChange:de,"aria-label":"全选"})}),e.jsx(ls,{children:"状态"}),e.jsx(ls,{children:"名称"}),e.jsx(ls,{children:"昵称"}),e.jsx(ls,{children:"平台"}),e.jsx(ls,{children:"用户ID"}),e.jsx(ls,{children:"最后更新"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:c?e.jsx(gt,{children:e.jsx(Qe,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?e.jsx(gt,{children:e.jsx(Qe,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(D=>e.jsxs(gt,{children:[e.jsx(Qe,{children:e.jsx(yt,{checked:he.has(D.person_id),onCheckedChange:()=>$(D.person_id),"aria-label":`选择 ${D.person_name||D.nickname||D.user_id}`})}),e.jsx(Qe,{children:e.jsx("div",{className:Q("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",D.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:D.is_known?"已认识":"未认识"})}),e.jsx(Qe,{className:"font-medium",children:D.person_name||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Qe,{children:D.nickname||"-"}),e.jsx(Qe,{children:D.platform}),e.jsx(Qe,{className:"font-mono text-sm",children:D.user_id}),e.jsx(Qe,{className:"text-sm text-muted-foreground",children:F(D.last_know)}),e.jsx(Qe,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(y,{variant:"default",size:"sm",onClick:()=>ie(D),children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),"详情"]}),e.jsxs(y,{variant:"default",size:"sm",onClick:()=>_(D),children:[e.jsx(pr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsxs(y,{size:"sm",onClick:()=>S(D),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(es,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},D.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:c?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(D=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(yt,{checked:he.has(D.person_id),onCheckedChange:()=>$(D.person_id),className:"mt-1"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:Q("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",D.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:D.is_known?"已认识":"未认识"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:D.person_name||e.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),D.nickname&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",D.nickname]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),e.jsx("p",{className:"font-medium text-xs",children:D.platform})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),e.jsx("p",{className:"font-mono text-xs truncate",title:D.user_id,children:D.user_id})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),e.jsx("p",{className:"text-xs",children:F(D.last_know)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>ie(D),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Zt,{className:"h-3 w-3 mr-1"}),"查看"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>_(D),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(pr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>S(D),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(es,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},D.id))}),h>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",h," 条记录,第 ",f," / ",Math.ceil(h/p)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(wr,{className:"h-4 w-4"})}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>j(f-1),disabled:f===1,children:[e.jsx(cn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:je,onChange:D=>_e(D.target.value),onKeyDown:D=>D.key==="Enter"&&L(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(h/p)}),e.jsx(y,{variant:"outline",size:"sm",onClick:L,disabled:!je,className:"h-8",children:"跳转"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>j(f+1),disabled:f>=Math.ceil(h/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(il,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(h/p)),disabled:f>=Math.ceil(h/p),className:"hidden sm:flex",children:e.jsx(_r,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(j1,{person:U,open:Z,onOpenChange:H}),e.jsx(v1,{person:U,open:z,onOpenChange:B,onSuccess:()=>{G(),q(),B(!1)}}),e.jsx(ps,{open:!!X,onOpenChange:()=>S(null),children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认删除"}),e.jsxs(us,{children:['确定要删除人物信息 "',X?.person_name||X?.nickname||X?.user_id,'" 吗? 此操作不可撤销。']})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:()=>X&&me(X),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(ps,{open:ye,onOpenChange:pe,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"确认批量删除"}),e.jsxs(us,{children:["确定要删除选中的 ",he.size," 个人物信息吗? 此操作不可撤销。"]})]}),e.jsxs(os,{children:[e.jsx(hs,{children:"取消"}),e.jsx(ms,{onClick:le,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function j1({person:n,open:r,onOpenChange:c}){if(!n)return null;const d=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Rs,{open:r,onOpenChange:c,children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"人物详情"}),e.jsxs(Ys,{children:["查看 ",n.person_name||n.nickname||n.user_id," 的完整信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(al,{icon:to,label:"人物名称",value:n.person_name}),e.jsx(al,{icon:si,label:"昵称",value:n.nickname}),e.jsx(al,{icon:Uu,label:"用户ID",value:n.user_id,mono:!0}),e.jsx(al,{icon:Uu,label:"人物ID",value:n.person_id,mono:!0}),e.jsx(al,{label:"平台",value:n.platform}),e.jsx(al,{label:"状态",value:n.is_known?"已认识":"未认识"})]}),n.name_reason&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(b,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),e.jsx("p",{className:"mt-1 text-sm",children:n.name_reason})]}),n.memory_points&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(b,{className:"text-xs text-muted-foreground",children:"个人印象"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:n.memory_points})]}),n.group_nick_name&&n.group_nick_name.length>0&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(b,{className:"text-xs text-muted-foreground",children:"群昵称"}),e.jsx("div",{className:"mt-2 space-y-1",children:n.group_nick_name.map((h,x)=>e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h.group_id}),e.jsx("span",{children:"→"}),e.jsx("span",{children:h.group_nick_name})]},x))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(al,{icon:Wn,label:"认识时间",value:d(n.know_times)}),e.jsx(al,{icon:Wn,label:"首次记录",value:d(n.know_since)}),e.jsx(al,{icon:Wn,label:"最后更新",value:d(n.last_know)})]})]}),e.jsx(Js,{children:e.jsx(y,{onClick:()=>c(!1),children:"关闭"})})]})})}function al({icon:n,label:r,value:c,mono:d=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(b,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&e.jsx(n,{className:"h-3 w-3"}),r]}),e.jsx("div",{className:Q("text-sm",d&&"font-mono",!c&&"text-muted-foreground"),children:c||"-"})]})}function v1({person:n,open:r,onOpenChange:c,onSuccess:d}){const[h,x]=u.useState({}),[f,j]=u.useState(!1),{toast:p}=Hs();u.useEffect(()=>{n&&x({person_name:n.person_name||"",name_reason:n.name_reason||"",nickname:n.nickname||"",memory_points:n.memory_points||"",is_known:n.is_known})},[n]);const w=async()=>{if(n)try{j(!0),await h1(n.person_id,h),p({title:"保存成功",description:"人物信息已更新"}),d()}catch(v){p({title:"保存失败",description:v instanceof Error?v.message:"无法更新人物信息",variant:"destructive"})}finally{j(!1)}};return n?e.jsx(Rs,{open:r,onOpenChange:c,children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"编辑人物信息"}),e.jsxs(Ys,{children:["修改 ",n.person_name||n.nickname||n.user_id," 的信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"person_name",children:"人物名称"}),e.jsx(ce,{id:"person_name",value:h.person_name||"",onChange:v=>x({...h,person_name:v.target.value}),placeholder:"为这个人设置一个名称"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"nickname",children:"昵称"}),e.jsx(ce,{id:"nickname",value:h.nickname||"",onChange:v=>x({...h,nickname:v.target.value}),placeholder:"昵称"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"name_reason",children:"名称设定原因"}),e.jsx(Bs,{id:"name_reason",value:h.name_reason||"",onChange:v=>x({...h,name_reason:v.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"memory_points",children:"个人印象"}),e.jsx(Bs,{id:"memory_points",value:h.memory_points||"",onChange:v=>x({...h,memory_points:v.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx(b,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),e.jsx(Ve,{id:"is_known",checked:h.is_known,onCheckedChange:v=>x({...h,is_known:v})})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(y,{onClick:w,disabled:f,children:f?"保存中...":"保存"})]})]})}):null}var y1=Cb();const pp=_y(y1),Wu="/api/webui";async function N1(n=100,r="all"){const c=`${Wu}/knowledge/graph?limit=${n}&node_type=${r}`,d=await fetch(c);if(!d.ok)throw new Error(`获取知识图谱失败: ${d.status}`);return d.json()}async function b1(){const n=await fetch(`${Wu}/knowledge/stats`);if(!n.ok)throw new Error("获取知识图谱统计信息失败");return n.json()}async function w1(n){const r=await fetch(`${Wu}/knowledge/search?query=${encodeURIComponent(n)}`);if(!r.ok)throw new Error("搜索知识节点失败");return r.json()}const $g=u.memo(({data:n})=>e.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[e.jsx(lo,{type:"target",position:no.Top}),e.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:n.content,children:n.label}),e.jsx(lo,{type:"source",position:no.Bottom})]}));$g.displayName="EntityNode";const Qg=u.memo(({data:n})=>e.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[e.jsx(lo,{type:"target",position:no.Top}),e.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:n.content,children:n.label}),e.jsx(lo,{type:"source",position:no.Bottom})]}));Qg.displayName="ParagraphNode";const _1={entity:$g,paragraph:Qg};function S1(n,r){const c=new pp.graphlib.Graph;c.setDefaultEdgeLabel(()=>({})),c.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const d=[],h=[];return n.forEach(x=>{c.setNode(x.id,{width:150,height:50})}),r.forEach(x=>{c.setEdge(x.source,x.target)}),pp.layout(c),n.forEach(x=>{const f=c.node(x.id);d.push({id:x.id,type:x.type,position:{x:f.x-75,y:f.y-25},data:{label:x.content.slice(0,20)+(x.content.length>20?"...":""),content:x.content}})}),r.forEach((x,f)=>{const j={id:`edge-${f}`,source:x.source,target:x.target,animated:n.length<=200&&x.weight>5,style:{strokeWidth:Math.min(x.weight/2,5),opacity:.6}};x.weight>10&&n.length<100&&(j.label=`${x.weight.toFixed(0)}`),h.push(j)}),{nodes:d,edges:h}}function C1(){const n=Jt(),[r,c]=u.useState(!1),[d,h]=u.useState(null),[x,f]=u.useState(""),[j,p]=u.useState("all"),[w,v]=u.useState(50),[k,T]=u.useState("50"),[E,R]=u.useState(!1),[K,U]=u.useState(!0),[A,Z]=u.useState(!1),[H,z]=u.useState(!1),[B,X,S]=kb([]),[O,te,he]=Tb([]),[Ne,ye]=u.useState(0),[pe,je]=u.useState(null),[_e,N]=u.useState(null),{toast:G}=Hs(),q=u.useCallback(le=>le.type==="entity"?"#6366f1":le.type==="paragraph"?"#10b981":"#6b7280",[]),ie=u.useCallback(async(le=!1)=>{try{if(!le&&w>200){z(!0);return}c(!0);const[L,F]=await Promise.all([N1(w,j),b1()]);if(h(F),L.nodes.length===0){G({title:"提示",description:"知识库为空,请先导入知识数据"}),X([]),te([]);return}const{nodes:D,edges:ee}=S1(L.nodes,L.edges);X(D),te(ee),ye(D.length),F&&F.total_nodes>w&&G({title:"提示",description:`知识图谱包含 ${F.total_nodes} 个节点,当前显示 ${D.length} 个`}),G({title:"加载成功",description:`已加载 ${D.length} 个节点,${ee.length} 条边`})}catch(L){console.error("加载知识图谱失败:",L),G({title:"加载失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}finally{c(!1)}},[w,j,G]),_=u.useCallback(async()=>{if(!x.trim()){G({title:"提示",description:"请输入搜索关键词"});return}try{const le=await w1(x);if(le.length===0){G({title:"未找到",description:"没有找到匹配的节点"});return}const L=new Set(le.map(F=>F.id));X(F=>F.map(D=>({...D,style:{...D.style,opacity:L.has(D.id)?1:.3,filter:L.has(D.id)?"brightness(1.2)":"brightness(0.8)"}}))),G({title:"搜索完成",description:`找到 ${le.length} 个匹配节点`})}catch(le){console.error("搜索失败:",le),G({title:"搜索失败",description:le instanceof Error?le.message:"未知错误",variant:"destructive"})}},[x,G]),me=u.useCallback(()=>{X(le=>le.map(L=>({...L,style:{...L.style,opacity:1,filter:"brightness(1)"}})))},[]),xe=u.useCallback(()=>{U(!1),Z(!0),ie()},[ie]),$=u.useCallback(()=>{z(!1),setTimeout(()=>{ie(!0)},0)},[ie]),de=u.useCallback((le,L)=>{B.find(D=>D.id===L.id)&&je({id:L.id,type:L.type,content:L.data.content})},[B]);u.useEffect(()=>{K||A&&ie()},[w,j,K,A]);const ge=u.useCallback((le,L)=>{const F=B.find(we=>we.id===L.source),D=B.find(we=>we.id===L.target),ee=O.find(we=>we.id===L.id);F&&D&&ee&&N({source:{id:F.id,type:F.type,content:F.data.content},target:{id:D.id,type:D.type,content:D.data.content},edge:{source:L.source,target:L.target,weight:parseFloat(L.label||"0")}})},[B,O]);return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),d&&e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(Ye,{variant:"outline",className:"gap-1",children:[e.jsx(eo,{className:"h-3 w-3"}),"节点: ",d.total_nodes]}),e.jsxs(Ye,{variant:"outline",className:"gap-1",children:[e.jsx(yg,{className:"h-3 w-3"}),"边: ",d.total_edges]}),e.jsxs(Ye,{variant:"outline",className:"gap-1",children:[e.jsx(Xt,{className:"h-3 w-3"}),"实体: ",d.entity_nodes]}),e.jsxs(Ye,{variant:"outline",className:"gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),"段落: ",d.paragraph_nodes]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[e.jsxs("div",{className:"flex-1 flex gap-2",children:[e.jsx(ce,{placeholder:"搜索节点内容...",value:x,onChange:le=>f(le.target.value),onKeyDown:le=>le.key==="Enter"&&_(),className:"flex-1"}),e.jsx(y,{onClick:_,size:"sm",children:e.jsx(_t,{className:"h-4 w-4"})}),e.jsx(y,{onClick:me,variant:"outline",size:"sm",children:"重置"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(He,{value:j,onValueChange:le=>p(le),children:[e.jsx(Re,{className:"w-[120px]",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部节点"}),e.jsx(ne,{value:"entity",children:"仅实体"}),e.jsx(ne,{value:"paragraph",children:"仅段落"})]})]}),e.jsxs(He,{value:w===1e4?"all":E?"custom":w.toString(),onValueChange:le=>{le==="custom"?(R(!0),T(w.toString())):le==="all"?(R(!1),v(1e4)):(R(!1),v(Number(le)))},children:[e.jsx(Re,{className:"w-[120px]",children:e.jsx(qe,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"50",children:"50 节点"}),e.jsx(ne,{value:"100",children:"100 节点"}),e.jsx(ne,{value:"200",children:"200 节点"}),e.jsx(ne,{value:"500",children:"500 节点"}),e.jsx(ne,{value:"1000",children:"1000 节点"}),e.jsx(ne,{value:"all",children:"全部 (最多10000)"}),e.jsx(ne,{value:"custom",children:"自定义..."})]})]}),E&&e.jsx(ce,{type:"number",min:"50",value:k,onChange:le=>T(le.target.value),onBlur:()=>{const le=parseInt(k);!isNaN(le)&&le>=50?v(le):(T("50"),v(50))},onKeyDown:le=>{if(le.key==="Enter"){const L=parseInt(k);!isNaN(L)&&L>=50?v(L):(T("50"),v(50))}},placeholder:"最少50个",className:"w-[120px]"}),e.jsx(y,{onClick:()=>ie(),variant:"outline",size:"sm",disabled:r,children:e.jsx(pt,{className:Q("h-4 w-4",r&&"animate-spin")})})]})]})]}),e.jsx("div",{className:"flex-1 relative",children:r?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(pt,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):B.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(eo,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),e.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):e.jsxs(Eb,{nodes:B,edges:O,onNodesChange:S,onEdgesChange:he,onNodeClick:de,onEdgeClick:ge,nodeTypes:_1,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:Ne<=500,nodesDraggable:Ne<=1e3,attributionPosition:"bottom-left",children:[e.jsx(zb,{variant:Mb.Dots,gap:12,size:1}),e.jsx(Ab,{}),Ne<=500&&e.jsx(Db,{nodeColor:q,nodeBorderRadius:8,pannable:!0,zoomable:!0}),e.jsxs(Ob,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[e.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),e.jsx("span",{children:"实体节点"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),e.jsx("span",{children:"段落节点"})]}),Ne>200&&e.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[e.jsx("div",{className:"font-semibold",children:"性能模式"}),e.jsx("div",{children:"已禁用动画"}),Ne>500&&e.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),e.jsx(Rs,{open:!!pe,onOpenChange:le=>!le&&je(null),children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(Ms,{children:e.jsx(As,{children:"节点详情"})}),pe&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),e.jsx("div",{className:"mt-1",children:e.jsx(Ye,{variant:pe.type==="entity"?"default":"secondary",children:pe.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),e.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:pe.id})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),e.jsx(Pe,{className:"mt-1 h-40 p-3 bg-muted rounded",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:pe.content})})]})]})]})}),e.jsx(Rs,{open:!!_e,onOpenChange:le=>!le&&N(null),children:e.jsxs(zs,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[e.jsx(Ms,{children:e.jsx(As,{children:"边详情"})}),_e&&e.jsx(Pe,{className:"flex-1 pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),e.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:_e.source.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[_e.source.id.slice(0,40),"..."]})]}),e.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),e.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),e.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:_e.target.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[_e.target.id.slice(0,40),"..."]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),e.jsx("div",{className:"mt-1",children:e.jsx(Ye,{variant:"outline",className:"text-base font-mono",children:_e.edge.weight.toFixed(4)})})]})]})})]})}),e.jsx(ps,{open:K,onOpenChange:U,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"加载知识图谱"}),e.jsxs(us,{children:["知识图谱的动态展示会消耗较多系统资源。",e.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),e.jsxs(os,{children:[e.jsx(hs,{onClick:()=>n({to:"/"}),children:"取消 (返回首页)"}),e.jsx(ms,{onClick:xe,children:"确认加载"})]})]})}),e.jsx(ps,{open:H,onOpenChange:z,children:e.jsxs(rs,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"⚠️ 节点数量较多"}),e.jsx(us,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["您正在尝试加载 ",e.jsx("strong",{className:"text-orange-600",children:w>=1e4?"全部 (最多10000个)":w})," 个节点。"]}),e.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),e.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[e.jsx("li",{children:"页面加载时间较长"}),e.jsx("li",{children:"浏览器卡顿或崩溃"}),e.jsx("li",{children:"系统资源占用过高"})]}),e.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),e.jsxs(os,{children:[e.jsx(hs,{onClick:()=>{z(!1),w>200&&(v(50),R(!1))},children:"取消"}),e.jsx(ms,{onClick:$,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function gp({className:n,classNames:r,showOutsideDays:c=!0,captionLayout:d="label",buttonVariant:h="ghost",formatters:x,components:f,...j}){const p=_g();return e.jsx(cb,{showOutsideDays:c,className:Q("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,n),captionLayout:d,formatters:{formatMonthDropdown:w=>w.toLocaleString("default",{month:"short"}),...x},classNames:{root:Q("w-fit",p.root),months:Q("relative flex flex-col gap-4 md:flex-row",p.months),month:Q("flex w-full flex-col gap-4",p.month),nav:Q("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",p.nav),button_previous:Q(gr({variant:h}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_previous),button_next:Q(gr({variant:h}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_next),month_caption:Q("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",p.month_caption),dropdowns:Q("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",p.dropdowns),dropdown_root:Q("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",p.dropdown_root),dropdown:Q("bg-popover absolute inset-0 opacity-0",p.dropdown),caption_label:Q("select-none font-medium",d==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:Q("flex",p.weekdays),weekday:Q("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",p.weekday),week:Q("mt-2 flex w-full",p.week),week_number_header:Q("w-[--cell-size] select-none",p.week_number_header),week_number:Q("text-muted-foreground select-none text-[0.8rem]",p.week_number),day:Q("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",p.day),range_start:Q("bg-accent rounded-l-md",p.range_start),range_middle:Q("rounded-none",p.range_middle),range_end:Q("bg-accent rounded-r-md",p.range_end),today:Q("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:Q("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:Q("text-muted-foreground opacity-50",p.disabled),hidden:Q("invisible",p.hidden),...r},components:{Root:({className:w,rootRef:v,...k})=>e.jsx("div",{"data-slot":"calendar",ref:v,className:Q(w),...k}),Chevron:({className:w,orientation:v,...k})=>v==="left"?e.jsx(cn,{className:Q("size-4",w),...k}):v==="right"?e.jsx(il,{className:Q("size-4",w),...k}):e.jsx(Ll,{className:Q("size-4",w),...k}),DayButton:k1,WeekNumber:({children:w,...v})=>e.jsx("td",{...v,children:e.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:w})}),...f},...j})}function k1({className:n,day:r,modifiers:c,...d}){const h=_g(),x=u.useRef(null);return u.useEffect(()=>{c.focused&&x.current?.focus()},[c.focused]),e.jsx(y,{ref:x,variant:"ghost",size:"icon","data-day":r.date.toLocaleDateString(),"data-selected-single":c.selected&&!c.range_start&&!c.range_end&&!c.range_middle,"data-range-start":c.range_start,"data-range-end":c.range_end,"data-range-middle":c.range_middle,className:Q("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",h.day,n),...d})}const T1={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},E1=(n,r,c)=>{let d;const h=T1[n];return typeof h=="string"?d=h:r===1?d=h.one:d=h.other.replace("{{count}}",String(r)),c?.addSuffix?c.comparison&&c.comparison>0?d+"内":d+"前":d},z1={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},M1={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},A1={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},D1={date:wu({formats:z1,defaultWidth:"full"}),time:wu({formats:M1,defaultWidth:"full"}),dateTime:wu({formats:A1,defaultWidth:"full"})};function jp(n,r,c){const d="eeee p";return ky(n,r,c)?d:n.getTime()>r.getTime()?"'下个'"+d:"'上个'"+d}const O1={lastWeek:jp,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:jp,other:"PP p"},R1=(n,r,c,d)=>{const h=O1[n];return typeof h=="function"?h(r,c,d):h},L1={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},U1={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},B1={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},H1={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},q1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},G1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},V1=(n,r)=>{const c=Number(n);switch(r?.unit){case"date":return c.toString()+"日";case"hour":return c.toString()+"时";case"minute":return c.toString()+"分";case"second":return c.toString()+"秒";default:return"第 "+c.toString()}},F1={ordinalNumber:V1,era:er({values:L1,defaultWidth:"wide"}),quarter:er({values:U1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:er({values:B1,defaultWidth:"wide"}),day:er({values:H1,defaultWidth:"wide"}),dayPeriod:er({values:q1,defaultWidth:"wide",formattingValues:G1,defaultFormattingWidth:"wide"})},$1=/^(第\s*)?\d+(日|时|分|秒)?/i,Q1=/\d+/i,Y1={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},X1={any:[/^(前)/i,/^(公元)/i]},K1={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Z1={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},J1={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},I1={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},P1={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},W1={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},e2={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},s2={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},t2={ordinalNumber:Ty({matchPattern:$1,parsePattern:Q1,valueCallback:n=>parseInt(n,10)}),era:sr({matchPatterns:Y1,defaultMatchWidth:"wide",parsePatterns:X1,defaultParseWidth:"any"}),quarter:sr({matchPatterns:K1,defaultMatchWidth:"wide",parsePatterns:Z1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:sr({matchPatterns:J1,defaultMatchWidth:"wide",parsePatterns:I1,defaultParseWidth:"any"}),day:sr({matchPatterns:P1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any"}),dayPeriod:sr({matchPatterns:e2,defaultMatchWidth:"any",parsePatterns:s2,defaultParseWidth:"any"})},$c={code:"zh-CN",formatDistance:E1,formatLong:D1,formatRelative:R1,localize:F1,match:t2,options:{weekStartsOn:1,firstWeekContainsDate:4}},Qc={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function a2(){const[n,r]=u.useState([]),[c,d]=u.useState(""),[h,x]=u.useState("all"),[f,j]=u.useState("all"),[p,w]=u.useState(void 0),[v,k]=u.useState(void 0),[T,E]=u.useState(!0),[R,K]=u.useState(!1),[U,A]=u.useState("xs"),[Z,H]=u.useState(4),z=u.useRef(null);u.useEffect(()=>{const N=an.getAllLogs();r(N);const G=an.onLog(()=>{r(an.getAllLogs())}),q=an.onConnectionChange(ie=>{K(ie)});return()=>{G(),q()}},[]);const B=u.useMemo(()=>{const N=new Set(n.map(G=>G.module).filter(G=>G&&G.trim()!==""));return Array.from(N).sort()},[n]),X=N=>{switch(N){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},S=N=>{switch(N){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},O=()=>{window.location.reload()},te=()=>{an.clearLogs(),r([])},he=()=>{const N=pe.map(_=>`${_.timestamp} [${_.level.padEnd(8)}] [${_.module}] ${_.message}`).join(` -`),G=new Blob([N],{type:"text/plain;charset=utf-8"}),q=URL.createObjectURL(G),ie=document.createElement("a");ie.href=q,ie.download=`logs-${_u(new Date,"yyyy-MM-dd-HHmmss")}.txt`,ie.click(),URL.revokeObjectURL(q)},Ne=()=>{E(!T)},ye=()=>{w(void 0),k(void 0)},pe=u.useMemo(()=>n.filter(N=>{const G=c===""||N.message.toLowerCase().includes(c.toLowerCase())||N.module.toLowerCase().includes(c.toLowerCase()),q=h==="all"||N.level===h,ie=f==="all"||N.module===f;let _=!0;if(p||v){const me=new Date(N.timestamp);if(p){const xe=new Date(p);xe.setHours(0,0,0,0),_=_&&me>=xe}if(v){const xe=new Date(v);xe.setHours(23,59,59,999),_=_&&me<=xe}}return G&&q&&ie&&_}),[n,c,h,f,p,v]),je=Qc[U].rowHeight+Z,_e=py({count:pe.length,getScrollElement:()=>z.current,estimateSize:()=>je,overscan:15});return u.useEffect(()=>{T&&pe.length>0&&_e.scrollToIndex(pe.length-1,{align:"end",behavior:"auto"})},[pe.length,T,_e]),e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:Q("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",R?"bg-green-500 animate-pulse":"bg-red-500")}),e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:R?"已连接":"未连接"})]})]}),e.jsx(Fe,{className:"p-3 sm:p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索日志...",value:c,onChange:N=>d(N.target.value),className:"pl-9 h-9 text-sm"})]}),e.jsxs(He,{value:h,onValueChange:x,children:[e.jsxs(Re,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[e.jsx(Lu,{className:"h-4 w-4 mr-2"}),e.jsx(qe,{placeholder:"级别"})]}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部级别"}),e.jsx(ne,{value:"DEBUG",children:"DEBUG"}),e.jsx(ne,{value:"INFO",children:"INFO"}),e.jsx(ne,{value:"WARNING",children:"WARNING"}),e.jsx(ne,{value:"ERROR",children:"ERROR"}),e.jsx(ne,{value:"CRITICAL",children:"CRITICAL"})]})]}),e.jsxs(He,{value:f,onValueChange:j,children:[e.jsxs(Re,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[e.jsx(Lu,{className:"h-4 w-4 mr-2"}),e.jsx(qe,{placeholder:"模块"})]}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部模块"}),B.map(N=>e.jsx(ne,{value:N,children:N},N))]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",className:Q("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!p&&"text-muted-foreground"),children:[e.jsx(Xf,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:p?_u(p,"PPP",{locale:$c}):"开始日期"})]})}),e.jsx(wa,{className:"w-auto p-0",align:"start",children:e.jsx(gp,{mode:"single",selected:p,onSelect:w,initialFocus:!0,locale:$c})})]}),e.jsxs(Oa,{children:[e.jsx(Ra,{asChild:!0,children:e.jsxs(y,{variant:"outline",size:"sm",className:Q("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!v&&"text-muted-foreground"),children:[e.jsx(Xf,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:v?_u(v,"PPP",{locale:$c}):"结束日期"})]})}),e.jsx(wa,{className:"w-auto p-0",align:"start",children:e.jsx(gp,{mode:"single",selected:v,onSelect:k,initialFocus:!0,locale:$c})})]}),(p||v)&&e.jsxs(y,{variant:"outline",size:"sm",onClick:ye,className:"w-full sm:w-auto h-9",children:[e.jsx(li,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),e.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(y,{variant:T?"default":"outline",size:"sm",onClick:Ne,className:"flex-1 sm:flex-none h-9",children:[T?e.jsx(GN,{className:"h-4 w-4"}):e.jsx(VN,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:T?"自动滚动":"已暂停"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:O,className:"flex-1 sm:flex-none h-9",children:[e.jsx(pt,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:te,className:"flex-1 sm:flex-none h-9",children:[e.jsx(es,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:he,className:"flex-1 sm:flex-none h-9",children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),e.jsx("div",{className:"flex-1 hidden sm:block"}),e.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[e.jsxs("span",{className:"font-mono",children:[pe.length," / ",n.length]}),e.jsx("span",{className:"ml-1",children:"条日志"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(FN,{className:"h-4 w-4"}),e.jsx("span",{children:"字号"})]}),e.jsx("div",{className:"flex gap-1",children:Object.keys(Qc).map(N=>e.jsx(y,{variant:U===N?"default":"outline",size:"sm",onClick:()=>A(N),className:"h-7 px-3 text-xs",children:Qc[N].label},N))})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),e.jsx(Ma,{value:[Z],onValueChange:([N])=>H(N),min:0,max:12,step:2,className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[Z,"px"]})]})]})]})})]}),e.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:e.jsx(Fe,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:e.jsx(Pe,{viewportRef:z,className:"h-full",children:e.jsx("div",{className:Q("p-2 sm:p-3 font-mono relative",Qc[U].class),style:{height:`${_e.getTotalSize()}px`},children:pe.length===0?e.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):_e.getVirtualItems().map(N=>{const G=pe[N.index];return e.jsxs("div",{"data-index":N.index,ref:_e.measureElement,className:Q("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",S(G.level)),style:{transform:`translateY(${N.start}px)`,paddingTop:`${Z/2}px`,paddingBottom:`${Z/2}px`},children:[e.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:G.timestamp}),e.jsxs("span",{className:Q("font-semibold",X(G.level)),children:["[",G.level,"]"]})]}),e.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:G.module}),e.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:G.message})]}),e.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:G.timestamp}),e.jsxs("span",{className:Q("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",X(G.level)),children:["[",G.level,"]"]}),e.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:G.module}),e.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:G.message})]})]},N.key)})})})})})]})}const l2="Mai-with-u",n2="plugin-repo",i2="main",r2="plugin_details.json";async function c2(){try{const n=await ke("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:l2,repo:n2,branch:i2,file_path:r2})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();if(!r.success||!r.data)throw new Error(r.error||"获取插件列表失败");return JSON.parse(r.data).filter(h=>!h?.id||!h?.manifest?(console.warn("跳过无效插件数据:",h),!1):!h.manifest.name||!h.manifest.version?(console.warn("跳过缺少必需字段的插件:",h.id),!1):!0).map(h=>({id:h.id,manifest:{manifest_version:h.manifest.manifest_version||1,name:h.manifest.name,version:h.manifest.version,description:h.manifest.description||"",author:h.manifest.author||{name:"Unknown"},license:h.manifest.license||"Unknown",host_application:h.manifest.host_application||{min_version:"0.0.0"},homepage_url:h.manifest.homepage_url,repository_url:h.manifest.repository_url,keywords:h.manifest.keywords||[],categories:h.manifest.categories||[],default_locale:h.manifest.default_locale||"zh-CN",locales_path:h.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(n){throw console.error("Failed to fetch plugin list:",n),n}}async function o2(){try{const n=await ke("/api/webui/plugins/git-status");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to check Git status:",n),{installed:!1,error:"无法检测 Git 安装状态"}}}async function d2(){try{const n=await ke("/api/webui/plugins/version");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to get Maimai version:",n),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function u2(n,r,c){const d=n.split(".").map(j=>parseInt(j)||0),h=d[0]||0,x=d[1]||0,f=d[2]||0;if(c.version_majorparseInt(k)||0),p=j[0]||0,w=j[1]||0,v=j[2]||0;if(c.version_major>p||c.version_major===p&&c.version_minor>w||c.version_major===p&&c.version_minor===w&&c.version_patch>v)return!1}return!0}function m2(n,r){const c=window.location.protocol==="https:"?"wss:":"ws:",d=window.location.host,h=new WebSocket(`${c}//${d}/api/webui/ws/plugin-progress`);return h.onopen=()=>{console.log("Plugin progress WebSocket connected");const x=setInterval(()=>{h.readyState===WebSocket.OPEN?h.send("ping"):clearInterval(x)},3e4)},h.onmessage=x=>{try{if(x.data==="pong")return;const f=JSON.parse(x.data);n(f)}catch(f){console.error("Failed to parse progress data:",f)}},h.onerror=x=>{console.error("Plugin progress WebSocket error:",x),r?.(x)},h.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},h}async function cr(){try{const n=await ke("/api/webui/plugins/installed",{headers:Ts()});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();if(!r.success)throw new Error(r.message||"获取已安装插件列表失败");return r.plugins||[]}catch(n){return console.error("Failed to get installed plugins:",n),[]}}function Yc(n,r){return r.some(c=>c.id===n)}function Xc(n,r){const c=r.find(d=>d.id===n);if(c)return c.manifest?.version||c.version}async function h2(n,r,c="main"){const d=await ke("/api/webui/plugins/install",{method:"POST",body:JSON.stringify({plugin_id:n,repository_url:r,branch:c})});if(!d.ok){const h=await d.json();throw new Error(h.detail||"安装失败")}return await d.json()}async function x2(n){const r=await ke("/api/webui/plugins/uninstall",{method:"POST",body:JSON.stringify({plugin_id:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"卸载失败")}return await r.json()}async function f2(n,r,c="main"){const d=await ke("/api/webui/plugins/update",{method:"POST",body:JSON.stringify({plugin_id:n,repository_url:r,branch:c})});if(!d.ok){const h=await d.json();throw new Error(h.detail||"更新失败")}return await d.json()}async function p2(n){const r=await ke(`/api/webui/plugins/config/${n}/schema`,{headers:Ts()});if(!r.ok){const d=await r.json();throw new Error(d.detail||"获取配置 Schema 失败")}const c=await r.json();if(!c.success)throw new Error(c.message||"获取配置 Schema 失败");return c.schema}async function g2(n){const r=await ke(`/api/webui/plugins/config/${n}`,{headers:Ts()});if(!r.ok){const d=await r.json();throw new Error(d.detail||"获取配置失败")}const c=await r.json();if(!c.success)throw new Error(c.message||"获取配置失败");return c.config}async function j2(n,r){const c=await ke(`/api/webui/plugins/config/${n}`,{method:"PUT",body:JSON.stringify({config:r})});if(!c.ok){const d=await c.json();throw new Error(d.detail||"保存配置失败")}return await c.json()}async function v2(n){const r=await ke(`/api/webui/plugins/config/${n}/reset`,{method:"POST",headers:Ts()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"重置配置失败")}return await r.json()}async function y2(n){const r=await ke(`/api/webui/plugins/config/${n}/toggle`,{method:"POST",headers:Ts()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"切换状态失败")}return await r.json()}const Cr="https://maibot-plugin-stats.maibot-webui.workers.dev";async function Yg(n){try{const r=await fetch(`${Cr}/stats/${n}`);return r.ok?await r.json():(console.error("Failed to fetch plugin stats:",r.statusText),null)}catch(r){return console.error("Error fetching plugin stats:",r),null}}async function N2(n,r){try{const c=r||em(),d=await fetch(`${Cr}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:c})}),h=await d.json();return d.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:d.ok?{success:!0,...h}:{success:!1,error:h.error||"点赞失败"}}catch(c){return console.error("Error liking plugin:",c),{success:!1,error:"网络错误"}}}async function b2(n,r){try{const c=r||em(),d=await fetch(`${Cr}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:c})}),h=await d.json();return d.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:d.ok?{success:!0,...h}:{success:!1,error:h.error||"点踩失败"}}catch(c){return console.error("Error disliking plugin:",c),{success:!1,error:"网络错误"}}}async function w2(n,r,c,d){if(r<1||r>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const h=d||em(),x=await fetch(`${Cr}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,rating:r,comment:c,user_id:h})}),f=await x.json();return x.status===429?{success:!1,error:"每天最多评分 3 次"}:x.ok?{success:!0,...f}:{success:!1,error:f.error||"评分失败"}}catch(h){return console.error("Error rating plugin:",h),{success:!1,error:"网络错误"}}}async function _2(n){try{const r=await fetch(`${Cr}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n})}),c=await r.json();return r.status===429?(console.warn("Download recording rate limited"),{success:!0}):r.ok?{success:!0,...c}:(console.error("Failed to record download:",c.error),{success:!1,error:c.error})}catch(r){return console.error("Error recording download:",r),{success:!1,error:"网络错误"}}}function S2(){const n=navigator,r=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,n.deviceMemory||0].join("|");let c=0;for(let d=0;d{x(!0);const A=await Yg(n);A&&d(A),x(!1)};u.useEffect(()=>{E()},[n]);const R=async()=>{const A=await N2(n);A.success?(T({title:"已点赞",description:"感谢你的支持!"}),E()):T({title:"点赞失败",description:A.error||"未知错误",variant:"destructive"})},K=async()=>{const A=await b2(n);A.success?(T({title:"已反馈",description:"感谢你的反馈!"}),E()):T({title:"操作失败",description:A.error||"未知错误",variant:"destructive"})},U=async()=>{if(f===0){T({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const A=await w2(n,f,p||void 0);A.success?(T({title:"评分成功",description:"感谢你的评价!"}),k(!1),j(0),w(""),E()):T({title:"评分失败",description:A.error||"未知错误",variant:"destructive"})};return h?e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ol,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]})]}):c?r?e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${c.downloads.toLocaleString()}`,children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{children:c.downloads.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${c.rating.toFixed(1)} (${c.rating_count} 条评价)`,children:[e.jsx(Ol,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:c.rating.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${c.likes}`,children:[e.jsx(Cu,{className:"h-4 w-4"}),e.jsx("span",{children:c.likes})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(nl,{className:"h-5 w-5 text-muted-foreground mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.downloads.toLocaleString()}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Ol,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),e.jsx("span",{className:"text-2xl font-bold",children:c.rating.toFixed(1)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.rating_count," 条评价"]})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Cu,{className:"h-5 w-5 text-green-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.likes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Kf,{className:"h-5 w-5 text-red-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.dislikes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:R,children:[e.jsx(Cu,{className:"h-4 w-4 mr-1"}),"点赞"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:K,children:[e.jsx(Kf,{className:"h-4 w-4 mr-1"}),"点踩"]}),e.jsxs(Rs,{open:v,onOpenChange:k,children:[e.jsx(ni,{asChild:!0,children:e.jsxs(y,{variant:"default",size:"sm",children:[e.jsx(Ol,{className:"h-4 w-4 mr-1"}),"评分"]})}),e.jsxs(zs,{children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"为插件评分"}),e.jsx(Ys,{children:"分享你的使用体验,帮助其他用户"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(A=>e.jsx("button",{onClick:()=>j(A),className:"focus:outline-none",children:e.jsx(Ol,{className:`h-8 w-8 transition-colors ${A<=f?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},A))}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[f===0&&"点击星星进行评分",f===1&&"很差",f===2&&"一般",f===3&&"还行",f===4&&"不错",f===5&&"非常好"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),e.jsx(Bs,{value:p,onChange:A=>w(A.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[p.length," / 500"]})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>k(!1),children:"取消"}),e.jsx(y,{onClick:U,disabled:f===0,children:"提交评分"})]})]})]})]}),c.recent_ratings&&c.recent_ratings.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),e.jsx("div",{className:"space-y-3",children:c.recent_ratings.map((A,Z)=>e.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(H=>e.jsx(Ol,{className:`h-3 w-3 ${H<=A.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},H))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(A.created_at).toLocaleDateString()})]}),A.comment&&e.jsx("p",{className:"text-sm text-muted-foreground",children:A.comment})]},Z))})]})]}):null}const vp={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function k2(){const n=Jt(),[r,c]=u.useState(null),[d,h]=u.useState(""),[x,f]=u.useState("all"),[j,p]=u.useState("all"),[w,v]=u.useState(!0),[k,T]=u.useState([]),[E,R]=u.useState(!0),[K,U]=u.useState(null),[A,Z]=u.useState(null),[H,z]=u.useState(null),[B,X]=u.useState(null),[,S]=u.useState([]),[O,te]=u.useState({}),{toast:he}=Hs(),Ne=async _=>{const me=_.map(async de=>{try{const ge=await Yg(de.id);return{id:de.id,stats:ge}}catch(ge){return console.warn(`Failed to load stats for ${de.id}:`,ge),{id:de.id,stats:null}}}),xe=await Promise.all(me),$={};xe.forEach(({id:de,stats:ge})=>{ge&&($[de]=ge)}),te($)};u.useEffect(()=>{let _=null,me=!1;return(async()=>{if(_=m2($=>{me||(z($),$.stage==="success"?setTimeout(()=>{me||z(null)},2e3):$.stage==="error"&&(R(!1),U($.error||"加载失败")))},$=>{console.error("WebSocket error:",$),me||he({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise($=>{if(!_){$();return}const de=()=>{_&&_.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),$()):_&&_.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),$()):setTimeout(de,100)};de()}),!me){const $=await o2();Z($),$.installed||he({title:"Git 未安装",description:$.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!me){const $=await d2();X($)}if(!me)try{R(!0),U(null);const $=await c2();if(!me){const de=await cr();S(de);const ge=$.map(le=>{const L=Yc(le.id,de),F=Xc(le.id,de);return{...le,installed:L,installed_version:F}});for(const le of de)!ge.some(F=>F.id===le.id)&&le.manifest&&ge.push({id:le.id,manifest:{manifest_version:le.manifest.manifest_version||1,name:le.manifest.name,version:le.manifest.version,description:le.manifest.description||"",author:le.manifest.author,license:le.manifest.license||"Unknown",host_application:le.manifest.host_application,homepage_url:le.manifest.homepage_url,repository_url:le.manifest.repository_url,keywords:le.manifest.keywords||[],categories:le.manifest.categories||[],default_locale:le.manifest.default_locale||"zh-CN",locales_path:le.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:le.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});T(ge),Ne(ge)}}catch($){if(!me){const de=$ instanceof Error?$.message:"加载插件列表失败";U(de),he({title:"加载失败",description:de,variant:"destructive"})}}finally{me||R(!1)}})(),()=>{me=!0,_&&_.close()}},[he]);const ye=_=>{if(!_.installed&&B&&!pe(_))return e.jsxs(Ye,{variant:"destructive",className:"gap-1",children:[e.jsx(Da,{className:"h-3 w-3"}),"不兼容"]});if(_.installed){const me=_.installed_version?.trim(),xe=_.manifest.version?.trim();if(me!==xe){const $=me?.split(".").map(Number)||[0,0,0],de=xe?.split(".").map(Number)||[0,0,0];for(let ge=0;ge<3;ge++){if((de[ge]||0)>($[ge]||0))return e.jsxs(Ye,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[e.jsx(Da,{className:"h-3 w-3"}),"可更新"]});if((de[ge]||0)<($[ge]||0))break}}return e.jsxs(Ye,{variant:"default",className:"gap-1",children:[e.jsx(pa,{className:"h-3 w-3"}),"已安装"]})}return null},pe=_=>!B||!_.manifest?.host_application?!0:u2(_.manifest.host_application.min_version,_.manifest.host_application.max_version,B),je=_=>{if(!_.installed||!_.installed_version||!_.manifest?.version)return!1;const me=_.installed_version.trim(),xe=_.manifest.version.trim();if(me===xe)return!1;const $=me.split(".").map(Number),de=xe.split(".").map(Number);for(let ge=0;ge<3;ge++){if((de[ge]||0)>($[ge]||0))return!0;if((de[ge]||0)<($[ge]||0))return!1}return!1},_e=k.filter(_=>{if(!_.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",_.id),!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(ge=>ge.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x);let $=!0;j==="installed"?$=_.installed===!0:j==="updates"&&($=_.installed===!0&&je(_));const de=!w||!B||pe(_);return me&&xe&&$&&de}),N=()=>{c(null)},G=async _=>{if(!A?.installed){he({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(B&&!pe(_)){he({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await h2(_.id,_.manifest.repository_url||"","main"),_2(_.id).catch(xe=>{console.warn("Failed to record download:",xe)}),he({title:"安装成功",description:`${_.manifest.name} 已成功安装`});const me=await cr();S(me),T(xe=>xe.map($=>{if($.id===_.id){const de=Yc($.id,me),ge=Xc($.id,me);return{...$,installed:de,installed_version:ge}}return $}))}catch(me){he({title:"安装失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},q=async _=>{try{await x2(_.id),he({title:"卸载成功",description:`${_.manifest.name} 已成功卸载`});const me=await cr();S(me),T(xe=>xe.map($=>{if($.id===_.id){const de=Yc($.id,me),ge=Xc($.id,me);return{...$,installed:de,installed_version:ge}}return $}))}catch(me){he({title:"卸载失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ie=async _=>{if(!A?.installed){he({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const me=await f2(_.id,_.manifest.repository_url||"","main");he({title:"更新成功",description:`${_.manifest.name} 已从 ${me.old_version} 更新到 ${me.new_version}`});const xe=await cr();S(xe),T($=>$.map(de=>{if(de.id===_.id){const ge=Yc(de.id,xe),le=Xc(de.id,xe);return{...de,installed:ge,installed_version:le}}return de}))}catch(me){he({title:"更新失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}};return e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),e.jsxs(y,{onClick:()=>n({to:"/plugin-mirrors"}),children:[e.jsx($N,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),A&&!A.installed&&e.jsxs(Fe,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[e.jsx(gs,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ba,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(js,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),e.jsx(Zs,{className:"text-orange-800 dark:text-orange-200",children:A.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),e.jsx(bs,{children:e.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",e.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),e.jsx(Fe,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索插件...",value:d,onChange:_=>h(_.target.value),className:"pl-9"})]}),e.jsxs(He,{value:x,onValueChange:f,children:[e.jsx(Re,{className:"w-full sm:w-[200px]",children:e.jsx(qe,{placeholder:"选择分类"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部分类"}),e.jsx(ne,{value:"Group Management",children:"群组管理"}),e.jsx(ne,{value:"Entertainment & Interaction",children:"娱乐互动"}),e.jsx(ne,{value:"Utility Tools",children:"实用工具"}),e.jsx(ne,{value:"Content Generation",children:"内容生成"}),e.jsx(ne,{value:"Multimedia",children:"多媒体"}),e.jsx(ne,{value:"External Integration",children:"外部集成"}),e.jsx(ne,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),e.jsx(ne,{value:"Other",children:"其他"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(yt,{id:"compatible-only",checked:w,onCheckedChange:_=>v(_===!0)}),e.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),e.jsx(Kt,{value:j,onValueChange:p,className:"w-full",children:e.jsxs(Rt,{className:"grid w-full grid-cols-3",children:[e.jsxs($e,{value:"all",children:["全部插件 (",k.filter(_=>{if(!_.manifest)return!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(de=>de.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x),$=!w||!B||pe(_);return me&&xe&&$}).length,")"]}),e.jsxs($e,{value:"installed",children:["已安装 (",k.filter(_=>{if(!_.manifest)return!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(de=>de.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x),$=!w||!B||pe(_);return _.installed&&me&&xe&&$}).length,")"]}),e.jsxs($e,{value:"updates",children:["可更新 (",k.filter(_=>{if(!_.manifest)return!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(de=>de.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x),$=!w||!B||pe(_);return _.installed&&je(_)&&me&&xe&&$}).length,")"]})]})}),H&&H.stage==="loading"&&e.jsx(Fe,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(vt,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{className:"text-sm font-medium",children:[H.operation==="fetch"&&"加载插件列表",H.operation==="install"&&`安装插件${H.plugin_id?`: ${H.plugin_id}`:""}`,H.operation==="uninstall"&&`卸载插件${H.plugin_id?`: ${H.plugin_id}`:""}`,H.operation==="update"&&`更新插件${H.plugin_id?`: ${H.plugin_id}`:""}`]})]}),e.jsxs("span",{className:"text-sm font-medium",children:[H.progress,"%"]})]}),e.jsx(Sr,{value:H.progress,className:"h-2"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:H.message}),H.operation==="fetch"&&H.total_plugins>0&&e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",H.loaded_plugins," / ",H.total_plugins," 个插件"]})]})}),H&&H.stage==="error"&&H.error&&e.jsx(Fe,{className:"border-destructive bg-destructive/10",children:e.jsx(gs,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ba,{className:"h-5 w-5 text-destructive"}),e.jsxs("div",{children:[e.jsx(js,{className:"text-lg text-destructive",children:"加载失败"}),e.jsx(Zs,{className:"text-destructive/80",children:H.error})]})]})})}),E?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(vt,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):K?e.jsx(Fe,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(ba,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:K}),e.jsx(y,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):_e.length===0?e.jsx(Fe,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(_t,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d||x!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:_e.map(_=>e.jsxs(Fe,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[e.jsxs(gs,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(js,{className:"text-xl",children:_.manifest?.name||_.id}),e.jsxs("div",{className:"flex flex-col gap-1",children:[_.manifest?.categories&&_.manifest.categories[0]&&e.jsx(Ye,{variant:"secondary",className:"text-xs whitespace-nowrap",children:vp[_.manifest.categories[0]]||_.manifest.categories[0]}),ye(_)]})]}),e.jsx(Zs,{className:"line-clamp-2",children:_.manifest?.description||"无描述"})]}),e.jsx(bs,{className:"flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(nl,{className:"h-4 w-4"}),e.jsx("span",{children:(O[_.id]?.downloads??_.downloads??0).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ol,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:(O[_.id]?.rating??_.rating??0).toFixed(1)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[_.manifest?.keywords&&_.manifest.keywords.slice(0,3).map(me=>e.jsx(Ye,{variant:"outline",className:"text-xs",children:me},me)),_.manifest?.keywords&&_.manifest.keywords.length>3&&e.jsxs(Ye,{variant:"outline",className:"text-xs",children:["+",_.manifest.keywords.length-3]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[e.jsxs("div",{children:["v",_.manifest?.version||"unknown"," · ",_.manifest?.author?.name||"Unknown"]}),_.manifest?.host_application&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"支持:"}),e.jsxs("span",{className:"font-medium",children:[_.manifest.host_application.min_version,_.manifest.host_application.max_version?` - ${_.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),e.jsx(Sg,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>c(_),children:"查看详情"}),_.installed?je(_)?e.jsxs(y,{size:"sm",disabled:!A?.installed,title:A?.installed?void 0:"Git 未安装",onClick:()=>ie(_),children:[e.jsx(pt,{className:"h-4 w-4 mr-1"}),"更新"]}):e.jsxs(y,{variant:"destructive",size:"sm",disabled:!A?.installed,title:A?.installed?void 0:"Git 未安装",onClick:()=>q(_),children:[e.jsx(es,{className:"h-4 w-4 mr-1"}),"卸载"]}):e.jsxs(y,{size:"sm",disabled:!A?.installed||H?.operation==="install"||B!==null&&!pe(_),title:A?.installed?B!==null&&!pe(_)?`不兼容当前版本 (需要 ${_.manifest?.host_application?.min_version||"未知"}${_.manifest?.host_application?.max_version?` - ${_.manifest.host_application.max_version}`:"+"},当前 ${B?.version})`:void 0:"Git 未安装",onClick:()=>G(_),children:[e.jsx(nl,{className:"h-4 w-4 mr-1"}),H?.operation==="install"&&H?.plugin_id===_.id?"安装中...":"安装"]})]})})]},_.id))}),e.jsx(Rs,{open:r!==null,onOpenChange:N,children:r&&r.manifest&&e.jsx(zs,{className:"max-w-2xl max-h-[80vh] p-0 flex flex-col",children:e.jsx(Pe,{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsx(Ms,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(As,{className:"text-2xl",children:r.manifest.name}),e.jsxs(Ys,{children:["作者: ",r.manifest.author?.name||"Unknown",r.manifest.author?.url&&e.jsx("a",{href:r.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:e.jsx(dr,{className:"h-3 w-3 inline"})})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[r.manifest.categories&&r.manifest.categories[0]&&e.jsx(Ye,{variant:"secondary",children:vp[r.manifest.categories[0]]||r.manifest.categories[0]}),ye(r)]})]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(C2,{pluginId:r.id}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",r.manifest?.version||"unknown"]}),r.installed&&r.installed_version&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",r.installed_version]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"下载量"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:(O[r.id]?.downloads??r.downloads??0).toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"评分"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ol,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(O[r.id]?.rating??r.rating??0).toFixed(1)," (",O[r.id]?.rating_count??r.review_count??0,")"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"许可证"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.manifest.license||"Unknown"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.manifest.host_application?.min_version||"未知",r.manifest.host_application?.max_version?` - ${r.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.manifest.keywords&&r.manifest.keywords.map(_=>e.jsx(Ye,{variant:"outline",children:_},_))})]}),r.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:r.detailed_description})]}),!r.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.manifest.description||"无描述"})]}),e.jsxs("div",{className:"space-y-2",children:[r.manifest.homepage_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"主页: "}),e.jsx("a",{href:r.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.manifest.homepage_url})]}),r.manifest.repository_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"仓库: "}),e.jsx("a",{href:r.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.manifest.repository_url})]})]})]}),e.jsxs(Js,{children:[r.manifest.homepage_url&&e.jsxs(y,{onClick:()=>window.open(r.manifest.homepage_url,"_blank"),children:[e.jsx(dr,{className:"h-4 w-4 mr-2"}),"访问主页"]}),r.manifest.repository_url&&e.jsxs(y,{variant:"outline",onClick:()=>window.open(r.manifest.repository_url,"_blank"),children:[e.jsx(dr,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})})})]})})}const Gu=$y,Vu=Qy,Fu=Yy;function T2({field:n,value:r,onChange:c}){const[d,h]=u.useState(!1);switch(n.ui_type){case"switch":return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{children:n.label}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]}),e.jsx(Ve,{checked:!!r,onCheckedChange:c,disabled:n.disabled})]});case"number":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsx(ce,{type:"number",value:r??n.default,onChange:x=>c(parseFloat(x.target.value)||0),min:n.min,max:n.max,step:n.step??1,placeholder:n.placeholder,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"slider":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:n.label}),e.jsx("span",{className:"text-sm text-muted-foreground",children:r??n.default})]}),e.jsx(Ma,{value:[r??n.default],onValueChange:x=>c(x[0]),min:n.min??0,max:n.max??100,step:n.step??1,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"select":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsxs(He,{value:String(r??n.default),onValueChange:c,disabled:n.disabled,children:[e.jsx(Re,{children:e.jsx(qe,{placeholder:n.placeholder??"请选择"})}),e.jsx(Le,{children:n.choices?.map(x=>e.jsx(ne,{value:String(x),children:String(x)},String(x)))})]}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"textarea":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsx(Bs,{value:r??n.default,onChange:x=>c(x.target.value),placeholder:n.placeholder,rows:n.rows??3,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"password":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{type:d?"text":"password",value:r??"",onChange:x=>c(x.target.value),placeholder:n.placeholder,disabled:n.disabled,className:"pr-10"}),e.jsx(y,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>h(!d),children:d?e.jsx(mr,{className:"h-4 w-4"}):e.jsx(Zt,{className:"h-4 w-4"})})]}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"text":default:return e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:n.label}),e.jsx(ce,{type:"text",value:r??n.default??"",onChange:x=>c(x.target.value),placeholder:n.placeholder,maxLength:n.max_length,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]})}}function yp({section:n,config:r,onChange:c}){const[d,h]=u.useState(!n.collapsed),x=Object.entries(n.fields).filter(([,f])=>!f.hidden).sort(([,f],[,j])=>f.order-j.order);return e.jsx(Gu,{open:d,onOpenChange:h,children:e.jsxs(Fe,{children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(gs,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d?e.jsx(Ll,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(il,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(js,{className:"text-lg",children:n.title})]}),e.jsxs(Ye,{variant:"secondary",className:"text-xs",children:[x.length," 项"]})]}),n.description&&e.jsx(Zs,{className:"ml-6",children:n.description})]})}),e.jsx(Fu,{children:e.jsx(bs,{className:"space-y-4 pt-0",children:x.map(([f,j])=>e.jsx(T2,{field:j,value:r[n.name]?.[f],onChange:p=>c(n.name,f,p),sectionName:n.name},f))})})]})})}function E2({plugin:n,onBack:r}){const{toast:c}=Hs(),[d,h]=u.useState(null),[x,f]=u.useState({}),[j,p]=u.useState({}),[w,v]=u.useState(!0),[k,T]=u.useState(!1),[E,R]=u.useState(!1),[K,U]=u.useState(!1),A=u.useCallback(async()=>{v(!0);try{const[O,te]=await Promise.all([p2(n.id),g2(n.id)]);h(O),f(te),p(JSON.parse(JSON.stringify(te)))}catch(O){c({title:"加载配置失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}finally{v(!1)}},[n.id,c]);u.useEffect(()=>{A()},[A]),u.useEffect(()=>{R(JSON.stringify(x)!==JSON.stringify(j))},[x,j]);const Z=(O,te,he)=>{f(Ne=>({...Ne,[O]:{...Ne[O]||{},[te]:he}}))},H=async()=>{T(!0);try{await j2(n.id,x),p(JSON.parse(JSON.stringify(x))),c({title:"配置已保存",description:"更改将在插件重新加载后生效"})}catch(O){c({title:"保存失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}finally{T(!1)}},z=async()=>{try{await v2(n.id),c({title:"配置已重置",description:"下次加载插件时将使用默认配置"}),U(!1),A()}catch(O){c({title:"重置失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},B=async()=>{try{const O=await y2(n.id);c({title:O.message,description:O.note}),A()}catch(O){c({title:"切换状态失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}};if(w)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(vt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!d)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[e.jsx(Da,{className:"h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"无法加载配置"}),e.jsxs(y,{onClick:r,variant:"outline",children:[e.jsx(ti,{className:"h-4 w-4 mr-2"}),"返回"]})]});const X=Object.values(d.sections).sort((O,te)=>O.order-te.order),S=x.plugin?.enabled!==!1;return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(y,{variant:"ghost",size:"icon",onClick:r,children:e.jsx(ti,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:d.plugin_info.name||n.manifest.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(Ye,{variant:S?"default":"secondary",children:S?"已启用":"已禁用"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",d.plugin_info.version||n.manifest.version]})]})]})]}),e.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:B,children:[e.jsx(Nr,{className:"h-4 w-4 mr-2"}),S?"禁用":"启用"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>U(!0),children:[e.jsx(Wc,{className:"h-4 w-4 mr-2"}),"重置"]}),e.jsxs(y,{size:"sm",onClick:H,disabled:!E||k,children:[k?e.jsx(vt,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(br,{className:"h-4 w-4 mr-2"}),"保存"]})]})]}),E&&e.jsx(Fe,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:e.jsx(bs,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{className:"h-4 w-4 text-orange-600"}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"有未保存的更改"})]})})}),d.layout.type==="tabs"&&d.layout.tabs.length>0?e.jsxs(Kt,{defaultValue:d.layout.tabs[0]?.id,children:[e.jsx(Rt,{children:d.layout.tabs.map(O=>e.jsxs($e,{value:O.id,children:[O.title,O.badge&&e.jsx(Ye,{variant:"secondary",className:"ml-2 text-xs",children:O.badge})]},O.id))}),d.layout.tabs.map(O=>e.jsx(We,{value:O.id,className:"space-y-4 mt-4",children:O.sections.map(te=>{const he=d.sections[te];return he?e.jsx(yp,{section:he,config:x,onChange:Z},te):null})},O.id))]}):e.jsx("div",{className:"space-y-4",children:X.map(O=>e.jsx(yp,{section:O,config:x,onChange:Z},O.name))}),e.jsx(Rs,{open:K,onOpenChange:U,children:e.jsxs(zs,{children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"确认重置配置"}),e.jsx(Ys,{children:"这将删除当前配置文件,下次加载插件时将使用默认配置。此操作不可撤销。"})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>U(!1),children:"取消"}),e.jsx(y,{variant:"destructive",onClick:z,children:"确认重置"})]})]})})]})}function z2(){const{toast:n}=Hs(),[r,c]=u.useState([]),[d,h]=u.useState(!0),[x,f]=u.useState(""),[j,p]=u.useState(null),w=async()=>{h(!0);try{const E=await cr();c(E)}catch(E){n({title:"加载插件列表失败",description:E instanceof Error?E.message:"未知错误",variant:"destructive"})}finally{h(!1)}};u.useEffect(()=>{w()},[]);const v=r.filter(E=>{const R=x.toLowerCase();return E.id.toLowerCase().includes(R)||E.manifest.name.toLowerCase().includes(R)||E.manifest.description?.toLowerCase().includes(R)}),k=r.length,T=0;return j?e.jsx(Pe,{className:"h-full",children:e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx(E2,{plugin:j,onBack:()=>p(null)})})}):e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:w,children:[e.jsx(pt,{className:`h-4 w-4 mr-2 ${d?"animate-spin":""}`}),"刷新"]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"已安装插件"}),e.jsx(rn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:r.length}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d?"正在加载...":"个插件"})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"已启用"}),e.jsx(pa,{className:"h-4 w-4 text-green-600"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:k}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(js,{className:"text-sm font-medium",children:"已禁用"}),e.jsx(Da,{className:"h-4 w-4 text-orange-600"})]}),e.jsxs(bs,{children:[e.jsx("div",{className:"text-2xl font-bold",children:T}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索插件...",value:x,onChange:E=>f(E.target.value),className:"pl-9"})]}),e.jsxs(Fe,{children:[e.jsxs(gs,{children:[e.jsx(js,{children:"已安装的插件"}),e.jsx(Zs,{children:"点击插件查看和编辑配置"})]}),e.jsx(bs,{children:d?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(vt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):v.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(rn,{className:"h-16 w-16 text-muted-foreground/50"}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:x?"没有找到匹配的插件":"暂无已安装的插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x?"尝试其他搜索关键词":"前往插件市场安装插件"})]})]}):e.jsx("div",{className:"space-y-2",children:v.map(E=>e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>p(E),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(rn,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-medium truncate",children:E.manifest.name}),e.jsxs(Ye,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",E.manifest.version]})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:E.manifest.description||"暂无描述"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(y,{variant:"ghost",size:"sm",children:e.jsx(Rl,{className:"h-4 w-4"})}),e.jsx(il,{className:"h-4 w-4 text-muted-foreground"})]})]},E.id))})})]})]})})}function M2(){const n=Jt(),{toast:r}=Hs(),[c,d]=u.useState([]),[h,x]=u.useState(!0),[f,j]=u.useState(null),[p,w]=u.useState(null),[v,k]=u.useState(!1),[T,E]=u.useState(!1),[R,K]=u.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),U=u.useCallback(async()=>{try{x(!0),j(null);const S=localStorage.getItem("access-token"),O=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${S}`}});if(!O.ok)throw new Error("获取镜像源列表失败");const te=await O.json();d(te.mirrors||[])}catch(S){const O=S instanceof Error?S.message:"加载镜像源失败";j(O),r({title:"加载失败",description:O,variant:"destructive"})}finally{x(!1)}},[r]);u.useEffect(()=>{U()},[U]);const A=async()=>{try{const S=localStorage.getItem("access-token"),O=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${S}`,"Content-Type":"application/json"},body:JSON.stringify(R)});if(!O.ok){const te=await O.json();throw new Error(te.detail||"添加镜像源失败")}r({title:"添加成功",description:"镜像源已添加"}),k(!1),K({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),U()}catch(S){r({title:"添加失败",description:S instanceof Error?S.message:"未知错误",variant:"destructive"})}},Z=async()=>{if(p)try{const S=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${p.id}`,{method:"PUT",headers:{Authorization:`Bearer ${S}`,"Content-Type":"application/json"},body:JSON.stringify({name:R.name,raw_prefix:R.raw_prefix,clone_prefix:R.clone_prefix,enabled:R.enabled,priority:R.priority})})).ok)throw new Error("更新镜像源失败");r({title:"更新成功",description:"镜像源已更新"}),E(!1),w(null),U()}catch(S){r({title:"更新失败",description:S instanceof Error?S.message:"未知错误",variant:"destructive"})}},H=async S=>{if(confirm("确定要删除这个镜像源吗?"))try{const O=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${S}`,{method:"DELETE",headers:{Authorization:`Bearer ${O}`}})).ok)throw new Error("删除镜像源失败");r({title:"删除成功",description:"镜像源已删除"}),U()}catch(O){r({title:"删除失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},z=async S=>{try{const O=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${S.id}`,{method:"PUT",headers:{Authorization:`Bearer ${O}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!S.enabled})})).ok)throw new Error("更新状态失败");U()}catch(O){r({title:"更新失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},B=S=>{w(S),K({id:S.id,name:S.name,raw_prefix:S.raw_prefix,clone_prefix:S.clone_prefix,enabled:S.enabled,priority:S.priority}),E(!0)},X=async(S,O)=>{const te=O==="up"?S.priority-1:S.priority+1;if(!(te<1))try{const he=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${S.id}`,{method:"PUT",headers:{Authorization:`Bearer ${he}`,"Content-Type":"application/json"},body:JSON.stringify({priority:te})})).ok)throw new Error("更新优先级失败");U()}catch(he){r({title:"更新失败",description:he instanceof Error?he.message:"未知错误",variant:"destructive"})}};return e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>n({to:"/plugins"}),children:e.jsx(ti,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),e.jsxs(y,{onClick:()=>k(!0),children:[e.jsx(ot,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),h?e.jsx(Fe,{className:"p-6",children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(vt,{className:"h-8 w-8 animate-spin text-primary"})})}):f?e.jsx(Fe,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(ba,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:f}),e.jsx(y,{onClick:U,children:"重新加载"})]})}):e.jsxs(Fe,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ii,{children:[e.jsx(ri,{children:e.jsxs(gt,{children:[e.jsx(ls,{children:"状态"}),e.jsx(ls,{children:"名称"}),e.jsx(ls,{children:"ID"}),e.jsx(ls,{children:"优先级"}),e.jsx(ls,{className:"text-right",children:"操作"})]})}),e.jsx(ci,{children:c.map(S=>e.jsxs(gt,{children:[e.jsx(Qe,{children:e.jsx(Ve,{checked:S.enabled,onCheckedChange:()=>z(S)})}),e.jsx(Qe,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:S.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",S.raw_prefix]})]})}),e.jsx(Qe,{children:e.jsx(Ye,{variant:"outline",children:S.id})}),e.jsx(Qe,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:S.priority}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(y,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>X(S,"up"),disabled:S.priority===1,children:e.jsx(fr,{className:"h-3 w-3"})}),e.jsx(y,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>X(S,"down"),children:e.jsx(Ll,{className:"h-3 w-3"})})]})]})}),e.jsx(Qe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>B(S),children:e.jsx(nn,{className:"h-4 w-4"})}),e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>H(S.id),children:e.jsx(es,{className:"h-4 w-4 text-destructive"})})]})})]},S.id))})]})}),e.jsx("div",{className:"md:hidden p-4 space-y-4",children:c.map(S=>e.jsx(Fe,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold",children:S.name}),S.enabled&&e.jsx(Ye,{variant:"default",className:"text-xs",children:"启用"})]}),e.jsx(Ye,{variant:"outline",className:"mt-1 text-xs",children:S.id})]}),e.jsx(Ve,{checked:S.enabled,onCheckedChange:()=>z(S)})]}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Raw: "}),e.jsx("span",{className:"break-all",children:S.raw_prefix})]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"优先级: "}),e.jsx("span",{className:"font-mono",children:S.priority})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[e.jsxs(y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>B(S),children:[e.jsx(nn,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>X(S,"up"),disabled:S.priority===1,children:e.jsx(fr,{className:"h-4 w-4"})}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>X(S,"down"),children:e.jsx(Ll,{className:"h-4 w-4"})}),e.jsx(y,{variant:"destructive",size:"sm",onClick:()=>H(S.id),children:e.jsx(es,{className:"h-4 w-4"})})]})]})},S.id))})]}),e.jsx(Rs,{open:v,onOpenChange:k,children:e.jsxs(zs,{className:"max-w-lg",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"添加镜像源"}),e.jsx(Ys,{children:"添加新的 Git 镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-id",children:"镜像源 ID *"}),e.jsx(ce,{id:"add-id",placeholder:"例如: my-mirror",value:R.id,onChange:S=>K({...R,id:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-name",children:"名称 *"}),e.jsx(ce,{id:"add-name",placeholder:"例如: 我的镜像源",value:R.name,onChange:S=>K({...R,name:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),e.jsx(ce,{id:"add-raw",placeholder:"https://example.com/raw",value:R.raw_prefix,onChange:S=>K({...R,raw_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-clone",children:"克隆前缀 *"}),e.jsx(ce,{id:"add-clone",placeholder:"https://example.com/clone",value:R.clone_prefix,onChange:S=>K({...R,clone_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"add-priority",children:"优先级"}),e.jsx(ce,{id:"add-priority",type:"number",min:"1",value:R.priority,onChange:S=>K({...R,priority:parseInt(S.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"add-enabled",checked:R.enabled,onCheckedChange:S=>K({...R,enabled:S})}),e.jsx(b,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>k(!1),children:"取消"}),e.jsx(y,{onClick:A,children:"添加"})]})]})}),e.jsx(Rs,{open:T,onOpenChange:E,children:e.jsxs(zs,{className:"max-w-lg",children:[e.jsxs(Ms,{children:[e.jsx(As,{children:"编辑镜像源"}),e.jsx(Ys,{children:"修改镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{children:"镜像源 ID"}),e.jsx(ce,{value:R.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-name",children:"名称 *"}),e.jsx(ce,{id:"edit-name",value:R.name,onChange:S=>K({...R,name:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),e.jsx(ce,{id:"edit-raw",value:R.raw_prefix,onChange:S=>K({...R,raw_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-clone",children:"克隆前缀 *"}),e.jsx(ce,{id:"edit-clone",value:R.clone_prefix,onChange:S=>K({...R,clone_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{htmlFor:"edit-priority",children:"优先级"}),e.jsx(ce,{id:"edit-priority",type:"number",min:"1",value:R.priority,onChange:S=>K({...R,priority:parseInt(S.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"edit-enabled",checked:R.enabled,onCheckedChange:S=>K({...R,enabled:S})}),e.jsx(b,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),e.jsxs(Js,{children:[e.jsx(y,{variant:"outline",onClick:()=>E(!1),children:"取消"}),e.jsx(y,{onClick:Z,children:"保存"})]})]})})]})})}const Ic=u.forwardRef(({className:n,...r},c)=>e.jsx(Bp,{ref:c,className:Q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...r}));Ic.displayName=Bp.displayName;const A2=u.forwardRef(({className:n,...r},c)=>e.jsx(Hp,{ref:c,className:Q("aspect-square h-full w-full",n),...r}));A2.displayName=Hp.displayName;const Pc=u.forwardRef(({className:n,...r},c)=>e.jsx(qp,{ref:c,className:Q("flex h-full w-full items-center justify-center rounded-full bg-muted",n),...r}));Pc.displayName=qp.displayName;function D2(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function O2(){const n="maibot_webui_user_id";let r=localStorage.getItem(n);return r||(r=D2(),localStorage.setItem(n,r)),r}function R2(){return localStorage.getItem("maibot_webui_user_name")||"WebUI用户"}function L2(n){localStorage.setItem("maibot_webui_user_name",n)}function U2(){const[n,r]=u.useState([]),[c,d]=u.useState(""),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!0),[T,E]=u.useState(R2()),[R,K]=u.useState(!1),[U,A]=u.useState(""),[Z,H]=u.useState({}),z=u.useRef(O2()),B=u.useRef(null),X=u.useRef(null),S=u.useRef(null),O=u.useRef(0),te=u.useRef(new Set),{toast:he}=Hs(),Ne=$=>(O.current+=1,`${$}-${Date.now()}-${O.current}-${Math.random().toString(36).substr(2,9)}`),ye=u.useCallback(()=>{X.current?.scrollIntoView({behavior:"smooth"})},[]);u.useEffect(()=>{ye()},[n,ye]);const pe=u.useCallback(async()=>{k(!0);try{const $=`/api/chat/history?user_id=${z.current}&limit=50`;console.log("[Chat] 正在加载历史消息:",$);const de=await fetch($);if(console.log("[Chat] 历史消息响应状态:",de.status,de.statusText),console.log("[Chat] 响应 Content-Type:",de.headers.get("content-type")),de.ok){const ge=await de.text();console.log("[Chat] 响应内容前100字符:",ge.substring(0,100));try{const le=JSON.parse(ge);if(console.log("[Chat] 解析后的数据:",le),le.messages&&le.messages.length>0){const L=le.messages.map(F=>({id:F.id,type:F.type,content:F.content,timestamp:F.timestamp,sender:{name:F.sender_name||(F.is_bot?"麦麦":"WebUI用户"),user_id:F.user_id,is_bot:F.is_bot}}));r(L),console.log("[Chat] 已加载历史消息数量:",L.length),L.forEach(F=>{if(F.type==="bot"){const D=`bot-${F.content}-${Math.floor(F.timestamp*1e3)}`;te.current.add(D)}})}else console.log("[Chat] 没有历史消息")}catch(le){console.error("[Chat] JSON 解析失败:",le),console.error("[Chat] 原始响应内容:",ge)}}else{console.error("[Chat] 响应失败:",de.status);const ge=await de.text();console.error("[Chat] 错误响应内容:",ge.substring(0,200))}}catch($){console.error("[Chat] 加载历史消息失败:",$)}finally{k(!1)}},[]),je=u.useCallback(()=>{if(B.current?.readyState===WebSocket.OPEN||B.current?.readyState===WebSocket.CONNECTING){console.log("WebSocket 已存在,跳过连接");return}j(!0);const de=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws?user_id=${encodeURIComponent(z.current)}&user_name=${encodeURIComponent(T)}`;console.log("正在连接 WebSocket:",de);try{const ge=new WebSocket(de);B.current=ge,ge.onopen=()=>{x(!0),j(!1),console.log("WebSocket 已连接")},ge.onmessage=le=>{try{const L=JSON.parse(le.data);switch(L.type){case"session_info":H({session_id:L.session_id,user_id:L.user_id,user_name:L.user_name,bot_name:L.bot_name});break;case"system":r(F=>[...F,{id:Ne("sys"),type:"system",content:L.content||"",timestamp:L.timestamp||Date.now()/1e3}]);break;case"user_message":r(F=>[...F,{id:L.message_id||Ne("user"),type:"user",content:L.content||"",timestamp:L.timestamp||Date.now()/1e3,sender:L.sender}]);break;case"bot_message":{w(!1);const F=`bot-${L.content}-${Math.floor((L.timestamp||0)*1e3)}`;if(te.current.has(F)){console.log("跳过重复的机器人消息");break}if(te.current.add(F),te.current.size>100){const D=te.current.values().next().value;D&&te.current.delete(D)}r(D=>[...D,{id:Ne("bot"),type:"bot",content:L.content||"",timestamp:L.timestamp||Date.now()/1e3,sender:L.sender}]);break}case"typing":w(L.is_typing||!1);break;case"error":r(F=>[...F,{id:Ne("error"),type:"error",content:L.content||"发生错误",timestamp:L.timestamp||Date.now()/1e3}]),he({title:"错误",description:L.content,variant:"destructive"});break;case"pong":break;default:console.log("未知消息类型:",L.type)}}catch(L){console.error("解析消息失败:",L)}},ge.onclose=()=>{x(!1),j(!1),B.current=null,console.log("WebSocket 已断开"),S.current&&clearTimeout(S.current),S.current=window.setTimeout(()=>{_e.current||je()},5e3)},ge.onerror=le=>{console.error("WebSocket 错误:",le),j(!1)}}catch(ge){console.error("创建 WebSocket 失败:",ge),j(!1)}},[he,T]),_e=u.useRef(!1);u.useEffect(()=>{_e.current=!1,pe();const $=setTimeout(()=>{_e.current||je()},100),de=setInterval(()=>{B.current?.readyState===WebSocket.OPEN&&B.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>{_e.current=!0,clearTimeout($),clearInterval(de),S.current&&(clearTimeout(S.current),S.current=null),B.current&&(B.current.close(),B.current=null)}},[je,pe]);const N=u.useCallback(()=>{!c.trim()||!B.current||B.current.readyState!==WebSocket.OPEN||(B.current.send(JSON.stringify({type:"message",content:c.trim(),user_name:T})),d(""))},[c,T]),G=$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),N())},q=()=>{A(T),K(!0)},ie=()=>{const $=U.trim()||"WebUI用户";E($),L2($),K(!1),B.current?.readyState===WebSocket.OPEN&&B.current.send(JSON.stringify({type:"update_nickname",user_name:$}))},_=()=>{A(""),K(!1)},me=$=>new Date($*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),xe=()=>{B.current&&B.current.close(),je()};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("div",{className:"shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx(Ic,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:e.jsx(Pc,{className:"bg-primary/10 text-primary",children:e.jsx(ir,{className:"h-4 w-4 sm:h-5 sm:w-5"})})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-base sm:text-lg font-semibold truncate",children:Z.bot_name||"麦麦"}),e.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:h?e.jsxs(e.Fragment,{children:[e.jsx(QN,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"已连接"})]}):f?e.jsxs(e.Fragment,{children:[e.jsx(vt,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"连接中..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(YN,{className:"h-3 w-3 text-red-500"}),e.jsx("span",{className:"text-red-600 dark:text-red-400",children:"未连接"})]})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v&&e.jsx(vt,{className:"h-4 w-4 animate-spin text-muted-foreground"}),e.jsx(y,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:xe,disabled:f,title:"重新连接",children:e.jsx(pt,{className:Q("h-4 w-4",f&&"animate-spin")})})]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:[e.jsx(to,{className:"h-3 w-3"}),e.jsx("span",{children:"当前身份:"}),R?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{value:U,onChange:$=>A($.target.value),onKeyDown:$=>{$.key==="Enter"&&ie(),$.key==="Escape"&&_()},className:"h-7 w-32",placeholder:"输入昵称",autoFocus:!0}),e.jsx(y,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:ie,children:"保存"}),e.jsx(y,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:_,children:"取消"})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium text-foreground",children:T}),e.jsx(y,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:q,title:"修改昵称",children:e.jsx(XN,{className:"h-3 w-3"})})]})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Pe,{className:"h-full",children:e.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto space-y-3 sm:space-y-4",children:[n.length===0&&!v&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(ir,{className:"h-12 w-12 mb-4 opacity-50"}),e.jsxs("p",{className:"text-sm",children:["开始与 ",Z.bot_name||"麦麦"," 对话吧!"]})]}),n.map($=>e.jsxs("div",{className:Q("flex gap-2 sm:gap-3",$.type==="user"&&"flex-row-reverse",$.type==="system"&&"justify-center",$.type==="error"&&"justify-center"),children:[$.type==="system"&&e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-3 py-1 rounded-full max-w-[90%]",children:$.content}),$.type==="error"&&e.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-100 dark:bg-red-900/30 px-3 py-1 rounded-full max-w-[90%]",children:$.content}),($.type==="user"||$.type==="bot")&&e.jsxs(e.Fragment,{children:[e.jsx(Ic,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pc,{className:Q("text-xs",$.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:$.type==="bot"?e.jsx(ir,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):e.jsx(to,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:Q("flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",$.type==="user"&&"items-end"),children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] sm:text-xs text-muted-foreground",children:[e.jsx("span",{className:"hidden sm:inline",children:$.sender?.name||($.type==="bot"?Z.bot_name:T)}),e.jsx("span",{children:me($.timestamp)})]}),e.jsx("div",{className:Q("rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",$.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:$.content})]})]})]},$.id)),p&&e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsx(Ic,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pc,{className:"bg-primary/10 text-primary",children:e.jsx(ir,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),e.jsx("div",{ref:X})]})})}),e.jsx("div",{className:"shrink-0 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsx("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:c,onChange:$=>d($.target.value),onKeyDown:G,placeholder:h?"输入消息...":"等待连接...",disabled:!h,className:"flex-1 h-10 sm:h-10"}),e.jsx(y,{onClick:N,disabled:!h||!c.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:e.jsx(KN,{className:"h-4 w-4"})})]})})})]})}function B2(){const n=Jt(),[r,c]=u.useState(!0);return u.useEffect(()=>{let d=!1;return(async()=>{try{const x=await Ju();!d&&!x&&n({to:"/auth"})}catch{d||n({to:"/auth"})}finally{d||c(!1)}})(),()=>{d=!0}},[n]),{checking:r}}async function H2(){return await Ju()}const q2=ai("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),Xg=u.forwardRef(({className:n,size:r,abbrTitle:c,children:d,...h},x)=>e.jsx("kbd",{className:Q(q2({size:r,className:n})),ref:x,...h,children:c?e.jsx("abbr",{title:c,children:d}):d}));Xg.displayName="Kbd";const G2=[{icon:xr,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Aa,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:Ng,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:bg,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:$u,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:si,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:wg,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:ZN,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:rn,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:ao,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Rl,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function V2({open:n,onOpenChange:r}){const[c,d]=u.useState(""),[h,x]=u.useState(0),f=Jt(),j=G2.filter(v=>v.title.toLowerCase().includes(c.toLowerCase())||v.description.toLowerCase().includes(c.toLowerCase())||v.category.toLowerCase().includes(c.toLowerCase()));u.useEffect(()=>{n&&(d(""),x(0))},[n]);const p=u.useCallback(v=>{f({to:v}),r(!1)},[f,r]),w=u.useCallback(v=>{v.key==="ArrowDown"?(v.preventDefault(),x(k=>(k+1)%j.length)):v.key==="ArrowUp"?(v.preventDefault(),x(k=>(k-1+j.length)%j.length)):v.key==="Enter"&&j[h]&&(v.preventDefault(),p(j[h].path))},[j,h,p]);return e.jsx(Rs,{open:n,onOpenChange:r,children:e.jsxs(zs,{className:"max-w-2xl p-0 gap-0",children:[e.jsxs(Ms,{className:"px-4 pt-4 pb-0",children:[e.jsx(As,{className:"sr-only",children:"搜索"}),e.jsxs("div",{className:"relative",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(ce,{value:c,onChange:v=>{d(v.target.value),x(0)},onKeyDown:w,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),e.jsx("div",{className:"border-t",children:e.jsx(Pe,{className:"h-[400px]",children:j.length>0?e.jsx("div",{className:"p-2",children:j.map((v,k)=>{const T=v.icon;return e.jsxs("button",{onClick:()=>p(v.path),onMouseEnter:()=>x(k),className:Q("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",k===h?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[e.jsx(T,{className:"h-5 w-5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm",children:v.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:v.description})]}),e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:v.category})]},v.path)})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(_t,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),e.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}const F2=Ky,$2=Zy,Q2=Jy,Kg=u.forwardRef(({className:n,inset:r,children:c,...d},h)=>e.jsxs(Gp,{ref:h,className:Q("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",r&&"pl-8",n),...d,children:[c,e.jsx(il,{className:"ml-auto h-4 w-4"})]}));Kg.displayName=Gp.displayName;const Zg=u.forwardRef(({className:n,...r},c)=>e.jsx(Vp,{ref:c,className:Q("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 origin-[--radix-context-menu-content-transform-origin]",n),...r}));Zg.displayName=Vp.displayName;const Jg=u.forwardRef(({className:n,...r},c)=>e.jsx(Xy,{children:e.jsx(Fp,{ref:c,className:Q("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-context-menu-content-transform-origin]",n),...r})}));Jg.displayName=Fp.displayName;const Na=u.forwardRef(({className:n,inset:r,...c},d)=>e.jsx($p,{ref:d,className:Q("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",r&&"pl-8",n),...c}));Na.displayName=$p.displayName;const Y2=u.forwardRef(({className:n,children:r,checked:c,...d},h)=>e.jsxs(Qp,{ref:h,className:Q("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",n),checked:c,...d,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Yp,{children:e.jsx(fa,{className:"h-4 w-4"})})}),r]}));Y2.displayName=Qp.displayName;const X2=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(Xp,{ref:d,className:Q("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",n),...c,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Yp,{children:e.jsx(JN,{className:"h-2 w-2 fill-current"})})}),r]}));X2.displayName=Xp.displayName;const K2=u.forwardRef(({className:n,inset:r,...c},d)=>e.jsx(Kp,{ref:d,className:Q("px-2 py-1.5 text-sm font-semibold text-foreground",r&&"pl-8",n),...c}));K2.displayName=Kp.displayName;const or=u.forwardRef(({className:n,...r},c)=>e.jsx(Zp,{ref:c,className:Q("-mx-1 my-1 h-px bg-border",n),...r}));or.displayName=Zp.displayName;const In=({className:n,...r})=>e.jsx("span",{className:Q("ml-auto text-xs tracking-widest text-muted-foreground",n),...r});In.displayName="ContextMenuShortcut";const Z2=jN,J2=vN,I2=yN,Ig=u.forwardRef(({className:n,sideOffset:r=4,...c},d)=>e.jsx(gN,{children:e.jsx(dg,{ref:d,sideOffset:r,className:Q("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 origin-[--radix-tooltip-content-transform-origin]",n),...c})}));Ig.displayName=dg.displayName;function P2({children:n}){const{checking:r}=B2(),[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),{theme:p,setTheme:w}=Yu(),v=gy(),k=Jt();if(u.useEffect(()=>{const U=A=>{(A.metaKey||A.ctrlKey)&&A.key==="k"&&(A.preventDefault(),j(!0))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]),r)return e.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:e.jsx("div",{className:"text-muted-foreground",children:"正在验证登录状态..."})});const T=[{title:"概览",items:[{icon:xr,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Aa,label:"麦麦主程序配置",path:"/config/bot"},{icon:Ng,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:bg,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:Zf,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:$u,label:"表情包管理",path:"/resource/emoji"},{icon:si,label:"表达方式管理",path:"/resource/expression"},{icon:wg,label:"人物信息管理",path:"/resource/person"},{icon:yg,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:rn,label:"插件市场",path:"/plugins"},{icon:Zf,label:"插件配置",path:"/plugin-config"},{icon:ao,label:"日志查看器",path:"/logs"},{icon:si,label:"本地聊天室",path:"/chat"}]},{title:"系统",items:[{icon:Rl,label:"系统设置",path:"/settings"}]}],R=p==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":p,K=async()=>{await y0()};return e.jsx(Z2,{delayDuration:300,children:e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsxs("aside",{className:Q("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",c?"lg:w-64":"lg:w-16",h?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[e.jsx("div",{className:"flex h-16 items-center border-b px-4",children:e.jsxs("div",{className:Q("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!c&&"lg:flex-none lg:w-8"),children:[e.jsxs("div",{className:Q("flex items-baseline gap-2",!c&&"lg:hidden"),children:[e.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),e.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:l0()})]}),!c&&e.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),e.jsx(Pe,{className:Q("flex-1 overflow-x-hidden",!c&&"lg:w-16"),children:e.jsx("nav",{className:Q("p-4",!c&&"lg:p-2 lg:w-16"),children:e.jsx("ul",{className:Q("space-y-6",!c&&"lg:space-y-3 lg:w-full"),children:T.map((U,A)=>e.jsxs("li",{children:[e.jsx("div",{className:Q("px-3 h-[1.25rem]","mb-2",!c&&"lg:mb-1 lg:invisible"),children:e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:U.title})}),!c&&A>0&&e.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),e.jsx("ul",{className:"space-y-1",children:U.items.map(Z=>{const H=v({to:Z.path}),z=Z.icon,B=e.jsxs(e.Fragment,{children:[H&&e.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),e.jsxs("div",{className:Q("flex items-center transition-all duration-300",c?"gap-3":"gap-3 lg:gap-0"),children:[e.jsx(z,{className:Q("h-5 w-5 flex-shrink-0",H&&"text-primary"),strokeWidth:2,fill:"none"}),e.jsx("span",{className:Q("text-sm font-medium whitespace-nowrap transition-all duration-300",H&&"font-semibold",c?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:Z.label})]})]});return e.jsx("li",{className:"relative",children:e.jsxs(J2,{children:[e.jsx(I2,{asChild:!0,children:e.jsx(Kc,{to:Z.path,"data-tour":Z.tourId,className:Q("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",H?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",c?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>x(!1),children:B})}),!c&&e.jsx(Ig,{side:"right",className:"hidden lg:block",children:e.jsx("p",{children:Z.label})})]})},Z.path)})})]},U.title))})})})]}),h&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>x(!1)}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:()=>x(!h),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:e.jsx(IN,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>d(!c),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:c?"收起侧边栏":"展开侧边栏",children:e.jsx(cn,{className:Q("h-5 w-5 transition-transform",!c&&"rotate-180")})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>j(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[e.jsx(_t,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),e.jsxs(Xg,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[e.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsx(V2,{open:f,onOpenChange:j}),e.jsxs(y,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[e.jsx(PN,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),e.jsx("button",{onClick:U=>{Wb(R==="dark"?"light":"dark",w,U)},className:"rounded-lg p-2 hover:bg-accent",title:R==="dark"?"切换到浅色模式":"切换到深色模式",children:R==="dark"?e.jsx(Ou,{className:"h-5 w-5"}):e.jsx(Ru,{className:"h-5 w-5"})}),e.jsx("div",{className:"h-6 w-px bg-border"}),e.jsxs(y,{variant:"ghost",size:"sm",onClick:K,className:"gap-2",title:"登出系统",children:[e.jsx(Jf,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),e.jsxs(F2,{children:[e.jsx($2,{asChild:!0,children:e.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:n})}),e.jsxs(Jg,{className:"w-64",children:[e.jsxs(Na,{onClick:()=>k({to:"/"}),children:[e.jsx(xr,{className:"mr-2 h-4 w-4"}),"首页"]}),e.jsxs(Na,{onClick:()=>k({to:"/settings"}),children:[e.jsx(Rl,{className:"mr-2 h-4 w-4"}),"系统设置"]}),e.jsxs(Na,{onClick:()=>k({to:"/logs"}),children:[e.jsx(ao,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),e.jsx(or,{}),e.jsxs(Q2,{children:[e.jsxs(Kg,{children:[e.jsx(gg,{className:"mr-2 h-4 w-4"}),"切换主题"]}),e.jsxs(Zg,{className:"w-48",children:[e.jsxs(Na,{onClick:()=>w("light"),disabled:p==="light",children:[e.jsx(Ou,{className:"mr-2 h-4 w-4"}),"浅色",p==="light"&&e.jsx(In,{children:"✓"})]}),e.jsxs(Na,{onClick:()=>w("dark"),disabled:p==="dark",children:[e.jsx(Ru,{className:"mr-2 h-4 w-4"}),"深色",p==="dark"&&e.jsx(In,{children:"✓"})]}),e.jsxs(Na,{onClick:()=>w("system"),disabled:p==="system",children:[e.jsx(Rl,{className:"mr-2 h-4 w-4"}),"跟随系统",p==="system"&&e.jsx(In,{children:"✓"})]})]})]}),e.jsx(or,{}),e.jsxs(Na,{onClick:()=>window.location.reload(),children:[e.jsx(WN,{className:"mr-2 h-4 w-4"}),"刷新页面",e.jsx(In,{children:"⌘R"})]}),e.jsxs(Na,{onClick:()=>j(!0),children:[e.jsx(_t,{className:"mr-2 h-4 w-4"}),"搜索",e.jsx(In,{children:"⌘K"})]}),e.jsx(or,{}),e.jsxs(Na,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[e.jsx(dr,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),e.jsx(or,{}),e.jsxs(Na,{onClick:K,className:"text-destructive focus:text-destructive",children:[e.jsx(Jf,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}function W2(n){const r=n.split(` -`).slice(1),c=[];for(const d of r){const h=d.trim();if(!h.startsWith("at "))continue;const x=h.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);x?c.push({functionName:x[1]||"",fileName:x[2],lineNumber:x[3],columnNumber:x[4],raw:h}):c.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:h})}return c}function e_({error:n,errorInfo:r}){const[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),p=n.stack?W2(n.stack):[],w=async()=>{const v=` -Error: ${n.name} -Message: ${n.message} - -Stack Trace: -${n.stack||"No stack trace available"} - -Component Stack: -${r?.componentStack||"No component stack available"} - -URL: ${window.location.href} -User Agent: ${navigator.userAgent} -Time: ${new Date().toISOString()} - `.trim();try{await navigator.clipboard.writeText(v),j(!0),setTimeout(()=>j(!1),2e3)}catch(k){console.error("Failed to copy:",k)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(ha,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[e.jsx(ba,{className:"h-4 w-4"}),e.jsxs(xa,{className:"font-mono text-sm",children:[e.jsxs("span",{className:"font-semibold",children:[n.name,":"]})," ",n.message]})]}),p.length>0&&e.jsxs(Gu,{open:c,onOpenChange:d,children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(y,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(eb,{className:"h-4 w-4"}),"Stack Trace (",p.length," frames)"]}),c?e.jsx(fr,{className:"h-4 w-4"}):e.jsx(Ll,{className:"h-4 w-4"})]})}),e.jsx(Fu,{children:e.jsx(Pe,{className:"h-[280px] rounded-md border bg-muted/30",children:e.jsx("div",{className:"p-3 space-y-1",children:p.map((v,k)=>e.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[k+1,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-primary font-medium",children:v.functionName}),v.fileName&&e.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[v.fileName,v.lineNumber&&e.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",v.lineNumber,":",v.columnNumber]})]})]})]})},k))})})})]}),r?.componentStack&&e.jsxs(Gu,{open:h,onOpenChange:x,children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(y,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(ba,{className:"h-4 w-4"}),"Component Stack"]}),h?e.jsx(fr,{className:"h-4 w-4"}):e.jsx(Ll,{className:"h-4 w-4"})]})}),e.jsx(Fu,{children:e.jsx(Pe,{className:"h-[200px] rounded-md border bg-muted/30",children:e.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:r.componentStack})})})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:w,className:"w-full",children:f?e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):e.jsxs(e.Fragment,{children:[e.jsx(so,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function Pg({error:n,errorInfo:r}){const c=()=>{window.location.href="/"},d=()=>{window.location.reload()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(Fe,{className:"w-full max-w-2xl shadow-lg",children:[e.jsxs(gs,{className:"text-center pb-2",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:e.jsx(ba,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),e.jsx(js,{className:"text-2xl font-bold",children:"页面出现了问题"}),e.jsx(Zs,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),e.jsxs(bs,{className:"space-y-4",children:[e.jsx(e_,{error:n,errorInfo:r}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[e.jsxs(y,{onClick:d,className:"flex-1",children:[e.jsx(pt,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),e.jsxs(y,{onClick:c,variant:"outline",className:"flex-1",children:[e.jsx(xr,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class s_ extends u.Component{constructor(r){super(r),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,c){console.error("ErrorBoundary caught an error:",r,c),this.setState({errorInfo:c})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:e.jsx(Pg,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function Wg({error:n}){return e.jsx(Pg,{error:n,errorInfo:null})}const kr=jy({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(Np,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!H2())throw yy({to:"/auth"})}}),t_=lt({getParentRoute:()=>kr,path:"/auth",component:N0}),a_=lt({getParentRoute:()=>kr,path:"/setup",component:B0}),Nt=lt({getParentRoute:()=>kr,id:"protected",component:()=>e.jsx(P2,{children:e.jsx(Np,{})}),errorComponent:({error:n})=>e.jsx(Wg,{error:n})}),l_=lt({getParentRoute:()=>Nt,path:"/",component:Ib}),n_=lt({getParentRoute:()=>Nt,path:"/config/bot",component:I0}),i_=lt({getParentRoute:()=>Nt,path:"/config/modelProvider",component:Nw}),r_=lt({getParentRoute:()=>Nt,path:"/config/model",component:Sw}),c_=lt({getParentRoute:()=>Nt,path:"/config/adapter",component:kw}),o_=lt({getParentRoute:()=>Nt,path:"/resource/emoji",component:Kw}),d_=lt({getParentRoute:()=>Nt,path:"/resource/expression",component:i1}),u_=lt({getParentRoute:()=>Nt,path:"/resource/person",component:g1}),m_=lt({getParentRoute:()=>Nt,path:"/resource/knowledge-graph",component:C1}),h_=lt({getParentRoute:()=>Nt,path:"/logs",component:a2}),x_=lt({getParentRoute:()=>Nt,path:"/chat",component:U2}),f_=lt({getParentRoute:()=>Nt,path:"/plugins",component:k2}),p_=lt({getParentRoute:()=>Nt,path:"/plugin-config",component:z2}),g_=lt({getParentRoute:()=>Nt,path:"/plugin-mirrors",component:M2}),j_=lt({getParentRoute:()=>Nt,path:"/settings",component:x0}),v_=lt({getParentRoute:()=>kr,path:"*",component:Rg}),y_=kr.addChildren([t_,a_,Nt.addChildren([l_,n_,i_,r_,c_,o_,d_,u_,m_,f_,p_,g_,h_,x_,j_]),v_]),N_=vy({routeTree:y_,defaultNotFoundComponent:Rg,defaultErrorComponent:({error:n})=>e.jsx(Wg,{error:n})});function b_({children:n,defaultTheme:r="system",storageKey:c="ui-theme",...d}){const[h,x]=u.useState(()=>localStorage.getItem(c)||r);u.useEffect(()=>{const j=window.document.documentElement;if(j.classList.remove("light","dark"),h==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";j.classList.add(p);return}j.classList.add(h)},[h]),u.useEffect(()=>{const j=localStorage.getItem("accent-color");if(j){const p=document.documentElement,v={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[j];v&&(p.style.setProperty("--primary",v.hsl),v.gradient?(p.style.setProperty("--primary-gradient",v.gradient),p.classList.add("has-gradient")):(p.style.removeProperty("--primary-gradient"),p.classList.remove("has-gradient")))}},[]);const f={theme:h,setTheme:j=>{localStorage.setItem(c,j),x(j)}};return e.jsx(Eg.Provider,{...d,value:f,children:n})}function w_({children:n,defaultEnabled:r=!0,defaultWavesEnabled:c=!0,storageKey:d="enable-animations",wavesStorageKey:h="enable-waves-background"}){const[x,f]=u.useState(()=>{const v=localStorage.getItem(d);return v!==null?v==="true":r}),[j,p]=u.useState(()=>{const v=localStorage.getItem(h);return v!==null?v==="true":c});u.useEffect(()=>{const v=document.documentElement;x?v.classList.remove("no-animations"):v.classList.add("no-animations"),localStorage.setItem(d,String(x))},[x,d]),u.useEffect(()=>{localStorage.setItem(h,String(j))},[j,h]);const w={enableAnimations:x,setEnableAnimations:f,enableWavesBackground:j,setEnableWavesBackground:p};return e.jsx(zg.Provider,{value:w,children:n})}const __=NN,ej=u.forwardRef(({className:n,...r},c)=>e.jsx(ug,{ref:c,className:Q("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",n),...r}));ej.displayName=ug.displayName;const S_=ai("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),sj=u.forwardRef(({className:n,variant:r,...c},d)=>e.jsx(mg,{ref:d,className:Q(S_({variant:r}),n),...c}));sj.displayName=mg.displayName;const C_=u.forwardRef(({className:n,...r},c)=>e.jsx(hg,{ref:c,className:Q("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...r}));C_.displayName=hg.displayName;const tj=u.forwardRef(({className:n,...r},c)=>e.jsx(xg,{ref:c,className:Q("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...r,children:e.jsx(li,{className:"h-4 w-4"})}));tj.displayName=xg.displayName;const aj=u.forwardRef(({className:n,...r},c)=>e.jsx(fg,{ref:c,className:Q("text-sm font-semibold [&+div]:text-xs",n),...r}));aj.displayName=fg.displayName;const lj=u.forwardRef(({className:n,...r},c)=>e.jsx(pg,{ref:c,className:Q("text-sm opacity-90",n),...r}));lj.displayName=pg.displayName;function k_(){const{toasts:n}=Hs();return e.jsxs(__,{children:[n.map(function({id:r,title:c,description:d,action:h,...x}){return e.jsxs(sj,{...x,children:[e.jsxs("div",{className:"grid gap-1",children:[c&&e.jsx(aj,{children:c}),d&&e.jsx(lj,{children:d})]}),h,e.jsx(tj,{})]},r)}),e.jsx(ej,{})]})}Hb.createRoot(document.getElementById("root")).render(e.jsx(u.StrictMode,{children:e.jsx(s_,{children:e.jsx(b_,{defaultTheme:"system",children:e.jsx(w_,{children:e.jsxs(pw,{children:[e.jsx(Ny,{router:N_}),e.jsx(vw,{}),e.jsx(k_,{})]})})})})})); diff --git a/webui/dist/assets/index-CUrrfy9B.css b/webui/dist/assets/index-CUrrfy9B.css deleted file mode 100644 index 3696bf9e..00000000 --- a/webui/dist/assets/index-CUrrfy9B.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-full{max-height:100%}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[1px\]{width:1px}.w-\[65px\]{width:65px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-32{max-width:8rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[75\%\]{max-width:75%}.max-w-\[90\%\]{max-width:90%}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-sm{border-top-right-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-muted-foreground\/50{border-color:hsl(var(--muted-foreground) / .5)}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500\/50{border-color:#eab30880}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/50{background-color:hsl(var(--muted-foreground) / .5)}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/5{background-color:#eab3080d}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.__floater{z-index:99999!important;pointer-events:auto!important}.react-joyride__overlay,.react-joyride__spotlight{z-index:99998!important}.react-joyride__tooltip{pointer-events:auto!important}#tour-portal-container *{pointer-events:auto}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-muted-foreground\/50:hover{border-color:hsl(var(--muted-foreground) / .5)}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-yellow-300:hover{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.hover\:text-yellow-800:hover{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:cursor-grabbing:active{cursor:grabbing}.active\:border-primary\/70:active{border-color:hsl(var(--primary) / .7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fade-out[data-state=closed]{animation:fade-out .15s ease-in}.data-\[state\=closed\]\:animate-slide-out-to-right[data-state=closed]{animation:slide-out-to-right .2s ease-in}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fade-in[data-state=open]{animation:fade-in .2s ease-out}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.data-\[state\=open\]\:animate-slide-in-from-right[data-state=open]{animation:slide-in-from-right .3s ease-out}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}.data-\[swipe\=end\]\:animate-slide-out-to-right[data-swipe=end]{animation:slide-out-to-right .2s ease-in}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}@supports (backdrop-filter: var(--tw)){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background) / .6)}}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-orange-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(124 45 18 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-green-950\/20:is(.dark *){background-color:#052e1633}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-yellow-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-0{margin-left:0}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-8{height:2rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-8{width:2rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:min-w-\[120px\]{min-width:120px}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[420px\]{max-width:420px}.sm\:max-w-\[70\%\]{max-width:70%}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pb-4{padding-bottom:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-4{margin-bottom:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-5{height:1.25rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-5{width:1.25rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:gap-4{gap:1rem}.md\:gap-6{gap:1.5rem}.md\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:whitespace-normal{white-space:normal}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-auto{margin-left:auto;margin-right:auto}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-12{width:3rem}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[130px\]{width:130px}.lg\:w-\[160px\]{width:160px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[75px\]{width:75px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-2{padding:.5rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:pb-6{padding-bottom:1.5rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:opacity-0{opacity:0}}@media(min-width:1280px){.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}.uppy-Root{box-sizing:border-box;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1;position:relative;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.uppy-Root[dir=rtl],[dir=rtl] .uppy-Root{text-align:right}.uppy-Root *,.uppy-Root :after,.uppy-Root :before{box-sizing:inherit}.uppy-Root [hidden]{display:none}.uppy-u-reset{all:initial;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1}[dir=rtl] .uppy-u-reset{text-align:right}.uppy-c-textInput{background-color:#fff;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;padding:6px 8px}.uppy-size--md .uppy-c-textInput{padding:8px 10px}.uppy-c-textInput:focus{border-color:#1269cf99;box-shadow:0 0 0 3px #1269cf26;outline:none}[data-uppy-theme=dark] .uppy-c-textInput{background-color:#333;border-color:#333;color:#eaeaea}[data-uppy-theme=dark] .uppy-c-textInput:focus{border-color:#525252;box-shadow:none}.uppy-c-icon{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;fill:currentColor}.uppy-c-btn{align-items:center;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-weight:500;justify-content:center;line-height:1;transition-duration:.3s;transition-property:background-color,color;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.uppy-c-btn,[dir=rtl] .uppy-c-btn{text-align:center}.uppy-c-btn:not(:disabled):not(.disabled){cursor:pointer}.uppy-c-btn::-moz-focus-inner{border:0}.uppy-c-btn-primary{background-color:#1269cf;border-radius:4px;color:#fff;font-size:14px;padding:10px 18px}.uppy-c-btn-primary:not(:disabled):hover{background-color:#0e51a0}.uppy-c-btn-primary:focus{box-shadow:0 0 0 3px #1269cf66;outline:none}.uppy-size--md .uppy-c-btn-primary{padding:13px 22px}[data-uppy-theme=dark] .uppy-c-btn-primary{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-primary::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-c-btn-primary.uppy-c-btn--disabled{background-color:#8eb2db}.uppy-c-btn-link{background-color:initial;border-radius:4px;color:#525252;font-size:14px;line-height:1;padding:10px 15px}.uppy-c-btn-link:hover{color:#333}.uppy-c-btn-link:focus{box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-size--md .uppy-c-btn-link{padding:13px 18px}[data-uppy-theme=dark] .uppy-c-btn-link{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-link:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-link::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-link:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-c-btn-link:hover{color:#939393}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:6px}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list:after,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list:after{content:"";flex:auto}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{margin:0;position:relative;width:50%}.uppy-size--md .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--md .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:33.3333%}.uppy-size--lg .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--lg .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:25%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem:before,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem:before{content:"";display:block;padding-top:100%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected svg{opacity:.85}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--disabled,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--disabled{opacity:.5}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#93939333}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#eaeaea33}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{height:30%;width:30%;fill:#000000b3}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{fill:#fffc}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{border-radius:4px;height:calc(100% - 14px);inset:7px;overflow:hidden;position:absolute;text-align:center;width:calc(100% - 14px)}@media(hover:none){.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author{display:block}}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{box-shadow:0 0 0 3px #aae1ffb3}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner img{border-radius:4px;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author{background:#0000004d;bottom:0;color:#fff;display:none;font-size:12px;font-weight:500;left:0;margin:0;padding:5px;position:absolute;text-decoration:none;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author:hover,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author:hover{background:#0006;text-decoration:underline}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-radius:50%;height:26px;opacity:0;position:absolute;right:16px;top:16px;width:26px;z-index:1002}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox:after{height:7px;inset-inline-start:7px;top:8px;width:12px}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{opacity:1}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author{display:block}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus{outline:none}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner{border:0}.uppy-ProviderBrowser-viewType--list{background-color:#fff}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list{background-color:#1f1f1f}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{align-items:center;display:flex;margin:0;padding:7px 15px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{color:#eaeaea}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem--disabled{opacity:.6}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox{background-color:#fff;border:1px solid #cfcfcf;border-radius:3px;height:17px;margin-inline-end:15px;width:17px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border:1px solid #1269cf;box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:after{height:5px;inset-inline-start:3px;opacity:0;top:4px;width:9px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border-color:#02baf2b3;box-shadow:0 0 0 3px #02baf233}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-color:#1269cf}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{opacity:1}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner{align-items:center;color:inherit;display:flex;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;overflow:hidden;padding:2px;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner:focus{outline:none;text-decoration:underline}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner svg{margin-inline-end:8px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner span{line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--disabled .uppy-ProviderBrowserItem-inner{cursor:default}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-iconWrap{margin-inline-end:7px;width:20px}.uppy-ProviderBrowserItem-checkbox{cursor:pointer;flex-shrink:0;position:relative}.uppy-ProviderBrowserItem-checkbox:disabled,.uppy-ProviderBrowserItem-checkbox:disabled:after{cursor:default}[data-uppy-theme=dark] .uppy-ProviderBrowserItem-checkbox{background-color:#1f1f1f;border-color:#939393}[data-uppy-theme=dark] .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{background-color:#333}.uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after{border-bottom:2px solid #eaeaea;border-left:2px solid #eaeaea;content:"";cursor:pointer;position:absolute;transform:rotate(-45deg)}.uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{background-color:#eaeaea!important;content:""!important;height:2px!important;left:20%!important;position:absolute!important;right:20%!important;top:50%!important;transform:translateY(-50%)!important}.uppy-SearchProvider{align-items:center;display:flex;flex:1;flex-direction:column;height:100%;justify-content:center;width:100%}[data-uppy-theme=dark] .uppy-SearchProvider{background-color:#1f1f1f}.uppy-SearchProvider-input{margin-bottom:15px;max-width:650px;width:90%}.uppy-size--md .uppy-SearchProvider-input{margin-bottom:20px}.uppy-SearchProvider-input::-webkit-search-cancel-button{display:none}.uppy-SearchProvider-searchButton{padding:13px 25px}.uppy-size--md .uppy-SearchProvider-searchButton{padding:13px 30px}.uppy-DashboardContent-panelBody{align-items:center;display:flex;flex:1;justify-content:center}[data-uppy-theme=dark] .uppy-DashboardContent-panelBody{background-color:#1f1f1f}.uppy-Provider-auth,.uppy-Provider-empty,.uppy-Provider-error,.uppy-Provider-loading{align-items:center;color:#939393;display:flex;flex:1;flex-flow:column wrap;justify-content:center}.uppy-Provider-empty{color:#939393}.uppy-Provider-authIcon svg{height:75px;width:100px}.uppy-Provider-authTitle{color:#757575;font-size:17px;font-weight:400;line-height:1.4;margin-bottom:30px;max-width:500px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Provider-authTitle{font-size:20px}[data-uppy-theme=dark] .uppy-Provider-authTitle{color:#cfcfcf}.uppy-Provider-btn-google{align-items:center;background:#4285f4;display:flex;padding:8px 12px!important}.uppy-Provider-btn-google:hover{background-color:#1266f1}.uppy-Provider-btn-google:focus{box-shadow:0 0 0 3px #4285f466;outline:none}.uppy-Provider-btn-google svg{margin-right:8px}.uppy-Provider-breadcrumbs{color:#525252;flex:1;font-size:12px;margin-bottom:10px;text-align:start}.uppy-size--md .uppy-Provider-breadcrumbs{margin-bottom:0}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs{color:#eaeaea}.uppy-Provider-breadcrumbsIcon{color:#525252;display:inline-block;line-height:1;margin-inline-end:4px;vertical-align:middle}.uppy-Provider-breadcrumbsIcon svg{height:13px;width:13px;fill:#525252}.uppy-Provider-breadcrumbs button{border-radius:3px;display:inline-block;line-height:inherit;padding:4px}.uppy-Provider-breadcrumbs button:focus{outline:none}.uppy-Provider-breadcrumbs button::-moz-focus-inner{border:0}.uppy-Provider-breadcrumbs button:hover{color:#0e51a0}.uppy-Provider-breadcrumbs button:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button:focus{background-color:#333}.uppy-Provider-breadcrumbs button:not(:last-of-type){text-decoration:underline}.uppy-Provider-breadcrumbs button:last-of-type{color:#333;cursor:normal;font-weight:500;pointer-events:none}.uppy-Provider-breadcrumbs button:hover{cursor:pointer}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button{color:#eaeaea}.uppy-ProviderBrowser{display:flex;flex:1;flex-direction:column;font-size:14px;font-weight:400;height:100%}.uppy-ProviderBrowser-user{color:#333;font-weight:500;margin:0 8px 0 0}[data-uppy-theme=dark] .uppy-ProviderBrowser-user{color:#eaeaea}.uppy-ProviderBrowser-user:after{color:#939393;content:"·";font-weight:400;inset-inline-start:4px;position:relative}.uppy-ProviderBrowser-header{border-bottom:1px solid #eaeaea;position:relative;z-index:1001}[data-uppy-theme=dark] .uppy-ProviderBrowser-header{border-bottom:1px solid #333}.uppy-ProviderBrowser-headerBar{background-color:#fafafa;color:#757575;font-size:12px;line-height:1.4;padding:7px 15px;z-index:1001}.uppy-size--md .uppy-ProviderBrowser-headerBar{align-items:center;display:flex}[data-uppy-theme=dark] .uppy-ProviderBrowser-headerBar{background-color:#1f1f1f}.uppy-ProviderBrowser-headerBar--simple{display:block;justify-content:center;text-align:center}.uppy-ProviderBrowser-headerBar--simple .uppy-Provider-breadcrumbsWrap{display:inline-block;flex:none;vertical-align:middle}.uppy-ProviderBrowser-searchFilter{align-items:center;display:flex;height:30px;margin-bottom:15px;margin-top:15px;padding-left:8px;padding-right:8px;position:relative;width:100%}.uppy-ProviderBrowser-searchFilterInput{background-color:#eaeaea;border:0;border-radius:4px;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;font-size:13px;height:30px;line-height:1.4;outline:0;padding-inline-end:30px;padding-inline-start:30px;width:100%;z-index:1001}.uppy-ProviderBrowser-searchFilterInput::-webkit-search-cancel-button{display:none}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput{background-color:#1f1f1f;color:#eaeaea}.uppy-ProviderBrowser-searchFilterInput:focus{background-color:#cfcfcf;border:0}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput:focus{background-color:#333}.uppy-ProviderBrowser-searchFilterIcon{color:#757575;height:12px;inset-inline-start:16px;position:absolute;width:12px;z-index:1002}.uppy-ProviderBrowser-searchFilterInput::-moz-placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterInput::placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterReset{border-radius:3px;color:#939393;cursor:pointer;height:22px;inset-inline-end:16px;padding:6px;position:absolute;width:22px;z-index:1002}.uppy-ProviderBrowser-searchFilterReset:focus{outline:none}.uppy-ProviderBrowser-searchFilterReset::-moz-focus-inner{border:0}.uppy-ProviderBrowser-searchFilterReset:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-searchFilterReset:hover{color:#757575}.uppy-ProviderBrowser-searchFilterReset svg{vertical-align:text-top}.uppy-ProviderBrowser-userLogout{border-radius:3px;color:#1269cf;cursor:pointer;line-height:inherit;padding:4px}.uppy-ProviderBrowser-userLogout:focus{outline:none}.uppy-ProviderBrowser-userLogout::-moz-focus-inner{border:0}.uppy-ProviderBrowser-userLogout:hover{color:#0e51a0}.uppy-ProviderBrowser-userLogout:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout:focus{background-color:#333}.uppy-ProviderBrowser-userLogout:hover{text-decoration:underline}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout{color:#eaeaea}.uppy-ProviderBrowser-body{flex:1;position:relative}.uppy-ProviderBrowser-list{background-color:#fff;border-spacing:0;display:block;flex:1;height:100%;inset:0;list-style:none;margin:0;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;width:100%;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-ProviderBrowser-list{background-color:#1f1f1f}.uppy-ProviderBrowser-list:focus{outline:none}.uppy-ProviderBrowserItem-inner{cursor:pointer;font-size:13px;font-weight:500}.uppy-ProviderBrowser-footer{align-items:center;background-color:#fff;border-top:1px solid #eaeaea;display:flex;justify-content:space-between;padding:15px}.uppy-ProviderBrowser-footer button{margin-inline-end:8px}[data-uppy-theme=dark] .uppy-ProviderBrowser-footer{background-color:#1f1f1f;border-top:1px solid #333}.uppy-ProviderBrowser-footer-buttons{flex-shrink:0}.uppy-ProviderBrowser-footer-error{color:#e32437;line-height:18px}@media(max-width:426px){.uppy-ProviderBrowser-footer{align-items:stretch;flex-direction:column-reverse}.uppy-ProviderBrowser-footer-error{padding-bottom:10px}}.picker-dialog-bg{z-index:20000!important}.picker-dialog{z-index:20001!important}.uppy-Dashboard-Item-previewInnerWrap{align-items:center;border-radius:3px;box-shadow:0 0 2px #0006;display:flex;flex-direction:column;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}.uppy-size--md .uppy-Dashboard-Item-previewInnerWrap{box-shadow:0 1px 2px #00000026}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewInnerWrap{box-shadow:none}.uppy-Dashboard-Item-previewInnerWrap:after{background-color:#000000a6;content:"";display:none;inset:0;position:absolute;z-index:1001}.uppy-Dashboard-Item-previewLink{inset:0;position:absolute;z-index:1002}.uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #579df0}[data-uppy-theme=dark] .uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #016c8d}.uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;height:100%;-o-object-fit:cover;object-fit:cover;transform:translateZ(0);width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;padding:10px;width:auto}.uppy-Dashboard-Item-progress{color:#fff;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:all .35 ease;width:120px;z-index:1002}.uppy-Dashboard-Item-progressIndicator{color:#fff;display:inline-block;height:38px;opacity:.9;width:38px}.uppy-size--md .uppy-Dashboard-Item-progressIndicator{height:55px;width:55px}button.uppy-Dashboard-Item-progressIndicator{cursor:pointer}button.uppy-Dashboard-Item-progressIndicator:focus{outline:none}button.uppy-Dashboard-Item-progressIndicator::-moz-focus-inner{border:0}button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--bg,button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--retry{fill:#579df0}.uppy-Dashboard-Item-progressIcon--circle{height:100%;width:100%}.uppy-Dashboard-Item-progressIcon--bg{stroke:#fff6}.uppy-Dashboard-Item-progressIcon--progress{transition:stroke-dashoffset .5s ease-out;stroke:#fff}.uppy-Dashboard-Item-progressIcon--play{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--cancel{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--pause{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--check{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--retry{fill:#fff}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{inset-inline-end:-8px;inset-inline-start:auto;top:-9px;transform:none;width:auto}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:18px;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:28px;width:28px}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:18px;opacity:1;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:22px;width:22px}.uppy-Dashboard-Item.is-processing .uppy-Dashboard-Item-progress{opacity:0}.uppy-Dashboard-Item-fileInfo{padding-inline-end:5px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:10px}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:15px}.uppy-Dashboard-Item-name{font-size:12px;font-weight:500;line-height:1.3;margin-bottom:5px;word-wrap:anywhere;word-break:break-all}[data-uppy-theme=dark] .uppy-Dashboard-Item-name{color:#eaeaea}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-name{font-size:14px;line-height:1.4}.uppy-Dashboard-Item-fileName{align-items:baseline;display:flex}.uppy-Dashboard-Item-fileName button{margin-left:5px}.uppy-Dashboard-Item-author{color:#757575;display:inline-block;font-size:11px;font-weight:400;line-height:1;margin-bottom:5px;vertical-align:bottom}.uppy-Dashboard-Item-author a{color:#757575}.uppy-Dashboard-Item-status{color:#757575;font-size:11px;font-weight:400;line-height:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-status{color:#bbb}.uppy-Dashboard-Item-statusSize{display:inline-block;margin-bottom:5px;text-transform:uppercase;vertical-align:bottom}.uppy-Dashboard-Item-reSelect{color:#1269cf;font-family:inherit;font-size:inherit;font-weight:600}.uppy-Dashboard-Item-errorMessage{background-color:#fdeff1;color:#a51523;font-size:11px;font-weight:500;line-height:1.3;padding:5px 6px}.uppy-Dashboard-Item-errorMessageBtn{color:#a51523;cursor:pointer;font-size:11px;font-weight:500;text-decoration:underline}.uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{display:none}.uppy-size--md .uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #f7c2c8;bottom:0;display:block;left:0;line-height:1.4;padding:6px 8px;position:absolute;right:0}.uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{border:1px solid #f7c2c8;border-radius:3px;display:inline-block;position:static}.uppy-size--md .uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{display:none}.uppy-Dashboard-Item-action{color:#939393;cursor:pointer}.uppy-Dashboard-Item-action:focus{outline:none}.uppy-Dashboard-Item-action::-moz-focus-inner{border:0}.uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-Item-action:hover{color:#1f1f1f;opacity:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-action{color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{outline:none}[data-uppy-theme=dark] .uppy-Dashboard-Item-action::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:hover{color:#eaeaea}.uppy-Dashboard-Item-action--remove{color:#1f1f1f;opacity:.95}.uppy-Dashboard-Item-action--remove:hover{color:#000;opacity:1}.uppy-size--md .uppy-Dashboard-Item-action--remove{height:18px;inset-inline-end:-8px;padding:0;position:absolute;top:-8px;width:18px;z-index:1002}.uppy-size--md .uppy-Dashboard-Item-action--remove:focus{border-radius:50%}.uppy-Dashboard--singleFile.uppy-size--height-md .uppy-Dashboard-Item-action--remove{inset-inline-end:8px;position:absolute;top:8px}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove{color:#525252}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove:hover{color:#333}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-actionWrapper{align-items:center;display:flex}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action{height:22px;margin-left:3px;padding:3px;width:22px}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action:focus{border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink,.uppy-size--md .uppy-Dashboard-Item-action--edit{height:16px;padding:0;width:16px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink:focus,.uppy-size--md .uppy-Dashboard-Item-action--edit:focus{border-radius:3px}.uppy-Dashboard-Item{align-items:center;border-bottom:1px solid #eaeaea;display:flex;padding:10px}.uppy-Dashboard:not(.uppy-Dashboard--singleFile) .uppy-Dashboard-Item{padding-inline-end:0}[data-uppy-theme=dark] .uppy-Dashboard-Item{border-bottom:1px solid #333}.uppy-size--md .uppy-Dashboard-Item{border-bottom:0;display:block;float:inline-start;height:215px;margin:5px 15px;padding:0;position:relative;width:calc(33.333% - 30px)}.uppy-size--lg .uppy-Dashboard-Item{height:190px;margin:5px 15px;padding:0;width:calc(25% - 30px)}.uppy-size--xl .uppy-Dashboard-Item{height:210px;padding:0;width:calc(20% - 30px)}.uppy-Dashboard--singleFile .uppy-Dashboard-Item{border-bottom:0;display:flex;flex-direction:column;height:100%;max-width:400px;padding:15px;position:relative;width:100%}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-previewInnerWrap{opacity:.2}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-name{opacity:.7}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35' height='39' viewBox='0 0 35 39'%3E%3Cpath fill='%2523000' d='M1.708 38.66c1.709 0 3.417-3.417 6.834-3.417s5.125 3.417 8.61 3.417c3.348 0 5.056-3.417 8.473-3.417 4.305 0 5.125 3.417 6.833 3.417.889 0 1.709-.889 1.709-1.709v-19.68C34.167-5.757 0-5.757 0 17.271v19.68c0 .82.888 1.709 1.708 1.709m8.542-17.084a3.383 3.383 0 0 1-3.417-3.416 3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.417 3.417 3.383 3.383 0 0 1-3.417 3.416m13.667 0A3.383 3.383 0 0 1 20.5 18.16a3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.416 3.417 3.383 3.383 0 0 1-3.416 3.416'/%3E%3C/svg%3E");background-position:50% 10px;background-repeat:no-repeat;background-size:25px;content:"";inset:0;opacity:.5;position:absolute;z-index:1005}.uppy-size--md .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:40px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:30%}.uppy-Dashboard-Item-preview{flex-grow:0;flex-shrink:0;height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-Item-preview{height:140px;width:100%}.uppy-size--lg .uppy-Dashboard-Item-preview{height:120px}.uppy-size--xl .uppy-Dashboard-Item-preview{height:140px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview{flex-grow:1;max-height:75%;width:100%}.uppy-Dashboard--singleFile.uppy-size--md .uppy-Dashboard-Item-preview{max-height:100%}.uppy-Dashboard-Item-fileInfoAndButtons{align-items:center;display:flex;flex-grow:1;justify-content:space-between;padding-inline-end:8px;padding-inline-start:12px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons,.uppy-size--md .uppy-Dashboard-Item-fileInfoAndButtons{align-items:flex-start;padding:9px 0 0}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons{flex-grow:0;width:100%}.uppy-Dashboard-Item-fileInfo{flex-grow:1;flex-shrink:1}.uppy-Dashboard-Item-actionWrapper{flex-grow:0;flex-shrink:0}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-previewInnerWrap:after,.uppy-Dashboard-Item.is-inprogress .uppy-Dashboard-Item-previewInnerWrap:after{display:block}.uppy-Dashboard-Item-errorDetails{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#939393;border:none;border-radius:50%;color:#fff;cursor:help;flex-shrink:0;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;width:13px}.uppy-Dashboard-Item-errorDetails:after{line-height:1.3;word-wrap:break-word}.uppy-Dashboard-FileCard{background-color:#fff;border-radius:5px;box-shadow:0 0 10px 4px #0000001a;display:flex;flex-direction:column;height:100%;inset:0;position:absolute;width:100%;z-index:1005}.uppy-Dashboard-FileCard .uppy-DashboardContent-bar{border-top-left-radius:5px;border-top-right-radius:5px}.uppy-Dashboard-FileCard .uppy-Dashboard-FileCard-actions{border-bottom-left-radius:5px;border-bottom-right-radius:5px}.uppy-Dashboard-FileCard-inner{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;height:100%;min-height:0}.uppy-Dashboard-FileCard-preview{align-items:center;border-bottom:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:1;height:60%;justify-content:center;min-height:0;position:relative}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-preview{background-color:#333;border-bottom:0}.uppy-Dashboard-FileCard-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;box-shadow:0 3px 20px #00000026;flex:0 0 auto;max-height:90%;max-width:90%;-o-object-fit:cover;object-fit:cover}.uppy-Dashboard-FileCard-edit{background-color:#00000080;border-radius:50px;color:#fff;font-size:13px;inset-inline-end:10px;padding:7px 15px;position:absolute;top:10px}.uppy-Dashboard-FileCard-edit:focus{outline:none}.uppy-Dashboard-FileCard-edit::-moz-focus-inner{border:0}.uppy-Dashboard-FileCard-edit:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-FileCard-edit:hover{background-color:#000c}.uppy-Dashboard-FileCard-info{flex-grow:0;flex-shrink:0;height:40%;overflow-y:auto;padding:30px 20px 20px;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-info{background-color:#1f1f1f}.uppy-Dashboard-FileCard-fieldset{border:0;font-size:0;margin:auto auto 12px;max-width:640px;padding:0}.uppy-Dashboard-FileCard-label{color:#525252;display:inline-block;font-size:12px;vertical-align:middle;width:22%}.uppy-size--md .uppy-Dashboard-FileCard-label{font-size:14px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-label{color:#eaeaea}.uppy-Dashboard-FileCard-input{display:inline-block;vertical-align:middle;width:78%}.uppy-Dashboard-FileCard-actions{align-items:center;background-color:#fafafa;border-top:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:0;height:55px;padding:0 15px}.uppy-size--md .uppy-Dashboard-FileCard-actions{height:65px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-actions{background-color:#1f1f1f;border-top:1px solid #333}.uppy-Dashboard-FileCard-actionsBtn{margin-inline-end:10px}.uppy-Informer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1005}.uppy-Informer span>div{margin-bottom:6px}.uppy-Informer-animated{opacity:0;transform:translateY(350%);transition:all .3s ease-in;z-index:-1000}.uppy-Informer p{background-color:#757575;border-radius:18px;color:#fff;display:inline-block;font-size:12px;font-weight:400;line-height:1.4;margin:0;max-width:90%;padding:6px 15px}.uppy-size--md .uppy-Informer p{font-size:14px;line-height:1.3;max-width:500px;padding:10px 20px}[data-uppy-theme=dark] .uppy-Informer p{background-color:#333}.uppy-Informer p span{background-color:#fff;border-radius:50%;color:#525252;display:inline-block;font-size:10px;height:13px;inset-inline-start:3px;line-height:12px;margin-inline-start:-1px;position:relative;top:-1px;vertical-align:middle;width:13px}.uppy-Informer p span:hover{cursor:help}.uppy-Informer p span:after{line-height:1.3;word-wrap:break-word}.uppy-Root [aria-label][role~=tooltip]{position:relative}.uppy-Root [aria-label][role~=tooltip]:after,.uppy-Root [aria-label][role~=tooltip]:before{backface-visibility:hidden;box-sizing:border-box;opacity:0;pointer-events:none;position:absolute;transform:translateZ(0);transform-origin:top;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);will-change:transform;z-index:10}.uppy-Root [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.uppy-Root [aria-label][role~=tooltip]:after{background:#111111e6;border-radius:4px;box-sizing:initial;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);padding:.5em 1em;text-transform:var(--microtip-text-transform,none);white-space:nowrap}.uppy-Root [aria-label][role~=tooltip]:focus:after,.uppy-Root [aria-label][role~=tooltip]:focus:before,.uppy-Root [aria-label][role~=tooltip]:hover:after,.uppy-Root [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto}.uppy-Root [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002S8.594 0 2.658 0'/%3E%3C/svg%3E") no-repeat;bottom:100%;height:6px;left:50%;margin-bottom:5px;transform:translate3d(-50%,0,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=top]:after{bottom:100%;left:50%;margin-bottom:11px;transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:after{bottom:100%;transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:after{bottom:100%;transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(-16px,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002S27.406 12 33.342 12'/%3E%3C/svg%3E") no-repeat;bottom:auto;height:6px;left:50%;margin-bottom:0;margin-top:5px;top:100%;transform:translate3d(-50%,-10px,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:after{left:50%;margin-top:11px;top:100%;transform:translate3d(-50%,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:after{top:100%;transform:translate3d(calc(-100% + 16px),-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:after{top:100%;transform:translate3d(-16px,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:before{inset:50% 100% auto auto;transform:translate3d(10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002S0 27.406 0 33.342'/%3E%3C/svg%3E") no-repeat;height:18px;margin-bottom:0;margin-right:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002S12 8.594 12 2.658'/%3E%3C/svg%3E") no-repeat;height:18px;margin-bottom:0;margin-left:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.uppy-Root [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:150px}.uppy-Root [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.uppy-StatusBar{background-color:#fff;color:#fff;display:flex;font-size:12px;font-weight:400;height:46px;line-height:40px;position:relative;transition:height .2s;z-index:1001}[data-uppy-theme=dark] .uppy-StatusBar{background-color:#1f1f1f}.uppy-StatusBar:before{background-color:#eaeaea;content:"";height:2px;inset:0;position:absolute;width:100%}[data-uppy-theme=dark] .uppy-StatusBar:before{background-color:#757575}.uppy-StatusBar[aria-hidden=true]{height:0;overflow-y:hidden}.uppy-StatusBar.is-complete .uppy-StatusBar-progress{background-color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-progress{background-color:#e32437}.uppy-StatusBar.is-complete .uppy-StatusBar-statusIndicator{color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-statusIndicator{color:#e32437}.uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#fff;border-top:1px solid #eaeaea;height:65px}[data-uppy-theme=dark] .uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#1f1f1f;border-top:1px solid #333}.uppy-StatusBar-progress{background-color:#1269cf;height:2px;position:absolute;transition:background-color,width .3s ease-out;z-index:1001}.uppy-StatusBar-progress.is-indeterminate{animation:uppy-StatusBar-ProgressStripes 1s linear infinite;background-image:linear-gradient(45deg,#0000004d 25%,#0000 0 50%,#0000004d 0 75%,#0000 0,#0000);background-size:64px 64px}@keyframes uppy-StatusBar-ProgressStripes{0%{background-position:0 0}to{background-position:64px 0}}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-progress,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-progress{background-color:#f6a623}.uppy-StatusBar.is-waiting .uppy-StatusBar-progress{display:none}.uppy-StatusBar-content{align-items:center;color:#333;display:flex;height:100%;padding-inline-start:10px;position:relative;text-overflow:ellipsis;white-space:nowrap;z-index:1002}.uppy-size--md .uppy-StatusBar-content{padding-inline-start:15px}[data-uppy-theme=dark] .uppy-StatusBar-content{color:#eaeaea}.uppy-StatusBar-status{display:flex;flex-direction:column;font-weight:400;justify-content:center;line-height:1.4;padding-inline-end:.3em}.uppy-StatusBar-statusPrimary{display:flex;font-weight:500;line-height:1}.uppy-StatusBar-statusPrimary button.uppy-StatusBar-details{margin-left:5px}[data-uppy-theme=dark] .uppy-StatusBar-statusPrimary{color:#eaeaea}.uppy-StatusBar-statusSecondary{color:#757575;display:inline-block;font-size:11px;line-height:1.2;margin-top:1px;white-space:nowrap}[data-uppy-theme=dark] .uppy-StatusBar-statusSecondary{color:#bbb}.uppy-StatusBar-statusSecondaryHint{display:inline-block;line-height:1;margin-inline-end:5px;vertical-align:middle}.uppy-size--md .uppy-StatusBar-statusSecondaryHint{margin-inline-end:8px}.uppy-StatusBar-statusIndicator{color:#525252;margin-inline-end:7px;position:relative;top:1px}.uppy-StatusBar-statusIndicator svg{vertical-align:text-bottom}.uppy-StatusBar-actions{align-items:center;bottom:0;display:flex;inset-inline-end:10px;position:absolute;top:0;z-index:1004}.uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#fafafa;height:100%;padding:0 15px;position:static;width:100%}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#1f1f1f}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:column;height:90px}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:row;height:65px}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:column;justify-content:center}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:row;justify-content:normal}.uppy-StatusBar-actionCircleBtn{cursor:pointer;line-height:1;margin:3px;opacity:.9}.uppy-StatusBar-actionCircleBtn:focus{outline:none}.uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}.uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionCircleBtn:hover{opacity:1}.uppy-StatusBar-actionCircleBtn:focus{border-radius:50%}.uppy-StatusBar-actionCircleBtn svg{vertical-align:bottom}.uppy-StatusBar-actionBtn{color:#1269cf;display:inline-block;font-size:10px;line-height:inherit;vertical-align:middle}.uppy-size--md .uppy-StatusBar-actionBtn{font-size:11px}.uppy-StatusBar-actionBtn--disabled{opacity:.4}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--disabled{opacity:.7}.uppy-StatusBar-actionBtn--retry{background-color:#ff4b23;border-radius:8px;color:#fff;height:16px;line-height:1;margin-inline-end:6px;padding:1px 6px 3px 18px;position:relative}.uppy-StatusBar-actionBtn--retry:focus{outline:none}.uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionBtn--retry:hover{background-color:#f92d00}.uppy-StatusBar-actionBtn--retry svg{inset-inline-start:6px;position:absolute;top:3px}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1bb240;color:#fff;font-size:14px;line-height:1;padding:15px 10px;width:100%}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#189c38}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1c8b37}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#18762f}.uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{padding:13px 22px;width:auto}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1bb240;cursor:not-allowed}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1c8b37}.uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload{background-color:initial;color:#1269cf}.uppy-StatusBar-actionBtn--uploadNewlyAdded{border-radius:3px;padding-inline-end:3px;padding-bottom:1px;padding-inline-start:3px}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}.uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded{display:none}.uppy-StatusBar-actionBtn--done{border-radius:3px;line-height:1;padding:7px 8px}.uppy-StatusBar-actionBtn--done:focus{outline:none}.uppy-StatusBar-actionBtn--done::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--done:hover{color:#0e51a0}.uppy-StatusBar-actionBtn--done:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done:focus{background-color:#333}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done{color:#02baf2}.uppy-size--md .uppy-StatusBar-actionBtn--done{font-size:14px}.uppy-StatusBar-serviceMsg{color:#000;font-size:11px;line-height:1.1;padding-left:10px}.uppy-size--md .uppy-StatusBar-serviceMsg{font-size:14px;padding-left:15px}[data-uppy-theme=dark] .uppy-StatusBar-serviceMsg{color:#eaeaea}.uppy-StatusBar-serviceMsg-ghostsIcon{left:6px;opacity:.5;position:relative;top:2px;vertical-align:text-bottom;width:10px}.uppy-size--md .uppy-StatusBar-serviceMsg-ghostsIcon{left:10px;top:1px;width:15px}.uppy-StatusBar-details{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#939393;border-radius:50%;color:#fff;cursor:help;display:inline-block;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;vertical-align:middle;width:13px}.uppy-StatusBar-details:after{line-height:1.3;word-wrap:break-word}.uppy-StatusBar-spinner{animation-duration:1s;animation-iteration-count:infinite;animation-name:uppy-StatusBar-spinnerAnimation;animation-timing-function:linear;fill:#1269cf;margin-inline-end:10px}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-spinner,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-spinner{fill:#f6a623}@keyframes uppy-StatusBar-spinnerAnimation{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.uppy-transition-slideDownUp-enter{opacity:.01;transform:translate3d(0,-105%,0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-enter.uppy-transition-slideDownUp-enter-active{opacity:1;transform:translateZ(0)}.uppy-transition-slideDownUp-leave{opacity:1;transform:translateZ(0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-leave.uppy-transition-slideDownUp-leave-active{opacity:.01;transform:translate3d(0,-105%,0)}@keyframes uppy-Dashboard-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes uppy-Dashboard-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes uppy-Dashboard-slideDownAndFadeIn{0%{opacity:0;transform:translate3d(-50%,-70%,0)}to{opacity:1;transform:translate3d(-50%,-50%,0)}}@keyframes uppy-Dashboard-slideDownAndFadeIn--small{0%{opacity:0;transform:translate3d(0,-20%,0)}to{opacity:1;transform:translateZ(0)}}@keyframes uppy-Dashboard-slideUpFadeOut{0%{opacity:1;transform:translate3d(-50%,-50%,0)}to{opacity:0;transform:translate3d(-50%,-70%,0)}}@keyframes uppy-Dashboard-slideUpFadeOut--small{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20%,0)}}.uppy-Dashboard--modal{z-index:1001}.uppy-Dashboard--modal[aria-hidden=true]{display:none}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeIn .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeOut .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard-isFixed{height:100vh;overflow:hidden}.uppy-Dashboard--modal .uppy-Dashboard-overlay{background-color:#00000080;inset:0;position:fixed;z-index:1001}.uppy-Dashboard-inner{background-color:#f4f4f4;border:1px solid #eaeaea;border-radius:5px;max-height:100%;max-width:100%;outline:none;position:relative}.uppy-size--md .uppy-Dashboard-inner{min-height:auto}@media only screen and (min-width:820px){.uppy-Dashboard-inner{height:500px;width:650px}}.uppy-Dashboard--modal .uppy-Dashboard-inner{z-index:1002}[data-uppy-theme=dark] .uppy-Dashboard-inner{background-color:#1f1f1f}.uppy-Dashboard--isDisabled .uppy-Dashboard-inner{cursor:not-allowed}.uppy-Dashboard-innerWrap{border-radius:5px;display:flex;flex-direction:column;height:100%;opacity:0;overflow:hidden;position:relative}.uppy-Dashboard--isInnerWrapVisible .uppy-Dashboard-innerWrap{opacity:1}.uppy-Dashboard--isDisabled .uppy-Dashboard-innerWrap{cursor:not-allowed;filter:grayscale(100%);opacity:.6;-webkit-user-select:none;-moz-user-select:none;user-select:none}.uppy-Dashboard--isDisabled .uppy-ProviderIconBg{fill:#9f9f9f}.uppy-Dashboard--isDisabled [aria-disabled],.uppy-Dashboard--isDisabled [disabled]{cursor:not-allowed;pointer-events:none}.uppy-Dashboard--modal .uppy-Dashboard-inner{border:none;inset:35px 15px 15px;position:fixed}@media only screen and (min-width:820px){.uppy-Dashboard--modal .uppy-Dashboard-inner{box-shadow:0 5px 15px 4px #00000026;left:50%;right:auto;top:50%;transform:translate(-50%,-50%)}}.uppy-Dashboard-close{color:#ffffffe6;cursor:pointer;display:block;font-size:27px;inset-inline-end:-2px;position:absolute;top:-33px;z-index:1005}.uppy-Dashboard-close:focus{outline:none}.uppy-Dashboard-close::-moz-focus-inner{border:0}.uppy-Dashboard-close:focus{color:#6eabf2}@media only screen and (min-width:820px){.uppy-Dashboard-close{font-size:35px;inset-inline-end:-35px;top:-10px}}.uppy-Dashboard-serviceMsg{background-color:#fffbf7;border-bottom:1px solid #edd4b9;border-top:1px solid #edd4b9;font-size:12px;font-weight:500;line-height:1.3;padding:12px 0;position:relative;top:-1px;z-index:1004}.uppy-size--md .uppy-Dashboard-serviceMsg{font-size:14px;line-height:1.4}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg{background-color:#1f1f1f;border-bottom:1px solid #333;border-top:1px solid #333;color:#eaeaea}.uppy-Dashboard-serviceMsg-title{display:block;line-height:1;margin-bottom:4px;padding-left:42px}.uppy-Dashboard-serviceMsg-text{padding:0 15px}.uppy-Dashboard-serviceMsg-actionBtn{color:#1269cf;font-size:inherit;font-weight:inherit;vertical-align:initial}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg-actionBtn{color:#02baf2e6}.uppy-Dashboard-serviceMsg-icon{left:15px;position:absolute;top:10px}.uppy-Dashboard-AddFiles{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;position:relative;text-align:center}[data-uppy-drag-drop-supported=true] .uppy-Dashboard-AddFiles{border:1px dashed #dfdfdf;border-radius:3px;height:calc(100% - 14px);margin:7px}.uppy-Dashboard-AddFilesPanel .uppy-Dashboard-AddFiles{border:none;height:calc(100% - 54px)}.uppy-Dashboard--modal .uppy-Dashboard-AddFiles{border-color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles{border-color:#757575}.uppy-Dashboard-AddFiles-info{display:none;margin-top:auto;padding-bottom:15px;padding-top:15px}.uppy-size--height-md .uppy-Dashboard-AddFiles-info{display:block}.uppy-size--md .uppy-Dashboard-AddFiles-info{bottom:25px;left:0;padding-bottom:0;padding-top:30px;position:absolute;right:0}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-info{margin-top:0}.uppy-Dashboard-browse{color:#1269cf;cursor:pointer}.uppy-Dashboard-browse:focus{outline:none}.uppy-Dashboard-browse::-moz-focus-inner{border:0}.uppy-Dashboard-browse:focus,.uppy-Dashboard-browse:hover{border-bottom:1px solid #1269cf}[data-uppy-theme=dark] .uppy-Dashboard-browse{color:#02baf2e6}[data-uppy-theme=dark] .uppy-Dashboard-browse:focus,[data-uppy-theme=dark] .uppy-Dashboard-browse:hover{border-bottom:1px solid #02baf2}.uppy-Dashboard-browseBtn{display:block;font-size:14px;font-weight:500;margin-bottom:5px;margin-top:8px;width:100%}.uppy-size--md .uppy-Dashboard-browseBtn{font-size:15px;margin:15px auto;padding:13px 44px;width:auto}.uppy-Dashboard-AddFiles-list{display:flex;flex:1;flex-direction:column;margin-top:2px;overflow-y:auto;padding:2px 0;width:100%;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;margin-top:15px;max-width:600px;overflow-y:visible;padding-top:0}.uppy-DashboardTab{border-bottom:1px solid #eaeaea;text-align:center;width:100%}[data-uppy-theme=dark] .uppy-DashboardTab{border-bottom:1px solid #333}.uppy-size--md .uppy-DashboardTab{border-bottom:none;display:inline-block;margin-bottom:10px;width:auto}.uppy-DashboardTab-btn{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:initial;color:#525252;cursor:pointer;flex-direction:row;height:100%;justify-content:left;padding:12px 15px;width:100%}.uppy-DashboardTab-btn:focus{outline:none}.uppy-size--md .uppy-DashboardTab-btn{border-radius:5px;flex-direction:column;margin-inline-end:1px;padding:10px 3px;width:86px}[data-uppy-theme=dark] .uppy-DashboardTab-btn{color:#eaeaea}.uppy-DashboardTab-btn::-moz-focus-inner{border:0}.uppy-DashboardTab-btn:hover{background-color:#e9ecef}[data-uppy-theme=dark] .uppy-DashboardTab-btn:hover{background-color:#333}.uppy-DashboardTab-btn:active,.uppy-DashboardTab-btn:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardTab-btn:active,[data-uppy-theme=dark] .uppy-DashboardTab-btn:focus{background-color:#525252}.uppy-DashboardTab-btn svg{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;transition:transform .15s ease-in-out;vertical-align:text-top}.uppy-DashboardTab-inner{align-items:center;background-color:#fff;border-radius:8px;box-shadow:0 1px 1px #0000001a,0 1px 2px #0000001a,0 2px 3px #00000005;display:flex;height:32px;justify-content:center;margin-inline-end:10px;width:32px}.uppy-size--md .uppy-DashboardTab-inner{margin-inline-end:0}[data-uppy-theme=dark] .uppy-DashboardTab-inner{background-color:#323232;box-shadow:0 1px 1px #0003,0 1px 2px #0003,0 2px 3px #00000014}.uppy-DashboardTab-name{font-size:14px;font-weight:400}.uppy-size--md .uppy-DashboardTab-name{font-size:12px;line-height:15px;margin-bottom:0;margin-top:8px}.uppy-DashboardTab-iconMyDevice{color:#1269cf}[data-uppy-theme=dark] .uppy-DashboardTab-iconMyDevice{color:#02baf2}.uppy-DashboardTab-iconBox{color:#0061d5}[data-uppy-theme=dark] .uppy-DashboardTab-iconBox{color:#eaeaea}.uppy-DashboardTab-iconDropbox{color:#0061fe}[data-uppy-theme=dark] .uppy-DashboardTab-iconDropbox{color:#eaeaea}.uppy-DashboardTab-iconUnsplash{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconUnsplash{color:#eaeaea}.uppy-DashboardTab-iconWebdav{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconWebdav{color:#eaeaea}.uppy-DashboardTab-iconScreenRec{color:#2c3e50}[data-uppy-theme=dark] .uppy-DashboardTab-iconScreenRec{color:#eaeaea}.uppy-DashboardTab-iconAudio{color:#8030a3}[data-uppy-theme=dark] .uppy-DashboardTab-iconAudio{color:#bf6ee3}.uppy-Dashboard-input{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px;z-index:-1}.uppy-DashboardContent-bar{align-items:center;background-color:#fafafa;border-bottom:1px solid #eaeaea;display:flex;flex-shrink:0;height:40px;justify-content:space-between;padding:0 10px;position:relative;width:100%;z-index:1004}.uppy-size--md .uppy-DashboardContent-bar{height:50px;padding:0 15px}[data-uppy-theme=dark] .uppy-DashboardContent-bar{background-color:#1f1f1f;border-bottom:1px solid #333}.uppy-DashboardContent-title{font-size:12px;font-weight:500;left:0;line-height:40px;margin:auto;max-width:170px;overflow-x:hidden;position:absolute;right:0;text-align:center;text-overflow:ellipsis;top:0;white-space:nowrap;width:100%}.uppy-size--md .uppy-DashboardContent-title{font-size:14px;line-height:50px;max-width:300px}[data-uppy-theme=dark] .uppy-DashboardContent-title{color:#eaeaea}.uppy-DashboardContent-back,.uppy-DashboardContent-save{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-size:12px;font-weight:400;line-height:1;margin:0;margin-inline-start:-6px;padding:7px 6px}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{outline:none}.uppy-DashboardContent-back::-moz-focus-inner,.uppy-DashboardContent-save::-moz-focus-inner{border:0}.uppy-DashboardContent-back:hover,.uppy-DashboardContent-save:hover{color:#0e51a0}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-back:focus,[data-uppy-theme=dark] .uppy-DashboardContent-save:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-back,.uppy-size--md .uppy-DashboardContent-save{font-size:14px}[data-uppy-theme=dark] .uppy-DashboardContent-back,[data-uppy-theme=dark] .uppy-DashboardContent-save{color:#02baf2}.uppy-DashboardContent-addMore{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:500;height:29px;line-height:1;margin:0;margin-inline-end:-5px;padding:7px 8px;width:29px}.uppy-DashboardContent-addMore:focus{outline:none}.uppy-DashboardContent-addMore::-moz-focus-inner{border:0}.uppy-DashboardContent-addMore:hover{color:#0e51a0}.uppy-DashboardContent-addMore:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-addMore:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-addMore{font-size:14px;height:auto;margin-inline-end:-8px;width:auto}[data-uppy-theme=dark] .uppy-DashboardContent-addMore{color:#02baf2}.uppy-DashboardContent-addMore svg{margin-inline-end:4px;vertical-align:initial}.uppy-size--md .uppy-DashboardContent-addMore svg{height:11px;width:11px}.uppy-DashboardContent-addMoreCaption{display:none}.uppy-size--md .uppy-DashboardContent-addMoreCaption{display:inline}.uppy-DashboardContent-panel{background-color:#f5f5f5;flex:1}.uppy-Dashboard-AddFilesPanel,.uppy-DashboardContent-panel{border-radius:5px;display:flex;flex-direction:column;inset:0;overflow:hidden;position:absolute;z-index:1005}.uppy-Dashboard-AddFilesPanel{background:#fafafa;background:linear-gradient(0deg,#fafafa 35%,#fafafad9);box-shadow:0 0 10px 5px #00000026}[data-uppy-theme=dark] .uppy-Dashboard-AddFilesPanel{background-color:#333;background-image:linear-gradient(0deg,#1f1f1f 35%,#1f1f1fd9)}.uppy-Dashboard--isAddFilesPanelVisible .uppy-Dashboard-files{filter:blur(2px)}.uppy-Dashboard-progress{bottom:0;height:12%;left:0;position:absolute;width:100%}.uppy-Dashboard-progressBarContainer.is-active{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1004}.uppy-Dashboard-filesContainer{flex:1;margin:0;overflow-y:hidden;position:relative}.uppy-Dashboard-filesContainer:after{clear:both;content:"";display:table}.uppy-Dashboard-files{flex:1;margin:0;overflow-y:auto;padding:0 0 10px;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-files{padding-top:10px}.uppy-Dashboard--singleFile .uppy-Dashboard-filesInner{align-items:center;display:flex;height:100%;justify-content:center}.uppy-Dashboard-dropFilesHereHint{align-items:center;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%231269CF' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;border:1px dashed #1269cf;border-radius:3px;color:#757575;display:flex;font-size:16px;justify-content:center;inset:7px;padding-top:90px;position:absolute;text-align:center;visibility:hidden;z-index:2000}[data-uppy-theme=dark] .uppy-Dashboard-dropFilesHereHint{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%2302BAF2' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");border-color:#02baf2;color:#bbb}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-dropFilesHereHint{pointer-events:none;visibility:visible}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-files,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-progressindicators,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-serviceMsg,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-DashboardContent-bar{opacity:.15}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-AddFiles{opacity:.03}.uppy-Dashboard-AddFiles-title{color:#000;font-size:17px;font-weight:500;line-height:1.35;margin-bottom:5px;margin-top:15px;padding:0 15px;text-align:inline-start;width:100%}.uppy-size--md .uppy-Dashboard-AddFiles-title{font-size:21px;font-weight:400;margin-top:5px;max-width:480px;padding:0 35px;text-align:center}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-title{text-align:center}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title{color:#eaeaea}.uppy-Dashboard-AddFiles-title button{font-weight:500}.uppy-size--md .uppy-Dashboard-AddFiles-title button{font-weight:400}.uppy-Dashboard-note{color:#757575;font-size:14px;line-height:1.25;margin:auto;max-width:350px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Dashboard-note{line-height:1.35;max-width:600px}[data-uppy-theme=dark] .uppy-Dashboard-note{color:#cfcfcf}a.uppy-Dashboard-poweredBy{color:#939393;display:inline-block;font-size:11px;margin-top:8px;text-align:center;text-decoration:none}.uppy-Dashboard-poweredByIcon{margin-left:1px;margin-right:1px;opacity:.9;position:relative;top:1px;vertical-align:text-top;fill:none;stroke:#939393}.uppy-Dashboard-Item-previewIcon{height:25px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:25px;z-index:100}.uppy-size--md .uppy-Dashboard-Item-previewIcon{height:38px;width:38px}.uppy-Dashboard-Item-previewIcon svg{height:100%;width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIcon{height:100%;max-height:60%;max-width:60%;width:100%}.uppy-Dashboard-Item-previewIconWrap{height:76px;max-height:75%;position:relative}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIconWrap{height:100%;width:100%}.uppy-Dashboard-Item-previewIconBg{filter:drop-shadow(rgba(0,0,0,.1) 0 1px 1px);height:100%;width:100%}.uppy-Dashboard-upload{height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-upload{height:60px;width:60px}.uppy-Dashboard-upload .uppy-c-icon{position:relative;top:1px;width:50%}.uppy-Dashboard-uploadCount{background-color:#1bb240;border-radius:50%;color:#fff;font-size:8px;height:16px;inset-inline-end:-12px;line-height:16px;position:absolute;top:-12px;width:16px}.uppy-size--md .uppy-Dashboard-uploadCount{font-size:9px;height:18px;line-height:18px;width:18px}.uppy-Dashboard-inner{border:none!important;background:transparent!important}.uppy-Dashboard-innerWrap{border-radius:.5rem;overflow:hidden}.uppy-Dashboard-AddFiles{border:2px dashed hsl(var(--border))!important;border-radius:.5rem!important;background:hsl(var(--muted) / .3)!important;transition:all .2s ease}.uppy-Dashboard-AddFiles:hover{border-color:hsl(var(--primary))!important;background:hsl(var(--muted) / .5)!important}.uppy-Dashboard-AddFiles-title{color:hsl(var(--foreground))!important;font-weight:500!important}.uppy-Dashboard-AddFiles-info{color:hsl(var(--muted-foreground))!important}.uppy-Dashboard-browse{color:hsl(var(--primary))!important;font-weight:500!important}.uppy-Dashboard-browse:hover{text-decoration:underline!important}.uppy-Dashboard-files{background:transparent!important}.uppy-Dashboard-Item{border-bottom-color:hsl(var(--border))!important}.uppy-Dashboard-Item-name{color:hsl(var(--foreground))!important}.uppy-Dashboard-Item-status{color:hsl(var(--muted-foreground))!important}.uppy-StatusBar{background:hsl(var(--muted))!important;border-top:1px solid hsl(var(--border))!important}.uppy-StatusBar-progress{background:hsl(var(--primary))!important}.uppy-StatusBar-content{color:hsl(var(--foreground))!important}.uppy-StatusBar-actionBtn--upload{background:hsl(var(--primary))!important;color:hsl(var(--primary-foreground))!important;border-radius:.375rem!important;font-weight:500!important;padding:.5rem 1rem!important}.uppy-StatusBar-actionBtn--upload:hover{background:hsl(var(--primary) / .9)!important}.uppy-Dashboard-note{color:hsl(var(--muted-foreground))!important;font-size:.75rem!important}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles,.dark .uppy-Dashboard-AddFiles{background:hsl(var(--muted) / .2)!important}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title,.dark .uppy-Dashboard-AddFiles-title{color:hsl(var(--foreground))!important}[data-uppy-theme=dark] .uppy-StatusBar,.dark .uppy-StatusBar{background:hsl(var(--muted) / .5)!important}.uppy-Dashboard{font-family:inherit!important}.uppy-Dashboard-Item-preview{border-radius:.375rem!important;overflow:hidden}.uppy-Dashboard-Item-action--remove{color:hsl(var(--destructive))!important}.uppy-Dashboard-Item-action--remove:hover{opacity:.8}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{color:hsl(var(--success, 142 76% 36%))!important}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progress{color:hsl(var(--destructive))!important}.uppy-Dashboard-files::-webkit-scrollbar{width:6px}.uppy-Dashboard-files::-webkit-scrollbar-track{background:transparent}.uppy-Dashboard-files::-webkit-scrollbar-thumb{background:hsl(var(--muted-foreground) / .3);border-radius:3px}.uppy-Dashboard-files::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground) / .5)}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:grab}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%} diff --git a/webui/dist/assets/index-DFcwoEiz.js b/webui/dist/assets/index-DFcwoEiz.js new file mode 100644 index 00000000..49524b8e --- /dev/null +++ b/webui/dist/assets/index-DFcwoEiz.js @@ -0,0 +1,52 @@ +import{r as u,j as e,L as Vc,e as ua,b as Jv,f as Iv,g as Pv,h as Wv,k as as,l as eb,m as tb,O as hp,n as sb}from"./router-CWhjJi2n.js";import{a as ab,b as lb,g as nb}from"./react-vendor-Dtc2IqVY.js";import{I as ib,c as rb,J as ei,K as Oc,L as gu,M as cb,N as Ii,O as Pi,P as ob,n as ju}from"./utils-CCeOswSm.js";import{L as xp,T as fp,C as pp,R as db,a as gp,V as ub,b as mb,S as jp,c as hb,d as vp,I as xb,e as bp,f as fb,g as yp,h as pb,i as gb,j as jb,O as Np,P as vb,k as wp,l as _p,D as Sp,A as Cp,m as kp,n as bb,o as yb,p as Tp,q as Nb,r as Ep,s as wb,t as _b,u as Sb,v as Cb,w as kb,x as zp,y as Ap,F as Mp}from"./radix-extra-BM7iD6Dt.js";import{aj as Tb,ak as Eb,al as zb,am as Ab,an as Rc,ao as Lc,ap as Wi,aq as Mb,ar as vu,as as Uc,at as Db,au as Ob,av as Rb}from"./charts-Dhri-zxi.js";import{S as Lb,G as Dp,O as Op,o as Ub,C as Rp,p as Bb,T as Lp,D as Up,R as Hb,q as qb,H as Bp,I as Gb,J as Hp,K as qp,L as Vb,M as Gp,V as Fb,N as Vp,Q as Fp,U as $b,X as Qb,Y as $p,Z as Yb,_ as Xb,$ as Qp,a0 as Kb,a1 as Zb,a2 as Yp,a3 as Jb,a4 as Ib,a5 as Pb,a6 as Xp,a7 as Kp,a8 as Zp,a9 as Jp,aa as Ip,ab as Pp,ac as Wb}from"./radix-core-C3XKqQJw.js";import{R as ps,P as fr,C as oa,a as Ea,Z as sn,b as Kc,F as Ta,c as ey,S as ti,A as ty,D as sy,d as Zc,e as Jn,M as Pn,T as ay,X as si,f as ly,g as ny,I as za,h as pa,i as ga,j as Jc,E as rr,k as Ys,l as Wp,H as iy,m as Pe,n as sl,U as cr,o as eg,p as tg,L as Hf,K as sg,q as ry,r as cy,s as Fc,t as vs,u as oy,B as ar,v as Ic,w as Lu,x as dy,y as uy,z as Os,G as to,J as Wn,N as Dl,O as or,Q as pr,V as my,W as hy,Y as cs,_ as Uu,$ as an,a0 as gr,a1 as nn,a2 as Ol,a3 as jr,a4 as Bu,a5 as xy,a6 as fy,a7 as py,a8 as ln,a9 as gy,aa as ag,ab as Tu,ac as dr,ad as jy,ae as Eu,af as vy,ag as lg,ah as qf,ai as by,aj as yy,ak as Ny,al as Ml,am as bu,an as Gf,ao as wy,ap as _y,aq as Sy,ar as Cy,as as ky,at as ng,au as ig,av as rg,aw as Ty,ax as Vf,ay as Ey,az as zy,aA as Ay,aB as My}from"./icons-y1PBa0Co.js";import{S as Dy,p as Oy,j as Ry,a as Ly,E as Ff,R as Uy,o as By}from"./codemirror-BHeANvwm.js";import{_ as Rs,c as Hy,g as cg,D as qy}from"./misc-DyBU7ISD.js";import{u as Gy,a as $f,D as Vy,c as Fy,S as $y,h as Qy,b as Yy,s as Xy,K as Ky,P as Zy,d as Jy,C as Iy}from"./dnd-Dyi3CnuX.js";import{D as Py,U as Wy}from"./uppy-BHC3OXBx.js";import{M as eN,r as tN,a as sN,b as aN}from"./markdown-A1ShuLvG.js";import{r as lN,H as Pc,P as Wc,u as nN,a as iN,R as rN,B as cN,b as oN,C as dN,M as uN,c as mN}from"./reactflow-B3n3_Vkw.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))d(h);new MutationObserver(h=>{for(const x of h)if(x.type==="childList")for(const f of x.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&d(f)}).observe(document,{childList:!0,subtree:!0});function c(h){const x={};return h.integrity&&(x.integrity=h.integrity),h.referrerPolicy&&(x.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?x.credentials="include":h.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function d(h){if(h.ep)return;h.ep=!0;const x=c(h);fetch(h.href,x)}})();var yu={exports:{}},er={},Nu={exports:{}},wu={};var Qf;function hN(){return Qf||(Qf=1,(function(n){function r(y,q){var H=y.length;y.push(q);e:for(;0>>1,_=y[ie];if(0>>1;ieh(Q,H))de<_&&0>h(ge,Q)?(y[ie]=ge,y[de]=H,ie=de):(y[ie]=Q,y[xe]=H,ie=xe);else if(de<_&&0>h(ge,H))y[ie]=ge,y[de]=H,ie=de;else break e}}return q}function h(y,q){var H=y.sortIndex-q.sortIndex;return H!==0?H:y.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;n.unstable_now=function(){return x.now()}}else{var f=Date,j=f.now();n.unstable_now=function(){return f.now()-j}}var p=[],w=[],v=1,k=null,T=3,E=!1,R=!1,F=!1,U=!1,M=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function z(y){for(var q=c(w);q!==null;){if(q.callback===null)d(w);else if(q.startTime<=y)d(w),q.sortIndex=q.expirationTime,r(p,q);else break;q=c(w)}}function B(y){if(F=!1,z(y),!R)if(c(p)!==null)R=!0,X||(X=!0,be());else{var q=c(w);q!==null&&_e(B,q.startTime-y)}}var X=!1,S=-1,O=5,se=-1;function he(){return U?!0:!(n.unstable_now()-sey&&he());){var ie=k.callback;if(typeof ie=="function"){k.callback=null,T=k.priorityLevel;var _=ie(k.expirationTime<=y);if(y=n.unstable_now(),typeof _=="function"){k.callback=_,z(y),q=!0;break t}k===c(p)&&d(p),z(y)}else d(p);k=c(p)}if(k!==null)q=!0;else{var me=c(w);me!==null&&_e(B,me.startTime-y),q=!1}}break e}finally{k=null,T=H,E=!1}q=void 0}}finally{q?be():X=!1}}}var be;if(typeof G=="function")be=function(){G(ye)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,je=pe.port2;pe.port1.onmessage=ye,be=function(){je.postMessage(null)}}else be=function(){M(ye,0)};function _e(y,q){S=M(function(){y(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(y){y.callback=null},n.unstable_forceFrameRate=function(y){0>y||125ie?(y.sortIndex=H,r(w,y),c(p)===null&&y===c(w)&&(F?(Z(S),S=-1):F=!0,_e(B,H-ie))):(y.sortIndex=_,r(p,y),R||E||(R=!0,X||(X=!0,be()))),y},n.unstable_shouldYield=he,n.unstable_wrapCallback=function(y){var q=T;return function(){var H=T;T=q;try{return y.apply(this,arguments)}finally{T=H}}}})(wu)),wu}var Yf;function xN(){return Yf||(Yf=1,Nu.exports=hN()),Nu.exports}var Xf;function fN(){if(Xf)return er;Xf=1;var n=xN(),r=ab(),c=lb();function d(t){var s="https://react.dev/errors/"+t;if(1_||(t.current=ie[_],ie[_]=null,_--)}function Q(t,s){_++,ie[_]=t.current,t.current=s}var de=me(null),ge=me(null),le=me(null),L=me(null);function $(t,s){switch(Q(le,s),Q(ge,t),Q(de,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?cf(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=cf(s),t=of(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}xe(de),Q(de,t)}function D(){xe(de),xe(ge),xe(le)}function ee(t){t.memoizedState!==null&&Q(L,t);var s=de.current,a=of(s,t.type);s!==a&&(Q(ge,t),Q(de,a))}function Ne(t){ge.current===t&&(xe(de),xe(ge)),L.current===t&&(xe(L),Xi._currentValue=H)}var ze,We;function Xe(t){if(ze===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);ze=s&&s[1]||"",We=-1)":-1i||C[l]!==I[i]){var ae=` +`+C[l].replace(" at new "," at ");return t.displayName&&ae.includes("")&&(ae=ae.replace("",t.displayName)),ae}while(1<=l&&0<=i);break}}}finally{Mt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Xe(a):""}function re(t,s){switch(t.tag){case 26:case 27:case 5:return Xe(t.type);case 16:return Xe("Lazy");case 13:return t.child!==s&&s!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return qt(t.type,!1);case 11:return qt(t.type.render,!1);case 1:return qt(t.type,!0);case 31:return Xe("Activity");default:return""}}function we(t){try{var s="",a=null;do s+=re(t,a),a=t,t=t.return;while(t);return s}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var Je=Object.prototype.hasOwnProperty,Fe=n.unstable_scheduleCallback,Wt=n.unstable_cancelCallback,Xs=n.unstable_shouldYield,Ns=n.unstable_requestPaint,Ke=n.unstable_now,Ue=n.unstable_getCurrentPriorityLevel,js=n.unstable_ImmediatePriority,ls=n.unstable_UserBlockingPriority,_s=n.unstable_NormalPriority,Ss=n.unstable_LowPriority,nl=n.unstable_IdlePriority,il=n.log,rl=n.unstable_setDisableYieldValue,Se=null,Oe=null;function ns(t){if(typeof il=="function"&&rl(t),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Se,t)}catch{}}var ds=Math.clz32?Math.clz32:us,ri=Math.log,rn=Math.LN2;function us(t){return t>>>=0,t===0?32:31-(ri(t)/rn|0)|0}var Ks=256,Zs=262144,Oa=4194304;function Ls(t){var s=t&42;if(s!==0)return s;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ra(t,s,a){var l=t.pendingLanes;if(l===0)return 0;var i=0,o=t.suspendedLanes,m=t.pingedLanes;t=t.warmLanes;var g=l&134217727;return g!==0?(l=g&~o,l!==0?i=Ls(l):(m&=g,m!==0?i=Ls(m):a||(a=g&~t,a!==0&&(i=Ls(a))))):(g=l&~o,g!==0?i=Ls(g):m!==0?i=Ls(m):a||(a=l&~t,a!==0&&(i=Ls(a)))),i===0?0:s!==0&&s!==i&&(s&o)===0&&(o=i&-i,a=s&-s,o>=a||o===32&&(a&4194048)!==0)?s:i}function ba(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function W(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ve(){var t=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),t}function Ae(t){for(var s=[],a=0;31>a;a++)s.push(t);return s}function es(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Us(t,s,a,l,i,o){var m=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var g=t.entanglements,C=t.expirationTimes,I=t.hiddenUpdates;for(a=m&~a;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var $g=/[\n"\\]/g;function Ws(t){return t.replace($g,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function uo(t,s,a,l,i,o,m,g){t.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?t.type=m:t.removeAttribute("type"),s!=null?m==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+Ps(s)):t.value!==""+Ps(s)&&(t.value=""+Ps(s)):m!=="submit"&&m!=="reset"||t.removeAttribute("value"),s!=null?mo(t,m,Ps(s)):a!=null?mo(t,m,Ps(a)):l!=null&&t.removeAttribute("value"),i==null&&o!=null&&(t.defaultChecked=!!o),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.name=""+Ps(g):t.removeAttribute("name")}function tm(t,s,a,l,i,o,m,g){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.type=o),s!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||s!=null)){oo(t);return}a=a!=null?""+Ps(a):"",s=s!=null?""+Ps(s):a,g||s===t.value||(t.value=s),t.defaultValue=s}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=g?t.checked:!!l,t.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.name=m),oo(t)}function mo(t,s,a){s==="number"&&_r(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function xn(t,s,a,l){if(t=t.options,s){s={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),go=!1;if(Ba)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){go=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{go=!1}var ol=null,jo=null,Cr=null;function cm(){if(Cr)return Cr;var t,s=jo,a=s.length,l,i="value"in ol?ol.value:ol.textContent,o=i.length;for(t=0;t=xi),xm=" ",fm=!1;function pm(t,s){switch(t){case"keyup":return jj.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var jn=!1;function bj(t,s){switch(t){case"compositionend":return gm(s);case"keypress":return s.which!==32?null:(fm=!0,xm);case"textInput":return t=s.data,t===xm&&fm?null:t;default:return null}}function yj(t,s){if(jn)return t==="compositionend"||!wo&&pm(t,s)?(t=cm(),Cr=jo=ol=null,jn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:a,offset:s-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Sm(a)}}function km(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?km(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Tm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=_r(t.document);s instanceof t.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)t=s.contentWindow;else break;s=_r(t.document)}return s}function Co(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var Ej=Ba&&"documentMode"in document&&11>=document.documentMode,vn=null,ko=null,ji=null,To=!1;function Em(t,s,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;To||vn==null||vn!==_r(l)||(l=vn,"selectionStart"in l&&Co(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ji&&gi(ji,l)||(ji=l,l=vc(ko,"onSelect"),0>=m,i-=m,Na=1<<32-ds(s)+i|a<Ze?(nt=Te,Te=null):nt=Te.sibling;var vt=P(V,Te,J[Ze],oe);if(vt===null){Te===null&&(Te=nt);break}t&&Te&&vt.alternate===null&&s(V,Te),A=o(vt,A,Ze),jt===null?Ee=vt:jt.sibling=vt,jt=vt,Te=nt}if(Ze===J.length)return a(V,Te),xt&&qa(V,Ze),Ee;if(Te===null){for(;ZeZe?(nt=Te,Te=null):nt=Te.sibling;var Al=P(V,Te,vt.value,oe);if(Al===null){Te===null&&(Te=nt);break}t&&Te&&Al.alternate===null&&s(V,Te),A=o(Al,A,Ze),jt===null?Ee=Al:jt.sibling=Al,jt=Al,Te=nt}if(vt.done)return a(V,Te),xt&&qa(V,Ze),Ee;if(Te===null){for(;!vt.done;Ze++,vt=J.next())vt=ue(V,vt.value,oe),vt!==null&&(A=o(vt,A,Ze),jt===null?Ee=vt:jt.sibling=vt,jt=vt);return xt&&qa(V,Ze),Ee}for(Te=l(Te);!vt.done;Ze++,vt=J.next())vt=te(Te,V,Ze,vt.value,oe),vt!==null&&(t&&vt.alternate!==null&&Te.delete(vt.key===null?Ze:vt.key),A=o(vt,A,Ze),jt===null?Ee=vt:jt.sibling=vt,jt=vt);return t&&Te.forEach(function(Zv){return s(V,Zv)}),xt&&qa(V,Ze),Ee}function kt(V,A,J,oe){if(typeof J=="object"&&J!==null&&J.type===F&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case E:e:{for(var Ee=J.key;A!==null;){if(A.key===Ee){if(Ee=J.type,Ee===F){if(A.tag===7){a(V,A.sibling),oe=i(A,J.props.children),oe.return=V,V=oe;break e}}else if(A.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===O&&Kl(Ee)===A.type){a(V,A.sibling),oe=i(A,J.props),_i(oe,J),oe.return=V,V=oe;break e}a(V,A);break}else s(V,A);A=A.sibling}J.type===F?(oe=Fl(J.props.children,V.mode,oe,J.key),oe.return=V,V=oe):(oe=Lr(J.type,J.key,J.props,null,V.mode,oe),_i(oe,J),oe.return=V,V=oe)}return m(V);case R:e:{for(Ee=J.key;A!==null;){if(A.key===Ee)if(A.tag===4&&A.stateNode.containerInfo===J.containerInfo&&A.stateNode.implementation===J.implementation){a(V,A.sibling),oe=i(A,J.children||[]),oe.return=V,V=oe;break e}else{a(V,A);break}else s(V,A);A=A.sibling}oe=Ro(J,V.mode,oe),oe.return=V,V=oe}return m(V);case O:return J=Kl(J),kt(V,A,J,oe)}if(_e(J))return Ce(V,A,J,oe);if(be(J)){if(Ee=be(J),typeof Ee!="function")throw Error(d(150));return J=Ee.call(J),De(V,A,J,oe)}if(typeof J.then=="function")return kt(V,A,Fr(J),oe);if(J.$$typeof===G)return kt(V,A,Hr(V,J),oe);$r(V,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,A!==null&&A.tag===6?(a(V,A.sibling),oe=i(A,J),oe.return=V,V=oe):(a(V,A),oe=Oo(J,V.mode,oe),oe.return=V,V=oe),m(V)):a(V,A)}return function(V,A,J,oe){try{wi=0;var Ee=kt(V,A,J,oe);return zn=null,Ee}catch(Te){if(Te===En||Te===Gr)throw Te;var jt=Hs(29,Te,null,V.mode);return jt.lanes=oe,jt.return=V,jt}finally{}}}var Jl=Pm(!0),Wm=Pm(!1),xl=!1;function Xo(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ko(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function fl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pl(t,s,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(bt&2)!==0){var i=l.pending;return i===null?s.next=s:(s.next=i.next,i.next=s),l.pending=s,s=Rr(t),Lm(t,null,a),s}return Or(t,l,s,a),Rr(t)}function Si(t,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var l=s.lanes;l&=t.pendingLanes,a|=l,s.lanes=a,cl(t,a)}}function Zo(t,s){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var i=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var m={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?i=o=m:o=o.next=m,a=a.next}while(a!==null);o===null?i=o=s:o=o.next=s}else i=o=s;a={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=s:t.next=s,a.lastBaseUpdate=s}var Jo=!1;function Ci(){if(Jo){var t=Tn;if(t!==null)throw t}}function ki(t,s,a,l){Jo=!1;var i=t.updateQueue;xl=!1;var o=i.firstBaseUpdate,m=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var C=g,I=C.next;C.next=null,m===null?o=I:m.next=I,m=C;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,g=ae.lastBaseUpdate,g!==m&&(g===null?ae.firstBaseUpdate=I:g.next=I,ae.lastBaseUpdate=C))}if(o!==null){var ue=i.baseState;m=0,ae=I=C=null,g=o;do{var P=g.lane&-536870913,te=P!==g.lane;if(te?(lt&P)===P:(l&P)===P){P!==0&&P===kn&&(Jo=!0),ae!==null&&(ae=ae.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var Ce=t,De=g;P=s;var kt=a;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){ue=Ce.call(kt,ue,P);break e}ue=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,P=typeof Ce=="function"?Ce.call(kt,ue,P):Ce,P==null)break e;ue=k({},ue,P);break e;case 2:xl=!0}}P=g.callback,P!==null&&(t.flags|=64,te&&(t.flags|=8192),te=i.callbacks,te===null?i.callbacks=[P]:te.push(P))}else te={lane:P,tag:g.tag,payload:g.payload,callback:g.callback,next:null},ae===null?(I=ae=te,C=ue):ae=ae.next=te,m|=P;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;te=g,g=te.next,te.next=null,i.lastBaseUpdate=te,i.shared.pending=null}}while(!0);ae===null&&(C=ue),i.baseState=C,i.firstBaseUpdate=I,i.lastBaseUpdate=ae,o===null&&(i.shared.lanes=0),yl|=m,t.lanes=m,t.memoizedState=ue}}function eh(t,s){if(typeof t!="function")throw Error(d(191,t));t.call(s)}function th(t,s){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;to?o:8;var m=y.T,g={};y.T=g,fd(t,!1,s,a);try{var C=i(),I=y.S;if(I!==null&&I(g,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var ae=Bj(C,l);zi(t,s,ae,$s(t))}else zi(t,s,l,$s(t))}catch(ue){zi(t,s,{then:function(){},status:"rejected",reason:ue},$s())}finally{q.p=o,m!==null&&g.types!==null&&(m.types=g.types),y.T=m}}function $j(){}function hd(t,s,a,l){if(t.tag!==5)throw Error(d(476));var i=Dh(t).queue;Mh(t,i,s,H,a===null?$j:function(){return Oh(t),a(l)})}function Dh(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:H},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:a},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function Oh(t){var s=Dh(t);s.next===null&&(s=t.alternate.memoizedState),zi(t,s.next.queue,{},$s())}function xd(){return hs(Xi)}function Rh(){return Xt().memoizedState}function Lh(){return Xt().memoizedState}function Qj(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var a=$s();t=fl(a);var l=pl(s,t,a);l!==null&&(Ms(l,s,a),Si(l,s,a)),s={cache:Fo()},t.payload=s;return}s=s.return}}function Yj(t,s,a){var l=$s();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ec(t)?Bh(s,a):(a=Mo(t,s,a,l),a!==null&&(Ms(a,t,l),Hh(a,s,l)))}function Uh(t,s,a){var l=$s();zi(t,s,a,l)}function zi(t,s,a,l){var i={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ec(t))Bh(s,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=s.lastRenderedReducer,o!==null))try{var m=s.lastRenderedState,g=o(m,a);if(i.hasEagerState=!0,i.eagerState=g,Bs(g,m))return Or(t,s,i,0),Et===null&&Dr(),!1}catch{}finally{}if(a=Mo(t,s,i,l),a!==null)return Ms(a,t,l),Hh(a,s,l),!0}return!1}function fd(t,s,a,l){if(l={lane:2,revertLane:Xd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ec(t)){if(s)throw Error(d(479))}else s=Mo(t,a,l,2),s!==null&&Ms(s,t,2)}function ec(t){var s=t.alternate;return t===Ye||s!==null&&s===Ye}function Bh(t,s){Mn=Xr=!0;var a=t.pending;a===null?s.next=s:(s.next=a.next,a.next=s),t.pending=s}function Hh(t,s,a){if((a&4194048)!==0){var l=s.lanes;l&=t.pendingLanes,a|=l,s.lanes=a,cl(t,a)}}var Ai={readContext:hs,use:Jr,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};Ai.useEffectEvent=Gt;var qh={readContext:hs,use:Jr,useCallback:function(t,s){return ws().memoizedState=[t,s===void 0?null:s],t},useContext:hs,useEffect:wh,useImperativeHandle:function(t,s,a){a=a!=null?a.concat([t]):null,Pr(4194308,4,kh.bind(null,s,t),a)},useLayoutEffect:function(t,s){return Pr(4194308,4,t,s)},useInsertionEffect:function(t,s){Pr(4,2,t,s)},useMemo:function(t,s){var a=ws();s=s===void 0?null:s;var l=t();if(Il){ns(!0);try{t()}finally{ns(!1)}}return a.memoizedState=[l,s],l},useReducer:function(t,s,a){var l=ws();if(a!==void 0){var i=a(s);if(Il){ns(!0);try{a(s)}finally{ns(!1)}}}else i=s;return l.memoizedState=l.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},l.queue=t,t=t.dispatch=Yj.bind(null,Ye,t),[l.memoizedState,t]},useRef:function(t){var s=ws();return t={current:t},s.memoizedState=t},useState:function(t){t=cd(t);var s=t.queue,a=Uh.bind(null,Ye,s);return s.dispatch=a,[t.memoizedState,a]},useDebugValue:ud,useDeferredValue:function(t,s){var a=ws();return md(a,t,s)},useTransition:function(){var t=cd(!1);return t=Mh.bind(null,Ye,t.queue,!0,!1),ws().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,a){var l=Ye,i=ws();if(xt){if(a===void 0)throw Error(d(407));a=a()}else{if(a=s(),Et===null)throw Error(d(349));(lt&127)!==0||rh(l,s,a)}i.memoizedState=a;var o={value:a,getSnapshot:s};return i.queue=o,wh(oh.bind(null,l,o,t),[t]),l.flags|=2048,On(9,{destroy:void 0},ch.bind(null,l,o,a,s),null),a},useId:function(){var t=ws(),s=Et.identifierPrefix;if(xt){var a=wa,l=Na;a=(l&~(1<<32-ds(l)-1)).toString(32)+a,s="_"+s+"R_"+a,a=Kr++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?m.createElement(i,{is:l.is}):m.createElement(i)}}o[qe]=s,o[ht]=l;e:for(m=s.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===s)break e;for(;m.sibling===null;){if(m.return===null||m.return===s)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}s.stateNode=o;e:switch(fs(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ya(s)}}return At(s),Ed(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,a),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==l&&Ya(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(d(166));if(t=le.current,Sn(s)){if(t=s.stateNode,a=s.memoizedProps,l=null,i=ms,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}t[qe]=s,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||nf(t.nodeValue,a)),t||ml(s,!0)}else t=bc(t).createTextNode(l),t[qe]=s,s.stateNode=t}return At(s),null;case 31:if(a=s.memoizedState,t===null||t.memoizedState!==null){if(l=Sn(s),a!==null){if(t===null){if(!l)throw Error(d(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(d(557));t[qe]=s}else $l(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;At(s),t=!1}else a=Ho(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return s.flags&256?(Gs(s),s):(Gs(s),null);if((s.flags&128)!==0)throw Error(d(558))}return At(s),null;case 13:if(l=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=Sn(s),l!==null&&l.dehydrated!==null){if(t===null){if(!i)throw Error(d(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(d(317));i[qe]=s}else $l(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;At(s),i=!1}else i=Ho(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return s.flags&256?(Gs(s),s):(Gs(s),null)}return Gs(s),(s.flags&128)!==0?(s.lanes=a,s):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=s.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),a!==t&&a&&(s.child.flags|=8192),nc(s,s.updateQueue),At(s),null);case 4:return D(),t===null&&Id(s.stateNode.containerInfo),At(s),null;case 10:return Va(s.type),At(s),null;case 19:if(xe(Yt),l=s.memoizedState,l===null)return At(s),null;if(i=(s.flags&128)!==0,o=l.rendering,o===null)if(i)Di(l,!1);else{if(Vt!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(o=Yr(t),o!==null){for(s.flags|=128,Di(l,!1),t=o.updateQueue,s.updateQueue=t,nc(s,t),s.subtreeFlags=0,t=a,a=s.child;a!==null;)Um(a,t),a=a.sibling;return Q(Yt,Yt.current&1|2),xt&&qa(s,l.treeForkCount),s.child}t=t.sibling}l.tail!==null&&Ke()>dc&&(s.flags|=128,i=!0,Di(l,!1),s.lanes=4194304)}else{if(!i)if(t=Yr(o),t!==null){if(s.flags|=128,i=!0,t=t.updateQueue,s.updateQueue=t,nc(s,t),Di(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!xt)return At(s),null}else 2*Ke()-l.renderingStartTime>dc&&a!==536870912&&(s.flags|=128,i=!0,Di(l,!1),s.lanes=4194304);l.isBackwards?(o.sibling=s.child,s.child=o):(t=l.last,t!==null?t.sibling=o:s.child=o,l.last=o)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ke(),t.sibling=null,a=Yt.current,Q(Yt,i?a&1|2:a&1),xt&&qa(s,l.treeForkCount),t):(At(s),null);case 22:case 23:return Gs(s),Po(),l=s.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(a&536870912)!==0&&(s.flags&128)===0&&(At(s),s.subtreeFlags&6&&(s.flags|=8192)):At(s),a=s.updateQueue,a!==null&&nc(s,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==a&&(s.flags|=2048),t!==null&&xe(Xl),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Va(Zt),At(s),null;case 25:return null;case 30:return null}throw Error(d(156,s.tag))}function Ij(t,s){switch(Uo(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Va(Zt),D(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return Ne(s),null;case 31:if(s.memoizedState!==null){if(Gs(s),s.alternate===null)throw Error(d(340));$l()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(Gs(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(d(340));$l()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return xe(Yt),null;case 4:return D(),null;case 10:return Va(s.type),null;case 22:case 23:return Gs(s),Po(),t!==null&&xe(Xl),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Va(Zt),null;case 25:return null;default:return null}}function dx(t,s){switch(Uo(s),s.tag){case 3:Va(Zt),D();break;case 26:case 27:case 5:Ne(s);break;case 4:D();break;case 31:s.memoizedState!==null&&Gs(s);break;case 13:Gs(s);break;case 19:xe(Yt);break;case 10:Va(s.type);break;case 22:case 23:Gs(s),Po(),t!==null&&xe(Xl);break;case 24:Va(Zt)}}function Oi(t,s){try{var a=s.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&t)===t){l=void 0;var o=a.create,m=a.inst;l=o(),m.destroy=l}a=a.next}while(a!==i)}}catch(g){wt(s,s.return,g)}}function vl(t,s,a){try{var l=s.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&t)===t){var m=l.inst,g=m.destroy;if(g!==void 0){m.destroy=void 0,i=s;var C=a,I=g;try{I()}catch(ae){wt(i,C,ae)}}}l=l.next}while(l!==o)}}catch(ae){wt(s,s.return,ae)}}function ux(t){var s=t.updateQueue;if(s!==null){var a=t.stateNode;try{th(s,a)}catch(l){wt(t,t.return,l)}}}function mx(t,s,a){a.props=Pl(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){wt(t,s,l)}}function Ri(t,s){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(i){wt(t,s,i)}}function _a(t,s){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(i){wt(t,s,i)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){wt(t,s,i)}else a.current=null}function hx(t){var s=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(i){wt(t,t.return,i)}}function zd(t,s,a){try{var l=t.stateNode;vv(l,t.type,a,s),l[ht]=s}catch(i){wt(t,t.return,i)}}function xx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Cl(t.type)||t.tag===4}function Ad(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Cl(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Md(t,s,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(t),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=Ua));else if(l!==4&&(l===27&&Cl(t.type)&&(a=t.stateNode,s=null),t=t.child,t!==null))for(Md(t,s,a),t=t.sibling;t!==null;)Md(t,s,a),t=t.sibling}function ic(t,s,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,s?a.insertBefore(t,s):a.appendChild(t);else if(l!==4&&(l===27&&Cl(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(ic(t,s,a),t=t.sibling;t!==null;)ic(t,s,a),t=t.sibling}function fx(t){var s=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,i=s.attributes;i.length;)s.removeAttributeNode(i[0]);fs(s,l,a),s[qe]=t,s[ht]=a}catch(o){wt(t,t.return,o)}}var Xa=!1,Pt=!1,Dd=!1,px=typeof WeakSet=="function"?WeakSet:Set,rs=null;function Pj(t,s){if(t=t.containerInfo,eu=kc,t=Tm(t),Co(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var m=0,g=-1,C=-1,I=0,ae=0,ue=t,P=null;t:for(;;){for(var te;ue!==a||i!==0&&ue.nodeType!==3||(g=m+i),ue!==o||l!==0&&ue.nodeType!==3||(C=m+l),ue.nodeType===3&&(m+=ue.nodeValue.length),(te=ue.firstChild)!==null;)P=ue,ue=te;for(;;){if(ue===t)break t;if(P===a&&++I===i&&(g=m),P===o&&++ae===l&&(C=m),(te=ue.nextSibling)!==null)break;ue=P,P=ue.parentNode}ue=te}a=g===-1||C===-1?null:{start:g,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(tu={focusedElem:t,selectionRange:a},kc=!1,rs=s;rs!==null;)if(s=rs,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,rs=t;else for(;rs!==null;){switch(s=rs,o=s.alternate,t=s.flags,s.tag){case 0:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a title"))),fs(o,l,a),o[qe]=t,is(o),l=o;break e;case"link":var m=wf("link","href",i).get(l+(a.href||""));if(m){for(var g=0;gkt&&(m=kt,kt=De,De=m);var V=Cm(g,De),A=Cm(g,kt);if(V&&A&&(te.rangeCount!==1||te.anchorNode!==V.node||te.anchorOffset!==V.offset||te.focusNode!==A.node||te.focusOffset!==A.offset)){var J=ue.createRange();J.setStart(V.node,V.offset),te.removeAllRanges(),De>kt?(te.addRange(J),te.extend(A.node,A.offset)):(J.setEnd(A.node,A.offset),te.addRange(J))}}}}for(ue=[],te=g;te=te.parentNode;)te.nodeType===1&&ue.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;ga?32:a,y.T=null,a=qd,qd=null;var o=wl,m=Pa;if(ts=0,Hn=wl=null,Pa=0,(bt&6)!==0)throw Error(d(331));var g=bt;if(bt|=4,kx(o.current),_x(o,o.current,m,a),bt=g,Gi(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Se,o)}catch{}return!0}finally{q.p=i,y.T=l,Qx(t,s)}}function Xx(t,s,a){s=ta(a,s),s=vd(t.stateNode,s,2),t=pl(t,s,2),t!==null&&(es(t,2),Sa(t))}function wt(t,s,a){if(t.tag===3)Xx(t,t,a);else for(;s!==null;){if(s.tag===3){Xx(s,t,a);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Nl===null||!Nl.has(l))){t=ta(a,t),a=Kh(2),l=pl(s,a,2),l!==null&&(Zh(a,l,s,t),es(l,2),Sa(l));break}}s=s.return}}function $d(t,s,a){var l=t.pingCache;if(l===null){l=t.pingCache=new tv;var i=new Set;l.set(s,i)}else i=l.get(s),i===void 0&&(i=new Set,l.set(s,i));i.has(a)||(Ld=!0,i.add(a),t=iv.bind(null,t,s,a),s.then(t,t))}function iv(t,s,a){var l=t.pingCache;l!==null&&l.delete(s),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Et===t&&(lt&a)===a&&(Vt===4||Vt===3&&(lt&62914560)===lt&&300>Ke()-oc?(bt&2)===0&&qn(t,0):Ud|=a,Bn===lt&&(Bn=0)),Sa(t)}function Kx(t,s){s===0&&(s=ve()),t=Vl(t,s),t!==null&&(es(t,s),Sa(t))}function rv(t){var s=t.memoizedState,a=0;s!==null&&(a=s.retryLane),Kx(t,a)}function cv(t,s){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,i=t.memoizedState;i!==null&&(a=i.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(d(314))}l!==null&&l.delete(s),Kx(t,a)}function ov(t,s){return Fe(t,s)}var pc=null,Vn=null,Qd=!1,gc=!1,Yd=!1,Sl=0;function Sa(t){t!==Vn&&t.next===null&&(Vn===null?pc=Vn=t:Vn=Vn.next=t),gc=!0,Qd||(Qd=!0,uv())}function Gi(t,s){if(!Yd&&gc){Yd=!0;do for(var a=!1,l=pc;l!==null;){if(t!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var m=l.suspendedLanes,g=l.pingedLanes;o=(1<<31-ds(42|t)+1)-1,o&=i&~(m&~g),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Px(l,o))}else o=lt,o=Ra(l,l===Et?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||ba(l,o)||(a=!0,Px(l,o));l=l.next}while(a);Yd=!1}}function dv(){Zx()}function Zx(){gc=Qd=!1;var t=0;Sl!==0&&yv()&&(t=Sl);for(var s=Ke(),a=null,l=pc;l!==null;){var i=l.next,o=Jx(l,s);o===0?(l.next=null,a===null?pc=i:a.next=i,i===null&&(Vn=a)):(a=l,(t!==0||(o&3)!==0)&&(gc=!0)),l=i}ts!==0&&ts!==5||Gi(t),Sl!==0&&(Sl=0)}function Jx(t,s){for(var a=t.suspendedLanes,l=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes&-62914561;0g)break;var ae=C.transferSize,ue=C.initiatorType;ae&&rf(ue)&&(C=C.responseEnd,m+=ae*(C"u"?null:document;function vf(t,s,a){var l=Fn;if(l&&typeof s=="string"&&s){var i=Ws(s);i='link[rel="'+t+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),jf.has(i)||(jf.add(i),t={rel:t,crossOrigin:a,href:s},l.querySelector(i)===null&&(s=l.createElement("link"),fs(s,"link",t),is(s),l.head.appendChild(s)))}}function zv(t){Wa.D(t),vf("dns-prefetch",t,null)}function Av(t,s){Wa.C(t,s),vf("preconnect",t,s)}function Mv(t,s,a){Wa.L(t,s,a);var l=Fn;if(l&&t&&s){var i='link[rel="preload"][as="'+Ws(s)+'"]';s==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+Ws(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+Ws(a.imageSizes)+'"]')):i+='[href="'+Ws(t)+'"]';var o=i;switch(s){case"style":o=$n(t);break;case"script":o=Qn(t)}ra.has(o)||(t=k({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:t,as:s},a),ra.set(o,t),l.querySelector(i)!==null||s==="style"&&l.querySelector(Qi(o))||s==="script"&&l.querySelector(Yi(o))||(s=l.createElement("link"),fs(s,"link",t),is(s),l.head.appendChild(s)))}}function Dv(t,s){Wa.m(t,s);var a=Fn;if(a&&t){var l=s&&typeof s.as=="string"?s.as:"script",i='link[rel="modulepreload"][as="'+Ws(l)+'"][href="'+Ws(t)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Qn(t)}if(!ra.has(o)&&(t=k({rel:"modulepreload",href:t},s),ra.set(o,t),a.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Yi(o)))return}l=a.createElement("link"),fs(l,"link",t),is(l),a.head.appendChild(l)}}}function Ov(t,s,a){Wa.S(t,s,a);var l=Fn;if(l&&t){var i=mn(l).hoistableStyles,o=$n(t);s=s||"default";var m=i.get(o);if(!m){var g={loading:0,preload:null};if(m=l.querySelector(Qi(o)))g.loading=5;else{t=k({rel:"stylesheet",href:t,"data-precedence":s},a),(a=ra.get(o))&&cu(t,a);var C=m=l.createElement("link");is(C),fs(C,"link",t),C._p=new Promise(function(I,ae){C.onload=I,C.onerror=ae}),C.addEventListener("load",function(){g.loading|=1}),C.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Nc(m,s,l)}m={type:"stylesheet",instance:m,count:1,state:g},i.set(o,m)}}}function Rv(t,s){Wa.X(t,s);var a=Fn;if(a&&t){var l=mn(a).hoistableScripts,i=Qn(t),o=l.get(i);o||(o=a.querySelector(Yi(i)),o||(t=k({src:t,async:!0},s),(s=ra.get(i))&&ou(t,s),o=a.createElement("script"),is(o),fs(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Lv(t,s){Wa.M(t,s);var a=Fn;if(a&&t){var l=mn(a).hoistableScripts,i=Qn(t),o=l.get(i);o||(o=a.querySelector(Yi(i)),o||(t=k({src:t,async:!0,type:"module"},s),(s=ra.get(i))&&ou(t,s),o=a.createElement("script"),is(o),fs(o,"link",t),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function bf(t,s,a,l){var i=(i=le.current)?yc(i):null;if(!i)throw Error(d(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=$n(a.href),a=mn(i).hoistableStyles,l=a.get(s),l||(l={type:"style",instance:null,count:0,state:null},a.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=$n(a.href);var o=mn(i).hoistableStyles,m=o.get(t);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(t,m),(o=i.querySelector(Qi(t)))&&!o._p&&(m.instance=o,m.state.loading=5),ra.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ra.set(t,a),o||Uv(i,t,a,m.state))),s&&l===null)throw Error(d(528,""));return m}if(s&&l!==null)throw Error(d(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Qn(a),a=mn(i).hoistableScripts,l=a.get(s),l||(l={type:"script",instance:null,count:0,state:null},a.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,t))}}function $n(t){return'href="'+Ws(t)+'"'}function Qi(t){return'link[rel="stylesheet"]['+t+"]"}function yf(t){return k({},t,{"data-precedence":t.precedence,precedence:null})}function Uv(t,s,a,l){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=t.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),fs(s,"link",a),is(s),t.head.appendChild(s))}function Qn(t){return'[src="'+Ws(t)+'"]'}function Yi(t){return"script[async]"+t}function Nf(t,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var l=t.querySelector('style[data-href~="'+Ws(a.href)+'"]');if(l)return s.instance=l,is(l),l;var i=k({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),is(l),fs(l,"style",i),Nc(l,a.precedence,t),s.instance=l;case"stylesheet":i=$n(a.href);var o=t.querySelector(Qi(i));if(o)return s.state.loading|=4,s.instance=o,is(o),o;l=yf(a),(i=ra.get(i))&&cu(l,i),o=(t.ownerDocument||t).createElement("link"),is(o);var m=o;return m._p=new Promise(function(g,C){m.onload=g,m.onerror=C}),fs(o,"link",l),s.state.loading|=4,Nc(o,a.precedence,t),s.instance=o;case"script":return o=Qn(a.src),(i=t.querySelector(Yi(o)))?(s.instance=i,is(i),i):(l=a,(i=ra.get(o))&&(l=k({},a),ou(l,i)),t=t.ownerDocument||t,i=t.createElement("script"),is(i),fs(i,"link",l),t.head.appendChild(i),s.instance=i);case"void":return null;default:throw Error(d(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,Nc(l,a.precedence,t));return s.instance}function Nc(t,s,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,m=0;m title"):null)}function Bv(t,s,a){if(a===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Sf(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Hv(t,s,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=$n(l.href),o=s.querySelector(Qi(i));if(o){s=o._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=_c.bind(t),s.then(t,t)),a.state.loading|=4,a.instance=o,is(o);return}o=s.ownerDocument||s,l=yf(l),(i=ra.get(i))&&cu(l,i),o=o.createElement("link"),is(o);var m=o;m._p=new Promise(function(g,C){m.onload=g,m.onerror=C}),fs(o,"link",l),a.instance=o}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=_c.bind(t),s.addEventListener("load",a),s.addEventListener("error",a))}}var du=0;function qv(t,s){return t.stylesheets&&t.count===0&&Cc(t,t.stylesheets),0du?50:800)+s);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function _c(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Sc=null;function Cc(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Sc=new Map,s.forEach(Gv,t),Sc=null,_c.call(t))}function Gv(t,s){if(!(s.state.loading&4)){var a=Sc.get(t);if(a)var l=a.get(null);else{a=new Map,Sc.set(t,a);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),yu.exports=fN(),yu.exports}var gN=pN();function K(...n){return ib(rb(n))}const Ve=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("rounded-xl border bg-card text-card-foreground shadow",n),...r}));Ve.displayName="Card";const pt=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("flex flex-col space-y-1.5 p-6",n),...r}));pt.displayName="CardHeader";const gt=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("font-semibold leading-none tracking-tight",n),...r}));gt.displayName="CardTitle";const Kt=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("text-sm text-muted-foreground",n),...r}));Kt.displayName="CardDescription";const yt=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("p-6 pt-0",n),...r}));yt.displayName="CardContent";const og=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("flex items-center p-6 pt-0",n),...r}));og.displayName="CardFooter";const Aa=db,ja=u.forwardRef(({className:n,...r},c)=>e.jsx(xp,{ref:c,className:K("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...r}));ja.displayName=xp.displayName;const st=u.forwardRef(({className:n,...r},c)=>e.jsx(fp,{ref:c,className:K("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 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",n),...r}));st.displayName=fp.displayName;const _t=u.forwardRef(({className:n,...r},c)=>e.jsx(pp,{ref:c,className:K("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",n),...r}));_t.displayName=pp.displayName;const Ie=u.forwardRef(({className:n,children:r,viewportRef:c,...d},h)=>e.jsxs(gp,{ref:h,className:K("relative overflow-hidden",n),...d,children:[e.jsx(ub,{ref:c,className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(zu,{}),e.jsx(zu,{orientation:"horizontal"}),e.jsx(mb,{})]}));Ie.displayName=gp.displayName;const zu=u.forwardRef(({className:n,orientation:r="vertical",...c},d)=>e.jsx(jp,{ref:d,orientation:r,className:K("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...c,children:e.jsx(hb,{className:"relative flex-1 rounded-full bg-border"})}));zu.displayName=jp.displayName;function dg({className:n,...r}){return e.jsx("div",{className:K("animate-pulse rounded-md bg-primary/10",n),...r})}const vr=u.forwardRef(({className:n,value:r,...c},d)=>e.jsx(vp,{ref:d,className:K("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...c,children:e.jsx(xb,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));vr.displayName=vp.displayName;const jN={light:"",dark:".dark"},ug=u.createContext(null);function mg(){const n=u.useContext(ug);if(!n)throw new Error("useChart must be used within a ");return n}const Xn=u.forwardRef(({id:n,className:r,children:c,config:d,...h},x)=>{const f=u.useId(),j=`chart-${n||f.replace(/:/g,"")}`;return e.jsx(ug.Provider,{value:{config:d},children:e.jsxs("div",{"data-chart":j,ref:x,className:K("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",r),...h,children:[e.jsx(vN,{id:j,config:d}),e.jsx(Tb,{children:c})]})})});Xn.displayName="Chart";const vN=({id:n,config:r})=>{const c=Object.entries(r).filter(([,d])=>d.theme||d.color);return c.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(jN).map(([d,h])=>` +${h} [data-chart=${n}] { +${c.map(([x,f])=>{const j=f.theme?.[d]||f.color;return j?` --color-${x}: ${j};`:null}).join(` +`)} +} +`).join(` +`)}}):null},tr=Eb,Kn=u.forwardRef(({active:n,payload:r,className:c,indicator:d="dot",hideLabel:h=!1,hideIndicator:x=!1,label:f,labelFormatter:j,labelClassName:p,formatter:w,color:v,nameKey:k,labelKey:T},E)=>{const{config:R}=mg(),F=u.useMemo(()=>{if(h||!r?.length)return null;const[M]=r,Z=`${T||M?.dataKey||M?.name||"value"}`,G=Au(R,M,Z),z=!T&&typeof f=="string"?R[f]?.label||f:G?.label;return j?e.jsx("div",{className:K("font-medium",p),children:j(z,r)}):z?e.jsx("div",{className:K("font-medium",p),children:z}):null},[f,j,r,h,p,R,T]);if(!n||!r?.length)return null;const U=r.length===1&&d!=="dot";return e.jsxs("div",{ref:E,className:K("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",c),children:[U?null:F,e.jsx("div",{className:"grid gap-1.5",children:r.filter(M=>M.type!=="none").map((M,Z)=>{const G=`${k||M.name||M.dataKey||"value"}`,z=Au(R,M,G),B=v||M.payload.fill||M.color;return e.jsx("div",{className:K("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",d==="dot"&&"items-center"),children:w&&M?.value!==void 0&&M.name?w(M.value,M.name,M,Z,M.payload):e.jsxs(e.Fragment,{children:[z?.icon?e.jsx(z.icon,{}):!x&&e.jsx("div",{className:K("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":d==="dot","w-1":d==="line","w-0 border-[1.5px] border-dashed bg-transparent":d==="dashed","my-0.5":U&&d==="dashed"}),style:{"--color-bg":B,"--color-border":B}}),e.jsxs("div",{className:K("flex flex-1 justify-between leading-none",U?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[U?F:null,e.jsx("span",{className:"text-muted-foreground",children:z?.label||M.name})]}),M.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:M.value.toLocaleString()})]})]})},M.dataKey)})})]})});Kn.displayName="ChartTooltip";const bN=zb,hg=u.forwardRef(({className:n,hideIcon:r=!1,payload:c,verticalAlign:d="bottom",nameKey:h},x)=>{const{config:f}=mg();return c?.length?e.jsx("div",{ref:x,className:K("flex items-center justify-center gap-4",d==="top"?"pb-3":"pt-3",n),children:c.filter(j=>j.type!=="none").map(j=>{const p=`${h||j.dataKey||"value"}`,w=Au(f,j,p);return e.jsxs("div",{className:K("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[w?.icon&&!r?e.jsx(w.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:j.color}}),w?.label]},j.value)})}):null});hg.displayName="ChartLegend";function Au(n,r,c){if(typeof r!="object"||r===null)return;const d="payload"in r&&typeof r.payload=="object"&&r.payload!==null?r.payload:void 0;let h=c;return c in r&&typeof r[c]=="string"?h=r[c]:d&&c in d&&typeof d[c]=="string"&&(h=d[c]),h in n?n[h]:n[c]}const ur=ei("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),b=u.forwardRef(({className:n,variant:r,size:c,asChild:d=!1,...h},x)=>{const f=d?Lb:"button";return e.jsx(f,{className:K(ur({variant:r,size:c,className:n})),ref:x,...h})});b.displayName="Button";const yN=ei("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qe({className:n,variant:r,...c}){return e.jsx("div",{className:K(yN({variant:r}),n),...c})}const NN=5,wN=5e3;let _u=0;function _N(){return _u=(_u+1)%Number.MAX_SAFE_INTEGER,_u.toString()}const Su=new Map,Zf=n=>{if(Su.has(n))return;const r=setTimeout(()=>{Su.delete(n),ir({type:"REMOVE_TOAST",toastId:n})},wN);Su.set(n,r)},SN=(n,r)=>{switch(r.type){case"ADD_TOAST":return{...n,toasts:[r.toast,...n.toasts].slice(0,NN)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(c=>c.id===r.toast.id?{...c,...r.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=r;return c?Zf(c):n.toasts.forEach(d=>{Zf(d.id)}),{...n,toasts:n.toasts.map(d=>d.id===c||c===void 0?{...d,open:!1}:d)}}case"REMOVE_TOAST":return r.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(c=>c.id!==r.toastId)}}},$c=[];let Qc={toasts:[]};function ir(n){Qc=SN(Qc,n),$c.forEach(r=>{r(Qc)})}function CN({...n}){const r=_N(),c=h=>ir({type:"UPDATE_TOAST",toast:{...h,id:r}}),d=()=>ir({type:"DISMISS_TOAST",toastId:r});return ir({type:"ADD_TOAST",toast:{...n,id:r,open:!0,onOpenChange:h=>{h||d()}}}),{id:r,dismiss:d,update:c}}function Rt(){const[n,r]=u.useState(Qc);return u.useEffect(()=>($c.push(r),()=>{const c=$c.indexOf(r);c>-1&&$c.splice(c,1)}),[n]),{...n,toast:CN,dismiss:c=>ir({type:"DISMISS_TOAST",toastId:c})}}const kN=n=>{const r=[];for(let c=0;c{try{E(!0);const H=await Oc.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");k({hitokoto:H.data.hitokoto,from:H.data.from||H.data.from_who||"未知"})}catch(H){console.error("获取一言失败:",H),k({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{E(!1)}},[]),z=u.useCallback(async()=>{try{const H=localStorage.getItem("access-token"),ie=await Oc.get("/api/webui/system/status",{headers:{Authorization:`Bearer ${H}`}});F(ie.data)}catch(H){console.error("获取机器人状态失败:",H),F(null)}},[]),B=async()=>{if(!U)try{M(!0);const H=localStorage.getItem("access-token");await Oc.post("/api/webui/system/restart",{},{headers:{Authorization:`Bearer ${H}`}}),Z({title:"重启中",description:"麦麦正在重启,请稍候..."}),setTimeout(()=>{z(),M(!1)},3e3)}catch(H){console.error("重启失败:",H),Z({title:"重启失败",description:"无法重启麦麦,请检查控制台",variant:"destructive"}),M(!1)}},X=u.useCallback(async()=>{try{const H=localStorage.getItem("access-token"),ie=await Oc.get(`/api/webui/statistics/dashboard?hours=${f}`,{headers:{Authorization:`Bearer ${H}`}});r(ie.data),d(!1),x(100)}catch(H){console.error("Failed to fetch dashboard data:",H),d(!1),x(100)}},[f]);if(u.useEffect(()=>{if(!c)return;x(0);const H=setTimeout(()=>x(15),200),ie=setTimeout(()=>x(30),800),_=setTimeout(()=>x(45),2e3),me=setTimeout(()=>x(60),4e3),xe=setTimeout(()=>x(75),6500),Q=setTimeout(()=>x(85),9e3),de=setTimeout(()=>x(92),11e3);return()=>{clearTimeout(H),clearTimeout(ie),clearTimeout(_),clearTimeout(me),clearTimeout(xe),clearTimeout(Q),clearTimeout(de)}},[c]),u.useEffect(()=>{X(),G(),z()},[X,G,z]),u.useEffect(()=>{if(!p)return;const H=setInterval(()=>{X(),z()},3e4);return()=>clearInterval(H)},[p,X,z]),c||!n)return e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:e.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[e.jsx(ps,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(vr,{value:h,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h,"%"]})]})]})});const{summary:S,model_stats:O=[],hourly_data:se=[],daily_data:he=[],recent_activity:ye=[]}=n,be=S??{total_requests:0,total_cost:0,total_tokens:0,online_time:0,total_messages:0,total_replies:0,avg_response_time:0,cost_per_hour:0,tokens_per_hour:0},pe=H=>{const ie=Math.floor(H/3600),_=Math.floor(H%3600/60);return`${ie}小时${_}分钟`},je=H=>new Date(H).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),_e=kN(O.length),y=O.map((H,ie)=>({name:H.model_name,value:H.request_count,fill:_e[ie]})),q={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Aa,{value:f.toString(),onValueChange:H=>j(Number(H)),children:e.jsxs(ja,{className:"grid grid-cols-3 w-full sm:w-auto",children:[e.jsx(st,{value:"24",children:"24小时"}),e.jsx(st,{value:"168",children:"7天"}),e.jsx(st,{value:"720",children:"30天"})]})}),e.jsxs(b,{variant:p?"default":"outline",size:"sm",onClick:()=>w(!p),className:"gap-2",children:[e.jsx(ps,{className:`h-4 w-4 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:X,children:e.jsx(ps,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[T?e.jsx(dg,{className:"h-5 flex-1"}):v?e.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',v.hitokoto,'" —— ',v.from]}):null,e.jsx(b,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:G,disabled:T,children:e.jsx(ps,{className:`h-3.5 w-3.5 ${T?"animate-spin":""}`})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[e.jsxs(Ve,{className:"lg:col-span-1",children:[e.jsx(pt,{className:"pb-3",children:e.jsxs(gt,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(fr,{className:"h-4 w-4"}),"麦麦状态"]})}),e.jsx(yt,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:R?.running?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),e.jsxs(Qe,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[e.jsx(oa,{className:"h-3 w-3 mr-1"}),"运行中"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-red-500"}),e.jsxs(Qe,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[e.jsx(Ea,{className:"h-3 w-3 mr-1"}),"已停止"]})]})}),R&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("span",{children:["v",R.version]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsxs("span",{children:["运行 ",pe(R.uptime)]})]})]})})]}),e.jsxs(Ve,{className:"lg:col-span-2",children:[e.jsx(pt,{className:"pb-3",children:e.jsxs(gt,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(sn,{className:"h-4 w-4"}),"快速操作"]})}),e.jsx(yt,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:B,disabled:U,className:"gap-2",children:[e.jsx(Kc,{className:`h-4 w-4 ${U?"animate-spin":""}`}),U?"重启中...":"重启麦麦"]}),e.jsx(b,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Vc,{to:"/logs",children:[e.jsx(Ta,{className:"h-4 w-4"}),"查看日志"]})}),e.jsx(b,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Vc,{to:"/plugins",children:[e.jsx(ey,{className:"h-4 w-4"}),"插件管理"]})}),e.jsx(b,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Vc,{to:"/settings",children:[e.jsx(ti,{className:"h-4 w-4"}),"系统设置"]})})]})})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"总请求数"}),e.jsx(ty,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:be.total_requests.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",f<48?f+"小时":Math.floor(f/24)+"天"]})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"总花费"}),e.jsx(sy,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["¥",be.total_cost.toFixed(2)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:be.cost_per_hour>0?`¥${be.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"Token消耗"}),e.jsx(Zc,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[(be.total_tokens/1e3).toFixed(1),"K"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:be.tokens_per_hour>0?`${(be.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"平均响应"}),e.jsx(sn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[be.avg_response_time.toFixed(2),"s"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"在线时长"}),e.jsx(Jn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(yt,{children:e.jsx("div",{className:"text-xl font-bold",children:pe(be.online_time)})})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"消息处理"}),e.jsx(Pn,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsx("div",{className:"text-xl font-bold",children:be.total_messages.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",be.total_replies.toLocaleString()," 条"]})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"成本效率"}),e.jsx(ay,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsx("div",{className:"text-xl font-bold",children:be.total_messages>0?`¥${(be.total_cost/be.total_messages*100).toFixed(2)}`:"¥0.00"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),e.jsxs(Aa,{defaultValue:"trends",className:"space-y-4",children:[e.jsxs(ja,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[e.jsx(st,{value:"trends",children:"趋势"}),e.jsx(st,{value:"models",children:"模型"}),e.jsx(st,{value:"activity",children:"活动"}),e.jsx(st,{value:"daily",children:"日统计"})]}),e.jsxs(_t,{value:"trends",className:"space-y-4",children:[e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"请求趋势"}),e.jsxs(Kt,{children:["最近",f,"小时的请求量变化"]})]}),e.jsx(yt,{children:e.jsx(Xn,{config:q,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(Ab,{data:se,children:[e.jsx(Rc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Lc,{dataKey:"timestamp",tickFormatter:H=>je(H),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Wi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{content:e.jsx(Kn,{labelFormatter:H=>je(H)})}),e.jsx(Mb,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"花费趋势"}),e.jsx(Kt,{children:"API调用成本变化"})]}),e.jsx(yt,{children:e.jsx(Xn,{config:q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(vu,{data:se,children:[e.jsx(Rc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Lc,{dataKey:"timestamp",tickFormatter:H=>je(H),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Wi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{content:e.jsx(Kn,{labelFormatter:H=>je(H)})}),e.jsx(Uc,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"Token消耗"}),e.jsx(Kt,{children:"Token使用量变化"})]}),e.jsx(yt,{children:e.jsx(Xn,{config:q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(vu,{data:se,children:[e.jsx(Rc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Lc,{dataKey:"timestamp",tickFormatter:H=>je(H),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Wi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{content:e.jsx(Kn,{labelFormatter:H=>je(H)})}),e.jsx(Uc,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),e.jsx(_t,{value:"models",className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"模型请求分布"}),e.jsxs(Kt,{children:["各模型使用占比 (共 ",O.length," 个模型)"]})]}),e.jsx(yt,{children:e.jsx(Xn,{config:Object.fromEntries(O.map((H,ie)=>[H.model_name,{label:H.model_name,color:_e[ie]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(Db,{children:[e.jsx(tr,{content:e.jsx(Kn,{})}),e.jsx(Ob,{data:y,cx:"50%",cy:"50%",labelLine:!1,label:({name:H,percent:ie})=>ie&&ie<.05?"":`${H} ${ie?(ie*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:y.map((H,ie)=>e.jsx(Rb,{fill:H.fill},`cell-${ie}`))})]})})})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"模型详细统计"}),e.jsx(Kt,{children:"请求数、花费和性能"})]}),e.jsx(yt,{children:e.jsx(Ie,{className:"h-[300px] sm:h-[400px]",children:e.jsx("div",{className:"space-y-3",children:O.map((H,ie)=>e.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:H.model_name}),e.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${ie%5+1}))`}})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),e.jsx("span",{className:"ml-1 font-medium",children:H.request_count.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1 font-medium",children:["¥",H.total_cost.toFixed(2)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[(H.total_tokens/1e3).toFixed(1),"K"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[H.avg_response_time.toFixed(2),"s"]})]})]})]},ie))})})})]})]})}),e.jsx(_t,{value:"activity",children:e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"最近活动"}),e.jsx(Kt,{children:"最新的API调用记录"})]}),e.jsx(yt,{children:e.jsx(Ie,{className:"h-[400px] sm:h-[500px]",children:e.jsx("div",{className:"space-y-2",children:ye.map((H,ie)=>e.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:H.model}),e.jsx("div",{className:"text-xs text-muted-foreground",children:H.request_type})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:je(H.timestamp)})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsx("span",{className:"ml-1",children:H.tokens})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1",children:["¥",H.cost.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),e.jsxs("span",{className:"ml-1",children:[H.time_cost.toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"状态:"}),e.jsx("span",{className:`ml-1 ${H.status==="success"?"text-green-600":"text-red-600"}`,children:H.status})]})]})]},ie))})})})]})}),e.jsx(_t,{value:"daily",children:e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"每日统计"}),e.jsx(Kt,{children:"最近7天的数据汇总"})]}),e.jsx(yt,{children:e.jsx(Xn,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:e.jsxs(vu,{data:he,children:[e.jsx(Rc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Lc,{dataKey:"timestamp",tickFormatter:H=>{const ie=new Date(H);return`${ie.getMonth()+1}/${ie.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Wi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Wi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(tr,{content:e.jsx(Kn,{labelFormatter:H=>new Date(H).toLocaleDateString("zh-CN")})}),e.jsx(bN,{content:e.jsx(hg,{})}),e.jsx(Uc,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),e.jsx(Uc,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const EN={theme:"system",setTheme:()=>null},xg=u.createContext(EN),Hu=()=>{const n=u.useContext(xg);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},zN=(n,r,c)=>{const d=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||d){r(n);return}const h=c.clientX,x=c.clientY,f=Math.hypot(Math.max(h,innerWidth-h),Math.max(x,innerHeight-x));document.startViewTransition(()=>{r(n)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${h}px ${x}px)`,`circle(${f}px at ${h}px ${x}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},fg=u.createContext(void 0),pg=()=>{const n=u.useContext(fg);if(n===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return n},Ge=u.forwardRef(({className:n,...r},c)=>e.jsx(bp,{className:K("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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",n),...r,ref:c,children:e.jsx(fb,{className:K("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ge.displayName=bp.displayName;const AN=ei("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),N=u.forwardRef(({className:n,...r},c)=>e.jsx(Dp,{ref:c,className:K(AN(),n),...r}));N.displayName=Dp.displayName;const ce=u.forwardRef(({className:n,type:r,...c},d)=>e.jsx("input",{type:r,className:K("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:d,...c}));ce.displayName="Input";const MN=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:n=>n.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:n=>/[A-Z]/.test(n)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:n=>/[a-z]/.test(n)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:n=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(n)}];function DN(n){const r=MN.map(d=>({id:d.id,label:d.label,description:d.description,passed:d.validate(n)}));return{isValid:r.every(d=>d.passed),rules:r}}const qu="0.11.6 Beta",Gu="MaiBot Dashboard",ON=`${Gu} v${qu}`,RN=(n="v")=>`${n}${qu}`,Ds={THEME:"maibot-ui-theme",ACCENT_COLOR:"accent-color",ENABLE_ANIMATIONS:"maibot-animations",ENABLE_WAVES_BACKGROUND:"maibot-waves-background",LOG_CACHE_SIZE:"maibot-log-cache-size",LOG_AUTO_SCROLL:"maibot-log-auto-scroll",LOG_FONT_SIZE:"maibot-log-font-size",LOG_LINE_SPACING:"maibot-log-line-spacing",DATA_SYNC_INTERVAL:"maibot-data-sync-interval",WS_RECONNECT_INTERVAL:"maibot-ws-reconnect-interval",WS_MAX_RECONNECT_ATTEMPTS:"maibot-ws-max-reconnect-attempts",COMPLETED_TOURS:"maibot-completed-tours"},Ca={theme:"system",accentColor:"blue",enableAnimations:!0,enableWavesBackground:!0,logCacheSize:1e3,logAutoScroll:!0,logFontSize:"xs",logLineSpacing:4,dataSyncInterval:30,wsReconnectInterval:3e3,wsMaxReconnectAttempts:10};function Ft(n){const r=gg(n),c=localStorage.getItem(r);if(c===null)return Ca[n];const d=Ca[n];if(typeof d=="boolean")return c==="true";if(typeof d=="number"){const h=parseFloat(c);return isNaN(h)?d:h}return c}function Zn(n,r){const c=gg(n);localStorage.setItem(c,String(r)),window.dispatchEvent(new CustomEvent("maibot-settings-change",{detail:{key:n,value:r}}))}function LN(){return{theme:Ft("theme"),accentColor:Ft("accentColor"),enableAnimations:Ft("enableAnimations"),enableWavesBackground:Ft("enableWavesBackground"),logCacheSize:Ft("logCacheSize"),logAutoScroll:Ft("logAutoScroll"),logFontSize:Ft("logFontSize"),logLineSpacing:Ft("logLineSpacing"),dataSyncInterval:Ft("dataSyncInterval"),wsReconnectInterval:Ft("wsReconnectInterval"),wsMaxReconnectAttempts:Ft("wsMaxReconnectAttempts")}}function UN(){const n=LN(),r=localStorage.getItem(Ds.COMPLETED_TOURS),c=r?JSON.parse(r):[];return{...n,completedTours:c}}function BN(n){const r=[],c=[];for(const[d,h]of Object.entries(n)){if(d==="completedTours"){Array.isArray(h)?(localStorage.setItem(Ds.COMPLETED_TOURS,JSON.stringify(h)),r.push("completedTours")):c.push("completedTours");continue}if(d in Ca){const x=d,f=Ca[x];if(typeof h==typeof f){if(x==="theme"&&!["light","dark","system"].includes(h)){c.push(d);continue}if(x==="logFontSize"&&!["xs","sm","base"].includes(h)){c.push(d);continue}Zn(x,h),r.push(d)}else c.push(d)}else c.push(d)}return{success:r.length>0,imported:r,skipped:c}}function HN(){for(const n of Object.keys(Ca))Zn(n,Ca[n]);localStorage.removeItem(Ds.COMPLETED_TOURS),window.dispatchEvent(new CustomEvent("maibot-settings-reset"))}function qN(){const n=[],r=[],c=[];for(let d=0;dd.size-c.size),{used:n,items:localStorage.length,details:r}}function GN(n){if(n===0)return"0 B";const r=1024,c=["B","KB","MB"],d=Math.floor(Math.log(n)/Math.log(r));return parseFloat((n/Math.pow(r,d)).toFixed(2))+" "+c[d]}function gg(n){return{theme:Ds.THEME,accentColor:Ds.ACCENT_COLOR,enableAnimations:Ds.ENABLE_ANIMATIONS,enableWavesBackground:Ds.ENABLE_WAVES_BACKGROUND,logCacheSize:Ds.LOG_CACHE_SIZE,logAutoScroll:Ds.LOG_AUTO_SCROLL,logFontSize:Ds.LOG_FONT_SIZE,logLineSpacing:Ds.LOG_LINE_SPACING,dataSyncInterval:Ds.DATA_SYNC_INTERVAL,wsReconnectInterval:Ds.WS_RECONNECT_INTERVAL,wsMaxReconnectAttempts:Ds.WS_MAX_RECONNECT_ATTEMPTS}[n]}const ka=u.forwardRef(({className:n,...r},c)=>e.jsxs(yp,{ref:c,className:K("relative flex w-full touch-none select-none items-center",n),...r,children:[e.jsx(pb,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(gb,{className:"absolute h-full bg-primary"})}),e.jsx(jb,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));ka.displayName=yp.displayName;class VN{ws=null;reconnectTimeout=null;reconnectAttempts=0;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];getMaxCacheSize(){return Ft("logCacheSize")}getMaxReconnectAttempts(){return Ft("wsMaxReconnectAttempts")}getReconnectInterval(){return Ft("wsReconnectInterval")}getWebSocketUrl(){{const r=window.location.protocol==="https:"?"wss:":"ws:",c=window.location.host;return`${r}//${c}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const r=this.getWebSocketUrl();try{this.ws=new WebSocket(r),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=c=>{try{if(c.data==="pong")return;const d=JSON.parse(c.data);this.notifyLog(d)}catch(d){console.error("解析日志消息失败:",d)}},this.ws.onerror=c=>{console.error("❌ WebSocket 错误:",c),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(c){console.error("创建 WebSocket 连接失败:",c),this.attemptReconnect()}}attemptReconnect(){const r=this.getMaxReconnectAttempts();if(this.reconnectAttempts>=r)return;this.reconnectAttempts+=1;const c=this.getReconnectInterval(),d=Math.min(c*this.reconnectAttempts,3e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},d)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(r){return this.logCallbacks.add(r),()=>this.logCallbacks.delete(r)}onConnectionChange(r){return this.connectionCallbacks.add(r),r(this.isConnected),()=>this.connectionCallbacks.delete(r)}notifyLog(r){if(!this.logCache.some(d=>d.id===r.id)){this.logCache.push(r);const d=this.getMaxCacheSize();this.logCache.length>d&&(this.logCache=this.logCache.slice(-d)),this.logCallbacks.forEach(h=>{try{h(r)}catch(x){console.error("日志回调执行失败:",x)}})}}notifyConnection(r){this.connectionCallbacks.forEach(c=>{try{c(r)}catch(d){console.error("连接状态回调执行失败:",d)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const tn=new VN;typeof window<"u"&&tn.connect();const Qt=Hb,Vu=qb,FN=Ub,jg=u.forwardRef(({className:n,...r},c)=>e.jsx(Op,{ref:c,className:K("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",n),...r}));jg.displayName=Op.displayName;const Ut=u.forwardRef(({className:n,children:r,preventOutsideClose:c=!1,...d},h)=>e.jsxs(FN,{children:[e.jsx(jg,{}),e.jsxs(Rp,{ref:h,className:K("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",n),onPointerDownOutside:c?x=>x.preventDefault():void 0,onInteractOutside:c?x=>x.preventDefault():void 0,...d,children:[r,e.jsxs(Bb,{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:[e.jsx(si,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ut.displayName=Rp.displayName;const Bt=({className:n,...r})=>e.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left",n),...r});Bt.displayName="DialogHeader";const os=({className:n,...r})=>e.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});os.displayName="DialogFooter";const Ht=u.forwardRef(({className:n,...r},c)=>e.jsx(Lp,{ref:c,className:K("text-lg font-semibold leading-none tracking-tight",n),...r}));Ht.displayName=Lp.displayName;const ss=u.forwardRef(({className:n,...r},c)=>e.jsx(Up,{ref:c,className:K("text-sm text-muted-foreground",n),...r}));ss.displayName=Up.displayName;const ft=bb,$t=yb,$N=vb,vg=u.forwardRef(({className:n,...r},c)=>e.jsx(Np,{className:K("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",n),...r,ref:c}));vg.displayName=Np.displayName;const it=u.forwardRef(({className:n,...r},c)=>e.jsxs($N,{children:[e.jsx(vg,{}),e.jsx(wp,{ref:c,className:K("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",n),...r})]}));it.displayName=wp.displayName;const rt=({className:n,...r})=>e.jsx("div",{className:K("flex flex-col space-y-2 text-center sm:text-left",n),...r});rt.displayName="AlertDialogHeader";const ct=({className:n,...r})=>e.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...r});ct.displayName="AlertDialogFooter";const ot=u.forwardRef(({className:n,...r},c)=>e.jsx(_p,{ref:c,className:K("text-lg font-semibold",n),...r}));ot.displayName=_p.displayName;const dt=u.forwardRef(({className:n,...r},c)=>e.jsx(Sp,{ref:c,className:K("text-sm text-muted-foreground",n),...r}));dt.displayName=Sp.displayName;const ut=u.forwardRef(({className:n,...r},c)=>e.jsx(Cp,{ref:c,className:K(ur(),n),...r}));ut.displayName=Cp.displayName;const mt=u.forwardRef(({className:n,...r},c)=>e.jsx(kp,{ref:c,className:K(ur({variant:"outline"}),"mt-2 sm:mt-0",n),...r}));mt.displayName=kp.displayName;function QN(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),e.jsxs(Aa,{defaultValue:"appearance",className:"w-full",children:[e.jsxs(ja,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(st,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(ly,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"外观"})]}),e.jsxs(st,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(ny,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"安全"})]}),e.jsxs(st,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(ti,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"其他"})]}),e.jsxs(st,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(za,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"关于"})]})]}),e.jsxs(Ie,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(_t,{value:"appearance",className:"mt-0",children:e.jsx(YN,{})}),e.jsx(_t,{value:"security",className:"mt-0",children:e.jsx(XN,{})}),e.jsx(_t,{value:"other",className:"mt-0",children:e.jsx(KN,{})}),e.jsx(_t,{value:"about",className:"mt-0",children:e.jsx(ZN,{})})]})]})]})}function If(n){const r=document.documentElement,d={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[n];if(d)r.style.setProperty("--primary",d.hsl),d.gradient?(r.style.setProperty("--primary-gradient",d.gradient),r.classList.add("has-gradient")):(r.style.removeProperty("--primary-gradient"),r.classList.remove("has-gradient"));else if(n.startsWith("#")){const h=x=>{x=x.replace("#","");const f=parseInt(x.substring(0,2),16)/255,j=parseInt(x.substring(2,4),16)/255,p=parseInt(x.substring(4,6),16)/255,w=Math.max(f,j,p),v=Math.min(f,j,p);let k=0,T=0;const E=(w+v)/2;if(w!==v){const R=w-v;switch(T=E>.5?R/(2-w-v):R/(w+v),w){case f:k=((j-p)/R+(jlocalStorage.getItem("accent-color")||"blue");u.useEffect(()=>{const w=localStorage.getItem("accent-color")||"blue";If(w)},[]);const p=w=>{j(w),localStorage.setItem("accent-color",w),If(w)};return e.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[e.jsx(Cu,{value:"light",current:n,onChange:r,label:"浅色",description:"始终使用浅色主题"}),e.jsx(Cu,{value:"dark",current:n,onChange:r,label:"深色",description:"始终使用深色主题"}),e.jsx(Cu,{value:"system",current:n,onChange:r,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(ca,{value:"blue",current:f,onChange:p,label:"蓝色",colorClass:"bg-blue-500"}),e.jsx(ca,{value:"purple",current:f,onChange:p,label:"紫色",colorClass:"bg-purple-500"}),e.jsx(ca,{value:"green",current:f,onChange:p,label:"绿色",colorClass:"bg-green-500"}),e.jsx(ca,{value:"orange",current:f,onChange:p,label:"橙色",colorClass:"bg-orange-500"}),e.jsx(ca,{value:"pink",current:f,onChange:p,label:"粉色",colorClass:"bg-pink-500"}),e.jsx(ca,{value:"red",current:f,onChange:p,label:"红色",colorClass:"bg-red-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(ca,{value:"gradient-sunset",current:f,onChange:p,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),e.jsx(ca,{value:"gradient-ocean",current:f,onChange:p,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsx(ca,{value:"gradient-forest",current:f,onChange:p,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),e.jsx(ca,{value:"gradient-aurora",current:f,onChange:p,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),e.jsx(ca,{value:"gradient-fire",current:f,onChange:p,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),e.jsx(ca,{value:"gradient-twilight",current:f,onChange:p,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx("input",{type:"color",value:f.startsWith("#")?f:"#3b82f6",onChange:w=>p(w.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),e.jsx("div",{className:"flex-1",children:e.jsx(ce,{type:"text",value:f,onChange:w=>p(w.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),e.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[e.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(N,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),e.jsx(Ge,{id:"animations",checked:c,onCheckedChange:d})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(N,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),e.jsx(Ge,{id:"waves-background",checked:h,onCheckedChange:x})]})})]})]})]})}function XN(){const n=ua(),[r,c]=u.useState(""),[d,h]=u.useState(""),[x,f]=u.useState(!1),[j,p]=u.useState(!1),[w,v]=u.useState(!1),[k,T]=u.useState(!1),[E,R]=u.useState(!1),[F,U]=u.useState(!1),[M,Z]=u.useState(""),[G,z]=u.useState(!1),{toast:B}=Rt(),X=u.useMemo(()=>DN(d),[d]),S=async pe=>{if(!r){B({title:"无法复制",description:"Token 存储在安全 Cookie 中,请重新生成以获取新 Token",variant:"destructive"});return}try{await navigator.clipboard.writeText(pe),R(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>R(!1),2e3)}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},O=async()=>{if(!d.trim()){B({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!X.isValid){const pe=X.rules.filter(je=>!je.passed).map(je=>je.label).join(", ");B({title:"格式错误",description:`Token 不符合要求: ${pe}`,variant:"destructive"});return}v(!0);try{const pe=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({new_token:d.trim()})}),je=await pe.json();pe.ok&&je.success?(h(""),c(d.trim()),B({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{n({to:"/auth"})},1500)):B({title:"更新失败",description:je.message||"无法更新 Token",variant:"destructive"})}catch(pe){console.error("更新 Token 错误:",pe),B({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{v(!1)}},se=async()=>{T(!0);try{const pe=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"}),je=await pe.json();pe.ok&&je.success?(c(je.token),Z(je.token),U(!0),z(!1),B({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):B({title:"生成失败",description:je.message||"无法生成新 Token",variant:"destructive"})}catch(pe){console.error("生成 Token 错误:",pe),B({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{T(!1)}},he=async()=>{try{await navigator.clipboard.writeText(M),z(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},ye=()=>{U(!1),setTimeout(()=>{Z(""),z(!1)},300),setTimeout(()=>{n({to:"/auth"})},500)},be=pe=>{pe||ye()};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(Qt,{open:F,onOpenChange:be,children:e.jsxs(Ut,{className:"sm:max-w-md",children:[e.jsxs(Bt,{children:[e.jsxs(Ht,{className:"flex items-center gap-2",children:[e.jsx(pa,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),e.jsx(ss,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[e.jsx(N,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),e.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:M})]}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(pa,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"重要提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),e.jsx("li",{children:"请立即复制并保存到安全的位置"}),e.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),e.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),e.jsxs(os,{className:"gap-2 sm:gap-0",children:[e.jsx(b,{variant:"outline",onClick:he,className:"gap-2",children:G?e.jsxs(e.Fragment,{children:[e.jsx(ga,{className:"h-4 w-4 text-green-500"}),"已复制"]}):e.jsxs(e.Fragment,{children:[e.jsx(Jc,{className:"h-4 w-4"}),"复制 Token"]})}),e.jsx(b,{onClick:ye,children:"我已保存,关闭"})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),e.jsx("div",{className:"space-y-3 sm:space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ce,{id:"current-token",type:x?"text":"password",value:r||"••••••••••••••••••••••••••••••••",readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"Token 存储在安全 Cookie 中"}),e.jsx("button",{onClick:()=>{r?f(!x):B({title:"无法查看",description:'Token 存储在安全 Cookie 中,如需新 Token 请点击"重新生成"'})},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:x?"隐藏":"显示",children:x?e.jsx(rr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Ys,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(b,{variant:"outline",size:"icon",onClick:()=>S(r),title:"复制到剪贴板",className:"flex-shrink-0",disabled:!r,children:E?e.jsx(ga,{className:"h-4 w-4 text-green-500"}):e.jsx(Jc,{className:"h-4 w-4"})}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{variant:"outline",disabled:k,className:"gap-2 flex-1 sm:flex-none",children:[e.jsx(ps,{className:K("h-4 w-4",k&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),e.jsx("span",{className:"sm:hidden",children:"生成"})]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认重新生成 Token"}),e.jsx(dt,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:se,children:"确认生成"})]})]})]})]})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{id:"new-token",type:j?"text":"password",value:d,onChange:pe=>h(pe.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),e.jsx("button",{onClick:()=>p(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:j?"隐藏":"显示",children:j?e.jsx(rr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Ys,{className:"h-4 w-4 text-muted-foreground"})})]}),d&&e.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),e.jsx("div",{className:"space-y-1.5",children:X.rules.map(pe=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[pe.passed?e.jsx(oa,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):e.jsx(Wp,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:K(pe.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:pe.label})]},pe.id))}),X.isValid&&e.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[e.jsx(ga,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),e.jsx(b,{onClick:O,disabled:w||!X.isValid||!d,className:"w-full sm:w-auto",children:w?"更新中...":"更新自定义 Token"})]})]}),e.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[e.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),e.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),e.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),e.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),e.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),e.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),e.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function KN(){const n=ua(),{toast:r}=Rt(),[c,d]=u.useState(!1),[h,x]=u.useState(!1),[f,j]=u.useState(()=>Ft("logCacheSize")),[p,w]=u.useState(()=>Ft("wsReconnectInterval")),[v,k]=u.useState(()=>Ft("wsMaxReconnectAttempts")),[T,E]=u.useState(()=>Ft("dataSyncInterval")),[R,F]=u.useState(()=>Jf()),[U,M]=u.useState(!1),[Z,G]=u.useState(!1),z=u.useRef(null);if(h)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const B=()=>{F(Jf())},X=y=>{const q=y[0];j(q),Zn("logCacheSize",q)},S=y=>{const q=y[0];w(q),Zn("wsReconnectInterval",q)},O=y=>{const q=y[0];k(q),Zn("wsMaxReconnectAttempts",q)},se=y=>{const q=y[0];E(q),Zn("dataSyncInterval",q)},he=()=>{tn.clearLogs(),r({title:"日志已清除",description:"日志缓存已清空"})},ye=()=>{const y=qN();B(),r({title:"缓存已清除",description:`已清除 ${y.clearedKeys.length} 项缓存数据`})},be=()=>{M(!0);try{const y=UN(),q=JSON.stringify(y,null,2),H=new Blob([q],{type:"application/json"}),ie=URL.createObjectURL(H),_=document.createElement("a");_.href=ie,_.download=`maibot-webui-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(_),_.click(),document.body.removeChild(_),URL.revokeObjectURL(ie),r({title:"导出成功",description:"设置已导出为 JSON 文件"})}catch(y){console.error("导出设置失败:",y),r({title:"导出失败",description:"无法导出设置",variant:"destructive"})}finally{M(!1)}},pe=y=>{const q=y.target.files?.[0];if(!q)return;G(!0);const H=new FileReader;H.onload=ie=>{try{const _=ie.target?.result,me=JSON.parse(_),xe=BN(me);xe.success?(j(Ft("logCacheSize")),w(Ft("wsReconnectInterval")),k(Ft("wsMaxReconnectAttempts")),E(Ft("dataSyncInterval")),B(),r({title:"导入成功",description:`成功导入 ${xe.imported.length} 项设置${xe.skipped.length>0?`,跳过 ${xe.skipped.length} 项`:""}`}),(xe.imported.includes("theme")||xe.imported.includes("accentColor"))&&r({title:"提示",description:"部分设置需要刷新页面才能完全生效"})):r({title:"导入失败",description:"没有有效的设置项可导入",variant:"destructive"})}catch(_){console.error("导入设置失败:",_),r({title:"导入失败",description:"文件格式无效",variant:"destructive"})}finally{G(!1),z.current&&(z.current.value="")}},H.readAsText(q)},je=()=>{HN(),j(Ca.logCacheSize),w(Ca.wsReconnectInterval),k(Ca.wsMaxReconnectAttempts),E(Ca.dataSyncInterval),B(),r({title:"已重置",description:"所有设置已恢复为默认值,刷新页面以应用更改"})},_e=async()=>{d(!0);try{const y=localStorage.getItem("access-token"),q=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${y}`}}),H=await q.json();q.ok&&H.success?(r({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{n({to:"/setup"})},1e3)):r({title:"重置失败",description:H.message||"无法重置配置状态",variant:"destructive"})}catch(y){console.error("重置配置状态错误:",y),r({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{d(!1)}};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(Zc,{className:"h-5 w-5"}),"性能与存储"]}),e.jsxs("div",{className:"space-y-4 sm:space-y-5",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(iy,{className:"h-4 w-4"}),"本地存储使用"]}),e.jsx(b,{variant:"ghost",size:"sm",onClick:B,className:"h-7 px-2",children:e.jsx(ps,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"text-2xl font-bold text-primary",children:GN(R.used)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[R.items," 个存储项"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{className:"text-sm font-medium",children:"日志缓存大小"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[f," 条"]})]}),e.jsx(ka,{value:[f],onValueChange:X,min:100,max:5e3,step:100,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"控制日志查看器最多缓存的日志条数,较大的值会占用更多内存"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{className:"text-sm font-medium",children:"首页数据刷新间隔"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[T," 秒"]})]}),e.jsx(ka,{value:[T],onValueChange:se,min:10,max:120,step:5,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"控制首页统计数据的自动刷新间隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{className:"text-sm font-medium",children:"WebSocket 重连间隔"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[p/1e3," 秒"]})]}),e.jsx(ka,{value:[p],onValueChange:S,min:1e3,max:1e4,step:500,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"日志 WebSocket 连接断开后的重连基础间隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{className:"text-sm font-medium",children:"WebSocket 最大重连次数"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[v," 次"]})]}),e.jsx(ka,{value:[v],onValueChange:O,min:3,max:30,step:1,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"连接失败后的最大重连尝试次数"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:he,className:"gap-2",children:[e.jsx(Pe,{className:"h-4 w-4"}),"清除日志缓存"]}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(Pe,{className:"h-4 w-4"}),"清除本地缓存"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认清除本地缓存"}),e.jsx(dt,{children:"这将清除所有本地缓存的设置和数据(不包括登录凭证)。 您可能需要重新配置部分偏好设置。确定要继续吗?"})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:ye,children:"确认清除"})]})]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(sl,{className:"h-5 w-5"}),"导入/导出设置"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"导出当前的界面设置以便备份,或从之前导出的文件中恢复设置。"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{variant:"outline",onClick:be,disabled:U,className:"gap-2",children:[e.jsx(sl,{className:"h-4 w-4"}),U?"导出中...":"导出设置"]}),e.jsx("input",{ref:z,type:"file",accept:".json",onChange:pe,className:"hidden"}),e.jsxs(b,{variant:"outline",onClick:()=>z.current?.click(),disabled:Z,className:"gap-2",children:[e.jsx(cr,{className:"h-4 w-4"}),Z?"导入中...":"导入设置"]})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",className:"gap-2 text-destructive hover:text-destructive",children:[e.jsx(Kc,{className:"h-4 w-4"}),"重置所有设置为默认值"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认重置所有设置"}),e.jsx(dt,{children:"这将把所有界面设置恢复为默认值,包括主题、颜色、动画等偏好设置。 此操作不会影响您的登录状态。确定要继续吗?"})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:je,children:"确认重置"})]})]})]})})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{variant:"outline",disabled:c,className:"gap-2",children:[e.jsx(Kc,{className:K("h-4 w-4",c&&"animate-spin")}),"重新进行初次配置"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认重新配置"}),e.jsx(dt,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:_e,children:"确认重置"})]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[e.jsx(pa,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{variant:"destructive",className:"gap-2",children:[e.jsx(pa,{className:"h-4 w-4"}),"触发测试错误"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认触发错误"}),e.jsx(dt,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>x(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function ZN(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:e.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:e.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),e.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:K("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Gu]}),e.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("p",{children:["版本: ",qu]}),e.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",e.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"React 19.2.0"}),e.jsx("li",{children:"TypeScript 5.7.2"}),e.jsx("li",{children:"Vite 6.0.7"}),e.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"shadcn/ui"}),e.jsx("li",{children:"Radix UI"}),e.jsx("li",{children:"Tailwind CSS 3.4.17"}),e.jsx("li",{children:"Lucide Icons"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"后端"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Python 3.12+"}),e.jsx("li",{children:"FastAPI"}),e.jsx("li",{children:"Uvicorn"}),e.jsx("li",{children:"WebSocket"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Bun / npm"}),e.jsx("li",{children:"ESLint 9.17.0"}),e.jsx("li",{children:"PostCSS"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),e.jsx(Ie,{className:"h-[300px] sm:h-[400px]",children:e.jsxs("div",{className:"space-y-4 pr-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"React",description:"用户界面构建库",license:"MIT"}),e.jsx(Lt,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),e.jsx(Lt,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),e.jsx(Lt,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),e.jsx(Lt,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),e.jsx(Lt,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),e.jsx(Lt,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),e.jsx(Lt,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),e.jsx(Lt,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),e.jsx(Lt,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),e.jsx(Lt,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),e.jsx(Lt,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),e.jsx(Lt,{name:"Pydantic",description:"数据验证库",license:"MIT"}),e.jsx(Lt,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(Lt,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),e.jsx(Lt,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),e.jsx(Lt,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),e.jsx(Lt,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:e.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Lt({name:n,description:r,license:c}){return e.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:n}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:r})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:c})]})}function Cu({value:n,current:r,onChange:c,label:d,description:h}){const x=r===n;return e.jsxs("button",{onClick:()=>c(n),className:K("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",x?"border-primary bg-accent":"border-border"),children:[x&&e.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm sm:text-base font-medium",children:d}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:h})]}),e.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[n==="light"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),n==="dark"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),n==="system"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ca({value:n,current:r,onChange:c,label:d,colorClass:h}){const x=r===n;return e.jsxs("button",{onClick:()=>c(n),className:K("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",x?"border-primary bg-accent":"border-border"),children:[x&&e.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[e.jsx("div",{className:K("h-8 w-8 sm:h-10 sm:w-10 rounded-full",h)}),e.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:d})]})]})}class JN{grad3;p;perm;constructor(r=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let c=0;c<256;c++)this.p[c]=Math.floor(Math.random()*256);this.perm=[];for(let c=0;c<512;c++)this.perm[c]=this.p[c&255]}dot(r,c,d){return r[0]*c+r[1]*d}mix(r,c,d){return(1-d)*r+d*c}fade(r){return r*r*r*(r*(r*6-15)+10)}perlin2(r,c){const d=Math.floor(r)&255,h=Math.floor(c)&255;r-=Math.floor(r),c-=Math.floor(c);const x=this.fade(r),f=this.fade(c),j=this.perm[d]+h,p=this.perm[j],w=this.perm[j+1],v=this.perm[d+1]+h,k=this.perm[v],T=this.perm[v+1];return this.mix(this.mix(this.dot(this.grad3[p%12],r,c),this.dot(this.grad3[k%12],r-1,c),x),this.mix(this.dot(this.grad3[w%12],r,c-1),this.dot(this.grad3[T%12],r-1,c-1),x),f)}}function Pf(){const n=u.useRef(null),r=u.useRef(null),c=u.useRef(void 0),d=u.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new JN(Math.random()),bounding:null});return u.useEffect(()=>{const h=r.current,x=n.current;if(!h||!x)return;const f=d.current,j=()=>{const F=h.getBoundingClientRect();f.bounding=F,x.style.width=`${F.width}px`,x.style.height=`${F.height}px`},p=()=>{if(!f.bounding)return;const{width:F,height:U}=f.bounding;f.lines=[],f.paths.forEach(se=>se.remove()),f.paths=[];const M=10,Z=32,G=F+200,z=U+30,B=Math.ceil(G/M),X=Math.ceil(z/Z),S=(F-M*B)/2,O=(U-Z*X)/2;for(let se=0;se<=B;se++){const he=[];for(let be=0;be<=X;be++){const pe={x:S+M*se,y:O+Z*be,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};he.push(pe)}const ye=document.createElementNS("http://www.w3.org/2000/svg","path");x.appendChild(ye),f.paths.push(ye),f.lines.push(he)}},w=F=>{const{lines:U,mouse:M,noise:Z}=f;U.forEach(G=>{G.forEach(z=>{const B=Z.perlin2((z.x+F*.0125)*.002,(z.y+F*.005)*.0015)*12;z.wave.x=Math.cos(B)*32,z.wave.y=Math.sin(B)*16;const X=z.x-M.sx,S=z.y-M.sy,O=Math.hypot(X,S),se=Math.max(175,M.vs);if(O{const M={x:F.x+F.wave.x+(U?F.cursor.x:0),y:F.y+F.wave.y+(U?F.cursor.y:0)};return M.x=Math.round(M.x*10)/10,M.y=Math.round(M.y*10)/10,M},k=()=>{const{lines:F,paths:U}=f;F.forEach((M,Z)=>{let G=v(M[0],!1),z=`M ${G.x} ${G.y}`;M.forEach((B,X)=>{const S=X===M.length-1;G=v(B,!S),z+=`L ${G.x} ${G.y}`}),U[Z].setAttribute("d",z)})},T=F=>{const{mouse:U}=f;U.sx+=(U.x-U.sx)*.1,U.sy+=(U.y-U.sy)*.1;const M=U.x-U.lx,Z=U.y-U.ly,G=Math.hypot(M,Z);U.v=G,U.vs+=(G-U.vs)*.1,U.vs=Math.min(100,U.vs),U.lx=U.x,U.ly=U.y,U.a=Math.atan2(Z,M),h&&(h.style.setProperty("--x",`${U.sx}px`),h.style.setProperty("--y",`${U.sy}px`)),w(F),k(),c.current=requestAnimationFrame(T)},E=F=>{if(!f.bounding)return;const{mouse:U}=f;U.x=F.pageX-f.bounding.left,U.y=F.pageY-f.bounding.top+window.scrollY,U.set||(U.sx=U.x,U.sy=U.y,U.lx=U.x,U.ly=U.y,U.set=!0)},R=()=>{j(),p()};return j(),p(),window.addEventListener("resize",R),window.addEventListener("mousemove",E),c.current=requestAnimationFrame(T),()=>{window.removeEventListener("resize",R),window.removeEventListener("mousemove",E),c.current&&cancelAnimationFrame(c.current)}},[]),e.jsxs("div",{ref:r,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[e.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),e.jsx("svg",{ref:n,style:{display:"block",width:"100%",height:"100%"},children:e.jsx("style",{children:` + path { + fill: none; + stroke: hsl(var(--primary) / 0.20); + stroke-width: 1px; + } + `})})]})}async function ke(n,r){const c={...r,credentials:"include",headers:{"Content-Type":"application/json",...r?.headers}},d=await fetch(n,c);if(d.status===401)throw window.location.href="/auth",new Error("认证失败,请重新登录");return d}function Tt(){return{"Content-Type":"application/json"}}async function IN(){try{await fetch("/api/webui/auth/logout",{method:"POST",credentials:"include"})}catch(n){console.error("登出请求失败:",n)}window.location.href="/auth"}async function Fu(){try{return(await(await fetch("/api/webui/auth/check",{method:"GET",credentials:"include"})).json()).authenticated===!0}catch{return!1}}function PN(){const[n,r]=u.useState(""),[c,d]=u.useState(!1),[h,x]=u.useState(""),[f,j]=u.useState(!0),p=ua(),{enableWavesBackground:w,setEnableWavesBackground:v}=pg(),{theme:k,setTheme:T}=Hu();u.useEffect(()=>{(async()=>{try{await Fu()&&p({to:"/"})}catch{}finally{j(!1)}})()},[p]);const R=k==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":k,F=()=>{T(R==="dark"?"light":"dark")},U=async M=>{if(M.preventDefault(),x(""),!n.trim()){x("请输入 Access Token");return}d(!0);try{const Z=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n.trim()})}),G=await Z.json();Z.ok&&G.valid?G.is_first_setup?p({to:"/setup"}):p({to:"/"}):x(G.message||"Token 验证失败,请检查后重试")}catch(Z){console.error("Token 验证错误:",Z),x("连接服务器失败,请检查网络连接")}finally{d(!1)}};return f?e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[w&&e.jsx(Pf,{}),e.jsx("div",{className:"text-muted-foreground",children:"正在检查登录状态..."})]}):e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[w&&e.jsx(Pf,{}),e.jsxs(Ve,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[e.jsx("button",{onClick:F,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:R==="dark"?"切换到浅色模式":"切换到深色模式",children:R==="dark"?e.jsx(eg,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):e.jsx(tg,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),e.jsxs(pt,{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(Hf,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(gt,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),e.jsx(Kt,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),e.jsx(yt,{children:e.jsxs("form",{onSubmit:U,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),e.jsxs("div",{className:"relative",children:[e.jsx(sg,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),e.jsx(ce,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:n,onChange:M=>r(M.target.value),className:K("pl-10",h&&"border-red-500 focus-visible:ring-red-500"),disabled:c,autoFocus:!0,autoComplete:"off"})]})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[e.jsx(Ea,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{children:h})]}),e.jsx(b,{type:"submit",className:"w-full",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),e.jsxs(Qt,{children:[e.jsx(Vu,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(ry,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),e.jsxs(Ut,{className:"sm:max-w-md",children:[e.jsxs(Bt,{children:[e.jsxs(Ht,{className:"flex items-center gap-2",children:[e.jsx(Hf,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),e.jsx(ss,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(cy,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),e.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),e.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ta,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),e.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:e.jsx("code",{className:"text-primary",children:"data/webui.json"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",e.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Ea,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"安全提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),e.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(sn,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsxs(ot,{className:"flex items-center gap-2",children:[e.jsx(sn,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),e.jsx(dt,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>v(!1),children:"关闭动画"})]})]})]})]})})]}),e.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:e.jsx("p",{children:ON})})]})}const Ot=u.forwardRef(({className:n,...r},c)=>e.jsx("textarea",{className:K("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:c,...r}));Ot.displayName="Textarea";const mr=u.forwardRef(({className:n,orientation:r="horizontal",decorative:c=!0,...d},h)=>e.jsx(Tp,{ref:h,decorative:c,orientation:r,className:K("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...d}));mr.displayName=Tp.displayName;function WN({config:n,onChange:r}){const c=h=>{h.trim()&&!n.alias_names.includes(h.trim())&&r({...n,alias_names:[...n.alias_names,h.trim()]})},d=h=>{r({...n,alias_names:n.alias_names.filter((x,f)=>f!==h)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"qq_account",children:"QQ账号 *"}),e.jsx(ce,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:n.qq_account||"",onChange:h=>r({...n,qq_account:Number(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"nickname",children:"昵称 *"}),e.jsx(ce,{id:"nickname",placeholder:"请输入机器人的昵称",value:n.nickname,onChange:h=>r({...n,nickname:h.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{children:"别名"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:n.alias_names.map((h,x)=>e.jsxs(Qe,{variant:"secondary",className:"gap-1",children:[h,e.jsx("button",{type:"button",onClick:()=>d(x),className:"ml-1 hover:text-destructive",children:e.jsx(si,{className:"h-3 w-3"})})]},x))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:h=>{h.key==="Enter"&&(c(h.target.value),h.target.value="")}}),e.jsx(b,{type:"button",variant:"outline",onClick:()=>{const h=document.getElementById("alias_input");h&&(c(h.value),h.value="")},children:"添加"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function e0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"personality",children:"人格特征 *"}),e.jsx(Ot,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:n.personality,onChange:c=>r({...n,personality:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"reply_style",children:"表达风格 *"}),e.jsx(Ot,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:n.reply_style,onChange:c=>r({...n,reply_style:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"interest",children:"兴趣 *"}),e.jsx(Ot,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:n.interest,onChange:c=>r({...n,interest:c.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),e.jsx(mr,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"plan_style",children:"群聊说话规则 *"}),e.jsx(Ot,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:n.plan_style,onChange:c=>r({...n,plan_style:c.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),e.jsx(Ot,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:n.private_plan_style,onChange:c=>r({...n,private_plan_style:c.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function t0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(n.emoji_chance*100).toFixed(0),"%"]})]}),e.jsx(ce,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:n.emoji_chance,onChange:c=>r({...n,emoji_chance:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"max_reg_num",children:"最大表情包数量"}),e.jsx(ce,{id:"max_reg_num",type:"number",min:"1",max:"200",value:n.max_reg_num,onChange:c=>r({...n,max_reg_num:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(N,{htmlFor:"do_replace",children:"达到最大数量时替换"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),e.jsx(Ge,{id:"do_replace",checked:n.do_replace,onCheckedChange:c=>r({...n,do_replace:c})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(ce,{id:"check_interval",type:"number",min:"1",max:"120",value:n.check_interval,onChange:c=>r({...n,check_interval:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),e.jsx(mr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(N,{htmlFor:"steal_emoji",children:"偷取表情包"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),e.jsx(Ge,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:c=>r({...n,steal_emoji:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(N,{htmlFor:"content_filtration",children:"启用表情包过滤"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),e.jsx(Ge,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:c=>r({...n,content_filtration:c})})]}),n.content_filtration&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(ce,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:n.filtration_prompt,onChange:c=>r({...n,filtration_prompt:c.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function s0({config:n,onChange:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(N,{htmlFor:"enable_tool",children:"启用工具系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),e.jsx(Ge,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:c=>r({...n,enable_tool:c})})]}),e.jsx(mr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(N,{htmlFor:"enable_mood",children:"启用情绪系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),e.jsx(Ge,{id:"enable_mood",checked:n.enable_mood,onCheckedChange:c=>r({...n,enable_mood:c})})]}),n.enable_mood&&e.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),e.jsx(ce,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:n.mood_update_threshold||1,onChange:c=>r({...n,mood_update_threshold:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"emotion_style",children:"情感特征"}),e.jsx(Ot,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:n.emotion_style||"",onChange:c=>r({...n,emotion_style:c.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),e.jsx(mr,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(N,{htmlFor:"all_global",children:"启用全局黑话模式"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),e.jsx(Ge,{id:"all_global",checked:n.all_global,onCheckedChange:c=>r({...n,all_global:c})})]})]})}function a0({config:n,onChange:r}){const[c,d]=u.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:e.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"flex-1 text-sm",children:[e.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),e.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),e.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",e.jsx(Fc,{className:"h-3 w-3"})]})]})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(N,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{id:"siliconflow_api_key",type:c?"text":"password",placeholder:"sk-...",value:n.api_key,onChange:h=>r({api_key:h.target.value}),className:"font-mono pr-10"}),e.jsx(b,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>d(!c),children:c?e.jsx(rr,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Ys,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[e.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[e.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),e.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),e.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),e.jsx("li",{children:"SenseVoice - 语音识别"}),e.jsx("li",{children:"BGE-M3 - 文本嵌入"}),e.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),e.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:e.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[e.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function l0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!n.ok)throw new Error("读取Bot配置失败");const c=(await n.json()).config.bot||{};return{qq_account:c.qq_account||0,nickname:c.nickname||"",alias_names:c.alias_names||[]}}async function n0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!n.ok)throw new Error("读取人格配置失败");const c=(await n.json()).config.personality||{};return{personality:c.personality||"",reply_style:c.reply_style||"",interest:c.interest||"",plan_style:c.plan_style||"",private_plan_style:c.private_plan_style||""}}async function i0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!n.ok)throw new Error("读取表情包配置失败");const c=(await n.json()).config.emoji||{};return{emoji_chance:c.emoji_chance??.4,max_reg_num:c.max_reg_num??40,do_replace:c.do_replace??!0,check_interval:c.check_interval??10,steal_emoji:c.steal_emoji??!0,content_filtration:c.content_filtration??!1,filtration_prompt:c.filtration_prompt||""}}async function r0(){const n=await ke("/api/webui/config/bot",{method:"GET",headers:Tt()});if(!n.ok)throw new Error("读取其他配置失败");const c=(await n.json()).config,d=c.tool||{},h=c.mood||{},x=c.jargon||{};return{enable_tool:d.enable_tool??!0,enable_mood:h.enable_mood??!1,mood_update_threshold:h.mood_update_threshold,emotion_style:h.emotion_style,all_global:x.all_global??!0}}async function c0(){const n=await ke("/api/webui/config/model",{method:"GET",headers:Tt()});if(!n.ok)throw new Error("读取模型配置失败");return{api_key:((await n.json()).config.api_providers||[]).find(x=>x.name==="SiliconFlow")?.api_key||""}}async function o0(n){const r=await ke("/api/webui/config/bot/section/bot",{method:"POST",headers:Tt(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存Bot基础配置失败")}return await r.json()}async function d0(n){const r=await ke("/api/webui/config/bot/section/personality",{method:"POST",headers:Tt(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存人格配置失败")}return await r.json()}async function u0(n){const r=await ke("/api/webui/config/bot/section/emoji",{method:"POST",headers:Tt(),body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"保存表情包配置失败")}return await r.json()}async function m0(n){const r=[];r.push(ke("/api/webui/config/bot/section/tool",{method:"POST",headers:Tt(),body:JSON.stringify({enable_tool:n.enable_tool})})),r.push(ke("/api/webui/config/bot/section/jargon",{method:"POST",headers:Tt(),body:JSON.stringify({all_global:n.all_global})}));const c={enable_mood:n.enable_mood};n.enable_mood&&(c.mood_update_threshold=n.mood_update_threshold||1,c.emotion_style=n.emotion_style||""),r.push(ke("/api/webui/config/bot/section/mood",{method:"POST",headers:Tt(),body:JSON.stringify(c)}));const d=await Promise.all(r);for(const h of d)if(!h.ok){const x=await h.json();throw new Error(x.detail||"保存其他配置失败")}return{success:!0}}async function h0(n){const r=await ke("/api/webui/config/model",{method:"GET",headers:Tt()});if(!r.ok)throw new Error("读取模型配置失败");const d=(await r.json()).config,h=d.api_providers||[],x=h.findIndex(p=>p.name==="SiliconFlow");x>=0?h[x]={...h[x],api_key:n.api_key}:h.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:n.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const f={...d,api_providers:h},j=await ke("/api/webui/config/model",{method:"POST",headers:Tt(),body:JSON.stringify(f)});if(!j.ok){const p=await j.json();throw new Error(p.detail||"保存模型配置失败")}return await j.json()}async function Wf(){const n=localStorage.getItem("access-token"),r=await ke("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${n}`}});if(!r.ok){const c=await r.json();throw new Error(c.message||"标记配置完成失败")}return await r.json()}async function so(){const n=await ke("/api/webui/system/restart",{method:"POST",headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"重启失败")}return await n.json()}async function x0(){const n=await ke("/api/webui/system/status",{method:"GET",headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取状态失败")}return await n.json()}function f0(){const n=ua(),{toast:r}=Rt(),[c,d]=u.useState(0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!0),[v,k]=u.useState({qq_account:0,nickname:"",alias_names:[]}),[T,E]=u.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.请控制你的发言频率,不要太过频繁的发言 +4.如果有人对你感到厌烦,请减少回复 +5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +2.如果相同的内容已经被执行,请不要重复执行 +3.某句话如果已经被回复过,不要重复回复`}),[R,F]=u.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[U,M]=u.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[Z,G]=u.useState({api_key:""}),[z,B]=u.useState(!1),[X,S]=u.useState(""),O=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:ar},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Ic},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:Lu},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:ti},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:sg}],se=(c+1)/O.length*100;u.useEffect(()=>{(async()=>{try{w(!0);const[q,H,ie,_,me]=await Promise.all([l0(),n0(),i0(),r0(),c0()]);k(q),E(H),F(ie),M(_),G(me)}catch(q){r({title:"加载配置失败",description:q instanceof Error?q.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{w(!1)}})()},[r]);const he=async()=>{j(!0);try{switch(c){case 0:await o0(v);break;case 1:await d0(T);break;case 2:await u0(R);break;case 3:await m0(U);break;case 4:await h0(Z);break}return r({title:"保存成功",description:`${O[c].title}配置已保存`}),!0}catch(y){return r({title:"保存失败",description:y instanceof Error?y.message:"未知错误",variant:"destructive"}),!1}finally{j(!1)}},ye=async()=>{await he()&&c{c>0&&d(c-1)},pe=async()=>{x(!0),B(!0);try{if(S("正在保存API配置..."),!await he()){x(!1),B(!1);return}S("正在完成初始化..."),await Wf(),S("正在重启麦麦..."),await so(),r({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),S("等待麦麦重启完成...");const q=60;let H=0,ie=!1;for(;HsetTimeout(_,1e3));try{(await x0()).running&&(ie=!0,S("重启成功!正在跳转..."))}catch{H++}}if(!ie)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{n({to:"/"})},1e3)}catch(y){B(!1),r({title:"配置失败",description:y instanceof Error?y.message:"未知错误",variant:"destructive"})}finally{x(!1)}},je=async()=>{try{await Wf(),n({to:"/"})}catch(y){r({title:"跳过失败",description:y instanceof Error?y.message:"未知错误",variant:"destructive"})}},_e=()=>{switch(c){case 0:return e.jsx(WN,{config:v,onChange:k});case 1:return e.jsx(e0,{config:T,onChange:E});case 2:return e.jsx(t0,{config:R,onChange:F});case 3:return e.jsx(s0,{config:U,onChange:M});case 4:return e.jsx(a0,{config:Z,onChange:G});default:return null}};return e.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[z&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[e.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:e.jsx(vs,{className:"h-10 w-10 animate-spin text-primary"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground",children:X})]}),e.jsx("div",{className:"w-full",children:e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:e.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),p?e.jsxs("div",{className:"relative z-10 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:e.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),e.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[e.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(oy,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Gu," 的初始配置"]})]}),e.jsxs("div",{className:"mb-6 md:mb-8",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",c+1," / ",O.length]}),e.jsxs("span",{className:"font-medium text-primary",children:[Math.round(se),"%"]})]}),e.jsx(vr,{value:se,className:"h-2"})]}),e.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:O.map((y,q)=>{const H=y.icon;return e.jsxs("div",{className:K("flex flex-1 flex-col items-center gap-1 md:gap-2",qn({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[e.jsx(to,{className:"h-4 w-4"}),"返回首页"]}),e.jsxs(b,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[e.jsx(Wn,{className:"h-4 w-4"}),"返回上一页"]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}const Be=Yb,He=Xb,Re=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(Bp,{ref:d,className:K("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...c,children:[r,e.jsx(Gb,{asChild:!0,children:e.jsx(Dl,{className:"h-4 w-4 opacity-50"})})]}));Re.displayName=Bp.displayName;const yg=u.forwardRef(({className:n,...r},c)=>e.jsx(Hp,{ref:c,className:K("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(or,{className:"h-4 w-4"})}));yg.displayName=Hp.displayName;const Ng=u.forwardRef(({className:n,...r},c)=>e.jsx(qp,{ref:c,className:K("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(Dl,{className:"h-4 w-4"})}));Ng.displayName=qp.displayName;const Le=u.forwardRef(({className:n,children:r,position:c="popper",...d},h)=>e.jsx(Vb,{children:e.jsxs(Gp,{ref:h,className:K("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 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 origin-[--radix-select-content-transform-origin]",c==="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",n),position:c,...d,children:[e.jsx(yg,{}),e.jsx(Fb,{className:K("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),e.jsx(Ng,{})]})}));Le.displayName=Gp.displayName;const p0=u.forwardRef(({className:n,...r},c)=>e.jsx(Vp,{ref:c,className:K("px-2 py-1.5 text-sm font-semibold",n),...r}));p0.displayName=Vp.displayName;const ne=u.forwardRef(({className:n,children:r,...c},d)=>e.jsxs(Fp,{ref:d,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...c,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx($b,{children:e.jsx(ga,{className:"h-4 w-4"})})}),e.jsx(Qb,{children:r})]}));ne.displayName=Fp.displayName;const g0=u.forwardRef(({className:n,...r},c)=>e.jsx($p,{ref:c,className:K("-mx-1 my-1 h-px bg-muted",n),...r}));g0.displayName=$p.displayName;const Ma=wb,Da=_b,va=u.forwardRef(({className:n,align:r="center",sideOffset:c=4,...d},h)=>e.jsx(Nb,{children:e.jsx(Ep,{ref:h,align:r,sideOffset:c,className:K("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 origin-[--radix-popover-content-transform-origin]",n),...d})}));va.displayName=Ep.displayName;const Rl="/api/webui/config";async function ep(){const r=await(await ke(`${Rl}/bot`)).json();if(!r.success)throw new Error("获取配置数据失败");return r.config}async function In(){const r=await(await ke(`${Rl}/model`)).json();if(!r.success)throw new Error("获取模型配置数据失败");return r.config}async function tp(n){const c=await(await ke(`${Rl}/bot`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function j0(){const r=await(await ke(`${Rl}/bot/raw`)).json();if(!r.success)throw new Error("获取配置源代码失败");return r.content}async function v0(n){const c=await(await ke(`${Rl}/bot/raw`,{method:"POST",body:JSON.stringify({raw_content:n})})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function eo(n){const c=await(await ke(`${Rl}/model`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||"保存配置失败")}async function b0(n,r){const d=await(await ke(`${Rl}/bot/section/${n}`,{method:"POST",body:JSON.stringify(r)})).json();if(!d.success)throw new Error(d.message||`保存配置节 ${n} 失败`)}async function Mu(n,r){const d=await(await ke(`${Rl}/model/section/${n}`,{method:"POST",body:JSON.stringify(r)})).json();if(!d.success)throw new Error(d.message||`保存配置节 ${n} 失败`)}async function y0(n,r="openai",c="/models"){const d=new URLSearchParams({provider_name:n,parser:r,endpoint:c}),h=await ke(`/api/webui/models/list?${d}`);if(!h.ok){const f=await h.json().catch(()=>({}));throw new Error(f.detail||`获取模型列表失败 (${h.status})`)}const x=await h.json();if(!x.success)throw new Error("获取模型列表失败");return x.models}async function N0(n){const r=new URLSearchParams({provider_name:n}),c=await ke(`/api/webui/models/test-connection-by-name?${r}`,{method:"POST"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.detail||`测试连接失败 (${c.status})`)}return await c.json()}const w0=ei("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),al=u.forwardRef(({className:n,variant:r,...c},d)=>e.jsx("div",{ref:d,role:"alert",className:K(w0({variant:r}),n),...c}));al.displayName="Alert";const _0=u.forwardRef(({className:n,...r},c)=>e.jsx("h5",{ref:c,className:K("mb-1 font-medium leading-none tracking-tight",n),...r}));_0.displayName="AlertTitle";const ll=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{ref:c,className:K("text-sm [&_p]:leading-relaxed",n),...r}));ll.displayName="AlertDescription";function $u({onRestartComplete:n,onRestartFailed:r}){const[c,d]=u.useState(0),[h,x]=u.useState("restarting"),[f,j]=u.useState(0),[p,w]=u.useState(0);u.useEffect(()=>{const T=setInterval(()=>{d(F=>F>=90?F:F+1)},200),E=setInterval(()=>{j(F=>F+1)},1e3),R=setTimeout(()=>{x("checking"),v()},3e3);return()=>{clearInterval(T),clearInterval(E),clearTimeout(R)}},[]);const v=()=>{const E=async()=>{try{if(w(F=>F+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)d(100),x("success"),setTimeout(()=>{n?.()},1500);else throw new Error("Status check failed")}catch{p<60?setTimeout(E,2e3):(x("failed"),r?.())}};E()},k=T=>{const E=Math.floor(T/60),R=T%60;return`${E}:${R.toString().padStart(2,"0")}`};return e.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:e.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[h==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx(vs,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),h==="checking"&&e.jsxs(e.Fragment,{children:[e.jsx(vs,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),e.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",p,"/60)"]})]}),h==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(oa,{className:"h-16 w-16 text-green-500"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),h==="failed"&&e.jsxs(e.Fragment,{children:[e.jsx(Ea,{className:"h-16 w-16 text-destructive"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),h!=="failed"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(vr,{value:c,className:"h-2"}),e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[c,"%"]}),e.jsxs("span",{children:["已用时: ",k(f)]})]})]}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[h==="restarting"&&"🔄 配置已保存,正在重启主程序...",h==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",h==="success"&&"✅ 配置已生效,服务运行正常",h==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),h==="failed"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),e.jsx("button",{onClick:()=>{x("checking"),w(0),v()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}const S0={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(n,r){let c;if(!r.inString&&(c=n.match(/^('''|"""|'|")/))&&(r.stringType=c[0],r.inString=!0),n.sol()&&!r.inString&&r.inArray===0&&(r.lhs=!0),r.inString){for(;r.inString;)if(n.match(r.stringType))r.inString=!1;else if(n.peek()==="\\")n.next(),n.next();else{if(n.eol())break;n.match(/^.[^\\\"\']*/)}return r.lhs?"property":"string"}else{if(r.inArray&&n.peek()==="]")return n.next(),r.inArray--,"bracket";if(r.lhs&&n.peek()==="["&&n.skipTo("]"))return n.next(),n.peek()==="]"&&n.next(),"atom";if(n.peek()==="#")return n.skipToEnd(),"comment";if(n.eatSpace())return null;if(r.lhs&&n.eatWhile(function(d){return d!="="&&d!=" "}))return"property";if(r.lhs&&n.peek()==="=")return n.next(),r.lhs=!1,null;if(!r.lhs&&n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!r.lhs&&(n.match("true")||n.match("false")))return"atom";if(!r.lhs&&n.peek()==="[")return r.inArray++,n.next(),"bracket";if(!r.lhs&&n.match(/^\-?\d+(?:\.\d+)?/))return"number";n.eatSpace()||n.next()}return null},languageData:{commentTokens:{line:"#"}}},C0={python:[Oy()],json:[Ry(),Ly()],toml:[Dy.define(S0)],text:[]};function k0({value:n,onChange:r,language:c="text",readOnly:d=!1,height:h="400px",minHeight:x,maxHeight:f,placeholder:j,theme:p="dark",className:w=""}){const[v,k]=u.useState(!1);if(u.useEffect(()=>{k(!0)},[]),!v)return e.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${w}`,style:{height:h,minHeight:x,maxHeight:f}});const T=[...C0[c]||[],Ff.lineWrapping];return d&&T.push(Ff.editable.of(!1)),e.jsx("div",{className:`rounded-md overflow-hidden border ${w}`,children:e.jsx(Uy,{value:n,height:h,minHeight:x,maxHeight:f,theme:p==="dark"?By:void 0,extensions:T,onChange:r,placeholder:j,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function T0(){const[n,r]=u.useState(!0),[c,d]=u.useState(!1),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!1),[T,E]=u.useState("visual"),[R,F]=u.useState(""),[U,M]=u.useState(!1),{toast:Z}=Rt(),[G,z]=u.useState(null),[B,X]=u.useState(null),[S,O]=u.useState(null),[se,he]=u.useState(null),[ye,be]=u.useState(null),[pe,je]=u.useState(null),[_e,y]=u.useState(null),[q,H]=u.useState(null),[ie,_]=u.useState(null),[me,xe]=u.useState(null),[Q,de]=u.useState(null),[ge,le]=u.useState(null),[L,$]=u.useState(null),[D,ee]=u.useState(null),[Ne,ze]=u.useState(null),[We,Xe]=u.useState(null),[Mt,qt]=u.useState(null),[re,we]=u.useState(null),Je=u.useRef(null),Fe=u.useRef(!0),Wt=u.useRef({}),Xs=u.useCallback(async()=>{try{const Se=await j0();F(Se),M(!1)}catch(Se){Z({variant:"destructive",title:"加载失败",description:Se instanceof Error?Se.message:"加载源代码失败"})}},[Z]),Ns=u.useCallback(async()=>{try{r(!0);const Se=await ep();Wt.current=Se,z(Se.bot),X(Se.personality);const Oe=Se.chat;Oe.talk_value_rules||(Oe.talk_value_rules=[]),O(Oe),he(Se.expression),be(Se.emoji),je(Se.memory),y(Se.tool),H(Se.mood),_(Se.voice),xe(Se.lpmm_knowledge),de(Se.keyword_reaction),le(Se.response_post_process),$(Se.chinese_typo),ee(Se.response_splitter),ze(Se.log),Xe(Se.debug),qt(Se.maim_message),we(Se.telemetry),j(!1),Fe.current=!1,await Xs()}catch(Se){console.error("加载配置失败:",Se),Z({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{r(!1)}},[Z,Xs]);u.useEffect(()=>{Ns()},[Ns]);const Ke=u.useCallback(async(Se,Oe)=>{if(!Fe.current)try{x(!0),await b0(Se,Oe),j(!1)}catch(ns){console.error(`自动保存 ${Se} 失败:`,ns),j(!0)}finally{x(!1)}},[]),Ue=u.useCallback((Se,Oe)=>{Fe.current||(j(!0),Je.current&&clearTimeout(Je.current),Je.current=setTimeout(()=>{Ke(Se,Oe)},2e3))},[Ke]);u.useEffect(()=>{G&&!Fe.current&&Ue("bot",G)},[G,Ue]),u.useEffect(()=>{B&&!Fe.current&&Ue("personality",B)},[B,Ue]),u.useEffect(()=>{S&&!Fe.current&&Ue("chat",S)},[S,Ue]),u.useEffect(()=>{se&&!Fe.current&&Ue("expression",se)},[se,Ue]),u.useEffect(()=>{ye&&!Fe.current&&Ue("emoji",ye)},[ye,Ue]),u.useEffect(()=>{pe&&!Fe.current&&Ue("memory",pe)},[pe,Ue]),u.useEffect(()=>{_e&&!Fe.current&&Ue("tool",_e)},[_e,Ue]),u.useEffect(()=>{q&&!Fe.current&&Ue("mood",q)},[q,Ue]),u.useEffect(()=>{ie&&!Fe.current&&Ue("voice",ie)},[ie,Ue]),u.useEffect(()=>{me&&!Fe.current&&Ue("lpmm_knowledge",me)},[me,Ue]),u.useEffect(()=>{Q&&!Fe.current&&Ue("keyword_reaction",Q)},[Q,Ue]),u.useEffect(()=>{ge&&!Fe.current&&Ue("response_post_process",ge)},[ge,Ue]),u.useEffect(()=>{L&&!Fe.current&&Ue("chinese_typo",L)},[L,Ue]),u.useEffect(()=>{D&&!Fe.current&&Ue("response_splitter",D)},[D,Ue]),u.useEffect(()=>{Ne&&!Fe.current&&Ue("log",Ne)},[Ne,Ue]),u.useEffect(()=>{We&&!Fe.current&&Ue("debug",We)},[We,Ue]),u.useEffect(()=>{Mt&&!Fe.current&&Ue("maim_message",Mt)},[Mt,Ue]),u.useEffect(()=>{re&&!Fe.current&&Ue("telemetry",re)},[re,Ue]);const js=async()=>{try{d(!0),await v0(R),j(!1),M(!1),Z({title:"保存成功",description:"配置已保存"}),await Ns()}catch(Se){M(!0),Z({variant:"destructive",title:"保存失败",description:Se instanceof Error?Se.message:"保存配置失败"})}finally{d(!1)}},ls=async Se=>{if(f){Z({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(E(Se),Se==="source")await Xs();else try{const Oe=await ep();Wt.current=Oe,z(Oe.bot),X(Oe.personality);const ns=Oe.chat;ns.talk_value_rules||(ns.talk_value_rules=[]),O(ns),he(Oe.expression),be(Oe.emoji),je(Oe.memory),y(Oe.tool),H(Oe.mood),_(Oe.voice),xe(Oe.lpmm_knowledge),de(Oe.keyword_reaction),le(Oe.response_post_process),$(Oe.chinese_typo),ee(Oe.response_splitter),ze(Oe.log),Xe(Oe.debug),qt(Oe.maim_message),we(Oe.telemetry),j(!1)}catch(Oe){console.error("加载配置失败:",Oe),Z({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},_s=async()=>{try{d(!0),Je.current&&clearTimeout(Je.current);const Se={...Wt.current,bot:G,personality:B,chat:S,expression:se,emoji:ye,memory:pe,tool:_e,mood:q,voice:ie,lpmm_knowledge:me,keyword_reaction:Q,response_post_process:ge,chinese_typo:L,response_splitter:D,log:Ne,debug:We,maim_message:Mt,telemetry:re};await tp(Se),j(!1),Z({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Se){console.error("保存配置失败:",Se),Z({title:"保存失败",description:Se.message,variant:"destructive"})}finally{d(!1)}},Ss=async()=>{try{w(!0),so().catch(()=>{}),k(!0)}catch(Se){console.error("重启失败:",Se),k(!1),Z({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),w(!1)}},nl=async()=>{try{d(!0),Je.current&&clearTimeout(Je.current);const Se={...Wt.current,bot:G,personality:B,chat:S,expression:se,emoji:ye,memory:pe,tool:_e,mood:q,voice:ie,lpmm_knowledge:me,keyword_reaction:Q,response_post_process:ge,chinese_typo:L,response_splitter:D,log:Ne,debug:We,maim_message:Mt,telemetry:re};await tp(Se),j(!1),Z({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Oe=>setTimeout(Oe,500)),await Ss()}catch(Se){console.error("保存失败:",Se),Z({title:"保存失败",description:Se.message,variant:"destructive"})}finally{d(!1)}},il=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},rl=()=>{k(!1),w(!1),Z({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return n?e.jsx(Ie,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold",children:"麦麦主程序配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs sm:text-sm",children:"管理麦麦的核心功能和行为设置"})]}),e.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[e.jsxs(b,{onClick:T==="visual"?_s:js,disabled:c||h||!f||p,size:"sm",variant:"outline",className:"w-20 sm:w-24",children:[e.jsx(pr,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{className:"ml-1 truncate text-xs sm:text-sm",children:c?"保存中":h?"自动":f?"保存":"已保存"})]}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{disabled:c||h||p,size:"sm",className:"w-20 sm:w-28",children:[e.jsx(fr,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"ml-1 truncate text-xs sm:text-sm",children:p?"重启中":f?"保存重启":"重启"})]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认重启麦麦?"}),e.jsx(dt,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:f?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})})})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:f?nl:Ss,children:f?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsx("div",{className:"flex",children:e.jsx(Aa,{value:T,onValueChange:Se=>ls(Se),className:"w-full",children:e.jsxs(ja,{className:"h-8 sm:h-9 w-full grid grid-cols-2",children:[e.jsxs(st,{value:"visual",className:"text-xs sm:text-sm",children:[e.jsx(my,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化编辑"]}),e.jsxs(st,{value:"source",className:"text-xs sm:text-sm",children:[e.jsx(hy,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码编辑"]})]})})})]}),e.jsxs(al,{children:[e.jsx(za,{className:"h-4 w-4"}),e.jsxs(ll,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),T==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(al,{children:[e.jsx(za,{className:"h-4 w-4"}),e.jsxs(ll,{children:[e.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",U&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),e.jsx(k0,{value:R,onChange:Se=>{F(Se),j(!0),U&&M(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),T==="visual"&&e.jsx(e.Fragment,{children:e.jsxs(Aa,{defaultValue:"bot",className:"w-full",children:[e.jsxs(ja,{className:"flex flex-wrap h-auto gap-1 p-1 sm:grid sm:grid-cols-5 lg:grid-cols-10",children:[e.jsx(st,{value:"bot",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"基本信息"}),e.jsx(st,{value:"personality",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"人格"}),e.jsx(st,{value:"chat",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"聊天"}),e.jsx(st,{value:"expression",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"表达"}),e.jsx(st,{value:"features",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"功能"}),e.jsx(st,{value:"processing",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"处理"}),e.jsx(st,{value:"mood",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"情绪"}),e.jsx(st,{value:"voice",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"语音"}),e.jsx(st,{value:"lpmm",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"知识库"}),e.jsx(st,{value:"other",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"其他"})]}),e.jsx(_t,{value:"bot",className:"space-y-4",children:G&&e.jsx(E0,{config:G,onChange:z})}),e.jsx(_t,{value:"personality",className:"space-y-4",children:B&&e.jsx(z0,{config:B,onChange:X})}),e.jsx(_t,{value:"chat",className:"space-y-4",children:S&&e.jsx(A0,{config:S,onChange:O})}),e.jsx(_t,{value:"expression",className:"space-y-4",children:se&&e.jsx(D0,{config:se,onChange:he})}),e.jsx(_t,{value:"features",className:"space-y-4",children:ye&&pe&&_e&&e.jsx(O0,{emojiConfig:ye,memoryConfig:pe,toolConfig:_e,onEmojiChange:be,onMemoryChange:je,onToolChange:y})}),e.jsx(_t,{value:"processing",className:"space-y-4",children:Q&&ge&&L&&D&&e.jsx(R0,{keywordReactionConfig:Q,responsePostProcessConfig:ge,chineseTypoConfig:L,responseSplitterConfig:D,onKeywordReactionChange:de,onResponsePostProcessChange:le,onChineseTypoChange:$,onResponseSplitterChange:ee})}),e.jsx(_t,{value:"mood",className:"space-y-4",children:q&&e.jsx(L0,{config:q,onChange:H})}),e.jsx(_t,{value:"voice",className:"space-y-4",children:ie&&e.jsx(U0,{config:ie,onChange:_})}),e.jsx(_t,{value:"lpmm",className:"space-y-4",children:me&&e.jsx(B0,{config:me,onChange:xe})}),e.jsxs(_t,{value:"other",className:"space-y-4",children:[Ne&&e.jsx(H0,{config:Ne,onChange:ze}),We&&e.jsx(q0,{config:We,onChange:Xe}),Mt&&e.jsx(G0,{config:Mt,onChange:qt}),re&&e.jsx(V0,{config:re,onChange:we})]})]})}),v&&e.jsx($u,{onRestartComplete:il,onRestartFailed:rl})]})})}function E0({config:n,onChange:r}){const c=()=>{r({...n,platforms:[...n.platforms,""]})},d=p=>{r({...n,platforms:n.platforms.filter((w,v)=>v!==p)})},h=(p,w)=>{const v=[...n.platforms];v[p]=w,r({...n,platforms:v})},x=()=>{r({...n,alias_names:[...n.alias_names,""]})},f=p=>{r({...n,alias_names:n.alias_names.filter((w,v)=>v!==p)})},j=(p,w)=>{const v=[...n.alias_names];v[p]=w,r({...n,alias_names:v})};return e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"platform",children:"平台"}),e.jsx(ce,{id:"platform",value:n.platform,onChange:p=>r({...n,platform:p.target.value}),placeholder:"qq"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"qq_account",children:"QQ账号"}),e.jsx(ce,{id:"qq_account",value:n.qq_account,onChange:p=>r({...n,qq_account:p.target.value}),placeholder:"123456789"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"nickname",children:"昵称"}),e.jsx(ce,{id:"nickname",value:n.nickname,onChange:p=>r({...n,nickname:p.target.value}),placeholder:"麦麦"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{children:"其他平台账号"}),e.jsxs(b,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.platforms.map((p,w)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:p,onChange:v=>h(w,v.target.value),placeholder:"wx:114514"}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除平台账号 "',p||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d(w),children:"删除"})]})]})]})]},w)),n.platforms.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{children:"别名"}),e.jsxs(b,{onClick:x,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[n.alias_names.map((p,w)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:p,onChange:v=>j(w,v.target.value),placeholder:"小麦"}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除别名 "',p||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>f(w),children:"删除"})]})]})]})]},w)),n.alias_names.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function z0({config:n,onChange:r}){const c=()=>{r({...n,states:[...n.states,""]})},d=x=>{r({...n,states:n.states.filter((f,j)=>j!==x)})},h=(x,f)=>{const j=[...n.states];j[x]=f,r({...n,states:j})};return e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"personality",children:"人格特质"}),e.jsx(Ot,{id:"personality",value:n.personality,onChange:x=>r({...n,personality:x.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"reply_style",children:"表达风格"}),e.jsx(Ot,{id:"reply_style",value:n.reply_style,onChange:x=>r({...n,reply_style:x.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"interest",children:"兴趣"}),e.jsx(Ot,{id:"interest",value:n.interest,onChange:x=>r({...n,interest:x.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"plan_style",children:"说话规则与行为风格"}),e.jsx(Ot,{id:"plan_style",value:n.plan_style,onChange:x=>r({...n,plan_style:x.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"visual_style",children:"识图规则"}),e.jsx(Ot,{id:"visual_style",value:n.visual_style,onChange:x=>r({...n,visual_style:x.target.value}),placeholder:"识图时的处理规则",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"private_plan_style",children:"私聊规则"}),e.jsx(Ot,{id:"private_plan_style",value:n.private_plan_style,onChange:x=>r({...n,private_plan_style:x.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{children:"状态列表(人格多样性)"}),e.jsxs(b,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),e.jsx("div",{className:"space-y-2",children:n.states.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Ot,{value:x,onChange:j=>h(f,j.target.value),placeholder:"描述一个人格状态",rows:2}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsx(dt,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d(f),children:"删除"})]})]})]})]},f))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"state_probability",children:"状态替换概率"}),e.jsx(ce,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:n.state_probability,onChange:x=>r({...n,state_probability:parseFloat(x.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function A0({config:n,onChange:r}){const c=()=>{r({...n,talk_value_rules:[...n.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},d=j=>{r({...n,talk_value_rules:n.talk_value_rules.filter((p,w)=>w!==j)})},h=(j,p,w)=>{const v=[...n.talk_value_rules];v[j]={...v[j],[p]:w},r({...n,talk_value_rules:v})},x=({value:j,onChange:p})=>{const[w,v]=u.useState("00"),[k,T]=u.useState("00"),[E,R]=u.useState("23"),[F,U]=u.useState("59");u.useEffect(()=>{const Z=j.split("-");if(Z.length===2){const[G,z]=Z,[B,X]=G.split(":"),[S,O]=z.split(":");B&&v(B.padStart(2,"0")),X&&T(X.padStart(2,"0")),S&&R(S.padStart(2,"0")),O&&U(O.padStart(2,"0"))}},[j]);const M=(Z,G,z,B)=>{const X=`${Z}:${G}-${z}:${B}`;p(X)};return e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[e.jsx(Jn,{className:"h-4 w-4 mr-2"}),j||"选择时间段"]})}),e.jsx(va,{className:"w-72 sm:w-80",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xs",children:"小时"}),e.jsxs(Be,{value:w,onValueChange:Z=>{v(Z),M(Z,k,E,F)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:Array.from({length:24},(Z,G)=>G).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-xs",children:"分钟"}),e.jsxs(Be,{value:k,onValueChange:Z=>{T(Z),M(w,Z,E,F)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:Array.from({length:60},(Z,G)=>G).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xs",children:"小时"}),e.jsxs(Be,{value:E,onValueChange:Z=>{R(Z),M(w,k,Z,F)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:Array.from({length:24},(Z,G)=>G).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-xs",children:"分钟"}),e.jsxs(Be,{value:F,onValueChange:Z=>{U(Z),M(w,k,E,Z)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:Array.from({length:60},(Z,G)=>G).map(Z=>e.jsx(ne,{value:Z.toString().padStart(2,"0"),children:Z.toString().padStart(2,"0")},Z))})]})]})]})]})]})})]})},f=({rule:j})=>{const p=`{ target = "${j.target}", time = "${j.time}", value = ${j.value.toFixed(1)} }`;return e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",children:[e.jsx(Ys,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(va,{className:"w-80 sm:w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:p}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),e.jsx(ce,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:n.talk_value,onChange:j=>r({...n,talk_value:parseFloat(j.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"mentioned_bot_reply",checked:n.mentioned_bot_reply,onCheckedChange:j=>r({...n,mentioned_bot_reply:j})}),e.jsx(N,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"max_context_size",children:"上下文长度"}),e.jsx(ce,{id:"max_context_size",type:"number",min:"1",value:n.max_context_size,onChange:j=>r({...n,max_context_size:parseInt(j.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"planner_smooth",children:"规划器平滑"}),e.jsx(ce,{id:"planner_smooth",type:"number",step:"1",min:"0",value:n.planner_smooth,onChange:j=>r({...n,planner_smooth:parseFloat(j.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"enable_talk_value_rules",checked:n.enable_talk_value_rules,onCheckedChange:j=>r({...n,enable_talk_value_rules:j})}),e.jsx(N,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"include_planner_reasoning",checked:n.include_planner_reasoning,onCheckedChange:j=>r({...n,include_planner_reasoning:j})}),e.jsx(N,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),n.enable_talk_value_rules&&e.jsxs("div",{className:"border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),e.jsxs(b,{onClick:c,size:"sm",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),n.talk_value_rules&&n.talk_value_rules.length>0?e.jsx("div",{className:"space-y-4",children:n.talk_value_rules.map((j,p)=>e.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",p+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{rule:j}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{variant:"ghost",size:"sm",children:e.jsx(Pe,{className:"h-4 w-4 text-destructive"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除规则 #",p+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d(p),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(Be,{value:j.target===""?"global":"specific",onValueChange:w=>{w==="global"?h(p,"target",""):h(p,"target","qq::group")},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"global",children:"全局配置"}),e.jsx(ne,{value:"specific",children:"详细配置"})]})]})]}),j.target!==""&&(()=>{const w=j.target.split(":"),v=w[0]||"qq",k=w[1]||"",T=w[2]||"group";return e.jsxs("div",{className:"grid gap-4 p-3 sm:p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"平台"}),e.jsxs(Be,{value:v,onValueChange:E=>{h(p,"target",`${E}:${k}:${T}`)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(ce,{value:k,onChange:E=>{h(p,"target",`${v}:${E.target.value}:${T}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"类型"}),e.jsxs(Be,{value:T,onValueChange:E=>{h(p,"target",`${v}:${k}:${E}`)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"group",children:"群组(group)"}),e.jsx(ne,{value:"private",children:"私聊(private)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",j.target||"(未设置)"]})]})})(),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"时间段 (Time)"}),e.jsx(x,{value:j.time,onChange:w=>h(p,"time",w)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{htmlFor:`rule-value-${p}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),e.jsx(ce,{id:`rule-value-${p}`,type:"number",step:"0.01",min:"0.01",max:"1",value:j.value,onChange:w=>{const v=parseFloat(w.target.value);isNaN(v)||h(p,"value",Math.max(.01,Math.min(1,v)))},className:"w-20 h-8 text-xs"})]}),e.jsx(ka,{value:[j.value],onValueChange:w=>h(p,"value",w[0]),min:.01,max:1,step:.01,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0.01 (极少发言)"}),e.jsx("span",{children:"0.5"}),e.jsx("span",{children:"1.0 (正常)"})]})]})]})]},p))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),e.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),e.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function M0({member:n,groupIndex:r,memberIndex:c,availableChatIds:d,onUpdate:h,onRemove:x}){const f=d.includes(n)||n==="*",[j,p]=u.useState(!f);return e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 flex gap-2",children:j?e.jsxs(e.Fragment,{children:[e.jsx(ce,{value:n,onChange:w=>h(r,c,w.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),d.length>0&&e.jsx(b,{size:"sm",variant:"outline",onClick:()=>p(!1),title:"切换到下拉选择",children:"下拉"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{value:n,onValueChange:w=>h(r,c,w),children:[e.jsx(Re,{className:"flex-1",children:e.jsx(He,{placeholder:"选择聊天流"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"*",children:"* (全局共享)"}),d.map((w,v)=>e.jsx(ne,{value:w,children:w},v))]})]}),e.jsx(b,{size:"sm",variant:"outline",onClick:()=>p(!0),title:"切换到手动输入",children:"输入"})]})}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除组成员 "',n||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>x(r,c),children:"删除"})]})]})]})]})}function D0({config:n,onChange:r}){const c=()=>{r({...n,learning_list:[...n.learning_list,["","enable","enable","1.0"]]})},d=k=>{r({...n,learning_list:n.learning_list.filter((T,E)=>E!==k)})},h=(k,T,E)=>{const R=[...n.learning_list];R[k][T]=E,r({...n,learning_list:R})},x=({rule:k})=>{const T=`["${k[0]}", "${k[1]}", "${k[2]}", "${k[3]}"]`;return e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",children:[e.jsx(Ys,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(va,{className:"w-80 sm:w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},f=()=>{r({...n,expression_groups:[...n.expression_groups,[]]})},j=k=>{r({...n,expression_groups:n.expression_groups.filter((T,E)=>E!==k)})},p=k=>{const T=[...n.expression_groups];T[k]=[...T[k],""],r({...n,expression_groups:T})},w=(k,T)=>{const E=[...n.expression_groups];E[k]=E[k].filter((R,F)=>F!==T),r({...n,expression_groups:E})},v=(k,T,E)=>{const R=[...n.expression_groups];R[k][T]=E,r({...n,expression_groups:R})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),e.jsxs(b,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.learning_list.map((k,T)=>{const E=n.learning_list.some((G,z)=>z!==T&&G[0]===""),R=k[0]==="",F=k[0].split(":"),U=F[0]||"qq",M=F[1]||"",Z=F[2]||"group";return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["规则 ",T+1," ",R&&"(全局配置)"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{rule:k}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"sm",variant:"ghost",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除学习规则 ",T+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d(T),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(Be,{value:R?"global":"specific",onValueChange:G=>{G==="global"?h(T,0,""):h(T,0,"qq::group")},disabled:E&&!R,children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"global",children:"全局配置"}),e.jsx(ne,{value:"specific",disabled:E&&!R,children:"详细配置"})]})]}),E&&!R&&e.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!R&&e.jsxs("div",{className:"grid gap-4 p-3 sm:p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"平台"}),e.jsxs(Be,{value:U,onValueChange:G=>{h(T,0,`${G}:${M}:${Z}`)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(ce,{value:M,onChange:G=>{h(T,0,`${U}:${G.target.value}:${Z}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"类型"}),e.jsxs(Be,{value:Z,onValueChange:G=>{h(T,0,`${U}:${M}:${G}`)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"group",children:"群组(group)"}),e.jsx(ne,{value:"private",children:"私聊(private)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",k[0]||"(未设置)"]})]}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xs font-medium",children:"使用学到的表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),e.jsx(Ge,{checked:k[1]==="enable",onCheckedChange:G=>h(T,1,G?"enable":"disable")})]})}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xs font-medium",children:"学习表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),e.jsx(Ge,{checked:k[2]==="enable",onCheckedChange:G=>h(T,2,G?"enable":"disable")})]})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{className:"text-xs font-medium",children:"学习强度"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"5",value:k[3],onChange:G=>{const z=parseFloat(G.target.value);isNaN(z)||h(T,3,Math.max(0,Math.min(5,z)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),e.jsx(ka,{value:[parseFloat(k[3])||1],onValueChange:G=>h(T,3,G[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0 (不学习)"}),e.jsx("span",{children:"2.5"}),e.jsx("span",{children:"5.0 (快速学习)"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},T)}),n.learning_list.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达反思配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦主动向管理员询问表达方式是否合适的功能"})]}),e.jsx(Ge,{checked:n.reflect,onCheckedChange:k=>r({...n,reflect:k})})]}),n.reflect&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("span",{className:"text-sm font-medium",children:"反思操作员"})}),e.jsx("div",{className:"space-y-4",children:(()=>{const T=(n.reflect_operator_id||"").split(":"),E=T[0]||"qq",R=T[1]||"",F=T[2]||"private";return e.jsxs("div",{className:"grid gap-4 p-3 sm:p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"平台"}),e.jsxs(Be,{value:E,onValueChange:U=>{r({...n,reflect_operator_id:`${U}:${R}:${F}`})},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"用户/群 ID"}),e.jsx(ce,{value:R,onChange:U=>{r({...n,reflect_operator_id:`${E}:${U.target.value}:${F}`})},placeholder:"输入 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"类型"}),e.jsxs(Be,{value:F,onValueChange:U=>{r({...n,reflect_operator_id:`${E}:${R}:${U}`})},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"private",children:"私聊(private)"}),e.jsx(ne,{value:"group",children:"群组(group)"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前操作员 ID:",n.reflect_operator_id||"(未设置)"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦会向此操作员询问表达方式是否合适"})]})})()})]}),e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:"允许反思的聊天流"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"只有在此列表中的聊天流才会提出问题并跟踪。如果列表为空,则所有聊天流都可以进行表达反思"})]}),e.jsxs(b,{onClick:()=>{r({...n,allow_reflect:[...n.allow_reflect||[],"qq::group"]})},size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加聊天流"]})]}),e.jsxs("div",{className:"space-y-2",children:[(n.allow_reflect||[]).map((k,T)=>{const E=k.split(":"),R=E[0]||"qq",F=E[1]||"",U=E[2]||"group";return e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50",children:[e.jsxs(Be,{value:R,onValueChange:M=>{const Z=[...n.allow_reflect];Z[T]=`${M}:${F}:${U}`,r({...n,allow_reflect:Z})},children:[e.jsx(Re,{className:"w-24",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"qq",children:"QQ"}),e.jsx(ne,{value:"wx",children:"微信"})]})]}),e.jsx(ce,{value:F,onChange:M=>{const Z=[...n.allow_reflect];Z[T]=`${R}:${M.target.value}:${U}`,r({...n,allow_reflect:Z})},placeholder:"ID",className:"flex-1 font-mono text-sm"}),e.jsxs(Be,{value:U,onValueChange:M=>{const Z=[...n.allow_reflect];Z[T]=`${R}:${F}:${M}`,r({...n,allow_reflect:Z})},children:[e.jsx(Re,{className:"w-32",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"group",children:"群组"}),e.jsx(ne,{value:"private",children:"私聊"})]})]}),e.jsx(b,{onClick:()=>{r({...n,allow_reflect:n.allow_reflect.filter((M,Z)=>Z!==T)})},size:"sm",variant:"ghost",children:e.jsx(Pe,{className:"h-4 w-4"})})]},T)}),(!n.allow_reflect||n.allow_reflect.length===0)&&e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"列表为空,所有聊天流都可以进行表达反思"})]})]})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),e.jsxs(b,{onClick:f,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.expression_groups.map((k,T)=>{const E=n.learning_list.map(R=>R[0]).filter(R=>R!=="");return e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",T+1,k.length===1&&k[0]==="*"&&"(全局共享)"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{onClick:()=>p(T),size:"sm",variant:"outline",children:e.jsx(cs,{className:"h-4 w-4"})}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"sm",variant:"ghost",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除共享组 ",T+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>j(T),children:"删除"})]})]})]})]})]}),e.jsx("div",{className:"space-y-2",children:k.map((R,F)=>e.jsx(M0,{member:R,groupIndex:T,memberIndex:F,availableChatIds:E,onUpdate:v,onRemove:w},`${T}-${F}`))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},T)}),n.expression_groups.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function O0({emojiConfig:n,memoryConfig:r,toolConfig:c,onEmojiChange:d,onMemoryChange:h,onToolChange:x}){return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"enable_tool",checked:c.enable_tool,onCheckedChange:f=>x({...c,enable_tool:f})}),e.jsx(N,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),e.jsx(ce,{id:"max_agent_iterations",type:"number",min:"1",value:r.max_agent_iterations,onChange:f=>h({...r,max_agent_iterations:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsx(ce,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:n.emoji_chance,onChange:f=>d({...n,emoji_chance:parseFloat(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"max_reg_num",children:"最大注册数量"}),e.jsx(ce,{id:"max_reg_num",type:"number",min:"1",value:n.max_reg_num,onChange:f=>d({...n,max_reg_num:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(ce,{id:"check_interval",type:"number",min:"1",value:n.check_interval,onChange:f=>d({...n,check_interval:parseInt(f.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"do_replace",checked:n.do_replace,onCheckedChange:f=>d({...n,do_replace:f})}),e.jsx(N,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:f=>d({...n,steal_emoji:f})}),e.jsx(N,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:f=>d({...n,content_filtration:f})}),e.jsx(N,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),n.content_filtration&&e.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[e.jsx(N,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(ce,{id:"filtration_prompt",value:n.filtration_prompt,onChange:f=>d({...n,filtration_prompt:f.target.value}),placeholder:"符合公序良俗"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function R0({keywordReactionConfig:n,responsePostProcessConfig:r,chineseTypoConfig:c,responseSplitterConfig:d,onKeywordReactionChange:h,onResponsePostProcessChange:x,onChineseTypoChange:f,onResponseSplitterChange:j}){const p=()=>{h({...n,regex_rules:[...n.regex_rules,{regex:[""],reaction:""}]})},w=z=>{h({...n,regex_rules:n.regex_rules.filter((B,X)=>X!==z)})},v=(z,B,X)=>{const S=[...n.regex_rules];B==="regex"&&typeof X=="string"?S[z]={...S[z],regex:[X]}:B==="reaction"&&typeof X=="string"&&(S[z]={...S[z],reaction:X}),h({...n,regex_rules:S})},k=({regex:z,reaction:B,onRegexChange:X,onReactionChange:S})=>{const[O,se]=u.useState(!1),[he,ye]=u.useState(""),[be,pe]=u.useState(null),[je,_e]=u.useState(""),[y,q]=u.useState({}),[H,ie]=u.useState(""),_=u.useRef(null),[me,xe]=u.useState("build"),Q=L=>L.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),de=(L,$=0)=>{const D=_.current;if(!D)return;const ee=D.selectionStart||0,Ne=D.selectionEnd||0,ze=z.substring(0,ee)+L+z.substring(Ne);X(ze),setTimeout(()=>{const We=ee+L.length+$;D.setSelectionRange(We,We),D.focus()},0)};u.useEffect(()=>{if(!z||!he){pe(null),q({}),ie(B),_e("");return}try{const L=Q(z),$=new RegExp(L,"g"),D=he.match($);pe(D),_e("");const Ne=new RegExp(L).exec(he);if(Ne&&Ne.groups){q(Ne.groups);let ze=B;Object.entries(Ne.groups).forEach(([We,Xe])=>{ze=ze.replace(new RegExp(`\\[${We}\\]`,"g"),Xe||"")}),ie(ze)}else q({}),ie(B)}catch(L){_e(L.message),pe(null),q({}),ie(B)}},[z,he,B]);const ge=()=>{if(!he||!be||be.length===0)return e.jsx("span",{className:"text-muted-foreground",children:he||"请输入测试文本"});try{const L=Q(z),$=new RegExp(L,"g");let D=0;const ee=[];let Ne;for(;(Ne=$.exec(he))!==null;)Ne.index>D&&ee.push(e.jsx("span",{children:he.substring(D,Ne.index)},`text-${D}`)),ee.push(e.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:Ne[0]},`match-${Ne.index}`)),D=Ne.index+Ne[0].length;return D)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return e.jsxs(Qt,{open:O,onOpenChange:se,children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",children:[e.jsx(Uu,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),e.jsxs(Ut,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"正则表达式编辑器"}),e.jsx(ss,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),e.jsx(Ie,{className:"max-h-[calc(90vh-120px)]",children:e.jsxs(Aa,{value:me,onValueChange:L=>xe(L),className:"w-full",children:[e.jsxs(ja,{className:"grid w-full grid-cols-2",children:[e.jsx(st,{value:"build",children:"🔧 构建器"}),e.jsx(st,{value:"test",children:"🧪 测试器"})]}),e.jsxs(_t,{value:"build",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{className:"text-sm font-medium",children:"正则表达式"}),e.jsx(ce,{ref:_,value:z,onChange:L=>X(L.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{className:"text-sm font-medium",children:"Reaction 内容"}),e.jsx(Ot,{value:B,onChange:L=>S(L.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[le.map(L=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:L.category}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:L.items.map($=>e.jsx(b,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>de($.pattern,$.moveCursor||0),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("span",{className:"text-xs font-medium",children:$.label}),e.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:$.pattern})]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:$.desc})]})},$.label))})]},L.category)),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("^(?P\\S{1,20})是这样的$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),e.jsx(b,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),e.jsx(b,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>X("(?P.+?)(?:是|为什么|怎么)"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),e.jsxs("li",{children:["命名捕获组格式:",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),e.jsxs("li",{children:["在 reaction 中使用 ",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),e.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),e.jsxs(_t,{value:"test",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{className:"text-sm font-medium",children:"当前正则表达式"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:z||"(未设置)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),e.jsx(Ot,{id:"test-text",value:he,onChange:L=>ye(L.target.value),placeholder:`在此输入要测试的文本... +例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),je&&e.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[e.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),e.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:je})]}),!je&&he&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:be&&be.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),e.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",be.length," 处)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{className:"text-sm font-medium",children:"匹配高亮"}),e.jsx(Ie,{className:"h-40 rounded-md bg-muted p-3",children:e.jsx("div",{className:"text-sm break-words",children:ge()})})]}),Object.keys(y).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{className:"text-sm font-medium",children:"命名捕获组"}),e.jsx(Ie,{className:"h-32 rounded-md border p-3",children:e.jsx("div",{className:"space-y-2",children:Object.entries(y).map(([L,$])=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",L,"]"]}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:$})]},L))})})]}),Object.keys(y).length>0&&B&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{className:"text-sm font-medium",children:"Reaction 替换预览"}),e.jsx(Ie,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:e.jsx("div",{className:"text-sm break-words",children:H})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),e.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),e.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),e.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},T=()=>{h({...n,keyword_rules:[...n.keyword_rules,{keywords:[],reaction:""}]})},E=z=>{h({...n,keyword_rules:n.keyword_rules.filter((B,X)=>X!==z)})},R=(z,B,X)=>{const S=[...n.keyword_rules];typeof X=="string"&&(S[z]={...S[z],reaction:X}),h({...n,keyword_rules:S})},F=z=>{const B=[...n.keyword_rules];B[z]={...B[z],keywords:[...B[z].keywords||[],""]},h({...n,keyword_rules:B})},U=(z,B)=>{const X=[...n.keyword_rules];X[z]={...X[z],keywords:(X[z].keywords||[]).filter((S,O)=>O!==B)},h({...n,keyword_rules:X})},M=(z,B,X)=>{const S=[...n.keyword_rules],O=[...S[z].keywords||[]];O[B]=X,S[z]={...S[z],keywords:O},h({...n,keyword_rules:S})},Z=({rule:z})=>{const B=`{ regex = [${(z.regex||[]).map(X=>`"${X}"`).join(", ")}], reaction = "${z.reaction}" }`;return e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",children:[e.jsx(Ys,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(va,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(Ie,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs break-all",children:B})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},G=({rule:z})=>{const B=`[[keyword_reaction.keyword_rules]] +keywords = [${(z.keywords||[]).map(X=>`"${X}"`).join(", ")}] +reaction = "${z.reaction}"`;return e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",children:[e.jsx(Ys,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(va,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(Ie,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:B})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),e.jsxs(b,{onClick:p,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.regex_rules.map((z,B)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",B+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{regex:z.regex&&z.regex[0]||"",reaction:z.reaction,onRegexChange:X=>v(B,"regex",X),onReactionChange:X=>v(B,"reaction",X)}),e.jsx(Z,{rule:z}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"sm",variant:"ghost",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除正则规则 ",B+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>w(B),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),e.jsx(ce,{value:z.regex&&z.regex[0]||"",onChange:X=>v(B,"regex",X.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Ot,{value:z.reaction,onChange:X=>v(B,"reaction",X.target.value),placeholder:`触发后麦麦的反应... +可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},B)),n.regex_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),e.jsxs("div",{className:"space-y-4 border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),e.jsxs(b,{onClick:T,size:"sm",variant:"outline",children:[e.jsx(cs,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.keyword_rules.map((z,B)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",B+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{rule:z}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"sm",variant:"ghost",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除关键词规则 ",B+1," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>E(B),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{className:"text-xs font-medium",children:"关键词列表"}),e.jsxs(b,{onClick:()=>F(B),size:"sm",variant:"ghost",children:[e.jsx(cs,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),e.jsxs("div",{className:"space-y-2",children:[(z.keywords||[]).map((X,S)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{value:X,onChange:O=>M(B,S,O.target.value),placeholder:"关键词",className:"flex-1"}),e.jsx(b,{onClick:()=>U(B,S),size:"sm",variant:"ghost",children:e.jsx(Pe,{className:"h-4 w-4"})})]},S)),(!z.keywords||z.keywords.length===0)&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Ot,{value:z.reaction,onChange:X=>R(B,"reaction",X.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},B)),n.keyword_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"enable_response_post_process",checked:r.enable_response_post_process,onCheckedChange:z=>x({...r,enable_response_post_process:z})}),e.jsx(N,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),r.enable_response_post_process&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(Ge,{id:"enable_chinese_typo",checked:c.enable,onCheckedChange:z=>f({...c,enable:z})}),e.jsx(N,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),c.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),e.jsx(ce,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.error_rate,onChange:z=>f({...c,error_rate:parseFloat(z.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),e.jsx(ce,{id:"min_freq",type:"number",min:"0",value:c.min_freq,onChange:z=>f({...c,min_freq:parseInt(z.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),e.jsx(ce,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:c.tone_error_rate,onChange:z=>f({...c,tone_error_rate:parseFloat(z.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),e.jsx(ce,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.word_replace_rate,onChange:z=>f({...c,word_replace_rate:parseFloat(z.target.value)})})]})]})]})}),e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(Ge,{id:"enable_response_splitter",checked:d.enable,onCheckedChange:z=>j({...d,enable:z})}),e.jsx(N,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),d.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),e.jsx(ce,{id:"max_length",type:"number",min:"1",value:d.max_length,onChange:z=>j({...d,max_length:parseInt(z.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),e.jsx(ce,{id:"max_sentence_num",type:"number",min:"1",value:d.max_sentence_num,onChange:z=>j({...d,max_sentence_num:parseInt(z.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"enable_kaomoji_protection",checked:d.enable_kaomoji_protection,onCheckedChange:z=>j({...d,enable_kaomoji_protection:z})}),e.jsx(N,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"enable_overflow_return_all",checked:d.enable_overflow_return_all,onCheckedChange:z=>j({...d,enable_overflow_return_all:z})}),e.jsx(N,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function L0({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{checked:n.enable_mood,onCheckedChange:c=>r({...n,enable_mood:c})}),e.jsx(N,{className:"cursor-pointer",children:"启用情绪系统"})]}),n.enable_mood&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"情绪更新阈值"}),e.jsx(ce,{type:"number",min:"1",value:n.mood_update_threshold,onChange:c=>r({...n,mood_update_threshold:parseInt(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"情感特征"}),e.jsx(Ot,{value:n.emotion_style,onChange:c=>r({...n,emotion_style:c.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function U0({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{checked:n.enable_asr,onCheckedChange:c=>r({...n,enable_asr:c})}),e.jsx(N,{className:"cursor-pointer",children:"启用语音识别"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function B0({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{checked:n.enable,onCheckedChange:c=>r({...n,enable:c})}),e.jsx(N,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),n.enable&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"LPMM 模式"}),e.jsxs(Be,{value:n.lpmm_mode,onValueChange:c=>r({...n,lpmm_mode:c}),children:[e.jsx(Re,{children:e.jsx(He,{placeholder:"选择 LPMM 模式"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"classic",children:"经典模式"}),e.jsx(ne,{value:"agent",children:"Agent 模式"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"同义词搜索 TopK"}),e.jsx(ce,{type:"number",min:"1",value:n.rag_synonym_search_top_k,onChange:c=>r({...n,rag_synonym_search_top_k:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"同义词阈值"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",value:n.rag_synonym_threshold,onChange:c=>r({...n,rag_synonym_threshold:parseFloat(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"实体提取线程数"}),e.jsx(ce,{type:"number",min:"1",value:n.info_extraction_workers,onChange:c=>r({...n,info_extraction_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"嵌入向量维度"}),e.jsx(ce,{type:"number",min:"1",value:n.embedding_dimension,onChange:c=>r({...n,embedding_dimension:parseInt(c.target.value)})})]})]})]})]})]})}function H0({config:n,onChange:r}){const[c,d]=u.useState(""),[h,x]=u.useState("WARNING"),f=()=>{c&&!n.suppress_libraries.includes(c)&&(r({...n,suppress_libraries:[...n.suppress_libraries,c]}),d(""))},j=E=>{r({...n,suppress_libraries:n.suppress_libraries.filter(R=>R!==E)})},p=()=>{c&&!n.library_log_levels[c]&&(r({...n,library_log_levels:{...n.library_log_levels,[c]:h}}),d(""),x("WARNING"))},w=E=>{const R={...n.library_log_levels};delete R[E],r({...n,library_log_levels:R})},v=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],k=["FULL","compact","lite"],T=["none","title","full"];return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"日期格式"}),e.jsx(ce,{value:n.date_style,onChange:E=>r({...n,date_style:E.target.value}),placeholder:"例如: m-d H:i:s"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"日志级别样式"}),e.jsxs(Be,{value:n.log_level_style,onValueChange:E=>r({...n,log_level_style:E}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:k.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"日志文本颜色"}),e.jsxs(Be,{value:n.color_text,onValueChange:E=>r({...n,color_text:E}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:T.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"全局日志级别"}),e.jsxs(Be,{value:n.log_level,onValueChange:E=>r({...n,log_level:E}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"控制台日志级别"}),e.jsxs(Be,{value:n.console_log_level,onValueChange:E=>r({...n,console_log_level:E}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"文件日志级别"}),e.jsxs(Be,{value:n.file_log_level,onValueChange:E=>r({...n,file_log_level:E}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]})]})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"mb-2 block",children:"完全屏蔽的库"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:E=>d(E.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),f())}}),e.jsx(b,{onClick:f,size:"sm",className:"flex-shrink-0",children:e.jsx(cs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.suppress_libraries.map(E=>e.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[e.jsx("span",{className:"text-sm",children:E}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>j(E),children:e.jsx(Pe,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},E))})]}),e.jsxs("div",{children:[e.jsx(N,{className:"mb-2 block",children:"特定库的日志级别"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:E=>d(E.target.value),placeholder:"输入库名",className:"flex-1"}),e.jsxs(Be,{value:h,onValueChange:x,children:[e.jsx(Re,{className:"w-32",children:e.jsx(He,{})}),e.jsx(Le,{children:v.map(E=>e.jsx(ne,{value:E,children:E},E))})]}),e.jsx(b,{onClick:p,size:"sm",children:e.jsx(cs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(n.library_log_levels).map(([E,R])=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-medium",children:E}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:R}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>w(E),children:e.jsx(Pe,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},E))})]})]})}function q0({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),e.jsx(Ge,{checked:n.show_prompt,onCheckedChange:c=>r({...n,show_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示回复器 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),e.jsx(Ge,{checked:n.show_replyer_prompt,onCheckedChange:c=>r({...n,show_replyer_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示回复器推理"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),e.jsx(Ge,{checked:n.show_replyer_reasoning,onCheckedChange:c=>r({...n,show_replyer_reasoning:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示 Jargon Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),e.jsx(Ge,{checked:n.show_jargon_prompt,onCheckedChange:c=>r({...n,show_jargon_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示记忆检索 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),e.jsx(Ge,{checked:n.show_memory_prompt,onCheckedChange:c=>r({...n,show_memory_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示 Planner Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),e.jsx(Ge,{checked:n.show_planner_prompt,onCheckedChange:c=>r({...n,show_planner_prompt:c})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"显示 LPMM 相关文段"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),e.jsx(Ge,{checked:n.show_lpmm_paragraph,onCheckedChange:c=>r({...n,show_lpmm_paragraph:c})})]})]})]})}function G0({config:n,onChange:r}){const[c,d]=u.useState(""),h=()=>{c&&!n.auth_token.includes(c)&&(r({...n,auth_token:[...n.auth_token,c]}),d(""))},x=f=>{r({...n,auth_token:n.auth_token.filter((j,p)=>p!==f)})};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"启用自定义服务器"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),e.jsx(Ge,{checked:n.use_custom,onCheckedChange:f=>r({...n,use_custom:f})})]}),n.use_custom&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"主机地址"}),e.jsx(ce,{value:n.host,onChange:f=>r({...n,host:f.target.value}),placeholder:"127.0.0.1"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"端口号"}),e.jsx(ce,{type:"number",value:n.port,onChange:f=>r({...n,port:parseInt(f.target.value)}),placeholder:"8090"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"连接模式"}),e.jsxs(Be,{value:n.mode,onValueChange:f=>r({...n,mode:f}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"ws",children:"WebSocket (ws)"}),e.jsx(ne,{value:"tcp",children:"TCP"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{checked:n.use_wss,onCheckedChange:f=>r({...n,use_wss:f}),disabled:n.mode!=="ws"}),e.jsx(N,{children:"使用 WSS 安全连接"})]})]}),n.use_wss&&n.mode==="ws"&&e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"SSL 证书文件路径"}),e.jsx(ce,{value:n.cert_file,onChange:f=>r({...n,cert_file:f.target.value}),placeholder:"cert.pem"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"SSL 密钥文件路径"}),e.jsx(ce,{value:n.key_file,onChange:f=>r({...n,key_file:f.target.value}),placeholder:"key.pem"})]})]})]})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"mb-2 block",children:"认证令牌"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ce,{value:c,onChange:f=>d(f.target.value),placeholder:"输入认证令牌",onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),h())}}),e.jsx(b,{onClick:h,size:"sm",children:e.jsx(cs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.auth_token.map((f,j)=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-mono",children:f}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>x(j),children:e.jsx(Pe,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},j))})]})]})}function V0({config:n,onChange:r}){return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:"启用统计信息发送"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),e.jsx(Ge,{checked:n.enable,onCheckedChange:c=>r({...n,enable:c})})]})]})}const ai=u.forwardRef(({className:n,...r},c)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:c,className:K("w-full caption-bottom text-sm",n),...r})}));ai.displayName="Table";const li=u.forwardRef(({className:n,...r},c)=>e.jsx("thead",{ref:c,className:K("[&_tr]:border-b",n),...r}));li.displayName="TableHeader";const ni=u.forwardRef(({className:n,...r},c)=>e.jsx("tbody",{ref:c,className:K("[&_tr:last-child]:border-0",n),...r}));ni.displayName="TableBody";const F0=u.forwardRef(({className:n,...r},c)=>e.jsx("tfoot",{ref:c,className:K("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",n),...r}));F0.displayName="TableFooter";const gs=u.forwardRef(({className:n,...r},c)=>e.jsx("tr",{ref:c,className:K("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...r}));gs.displayName="TableRow";const at=u.forwardRef(({className:n,...r},c)=>e.jsx("th",{ref:c,className:K("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r}));at.displayName="TableHead";const $e=u.forwardRef(({className:n,...r},c)=>e.jsx("td",{ref:c,className:K("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r}));$e.displayName="TableCell";const $0=u.forwardRef(({className:n,...r},c)=>e.jsx("caption",{ref:c,className:K("mt-4 text-sm text-muted-foreground",n),...r}));$0.displayName="TableCaption";const ao=u.forwardRef(({className:n,...r},c)=>e.jsx(Rs,{ref:c,className:K("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),...r}));ao.displayName=Rs.displayName;const lo=u.forwardRef(({className:n,...r},c)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Os,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Rs.Input,{ref:c,className:K("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...r})]}));lo.displayName=Rs.Input.displayName;const no=u.forwardRef(({className:n,...r},c)=>e.jsx(Rs.List,{ref:c,className:K("max-h-[300px] overflow-y-auto overflow-x-hidden",n),...r}));no.displayName=Rs.List.displayName;const io=u.forwardRef((n,r)=>e.jsx(Rs.Empty,{ref:r,className:"py-6 text-center text-sm",...n}));io.displayName=Rs.Empty.displayName;const hr=u.forwardRef(({className:n,...r},c)=>e.jsx(Rs.Group,{ref:c,className:K("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",n),...r}));hr.displayName=Rs.Group.displayName;const Q0=u.forwardRef(({className:n,...r},c)=>e.jsx(Rs.Separator,{ref:c,className:K("-mx-1 h-px bg-border",n),...r}));Q0.displayName=Rs.Separator.displayName;const xr=u.forwardRef(({className:n,...r},c)=>e.jsx(Rs.Item,{ref:c,className:K("relative flex cursor-default gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n),...r}));xr.displayName=Rs.Item.displayName;const bs=u.forwardRef(({className:n,...r},c)=>e.jsx(Qp,{ref:c,className:K("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...r,children:e.jsx(Kb,{className:K("grid place-content-center text-current"),children:e.jsx(ga,{className:"h-4 w-4"})})}));bs.displayName=Qp.displayName;const wg=u.createContext(null),_g="maibot-completed-tours";function Y0(){try{const n=localStorage.getItem(_g);return n?new Set(JSON.parse(n)):new Set}catch{return new Set}}function sp(n){localStorage.setItem(_g,JSON.stringify([...n]))}function X0({children:n}){const[r,c]=u.useState({activeTourId:null,stepIndex:0,isRunning:!1}),d=u.useRef(new Map),[,h]=u.useState(0),[x,f]=u.useState(Y0),j=u.useCallback((G,z)=>{d.current.set(G,z),h(B=>B+1)},[]),p=u.useCallback(G=>{d.current.delete(G),c(z=>z.activeTourId===G?{...z,activeTourId:null,isRunning:!1,stepIndex:0}:z)},[]),w=u.useCallback((G,z=0)=>{d.current.has(G)&&c({activeTourId:G,stepIndex:z,isRunning:!0})},[]),v=u.useCallback(()=>{c(G=>({...G,isRunning:!1}))},[]),k=u.useCallback(G=>{c(z=>({...z,stepIndex:G}))},[]),T=u.useCallback(()=>{c(G=>({...G,stepIndex:G.stepIndex+1}))},[]),E=u.useCallback(()=>{c(G=>({...G,stepIndex:Math.max(0,G.stepIndex-1)}))},[]),R=u.useCallback(()=>r.activeTourId?d.current.get(r.activeTourId)||[]:[],[r.activeTourId]),F=u.useCallback(G=>{f(z=>{const B=new Set(z);return B.add(G),sp(B),B})},[]),U=u.useCallback(G=>{const{action:z,index:B,status:X,type:S}=G,O=["finished","skipped"];if(z==="close"){c(se=>({...se,isRunning:!1,stepIndex:0}));return}O.includes(X)?c(se=>(X==="finished"&&se.activeTourId&&setTimeout(()=>F(se.activeTourId),0),{...se,isRunning:!1,stepIndex:0})):S==="step:after"&&(z==="next"?c(se=>({...se,stepIndex:B+1})):z==="prev"&&c(se=>({...se,stepIndex:B-1})))},[F]),M=u.useCallback(G=>x.has(G),[x]),Z=u.useCallback(G=>{f(z=>{const B=new Set(z);return B.delete(G),sp(B),B})},[]);return e.jsx(wg.Provider,{value:{state:r,tours:d.current,registerTour:j,unregisterTour:p,startTour:w,stopTour:v,goToStep:k,nextStep:T,prevStep:E,getCurrentSteps:R,handleJoyrideCallback:U,isTourCompleted:M,markTourCompleted:F,resetTourCompleted:Z},children:n})}function Qu(){const n=u.useContext(wg);if(!n)throw new Error("useTour must be used within a TourProvider");return n}const K0={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},Z0={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function J0(){const{state:n,getCurrentSteps:r,handleJoyrideCallback:c}=Qu(),d=r(),[h,x]=u.useState(!1),f=u.useRef(n.stepIndex),j=u.useRef(null);u.useEffect(()=>{f.current!==n.stepIndex&&(x(!1),f.current=n.stepIndex)},[n.stepIndex]),u.useEffect(()=>{if(!n.isRunning||d.length===0){x(!1);return}const v=d[n.stepIndex];if(!v){x(!1);return}const k=v.target;if(k==="body"){x(!0);return}x(!1);const T=setTimeout(()=>{const E=()=>{const M=document.querySelector(k);if(M){const Z=M.getBoundingClientRect();if(Z.width>0&&Z.height>0)return!0}return!1};if(E()){setTimeout(()=>x(!0),100);return}const R=setInterval(()=>{E()&&(clearInterval(R),setTimeout(()=>x(!0),100))},100),F=setTimeout(()=>{clearInterval(R),x(!0)},5e3),U=()=>{clearInterval(R),clearTimeout(F)};j.current=U},150);return()=>{clearTimeout(T),j.current&&(j.current(),j.current=null)}},[n.isRunning,n.stepIndex,d]);const p=u.useRef(null);if(u.useEffect(()=>{let v=document.getElementById("tour-portal-container");return v||(v=document.createElement("div"),v.id="tour-portal-container",v.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(v)),p.current=v,()=>{}},[]),!n.isRunning||d.length===0||!h)return null;const w=e.jsx(Hy,{steps:d,stepIndex:n.stepIndex,run:n.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:c,styles:K0,locale:Z0,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${n.stepIndex}`);return p.current?Jv.createPortal(w,p.current):w}const tl="model-assignment-tour",Sg=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],Cg={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},lr=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function ap(n){return n?n.replace(/\/+$/,"").toLowerCase():""}function I0(n){if(!n)return null;const r=ap(n);return lr.find(c=>c.id!=="custom"&&ap(c.base_url)===r)||null}function P0(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!1),[T,E]=u.useState(!1),[R,F]=u.useState(!1),[U,M]=u.useState(null),[Z,G]=u.useState(null),[z,B]=u.useState("custom"),[X,S]=u.useState(!1),[O,se]=u.useState(!1),[he,ye]=u.useState(null),[be,pe]=u.useState(!1),[je,_e]=u.useState(""),[y,q]=u.useState(new Set),[H,ie]=u.useState(!1),[_,me]=u.useState(1),[xe,Q]=u.useState(20),[de,ge]=u.useState(""),[le,L]=u.useState({}),[$,D]=u.useState(new Set),[ee,Ne]=u.useState(new Map),{toast:ze}=Rt(),We=ua(),{state:Xe,goToStep:Mt,registerTour:qt}=Qu(),re=u.useRef(null),we=u.useRef(!0);u.useEffect(()=>{qt(tl,Sg)},[qt]),u.useEffect(()=>{if(Xe.activeTourId===tl&&Xe.isRunning){const W=Cg[Xe.stepIndex];W&&!window.location.pathname.endsWith(W.replace("/config/",""))&&We({to:W})}},[Xe.stepIndex,Xe.activeTourId,Xe.isRunning,We]);const Je=u.useRef(Xe.stepIndex);u.useEffect(()=>{if(Xe.activeTourId===tl&&Xe.isRunning){const W=Je.current,ve=Xe.stepIndex;W>=3&&W<=9&&ve<3&&F(!1),W>=10&&ve>=3&&ve<=9&&(L({}),B("custom"),M({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),G(null),pe(!1),F(!0)),Je.current=ve}},[Xe.stepIndex,Xe.activeTourId,Xe.isRunning]),u.useEffect(()=>{if(Xe.activeTourId!==tl||!Xe.isRunning)return;const W=ve=>{const Ae=ve.target,es=Xe.stepIndex;es===2&&Ae.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Mt(3),300):es===9&&Ae.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>Mt(10),300)};return document.addEventListener("click",W,!0),()=>document.removeEventListener("click",W,!0)},[Xe,Mt]),u.useEffect(()=>{Fe()},[]);const Fe=async()=>{try{d(!0);const W=await In();r(W.api_providers||[]),w(!1),we.current=!1}catch(W){console.error("加载配置失败:",W)}finally{d(!1)}},Wt=async()=>{try{k(!0),so().catch(()=>{}),E(!0)}catch(W){console.error("重启失败:",W),E(!1),ze({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),k(!1)}},Xs=async()=>{try{x(!0),re.current&&clearTimeout(re.current);const W=await In();W.api_providers=n,await eo(W),w(!1),ze({title:"保存成功",description:"正在重启麦麦..."}),await Wt()}catch(W){console.error("保存配置失败:",W),ze({title:"保存失败",description:W.message,variant:"destructive"}),x(!1)}},Ns=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Ke=()=>{E(!1),k(!1),ze({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ue=u.useCallback(async W=>{if(!we.current)try{j(!0),await Mu("api_providers",W),w(!1)}catch(ve){console.error("自动保存失败:",ve),w(!0)}finally{j(!1)}},[]);u.useEffect(()=>{if(!we.current)return w(!0),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{Ue(n)},2e3),()=>{re.current&&clearTimeout(re.current)}},[n,Ue]);const js=async()=>{try{x(!0),re.current&&clearTimeout(re.current);const W=await In();W.api_providers=n,await eo(W),w(!1),ze({title:"保存成功",description:"模型提供商配置已保存"})}catch(W){console.error("保存配置失败:",W),ze({title:"保存失败",description:W.message,variant:"destructive"})}finally{x(!1)}},ls=(W,ve)=>{if(L({}),W){const Ae=lr.find(es=>es.base_url===W.base_url&&es.client_type===W.client_type);B(Ae?.id||"custom"),M(W)}else B("custom"),M({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});G(ve),pe(!1),F(!0)},_s=W=>{B(W),S(!1);const ve=lr.find(Ae=>Ae.id===W);ve&&ve.id!=="custom"?M(Ae=>({...Ae,name:ve.name,base_url:ve.base_url,client_type:ve.client_type})):ve?.id==="custom"&&M(Ae=>({...Ae,name:"",base_url:"",client_type:"openai"}))},Ss=u.useMemo(()=>z!=="custom",[z]),nl=async()=>{if(U?.api_key)try{await navigator.clipboard.writeText(U.api_key),ze({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ze({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},il=()=>{if(!U)return;const W={};if(U.name?.trim()||(W.name="请输入提供商名称"),U.base_url?.trim()||(W.base_url="请输入基础 URL"),U.api_key?.trim()||(W.api_key="请输入 API Key"),Object.keys(W).length>0){L(W);return}L({});const ve={...U,max_retry:U.max_retry??2,timeout:U.timeout??30,retry_interval:U.retry_interval??10};if(Z!==null){const Ae=[...n];Ae[Z]=ve,r(Ae)}else r([...n,ve]);F(!1),M(null),G(null)},rl=W=>{if(!W&&U){const ve={...U,max_retry:U.max_retry??2,timeout:U.timeout??30,retry_interval:U.retry_interval??10};M(ve)}F(W)},Se=W=>{ye(W),se(!0)},Oe=()=>{if(he!==null){const W=n.filter((ve,Ae)=>Ae!==he);r(W),ze({title:"删除成功",description:"提供商已从列表中移除"})}se(!1),ye(null)},ns=W=>{const ve=new Set(y);ve.has(W)?ve.delete(W):ve.add(W),q(ve)},ds=()=>{if(y.size===us.length)q(new Set);else{const W=us.map((ve,Ae)=>n.findIndex(es=>es===us[Ae]));q(new Set(W))}},ri=()=>{if(y.size===0){ze({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}ie(!0)},rn=()=>{const W=n.filter((ve,Ae)=>!y.has(Ae));r(W),q(new Set),ie(!1),ze({title:"批量删除成功",description:`已删除 ${y.size} 个提供商`})},us=n.filter(W=>{if(!je)return!0;const ve=je.toLowerCase();return W.name.toLowerCase().includes(ve)||W.base_url.toLowerCase().includes(ve)||W.client_type.toLowerCase().includes(ve)}),Ks=Math.ceil(us.length/xe),Zs=us.slice((_-1)*xe,_*xe),Oa=()=>{const W=parseInt(de);W>=1&&W<=Ks&&(me(W),ge(""))},Ls=async W=>{D(ve=>new Set(ve).add(W));try{const ve=await N0(W);Ne(Ae=>new Map(Ae).set(W,ve)),ve.network_ok?ve.api_key_valid===!0?ze({title:"连接正常",description:`${W} 网络连接正常,API Key 有效 (${ve.latency_ms}ms)`}):ve.api_key_valid===!1?ze({title:"连接正常但 Key 无效",description:`${W} 网络连接正常,但 API Key 无效或已过期`,variant:"destructive"}):ze({title:"网络连接正常",description:`${W} 可以访问 (${ve.latency_ms}ms)`}):ze({title:"连接失败",description:ve.error||"无法连接到提供商",variant:"destructive"})}catch(ve){ze({title:"测试失败",description:ve.message,variant:"destructive"})}finally{D(ve=>{const Ae=new Set(ve);return Ae.delete(W),Ae})}},Ra=async()=>{for(const W of n)await Ls(W.name)},ba=W=>{const ve=$.has(W),Ae=ee.get(W);return ve?e.jsxs(Qe,{variant:"secondary",className:"gap-1",children:[e.jsx(vs,{className:"h-3 w-3 animate-spin"}),"测试中"]}):Ae?Ae.network_ok?Ae.api_key_valid===!0?e.jsxs(Qe,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[e.jsx(oa,{className:"h-3 w-3"}),"正常"]}):Ae.api_key_valid===!1?e.jsxs(Qe,{variant:"destructive",className:"gap-1",children:[e.jsx(Ea,{className:"h-3 w-3"}),"Key无效"]}):e.jsxs(Qe,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[e.jsx(oa,{className:"h-3 w-3"}),"可访问"]}):e.jsxs(Qe,{variant:"destructive",className:"gap-1",children:[e.jsx(Wp,{className:"h-3 w-3"}),"离线"]}):null};return c?e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[y.size>0&&e.jsxs(b,{onClick:ri,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(Pe,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",y.size,")"]}),e.jsxs(b,{onClick:Ra,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:n.length===0||$.size>0,children:[e.jsx(sn,{className:"mr-2 h-4 w-4"}),$.size>0?`测试中 (${$.size})`:"测试全部"]}),e.jsxs(b,{onClick:()=>ls(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[e.jsx(cs,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),e.jsxs(b,{onClick:js,disabled:h||f||!p||v,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(pr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),h?"保存中...":f?"自动保存中...":p?"保存配置":"已保存"]}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{disabled:h||f||v,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(fr,{className:"mr-2 h-4 w-4"}),v?"重启中...":p?"保存并重启":"重启麦麦"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认重启麦麦?"}),e.jsx(dt,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:p?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})})})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:p?Xs:Wt,children:p?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(al,{children:[e.jsx(za,{className:"h-4 w-4"}),e.jsxs(ll,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(Ie,{className:"h-[calc(100vh-260px)]",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索提供商名称、URL 或类型...",value:je,onChange:W=>_e(W.target.value),className:"pl-9"})]}),je&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",us.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:us.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:je?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):Zs.map((W,ve)=>{const Ae=n.findIndex(es=>es===W);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-base truncate",children:W.name}),ba(W.name)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:W.base_url})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>Ls(W.name),disabled:$.has(W.name),title:"测试连接",children:$.has(W.name)?e.jsx(vs,{className:"h-4 w-4 animate-spin"}):e.jsx(sn,{className:"h-4 w-4"})}),e.jsx(b,{variant:"default",size:"sm",onClick:()=>ls(W,Ae),children:e.jsx(an,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),e.jsx(b,{size:"sm",onClick:()=>Se(Ae),className:"bg-red-600 hover:bg-red-700 text-white",children:e.jsx(Pe,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),e.jsx("p",{className:"font-medium",children:W.client_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),e.jsx("p",{className:"font-medium",children:W.max_retry})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),e.jsx("p",{className:"font-medium",children:W.timeout})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),e.jsx("p",{className:"font-medium",children:W.retry_interval})]})]})]},ve)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ai,{children:[e.jsx(li,{children:e.jsxs(gs,{children:[e.jsx(at,{className:"w-12",children:e.jsx(bs,{checked:y.size===us.length&&us.length>0,onCheckedChange:ds})}),e.jsx(at,{children:"状态"}),e.jsx(at,{children:"名称"}),e.jsx(at,{children:"基础URL"}),e.jsx(at,{children:"客户端类型"}),e.jsx(at,{className:"text-right",children:"最大重试"}),e.jsx(at,{className:"text-right",children:"超时(秒)"}),e.jsx(at,{className:"text-right",children:"重试间隔(秒)"}),e.jsx(at,{className:"text-right",children:"操作"})]})}),e.jsx(ni,{children:Zs.length===0?e.jsx(gs,{children:e.jsx($e,{colSpan:9,className:"text-center text-muted-foreground py-8",children:je?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):Zs.map((W,ve)=>{const Ae=n.findIndex(es=>es===W);return e.jsxs(gs,{children:[e.jsx($e,{children:e.jsx(bs,{checked:y.has(Ae),onCheckedChange:()=>ns(Ae)})}),e.jsx($e,{children:ba(W.name)||e.jsx(Qe,{variant:"outline",className:"text-muted-foreground",children:"未测试"})}),e.jsx($e,{className:"font-medium",children:W.name}),e.jsx($e,{className:"max-w-xs truncate",title:W.base_url,children:W.base_url}),e.jsx($e,{children:W.client_type}),e.jsx($e,{className:"text-right",children:W.max_retry}),e.jsx($e,{className:"text-right",children:W.timeout}),e.jsx($e,{className:"text-right",children:W.retry_interval}),e.jsx($e,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>Ls(W.name),disabled:$.has(W.name),title:"测试连接",children:$.has(W.name)?e.jsx(vs,{className:"h-4 w-4 animate-spin"}):e.jsx(sn,{className:"h-4 w-4"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:()=>ls(W,Ae),children:[e.jsx(an,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(b,{size:"sm",onClick:()=>Se(Ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(Pe,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},ve)})})]})})}),us.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Be,{value:xe.toString(),onValueChange:W=>{Q(parseInt(W)),me(1),q(new Set)},children:[e.jsx(Re,{id:"page-size-provider",className:"w-20",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(_-1)*xe+1," 到"," ",Math.min(_*xe,us.length)," 条,共 ",us.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>me(1),disabled:_===1,className:"hidden sm:flex",children:e.jsx(gr,{className:"h-4 w-4"})}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>me(W=>Math.max(1,W-1)),disabled:_===1,children:[e.jsx(nn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:de,onChange:W=>ge(W.target.value),onKeyDown:W=>W.key==="Enter"&&Oa(),placeholder:_.toString(),className:"w-16 h-8 text-center",min:1,max:Ks}),e.jsx(b,{variant:"outline",size:"sm",onClick:Oa,disabled:!de,className:"h-8",children:"跳转"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>me(W=>W+1),disabled:_>=Ks,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Ol,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>me(Ks),disabled:_>=Ks,className:"hidden sm:flex",children:e.jsx(jr,{className:"h-4 w-4"})})]})]})]}),e.jsx(Qt,{open:R,onOpenChange:rl,children:e.jsxs(Ut,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Xe.isRunning,children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:Z!==null?"编辑提供商":"添加提供商"}),e.jsx(ss,{children:"配置 API 提供商的连接信息和参数"})]}),e.jsxs("form",{onSubmit:W=>{W.preventDefault(),il()},autoComplete:"off",children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[e.jsx(N,{htmlFor:"template",children:"提供商模板"}),e.jsxs(Ma,{open:X,onOpenChange:S,children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",role:"combobox","aria-expanded":X,className:"w-full justify-between",children:[z?lr.find(W=>W.id===z)?.display_name:"选择提供商模板...",e.jsx(Bu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(va,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(ao,{children:[e.jsx(lo,{placeholder:"搜索提供商模板..."}),e.jsx(Ie,{className:"h-[300px]",children:e.jsxs(no,{className:"max-h-none overflow-visible",children:[e.jsx(io,{children:"未找到匹配的模板"}),e.jsx(hr,{children:lr.map(W=>e.jsxs(xr,{value:W.display_name,onSelect:()=>_s(W.id),children:[e.jsx(ga,{className:`mr-2 h-4 w-4 ${z===W.id?"opacity-100":"opacity-0"}`}),W.display_name]},W.id))})]})})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[e.jsx(N,{htmlFor:"name",className:le.name?"text-destructive":"",children:"名称 *"}),e.jsx(ce,{id:"name",value:U?.name||"",onChange:W=>{M(ve=>ve?{...ve,name:W.target.value}:null),le.name&&L(ve=>({...ve,name:void 0}))},placeholder:"例如: DeepSeek, SiliconFlow",className:le.name?"border-destructive focus-visible:ring-destructive":""}),le.name&&e.jsx("p",{className:"text-xs text-destructive",children:le.name})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[e.jsx(N,{htmlFor:"base_url",className:le.base_url?"text-destructive":"",children:"基础 URL *"}),e.jsx(ce,{id:"base_url",value:U?.base_url||"",onChange:W=>{M(ve=>ve?{...ve,base_url:W.target.value}:null),le.base_url&&L(ve=>({...ve,base_url:void 0}))},placeholder:"https://api.example.com/v1",disabled:Ss,className:`${Ss?"bg-muted cursor-not-allowed":""} ${le.base_url?"border-destructive focus-visible:ring-destructive":""}`}),le.base_url&&e.jsx("p",{className:"text-xs text-destructive",children:le.base_url}),Ss&&!le.base_url&&e.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[e.jsx(N,{htmlFor:"api_key",className:le.api_key?"text-destructive":"",children:"API Key *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{id:"api_key",type:be?"text":"password",value:U?.api_key||"",onChange:W=>{M(ve=>ve?{...ve,api_key:W.target.value}:null),le.api_key&&L(ve=>({...ve,api_key:void 0}))},placeholder:"sk-...",className:`flex-1 ${le.api_key?"border-destructive focus-visible:ring-destructive":""}`}),e.jsx(b,{type:"button",variant:"outline",size:"icon",onClick:()=>pe(!be),title:be?"隐藏密钥":"显示密钥",children:be?e.jsx(rr,{className:"h-4 w-4"}):e.jsx(Ys,{className:"h-4 w-4"})}),e.jsx(b,{type:"button",variant:"outline",size:"icon",onClick:nl,title:"复制密钥",children:e.jsx(Jc,{className:"h-4 w-4"})})]}),le.api_key&&e.jsx("p",{className:"text-xs text-destructive",children:le.api_key})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"client_type",children:"客户端类型"}),e.jsxs(Be,{value:U?.client_type||"openai",onValueChange:W=>M(ve=>ve?{...ve,client_type:W}:null),disabled:Ss,children:[e.jsx(Re,{id:"client_type",className:Ss?"bg-muted cursor-not-allowed":"",children:e.jsx(He,{placeholder:"选择客户端类型"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"openai",children:"OpenAI"}),e.jsx(ne,{value:"gemini",children:"Gemini"})]})]}),Ss&&e.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"max_retry",children:"最大重试"}),e.jsx(ce,{id:"max_retry",type:"number",min:"0",value:U?.max_retry??"",onChange:W=>{const ve=W.target.value===""?null:parseInt(W.target.value);M(Ae=>Ae?{...Ae,max_retry:ve}:null)},placeholder:"默认: 2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"timeout",children:"超时(秒)"}),e.jsx(ce,{id:"timeout",type:"number",min:"1",value:U?.timeout??"",onChange:W=>{const ve=W.target.value===""?null:parseInt(W.target.value);M(Ae=>Ae?{...Ae,timeout:ve}:null)},placeholder:"默认: 30"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),e.jsx(ce,{id:"retry_interval",type:"number",min:"1",value:U?.retry_interval??"",onChange:W=>{const ve=W.target.value===""?null:parseInt(W.target.value);M(Ae=>Ae?{...Ae,retry_interval:ve}:null)},placeholder:"默认: 10"})]})]})]}),e.jsxs(os,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>F(!1),"data-tour":"provider-cancel-button",children:"取消"}),e.jsx(b,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),e.jsx(ft,{open:O,onOpenChange:se,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除提供商 "',he!==null?n[he]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:Oe,children:"删除"})]})]})}),e.jsx(ft,{open:H,onOpenChange:ie,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认批量删除"}),e.jsxs(dt,{children:["确定要删除选中的 ",y.size," 个提供商吗? 此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:rn,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&e.jsx($u,{onRestartComplete:Ns,onRestartFailed:Ke})]})}function W0({value:n,label:r,onRemove:c}){const{attributes:d,listeners:h,setNodeRef:x,transform:f,transition:j,isDragging:p}=Jy({id:n}),w={transform:Iy.Transform.toString(f),transition:j,opacity:p?.5:1};return e.jsx("div",{ref:x,style:w,className:K("inline-flex items-center gap-1",p&&"shadow-lg"),children:e.jsxs(Qe,{variant:"secondary",className:"cursor-move hover:bg-secondary/80 flex items-center gap-1",children:[e.jsx("div",{...d,...h,className:"cursor-grab active:cursor-grabbing flex items-center",children:e.jsx(xy,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("span",{children:r}),e.jsx(si,{className:"ml-1 h-3 w-3 cursor-pointer hover:text-destructive",strokeWidth:2,fill:"none",onClick:v=>{v.stopPropagation(),c(n)}})]})})}function ew({options:n,selected:r,onChange:c,placeholder:d="选择选项...",emptyText:h="未找到选项",className:x}){const[f,j]=u.useState(!1),p=Gy($f(Zy,{activationConstraint:{distance:8}}),$f(Ky,{coordinateGetter:Xy})),w=T=>{r.includes(T)?c(r.filter(E=>E!==T)):c([...r,T])},v=T=>{c(r.filter(E=>E!==T))},k=T=>{const{active:E,over:R}=T;if(R&&E.id!==R.id){const F=r.indexOf(E.id),U=r.indexOf(R.id);c(Yy(r,F,U))}};return e.jsxs(Ma,{open:f,onOpenChange:j,children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",role:"combobox","aria-expanded":f,className:K("w-full justify-between min-h-10 h-auto",x),children:[e.jsx(Vy,{sensors:p,collisionDetection:Fy,onDragEnd:k,children:e.jsx($y,{items:r,strategy:Qy,children:e.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:r.length===0?e.jsx("span",{className:"text-muted-foreground",children:d}):r.map(T=>{const E=n.find(R=>R.value===T);return e.jsx(W0,{value:T,label:E?.label||T,onRemove:v},T)})})})}),e.jsx(Bu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),e.jsx(va,{className:"w-full p-0",align:"start",children:e.jsxs(ao,{children:[e.jsx(lo,{placeholder:"搜索...",className:"h-9"}),e.jsxs(no,{children:[e.jsx(io,{children:h}),e.jsx(hr,{children:n.map(T=>{const E=r.includes(T.value);return e.jsxs(xr,{value:T.value,onSelect:()=>w(T.value),children:[e.jsx("div",{className:K("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",E?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ga,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),e.jsx("span",{children:T.label})]},T.value)})})]})]})})]})}const lp=new Map,tw=300*1e3;function sw(){const[n,r]=u.useState([]),[c,d]=u.useState([]),[h,x]=u.useState([]),[f,j]=u.useState([]),[p,w]=u.useState(null),[v,k]=u.useState(!0),[T,E]=u.useState(!1),[R,F]=u.useState(!1),[U,M]=u.useState(!1),[Z,G]=u.useState(!1),[z,B]=u.useState(!1),[X,S]=u.useState(!1),[O,se]=u.useState(null),[he,ye]=u.useState(null),[be,pe]=u.useState(!1),[je,_e]=u.useState(null),[y,q]=u.useState(""),[H,ie]=u.useState(new Set),[_,me]=u.useState(!1),[xe,Q]=u.useState(1),[de,ge]=u.useState(20),[le,L]=u.useState(""),[$,D]=u.useState([]),[ee,Ne]=u.useState(!1),[ze,We]=u.useState(null),[Xe,Mt]=u.useState(!1),[qt,re]=u.useState(null),[we,Je]=u.useState({}),{toast:Fe}=Rt(),Wt=ua(),{registerTour:Xs,startTour:Ns,state:Ke,goToStep:Ue}=Qu(),js=u.useRef(null),ls=u.useRef(null),_s=u.useRef(!0);u.useEffect(()=>{Xs(tl,Sg)},[Xs]),u.useEffect(()=>{if(Ke.activeTourId===tl&&Ke.isRunning){const Y=Cg[Ke.stepIndex];Y&&!window.location.pathname.endsWith(Y.replace("/config/",""))&&Wt({to:Y})}},[Ke.stepIndex,Ke.activeTourId,Ke.isRunning,Wt]);const Ss=u.useRef(Ke.stepIndex);u.useEffect(()=>{if(Ke.activeTourId===tl&&Ke.isRunning){const Y=Ss.current,fe=Ke.stepIndex;Y>=12&&Y<=17&&fe<12&&S(!1),Ss.current=fe}},[Ke.stepIndex,Ke.activeTourId,Ke.isRunning]),u.useEffect(()=>{if(Ke.activeTourId!==tl||!Ke.isRunning)return;const Y=fe=>{const Me=fe.target,qe=Ke.stepIndex;qe===2&&Me.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Ue(3),300):qe===9&&Me.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>Ue(10),300):qe===11&&Me.closest('[data-tour="add-model-button"]')?setTimeout(()=>Ue(12),300):qe===17&&Me.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>Ue(18),300):qe===18&&Me.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>Ue(19),300)};return document.addEventListener("click",Y,!0),()=>document.removeEventListener("click",Y,!0)},[Ke,Ue]);const nl=()=>{Ns(tl)};u.useEffect(()=>{il()},[]);const il=async()=>{try{k(!0);const Y=await In(),fe=Y.models||[];r(fe),j(fe.map(qe=>qe.name));const Me=Y.api_providers||[];d(Me.map(qe=>qe.name)),x(Me),w(Y.model_task_config||null),M(!1),_s.current=!1}catch(Y){console.error("加载配置失败:",Y)}finally{k(!1)}},rl=u.useCallback(Y=>h.find(fe=>fe.name===Y),[h]),Se=u.useCallback(async(Y,fe=!1)=>{const Me=rl(Y);if(!Me?.base_url){D([]),re(null),We('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Me.api_key){D([]),re(null),We('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const qe=I0(Me.base_url);if(re(qe),!qe?.modelFetcher){D([]),We(null);return}const ht=`${Y}:${Me.base_url}`,Js=lp.get(ht);if(!fe&&Js&&Date.now()-Js.timestamp{X&&O?.api_provider&&Se(O.api_provider)},[X,O?.api_provider,Se]);const Oe=async()=>{try{G(!0),so().catch(()=>{}),B(!0)}catch(Y){console.error("重启失败:",Y),B(!1),Fe({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),G(!1)}},ns=async()=>{try{E(!0),js.current&&clearTimeout(js.current),ls.current&&clearTimeout(ls.current);const Y=await In();Y.models=n,Y.model_task_config=p,await eo(Y),M(!1),Fe({title:"保存成功",description:"正在重启麦麦..."}),await Oe()}catch(Y){console.error("保存配置失败:",Y),Fe({title:"保存失败",description:Y.message,variant:"destructive"}),E(!1)}},ds=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ri=()=>{B(!1),G(!1),Fe({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},rn=u.useCallback(async Y=>{if(!_s.current)try{F(!0),await Mu("models",Y),M(!1)}catch(fe){console.error("自动保存模型列表失败:",fe),M(!0)}finally{F(!1)}},[]),us=u.useCallback(async Y=>{if(!_s.current)try{F(!0),await Mu("model_task_config",Y),M(!1)}catch(fe){console.error("自动保存任务配置失败:",fe),M(!0)}finally{F(!1)}},[]);u.useEffect(()=>{if(!_s.current)return M(!0),js.current&&clearTimeout(js.current),js.current=setTimeout(()=>{rn(n)},2e3),()=>{js.current&&clearTimeout(js.current)}},[n,rn]),u.useEffect(()=>{if(!(_s.current||!p))return M(!0),ls.current&&clearTimeout(ls.current),ls.current=setTimeout(()=>{us(p)},2e3),()=>{ls.current&&clearTimeout(ls.current)}},[p,us]);const Ks=async()=>{try{E(!0),js.current&&clearTimeout(js.current),ls.current&&clearTimeout(ls.current);const Y=await In();Y.models=n,Y.model_task_config=p,await eo(Y),M(!1),Fe({title:"保存成功",description:"模型配置已保存"}),await il()}catch(Y){console.error("保存配置失败:",Y),Fe({title:"保存失败",description:Y.message,variant:"destructive"})}finally{E(!1)}},Zs=(Y,fe)=>{Je({}),se(Y||{model_identifier:"",name:"",api_provider:c[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),ye(fe),S(!0)},Oa=()=>{if(!O)return;const Y={};if(O.name?.trim()||(Y.name="请输入模型名称"),O.api_provider?.trim()||(Y.api_provider="请选择 API 提供商"),O.model_identifier?.trim()||(Y.model_identifier="请输入模型标识符"),Object.keys(Y).length>0){Je(Y);return}Je({});const fe={...O,price_in:O.price_in??0,price_out:O.price_out??0};let Me,qe=null;if(he!==null?(qe=n[he].name,Me=[...n],Me[he]=fe):Me=[...n,fe],r(Me),j(Me.map(ht=>ht.name)),qe&&qe!==fe.name&&p){const ht=Js=>Js.map(Is=>Is===qe?fe.name:Is);w({...p,utils:{...p.utils,model_list:ht(p.utils?.model_list||[])},utils_small:{...p.utils_small,model_list:ht(p.utils_small?.model_list||[])},tool_use:{...p.tool_use,model_list:ht(p.tool_use?.model_list||[])},replyer:{...p.replyer,model_list:ht(p.replyer?.model_list||[])},planner:{...p.planner,model_list:ht(p.planner?.model_list||[])},vlm:{...p.vlm,model_list:ht(p.vlm?.model_list||[])},voice:{...p.voice,model_list:ht(p.voice?.model_list||[])},embedding:{...p.embedding,model_list:ht(p.embedding?.model_list||[])},lpmm_entity_extract:{...p.lpmm_entity_extract,model_list:ht(p.lpmm_entity_extract?.model_list||[])},lpmm_rdf_build:{...p.lpmm_rdf_build,model_list:ht(p.lpmm_rdf_build?.model_list||[])},lpmm_qa:{...p.lpmm_qa,model_list:ht(p.lpmm_qa?.model_list||[])}})}S(!1),se(null),ye(null)},Ls=Y=>{if(!Y&&O){const fe={...O,price_in:O.price_in??0,price_out:O.price_out??0};se(fe)}S(Y)},Ra=Y=>{_e(Y),pe(!0)},ba=()=>{if(je!==null){const Y=n.filter((fe,Me)=>Me!==je);r(Y),j(Y.map(fe=>fe.name)),Fe({title:"删除成功",description:"模型已从列表中移除"})}pe(!1),_e(null)},W=Y=>{const fe=new Set(H);fe.has(Y)?fe.delete(Y):fe.add(Y),ie(fe)},ve=()=>{if(H.size===Cs.length)ie(new Set);else{const Y=Cs.map((fe,Me)=>n.findIndex(qe=>qe===Cs[Me]));ie(new Set(Y))}},Ae=()=>{if(H.size===0){Fe({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}me(!0)},es=()=>{const Y=n.filter((fe,Me)=>!H.has(Me));r(Y),j(Y.map(fe=>fe.name)),ie(new Set),me(!1),Fe({title:"批量删除成功",description:`已删除 ${H.size} 个模型`})},Us=(Y,fe,Me)=>{p&&w({...p,[Y]:{...p[Y],[fe]:Me}})},Cs=n.filter(Y=>{if(!y)return!0;const fe=y.toLowerCase();return Y.name.toLowerCase().includes(fe)||Y.model_identifier.toLowerCase().includes(fe)||Y.api_provider.toLowerCase().includes(fe)}),cl=Math.ceil(Cs.length/de),Ul=Cs.slice((xe-1)*de,xe*de),cn=()=>{const Y=parseInt(le);Y>=1&&Y<=cl&&(Q(Y),L(""))},on=Y=>p?[p.utils?.model_list||[],p.utils_small?.model_list||[],p.tool_use?.model_list||[],p.replyer?.model_list||[],p.planner?.model_list||[],p.vlm?.model_list||[],p.voice?.model_list||[],p.embedding?.model_list||[],p.lpmm_entity_extract?.model_list||[],p.lpmm_rdf_build?.model_list||[],p.lpmm_qa?.model_list||[]].some(Me=>Me.includes(Y)):!1;return v?e.jsx(Ie,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsxs(b,{onClick:Ks,disabled:T||R||!U||Z,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(pr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),T?"保存中...":R?"自动保存中...":U?"保存配置":"已保存"]}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsxs(b,{disabled:T||R||Z,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(fr,{className:"mr-2 h-4 w-4"}),Z?"重启中...":U?"保存并重启":"重启麦麦"]})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认重启麦麦?"}),e.jsx(dt,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:U?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})})})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:U?ns:Oe,children:U?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(al,{children:[e.jsx(za,{className:"h-4 w-4"}),e.jsxs(ll,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(al,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:nl,children:[e.jsx(fy,{className:"h-4 w-4 text-primary"}),e.jsxs(ll,{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),e.jsx(b,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),e.jsxs(Aa,{defaultValue:"models",className:"w-full",children:[e.jsxs(ja,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[e.jsx(st,{value:"models",children:"添加模型"}),e.jsx(st,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),e.jsxs(_t,{value:"models",className:"space-y-4 mt-0",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[H.size>0&&e.jsxs(b,{onClick:Ae,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(Pe,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",H.size,")"]}),e.jsxs(b,{onClick:()=>Zs(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[e.jsx(cs,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索模型名称、标识符或提供商...",value:y,onChange:Y=>q(Y.target.value),className:"pl-9"})]}),y&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Cs.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:Ul.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:y?"未找到匹配的模型":"暂无模型配置"}):Ul.map((Y,fe)=>{const Me=n.findIndex(ht=>ht===Y),qe=on(Y.name);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-base",children:Y.name}),e.jsx(Qe,{variant:qe?"default":"secondary",className:qe?"bg-green-600 hover:bg-green-700":"",children:qe?"已使用":"未使用"})]}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",title:Y.model_identifier,children:Y.model_identifier})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(b,{variant:"default",size:"sm",onClick:()=>Zs(Y,Me),children:[e.jsx(an,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(b,{size:"sm",onClick:()=>Ra(Me),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(Pe,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),e.jsx("p",{className:"font-medium",children:Y.api_provider})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),e.jsx("p",{className:"font-medium",children:Y.force_stream_mode?"是":"否"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),e.jsxs("p",{className:"font-medium",children:["¥",Y.price_in,"/M"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),e.jsxs("p",{className:"font-medium",children:["¥",Y.price_out,"/M"]})]})]})]},fe)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ai,{children:[e.jsx(li,{children:e.jsxs(gs,{children:[e.jsx(at,{className:"w-12",children:e.jsx(bs,{checked:H.size===Cs.length&&Cs.length>0,onCheckedChange:ve})}),e.jsx(at,{className:"w-24",children:"使用状态"}),e.jsx(at,{children:"模型名称"}),e.jsx(at,{children:"模型标识符"}),e.jsx(at,{children:"提供商"}),e.jsx(at,{className:"text-right",children:"输入价格"}),e.jsx(at,{className:"text-right",children:"输出价格"}),e.jsx(at,{className:"text-center",children:"强制流式"}),e.jsx(at,{className:"text-right",children:"操作"})]})}),e.jsx(ni,{children:Ul.length===0?e.jsx(gs,{children:e.jsx($e,{colSpan:9,className:"text-center text-muted-foreground py-8",children:y?"未找到匹配的模型":"暂无模型配置"})}):Ul.map((Y,fe)=>{const Me=n.findIndex(ht=>ht===Y),qe=on(Y.name);return e.jsxs(gs,{children:[e.jsx($e,{children:e.jsx(bs,{checked:H.has(Me),onCheckedChange:()=>W(Me)})}),e.jsx($e,{children:e.jsx(Qe,{variant:qe?"default":"secondary",className:qe?"bg-green-600 hover:bg-green-700":"",children:qe?"已使用":"未使用"})}),e.jsx($e,{className:"font-medium",children:Y.name}),e.jsx($e,{className:"max-w-xs truncate",title:Y.model_identifier,children:Y.model_identifier}),e.jsx($e,{children:Y.api_provider}),e.jsxs($e,{className:"text-right",children:["¥",Y.price_in,"/M"]}),e.jsxs($e,{className:"text-right",children:["¥",Y.price_out,"/M"]}),e.jsx($e,{className:"text-center",children:Y.force_stream_mode?"是":"否"}),e.jsx($e,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(b,{variant:"default",size:"sm",onClick:()=>Zs(Y,Me),children:[e.jsx(an,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(b,{size:"sm",onClick:()=>Ra(Me),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(Pe,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},fe)})})]})})}),Cs.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Be,{value:de.toString(),onValueChange:Y=>{ge(parseInt(Y)),Q(1),ie(new Set)},children:[e.jsx(Re,{id:"page-size-model",className:"w-20",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(xe-1)*de+1," 到"," ",Math.min(xe*de,Cs.length)," 条,共 ",Cs.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>Q(1),disabled:xe===1,className:"hidden sm:flex",children:e.jsx(gr,{className:"h-4 w-4"})}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>Q(Y=>Math.max(1,Y-1)),disabled:xe===1,children:[e.jsx(nn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:le,onChange:Y=>L(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&cn(),placeholder:xe.toString(),className:"w-16 h-8 text-center",min:1,max:cl}),e.jsx(b,{variant:"outline",size:"sm",onClick:cn,disabled:!le,className:"h-8",children:"跳转"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>Q(Y=>Y+1),disabled:xe>=cl,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Ol,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>Q(cl),disabled:xe>=cl,className:"hidden sm:flex",children:e.jsx(jr,{className:"h-4 w-4"})})]})]})]}),e.jsxs(_t,{value:"tasks",className:"space-y-6 mt-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),p&&e.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[e.jsx(fa,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:p.utils,modelNames:f,onChange:(Y,fe)=>Us("utils",Y,fe),dataTour:"task-model-select"}),e.jsx(fa,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:p.utils_small,modelNames:f,onChange:(Y,fe)=>Us("utils_small",Y,fe)}),e.jsx(fa,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:p.tool_use,modelNames:f,onChange:(Y,fe)=>Us("tool_use",Y,fe)}),e.jsx(fa,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:p.replyer,modelNames:f,onChange:(Y,fe)=>Us("replyer",Y,fe)}),e.jsx(fa,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:p.planner,modelNames:f,onChange:(Y,fe)=>Us("planner",Y,fe)}),e.jsx(fa,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:p.vlm,modelNames:f,onChange:(Y,fe)=>Us("vlm",Y,fe),hideTemperature:!0}),e.jsx(fa,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:p.voice,modelNames:f,onChange:(Y,fe)=>Us("voice",Y,fe),hideTemperature:!0,hideMaxTokens:!0}),e.jsx(fa,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:p.embedding,modelNames:f,onChange:(Y,fe)=>Us("embedding",Y,fe),hideTemperature:!0,hideMaxTokens:!0}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),e.jsx(fa,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:p.lpmm_entity_extract,modelNames:f,onChange:(Y,fe)=>Us("lpmm_entity_extract",Y,fe)}),e.jsx(fa,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:p.lpmm_rdf_build,modelNames:f,onChange:(Y,fe)=>Us("lpmm_rdf_build",Y,fe)}),e.jsx(fa,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:p.lpmm_qa,modelNames:f,onChange:(Y,fe)=>Us("lpmm_qa",Y,fe)})]})]})]})]}),e.jsx(Qt,{open:X,onOpenChange:Ls,children:e.jsxs(Ut,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:Ke.isRunning,children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:he!==null?"编辑模型":"添加模型"}),e.jsx(ss,{children:"配置模型的基本信息和参数"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[e.jsx(N,{htmlFor:"model_name",className:we.name?"text-destructive":"",children:"模型名称 *"}),e.jsx(ce,{id:"model_name",value:O?.name||"",onChange:Y=>{se(fe=>fe?{...fe,name:Y.target.value}:null),we.name&&Je(fe=>({...fe,name:void 0}))},placeholder:"例如: qwen3-30b",className:we.name?"border-destructive focus-visible:ring-destructive":""}),we.name?e.jsx("p",{className:"text-xs text-destructive",children:we.name}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[e.jsx(N,{htmlFor:"api_provider",className:we.api_provider?"text-destructive":"",children:"API 提供商 *"}),e.jsxs(Be,{value:O?.api_provider||"",onValueChange:Y=>{se(fe=>fe?{...fe,api_provider:Y}:null),D([]),We(null),we.api_provider&&Je(fe=>({...fe,api_provider:void 0}))},children:[e.jsx(Re,{id:"api_provider",className:we.api_provider?"border-destructive focus-visible:ring-destructive":"",children:e.jsx(He,{placeholder:"选择提供商"})}),e.jsx(Le,{children:c.map(Y=>e.jsx(ne,{value:Y,children:Y},Y))})]}),we.api_provider&&e.jsx("p",{className:"text-xs text-destructive",children:we.api_provider})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{htmlFor:"model_identifier",className:we.model_identifier?"text-destructive":"",children:"模型标识符 *"}),qt?.modelFetcher&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{variant:"secondary",className:"text-xs",children:qt.display_name}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>O?.api_provider&&Se(O.api_provider,!0),disabled:ee,children:ee?e.jsx(vs,{className:"h-3 w-3 animate-spin"}):e.jsx(ps,{className:"h-3 w-3"})})]})]}),qt?.modelFetcher?e.jsxs(Ma,{open:Xe,onOpenChange:Mt,children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",role:"combobox","aria-expanded":Xe,className:"w-full justify-between font-normal",disabled:ee||!!ze,children:[ee?e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(vs,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):ze?e.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):O?.model_identifier?e.jsx("span",{className:"truncate",children:O.model_identifier}):e.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),e.jsx(Bu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(va,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(ao,{children:[e.jsx(lo,{placeholder:"搜索模型..."}),e.jsx(Ie,{className:"h-[300px]",children:e.jsxs(no,{className:"max-h-none overflow-visible",children:[e.jsx(io,{children:ze?e.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[e.jsx("p",{className:"text-sm text-destructive",children:ze}),!ze.includes("API Key")&&e.jsx(b,{variant:"link",size:"sm",onClick:()=>O?.api_provider&&Se(O.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),e.jsx(hr,{heading:"可用模型",children:$.map(Y=>e.jsxs(xr,{value:Y.id,onSelect:()=>{se(fe=>fe?{...fe,model_identifier:Y.id}:null),Mt(!1)},children:[e.jsx(ga,{className:`mr-2 h-4 w-4 ${O?.model_identifier===Y.id?"opacity-100":"opacity-0"}`}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:Y.id}),Y.name!==Y.id&&e.jsx("span",{className:"text-xs text-muted-foreground",children:Y.name})]})]},Y.id))}),e.jsx(hr,{heading:"手动输入",children:e.jsxs(xr,{value:"__manual_input__",onSelect:()=>{Mt(!1)},children:[e.jsx(an,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):e.jsx(ce,{id:"model_identifier",value:O?.model_identifier||"",onChange:Y=>{se(fe=>fe?{...fe,model_identifier:Y.target.value}:null),we.model_identifier&&Je(fe=>({...fe,model_identifier:void 0}))},placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507",className:we.model_identifier?"border-destructive focus-visible:ring-destructive":""}),we.model_identifier&&e.jsx("p",{className:"text-xs text-destructive",children:we.model_identifier}),ze&&qt?.modelFetcher&&!we.model_identifier&&e.jsxs(al,{variant:"destructive",className:"mt-2 py-2",children:[e.jsx(za,{className:"h-4 w-4"}),e.jsx(ll,{className:"text-xs",children:ze})]}),qt?.modelFetcher&&e.jsx(ce,{value:O?.model_identifier||"",onChange:Y=>{se(fe=>fe?{...fe,model_identifier:Y.target.value}:null),we.model_identifier&&Je(fe=>({...fe,model_identifier:void 0}))},placeholder:"或手动输入模型标识符",className:`mt-2 ${we.model_identifier?"border-destructive focus-visible:ring-destructive":""}`}),!we.model_identifier&&e.jsx("p",{className:"text-xs text-muted-foreground",children:ze?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':qt?.modelFetcher?`已识别为 ${qt.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),e.jsx(ce,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in??"",onChange:Y=>{const fe=Y.target.value===""?null:parseFloat(Y.target.value);se(Me=>Me?{...Me,price_in:fe}:null)},placeholder:"默认: 0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),e.jsx(ce,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out??"",onChange:Y=>{const fe=Y.target.value===""?null:parseFloat(Y.target.value);se(Me=>Me?{...Me,price_out:fe}:null)},placeholder:"默认: 0"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:Y=>se(fe=>fe?{...fe,force_stream_mode:Y}:null)}),e.jsx(N,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>S(!1),"data-tour":"model-cancel-button",children:"取消"}),e.jsx(b,{onClick:Oa,"data-tour":"model-save-button",children:"保存"})]})]})}),e.jsx(ft,{open:be,onOpenChange:pe,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除模型 "',je!==null?n[je]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:ba,children:"删除"})]})]})}),e.jsx(ft,{open:_,onOpenChange:me,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认批量删除"}),e.jsxs(dt,{children:["确定要删除选中的 ",H.size," 个模型吗? 此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:es,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),z&&e.jsx($u,{onRestartComplete:ds,onRestartFailed:ri})]})})}function fa({title:n,description:r,taskConfig:c,modelNames:d,onChange:h,hideTemperature:x=!1,hideMaxTokens:f=!1,dataTour:j}){const p=w=>{h("model_list",w)};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:n}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:r})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":j,children:[e.jsx(N,{children:"模型列表"}),e.jsx(ew,{options:d.map(w=>({label:w,value:w})),selected:c.model_list||[],onChange:p,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!x&&e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{children:"温度"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",value:c.temperature??.3,onChange:w=>{const v=parseFloat(w.target.value);!isNaN(v)&&v>=0&&v<=1&&h("temperature",v)},className:"w-20 h-8 text-sm"})]}),e.jsx(ka,{value:[c.temperature??.3],onValueChange:w=>h("temperature",w[0]),min:0,max:1,step:.1,className:"w-full"})]}),!f&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{children:"最大 Token"}),e.jsx(ce,{type:"number",step:"1",min:"1",value:c.max_tokens??1024,onChange:w=>h("max_tokens",parseInt(w.target.value))})]})]})]})]})}const ro="/api/webui/config";async function aw(){const r=await(await ke(`${ro}/adapter-config/path`)).json();return!r.success||!r.path?null:{path:r.path,lastModified:r.lastModified}}async function np(n){const c=await(await ke(`${ro}/adapter-config/path`,{method:"POST",headers:Tt(),body:JSON.stringify({path:n})})).json();if(!c.success)throw new Error(c.message||"保存路径失败")}async function ip(n){const c=await(await ke(`${ro}/adapter-config?path=${encodeURIComponent(n)}`)).json();if(!c.success)throw new Error("读取配置文件失败");return c.content}async function rp(n,r){const d=await(await ke(`${ro}/adapter-config`,{method:"POST",headers:Tt(),body:JSON.stringify({path:n,content:r})})).json();if(!d.success)throw new Error(d.message||"保存配置失败")}const Qs={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}},ku={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:ln},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:py}};function lw(){const[n,r]=u.useState("upload"),[c,d]=u.useState(null),[h,x]=u.useState(""),[f,j]=u.useState(""),[p,w]=u.useState("oneclick"),[v,k]=u.useState(""),[T,E]=u.useState(!1),[R,F]=u.useState(!1),[U,M]=u.useState(!1),[Z,G]=u.useState(!1),[z,B]=u.useState(null),X=u.useRef(null),{toast:S}=Rt(),O=u.useRef(null),se=L=>{if(!L.trim())return{valid:!1,error:"路径不能为空"};if(!L.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const $=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,D=/^(\/|~\/).+\.toml$/i,ee=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,Ne=$.test(L),ze=D.test(L),We=ee.test(L);return!Ne&&!ze&&!We?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(L)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},he=L=>{if(j(L),L.trim()){const $=se(L);k($.error)}else k("")},ye=u.useCallback(async L=>{const $=ku[L];F(!0);try{const D=await ip($.path),ee=xe(D);d(ee),w(L),j($.path),await np($.path),S({title:"加载成功",description:`已从${$.name}预设加载配置`})}catch(D){console.error("加载预设配置失败:",D),S({title:"加载失败",description:D instanceof Error?D.message:"无法读取预设配置文件",variant:"destructive"})}finally{F(!1)}},[S]),be=u.useCallback(async L=>{const $=se(L);if(!$.valid){k($.error),S({title:"路径无效",description:$.error,variant:"destructive"});return}k(""),F(!0);try{const D=await ip(L),ee=xe(D);d(ee),j(L),await np(L),S({title:"加载成功",description:"已从配置文件加载"})}catch(D){console.error("加载配置失败:",D),S({title:"加载失败",description:D instanceof Error?D.message:"无法读取配置文件",variant:"destructive"})}finally{F(!1)}},[S]);u.useEffect(()=>{(async()=>{try{const $=await aw();if($&&$.path){j($.path);const D=Object.entries(ku).find(([,ee])=>ee.path===$.path);D?(r("preset"),w(D[0]),await ye(D[0])):(r("path"),await be($.path))}}catch($){console.error("加载保存的路径失败:",$)}})()},[be,ye]);const pe=u.useCallback(L=>{n!=="path"&&n!=="preset"||!f||(O.current&&clearTimeout(O.current),O.current=setTimeout(async()=>{E(!0);try{const $=Q(L);await rp(f,$),S({title:"自动保存成功",description:"配置已保存到文件"})}catch($){console.error("自动保存失败:",$),S({title:"自动保存失败",description:$ instanceof Error?$.message:"保存配置失败",variant:"destructive"})}finally{E(!1)}},1e3))},[n,f,S]),je=async()=>{if(!c||!f)return;const L=se(f);if(!L.valid){S({title:"保存失败",description:L.error,variant:"destructive"});return}E(!0);try{const $=Q(c);await rp(f,$),S({title:"保存成功",description:"配置已保存到文件"})}catch($){console.error("保存失败:",$),S({title:"保存失败",description:$ instanceof Error?$.message:"保存配置失败",variant:"destructive"})}finally{E(!1)}},_e=async()=>{f&&await be(f)},y=L=>{if(L!==n){if(c){B(L),M(!0);return}q(L)}},q=L=>{d(null),x(""),k(""),r(L),L==="preset"&&ye("oneclick"),S({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[L]})},H=()=>{z&&(q(z),B(null)),M(!1)},ie=()=>{if(c){G(!0);return}_()},_=()=>{j(""),d(null),k(""),S({title:"已清空",description:"路径和配置已清空"})},me=()=>{_(),G(!1)},xe=L=>{const $=JSON.parse(JSON.stringify(Qs)),D=L.split(` +`);let ee="";for(const Ne of D){const ze=Ne.trim();if(!ze||ze.startsWith("#"))continue;const We=ze.match(/^\[(\w+)\]/);if(We){ee=We[1];continue}const Xe=ze.match(/^(\w+)\s*=\s*(.+)$/);if(Xe&&ee){const[,Mt,qt]=Xe;let re=qt.trim();const we=re.match(/^("[^"]*")/);if(we)re=we[1];else{const Fe=re.indexOf("#");Fe!==-1&&(re=re.substring(0,Fe).trim())}let Je;if(re==="true")Je=!0;else if(re==="false")Je=!1;else if(re.startsWith("[")&&re.endsWith("]")){const Fe=re.slice(1,-1).trim();if(Fe){const Wt=Fe.split(",").map(Ns=>{const Ke=Ns.trim();return isNaN(Number(Ke))?Ke.replace(/"/g,""):Number(Ke)}),Xs=typeof Wt[0];Je=Wt.every(Ns=>typeof Ns===Xs)?Wt:Wt.filter(Ns=>typeof Ns=="number")}else Je=[]}else re.startsWith('"')&&re.endsWith('"')?Je=re.slice(1,-1):isNaN(Number(re))?Je=re.replace(/"/g,""):Je=Number(re);if(ee in $){const Fe=$[ee];Fe[Mt]=Je}}}return $},Q=L=>{const $=[],D=(ee,Ne)=>ee===""||ee===null||ee===void 0?Ne:ee;return $.push("[inner]"),$.push(`version = "${D(L.inner.version,Qs.inner.version)}" # 版本号`),$.push("# 请勿修改版本号,除非你知道自己在做什么"),$.push(""),$.push("[nickname] # 现在没用"),$.push(`nickname = "${D(L.nickname.nickname,Qs.nickname.nickname)}"`),$.push(""),$.push("[napcat_server] # Napcat连接的ws服务设置"),$.push(`host = "${D(L.napcat_server.host,Qs.napcat_server.host)}" # Napcat设定的主机地址`),$.push(`port = ${D(L.napcat_server.port||0,Qs.napcat_server.port)} # Napcat设定的端口`),$.push(`token = "${D(L.napcat_server.token,Qs.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),$.push(`heartbeat_interval = ${D(L.napcat_server.heartbeat_interval||0,Qs.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),$.push(""),$.push("[maibot_server] # 连接麦麦的ws服务设置"),$.push(`host = "${D(L.maibot_server.host,Qs.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),$.push(`port = ${D(L.maibot_server.port||0,Qs.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),$.push(""),$.push("[chat] # 黑白名单功能"),$.push(`group_list_type = "${D(L.chat.group_list_type,Qs.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),$.push(`group_list = [${L.chat.group_list.join(", ")}] # 群组名单`),$.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),$.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),$.push(`private_list_type = "${D(L.chat.private_list_type,Qs.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),$.push(`private_list = [${L.chat.private_list.join(", ")}] # 私聊名单`),$.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),$.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),$.push(`ban_user_id = [${L.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),$.push(`ban_qq_bot = ${L.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),$.push(`enable_poke = ${L.chat.enable_poke} # 是否启用戳一戳功能`),$.push(""),$.push("[voice] # 发送语音设置"),$.push(`use_tts = ${L.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),$.push(""),$.push("[debug]"),$.push(`level = "${D(L.debug.level,Qs.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),$.join(` +`)},de=L=>{const $=L.target.files?.[0];if(!$)return;const D=new FileReader;D.onload=ee=>{try{const Ne=ee.target?.result,ze=xe(Ne);d(ze),x($.name),S({title:"上传成功",description:`已加载配置文件:${$.name}`})}catch(Ne){console.error("解析配置文件失败:",Ne),S({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},D.readAsText($)},ge=()=>{if(!c)return;const L=Q(c),$=new Blob([L],{type:"text/plain;charset=utf-8"}),D=URL.createObjectURL($),ee=document.createElement("a");ee.href=D,ee.download=h||"config.toml",document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(D),S({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},le=()=>{d(JSON.parse(JSON.stringify(Qs))),x("config.toml"),S({title:"已加载默认配置",description:"可以开始编辑配置"})};return e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[e.jsx(Ea,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"工作模式"}),e.jsx(Kt,{children:"选择配置文件的管理方式"})]}),e.jsxs(yt,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>y("preset"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(ln,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>y("upload"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(cr,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),e.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>y("path"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(gy,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),n==="preset"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsx(N,{className:"text-sm md:text-base",children:"选择部署方式"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(ku).map(([L,$])=>{const D=$.icon,ee=p===L;return e.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${ee?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{w(L),ye(L)},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(D,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"font-semibold text-sm",children:$.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:$.description}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:$.path})]})]})},L)})})]}),n==="path"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(ce,{id:"config-path",value:f,onChange:L=>he(L.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${v?"border-destructive":""}`}),v&&e.jsx("p",{className:"text-xs text-destructive",children:v})]}),e.jsx(b,{onClick:()=>be(f),disabled:R||!f||!!v,className:"w-full sm:w-auto",children:R?e.jsxs(e.Fragment,{children:[e.jsx(ps,{className:"h-4 w-4 animate-spin mr-2"}),e.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sm:hidden",children:"加载配置"}),e.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),e.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[e.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[e.jsx("span",{children:"路径格式说明"}),e.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),e.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),e.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[e.jsx("div",{children:"C:\\Adapter\\config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),e.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[e.jsx("div",{children:"/opt/adapter/config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),e.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),e.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),e.jsxs(al,{children:[e.jsx(za,{className:"h-4 w-4"}),e.jsx(ll,{children:n==="preset"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",T&&" (正在保存...)"]}):n==="upload"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",T&&" (正在保存...)"]})})]}),n==="upload"&&!c&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsx("input",{ref:X,type:"file",accept:".toml",className:"hidden",onChange:de}),e.jsxs(b,{onClick:()=>X.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(cr,{className:"mr-2 h-4 w-4"}),"上传配置"]}),e.jsxs(b,{onClick:le,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Ta,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),n==="upload"&&c&&e.jsx("div",{className:"flex gap-2",children:e.jsxs(b,{onClick:ge,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(sl,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(n==="preset"||n==="path")&&c&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs(b,{onClick:je,size:"sm",disabled:T||!!v,className:"w-full sm:w-auto",children:[e.jsx(pr,{className:"mr-2 h-4 w-4"}),T?"保存中...":"立即保存"]}),e.jsxs(b,{onClick:_e,size:"sm",variant:"outline",disabled:R,className:"w-full sm:w-auto",children:[e.jsx(ps,{className:`mr-2 h-4 w-4 ${R?"animate-spin":""}`}),"刷新"]}),n==="path"&&e.jsxs(b,{onClick:ie,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(Pe,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),c?e.jsxs(Aa,{defaultValue:"napcat",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs(ja,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[e.jsxs(st,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),e.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),e.jsxs(st,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),e.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),e.jsxs(st,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),e.jsx("span",{className:"sm:hidden",children:"聊天"})]}),e.jsxs(st,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[e.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),e.jsx("span",{className:"sm:hidden",children:"语音"})]}),e.jsx(st,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),e.jsx(_t,{value:"napcat",className:"space-y-4",children:e.jsx(nw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(_t,{value:"maibot",className:"space-y-4",children:e.jsx(iw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(_t,{value:"chat",className:"space-y-4",children:e.jsx(rw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(_t,{value:"voice",className:"space-y-4",children:e.jsx(cw,{config:c,onChange:L=>{d(L),pe(L)}})}),e.jsx(_t,{value:"debug",className:"space-y-4",children:e.jsx(ow,{config:c,onChange:L=>{d(L),pe(L)}})})]}):e.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:e.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[e.jsx(Ta,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:n==="preset"?"请选择预设的部署方式":n==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),e.jsx(ft,{open:U,onOpenChange:M,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认切换模式"}),e.jsxs(dt,{children:["切换模式将清空当前配置,确定要继续吗?",e.jsx("br",{}),e.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),e.jsxs(ct,{children:[e.jsx(mt,{onClick:()=>{M(!1),B(null)},children:"取消"}),e.jsx(ut,{onClick:H,children:"确认切换"})]})]})}),e.jsx(ft,{open:Z,onOpenChange:G,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认清空路径"}),e.jsxs(dt,{children:["清空路径将清除当前配置,确定要继续吗?",e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),e.jsxs(ct,{children:[e.jsx(mt,{onClick:()=>G(!1),children:"取消"}),e.jsx(ut,{onClick:me,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function nw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),e.jsxs("div",{className:"grid gap-3 md:gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),e.jsx(ce,{id:"napcat-host",value:n.napcat_server.host,onChange:c=>r({...n,napcat_server:{...n.napcat_server,host:c.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),e.jsx(ce,{id:"napcat-port",type:"number",value:n.napcat_server.port||"",onChange:c=>r({...n,napcat_server:{...n.napcat_server,port:c.target.value?parseInt(c.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),e.jsx(ce,{id:"napcat-token",type:"password",value:n.napcat_server.token,onChange:c=>r({...n,napcat_server:{...n.napcat_server,token:c.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),e.jsx(ce,{id:"napcat-heartbeat",type:"number",value:n.napcat_server.heartbeat_interval||"",onChange:c=>r({...n,napcat_server:{...n.napcat_server,heartbeat_interval:c.target.value?parseInt(c.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function iw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),e.jsxs("div",{className:"grid gap-3 md:gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),e.jsx(ce,{id:"maibot-host",value:n.maibot_server.host,onChange:c=>r({...n,maibot_server:{...n.maibot_server,host:c.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),e.jsx(ce,{id:"maibot-port",type:"number",value:n.maibot_server.port||"",onChange:c=>r({...n,maibot_server:{...n.maibot_server,port:c.target.value?parseInt(c.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function rw({config:n,onChange:r}){const c=x=>{const f={...n};x==="group"?f.chat.group_list=[...f.chat.group_list,0]:x==="private"?f.chat.private_list=[...f.chat.private_list,0]:f.chat.ban_user_id=[...f.chat.ban_user_id,0],r(f)},d=(x,f)=>{const j={...n};x==="group"?j.chat.group_list=j.chat.group_list.filter((p,w)=>w!==f):x==="private"?j.chat.private_list=j.chat.private_list.filter((p,w)=>w!==f):j.chat.ban_user_id=j.chat.ban_user_id.filter((p,w)=>w!==f),r(j)},h=(x,f,j)=>{const p={...n};x==="group"?p.chat.group_list[f]=j:x==="private"?p.chat.private_list[f]=j:p.chat.ban_user_id[f]=j,r(p)};return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),e.jsxs("div",{className:"grid gap-4 md:gap-6",children:[e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-sm md:text-base",children:"群组名单类型"}),e.jsxs(Be,{value:n.chat.group_list_type,onValueChange:x=>r({...n,chat:{...n.chat,group_list_type:x}}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),e.jsx(ne,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsx(N,{className:"text-sm md:text-base",children:"群组列表"}),e.jsxs(b,{onClick:()=>c("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ta,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),n.chat.group_list.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("group",f,parseInt(j.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除群号 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d("group",f),children:"删除"})]})]})]})]},f)),n.chat.group_list.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),e.jsxs("div",{className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-sm md:text-base",children:"私聊名单类型"}),e.jsxs(Be,{value:n.chat.private_list_type,onValueChange:x=>r({...n,chat:{...n.chat,private_list_type:x}}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),e.jsx(ne,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsx(N,{className:"text-sm md:text-base",children:"私聊列表"}),e.jsxs(b,{onClick:()=>c("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ta,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.private_list.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("private",f,parseInt(j.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要删除用户 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d("private",f),children:"删除"})]})]})]})]},f)),n.chat.private_list.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-sm md:text-base",children:"全局禁止名单"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),e.jsxs(b,{onClick:()=>c("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ta,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.ban_user_id.map((x,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{type:"number",value:x,onChange:j=>h("ban",f,parseInt(j.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),e.jsxs(ft,{children:[e.jsx($t,{asChild:!0,children:e.jsx(b,{size:"icon",variant:"outline",children:e.jsx(Pe,{className:"h-4 w-4"})})}),e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:["确定要从全局禁止名单中删除用户 ",x," 吗?此操作无法撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>d("ban",f),children:"删除"})]})]})]})]},f)),n.chat.ban_user_id.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),e.jsx(Ge,{checked:n.chat.ban_qq_bot,onCheckedChange:x=>r({...n,chat:{...n.chat,ban_qq_bot:x}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),e.jsx(Ge,{checked:n.chat.enable_poke,onCheckedChange:x=>r({...n,chat:{...n.chat,enable_poke:x}})})]})]})]})})}function cw({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),e.jsx(Ge,{checked:n.voice.use_tts,onCheckedChange:c=>r({...n,voice:{use_tts:c}})})]})]})})}function ow({config:n,onChange:r}){return e.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),e.jsx("div",{className:"grid gap-3 md:gap-4",children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{className:"text-sm md:text-base",children:"日志等级"}),e.jsxs(Be,{value:n.debug.level,onValueChange:c=>r({...n,debug:{level:c}}),children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"DEBUG",children:"DEBUG(调试)"}),e.jsx(ne,{value:"INFO",children:"INFO(信息)"}),e.jsx(ne,{value:"WARNING",children:"WARNING(警告)"}),e.jsx(ne,{value:"ERROR",children:"ERROR(错误)"}),e.jsx(ne,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}const dw=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],uw=/^(aria-|data-)/,kg=n=>Object.fromEntries(Object.entries(n).filter(([r])=>uw.test(r)||dw.includes(r)));function mw(n,r){const c=kg(n);return Object.keys(n).some(d=>!Object.hasOwn(c,d)&&n[d]!==r[d])}class hw extends u.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(r){if(r.uppy!==this.props.uppy)this.uninstallPlugin(r),this.installPlugin();else if(mw(this.props,r)){const{uppy:c,...d}={...this.props,target:this.container};this.plugin.setOptions(d)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:r,...c}={id:"Dashboard",...this.props,inline:!0,target:this.container};r.use(Py,c),this.plugin=r.getPlugin(c.id)}uninstallPlugin(r=this.props){const{uppy:c}=r;c.removePlugin(this.plugin)}render(){return u.createElement("div",{className:"uppy-Container",ref:r=>{this.container=r},...kg(this.props)})}}function xw({src:n,alt:r="表情包",className:c,maxRetries:d=5,retryInterval:h=1500}){const[x,f]=u.useState("loading"),[j,p]=u.useState(0),[w,v]=u.useState(null),k=u.useCallback(async()=>{try{const T=await fetch(n,{credentials:"include"});if(T.status===202){f("generating"),j{p(F=>F+1)},h):f("error");return}if(!T.ok){f("error");return}const E=await T.blob(),R=URL.createObjectURL(E);v(R),f("loaded")}catch(T){console.error("加载缩略图失败:",T),f("error")}},[n,j,d,h]);return u.useEffect(()=>{f("loading"),p(0),v(null)},[n]),u.useEffect(()=>{k()},[k]),u.useEffect(()=>()=>{w&&URL.revokeObjectURL(w)},[w]),x==="loading"||x==="generating"?e.jsx(dg,{className:K("w-full h-full",c)}):x==="error"||!w?e.jsx("div",{className:K("w-full h-full flex items-center justify-center bg-muted",c),children:e.jsx(ag,{className:"h-8 w-8 text-muted-foreground"})}):e.jsx("img",{src:w,alt:r,className:K("w-full h-full object-contain",c)})}function fw({content:n,className:r=""}){return e.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${r}`,children:e.jsx(eN,{remarkPlugins:[sN,aN],rehypePlugins:[tN],components:{code({inline:c,className:d,children:h,...x}){return c?e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...x,children:h}):e.jsx("code",{className:`${d} block bg-muted p-4 rounded-lg overflow-x-auto`,...x,children:h})},table({children:c,...d}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{className:"border-collapse border border-border",...d,children:c})})},th({children:c,...d}){return e.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...d,children:c})},td({children:c,...d}){return e.jsx("td",{className:"border border-border px-4 py-2",...d,children:c})},a({children:c,...d}){return e.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...d,children:c})},blockquote({children:c,...d}){return e.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...d,children:c})},h1({children:c,...d}){return e.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...d,children:c})},h2({children:c,...d}){return e.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...d,children:c})},h3({children:c,...d}){return e.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...d,children:c})},h4({children:c,...d}){return e.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...d,children:c})},ul({children:c,...d}){return e.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...d,children:c})},ol({children:c,...d}){return e.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...d,children:c})},p({children:c,...d}){return e.jsx("p",{className:"my-2 leading-relaxed",...d,children:c})},hr({...c}){return e.jsx("hr",{className:"my-4 border-border",...c})}},children:n})})}function pw({children:n,className:r}){return e.jsx(fw,{content:n,className:r})}const da="/api/webui/emoji";async function gw(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.is_registered!==void 0&&r.append("is_registered",n.is_registered.toString()),n.is_banned!==void 0&&r.append("is_banned",n.is_banned.toString()),n.format&&r.append("format",n.format),n.sort_by&&r.append("sort_by",n.sort_by),n.sort_order&&r.append("sort_order",n.sort_order);const c=await ke(`${da}/list?${r}`,{});if(!c.ok)throw new Error(`获取表情包列表失败: ${c.statusText}`);return c.json()}async function jw(n){const r=await ke(`${da}/${n}`,{});if(!r.ok)throw new Error(`获取表情包详情失败: ${r.statusText}`);return r.json()}async function vw(n,r){const c=await ke(`${da}/${n}`,{method:"PATCH",body:JSON.stringify(r)});if(!c.ok)throw new Error(`更新表情包失败: ${c.statusText}`);return c.json()}async function bw(n){const r=await ke(`${da}/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(`删除表情包失败: ${r.statusText}`);return r.json()}async function yw(){const n=await ke(`${da}/stats/summary`,{});if(!n.ok)throw new Error(`获取统计数据失败: ${n.statusText}`);return n.json()}async function Nw(n){const r=await ke(`${da}/${n}/register`,{method:"POST"});if(!r.ok)throw new Error(`注册表情包失败: ${r.statusText}`);return r.json()}async function ww(n){const r=await ke(`${da}/${n}/ban`,{method:"POST"});if(!r.ok)throw new Error(`封禁表情包失败: ${r.statusText}`);return r.json()}function _w(n,r=!1){return r?`${da}/${n}/thumbnail?original=true`:`${da}/${n}/thumbnail`}function Sw(n){return`${da}/${n}/thumbnail?original=true`}async function Cw(n){const r=await ke(`${da}/batch/delete`,{method:"POST",body:JSON.stringify({emoji_ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除失败")}return r.json()}function kw(){return`${da}/upload`}function Tw(){const[n,r]=u.useState([]),[c,d]=u.useState(null),[h,x]=u.useState(!1),[f,j]=u.useState(1),[p,w]=u.useState(0),[v,k]=u.useState(20),[T,E]=u.useState("all"),[R,F]=u.useState("all"),[U,M]=u.useState("all"),[Z,G]=u.useState("usage_count"),[z,B]=u.useState("desc"),[X,S]=u.useState(null),[O,se]=u.useState(!1),[he,ye]=u.useState(!1),[be,pe]=u.useState(!1),[je,_e]=u.useState(new Set),[y,q]=u.useState(!1),[H,ie]=u.useState(""),[_,me]=u.useState("medium"),[xe,Q]=u.useState(!1),{toast:de}=Rt(),ge=u.useCallback(async()=>{try{x(!0);const re=await gw({page:f,page_size:v,is_registered:T==="all"?void 0:T==="registered",is_banned:R==="all"?void 0:R==="banned",format:U==="all"?void 0:U,sort_by:Z,sort_order:z});r(re.data),w(re.total)}catch(re){const we=re instanceof Error?re.message:"加载表情包列表失败";de({title:"错误",description:we,variant:"destructive"})}finally{x(!1)}},[f,v,T,R,U,Z,z,de]),le=async()=>{try{const re=await yw();d(re.data)}catch(re){console.error("加载统计数据失败:",re)}};u.useEffect(()=>{ge()},[ge]),u.useEffect(()=>{le()},[]);const L=async re=>{try{const we=await jw(re.id);S(we.data),se(!0)}catch(we){const Je=we instanceof Error?we.message:"加载详情失败";de({title:"错误",description:Je,variant:"destructive"})}},$=re=>{S(re),ye(!0)},D=re=>{S(re),pe(!0)},ee=async()=>{if(X)try{await bw(X.id),de({title:"成功",description:"表情包已删除"}),pe(!1),S(null),ge(),le()}catch(re){const we=re instanceof Error?re.message:"删除失败";de({title:"错误",description:we,variant:"destructive"})}},Ne=async re=>{try{await Nw(re.id),de({title:"成功",description:"表情包已注册"}),ge(),le()}catch(we){const Je=we instanceof Error?we.message:"注册失败";de({title:"错误",description:Je,variant:"destructive"})}},ze=async re=>{try{await ww(re.id),de({title:"成功",description:"表情包已封禁"}),ge(),le()}catch(we){const Je=we instanceof Error?we.message:"封禁失败";de({title:"错误",description:Je,variant:"destructive"})}},We=re=>{const we=new Set(je);we.has(re)?we.delete(re):we.add(re),_e(we)},Xe=async()=>{try{const re=await Cw(Array.from(je));de({title:"批量删除完成",description:re.message}),_e(new Set),q(!1),ge(),le()}catch(re){de({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},Mt=()=>{const re=parseInt(H),we=Math.ceil(p/v);re>=1&&re<=we?(j(re),ie("")):de({title:"无效的页码",description:`请输入1-${we}之间的页码`,variant:"destructive"})},qt=c?.formats?Object.keys(c.formats):[];return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-4 sm:mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),e.jsxs(b,{onClick:()=>Q(!0),className:"gap-2",children:[e.jsx(cr,{className:"h-4 w-4"}),"上传表情包"]})]}),e.jsx(Ie,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[c&&e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e.jsx(Ve,{children:e.jsxs(pt,{className:"pb-2",children:[e.jsx(Kt,{children:"总数"}),e.jsx(gt,{className:"text-2xl",children:c.total})]})}),e.jsx(Ve,{children:e.jsxs(pt,{className:"pb-2",children:[e.jsx(Kt,{children:"已注册"}),e.jsx(gt,{className:"text-2xl text-green-600",children:c.registered})]})}),e.jsx(Ve,{children:e.jsxs(pt,{className:"pb-2",children:[e.jsx(Kt,{children:"已封禁"}),e.jsx(gt,{className:"text-2xl text-red-600",children:c.banned})]})}),e.jsx(Ve,{children:e.jsxs(pt,{className:"pb-2",children:[e.jsx(Kt,{children:"未注册"}),e.jsx(gt,{className:"text-2xl text-gray-600",children:c.unregistered})]})})]}),e.jsxs(Ve,{children:[e.jsx(pt,{children:e.jsxs(gt,{className:"flex items-center gap-2",children:[e.jsx(Tu,{className:"h-5 w-5"}),"筛选和排序"]})}),e.jsxs(yt,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"排序方式"}),e.jsxs(Be,{value:`${Z}-${z}`,onValueChange:re=>{const[we,Je]=re.split("-");G(we),B(Je),j(1)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"usage_count-desc",children:"使用次数 (多→少)"}),e.jsx(ne,{value:"usage_count-asc",children:"使用次数 (少→多)"}),e.jsx(ne,{value:"register_time-desc",children:"注册时间 (新→旧)"}),e.jsx(ne,{value:"register_time-asc",children:"注册时间 (旧→新)"}),e.jsx(ne,{value:"record_time-desc",children:"记录时间 (新→旧)"}),e.jsx(ne,{value:"record_time-asc",children:"记录时间 (旧→新)"}),e.jsx(ne,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),e.jsx(ne,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"注册状态"}),e.jsxs(Be,{value:T,onValueChange:re=>{E(re),j(1)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),e.jsx(ne,{value:"registered",children:"已注册"}),e.jsx(ne,{value:"unregistered",children:"未注册"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"封禁状态"}),e.jsxs(Be,{value:R,onValueChange:re=>{F(re),j(1)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),e.jsx(ne,{value:"banned",children:"已封禁"}),e.jsx(ne,{value:"unbanned",children:"未封禁"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"格式"}),e.jsxs(Be,{value:U,onValueChange:re=>{M(re),j(1)},children:[e.jsx(Re,{children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),qt.map(re=>e.jsxs(ne,{value:re,children:[re.toUpperCase()," (",c?.formats[re],")"]},re))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[je.size>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",je.size," 个表情包"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),e.jsxs(Be,{value:_,onValueChange:re=>me(re),children:[e.jsx(Re,{className:"w-24",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"small",children:"小"}),e.jsx(ne,{value:"medium",children:"中"}),e.jsx(ne,{value:"large",children:"大"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Be,{value:v.toString(),onValueChange:re=>{k(parseInt(re)),j(1),_e(new Set)},children:[e.jsx(Re,{id:"emoji-page-size",className:"w-20",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"40",children:"40"}),e.jsx(ne,{value:"60",children:"60"}),e.jsx(ne,{value:"100",children:"100"})]})]}),je.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>_e(new Set),children:"取消选择"}),e.jsxs(b,{variant:"destructive",size:"sm",onClick:()=>q(!0),children:[e.jsx(Pe,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:ge,disabled:h,children:[e.jsx(ps,{className:`h-4 w-4 mr-2 ${h?"animate-spin":""}`}),"刷新"]})})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"表情包列表"}),e.jsxs(Kt,{children:["共 ",p," 个表情包,当前第 ",f," 页"]})]}),e.jsxs(yt,{children:[n.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):e.jsx("div",{className:`grid gap-3 ${_==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":_==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:n.map(re=>e.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${je.has(re.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>We(re.id),children:[e.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${je.has(re.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:e.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${je.has(re.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:je.has(re.id)&&e.jsx(oa,{className:"h-3 w-3"})})}),e.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[re.is_registered&&e.jsx(Qe,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),re.is_banned&&e.jsx(Qe,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),e.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${_==="small"?"p-1":_==="medium"?"p-2":"p-3"}`,children:e.jsx(xw,{src:_w(re.id),alt:"表情包"})}),e.jsxs("div",{className:`border-t bg-card ${_==="small"?"p-1":"p-2"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[e.jsx(Qe,{variant:"outline",className:"text-[10px] px-1 py-0",children:re.format.toUpperCase()}),e.jsxs("span",{className:"font-mono",children:[re.usage_count,"次"]})]}),e.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${_==="small"?"flex-wrap":""}`,children:[e.jsx(b,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:we=>{we.stopPropagation(),$(re)},title:"编辑",children:e.jsx(dr,{className:"h-3 w-3"})}),e.jsx(b,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:we=>{we.stopPropagation(),L(re)},title:"详情",children:e.jsx(za,{className:"h-3 w-3"})}),!re.is_registered&&e.jsx(b,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:we=>{we.stopPropagation(),Ne(re)},title:"注册",children:e.jsx(oa,{className:"h-3 w-3"})}),!re.is_banned&&e.jsx(b,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:we=>{we.stopPropagation(),ze(re)},title:"封禁",children:e.jsx(jy,{className:"h-3 w-3"})}),e.jsx(b,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:we=>{we.stopPropagation(),D(re)},title:"删除",children:e.jsx(Pe,{className:"h-3 w-3"})})]})]})]},re.id))}),p>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(f-1)*v+1," 到"," ",Math.min(f*v,p)," 条,共 ",p," 条"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(gr,{className:"h-4 w-4"})}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>j(re=>Math.max(1,re-1)),disabled:f===1,children:[e.jsx(nn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:H,onChange:re=>ie(re.target.value),onKeyDown:re=>re.key==="Enter"&&Mt(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(p/v)}),e.jsx(b,{variant:"outline",size:"sm",onClick:Mt,disabled:!H,className:"h-8",children:"跳转"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>j(re=>re+1),disabled:f>=Math.ceil(p/v),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Ol,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(p/v)),disabled:f>=Math.ceil(p/v),className:"hidden sm:flex",children:e.jsx(jr,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(Ew,{emoji:X,open:O,onOpenChange:se}),e.jsx(zw,{emoji:X,open:he,onOpenChange:ye,onSuccess:()=>{ge(),le()}}),e.jsx(Aw,{open:xe,onOpenChange:Q,onSuccess:()=>{ge(),le()}})]})}),e.jsx(ft,{open:y,onOpenChange:q,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认批量删除"}),e.jsxs(dt,{children:["你确定要删除选中的 ",je.size," 个表情包吗?此操作不可撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:Xe,children:"确认删除"})]})]})}),e.jsx(Qt,{open:be,onOpenChange:pe,children:e.jsxs(Ut,{children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"确认删除"}),e.jsx(ss,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>pe(!1),children:"取消"}),e.jsx(b,{variant:"destructive",onClick:ee,children:"删除"})]})]})})]})}function Ew({emoji:n,open:r,onOpenChange:c}){if(!n)return null;const d=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Qt,{open:r,onOpenChange:c,children:e.jsxs(Ut,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(Bt,{children:e.jsx(Ht,{children:"表情包详情"})}),e.jsx(Ie,{className:"max-h-[calc(90vh-8rem)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Sw(n.id),alt:n.description||"表情包",className:"w-full h-full object-cover",onError:h=>{const x=h.target;x.style.display="none";const f=x.parentElement;f&&(f.innerHTML='')}})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"ID"}),e.jsx("div",{className:"mt-1 font-mono",children:n.id})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"格式"}),e.jsx("div",{className:"mt-1",children:e.jsx(Qe,{variant:"outline",children:n.format.toUpperCase()})})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"文件路径"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.full_path})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"哈希值"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.emoji_hash})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"描述"}),n.description?e.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:e.jsx(pw,{className:"prose-sm",children:n.description})}):e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"情绪"}),e.jsx("div",{className:"mt-1",children:n.emotion?e.jsx("span",{className:"text-sm",children:n.emotion}):e.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"状态"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[n.is_registered&&e.jsx(Qe,{variant:"default",className:"bg-green-600",children:"已注册"}),n.is_banned&&e.jsx(Qe,{variant:"destructive",children:"已封禁"}),!n.is_registered&&!n.is_banned&&e.jsx(Qe,{variant:"outline",children:"未注册"})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"使用次数"}),e.jsx("div",{className:"mt-1 font-mono text-lg",children:n.usage_count})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"记录时间"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.record_time)})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"注册时间"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.register_time)})]})]}),e.jsxs("div",{children:[e.jsx(N,{className:"text-muted-foreground",children:"最后使用"}),e.jsx("div",{className:"mt-1 text-sm",children:d(n.last_used_time)})]})]})})]})})}function zw({emoji:n,open:r,onOpenChange:c,onSuccess:d}){const[h,x]=u.useState(""),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!1),{toast:T}=Rt();u.useEffect(()=>{n&&(x(n.emotion||""),j(n.is_registered),w(n.is_banned))},[n]);const E=async()=>{if(n)try{k(!0);const R=h.split(/[,,]/).map(F=>F.trim()).filter(Boolean).join(",");await vw(n.id,{emotion:R||void 0,is_registered:f,is_banned:p}),T({title:"成功",description:"表情包信息已更新"}),c(!1),d()}catch(R){const F=R instanceof Error?R.message:"保存失败";T({title:"错误",description:F,variant:"destructive"})}finally{k(!1)}};return n?e.jsx(Qt,{open:r,onOpenChange:c,children:e.jsxs(Ut,{className:"max-w-2xl",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"编辑表情包"}),e.jsx(ss,{children:"修改表情包的情绪和状态信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(N,{children:"情绪"}),e.jsx(Ot,{value:h,onChange:R=>x(R.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(bs,{id:"is_registered",checked:f,onCheckedChange:R=>{R===!0?(j(!0),w(!1)):j(!1)}}),e.jsx(N,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(bs,{id:"is_banned",checked:p,onCheckedChange:R=>{R===!0?(w(!0),j(!1)):w(!1)}}),e.jsx(N,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(b,{onClick:E,disabled:v,children:v?"保存中...":"保存"})]})]})}):null}function Aw({open:n,onOpenChange:r,onSuccess:c}){const[d,h]=u.useState("select"),[x,f]=u.useState([]),[j,p]=u.useState(null),[w,v]=u.useState(!1),{toast:k}=Rt(),T=u.useMemo(()=>new Wy({id:"emoji-uploader",autoProceed:!1,restrictions:{maxFileSize:10485760,allowedFileTypes:["image/jpeg","image/png","image/gif","image/webp"],maxNumberOfFiles:20},locale:{pluralize:()=>0,strings:{addMoreFiles:"添加更多文件",addingMoreFiles:"正在添加更多文件",allowedFileTypes:"允许的文件类型:%{types}",cancel:"取消",closeModal:"关闭",complete:"完成",connectedToInternet:"已连接到互联网",copyLink:"复制链接",copyLinkToClipboardFallback:"复制下方链接",copyLinkToClipboardSuccess:"链接已复制到剪贴板",dashboardTitle:"选择文件",dashboardWindowTitle:"文件选择窗口(按 ESC 关闭)",done:"完成",dropHereOr:"拖放文件到这里或 %{browse}",dropHint:"将文件拖放到此处",dropPasteFiles:"将文件拖放到这里或 %{browseFiles}",dropPasteFolders:"将文件拖放到这里或 %{browseFolders}",dropPasteBoth:"将文件拖放到这里,%{browseFiles} 或 %{browseFolders}",dropPasteImportFiles:"将文件拖放到这里,%{browseFiles} 或从以下位置导入:",dropPasteImportFolders:"将文件拖放到这里,%{browseFolders} 或从以下位置导入:",dropPasteImportBoth:"将文件拖放到这里,%{browseFiles},%{browseFolders} 或从以下位置导入:",editFile:"编辑文件",editing:"正在编辑 %{file}",emptyFolderAdded:"未从空文件夹添加文件",exceedsSize:"%{file} 超过了最大允许大小 %{size}",failedToUpload:"上传 %{file} 失败",fileSource:"文件来源:%{name}",filesUploadedOfTotal:{0:"已上传 %{complete} / %{smart_count} 个文件",1:"已上传 %{complete} / %{smart_count} 个文件"},filter:"筛选",finishEditingFile:"完成编辑文件",folderAdded:{0:"已从 %{folder} 添加 %{smart_count} 个文件",1:"已从 %{folder} 添加 %{smart_count} 个文件"},generatingThumbnails:"正在生成缩略图...",import:"导入",importFiles:"从以下位置导入文件:",importFrom:"从 %{name} 导入",loading:"加载中...",logOut:"登出",myDevice:"我的设备",noFilesFound:"这里没有文件或文件夹",noInternetConnection:"无网络连接",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",pauseUpload:"暂停上传",paused:"已暂停",poweredBy:"技术支持:%{uppy}",processingXFiles:{0:"正在处理 %{smart_count} 个文件",1:"正在处理 %{smart_count} 个文件"},recording:"录制中",removeFile:"移除文件",resetFilter:"重置筛选",resume:"继续",resumeUpload:"继续上传",retry:"重试",retryUpload:"重试上传",save:"保存",saveChanges:"保存更改",selectFileNamed:"选择文件 %{name}",selectX:{0:"选择 %{smart_count}",1:"选择 %{smart_count}"},smile:"笑一个!",startRecording:"开始录制视频",stopRecording:"停止录制视频",takePicture:"拍照",timedOut:"上传已停滞 %{seconds} 秒,正在中止。",upload:"下一步",uploadComplete:"上传完成",uploadFailed:"上传失败",uploadPaused:"上传已暂停",uploadXFiles:{0:"下一步(%{smart_count} 个文件)",1:"下一步(%{smart_count} 个文件)"},uploadXNewFiles:{0:"下一步(+%{smart_count} 个文件)",1:"下一步(+%{smart_count} 个文件)"},uploading:"正在上传",uploadingXFiles:{0:"正在上传 %{smart_count} 个文件",1:"正在上传 %{smart_count} 个文件"},xFilesSelected:{0:"已选择 %{smart_count} 个文件",1:"已选择 %{smart_count} 个文件"},xMoreFilesAdded:{0:"又添加了 %{smart_count} 个文件",1:"又添加了 %{smart_count} 个文件"},xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传:%{types}",youCanOnlyUploadX:{0:"您只能上传 %{smart_count} 个文件",1:"您只能上传 %{smart_count} 个文件"},youHaveToAtLeastSelectX:{0:"您至少需要选择 %{smart_count} 个文件",1:"您至少需要选择 %{smart_count} 个文件"},browseFiles:"浏览文件",browseFolders:"浏览文件夹",cancelUpload:"取消上传",addMore:"添加更多",back:"返回",editFileWithFilename:"编辑文件 %{file}"}}}),[]);u.useEffect(()=>{const X=()=>{const S=T.getFiles();if(S.length===0)return;const O=S.map(se=>({id:se.id,name:se.name,previewUrl:se.preview||URL.createObjectURL(se.data),emotion:"",description:"",isRegistered:!0,file:se.data}));f(O),S.length===1?(p(O[0].id),h("edit-single")):h("edit-multiple")};return T.on("upload",X),()=>{T.off("upload",X)}},[T]),u.useEffect(()=>{n||(T.cancelAll(),h("select"),f([]),p(null),v(!1))},[n,T]);const E=u.useCallback((X,S)=>{f(O=>O.map(se=>se.id===X?{...se,...S}:se))},[]),R=u.useCallback(X=>X.emotion.trim().length>0,[]),F=u.useMemo(()=>x.length>0&&x.every(R),[x,R]),U=u.useMemo(()=>x.find(X=>X.id===j)||null,[x,j]),M=u.useCallback(()=>{(d==="edit-single"||d==="edit-multiple")&&(h("select"),f([]),p(null))},[d]),Z=u.useCallback(async()=>{if(!F){k({title:"请填写必填项",description:"每个表情包的情感标签都是必填的",variant:"destructive"});return}v(!0);const X=localStorage.getItem("access-token")||"";let S=0,O=0;try{for(const se of x){const he=new FormData;he.append("file",se.file),he.append("emotion",se.emotion),he.append("description",se.description),he.append("is_registered",se.isRegistered.toString());try{(await fetch(kw(),{method:"POST",headers:{Authorization:`Bearer ${X}`},body:he})).ok?S++:O++}catch{O++}}O===0?(k({title:"上传成功",description:`成功上传 ${S} 个表情包`}),r(!1),c()):(k({title:"部分上传失败",description:`成功 ${S} 个,失败 ${O} 个`,variant:"destructive"}),c())}finally{v(!1)}},[F,x,k,r,c]),G=()=>e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"border rounded-lg overflow-hidden w-full",children:e.jsx(hw,{uppy:T,proudlyDisplayPoweredByUppy:!1,hideProgressDetails:!0,height:350,width:"100%",theme:"auto",note:"支持 JPG、PNG、GIF、WebP 格式,最多 20 个文件"})})}),z=()=>{const X=x[0];return X?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(b,{variant:"ghost",size:"sm",onClick:M,children:[e.jsx(Wn,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"编辑表情包信息"})]}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex-shrink-0",children:[e.jsx("div",{className:"w-32 h-32 rounded-lg border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:X.previewUrl,alt:X.name,className:"max-w-full max-h-full object-contain"})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2 text-center truncate max-w-32",children:X.name})]}),e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"single-emotion",children:["情感标签 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"single-emotion",value:X.emotion,onChange:S=>E(X.id,{emotion:S.target.value}),placeholder:"多个标签用逗号分隔,如:开心,高兴",className:X.emotion.trim()?"":"border-destructive"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于情感匹配,多个标签用逗号分隔"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"single-description",children:"描述"}),e.jsx(ce,{id:"single-description",value:X.description,onChange:S=>E(X.id,{description:S.target.value}),placeholder:"输入表情包描述..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(bs,{id:"single-is-registered",checked:X.isRegistered,onCheckedChange:S=>E(X.id,{isRegistered:S===!0})}),e.jsx(N,{htmlFor:"single-is-registered",className:"cursor-pointer",children:"上传后立即注册(可被麦麦使用)"})]})]})]}),e.jsx(os,{children:e.jsx(b,{onClick:Z,disabled:!F||w,children:w?"上传中...":"上传"})})]}):null},B=()=>{const X=x.filter(R).length,S=x.length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(b,{variant:"ghost",size:"sm",onClick:M,children:[e.jsx(Wn,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["编辑表情包信息(",X,"/",S," 已完成)"]})]}),e.jsx(Qe,{variant:F?"default":"secondary",children:F?e.jsxs(e.Fragment,{children:[e.jsx(ga,{className:"h-3 w-3 mr-1"}),"全部完成"]}):e.jsxs(e.Fragment,{children:[e.jsx(si,{className:"h-3 w-3 mr-1"}),"未完成"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ie,{className:"h-[350px] pr-2",children:e.jsx("div",{className:"space-y-2",children:x.map(O=>{const se=R(O),he=j===O.id;return e.jsxs("div",{onClick:()=>p(O.id),className:` + flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-all + ${he?"ring-2 ring-primary":""} + ${se?"border-green-500 bg-green-50 dark:bg-green-950/20":"border-border hover:border-muted-foreground/50"} + `,children:[e.jsx("div",{className:"w-12 h-12 rounded border overflow-hidden bg-muted flex-shrink-0 flex items-center justify-center",children:e.jsx("img",{src:O.previewUrl,alt:O.name,className:"max-w-full max-h-full object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:O.emotion||"未填写情感标签"})]}),se?e.jsx(oa,{className:"h-5 w-5 text-green-500 flex-shrink-0"}):e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-muted-foreground/30 flex-shrink-0"})]},O.id)})})}),e.jsx("div",{className:"border rounded-lg p-4",children:U?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-16 h-16 rounded border overflow-hidden bg-muted flex items-center justify-center",children:e.jsx("img",{src:U.previewUrl,alt:U.name,className:"max-w-full max-h-full object-contain"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:U.name}),R(U)&&e.jsxs(Qe,{variant:"outline",className:"text-green-600 border-green-600",children:[e.jsx(ga,{className:"h-3 w-3 mr-1"}),"已完成"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"multi-emotion",children:["情感标签 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"multi-emotion",value:U.emotion,onChange:O=>E(U.id,{emotion:O.target.value}),placeholder:"多个标签用逗号分隔,如:开心,高兴",className:U.emotion.trim()?"":"border-destructive"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"multi-description",children:"描述"}),e.jsx(ce,{id:"multi-description",value:U.description,onChange:O=>E(U.id,{description:O.target.value}),placeholder:"输入表情包描述..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(bs,{id:"multi-is-registered",checked:U.isRegistered,onCheckedChange:O=>E(U.id,{isRegistered:O===!0})}),e.jsx(N,{htmlFor:"multi-is-registered",className:"cursor-pointer text-sm",children:"上传后立即注册"})]})]}):e.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ag,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"点击左侧卡片编辑"})]})})})]}),e.jsx(os,{children:e.jsx(b,{onClick:Z,disabled:!F||w,children:w?"上传中...":`上传全部 (${S})`})})]})};return e.jsx(Qt,{open:n,onOpenChange:r,children:e.jsxs(Ut,{className:"max-w-3xl max-h-[90vh] overflow-hidden",children:[e.jsxs(Bt,{children:[e.jsxs(Ht,{className:"flex items-center gap-2",children:[e.jsx(cr,{className:"h-5 w-5"}),d==="select"&&"上传表情包 - 选择文件",d==="edit-single"&&"上传表情包 - 填写信息",d==="edit-multiple"&&"上传表情包 - 批量编辑"]}),e.jsxs(ss,{children:[d==="select"&&"支持 JPG、PNG、GIF、WebP 格式,单个文件最大 10MB,可同时上传多个文件",d==="edit-single"&&"请填写表情包的情感标签(必填)和描述",d==="edit-multiple"&&"点击左侧卡片编辑每个表情包的信息,情感标签为必填项"]})]}),e.jsxs("div",{className:"overflow-y-auto pr-1",children:[d==="select"&&G(),d==="edit-single"&&z(),d==="edit-multiple"&&B()]})]})})}const Ll="/api/webui/expression";async function Mw(){const n=await ke(`${Ll}/chats`,{});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取聊天列表失败")}return n.json()}async function Dw(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.chat_id&&r.append("chat_id",n.chat_id);const c=await ke(`${Ll}/list?${r}`,{});if(!c.ok){const d=await c.json();throw new Error(d.detail||"获取表达方式列表失败")}return c.json()}async function Ow(n){const r=await ke(`${Ll}/${n}`,{});if(!r.ok){const c=await r.json();throw new Error(c.detail||"获取表达方式详情失败")}return r.json()}async function Rw(n){const r=await ke(`${Ll}/`,{method:"POST",body:JSON.stringify(n)});if(!r.ok){const c=await r.json();throw new Error(c.detail||"创建表达方式失败")}return r.json()}async function Lw(n,r){const c=await ke(`${Ll}/${n}`,{method:"PATCH",body:JSON.stringify(r)});if(!c.ok){const d=await c.json();throw new Error(d.detail||"更新表达方式失败")}return c.json()}async function Uw(n){const r=await ke(`${Ll}/${n}`,{method:"DELETE"});if(!r.ok){const c=await r.json();throw new Error(c.detail||"删除表达方式失败")}return r.json()}async function Bw(n){const r=await ke(`${Ll}/batch/delete`,{method:"POST",body:JSON.stringify({ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除表达方式失败")}return r.json()}async function Hw(){const n=await ke(`${Ll}/stats/summary`,{});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取统计数据失败")}return n.json()}function qw(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(0),[f,j]=u.useState(1),[p,w]=u.useState(20),[v,k]=u.useState(""),[T,E]=u.useState(null),[R,F]=u.useState(!1),[U,M]=u.useState(!1),[Z,G]=u.useState(!1),[z,B]=u.useState(null),[X,S]=u.useState(new Set),[O,se]=u.useState(!1),[he,ye]=u.useState(""),[be,pe]=u.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[je,_e]=u.useState([]),[y,q]=u.useState(new Map),{toast:H}=Rt(),ie=async()=>{try{d(!0);const ee=await Dw({page:f,page_size:p,search:v||void 0});r(ee.data),x(ee.total)}catch(ee){H({title:"加载失败",description:ee instanceof Error?ee.message:"无法加载表达方式",variant:"destructive"})}finally{d(!1)}},_=async()=>{try{const ee=await Hw();ee?.data&&pe(ee.data)}catch(ee){console.error("加载统计数据失败:",ee)}},me=async()=>{try{const ee=await Mw();if(ee?.data){_e(ee.data);const Ne=new Map;ee.data.forEach(ze=>{Ne.set(ze.chat_id,ze.chat_name)}),q(Ne)}}catch(ee){console.error("加载聊天列表失败:",ee)}},xe=ee=>y.get(ee)||ee;u.useEffect(()=>{ie(),_(),me()},[f,p,v]);const Q=async ee=>{try{const Ne=await Ow(ee.id);E(Ne.data),F(!0)}catch(Ne){H({title:"加载详情失败",description:Ne instanceof Error?Ne.message:"无法加载表达方式详情",variant:"destructive"})}},de=ee=>{E(ee),M(!0)},ge=async ee=>{try{await Uw(ee.id),H({title:"删除成功",description:`已删除表达方式: ${ee.situation}`}),B(null),ie(),_()}catch(Ne){H({title:"删除失败",description:Ne instanceof Error?Ne.message:"无法删除表达方式",variant:"destructive"})}},le=ee=>{const Ne=new Set(X);Ne.has(ee)?Ne.delete(ee):Ne.add(ee),S(Ne)},L=()=>{X.size===n.length&&n.length>0?S(new Set):S(new Set(n.map(ee=>ee.id)))},$=async()=>{try{await Bw(Array.from(X)),H({title:"批量删除成功",description:`已删除 ${X.size} 个表达方式`}),S(new Set),se(!1),ie(),_()}catch(ee){H({title:"批量删除失败",description:ee instanceof Error?ee.message:"无法批量删除表达方式",variant:"destructive"})}},D=()=>{const ee=parseInt(he),Ne=Math.ceil(h/p);ee>=1&&ee<=Ne?(j(ee),ye("")):H({title:"无效的页码",description:`请输入1-${Ne}之间的页码`,variant:"destructive"})};return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(Pn,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),e.jsxs(b,{onClick:()=>G(!0),className:"gap-2",children:[e.jsx(cs,{className:"h-4 w-4"}),"新增表达方式"]})]})}),e.jsx(Ie,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:be.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:be.recent_7days})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:be.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx(N,{htmlFor:"search",children:"搜索"}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Os,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{id:"search",placeholder:"搜索情境、风格或上下文...",value:v,onChange:ee=>k(ee.target.value),className:"pl-9"})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:X.size>0&&e.jsxs("span",{children:["已选择 ",X.size," 个表达方式"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Be,{value:p.toString(),onValueChange:ee=>{w(parseInt(ee)),j(1),S(new Set)},children:[e.jsx(Re,{id:"page-size",className:"w-20",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),X.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>S(new Set),children:"取消选择"}),e.jsxs(b,{variant:"destructive",size:"sm",onClick:()=>se(!0),children:[e.jsx(Pe,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ai,{children:[e.jsx(li,{children:e.jsxs(gs,{children:[e.jsx(at,{className:"w-12",children:e.jsx(bs,{checked:X.size===n.length&&n.length>0,onCheckedChange:L})}),e.jsx(at,{children:"情境"}),e.jsx(at,{children:"风格"}),e.jsx(at,{children:"聊天"}),e.jsx(at,{className:"text-right",children:"操作"})]})}),e.jsx(ni,{children:c?e.jsx(gs,{children:e.jsx($e,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?e.jsx(gs,{children:e.jsx($e,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(ee=>e.jsxs(gs,{children:[e.jsx($e,{children:e.jsx(bs,{checked:X.has(ee.id),onCheckedChange:()=>le(ee.id)})}),e.jsx($e,{className:"font-medium max-w-xs truncate",children:ee.situation}),e.jsx($e,{className:"max-w-xs truncate",children:ee.style}),e.jsx($e,{className:"max-w-[200px] truncate",title:xe(ee.chat_id),style:{wordBreak:"keep-all"},children:e.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:xe(ee.chat_id)})}),e.jsx($e,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(b,{variant:"default",size:"sm",onClick:()=>de(ee),children:[e.jsx(dr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(b,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>Q(ee),title:"查看详情",children:e.jsx(Ys,{className:"h-4 w-4"})}),e.jsxs(b,{size:"sm",onClick:()=>B(ee),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(Pe,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ee.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:c?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(ee=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(bs,{checked:X.has(ee.id),onCheckedChange:()=>le(ee.id),className:"mt-1"}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:ee.situation,children:ee.situation})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),e.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:ee.style,children:ee.style})]})]})]}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),e.jsx("p",{className:"text-sm truncate",title:xe(ee.chat_id),style:{wordBreak:"keep-all"},children:xe(ee.chat_id)})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>de(ee),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(dr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>Q(ee),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:e.jsx(Ys,{className:"h-3 w-3"})}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>B(ee),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(Pe,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ee.id))}),h>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",h," 条记录,第 ",f," / ",Math.ceil(h/p)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(gr,{className:"h-4 w-4"})}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>j(f-1),disabled:f===1,children:[e.jsx(nn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:he,onChange:ee=>ye(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&D(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(h/p)}),e.jsx(b,{variant:"outline",size:"sm",onClick:D,disabled:!he,className:"h-8",children:"跳转"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>j(f+1),disabled:f>=Math.ceil(h/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Ol,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(h/p)),disabled:f>=Math.ceil(h/p),className:"hidden sm:flex",children:e.jsx(jr,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(Gw,{expression:T,open:R,onOpenChange:F,chatNameMap:y}),e.jsx(Vw,{open:Z,onOpenChange:G,chatList:je,onSuccess:()=>{ie(),_(),G(!1)}}),e.jsx(Fw,{expression:T,open:U,onOpenChange:M,chatList:je,onSuccess:()=>{ie(),_(),M(!1)}}),e.jsx(ft,{open:!!z,onOpenChange:()=>B(null),children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除表达方式 "',z?.situation,'" 吗? 此操作不可撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>z&&ge(z),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx($w,{open:O,onOpenChange:se,onConfirm:$,count:X.size})]})}function Gw({expression:n,open:r,onOpenChange:c,chatNameMap:d}){if(!n)return null;const h=f=>f?new Date(f*1e3).toLocaleString("zh-CN"):"-",x=f=>d.get(f)||f;return e.jsx(Qt,{open:r,onOpenChange:c,children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"表达方式详情"}),e.jsx(ss,{children:"查看表达方式的完整信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(sr,{label:"情境",value:n.situation}),e.jsx(sr,{label:"风格",value:n.style}),e.jsx(sr,{label:"聊天",value:x(n.chat_id)}),e.jsx(sr,{icon:Eu,label:"记录ID",value:n.id.toString(),mono:!0})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsx(sr,{icon:Jn,label:"创建时间",value:h(n.create_date)})})]}),e.jsx(os,{children:e.jsx(b,{onClick:()=>c(!1),children:"关闭"})})]})})}function sr({icon:n,label:r,value:c,mono:d=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(N,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&e.jsx(n,{className:"h-3 w-3"}),r]}),e.jsx("div",{className:K("text-sm",d&&"font-mono",!c&&"text-muted-foreground"),children:c||"-"})]})}function Vw({open:n,onOpenChange:r,chatList:c,onSuccess:d}){const[h,x]=u.useState({situation:"",style:"",chat_id:""}),[f,j]=u.useState(!1),{toast:p}=Rt(),w=async()=>{if(!h.situation||!h.style||!h.chat_id){p({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{j(!0),await Rw(h),p({title:"创建成功",description:"表达方式已创建"}),x({situation:"",style:"",chat_id:""}),d()}catch(v){p({title:"创建失败",description:v instanceof Error?v.message:"无法创建表达方式",variant:"destructive"})}finally{j(!1)}};return e.jsx(Qt,{open:n,onOpenChange:r,children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"新增表达方式"}),e.jsx(ss,{children:"创建新的表达方式记录"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"situation",children:["情境 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"situation",value:h.situation,onChange:v=>x({...h,situation:v.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"style",children:["风格 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ce,{id:"style",value:h.style,onChange:v=>x({...h,style:v.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(N,{htmlFor:"chat_id",children:["聊天 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Be,{value:h.chat_id,onValueChange:v=>x({...h,chat_id:v}),children:[e.jsx(Re,{children:e.jsx(He,{placeholder:"选择关联的聊天"})}),e.jsx(Le,{children:c.map(v=>e.jsx(ne,{value:v.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[v.chat_name,v.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},v.chat_id))})]})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>r(!1),children:"取消"}),e.jsx(b,{onClick:w,disabled:f,children:f?"创建中...":"创建"})]})]})})}function Fw({expression:n,open:r,onOpenChange:c,chatList:d,onSuccess:h}){const[x,f]=u.useState({}),[j,p]=u.useState(!1),{toast:w}=Rt();u.useEffect(()=>{n&&f({situation:n.situation,style:n.style,chat_id:n.chat_id})},[n]);const v=async()=>{if(n)try{p(!0),await Lw(n.id,x),w({title:"保存成功",description:"表达方式已更新"}),h()}catch(k){w({title:"保存失败",description:k instanceof Error?k.message:"无法更新表达方式",variant:"destructive"})}finally{p(!1)}};return n?e.jsx(Qt,{open:r,onOpenChange:c,children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"编辑表达方式"}),e.jsx(ss,{children:"修改表达方式的信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit_situation",children:"情境"}),e.jsx(ce,{id:"edit_situation",value:x.situation||"",onChange:k=>f({...x,situation:k.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit_style",children:"风格"}),e.jsx(ce,{id:"edit_style",value:x.style||"",onChange:k=>f({...x,style:k.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit_chat_id",children:"聊天"}),e.jsxs(Be,{value:x.chat_id||"",onValueChange:k=>f({...x,chat_id:k}),children:[e.jsx(Re,{children:e.jsx(He,{placeholder:"选择关联的聊天"})}),e.jsx(Le,{children:d.map(k=>e.jsx(ne,{value:k.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[k.chat_name,k.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},k.chat_id))})]})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(b,{onClick:v,disabled:j,children:j?"保存中...":"保存"})]})]})}):null}function $w({open:n,onOpenChange:r,onConfirm:c,count:d}){return e.jsx(ft,{open:n,onOpenChange:r,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认批量删除"}),e.jsxs(dt,{children:["您即将删除 ",d," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const ii="/api/webui/person";async function Qw(n){const r=new URLSearchParams;n.page&&r.append("page",n.page.toString()),n.page_size&&r.append("page_size",n.page_size.toString()),n.search&&r.append("search",n.search),n.is_known!==void 0&&r.append("is_known",n.is_known.toString()),n.platform&&r.append("platform",n.platform);const c=await ke(`${ii}/list?${r}`,{headers:Tt()});if(!c.ok){const d=await c.json();throw new Error(d.detail||"获取人物列表失败")}return c.json()}async function Yw(n){const r=await ke(`${ii}/${n}`,{headers:Tt()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"获取人物详情失败")}return r.json()}async function Xw(n,r){const c=await ke(`${ii}/${n}`,{method:"PATCH",headers:Tt(),body:JSON.stringify(r)});if(!c.ok){const d=await c.json();throw new Error(d.detail||"更新人物信息失败")}return c.json()}async function Kw(n){const r=await ke(`${ii}/${n}`,{method:"DELETE",headers:Tt()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"删除人物信息失败")}return r.json()}async function Zw(){const n=await ke(`${ii}/stats/summary`,{headers:Tt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取统计数据失败")}return n.json()}async function Jw(n){const r=await ke(`${ii}/batch/delete`,{method:"POST",headers:Tt(),body:JSON.stringify({person_ids:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"批量删除失败")}return r.json()}function Iw(){const[n,r]=u.useState([]),[c,d]=u.useState(!0),[h,x]=u.useState(0),[f,j]=u.useState(1),[p,w]=u.useState(20),[v,k]=u.useState(""),[T,E]=u.useState(void 0),[R,F]=u.useState(void 0),[U,M]=u.useState(null),[Z,G]=u.useState(!1),[z,B]=u.useState(!1),[X,S]=u.useState(null),[O,se]=u.useState({total:0,known:0,unknown:0,platforms:{}}),[he,ye]=u.useState(new Set),[be,pe]=u.useState(!1),[je,_e]=u.useState(""),{toast:y}=Rt(),q=async()=>{try{d(!0);const D=await Qw({page:f,page_size:p,search:v||void 0,is_known:T,platform:R});r(D.data),x(D.total)}catch(D){y({title:"加载失败",description:D instanceof Error?D.message:"无法加载人物信息",variant:"destructive"})}finally{d(!1)}},H=async()=>{try{const D=await Zw();D?.data&&se(D.data)}catch(D){console.error("加载统计数据失败:",D)}};u.useEffect(()=>{q(),H()},[f,p,v,T,R]);const ie=async D=>{try{const ee=await Yw(D.person_id);M(ee.data),G(!0)}catch(ee){y({title:"加载详情失败",description:ee instanceof Error?ee.message:"无法加载人物详情",variant:"destructive"})}},_=D=>{M(D),B(!0)},me=async D=>{try{await Kw(D.person_id),y({title:"删除成功",description:`已删除人物信息: ${D.person_name||D.nickname||D.user_id}`}),S(null),q(),H()}catch(ee){y({title:"删除失败",description:ee instanceof Error?ee.message:"无法删除人物信息",variant:"destructive"})}},xe=u.useMemo(()=>Object.keys(O.platforms),[O.platforms]),Q=D=>{const ee=new Set(he);ee.has(D)?ee.delete(D):ee.add(D),ye(ee)},de=()=>{he.size===n.length&&n.length>0?ye(new Set):ye(new Set(n.map(D=>D.person_id)))},ge=()=>{if(he.size===0){y({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}pe(!0)},le=async()=>{try{const D=await Jw(Array.from(he));y({title:"批量删除完成",description:D.message}),ye(new Set),pe(!1),q(),H()}catch(D){y({title:"批量删除失败",description:D instanceof Error?D.message:"批量删除失败",variant:"destructive"})}},L=()=>{const D=parseInt(je),ee=Math.ceil(h/p);D>=1&&D<=ee?(j(D),_e("")):y({title:"无效的页码",description:`请输入1-${ee}之间的页码`,variant:"destructive"})},$=D=>D?new Date(D*1e3).toLocaleString("zh-CN"):"-";return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(vy,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),e.jsx(Ie,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:O.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:O.known})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:O.unknown})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(N,{htmlFor:"search",children:"搜索"}),e.jsxs("div",{className:"relative mt-1.5",children:[e.jsx(Os,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:v,onChange:D=>k(D.target.value),className:"pl-9"})]})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"filter-known",children:"认识状态"}),e.jsxs(Be,{value:T===void 0?"all":T.toString(),onValueChange:D=>{E(D==="all"?void 0:D==="true"),j(1)},children:[e.jsx(Re,{id:"filter-known",className:"mt-1.5",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部"}),e.jsx(ne,{value:"true",children:"已认识"}),e.jsx(ne,{value:"false",children:"未认识"})]})]})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"filter-platform",children:"平台"}),e.jsxs(Be,{value:R||"all",onValueChange:D=>{F(D==="all"?void 0:D),j(1)},children:[e.jsx(Re,{id:"filter-platform",className:"mt-1.5",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部平台"}),xe.map(D=>e.jsxs(ne,{value:D,children:[D," (",O.platforms[D],")"]},D))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:he.size>0&&e.jsxs("span",{children:["已选择 ",he.size," 个人物"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(Be,{value:p.toString(),onValueChange:D=>{w(parseInt(D)),j(1),ye(new Set)},children:[e.jsx(Re,{id:"page-size",className:"w-20",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"10",children:"10"}),e.jsx(ne,{value:"20",children:"20"}),e.jsx(ne,{value:"50",children:"50"}),e.jsx(ne,{value:"100",children:"100"})]})]}),he.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>ye(new Set),children:"取消选择"}),e.jsxs(b,{variant:"destructive",size:"sm",onClick:ge,children:[e.jsx(Pe,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ai,{children:[e.jsx(li,{children:e.jsxs(gs,{children:[e.jsx(at,{className:"w-12",children:e.jsx(bs,{checked:n.length>0&&he.size===n.length,onCheckedChange:de,"aria-label":"全选"})}),e.jsx(at,{children:"状态"}),e.jsx(at,{children:"名称"}),e.jsx(at,{children:"昵称"}),e.jsx(at,{children:"平台"}),e.jsx(at,{children:"用户ID"}),e.jsx(at,{children:"最后更新"}),e.jsx(at,{className:"text-right",children:"操作"})]})}),e.jsx(ni,{children:c?e.jsx(gs,{children:e.jsx($e,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?e.jsx(gs,{children:e.jsx($e,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(D=>e.jsxs(gs,{children:[e.jsx($e,{children:e.jsx(bs,{checked:he.has(D.person_id),onCheckedChange:()=>Q(D.person_id),"aria-label":`选择 ${D.person_name||D.nickname||D.user_id}`})}),e.jsx($e,{children:e.jsx("div",{className:K("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",D.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:D.is_known?"已认识":"未认识"})}),e.jsx($e,{className:"font-medium",children:D.person_name||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx($e,{children:D.nickname||"-"}),e.jsx($e,{children:D.platform}),e.jsx($e,{className:"font-mono text-sm",children:D.user_id}),e.jsx($e,{className:"text-sm text-muted-foreground",children:$(D.last_know)}),e.jsx($e,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(b,{variant:"default",size:"sm",onClick:()=>ie(D),children:[e.jsx(Ys,{className:"h-4 w-4 mr-1"}),"详情"]}),e.jsxs(b,{variant:"default",size:"sm",onClick:()=>_(D),children:[e.jsx(dr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsxs(b,{size:"sm",onClick:()=>S(D),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(Pe,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},D.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:c?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(D=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(bs,{checked:he.has(D.person_id),onCheckedChange:()=>Q(D.person_id),className:"mt-1"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:K("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",D.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:D.is_known?"已认识":"未认识"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:D.person_name||e.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),D.nickname&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",D.nickname]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),e.jsx("p",{className:"font-medium text-xs",children:D.platform})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),e.jsx("p",{className:"font-mono text-xs truncate",title:D.user_id,children:D.user_id})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),e.jsx("p",{className:"text-xs",children:$(D.last_know)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>ie(D),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Ys,{className:"h-3 w-3 mr-1"}),"查看"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>_(D),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(dr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>S(D),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(Pe,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},D.id))}),h>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",h," 条记录,第 ",f," / ",Math.ceil(h/p)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(1),disabled:f===1,className:"hidden sm:flex",children:e.jsx(gr,{className:"h-4 w-4"})}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>j(f-1),disabled:f===1,children:[e.jsx(nn,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{type:"number",value:je,onChange:D=>_e(D.target.value),onKeyDown:D=>D.key==="Enter"&&L(),placeholder:f.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(h/p)}),e.jsx(b,{variant:"outline",size:"sm",onClick:L,disabled:!je,className:"h-8",children:"跳转"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>j(f+1),disabled:f>=Math.ceil(h/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Ol,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>j(Math.ceil(h/p)),disabled:f>=Math.ceil(h/p),className:"hidden sm:flex",children:e.jsx(jr,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(Pw,{person:U,open:Z,onOpenChange:G}),e.jsx(Ww,{person:U,open:z,onOpenChange:B,onSuccess:()=>{q(),H(),B(!1)}}),e.jsx(ft,{open:!!X,onOpenChange:()=>S(null),children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认删除"}),e.jsxs(dt,{children:['确定要删除人物信息 "',X?.person_name||X?.nickname||X?.user_id,'" 吗? 此操作不可撤销。']})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:()=>X&&me(X),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(ft,{open:be,onOpenChange:pe,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"确认批量删除"}),e.jsxs(dt,{children:["确定要删除选中的 ",he.size," 个人物信息吗? 此操作不可撤销。"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{children:"取消"}),e.jsx(ut,{onClick:le,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function Pw({person:n,open:r,onOpenChange:c}){if(!n)return null;const d=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Qt,{open:r,onOpenChange:c,children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"人物详情"}),e.jsxs(ss,{children:["查看 ",n.person_name||n.nickname||n.user_id," 的完整信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(el,{icon:Ic,label:"人物名称",value:n.person_name}),e.jsx(el,{icon:Pn,label:"昵称",value:n.nickname}),e.jsx(el,{icon:Eu,label:"用户ID",value:n.user_id,mono:!0}),e.jsx(el,{icon:Eu,label:"人物ID",value:n.person_id,mono:!0}),e.jsx(el,{label:"平台",value:n.platform}),e.jsx(el,{label:"状态",value:n.is_known?"已认识":"未认识"})]}),n.name_reason&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(N,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),e.jsx("p",{className:"mt-1 text-sm",children:n.name_reason})]}),n.memory_points&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(N,{className:"text-xs text-muted-foreground",children:"个人印象"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:n.memory_points})]}),n.group_nick_name&&n.group_nick_name.length>0&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(N,{className:"text-xs text-muted-foreground",children:"群昵称"}),e.jsx("div",{className:"mt-2 space-y-1",children:n.group_nick_name.map((h,x)=>e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h.group_id}),e.jsx("span",{children:"→"}),e.jsx("span",{children:h.group_nick_name})]},x))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(el,{icon:Jn,label:"认识时间",value:d(n.know_times)}),e.jsx(el,{icon:Jn,label:"首次记录",value:d(n.know_since)}),e.jsx(el,{icon:Jn,label:"最后更新",value:d(n.last_know)})]})]}),e.jsx(os,{children:e.jsx(b,{onClick:()=>c(!1),children:"关闭"})})]})})}function el({icon:n,label:r,value:c,mono:d=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(N,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&e.jsx(n,{className:"h-3 w-3"}),r]}),e.jsx("div",{className:K("text-sm",d&&"font-mono",!c&&"text-muted-foreground"),children:c||"-"})]})}function Ww({person:n,open:r,onOpenChange:c,onSuccess:d}){const[h,x]=u.useState({}),[f,j]=u.useState(!1),{toast:p}=Rt();u.useEffect(()=>{n&&x({person_name:n.person_name||"",name_reason:n.name_reason||"",nickname:n.nickname||"",memory_points:n.memory_points||"",is_known:n.is_known})},[n]);const w=async()=>{if(n)try{j(!0),await Xw(n.person_id,h),p({title:"保存成功",description:"人物信息已更新"}),d()}catch(v){p({title:"保存失败",description:v instanceof Error?v.message:"无法更新人物信息",variant:"destructive"})}finally{j(!1)}};return n?e.jsx(Qt,{open:r,onOpenChange:c,children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"编辑人物信息"}),e.jsxs(ss,{children:["修改 ",n.person_name||n.nickname||n.user_id," 的信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"person_name",children:"人物名称"}),e.jsx(ce,{id:"person_name",value:h.person_name||"",onChange:v=>x({...h,person_name:v.target.value}),placeholder:"为这个人设置一个名称"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"nickname",children:"昵称"}),e.jsx(ce,{id:"nickname",value:h.nickname||"",onChange:v=>x({...h,nickname:v.target.value}),placeholder:"昵称"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"name_reason",children:"名称设定原因"}),e.jsx(Ot,{id:"name_reason",value:h.name_reason||"",onChange:v=>x({...h,name_reason:v.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"memory_points",children:"个人印象"}),e.jsx(Ot,{id:"memory_points",value:h.memory_points||"",onChange:v=>x({...h,memory_points:v.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx(N,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),e.jsx(Ge,{id:"is_known",checked:h.is_known,onCheckedChange:v=>x({...h,is_known:v})})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>c(!1),children:"取消"}),e.jsx(b,{onClick:w,disabled:f,children:f?"保存中...":"保存"})]})]})}):null}var e1=lN();const cp=nb(e1),Yu="/api/webui";async function t1(n=100,r="all"){const c=`${Yu}/knowledge/graph?limit=${n}&node_type=${r}`,d=await fetch(c);if(!d.ok)throw new Error(`获取知识图谱失败: ${d.status}`);return d.json()}async function s1(){const n=await fetch(`${Yu}/knowledge/stats`);if(!n.ok)throw new Error("获取知识图谱统计信息失败");return n.json()}async function a1(n){const r=await fetch(`${Yu}/knowledge/search?query=${encodeURIComponent(n)}`);if(!r.ok)throw new Error("搜索知识节点失败");return r.json()}const Tg=u.memo(({data:n})=>e.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[e.jsx(Pc,{type:"target",position:Wc.Top}),e.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:n.content,children:n.label}),e.jsx(Pc,{type:"source",position:Wc.Bottom})]}));Tg.displayName="EntityNode";const Eg=u.memo(({data:n})=>e.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[e.jsx(Pc,{type:"target",position:Wc.Top}),e.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:n.content,children:n.label}),e.jsx(Pc,{type:"source",position:Wc.Bottom})]}));Eg.displayName="ParagraphNode";const l1={entity:Tg,paragraph:Eg};function n1(n,r){const c=new cp.graphlib.Graph;c.setDefaultEdgeLabel(()=>({})),c.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const d=[],h=[];return n.forEach(x=>{c.setNode(x.id,{width:150,height:50})}),r.forEach(x=>{c.setEdge(x.source,x.target)}),cp.layout(c),n.forEach(x=>{const f=c.node(x.id);d.push({id:x.id,type:x.type,position:{x:f.x-75,y:f.y-25},data:{label:x.content.slice(0,20)+(x.content.length>20?"...":""),content:x.content}})}),r.forEach((x,f)=>{const j={id:`edge-${f}`,source:x.source,target:x.target,animated:n.length<=200&&x.weight>5,style:{strokeWidth:Math.min(x.weight/2,5),opacity:.6}};x.weight>10&&n.length<100&&(j.label=`${x.weight.toFixed(0)}`),h.push(j)}),{nodes:d,edges:h}}function i1(){const n=ua(),[r,c]=u.useState(!1),[d,h]=u.useState(null),[x,f]=u.useState(""),[j,p]=u.useState("all"),[w,v]=u.useState(50),[k,T]=u.useState("50"),[E,R]=u.useState(!1),[F,U]=u.useState(!0),[M,Z]=u.useState(!1),[G,z]=u.useState(!1),[B,X,S]=nN([]),[O,se,he]=iN([]),[ye,be]=u.useState(0),[pe,je]=u.useState(null),[_e,y]=u.useState(null),{toast:q}=Rt(),H=u.useCallback(le=>le.type==="entity"?"#6366f1":le.type==="paragraph"?"#10b981":"#6b7280",[]),ie=u.useCallback(async(le=!1)=>{try{if(!le&&w>200){z(!0);return}c(!0);const[L,$]=await Promise.all([t1(w,j),s1()]);if(h($),L.nodes.length===0){q({title:"提示",description:"知识库为空,请先导入知识数据"}),X([]),se([]);return}const{nodes:D,edges:ee}=n1(L.nodes,L.edges);X(D),se(ee),be(D.length),$&&$.total_nodes>w&&q({title:"提示",description:`知识图谱包含 ${$.total_nodes} 个节点,当前显示 ${D.length} 个`}),q({title:"加载成功",description:`已加载 ${D.length} 个节点,${ee.length} 条边`})}catch(L){console.error("加载知识图谱失败:",L),q({title:"加载失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}finally{c(!1)}},[w,j,q]),_=u.useCallback(async()=>{if(!x.trim()){q({title:"提示",description:"请输入搜索关键词"});return}try{const le=await a1(x);if(le.length===0){q({title:"未找到",description:"没有找到匹配的节点"});return}const L=new Set(le.map($=>$.id));X($=>$.map(D=>({...D,style:{...D.style,opacity:L.has(D.id)?1:.3,filter:L.has(D.id)?"brightness(1.2)":"brightness(0.8)"}}))),q({title:"搜索完成",description:`找到 ${le.length} 个匹配节点`})}catch(le){console.error("搜索失败:",le),q({title:"搜索失败",description:le instanceof Error?le.message:"未知错误",variant:"destructive"})}},[x,q]),me=u.useCallback(()=>{X(le=>le.map(L=>({...L,style:{...L.style,opacity:1,filter:"brightness(1)"}})))},[]),xe=u.useCallback(()=>{U(!1),Z(!0),ie()},[ie]),Q=u.useCallback(()=>{z(!1),setTimeout(()=>{ie(!0)},0)},[ie]),de=u.useCallback((le,L)=>{B.find(D=>D.id===L.id)&&je({id:L.id,type:L.type,content:L.data.content})},[B]);u.useEffect(()=>{F||M&&ie()},[w,j,F,M]);const ge=u.useCallback((le,L)=>{const $=B.find(Ne=>Ne.id===L.source),D=B.find(Ne=>Ne.id===L.target),ee=O.find(Ne=>Ne.id===L.id);$&&D&&ee&&y({source:{id:$.id,type:$.type,content:$.data.content},target:{id:D.id,type:D.type,content:D.data.content},edge:{source:L.source,target:L.target,weight:parseFloat(L.label||"0")}})},[B,O]);return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),d&&e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(Qe,{variant:"outline",className:"gap-1",children:[e.jsx(Zc,{className:"h-3 w-3"}),"节点: ",d.total_nodes]}),e.jsxs(Qe,{variant:"outline",className:"gap-1",children:[e.jsx(lg,{className:"h-3 w-3"}),"边: ",d.total_edges]}),e.jsxs(Qe,{variant:"outline",className:"gap-1",children:[e.jsx(za,{className:"h-3 w-3"}),"实体: ",d.entity_nodes]}),e.jsxs(Qe,{variant:"outline",className:"gap-1",children:[e.jsx(Ta,{className:"h-3 w-3"}),"段落: ",d.paragraph_nodes]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[e.jsxs("div",{className:"flex-1 flex gap-2",children:[e.jsx(ce,{placeholder:"搜索节点内容...",value:x,onChange:le=>f(le.target.value),onKeyDown:le=>le.key==="Enter"&&_(),className:"flex-1"}),e.jsx(b,{onClick:_,size:"sm",children:e.jsx(Os,{className:"h-4 w-4"})}),e.jsx(b,{onClick:me,variant:"outline",size:"sm",children:"重置"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Be,{value:j,onValueChange:le=>p(le),children:[e.jsx(Re,{className:"w-[120px]",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部节点"}),e.jsx(ne,{value:"entity",children:"仅实体"}),e.jsx(ne,{value:"paragraph",children:"仅段落"})]})]}),e.jsxs(Be,{value:w===1e4?"all":E?"custom":w.toString(),onValueChange:le=>{le==="custom"?(R(!0),T(w.toString())):le==="all"?(R(!1),v(1e4)):(R(!1),v(Number(le)))},children:[e.jsx(Re,{className:"w-[120px]",children:e.jsx(He,{})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"50",children:"50 节点"}),e.jsx(ne,{value:"100",children:"100 节点"}),e.jsx(ne,{value:"200",children:"200 节点"}),e.jsx(ne,{value:"500",children:"500 节点"}),e.jsx(ne,{value:"1000",children:"1000 节点"}),e.jsx(ne,{value:"all",children:"全部 (最多10000)"}),e.jsx(ne,{value:"custom",children:"自定义..."})]})]}),E&&e.jsx(ce,{type:"number",min:"50",value:k,onChange:le=>T(le.target.value),onBlur:()=>{const le=parseInt(k);!isNaN(le)&&le>=50?v(le):(T("50"),v(50))},onKeyDown:le=>{if(le.key==="Enter"){const L=parseInt(k);!isNaN(L)&&L>=50?v(L):(T("50"),v(50))}},placeholder:"最少50个",className:"w-[120px]"}),e.jsx(b,{onClick:()=>ie(),variant:"outline",size:"sm",disabled:r,children:e.jsx(ps,{className:K("h-4 w-4",r&&"animate-spin")})})]})]})]}),e.jsx("div",{className:"flex-1 relative",children:r?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ps,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):B.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Zc,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),e.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):e.jsxs(rN,{nodes:B,edges:O,onNodesChange:S,onEdgesChange:he,onNodeClick:de,onEdgeClick:ge,nodeTypes:l1,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:ye<=500,nodesDraggable:ye<=1e3,attributionPosition:"bottom-left",children:[e.jsx(cN,{variant:oN.Dots,gap:12,size:1}),e.jsx(dN,{}),ye<=500&&e.jsx(uN,{nodeColor:H,nodeBorderRadius:8,pannable:!0,zoomable:!0}),e.jsxs(mN,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[e.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),e.jsx("span",{children:"实体节点"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),e.jsx("span",{children:"段落节点"})]}),ye>200&&e.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[e.jsx("div",{className:"font-semibold",children:"性能模式"}),e.jsx("div",{children:"已禁用动画"}),ye>500&&e.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),e.jsx(Qt,{open:!!pe,onOpenChange:le=>!le&&je(null),children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(Bt,{children:e.jsx(Ht,{children:"节点详情"})}),pe&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),e.jsx("div",{className:"mt-1",children:e.jsx(Qe,{variant:pe.type==="entity"?"default":"secondary",children:pe.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),e.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:pe.id})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),e.jsx(Ie,{className:"mt-1 h-40 p-3 bg-muted rounded",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:pe.content})})]})]})]})}),e.jsx(Qt,{open:!!_e,onOpenChange:le=>!le&&y(null),children:e.jsxs(Ut,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[e.jsx(Bt,{children:e.jsx(Ht,{children:"边详情"})}),_e&&e.jsx(Ie,{className:"flex-1 pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),e.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:_e.source.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[_e.source.id.slice(0,40),"..."]})]}),e.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),e.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),e.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:_e.target.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[_e.target.id.slice(0,40),"..."]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),e.jsx("div",{className:"mt-1",children:e.jsx(Qe,{variant:"outline",className:"text-base font-mono",children:_e.edge.weight.toFixed(4)})})]})]})})]})}),e.jsx(ft,{open:F,onOpenChange:U,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"加载知识图谱"}),e.jsxs(dt,{children:["知识图谱的动态展示会消耗较多系统资源。",e.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),e.jsxs(ct,{children:[e.jsx(mt,{onClick:()=>n({to:"/"}),children:"取消 (返回首页)"}),e.jsx(ut,{onClick:xe,children:"确认加载"})]})]})}),e.jsx(ft,{open:G,onOpenChange:z,children:e.jsxs(it,{children:[e.jsxs(rt,{children:[e.jsx(ot,{children:"⚠️ 节点数量较多"}),e.jsx(dt,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["您正在尝试加载 ",e.jsx("strong",{className:"text-orange-600",children:w>=1e4?"全部 (最多10000个)":w})," 个节点。"]}),e.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),e.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[e.jsx("li",{children:"页面加载时间较长"}),e.jsx("li",{children:"浏览器卡顿或崩溃"}),e.jsx("li",{children:"系统资源占用过高"})]}),e.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),e.jsxs(ct,{children:[e.jsx(mt,{onClick:()=>{z(!1),w>200&&(v(50),R(!1))},children:"取消"}),e.jsx(ut,{onClick:Q,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function op({className:n,classNames:r,showOutsideDays:c=!0,captionLayout:d="label",buttonVariant:h="ghost",formatters:x,components:f,...j}){const p=cg();return e.jsx(qy,{showOutsideDays:c,className:K("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,n),captionLayout:d,formatters:{formatMonthDropdown:w=>w.toLocaleString("default",{month:"short"}),...x},classNames:{root:K("w-fit",p.root),months:K("relative flex flex-col gap-4 md:flex-row",p.months),month:K("flex w-full flex-col gap-4",p.month),nav:K("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",p.nav),button_previous:K(ur({variant:h}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_previous),button_next:K(ur({variant:h}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_next),month_caption:K("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",p.month_caption),dropdowns:K("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",p.dropdowns),dropdown_root:K("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",p.dropdown_root),dropdown:K("bg-popover absolute inset-0 opacity-0",p.dropdown),caption_label:K("select-none font-medium",d==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:K("flex",p.weekdays),weekday:K("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",p.weekday),week:K("mt-2 flex w-full",p.week),week_number_header:K("w-[--cell-size] select-none",p.week_number_header),week_number:K("text-muted-foreground select-none text-[0.8rem]",p.week_number),day:K("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",p.day),range_start:K("bg-accent rounded-l-md",p.range_start),range_middle:K("rounded-none",p.range_middle),range_end:K("bg-accent rounded-r-md",p.range_end),today:K("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:K("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:K("text-muted-foreground opacity-50",p.disabled),hidden:K("invisible",p.hidden),...r},components:{Root:({className:w,rootRef:v,...k})=>e.jsx("div",{"data-slot":"calendar",ref:v,className:K(w),...k}),Chevron:({className:w,orientation:v,...k})=>v==="left"?e.jsx(nn,{className:K("size-4",w),...k}):v==="right"?e.jsx(Ol,{className:K("size-4",w),...k}):e.jsx(Dl,{className:K("size-4",w),...k}),DayButton:r1,WeekNumber:({children:w,...v})=>e.jsx("td",{...v,children:e.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:w})}),...f},...j})}function r1({className:n,day:r,modifiers:c,...d}){const h=cg(),x=u.useRef(null);return u.useEffect(()=>{c.focused&&x.current?.focus()},[c.focused]),e.jsx(b,{ref:x,variant:"ghost",size:"icon","data-day":r.date.toLocaleDateString(),"data-selected-single":c.selected&&!c.range_start&&!c.range_end&&!c.range_middle,"data-range-start":c.range_start,"data-range-end":c.range_end,"data-range-middle":c.range_middle,className:K("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",h.day,n),...d})}const c1={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},o1=(n,r,c)=>{let d;const h=c1[n];return typeof h=="string"?d=h:r===1?d=h.one:d=h.other.replace("{{count}}",String(r)),c?.addSuffix?c.comparison&&c.comparison>0?d+"内":d+"前":d},d1={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},u1={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},m1={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},h1={date:gu({formats:d1,defaultWidth:"full"}),time:gu({formats:u1,defaultWidth:"full"}),dateTime:gu({formats:m1,defaultWidth:"full"})};function dp(n,r,c){const d="eeee p";return cb(n,r,c)?d:n.getTime()>r.getTime()?"'下个'"+d:"'上个'"+d}const x1={lastWeek:dp,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:dp,other:"PP p"},f1=(n,r,c,d)=>{const h=x1[n];return typeof h=="function"?h(r,c,d):h},p1={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},g1={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},j1={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},v1={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},b1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},y1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},N1=(n,r)=>{const c=Number(n);switch(r?.unit){case"date":return c.toString()+"日";case"hour":return c.toString()+"时";case"minute":return c.toString()+"分";case"second":return c.toString()+"秒";default:return"第 "+c.toString()}},w1={ordinalNumber:N1,era:Ii({values:p1,defaultWidth:"wide"}),quarter:Ii({values:g1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ii({values:j1,defaultWidth:"wide"}),day:Ii({values:v1,defaultWidth:"wide"}),dayPeriod:Ii({values:b1,defaultWidth:"wide",formattingValues:y1,defaultFormattingWidth:"wide"})},_1=/^(第\s*)?\d+(日|时|分|秒)?/i,S1=/\d+/i,C1={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},k1={any:[/^(前)/i,/^(公元)/i]},T1={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},E1={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},z1={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},A1={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},M1={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},D1={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},O1={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},R1={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},L1={ordinalNumber:ob({matchPattern:_1,parsePattern:S1,valueCallback:n=>parseInt(n,10)}),era:Pi({matchPatterns:C1,defaultMatchWidth:"wide",parsePatterns:k1,defaultParseWidth:"any"}),quarter:Pi({matchPatterns:T1,defaultMatchWidth:"wide",parsePatterns:E1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Pi({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:A1,defaultParseWidth:"any"}),day:Pi({matchPatterns:M1,defaultMatchWidth:"wide",parsePatterns:D1,defaultParseWidth:"any"}),dayPeriod:Pi({matchPatterns:O1,defaultMatchWidth:"any",parsePatterns:R1,defaultParseWidth:"any"})},Bc={code:"zh-CN",formatDistance:o1,formatLong:h1,formatRelative:f1,localize:w1,match:L1,options:{weekStartsOn:1,firstWeekContainsDate:4}},Hc={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function U1(){const[n,r]=u.useState([]),[c,d]=u.useState(""),[h,x]=u.useState("all"),[f,j]=u.useState("all"),[p,w]=u.useState(void 0),[v,k]=u.useState(void 0),[T,E]=u.useState(!0),[R,F]=u.useState(!1),[U,M]=u.useState("xs"),[Z,G]=u.useState(4),z=u.useRef(null);u.useEffect(()=>{const y=tn.getAllLogs();r(y);const q=tn.onLog(()=>{r(tn.getAllLogs())}),H=tn.onConnectionChange(ie=>{F(ie)});return()=>{q(),H()}},[]);const B=u.useMemo(()=>{const y=new Set(n.map(q=>q.module).filter(q=>q&&q.trim()!==""));return Array.from(y).sort()},[n]),X=y=>{switch(y){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},S=y=>{switch(y){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},O=()=>{window.location.reload()},se=()=>{tn.clearLogs(),r([])},he=()=>{const y=pe.map(_=>`${_.timestamp} [${_.level.padEnd(8)}] [${_.module}] ${_.message}`).join(` +`),q=new Blob([y],{type:"text/plain;charset=utf-8"}),H=URL.createObjectURL(q),ie=document.createElement("a");ie.href=H,ie.download=`logs-${ju(new Date,"yyyy-MM-dd-HHmmss")}.txt`,ie.click(),URL.revokeObjectURL(H)},ye=()=>{E(!T)},be=()=>{w(void 0),k(void 0)},pe=u.useMemo(()=>n.filter(y=>{const q=c===""||y.message.toLowerCase().includes(c.toLowerCase())||y.module.toLowerCase().includes(c.toLowerCase()),H=h==="all"||y.level===h,ie=f==="all"||y.module===f;let _=!0;if(p||v){const me=new Date(y.timestamp);if(p){const xe=new Date(p);xe.setHours(0,0,0,0),_=_&&me>=xe}if(v){const xe=new Date(v);xe.setHours(23,59,59,999),_=_&&me<=xe}}return q&&H&&ie&&_}),[n,c,h,f,p,v]),je=Hc[U].rowHeight+Z,_e=Iv({count:pe.length,getScrollElement:()=>z.current,estimateSize:()=>je,overscan:15});return u.useEffect(()=>{T&&pe.length>0&&_e.scrollToIndex(pe.length-1,{align:"end",behavior:"auto"})},[pe.length,T,_e]),e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:K("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",R?"bg-green-500 animate-pulse":"bg-red-500")}),e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:R?"已连接":"未连接"})]})]}),e.jsx(Ve,{className:"p-3 sm:p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索日志...",value:c,onChange:y=>d(y.target.value),className:"pl-9 h-9 text-sm"})]}),e.jsxs(Be,{value:h,onValueChange:x,children:[e.jsxs(Re,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[e.jsx(Tu,{className:"h-4 w-4 mr-2"}),e.jsx(He,{placeholder:"级别"})]}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部级别"}),e.jsx(ne,{value:"DEBUG",children:"DEBUG"}),e.jsx(ne,{value:"INFO",children:"INFO"}),e.jsx(ne,{value:"WARNING",children:"WARNING"}),e.jsx(ne,{value:"ERROR",children:"ERROR"}),e.jsx(ne,{value:"CRITICAL",children:"CRITICAL"})]})]}),e.jsxs(Be,{value:f,onValueChange:j,children:[e.jsxs(Re,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[e.jsx(Tu,{className:"h-4 w-4 mr-2"}),e.jsx(He,{placeholder:"模块"})]}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部模块"}),B.map(y=>e.jsx(ne,{value:y,children:y},y))]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",className:K("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!p&&"text-muted-foreground"),children:[e.jsx(qf,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:p?ju(p,"PPP",{locale:Bc}):"开始日期"})]})}),e.jsx(va,{className:"w-auto p-0",align:"start",children:e.jsx(op,{mode:"single",selected:p,onSelect:w,initialFocus:!0,locale:Bc})})]}),e.jsxs(Ma,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs(b,{variant:"outline",size:"sm",className:K("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!v&&"text-muted-foreground"),children:[e.jsx(qf,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:v?ju(v,"PPP",{locale:Bc}):"结束日期"})]})}),e.jsx(va,{className:"w-auto p-0",align:"start",children:e.jsx(op,{mode:"single",selected:v,onSelect:k,initialFocus:!0,locale:Bc})})]}),(p||v)&&e.jsxs(b,{variant:"outline",size:"sm",onClick:be,className:"w-full sm:w-auto h-9",children:[e.jsx(si,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),e.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(b,{variant:T?"default":"outline",size:"sm",onClick:ye,className:"flex-1 sm:flex-none h-9",children:[T?e.jsx(by,{className:"h-4 w-4"}):e.jsx(yy,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:T?"自动滚动":"已暂停"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:O,className:"flex-1 sm:flex-none h-9",children:[e.jsx(ps,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:se,className:"flex-1 sm:flex-none h-9",children:[e.jsx(Pe,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:he,className:"flex-1 sm:flex-none h-9",children:[e.jsx(sl,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),e.jsx("div",{className:"flex-1 hidden sm:block"}),e.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[e.jsxs("span",{className:"font-mono",children:[pe.length," / ",n.length]}),e.jsx("span",{className:"ml-1",children:"条日志"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ny,{className:"h-4 w-4"}),e.jsx("span",{children:"字号"})]}),e.jsx("div",{className:"flex gap-1",children:Object.keys(Hc).map(y=>e.jsx(b,{variant:U===y?"default":"outline",size:"sm",onClick:()=>M(y),className:"h-7 px-3 text-xs",children:Hc[y].label},y))})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),e.jsx(ka,{value:[Z],onValueChange:([y])=>G(y),min:0,max:12,step:2,className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[Z,"px"]})]})]})]})})]}),e.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:e.jsx(Ve,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:e.jsx(Ie,{viewportRef:z,className:"h-full",children:e.jsx("div",{className:K("p-2 sm:p-3 font-mono relative",Hc[U].class),style:{height:`${_e.getTotalSize()}px`},children:pe.length===0?e.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):_e.getVirtualItems().map(y=>{const q=pe[y.index];return e.jsxs("div",{"data-index":y.index,ref:_e.measureElement,className:K("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",S(q.level)),style:{transform:`translateY(${y.start}px)`,paddingTop:`${Z/2}px`,paddingBottom:`${Z/2}px`},children:[e.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:q.timestamp}),e.jsxs("span",{className:K("font-semibold",X(q.level)),children:["[",q.level,"]"]})]}),e.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:q.module}),e.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:q.message})]}),e.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:q.timestamp}),e.jsxs("span",{className:K("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",X(q.level)),children:["[",q.level,"]"]}),e.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:q.module}),e.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:q.message})]})]},y.key)})})})})})]})}const B1="Mai-with-u",H1="plugin-repo",q1="main",G1="plugin_details.json";async function V1(){try{const n=await ke("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:B1,repo:H1,branch:q1,file_path:G1})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();if(!r.success||!r.data)throw new Error(r.error||"获取插件列表失败");return JSON.parse(r.data).filter(h=>!h?.id||!h?.manifest?(console.warn("跳过无效插件数据:",h),!1):!h.manifest.name||!h.manifest.version?(console.warn("跳过缺少必需字段的插件:",h.id),!1):!0).map(h=>({id:h.id,manifest:{manifest_version:h.manifest.manifest_version||1,name:h.manifest.name,version:h.manifest.version,description:h.manifest.description||"",author:h.manifest.author||{name:"Unknown"},license:h.manifest.license||"Unknown",host_application:h.manifest.host_application||{min_version:"0.0.0"},homepage_url:h.manifest.homepage_url,repository_url:h.manifest.repository_url,keywords:h.manifest.keywords||[],categories:h.manifest.categories||[],default_locale:h.manifest.default_locale||"zh-CN",locales_path:h.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(n){throw console.error("Failed to fetch plugin list:",n),n}}async function F1(){try{const n=await ke("/api/webui/plugins/git-status");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to check Git status:",n),{installed:!1,error:"无法检测 Git 安装状态"}}}async function $1(){try{const n=await ke("/api/webui/plugins/version");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to get Maimai version:",n),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function Q1(n,r,c){const d=n.split(".").map(j=>parseInt(j)||0),h=d[0]||0,x=d[1]||0,f=d[2]||0;if(c.version_majorparseInt(k)||0),p=j[0]||0,w=j[1]||0,v=j[2]||0;if(c.version_major>p||c.version_major===p&&c.version_minor>w||c.version_major===p&&c.version_minor===w&&c.version_patch>v)return!1}return!0}function Y1(n,r){const c=window.location.protocol==="https:"?"wss:":"ws:",d=window.location.host,h=new WebSocket(`${c}//${d}/api/webui/ws/plugin-progress`);return h.onopen=()=>{console.log("Plugin progress WebSocket connected");const x=setInterval(()=>{h.readyState===WebSocket.OPEN?h.send("ping"):clearInterval(x)},3e4)},h.onmessage=x=>{try{if(x.data==="pong")return;const f=JSON.parse(x.data);n(f)}catch(f){console.error("Failed to parse progress data:",f)}},h.onerror=x=>{console.error("Plugin progress WebSocket error:",x),r?.(x)},h.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},h}async function nr(){try{const n=await ke("/api/webui/plugins/installed",{headers:Tt()});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=await n.json();if(!r.success)throw new Error(r.message||"获取已安装插件列表失败");return r.plugins||[]}catch(n){return console.error("Failed to get installed plugins:",n),[]}}function qc(n,r){return r.some(c=>c.id===n)}function Gc(n,r){const c=r.find(d=>d.id===n);if(c)return c.manifest?.version||c.version}async function X1(n,r,c="main"){const d=await ke("/api/webui/plugins/install",{method:"POST",body:JSON.stringify({plugin_id:n,repository_url:r,branch:c})});if(!d.ok){const h=await d.json();throw new Error(h.detail||"安装失败")}return await d.json()}async function K1(n){const r=await ke("/api/webui/plugins/uninstall",{method:"POST",body:JSON.stringify({plugin_id:n})});if(!r.ok){const c=await r.json();throw new Error(c.detail||"卸载失败")}return await r.json()}async function Z1(n,r,c="main"){const d=await ke("/api/webui/plugins/update",{method:"POST",body:JSON.stringify({plugin_id:n,repository_url:r,branch:c})});if(!d.ok){const h=await d.json();throw new Error(h.detail||"更新失败")}return await d.json()}async function J1(n){const r=await ke(`/api/webui/plugins/config/${n}/schema`,{headers:Tt()});if(!r.ok){const d=await r.json();throw new Error(d.detail||"获取配置 Schema 失败")}const c=await r.json();if(!c.success)throw new Error(c.message||"获取配置 Schema 失败");return c.schema}async function I1(n){const r=await ke(`/api/webui/plugins/config/${n}`,{headers:Tt()});if(!r.ok){const d=await r.json();throw new Error(d.detail||"获取配置失败")}const c=await r.json();if(!c.success)throw new Error(c.message||"获取配置失败");return c.config}async function P1(n,r){const c=await ke(`/api/webui/plugins/config/${n}`,{method:"PUT",body:JSON.stringify({config:r})});if(!c.ok){const d=await c.json();throw new Error(d.detail||"保存配置失败")}return await c.json()}async function W1(n){const r=await ke(`/api/webui/plugins/config/${n}/reset`,{method:"POST",headers:Tt()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"重置配置失败")}return await r.json()}async function e2(n){const r=await ke(`/api/webui/plugins/config/${n}/toggle`,{method:"POST",headers:Tt()});if(!r.ok){const c=await r.json();throw new Error(c.detail||"切换状态失败")}return await r.json()}const br="https://maibot-plugin-stats.maibot-webui.workers.dev";async function zg(n){try{const r=await fetch(`${br}/stats/${n}`);return r.ok?await r.json():(console.error("Failed to fetch plugin stats:",r.statusText),null)}catch(r){return console.error("Error fetching plugin stats:",r),null}}async function t2(n,r){try{const c=r||Xu(),d=await fetch(`${br}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:c})}),h=await d.json();return d.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:d.ok?{success:!0,...h}:{success:!1,error:h.error||"点赞失败"}}catch(c){return console.error("Error liking plugin:",c),{success:!1,error:"网络错误"}}}async function s2(n,r){try{const c=r||Xu(),d=await fetch(`${br}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:c})}),h=await d.json();return d.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:d.ok?{success:!0,...h}:{success:!1,error:h.error||"点踩失败"}}catch(c){return console.error("Error disliking plugin:",c),{success:!1,error:"网络错误"}}}async function a2(n,r,c,d){if(r<1||r>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const h=d||Xu(),x=await fetch(`${br}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,rating:r,comment:c,user_id:h})}),f=await x.json();return x.status===429?{success:!1,error:"每天最多评分 3 次"}:x.ok?{success:!0,...f}:{success:!1,error:f.error||"评分失败"}}catch(h){return console.error("Error rating plugin:",h),{success:!1,error:"网络错误"}}}async function l2(n){try{const r=await fetch(`${br}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n})}),c=await r.json();return r.status===429?(console.warn("Download recording rate limited"),{success:!0}):r.ok?{success:!0,...c}:(console.error("Failed to record download:",c.error),{success:!1,error:c.error})}catch(r){return console.error("Error recording download:",r),{success:!1,error:"网络错误"}}}function n2(){const n=navigator,r=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,n.deviceMemory||0].join("|");let c=0;for(let d=0;d{x(!0);const M=await zg(n);M&&d(M),x(!1)};u.useEffect(()=>{E()},[n]);const R=async()=>{const M=await t2(n);M.success?(T({title:"已点赞",description:"感谢你的支持!"}),E()):T({title:"点赞失败",description:M.error||"未知错误",variant:"destructive"})},F=async()=>{const M=await s2(n);M.success?(T({title:"已反馈",description:"感谢你的反馈!"}),E()):T({title:"操作失败",description:M.error||"未知错误",variant:"destructive"})},U=async()=>{if(f===0){T({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const M=await a2(n,f,p||void 0);M.success?(T({title:"评分成功",description:"感谢你的评价!"}),k(!1),j(0),w(""),E()):T({title:"评分失败",description:M.error||"未知错误",variant:"destructive"})};return h?e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(sl,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ml,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]})]}):c?r?e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${c.downloads.toLocaleString()}`,children:[e.jsx(sl,{className:"h-4 w-4"}),e.jsx("span",{children:c.downloads.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${c.rating.toFixed(1)} (${c.rating_count} 条评价)`,children:[e.jsx(Ml,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:c.rating.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${c.likes}`,children:[e.jsx(bu,{className:"h-4 w-4"}),e.jsx("span",{children:c.likes})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(sl,{className:"h-5 w-5 text-muted-foreground mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.downloads.toLocaleString()}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Ml,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),e.jsx("span",{className:"text-2xl font-bold",children:c.rating.toFixed(1)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.rating_count," 条评价"]})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(bu,{className:"h-5 w-5 text-green-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.likes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(Gf,{className:"h-5 w-5 text-red-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:c.dislikes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:R,children:[e.jsx(bu,{className:"h-4 w-4 mr-1"}),"点赞"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:F,children:[e.jsx(Gf,{className:"h-4 w-4 mr-1"}),"点踩"]}),e.jsxs(Qt,{open:v,onOpenChange:k,children:[e.jsx(Vu,{asChild:!0,children:e.jsxs(b,{variant:"default",size:"sm",children:[e.jsx(Ml,{className:"h-4 w-4 mr-1"}),"评分"]})}),e.jsxs(Ut,{children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"为插件评分"}),e.jsx(ss,{children:"分享你的使用体验,帮助其他用户"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(M=>e.jsx("button",{onClick:()=>j(M),className:"focus:outline-none",children:e.jsx(Ml,{className:`h-8 w-8 transition-colors ${M<=f?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},M))}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[f===0&&"点击星星进行评分",f===1&&"很差",f===2&&"一般",f===3&&"还行",f===4&&"不错",f===5&&"非常好"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),e.jsx(Ot,{value:p,onChange:M=>w(M.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[p.length," / 500"]})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>k(!1),children:"取消"}),e.jsx(b,{onClick:U,disabled:f===0,children:"提交评分"})]})]})]})]}),c.recent_ratings&&c.recent_ratings.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),e.jsx("div",{className:"space-y-3",children:c.recent_ratings.map((M,Z)=>e.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(G=>e.jsx(Ml,{className:`h-3 w-3 ${G<=M.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},G))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(M.created_at).toLocaleDateString()})]}),M.comment&&e.jsx("p",{className:"text-sm text-muted-foreground",children:M.comment})]},Z))})]})]}):null}const up={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function r2(){const n=ua(),[r,c]=u.useState(null),[d,h]=u.useState(""),[x,f]=u.useState("all"),[j,p]=u.useState("all"),[w,v]=u.useState(!0),[k,T]=u.useState([]),[E,R]=u.useState(!0),[F,U]=u.useState(null),[M,Z]=u.useState(null),[G,z]=u.useState(null),[B,X]=u.useState(null),[,S]=u.useState([]),[O,se]=u.useState({}),{toast:he}=Rt(),ye=async _=>{const me=_.map(async de=>{try{const ge=await zg(de.id);return{id:de.id,stats:ge}}catch(ge){return console.warn(`Failed to load stats for ${de.id}:`,ge),{id:de.id,stats:null}}}),xe=await Promise.all(me),Q={};xe.forEach(({id:de,stats:ge})=>{ge&&(Q[de]=ge)}),se(Q)};u.useEffect(()=>{let _=null,me=!1;return(async()=>{if(_=Y1(Q=>{me||(z(Q),Q.stage==="success"?setTimeout(()=>{me||z(null)},2e3):Q.stage==="error"&&(R(!1),U(Q.error||"加载失败")))},Q=>{console.error("WebSocket error:",Q),me||he({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(Q=>{if(!_){Q();return}const de=()=>{_&&_.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),Q()):_&&_.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),Q()):setTimeout(de,100)};de()}),!me){const Q=await F1();Z(Q),Q.installed||he({title:"Git 未安装",description:Q.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!me){const Q=await $1();X(Q)}if(!me)try{R(!0),U(null);const Q=await V1();if(!me){const de=await nr();S(de);const ge=Q.map(le=>{const L=qc(le.id,de),$=Gc(le.id,de);return{...le,installed:L,installed_version:$}});for(const le of de)!ge.some($=>$.id===le.id)&&le.manifest&&ge.push({id:le.id,manifest:{manifest_version:le.manifest.manifest_version||1,name:le.manifest.name,version:le.manifest.version,description:le.manifest.description||"",author:le.manifest.author,license:le.manifest.license||"Unknown",host_application:le.manifest.host_application,homepage_url:le.manifest.homepage_url,repository_url:le.manifest.repository_url,keywords:le.manifest.keywords||[],categories:le.manifest.categories||[],default_locale:le.manifest.default_locale||"zh-CN",locales_path:le.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:le.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});T(ge),ye(ge)}}catch(Q){if(!me){const de=Q instanceof Error?Q.message:"加载插件列表失败";U(de),he({title:"加载失败",description:de,variant:"destructive"})}}finally{me||R(!1)}})(),()=>{me=!0,_&&_.close()}},[he]);const be=_=>{if(!_.installed&&B&&!pe(_))return e.jsxs(Qe,{variant:"destructive",className:"gap-1",children:[e.jsx(Ea,{className:"h-3 w-3"}),"不兼容"]});if(_.installed){const me=_.installed_version?.trim(),xe=_.manifest.version?.trim();if(me!==xe){const Q=me?.split(".").map(Number)||[0,0,0],de=xe?.split(".").map(Number)||[0,0,0];for(let ge=0;ge<3;ge++){if((de[ge]||0)>(Q[ge]||0))return e.jsxs(Qe,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[e.jsx(Ea,{className:"h-3 w-3"}),"可更新"]});if((de[ge]||0)<(Q[ge]||0))break}}return e.jsxs(Qe,{variant:"default",className:"gap-1",children:[e.jsx(oa,{className:"h-3 w-3"}),"已安装"]})}return null},pe=_=>!B||!_.manifest?.host_application?!0:Q1(_.manifest.host_application.min_version,_.manifest.host_application.max_version,B),je=_=>{if(!_.installed||!_.installed_version||!_.manifest?.version)return!1;const me=_.installed_version.trim(),xe=_.manifest.version.trim();if(me===xe)return!1;const Q=me.split(".").map(Number),de=xe.split(".").map(Number);for(let ge=0;ge<3;ge++){if((de[ge]||0)>(Q[ge]||0))return!0;if((de[ge]||0)<(Q[ge]||0))return!1}return!1},_e=k.filter(_=>{if(!_.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",_.id),!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(ge=>ge.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x);let Q=!0;j==="installed"?Q=_.installed===!0:j==="updates"&&(Q=_.installed===!0&&je(_));const de=!w||!B||pe(_);return me&&xe&&Q&&de}),y=()=>{c(null)},q=async _=>{if(!M?.installed){he({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(B&&!pe(_)){he({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await X1(_.id,_.manifest.repository_url||"","main"),l2(_.id).catch(xe=>{console.warn("Failed to record download:",xe)}),he({title:"安装成功",description:`${_.manifest.name} 已成功安装`});const me=await nr();S(me),T(xe=>xe.map(Q=>{if(Q.id===_.id){const de=qc(Q.id,me),ge=Gc(Q.id,me);return{...Q,installed:de,installed_version:ge}}return Q}))}catch(me){he({title:"安装失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},H=async _=>{try{await K1(_.id),he({title:"卸载成功",description:`${_.manifest.name} 已成功卸载`});const me=await nr();S(me),T(xe=>xe.map(Q=>{if(Q.id===_.id){const de=qc(Q.id,me),ge=Gc(Q.id,me);return{...Q,installed:de,installed_version:ge}}return Q}))}catch(me){he({title:"卸载失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ie=async _=>{if(!M?.installed){he({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const me=await Z1(_.id,_.manifest.repository_url||"","main");he({title:"更新成功",description:`${_.manifest.name} 已从 ${me.old_version} 更新到 ${me.new_version}`});const xe=await nr();S(xe),T(Q=>Q.map(de=>{if(de.id===_.id){const ge=qc(de.id,xe),le=Gc(de.id,xe);return{...de,installed:ge,installed_version:le}}return de}))}catch(me){he({title:"更新失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}};return e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),e.jsxs(b,{onClick:()=>n({to:"/plugin-mirrors"}),children:[e.jsx(wy,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),M&&!M.installed&&e.jsxs(Ve,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[e.jsx(pt,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pa,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(gt,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),e.jsx(Kt,{className:"text-orange-800 dark:text-orange-200",children:M.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),e.jsx(yt,{children:e.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",e.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),e.jsx(Ve,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索插件...",value:d,onChange:_=>h(_.target.value),className:"pl-9"})]}),e.jsxs(Be,{value:x,onValueChange:f,children:[e.jsx(Re,{className:"w-full sm:w-[200px]",children:e.jsx(He,{placeholder:"选择分类"})}),e.jsxs(Le,{children:[e.jsx(ne,{value:"all",children:"全部分类"}),e.jsx(ne,{value:"Group Management",children:"群组管理"}),e.jsx(ne,{value:"Entertainment & Interaction",children:"娱乐互动"}),e.jsx(ne,{value:"Utility Tools",children:"实用工具"}),e.jsx(ne,{value:"Content Generation",children:"内容生成"}),e.jsx(ne,{value:"Multimedia",children:"多媒体"}),e.jsx(ne,{value:"External Integration",children:"外部集成"}),e.jsx(ne,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),e.jsx(ne,{value:"Other",children:"其他"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(bs,{id:"compatible-only",checked:w,onCheckedChange:_=>v(_===!0)}),e.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),e.jsx(Aa,{value:j,onValueChange:p,className:"w-full",children:e.jsxs(ja,{className:"grid w-full grid-cols-3",children:[e.jsxs(st,{value:"all",children:["全部插件 (",k.filter(_=>{if(!_.manifest)return!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(de=>de.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x),Q=!w||!B||pe(_);return me&&xe&&Q}).length,")"]}),e.jsxs(st,{value:"installed",children:["已安装 (",k.filter(_=>{if(!_.manifest)return!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(de=>de.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x),Q=!w||!B||pe(_);return _.installed&&me&&xe&&Q}).length,")"]}),e.jsxs(st,{value:"updates",children:["可更新 (",k.filter(_=>{if(!_.manifest)return!1;const me=d===""||_.manifest.name?.toLowerCase().includes(d.toLowerCase())||_.manifest.description?.toLowerCase().includes(d.toLowerCase())||_.manifest.keywords&&_.manifest.keywords.some(de=>de.toLowerCase().includes(d.toLowerCase())),xe=x==="all"||_.manifest.categories&&_.manifest.categories.includes(x),Q=!w||!B||pe(_);return _.installed&&je(_)&&me&&xe&&Q}).length,")"]})]})}),G&&G.stage==="loading"&&e.jsx(Ve,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(vs,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{className:"text-sm font-medium",children:[G.operation==="fetch"&&"加载插件列表",G.operation==="install"&&`安装插件${G.plugin_id?`: ${G.plugin_id}`:""}`,G.operation==="uninstall"&&`卸载插件${G.plugin_id?`: ${G.plugin_id}`:""}`,G.operation==="update"&&`更新插件${G.plugin_id?`: ${G.plugin_id}`:""}`]})]}),e.jsxs("span",{className:"text-sm font-medium",children:[G.progress,"%"]})]}),e.jsx(vr,{value:G.progress,className:"h-2"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:G.message}),G.operation==="fetch"&&G.total_plugins>0&&e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",G.loaded_plugins," / ",G.total_plugins," 个插件"]})]})}),G&&G.stage==="error"&&G.error&&e.jsx(Ve,{className:"border-destructive bg-destructive/10",children:e.jsx(pt,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pa,{className:"h-5 w-5 text-destructive"}),e.jsxs("div",{children:[e.jsx(gt,{className:"text-lg text-destructive",children:"加载失败"}),e.jsx(Kt,{className:"text-destructive/80",children:G.error})]})]})})}),E?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(vs,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):F?e.jsx(Ve,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(pa,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:F}),e.jsx(b,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):_e.length===0?e.jsx(Ve,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Os,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d||x!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:_e.map(_=>e.jsxs(Ve,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[e.jsxs(pt,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(gt,{className:"text-xl",children:_.manifest?.name||_.id}),e.jsxs("div",{className:"flex flex-col gap-1",children:[_.manifest?.categories&&_.manifest.categories[0]&&e.jsx(Qe,{variant:"secondary",className:"text-xs whitespace-nowrap",children:up[_.manifest.categories[0]]||_.manifest.categories[0]}),be(_)]})]}),e.jsx(Kt,{className:"line-clamp-2",children:_.manifest?.description||"无描述"})]}),e.jsx(yt,{className:"flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(sl,{className:"h-4 w-4"}),e.jsx("span",{children:(O[_.id]?.downloads??_.downloads??0).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ml,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:(O[_.id]?.rating??_.rating??0).toFixed(1)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[_.manifest?.keywords&&_.manifest.keywords.slice(0,3).map(me=>e.jsx(Qe,{variant:"outline",className:"text-xs",children:me},me)),_.manifest?.keywords&&_.manifest.keywords.length>3&&e.jsxs(Qe,{variant:"outline",className:"text-xs",children:["+",_.manifest.keywords.length-3]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[e.jsxs("div",{children:["v",_.manifest?.version||"unknown"," · ",_.manifest?.author?.name||"Unknown"]}),_.manifest?.host_application&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"支持:"}),e.jsxs("span",{className:"font-medium",children:[_.manifest.host_application.min_version,_.manifest.host_application.max_version?` - ${_.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),e.jsx(og,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:()=>c(_),children:"查看详情"}),_.installed?je(_)?e.jsxs(b,{size:"sm",disabled:!M?.installed,title:M?.installed?void 0:"Git 未安装",onClick:()=>ie(_),children:[e.jsx(ps,{className:"h-4 w-4 mr-1"}),"更新"]}):e.jsxs(b,{variant:"destructive",size:"sm",disabled:!M?.installed,title:M?.installed?void 0:"Git 未安装",onClick:()=>H(_),children:[e.jsx(Pe,{className:"h-4 w-4 mr-1"}),"卸载"]}):e.jsxs(b,{size:"sm",disabled:!M?.installed||G?.operation==="install"||B!==null&&!pe(_),title:M?.installed?B!==null&&!pe(_)?`不兼容当前版本 (需要 ${_.manifest?.host_application?.min_version||"未知"}${_.manifest?.host_application?.max_version?` - ${_.manifest.host_application.max_version}`:"+"},当前 ${B?.version})`:void 0:"Git 未安装",onClick:()=>q(_),children:[e.jsx(sl,{className:"h-4 w-4 mr-1"}),G?.operation==="install"&&G?.plugin_id===_.id?"安装中...":"安装"]})]})})]},_.id))}),e.jsx(Qt,{open:r!==null,onOpenChange:y,children:r&&r.manifest&&e.jsx(Ut,{className:"max-w-2xl max-h-[80vh] p-0 flex flex-col",children:e.jsx(Ie,{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-6",children:[e.jsx(Bt,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(Ht,{className:"text-2xl",children:r.manifest.name}),e.jsxs(ss,{children:["作者: ",r.manifest.author?.name||"Unknown",r.manifest.author?.url&&e.jsx("a",{href:r.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:e.jsx(Fc,{className:"h-3 w-3 inline"})})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[r.manifest.categories&&r.manifest.categories[0]&&e.jsx(Qe,{variant:"secondary",children:up[r.manifest.categories[0]]||r.manifest.categories[0]}),be(r)]})]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(i2,{pluginId:r.id}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",r.manifest?.version||"unknown"]}),r.installed&&r.installed_version&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",r.installed_version]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"下载量"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:(O[r.id]?.downloads??r.downloads??0).toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"评分"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ml,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(O[r.id]?.rating??r.rating??0).toFixed(1)," (",O[r.id]?.rating_count??r.review_count??0,")"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"许可证"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.manifest.license||"Unknown"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.manifest.host_application?.min_version||"未知",r.manifest.host_application?.max_version?` - ${r.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.manifest.keywords&&r.manifest.keywords.map(_=>e.jsx(Qe,{variant:"outline",children:_},_))})]}),r.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:r.detailed_description})]}),!r.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.manifest.description||"无描述"})]}),e.jsxs("div",{className:"space-y-2",children:[r.manifest.homepage_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"主页: "}),e.jsx("a",{href:r.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.manifest.homepage_url})]}),r.manifest.repository_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"仓库: "}),e.jsx("a",{href:r.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:r.manifest.repository_url})]})]})]}),e.jsxs(os,{children:[r.manifest.homepage_url&&e.jsxs(b,{onClick:()=>window.open(r.manifest.homepage_url,"_blank"),children:[e.jsx(Fc,{className:"h-4 w-4 mr-2"}),"访问主页"]}),r.manifest.repository_url&&e.jsxs(b,{variant:"outline",onClick:()=>window.open(r.manifest.repository_url,"_blank"),children:[e.jsx(Fc,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})})})]})})}const Du=Sb,Ou=Cb,Ru=kb;function c2({field:n,value:r,onChange:c}){const[d,h]=u.useState(!1);switch(n.ui_type){case"switch":return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(N,{children:n.label}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]}),e.jsx(Ge,{checked:!!r,onCheckedChange:c,disabled:n.disabled})]});case"number":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:n.label}),e.jsx(ce,{type:"number",value:r??n.default,onChange:x=>c(parseFloat(x.target.value)||0),min:n.min,max:n.max,step:n.step??1,placeholder:n.placeholder,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"slider":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{children:n.label}),e.jsx("span",{className:"text-sm text-muted-foreground",children:r??n.default})]}),e.jsx(ka,{value:[r??n.default],onValueChange:x=>c(x[0]),min:n.min??0,max:n.max??100,step:n.step??1,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"select":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:n.label}),e.jsxs(Be,{value:String(r??n.default),onValueChange:c,disabled:n.disabled,children:[e.jsx(Re,{children:e.jsx(He,{placeholder:n.placeholder??"请选择"})}),e.jsx(Le,{children:n.choices?.map(x=>e.jsx(ne,{value:String(x),children:String(x)},String(x)))})]}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"textarea":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:n.label}),e.jsx(Ot,{value:r??n.default,onChange:x=>c(x.target.value),placeholder:n.placeholder,rows:n.rows??3,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"password":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:n.label}),e.jsxs("div",{className:"relative",children:[e.jsx(ce,{type:d?"text":"password",value:r??"",onChange:x=>c(x.target.value),placeholder:n.placeholder,disabled:n.disabled,className:"pr-10"}),e.jsx(b,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>h(!d),children:d?e.jsx(rr,{className:"h-4 w-4"}):e.jsx(Ys,{className:"h-4 w-4"})})]}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]});case"text":default:return e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:n.label}),e.jsx(ce,{type:"text",value:r??n.default??"",onChange:x=>c(x.target.value),placeholder:n.placeholder,maxLength:n.max_length,disabled:n.disabled}),n.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:n.hint})]})}}function mp({section:n,config:r,onChange:c}){const[d,h]=u.useState(!n.collapsed),x=Object.entries(n.fields).filter(([,f])=>!f.hidden).sort(([,f],[,j])=>f.order-j.order);return e.jsx(Du,{open:d,onOpenChange:h,children:e.jsxs(Ve,{children:[e.jsx(Ou,{asChild:!0,children:e.jsxs(pt,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d?e.jsx(Dl,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Ol,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(gt,{className:"text-lg",children:n.title})]}),e.jsxs(Qe,{variant:"secondary",className:"text-xs",children:[x.length," 项"]})]}),n.description&&e.jsx(Kt,{className:"ml-6",children:n.description})]})}),e.jsx(Ru,{children:e.jsx(yt,{className:"space-y-4 pt-0",children:x.map(([f,j])=>e.jsx(c2,{field:j,value:r[n.name]?.[f],onChange:p=>c(n.name,f,p),sectionName:n.name},f))})})]})})}function o2({plugin:n,onBack:r}){const{toast:c}=Rt(),[d,h]=u.useState(null),[x,f]=u.useState({}),[j,p]=u.useState({}),[w,v]=u.useState(!0),[k,T]=u.useState(!1),[E,R]=u.useState(!1),[F,U]=u.useState(!1),M=u.useCallback(async()=>{v(!0);try{const[O,se]=await Promise.all([J1(n.id),I1(n.id)]);h(O),f(se),p(JSON.parse(JSON.stringify(se)))}catch(O){c({title:"加载配置失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}finally{v(!1)}},[n.id,c]);u.useEffect(()=>{M()},[M]),u.useEffect(()=>{R(JSON.stringify(x)!==JSON.stringify(j))},[x,j]);const Z=(O,se,he)=>{f(ye=>({...ye,[O]:{...ye[O]||{},[se]:he}}))},G=async()=>{T(!0);try{await P1(n.id,x),p(JSON.parse(JSON.stringify(x))),c({title:"配置已保存",description:"更改将在插件重新加载后生效"})}catch(O){c({title:"保存失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}finally{T(!1)}},z=async()=>{try{await W1(n.id),c({title:"配置已重置",description:"下次加载插件时将使用默认配置"}),U(!1),M()}catch(O){c({title:"重置失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},B=async()=>{try{const O=await e2(n.id);c({title:O.message,description:O.note}),M()}catch(O){c({title:"切换状态失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}};if(w)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(vs,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!d)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[e.jsx(Ea,{className:"h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"无法加载配置"}),e.jsxs(b,{onClick:r,variant:"outline",children:[e.jsx(Wn,{className:"h-4 w-4 mr-2"}),"返回"]})]});const X=Object.values(d.sections).sort((O,se)=>O.order-se.order),S=x.plugin?.enabled!==!1;return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(b,{variant:"ghost",size:"icon",onClick:r,children:e.jsx(Wn,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:d.plugin_info.name||n.manifest.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(Qe,{variant:S?"default":"secondary",children:S?"已启用":"已禁用"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",d.plugin_info.version||n.manifest.version]})]})]})]}),e.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:B,children:[e.jsx(fr,{className:"h-4 w-4 mr-2"}),S?"禁用":"启用"]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>U(!0),children:[e.jsx(Kc,{className:"h-4 w-4 mr-2"}),"重置"]}),e.jsxs(b,{size:"sm",onClick:G,disabled:!E||k,children:[k?e.jsx(vs,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(pr,{className:"h-4 w-4 mr-2"}),"保存"]})]})]}),E&&e.jsx(Ve,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:e.jsx(yt,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(za,{className:"h-4 w-4 text-orange-600"}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"有未保存的更改"})]})})}),d.layout.type==="tabs"&&d.layout.tabs.length>0?e.jsxs(Aa,{defaultValue:d.layout.tabs[0]?.id,children:[e.jsx(ja,{children:d.layout.tabs.map(O=>e.jsxs(st,{value:O.id,children:[O.title,O.badge&&e.jsx(Qe,{variant:"secondary",className:"ml-2 text-xs",children:O.badge})]},O.id))}),d.layout.tabs.map(O=>e.jsx(_t,{value:O.id,className:"space-y-4 mt-4",children:O.sections.map(se=>{const he=d.sections[se];return he?e.jsx(mp,{section:he,config:x,onChange:Z},se):null})},O.id))]}):e.jsx("div",{className:"space-y-4",children:X.map(O=>e.jsx(mp,{section:O,config:x,onChange:Z},O.name))}),e.jsx(Qt,{open:F,onOpenChange:U,children:e.jsxs(Ut,{children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"确认重置配置"}),e.jsx(ss,{children:"这将删除当前配置文件,下次加载插件时将使用默认配置。此操作不可撤销。"})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>U(!1),children:"取消"}),e.jsx(b,{variant:"destructive",onClick:z,children:"确认重置"})]})]})})]})}function d2(){const{toast:n}=Rt(),[r,c]=u.useState([]),[d,h]=u.useState(!0),[x,f]=u.useState(""),[j,p]=u.useState(null),w=async()=>{h(!0);try{const E=await nr();c(E)}catch(E){n({title:"加载插件列表失败",description:E instanceof Error?E.message:"未知错误",variant:"destructive"})}finally{h(!1)}};u.useEffect(()=>{w()},[]);const v=r.filter(E=>{const R=x.toLowerCase();return E.id.toLowerCase().includes(R)||E.manifest.name.toLowerCase().includes(R)||E.manifest.description?.toLowerCase().includes(R)}),k=r.length,T=0;return j?e.jsx(Ie,{className:"h-full",children:e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx(o2,{plugin:j,onBack:()=>p(null)})})}):e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),e.jsxs(b,{variant:"outline",size:"sm",onClick:w,children:[e.jsx(ps,{className:`h-4 w-4 mr-2 ${d?"animate-spin":""}`}),"刷新"]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"已安装插件"}),e.jsx(ln,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(yt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:r.length}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d?"正在加载...":"个插件"})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"已启用"}),e.jsx(oa,{className:"h-4 w-4 text-green-600"})]}),e.jsxs(yt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:k}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gt,{className:"text-sm font-medium",children:"已禁用"}),e.jsx(Ea,{className:"h-4 w-4 text-orange-600"})]}),e.jsxs(yt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:T}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ce,{placeholder:"搜索插件...",value:x,onChange:E=>f(E.target.value),className:"pl-9"})]}),e.jsxs(Ve,{children:[e.jsxs(pt,{children:[e.jsx(gt,{children:"已安装的插件"}),e.jsx(Kt,{children:"点击插件查看和编辑配置"})]}),e.jsx(yt,{children:d?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(vs,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):v.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ln,{className:"h-16 w-16 text-muted-foreground/50"}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:x?"没有找到匹配的插件":"暂无已安装的插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x?"尝试其他搜索关键词":"前往插件市场安装插件"})]})]}):e.jsx("div",{className:"space-y-2",children:v.map(E=>e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>p(E),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(ln,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-medium truncate",children:E.manifest.name}),e.jsxs(Qe,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",E.manifest.version]})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:E.manifest.description||"暂无描述"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(b,{variant:"ghost",size:"sm",children:e.jsx(ti,{className:"h-4 w-4"})}),e.jsx(Ol,{className:"h-4 w-4 text-muted-foreground"})]})]},E.id))})})]})]})})}function u2(){const n=ua(),{toast:r}=Rt(),[c,d]=u.useState([]),[h,x]=u.useState(!0),[f,j]=u.useState(null),[p,w]=u.useState(null),[v,k]=u.useState(!1),[T,E]=u.useState(!1),[R,F]=u.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),U=u.useCallback(async()=>{try{x(!0),j(null);const S=localStorage.getItem("access-token"),O=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${S}`}});if(!O.ok)throw new Error("获取镜像源列表失败");const se=await O.json();d(se.mirrors||[])}catch(S){const O=S instanceof Error?S.message:"加载镜像源失败";j(O),r({title:"加载失败",description:O,variant:"destructive"})}finally{x(!1)}},[r]);u.useEffect(()=>{U()},[U]);const M=async()=>{try{const S=localStorage.getItem("access-token"),O=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${S}`,"Content-Type":"application/json"},body:JSON.stringify(R)});if(!O.ok){const se=await O.json();throw new Error(se.detail||"添加镜像源失败")}r({title:"添加成功",description:"镜像源已添加"}),k(!1),F({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),U()}catch(S){r({title:"添加失败",description:S instanceof Error?S.message:"未知错误",variant:"destructive"})}},Z=async()=>{if(p)try{const S=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${p.id}`,{method:"PUT",headers:{Authorization:`Bearer ${S}`,"Content-Type":"application/json"},body:JSON.stringify({name:R.name,raw_prefix:R.raw_prefix,clone_prefix:R.clone_prefix,enabled:R.enabled,priority:R.priority})})).ok)throw new Error("更新镜像源失败");r({title:"更新成功",description:"镜像源已更新"}),E(!1),w(null),U()}catch(S){r({title:"更新失败",description:S instanceof Error?S.message:"未知错误",variant:"destructive"})}},G=async S=>{if(confirm("确定要删除这个镜像源吗?"))try{const O=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${S}`,{method:"DELETE",headers:{Authorization:`Bearer ${O}`}})).ok)throw new Error("删除镜像源失败");r({title:"删除成功",description:"镜像源已删除"}),U()}catch(O){r({title:"删除失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},z=async S=>{try{const O=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${S.id}`,{method:"PUT",headers:{Authorization:`Bearer ${O}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!S.enabled})})).ok)throw new Error("更新状态失败");U()}catch(O){r({title:"更新失败",description:O instanceof Error?O.message:"未知错误",variant:"destructive"})}},B=S=>{w(S),F({id:S.id,name:S.name,raw_prefix:S.raw_prefix,clone_prefix:S.clone_prefix,enabled:S.enabled,priority:S.priority}),E(!0)},X=async(S,O)=>{const se=O==="up"?S.priority-1:S.priority+1;if(!(se<1))try{const he=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${S.id}`,{method:"PUT",headers:{Authorization:`Bearer ${he}`,"Content-Type":"application/json"},body:JSON.stringify({priority:se})})).ok)throw new Error("更新优先级失败");U()}catch(he){r({title:"更新失败",description:he instanceof Error?he.message:"未知错误",variant:"destructive"})}};return e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(b,{variant:"ghost",size:"icon",onClick:()=>n({to:"/plugins"}),children:e.jsx(Wn,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),e.jsxs(b,{onClick:()=>k(!0),children:[e.jsx(cs,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),h?e.jsx(Ve,{className:"p-6",children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(vs,{className:"h-8 w-8 animate-spin text-primary"})})}):f?e.jsx(Ve,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(pa,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:f}),e.jsx(b,{onClick:U,children:"重新加载"})]})}):e.jsxs(Ve,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(ai,{children:[e.jsx(li,{children:e.jsxs(gs,{children:[e.jsx(at,{children:"状态"}),e.jsx(at,{children:"名称"}),e.jsx(at,{children:"ID"}),e.jsx(at,{children:"优先级"}),e.jsx(at,{className:"text-right",children:"操作"})]})}),e.jsx(ni,{children:c.map(S=>e.jsxs(gs,{children:[e.jsx($e,{children:e.jsx(Ge,{checked:S.enabled,onCheckedChange:()=>z(S)})}),e.jsx($e,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:S.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",S.raw_prefix]})]})}),e.jsx($e,{children:e.jsx(Qe,{variant:"outline",children:S.id})}),e.jsx($e,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:S.priority}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(b,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>X(S,"up"),disabled:S.priority===1,children:e.jsx(or,{className:"h-3 w-3"})}),e.jsx(b,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>X(S,"down"),children:e.jsx(Dl,{className:"h-3 w-3"})})]})]})}),e.jsx($e,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(b,{variant:"ghost",size:"icon",onClick:()=>B(S),children:e.jsx(an,{className:"h-4 w-4"})}),e.jsx(b,{variant:"ghost",size:"icon",onClick:()=>G(S.id),children:e.jsx(Pe,{className:"h-4 w-4 text-destructive"})})]})})]},S.id))})]})}),e.jsx("div",{className:"md:hidden p-4 space-y-4",children:c.map(S=>e.jsx(Ve,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold",children:S.name}),S.enabled&&e.jsx(Qe,{variant:"default",className:"text-xs",children:"启用"})]}),e.jsx(Qe,{variant:"outline",className:"mt-1 text-xs",children:S.id})]}),e.jsx(Ge,{checked:S.enabled,onCheckedChange:()=>z(S)})]}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Raw: "}),e.jsx("span",{className:"break-all",children:S.raw_prefix})]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"优先级: "}),e.jsx("span",{className:"font-mono",children:S.priority})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[e.jsxs(b,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>B(S),children:[e.jsx(an,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>X(S,"up"),disabled:S.priority===1,children:e.jsx(or,{className:"h-4 w-4"})}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>X(S,"down"),children:e.jsx(Dl,{className:"h-4 w-4"})}),e.jsx(b,{variant:"destructive",size:"sm",onClick:()=>G(S.id),children:e.jsx(Pe,{className:"h-4 w-4"})})]})]})},S.id))})]}),e.jsx(Qt,{open:v,onOpenChange:k,children:e.jsxs(Ut,{className:"max-w-lg",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"添加镜像源"}),e.jsx(ss,{children:"添加新的 Git 镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"add-id",children:"镜像源 ID *"}),e.jsx(ce,{id:"add-id",placeholder:"例如: my-mirror",value:R.id,onChange:S=>F({...R,id:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"add-name",children:"名称 *"}),e.jsx(ce,{id:"add-name",placeholder:"例如: 我的镜像源",value:R.name,onChange:S=>F({...R,name:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),e.jsx(ce,{id:"add-raw",placeholder:"https://example.com/raw",value:R.raw_prefix,onChange:S=>F({...R,raw_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"add-clone",children:"克隆前缀 *"}),e.jsx(ce,{id:"add-clone",placeholder:"https://example.com/clone",value:R.clone_prefix,onChange:S=>F({...R,clone_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"add-priority",children:"优先级"}),e.jsx(ce,{id:"add-priority",type:"number",min:"1",value:R.priority,onChange:S=>F({...R,priority:parseInt(S.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"add-enabled",checked:R.enabled,onCheckedChange:S=>F({...R,enabled:S})}),e.jsx(N,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>k(!1),children:"取消"}),e.jsx(b,{onClick:M,children:"添加"})]})]})}),e.jsx(Qt,{open:T,onOpenChange:E,children:e.jsxs(Ut,{className:"max-w-lg",children:[e.jsxs(Bt,{children:[e.jsx(Ht,{children:"编辑镜像源"}),e.jsx(ss,{children:"修改镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"镜像源 ID"}),e.jsx(ce,{value:R.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit-name",children:"名称 *"}),e.jsx(ce,{id:"edit-name",value:R.name,onChange:S=>F({...R,name:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),e.jsx(ce,{id:"edit-raw",value:R.raw_prefix,onChange:S=>F({...R,raw_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit-clone",children:"克隆前缀 *"}),e.jsx(ce,{id:"edit-clone",value:R.clone_prefix,onChange:S=>F({...R,clone_prefix:S.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"edit-priority",children:"优先级"}),e.jsx(ce,{id:"edit-priority",type:"number",min:"1",value:R.priority,onChange:S=>F({...R,priority:parseInt(S.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ge,{id:"edit-enabled",checked:R.enabled,onCheckedChange:S=>F({...R,enabled:S})}),e.jsx(N,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),e.jsxs(os,{children:[e.jsx(b,{variant:"outline",onClick:()=>E(!1),children:"取消"}),e.jsx(b,{onClick:Z,children:"保存"})]})]})})]})})}const Yc=u.forwardRef(({className:n,...r},c)=>e.jsx(zp,{ref:c,className:K("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n),...r}));Yc.displayName=zp.displayName;const m2=u.forwardRef(({className:n,...r},c)=>e.jsx(Ap,{ref:c,className:K("aspect-square h-full w-full",n),...r}));m2.displayName=Ap.displayName;const Xc=u.forwardRef(({className:n,...r},c)=>e.jsx(Mp,{ref:c,className:K("flex h-full w-full items-center justify-center rounded-full bg-muted",n),...r}));Xc.displayName=Mp.displayName;function h2(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function x2(){const n="maibot_webui_user_id";let r=localStorage.getItem(n);return r||(r=h2(),localStorage.setItem(n,r)),r}function f2(){return localStorage.getItem("maibot_webui_user_name")||"WebUI用户"}function p2(n){localStorage.setItem("maibot_webui_user_name",n)}function g2(){const[n,r]=u.useState([]),[c,d]=u.useState(""),[h,x]=u.useState(!1),[f,j]=u.useState(!1),[p,w]=u.useState(!1),[v,k]=u.useState(!0),[T,E]=u.useState(f2()),[R,F]=u.useState(!1),[U,M]=u.useState(""),[Z,G]=u.useState({}),z=u.useRef(x2()),B=u.useRef(null),X=u.useRef(null),S=u.useRef(null),O=u.useRef(0),se=u.useRef(new Set),{toast:he}=Rt(),ye=Q=>(O.current+=1,`${Q}-${Date.now()}-${O.current}-${Math.random().toString(36).substr(2,9)}`),be=u.useCallback(()=>{X.current?.scrollIntoView({behavior:"smooth"})},[]);u.useEffect(()=>{be()},[n,be]);const pe=u.useCallback(async()=>{k(!0);try{const Q=`/api/chat/history?user_id=${z.current}&limit=50`;console.log("[Chat] 正在加载历史消息:",Q);const de=await fetch(Q);if(console.log("[Chat] 历史消息响应状态:",de.status,de.statusText),console.log("[Chat] 响应 Content-Type:",de.headers.get("content-type")),de.ok){const ge=await de.text();console.log("[Chat] 响应内容前100字符:",ge.substring(0,100));try{const le=JSON.parse(ge);if(console.log("[Chat] 解析后的数据:",le),le.messages&&le.messages.length>0){const L=le.messages.map($=>({id:$.id,type:$.type,content:$.content,timestamp:$.timestamp,sender:{name:$.sender_name||($.is_bot?"麦麦":"WebUI用户"),user_id:$.user_id,is_bot:$.is_bot}}));r(L),console.log("[Chat] 已加载历史消息数量:",L.length),L.forEach($=>{if($.type==="bot"){const D=`bot-${$.content}-${Math.floor($.timestamp*1e3)}`;se.current.add(D)}})}else console.log("[Chat] 没有历史消息")}catch(le){console.error("[Chat] JSON 解析失败:",le),console.error("[Chat] 原始响应内容:",ge)}}else{console.error("[Chat] 响应失败:",de.status);const ge=await de.text();console.error("[Chat] 错误响应内容:",ge.substring(0,200))}}catch(Q){console.error("[Chat] 加载历史消息失败:",Q)}finally{k(!1)}},[]),je=u.useCallback(()=>{if(B.current?.readyState===WebSocket.OPEN||B.current?.readyState===WebSocket.CONNECTING){console.log("WebSocket 已存在,跳过连接");return}j(!0);const de=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws?user_id=${encodeURIComponent(z.current)}&user_name=${encodeURIComponent(T)}`;console.log("正在连接 WebSocket:",de);try{const ge=new WebSocket(de);B.current=ge,ge.onopen=()=>{x(!0),j(!1),console.log("WebSocket 已连接")},ge.onmessage=le=>{try{const L=JSON.parse(le.data);switch(L.type){case"session_info":G({session_id:L.session_id,user_id:L.user_id,user_name:L.user_name,bot_name:L.bot_name});break;case"system":r($=>[...$,{id:ye("sys"),type:"system",content:L.content||"",timestamp:L.timestamp||Date.now()/1e3}]);break;case"user_message":r($=>[...$,{id:L.message_id||ye("user"),type:"user",content:L.content||"",timestamp:L.timestamp||Date.now()/1e3,sender:L.sender}]);break;case"bot_message":{w(!1);const $=`bot-${L.content}-${Math.floor((L.timestamp||0)*1e3)}`;if(se.current.has($)){console.log("跳过重复的机器人消息");break}if(se.current.add($),se.current.size>100){const D=se.current.values().next().value;D&&se.current.delete(D)}r(D=>[...D,{id:ye("bot"),type:"bot",content:L.content||"",timestamp:L.timestamp||Date.now()/1e3,sender:L.sender}]);break}case"typing":w(L.is_typing||!1);break;case"error":r($=>[...$,{id:ye("error"),type:"error",content:L.content||"发生错误",timestamp:L.timestamp||Date.now()/1e3}]),he({title:"错误",description:L.content,variant:"destructive"});break;case"pong":break;default:console.log("未知消息类型:",L.type)}}catch(L){console.error("解析消息失败:",L)}},ge.onclose=()=>{x(!1),j(!1),B.current=null,console.log("WebSocket 已断开"),S.current&&clearTimeout(S.current),S.current=window.setTimeout(()=>{_e.current||je()},5e3)},ge.onerror=le=>{console.error("WebSocket 错误:",le),j(!1)}}catch(ge){console.error("创建 WebSocket 失败:",ge),j(!1)}},[he,T]),_e=u.useRef(!1);u.useEffect(()=>{_e.current=!1,pe();const Q=setTimeout(()=>{_e.current||je()},100),de=setInterval(()=>{B.current?.readyState===WebSocket.OPEN&&B.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>{_e.current=!0,clearTimeout(Q),clearInterval(de),S.current&&(clearTimeout(S.current),S.current=null),B.current&&(B.current.close(),B.current=null)}},[je,pe]);const y=u.useCallback(()=>{!c.trim()||!B.current||B.current.readyState!==WebSocket.OPEN||(B.current.send(JSON.stringify({type:"message",content:c.trim(),user_name:T})),d(""))},[c,T]),q=Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),y())},H=()=>{M(T),F(!0)},ie=()=>{const Q=U.trim()||"WebUI用户";E(Q),p2(Q),F(!1),B.current?.readyState===WebSocket.OPEN&&B.current.send(JSON.stringify({type:"update_nickname",user_name:Q}))},_=()=>{M(""),F(!1)},me=Q=>new Date(Q*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),xe=()=>{B.current&&B.current.close(),je()};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("div",{className:"shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx(Yc,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:e.jsx(Xc,{className:"bg-primary/10 text-primary",children:e.jsx(ar,{className:"h-4 w-4 sm:h-5 sm:w-5"})})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-base sm:text-lg font-semibold truncate",children:Z.bot_name||"麦麦"}),e.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:h?e.jsxs(e.Fragment,{children:[e.jsx(_y,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"已连接"})]}):f?e.jsxs(e.Fragment,{children:[e.jsx(vs,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"连接中..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Sy,{className:"h-3 w-3 text-red-500"}),e.jsx("span",{className:"text-red-600 dark:text-red-400",children:"未连接"})]})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v&&e.jsx(vs,{className:"h-4 w-4 animate-spin text-muted-foreground"}),e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:xe,disabled:f,title:"重新连接",children:e.jsx(ps,{className:K("h-4 w-4",f&&"animate-spin")})})]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:[e.jsx(Ic,{className:"h-3 w-3"}),e.jsx("span",{children:"当前身份:"}),R?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{value:U,onChange:Q=>M(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&ie(),Q.key==="Escape"&&_()},className:"h-7 w-32",placeholder:"输入昵称",autoFocus:!0}),e.jsx(b,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:ie,children:"保存"}),e.jsx(b,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:_,children:"取消"})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium text-foreground",children:T}),e.jsx(b,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:H,title:"修改昵称",children:e.jsx(Cy,{className:"h-3 w-3"})})]})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Ie,{className:"h-full",children:e.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto space-y-3 sm:space-y-4",children:[n.length===0&&!v&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(ar,{className:"h-12 w-12 mb-4 opacity-50"}),e.jsxs("p",{className:"text-sm",children:["开始与 ",Z.bot_name||"麦麦"," 对话吧!"]})]}),n.map(Q=>e.jsxs("div",{className:K("flex gap-2 sm:gap-3",Q.type==="user"&&"flex-row-reverse",Q.type==="system"&&"justify-center",Q.type==="error"&&"justify-center"),children:[Q.type==="system"&&e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-3 py-1 rounded-full max-w-[90%]",children:Q.content}),Q.type==="error"&&e.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-100 dark:bg-red-900/30 px-3 py-1 rounded-full max-w-[90%]",children:Q.content}),(Q.type==="user"||Q.type==="bot")&&e.jsxs(e.Fragment,{children:[e.jsx(Yc,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Xc,{className:K("text-xs",Q.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:Q.type==="bot"?e.jsx(ar,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):e.jsx(Ic,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:K("flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",Q.type==="user"&&"items-end"),children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] sm:text-xs text-muted-foreground",children:[e.jsx("span",{className:"hidden sm:inline",children:Q.sender?.name||(Q.type==="bot"?Z.bot_name:T)}),e.jsx("span",{children:me(Q.timestamp)})]}),e.jsx("div",{className:K("rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",Q.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:Q.content})]})]})]},Q.id)),p&&e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsx(Yc,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Xc,{className:"bg-primary/10 text-primary",children:e.jsx(ar,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),e.jsx("div",{ref:X})]})})}),e.jsx("div",{className:"shrink-0 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsx("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{value:c,onChange:Q=>d(Q.target.value),onKeyDown:q,placeholder:h?"输入消息...":"等待连接...",disabled:!h,className:"flex-1 h-10 sm:h-10"}),e.jsx(b,{onClick:y,disabled:!h||!c.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:e.jsx(ky,{className:"h-4 w-4"})})]})})})]})}function j2(){const n=ua(),[r,c]=u.useState(!0);return u.useEffect(()=>{let d=!1;return(async()=>{try{const x=await Fu();!d&&!x&&n({to:"/auth"})}catch{d||n({to:"/auth"})}finally{d||c(!1)}})(),()=>{d=!0}},[n]),{checking:r}}async function v2(){return await Fu()}const b2=ei("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),Ag=u.forwardRef(({className:n,size:r,abbrTitle:c,children:d,...h},x)=>e.jsx("kbd",{className:K(b2({size:r,className:n})),ref:x,...h,children:c?e.jsx("abbr",{title:c,children:d}):d}));Ag.displayName="Kbd";const y2=[{icon:to,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Ta,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:ng,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:ig,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:Lu,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Pn,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:rg,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:Ty,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:ln,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:Uu,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:ti,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function N2({open:n,onOpenChange:r}){const[c,d]=u.useState(""),[h,x]=u.useState(0),f=ua(),j=y2.filter(v=>v.title.toLowerCase().includes(c.toLowerCase())||v.description.toLowerCase().includes(c.toLowerCase())||v.category.toLowerCase().includes(c.toLowerCase()));u.useEffect(()=>{n&&(d(""),x(0))},[n]);const p=u.useCallback(v=>{f({to:v}),r(!1)},[f,r]),w=u.useCallback(v=>{v.key==="ArrowDown"?(v.preventDefault(),x(k=>(k+1)%j.length)):v.key==="ArrowUp"?(v.preventDefault(),x(k=>(k-1+j.length)%j.length)):v.key==="Enter"&&j[h]&&(v.preventDefault(),p(j[h].path))},[j,h,p]);return e.jsx(Qt,{open:n,onOpenChange:r,children:e.jsxs(Ut,{className:"max-w-2xl p-0 gap-0",children:[e.jsxs(Bt,{className:"px-4 pt-4 pb-0",children:[e.jsx(Ht,{className:"sr-only",children:"搜索"}),e.jsxs("div",{className:"relative",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(ce,{value:c,onChange:v=>{d(v.target.value),x(0)},onKeyDown:w,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),e.jsx("div",{className:"border-t",children:e.jsx(Ie,{className:"h-[400px]",children:j.length>0?e.jsx("div",{className:"p-2",children:j.map((v,k)=>{const T=v.icon;return e.jsxs("button",{onClick:()=>p(v.path),onMouseEnter:()=>x(k),className:K("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",k===h?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[e.jsx(T,{className:"h-5 w-5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm",children:v.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:v.description})]}),e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:v.category})]},v.path)})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Os,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),e.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}const w2=Jb,_2=Ib,S2=Pb,Mg=u.forwardRef(({className:n,sideOffset:r=4,...c},d)=>e.jsx(Zb,{children:e.jsx(Yp,{ref:d,sideOffset:r,className:K("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 origin-[--radix-tooltip-content-transform-origin]",n),...c})}));Mg.displayName=Yp.displayName;function C2({children:n}){const{checking:r}=j2(),[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),{theme:p,setTheme:w}=Hu(),v=Pv();if(u.useEffect(()=>{const F=U=>{(U.metaKey||U.ctrlKey)&&U.key==="k"&&(U.preventDefault(),j(!0))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[]),r)return e.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:e.jsx("div",{className:"text-muted-foreground",children:"正在验证登录状态..."})});const k=[{title:"概览",items:[{icon:to,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Ta,label:"麦麦主程序配置",path:"/config/bot"},{icon:ng,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:ig,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:Vf,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:Lu,label:"表情包管理",path:"/resource/emoji"},{icon:Pn,label:"表达方式管理",path:"/resource/expression"},{icon:rg,label:"人物信息管理",path:"/resource/person"},{icon:lg,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:ln,label:"插件市场",path:"/plugins"},{icon:Vf,label:"插件配置",path:"/plugin-config"},{icon:Uu,label:"日志查看器",path:"/logs"},{icon:Pn,label:"本地聊天室",path:"/chat"}]},{title:"系统",items:[{icon:ti,label:"系统设置",path:"/settings"}]}],E=p==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":p,R=async()=>{await IN()};return e.jsx(w2,{delayDuration:300,children:e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsxs("aside",{className:K("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",c?"lg:w-64":"lg:w-16",h?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[e.jsx("div",{className:"flex h-16 items-center border-b px-4",children:e.jsxs("div",{className:K("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!c&&"lg:flex-none lg:w-8"),children:[e.jsxs("div",{className:K("flex items-baseline gap-2",!c&&"lg:hidden"),children:[e.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),e.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:RN()})]}),!c&&e.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),e.jsx(Ie,{className:K("flex-1 overflow-x-hidden",!c&&"lg:w-16"),children:e.jsx("nav",{className:K("p-4",!c&&"lg:p-2 lg:w-16"),children:e.jsx("ul",{className:K("space-y-6",!c&&"lg:space-y-3 lg:w-full"),children:k.map((F,U)=>e.jsxs("li",{children:[e.jsx("div",{className:K("px-3 h-[1.25rem]","mb-2",!c&&"lg:mb-1 lg:invisible"),children:e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:F.title})}),!c&&U>0&&e.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),e.jsx("ul",{className:"space-y-1",children:F.items.map(M=>{const Z=v({to:M.path}),G=M.icon,z=e.jsxs(e.Fragment,{children:[Z&&e.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),e.jsxs("div",{className:K("flex items-center transition-all duration-300",c?"gap-3":"gap-3 lg:gap-0"),children:[e.jsx(G,{className:K("h-5 w-5 flex-shrink-0",Z&&"text-primary"),strokeWidth:2,fill:"none"}),e.jsx("span",{className:K("text-sm font-medium whitespace-nowrap transition-all duration-300",Z&&"font-semibold",c?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:M.label})]})]});return e.jsx("li",{className:"relative",children:e.jsxs(_2,{children:[e.jsx(S2,{asChild:!0,children:e.jsx(Vc,{to:M.path,"data-tour":M.tourId,className:K("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",Z?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",c?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>x(!1),children:z})}),!c&&e.jsx(Mg,{side:"right",className:"hidden lg:block",children:e.jsx("p",{children:M.label})})]})},M.path)})})]},F.title))})})})]}),h&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>x(!1)}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:()=>x(!h),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:e.jsx(Ey,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>d(!c),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:c?"收起侧边栏":"展开侧边栏",children:e.jsx(nn,{className:K("h-5 w-5 transition-transform",!c&&"rotate-180")})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>j(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),e.jsxs(Ag,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[e.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsx(N2,{open:f,onOpenChange:j}),e.jsxs(b,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[e.jsx(zy,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),e.jsx("button",{onClick:F=>{zN(E==="dark"?"light":"dark",w,F)},className:"rounded-lg p-2 hover:bg-accent",title:E==="dark"?"切换到浅色模式":"切换到深色模式",children:E==="dark"?e.jsx(eg,{className:"h-5 w-5"}):e.jsx(tg,{className:"h-5 w-5"})}),e.jsx("div",{className:"h-6 w-px bg-border"}),e.jsxs(b,{variant:"ghost",size:"sm",onClick:R,className:"gap-2",title:"登出系统",children:[e.jsx(Ay,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),e.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:n})]})]})})}function k2(n){const r=n.split(` +`).slice(1),c=[];for(const d of r){const h=d.trim();if(!h.startsWith("at "))continue;const x=h.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);x?c.push({functionName:x[1]||"",fileName:x[2],lineNumber:x[3],columnNumber:x[4],raw:h}):c.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:h})}return c}function T2({error:n,errorInfo:r}){const[c,d]=u.useState(!0),[h,x]=u.useState(!1),[f,j]=u.useState(!1),p=n.stack?k2(n.stack):[],w=async()=>{const v=` +Error: ${n.name} +Message: ${n.message} + +Stack Trace: +${n.stack||"No stack trace available"} + +Component Stack: +${r?.componentStack||"No component stack available"} + +URL: ${window.location.href} +User Agent: ${navigator.userAgent} +Time: ${new Date().toISOString()} + `.trim();try{await navigator.clipboard.writeText(v),j(!0),setTimeout(()=>j(!1),2e3)}catch(k){console.error("Failed to copy:",k)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(al,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[e.jsx(pa,{className:"h-4 w-4"}),e.jsxs(ll,{className:"font-mono text-sm",children:[e.jsxs("span",{className:"font-semibold",children:[n.name,":"]})," ",n.message]})]}),p.length>0&&e.jsxs(Du,{open:c,onOpenChange:d,children:[e.jsx(Ou,{asChild:!0,children:e.jsxs(b,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(My,{className:"h-4 w-4"}),"Stack Trace (",p.length," frames)"]}),c?e.jsx(or,{className:"h-4 w-4"}):e.jsx(Dl,{className:"h-4 w-4"})]})}),e.jsx(Ru,{children:e.jsx(Ie,{className:"h-[280px] rounded-md border bg-muted/30",children:e.jsx("div",{className:"p-3 space-y-1",children:p.map((v,k)=>e.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[k+1,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-primary font-medium",children:v.functionName}),v.fileName&&e.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[v.fileName,v.lineNumber&&e.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",v.lineNumber,":",v.columnNumber]})]})]})]})},k))})})})]}),r?.componentStack&&e.jsxs(Du,{open:h,onOpenChange:x,children:[e.jsx(Ou,{asChild:!0,children:e.jsxs(b,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx(pa,{className:"h-4 w-4"}),"Component Stack"]}),h?e.jsx(or,{className:"h-4 w-4"}):e.jsx(Dl,{className:"h-4 w-4"})]})}),e.jsx(Ru,{children:e.jsx(Ie,{className:"h-[200px] rounded-md border bg-muted/30",children:e.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:r.componentStack})})})]}),e.jsx(b,{variant:"outline",size:"sm",onClick:w,className:"w-full",children:f?e.jsxs(e.Fragment,{children:[e.jsx(ga,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):e.jsxs(e.Fragment,{children:[e.jsx(Jc,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function Dg({error:n,errorInfo:r}){const c=()=>{window.location.href="/"},d=()=>{window.location.reload()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(Ve,{className:"w-full max-w-2xl shadow-lg",children:[e.jsxs(pt,{className:"text-center pb-2",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:e.jsx(pa,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),e.jsx(gt,{className:"text-2xl font-bold",children:"页面出现了问题"}),e.jsx(Kt,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),e.jsxs(yt,{className:"space-y-4",children:[e.jsx(T2,{error:n,errorInfo:r}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[e.jsxs(b,{onClick:d,className:"flex-1",children:[e.jsx(ps,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),e.jsxs(b,{onClick:c,variant:"outline",className:"flex-1",children:[e.jsx(to,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class E2 extends u.Component{constructor(r){super(r),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,c){console.error("ErrorBoundary caught an error:",r,c),this.setState({errorInfo:c})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:e.jsx(Dg,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function Og({error:n}){return e.jsx(Dg,{error:n,errorInfo:null})}const yr=Wv({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(hp,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!v2())throw tb({to:"/auth"})}}),z2=as({getParentRoute:()=>yr,path:"/auth",component:PN}),A2=as({getParentRoute:()=>yr,path:"/setup",component:f0}),ys=as({getParentRoute:()=>yr,id:"protected",component:()=>e.jsx(C2,{children:e.jsx(hp,{})}),errorComponent:({error:n})=>e.jsx(Og,{error:n})}),M2=as({getParentRoute:()=>ys,path:"/",component:TN}),D2=as({getParentRoute:()=>ys,path:"/config/bot",component:T0}),O2=as({getParentRoute:()=>ys,path:"/config/modelProvider",component:P0}),R2=as({getParentRoute:()=>ys,path:"/config/model",component:sw}),L2=as({getParentRoute:()=>ys,path:"/config/adapter",component:lw}),U2=as({getParentRoute:()=>ys,path:"/resource/emoji",component:Tw}),B2=as({getParentRoute:()=>ys,path:"/resource/expression",component:qw}),H2=as({getParentRoute:()=>ys,path:"/resource/person",component:Iw}),q2=as({getParentRoute:()=>ys,path:"/resource/knowledge-graph",component:i1}),G2=as({getParentRoute:()=>ys,path:"/logs",component:U1}),V2=as({getParentRoute:()=>ys,path:"/chat",component:g2}),F2=as({getParentRoute:()=>ys,path:"/plugins",component:r2}),$2=as({getParentRoute:()=>ys,path:"/plugin-config",component:d2}),Q2=as({getParentRoute:()=>ys,path:"/plugin-mirrors",component:u2}),Y2=as({getParentRoute:()=>ys,path:"/settings",component:QN}),X2=as({getParentRoute:()=>yr,path:"*",component:bg}),K2=yr.addChildren([z2,A2,ys.addChildren([M2,D2,O2,R2,L2,U2,B2,H2,q2,F2,$2,Q2,G2,V2,Y2]),X2]),Z2=eb({routeTree:K2,defaultNotFoundComponent:bg,defaultErrorComponent:({error:n})=>e.jsx(Og,{error:n})});function J2({children:n,defaultTheme:r="system",storageKey:c="ui-theme",...d}){const[h,x]=u.useState(()=>localStorage.getItem(c)||r);u.useEffect(()=>{const j=window.document.documentElement;if(j.classList.remove("light","dark"),h==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";j.classList.add(p);return}j.classList.add(h)},[h]),u.useEffect(()=>{const j=localStorage.getItem("accent-color");if(j){const p=document.documentElement,v={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[j];v&&(p.style.setProperty("--primary",v.hsl),v.gradient?(p.style.setProperty("--primary-gradient",v.gradient),p.classList.add("has-gradient")):(p.style.removeProperty("--primary-gradient"),p.classList.remove("has-gradient")))}},[]);const f={theme:h,setTheme:j=>{localStorage.setItem(c,j),x(j)}};return e.jsx(xg.Provider,{...d,value:f,children:n})}function I2({children:n,defaultEnabled:r=!0,defaultWavesEnabled:c=!0,storageKey:d="enable-animations",wavesStorageKey:h="enable-waves-background"}){const[x,f]=u.useState(()=>{const v=localStorage.getItem(d);return v!==null?v==="true":r}),[j,p]=u.useState(()=>{const v=localStorage.getItem(h);return v!==null?v==="true":c});u.useEffect(()=>{const v=document.documentElement;x?v.classList.remove("no-animations"):v.classList.add("no-animations"),localStorage.setItem(d,String(x))},[x,d]),u.useEffect(()=>{localStorage.setItem(h,String(j))},[j,h]);const w={enableAnimations:x,setEnableAnimations:f,enableWavesBackground:j,setEnableWavesBackground:p};return e.jsx(fg.Provider,{value:w,children:n})}const P2=Wb,Rg=u.forwardRef(({className:n,...r},c)=>e.jsx(Xp,{ref:c,className:K("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",n),...r}));Rg.displayName=Xp.displayName;const W2=ei("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),Lg=u.forwardRef(({className:n,variant:r,...c},d)=>e.jsx(Kp,{ref:d,className:K(W2({variant:r}),n),...c}));Lg.displayName=Kp.displayName;const e_=u.forwardRef(({className:n,...r},c)=>e.jsx(Zp,{ref:c,className:K("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...r}));e_.displayName=Zp.displayName;const Ug=u.forwardRef(({className:n,...r},c)=>e.jsx(Jp,{ref:c,className:K("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...r,children:e.jsx(si,{className:"h-4 w-4"})}));Ug.displayName=Jp.displayName;const Bg=u.forwardRef(({className:n,...r},c)=>e.jsx(Ip,{ref:c,className:K("text-sm font-semibold [&+div]:text-xs",n),...r}));Bg.displayName=Ip.displayName;const Hg=u.forwardRef(({className:n,...r},c)=>e.jsx(Pp,{ref:c,className:K("text-sm opacity-90",n),...r}));Hg.displayName=Pp.displayName;function t_(){const{toasts:n}=Rt();return e.jsxs(P2,{children:[n.map(function({id:r,title:c,description:d,action:h,...x}){return e.jsxs(Lg,{...x,children:[e.jsxs("div",{className:"grid gap-1",children:[c&&e.jsx(Bg,{children:c}),d&&e.jsx(Hg,{children:d})]}),h,e.jsx(Ug,{})]},r)}),e.jsx(Rg,{})]})}gN.createRoot(document.getElementById("root")).render(e.jsx(u.StrictMode,{children:e.jsx(E2,{children:e.jsx(J2,{defaultTheme:"system",children:e.jsx(I2,{children:e.jsxs(X0,{children:[e.jsx(sb,{router:Z2}),e.jsx(J0,{}),e.jsx(t_,{})]})})})})})); diff --git a/webui/dist/assets/index-ceRg_XiX.css b/webui/dist/assets/index-ceRg_XiX.css new file mode 100644 index 00000000..0ac3fa6c --- /dev/null +++ b/webui/dist/assets/index-ceRg_XiX.css @@ -0,0 +1 @@ +@charset "UTF-8";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[350px\]{height:350px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-full{max-height:100%}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[1px\]{width:1px}.w-\[65px\]{width:65px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-32{max-width:8rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[75\%\]{max-width:75%}.max-w-\[90\%\]{max-width:90%}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-sm{border-top-right-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-muted-foreground\/50{border-color:hsl(var(--muted-foreground) / .5)}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500\/50{border-color:#eab30880}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/50{background-color:hsl(var(--muted-foreground) / .5)}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/5{background-color:#eab3080d}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.__floater{z-index:99999!important;pointer-events:auto!important}.react-joyride__overlay,.react-joyride__spotlight{z-index:99998!important}.react-joyride__tooltip{pointer-events:auto!important}#tour-portal-container *{pointer-events:auto}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-muted-foreground\/50:hover{border-color:hsl(var(--muted-foreground) / .5)}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-yellow-300:hover{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:cursor-grabbing:active{cursor:grabbing}.active\:border-primary\/70:active{border-color:hsl(var(--primary) / .7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fade-out[data-state=closed]{animation:fade-out .15s ease-in}.data-\[state\=closed\]\:animate-slide-out-to-right[data-state=closed]{animation:slide-out-to-right .2s ease-in}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fade-in[data-state=open]{animation:fade-in .2s ease-out}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.data-\[state\=open\]\:animate-slide-in-from-right[data-state=open]{animation:slide-in-from-right .3s ease-out}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}.data-\[swipe\=end\]\:animate-slide-out-to-right[data-swipe=end]{animation:slide-out-to-right .2s ease-in}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}@supports (backdrop-filter: var(--tw)){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background) / .6)}}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-orange-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(124 45 18 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-green-950\/20:is(.dark *){background-color:#052e1633}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-0{margin-left:0}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-8{height:2rem}.sm\:h-9{height:2.25rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-28{width:7rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-8{width:2rem}.sm\:w-80{width:20rem}.sm\:w-96{width:24rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:min-w-\[120px\]{min-width:120px}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[420px\]{max-width:420px}.sm\:max-w-\[70\%\]{max-width:70%}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:pb-4{padding-bottom:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-4{margin-bottom:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-5{height:1.25rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-5{width:1.25rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:gap-4{gap:1rem}.md\:gap-6{gap:1.5rem}.md\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:whitespace-normal{white-space:normal}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mx-auto{margin-left:auto;margin-right:auto}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-12{width:3rem}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[130px\]{width:130px}.lg\:w-\[160px\]{width:160px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[75px\]{width:75px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-2{padding:.5rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:pb-6{padding-bottom:1.5rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:opacity-0{opacity:0}}@media(min-width:1280px){.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}.uppy-Root{box-sizing:border-box;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1;position:relative;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.uppy-Root[dir=rtl],[dir=rtl] .uppy-Root{text-align:right}.uppy-Root *,.uppy-Root :after,.uppy-Root :before{box-sizing:inherit}.uppy-Root [hidden]{display:none}.uppy-u-reset{all:initial;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1}[dir=rtl] .uppy-u-reset{text-align:right}.uppy-c-textInput{background-color:#fff;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;padding:6px 8px}.uppy-size--md .uppy-c-textInput{padding:8px 10px}.uppy-c-textInput:focus{border-color:#1269cf99;box-shadow:0 0 0 3px #1269cf26;outline:none}[data-uppy-theme=dark] .uppy-c-textInput{background-color:#333;border-color:#333;color:#eaeaea}[data-uppy-theme=dark] .uppy-c-textInput:focus{border-color:#525252;box-shadow:none}.uppy-c-icon{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;fill:currentColor}.uppy-c-btn{align-items:center;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-weight:500;justify-content:center;line-height:1;transition-duration:.3s;transition-property:background-color,color;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.uppy-c-btn,[dir=rtl] .uppy-c-btn{text-align:center}.uppy-c-btn:not(:disabled):not(.disabled){cursor:pointer}.uppy-c-btn::-moz-focus-inner{border:0}.uppy-c-btn-primary{background-color:#1269cf;border-radius:4px;color:#fff;font-size:14px;padding:10px 18px}.uppy-c-btn-primary:not(:disabled):hover{background-color:#0e51a0}.uppy-c-btn-primary:focus{box-shadow:0 0 0 3px #1269cf66;outline:none}.uppy-size--md .uppy-c-btn-primary{padding:13px 22px}[data-uppy-theme=dark] .uppy-c-btn-primary{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-primary::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-c-btn-primary.uppy-c-btn--disabled{background-color:#8eb2db}.uppy-c-btn-link{background-color:initial;border-radius:4px;color:#525252;font-size:14px;line-height:1;padding:10px 15px}.uppy-c-btn-link:hover{color:#333}.uppy-c-btn-link:focus{box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-size--md .uppy-c-btn-link{padding:13px 18px}[data-uppy-theme=dark] .uppy-c-btn-link{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-link:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-link::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-link:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-c-btn-link:hover{color:#939393}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:6px}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list:after,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list:after{content:"";flex:auto}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{margin:0;position:relative;width:50%}.uppy-size--md .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--md .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:33.3333%}.uppy-size--lg .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--lg .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:25%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem:before,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem:before{content:"";display:block;padding-top:100%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected svg{opacity:.85}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--disabled,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--disabled{opacity:.5}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#93939333}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#eaeaea33}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{height:30%;width:30%;fill:#000000b3}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{fill:#fffc}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{border-radius:4px;height:calc(100% - 14px);inset:7px;overflow:hidden;position:absolute;text-align:center;width:calc(100% - 14px)}@media(hover:none){.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author{display:block}}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{box-shadow:0 0 0 3px #aae1ffb3}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner img{border-radius:4px;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author{background:#0000004d;bottom:0;color:#fff;display:none;font-size:12px;font-weight:500;left:0;margin:0;padding:5px;position:absolute;text-decoration:none;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author:hover,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author:hover{background:#0006;text-decoration:underline}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-radius:50%;height:26px;opacity:0;position:absolute;right:16px;top:16px;width:26px;z-index:1002}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox:after{height:7px;inset-inline-start:7px;top:8px;width:12px}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{opacity:1}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author{display:block}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus{outline:none}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner{border:0}.uppy-ProviderBrowser-viewType--list{background-color:#fff}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list{background-color:#1f1f1f}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{align-items:center;display:flex;margin:0;padding:7px 15px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{color:#eaeaea}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem--disabled{opacity:.6}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox{background-color:#fff;border:1px solid #cfcfcf;border-radius:3px;height:17px;margin-inline-end:15px;width:17px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border:1px solid #1269cf;box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:after{height:5px;inset-inline-start:3px;opacity:0;top:4px;width:9px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border-color:#02baf2b3;box-shadow:0 0 0 3px #02baf233}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-color:#1269cf}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{opacity:1}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner{align-items:center;color:inherit;display:flex;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;overflow:hidden;padding:2px;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner:focus{outline:none;text-decoration:underline}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner svg{margin-inline-end:8px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner span{line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--disabled .uppy-ProviderBrowserItem-inner{cursor:default}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-iconWrap{margin-inline-end:7px;width:20px}.uppy-ProviderBrowserItem-checkbox{cursor:pointer;flex-shrink:0;position:relative}.uppy-ProviderBrowserItem-checkbox:disabled,.uppy-ProviderBrowserItem-checkbox:disabled:after{cursor:default}[data-uppy-theme=dark] .uppy-ProviderBrowserItem-checkbox{background-color:#1f1f1f;border-color:#939393}[data-uppy-theme=dark] .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{background-color:#333}.uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after{border-bottom:2px solid #eaeaea;border-left:2px solid #eaeaea;content:"";cursor:pointer;position:absolute;transform:rotate(-45deg)}.uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{background-color:#eaeaea!important;content:""!important;height:2px!important;left:20%!important;position:absolute!important;right:20%!important;top:50%!important;transform:translateY(-50%)!important}.uppy-SearchProvider{align-items:center;display:flex;flex:1;flex-direction:column;height:100%;justify-content:center;width:100%}[data-uppy-theme=dark] .uppy-SearchProvider{background-color:#1f1f1f}.uppy-SearchProvider-input{margin-bottom:15px;max-width:650px;width:90%}.uppy-size--md .uppy-SearchProvider-input{margin-bottom:20px}.uppy-SearchProvider-input::-webkit-search-cancel-button{display:none}.uppy-SearchProvider-searchButton{padding:13px 25px}.uppy-size--md .uppy-SearchProvider-searchButton{padding:13px 30px}.uppy-DashboardContent-panelBody{align-items:center;display:flex;flex:1;justify-content:center}[data-uppy-theme=dark] .uppy-DashboardContent-panelBody{background-color:#1f1f1f}.uppy-Provider-auth,.uppy-Provider-empty,.uppy-Provider-error,.uppy-Provider-loading{align-items:center;color:#939393;display:flex;flex:1;flex-flow:column wrap;justify-content:center}.uppy-Provider-empty{color:#939393}.uppy-Provider-authIcon svg{height:75px;width:100px}.uppy-Provider-authTitle{color:#757575;font-size:17px;font-weight:400;line-height:1.4;margin-bottom:30px;max-width:500px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Provider-authTitle{font-size:20px}[data-uppy-theme=dark] .uppy-Provider-authTitle{color:#cfcfcf}.uppy-Provider-btn-google{align-items:center;background:#4285f4;display:flex;padding:8px 12px!important}.uppy-Provider-btn-google:hover{background-color:#1266f1}.uppy-Provider-btn-google:focus{box-shadow:0 0 0 3px #4285f466;outline:none}.uppy-Provider-btn-google svg{margin-right:8px}.uppy-Provider-breadcrumbs{color:#525252;flex:1;font-size:12px;margin-bottom:10px;text-align:start}.uppy-size--md .uppy-Provider-breadcrumbs{margin-bottom:0}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs{color:#eaeaea}.uppy-Provider-breadcrumbsIcon{color:#525252;display:inline-block;line-height:1;margin-inline-end:4px;vertical-align:middle}.uppy-Provider-breadcrumbsIcon svg{height:13px;width:13px;fill:#525252}.uppy-Provider-breadcrumbs button{border-radius:3px;display:inline-block;line-height:inherit;padding:4px}.uppy-Provider-breadcrumbs button:focus{outline:none}.uppy-Provider-breadcrumbs button::-moz-focus-inner{border:0}.uppy-Provider-breadcrumbs button:hover{color:#0e51a0}.uppy-Provider-breadcrumbs button:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button:focus{background-color:#333}.uppy-Provider-breadcrumbs button:not(:last-of-type){text-decoration:underline}.uppy-Provider-breadcrumbs button:last-of-type{color:#333;cursor:normal;font-weight:500;pointer-events:none}.uppy-Provider-breadcrumbs button:hover{cursor:pointer}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button{color:#eaeaea}.uppy-ProviderBrowser{display:flex;flex:1;flex-direction:column;font-size:14px;font-weight:400;height:100%}.uppy-ProviderBrowser-user{color:#333;font-weight:500;margin:0 8px 0 0}[data-uppy-theme=dark] .uppy-ProviderBrowser-user{color:#eaeaea}.uppy-ProviderBrowser-user:after{color:#939393;content:"·";font-weight:400;inset-inline-start:4px;position:relative}.uppy-ProviderBrowser-header{border-bottom:1px solid #eaeaea;position:relative;z-index:1001}[data-uppy-theme=dark] .uppy-ProviderBrowser-header{border-bottom:1px solid #333}.uppy-ProviderBrowser-headerBar{background-color:#fafafa;color:#757575;font-size:12px;line-height:1.4;padding:7px 15px;z-index:1001}.uppy-size--md .uppy-ProviderBrowser-headerBar{align-items:center;display:flex}[data-uppy-theme=dark] .uppy-ProviderBrowser-headerBar{background-color:#1f1f1f}.uppy-ProviderBrowser-headerBar--simple{display:block;justify-content:center;text-align:center}.uppy-ProviderBrowser-headerBar--simple .uppy-Provider-breadcrumbsWrap{display:inline-block;flex:none;vertical-align:middle}.uppy-ProviderBrowser-searchFilter{align-items:center;display:flex;height:30px;margin-bottom:15px;margin-top:15px;padding-left:8px;padding-right:8px;position:relative;width:100%}.uppy-ProviderBrowser-searchFilterInput{background-color:#eaeaea;border:0;border-radius:4px;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;font-size:13px;height:30px;line-height:1.4;outline:0;padding-inline-end:30px;padding-inline-start:30px;width:100%;z-index:1001}.uppy-ProviderBrowser-searchFilterInput::-webkit-search-cancel-button{display:none}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput{background-color:#1f1f1f;color:#eaeaea}.uppy-ProviderBrowser-searchFilterInput:focus{background-color:#cfcfcf;border:0}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput:focus{background-color:#333}.uppy-ProviderBrowser-searchFilterIcon{color:#757575;height:12px;inset-inline-start:16px;position:absolute;width:12px;z-index:1002}.uppy-ProviderBrowser-searchFilterInput::-moz-placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterInput::placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterReset{border-radius:3px;color:#939393;cursor:pointer;height:22px;inset-inline-end:16px;padding:6px;position:absolute;width:22px;z-index:1002}.uppy-ProviderBrowser-searchFilterReset:focus{outline:none}.uppy-ProviderBrowser-searchFilterReset::-moz-focus-inner{border:0}.uppy-ProviderBrowser-searchFilterReset:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-searchFilterReset:hover{color:#757575}.uppy-ProviderBrowser-searchFilterReset svg{vertical-align:text-top}.uppy-ProviderBrowser-userLogout{border-radius:3px;color:#1269cf;cursor:pointer;line-height:inherit;padding:4px}.uppy-ProviderBrowser-userLogout:focus{outline:none}.uppy-ProviderBrowser-userLogout::-moz-focus-inner{border:0}.uppy-ProviderBrowser-userLogout:hover{color:#0e51a0}.uppy-ProviderBrowser-userLogout:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout:focus{background-color:#333}.uppy-ProviderBrowser-userLogout:hover{text-decoration:underline}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout{color:#eaeaea}.uppy-ProviderBrowser-body{flex:1;position:relative}.uppy-ProviderBrowser-list{background-color:#fff;border-spacing:0;display:block;flex:1;height:100%;inset:0;list-style:none;margin:0;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;width:100%;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-ProviderBrowser-list{background-color:#1f1f1f}.uppy-ProviderBrowser-list:focus{outline:none}.uppy-ProviderBrowserItem-inner{cursor:pointer;font-size:13px;font-weight:500}.uppy-ProviderBrowser-footer{align-items:center;background-color:#fff;border-top:1px solid #eaeaea;display:flex;justify-content:space-between;padding:15px}.uppy-ProviderBrowser-footer button{margin-inline-end:8px}[data-uppy-theme=dark] .uppy-ProviderBrowser-footer{background-color:#1f1f1f;border-top:1px solid #333}.uppy-ProviderBrowser-footer-buttons{flex-shrink:0}.uppy-ProviderBrowser-footer-error{color:#e32437;line-height:18px}@media(max-width:426px){.uppy-ProviderBrowser-footer{align-items:stretch;flex-direction:column-reverse}.uppy-ProviderBrowser-footer-error{padding-bottom:10px}}.picker-dialog-bg{z-index:20000!important}.picker-dialog{z-index:20001!important}.uppy-Dashboard-Item-previewInnerWrap{align-items:center;border-radius:3px;box-shadow:0 0 2px #0006;display:flex;flex-direction:column;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}.uppy-size--md .uppy-Dashboard-Item-previewInnerWrap{box-shadow:0 1px 2px #00000026}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewInnerWrap{box-shadow:none}.uppy-Dashboard-Item-previewInnerWrap:after{background-color:#000000a6;content:"";display:none;inset:0;position:absolute;z-index:1001}.uppy-Dashboard-Item-previewLink{inset:0;position:absolute;z-index:1002}.uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #579df0}[data-uppy-theme=dark] .uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #016c8d}.uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;height:100%;-o-object-fit:cover;object-fit:cover;transform:translateZ(0);width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;padding:10px;width:auto}.uppy-Dashboard-Item-progress{color:#fff;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:all .35 ease;width:120px;z-index:1002}.uppy-Dashboard-Item-progressIndicator{color:#fff;display:inline-block;height:38px;opacity:.9;width:38px}.uppy-size--md .uppy-Dashboard-Item-progressIndicator{height:55px;width:55px}button.uppy-Dashboard-Item-progressIndicator{cursor:pointer}button.uppy-Dashboard-Item-progressIndicator:focus{outline:none}button.uppy-Dashboard-Item-progressIndicator::-moz-focus-inner{border:0}button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--bg,button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--retry{fill:#579df0}.uppy-Dashboard-Item-progressIcon--circle{height:100%;width:100%}.uppy-Dashboard-Item-progressIcon--bg{stroke:#fff6}.uppy-Dashboard-Item-progressIcon--progress{transition:stroke-dashoffset .5s ease-out;stroke:#fff}.uppy-Dashboard-Item-progressIcon--play{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--cancel{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--pause{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--check{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--retry{fill:#fff}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{inset-inline-end:-8px;inset-inline-start:auto;top:-9px;transform:none;width:auto}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:18px;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:28px;width:28px}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:18px;opacity:1;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:22px;width:22px}.uppy-Dashboard-Item.is-processing .uppy-Dashboard-Item-progress{opacity:0}.uppy-Dashboard-Item-fileInfo{padding-inline-end:5px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:10px}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:15px}.uppy-Dashboard-Item-name{font-size:12px;font-weight:500;line-height:1.3;margin-bottom:5px;word-wrap:anywhere;word-break:break-all}[data-uppy-theme=dark] .uppy-Dashboard-Item-name{color:#eaeaea}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-name{font-size:14px;line-height:1.4}.uppy-Dashboard-Item-fileName{align-items:baseline;display:flex}.uppy-Dashboard-Item-fileName button{margin-left:5px}.uppy-Dashboard-Item-author{color:#757575;display:inline-block;font-size:11px;font-weight:400;line-height:1;margin-bottom:5px;vertical-align:bottom}.uppy-Dashboard-Item-author a{color:#757575}.uppy-Dashboard-Item-status{color:#757575;font-size:11px;font-weight:400;line-height:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-status{color:#bbb}.uppy-Dashboard-Item-statusSize{display:inline-block;margin-bottom:5px;text-transform:uppercase;vertical-align:bottom}.uppy-Dashboard-Item-reSelect{color:#1269cf;font-family:inherit;font-size:inherit;font-weight:600}.uppy-Dashboard-Item-errorMessage{background-color:#fdeff1;color:#a51523;font-size:11px;font-weight:500;line-height:1.3;padding:5px 6px}.uppy-Dashboard-Item-errorMessageBtn{color:#a51523;cursor:pointer;font-size:11px;font-weight:500;text-decoration:underline}.uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{display:none}.uppy-size--md .uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #f7c2c8;bottom:0;display:block;left:0;line-height:1.4;padding:6px 8px;position:absolute;right:0}.uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{border:1px solid #f7c2c8;border-radius:3px;display:inline-block;position:static}.uppy-size--md .uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{display:none}.uppy-Dashboard-Item-action{color:#939393;cursor:pointer}.uppy-Dashboard-Item-action:focus{outline:none}.uppy-Dashboard-Item-action::-moz-focus-inner{border:0}.uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-Item-action:hover{color:#1f1f1f;opacity:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-action{color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{outline:none}[data-uppy-theme=dark] .uppy-Dashboard-Item-action::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:hover{color:#eaeaea}.uppy-Dashboard-Item-action--remove{color:#1f1f1f;opacity:.95}.uppy-Dashboard-Item-action--remove:hover{color:#000;opacity:1}.uppy-size--md .uppy-Dashboard-Item-action--remove{height:18px;inset-inline-end:-8px;padding:0;position:absolute;top:-8px;width:18px;z-index:1002}.uppy-size--md .uppy-Dashboard-Item-action--remove:focus{border-radius:50%}.uppy-Dashboard--singleFile.uppy-size--height-md .uppy-Dashboard-Item-action--remove{inset-inline-end:8px;position:absolute;top:8px}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove{color:#525252}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove:hover{color:#333}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-actionWrapper{align-items:center;display:flex}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action{height:22px;margin-left:3px;padding:3px;width:22px}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action:focus{border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink,.uppy-size--md .uppy-Dashboard-Item-action--edit{height:16px;padding:0;width:16px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink:focus,.uppy-size--md .uppy-Dashboard-Item-action--edit:focus{border-radius:3px}.uppy-Dashboard-Item{align-items:center;border-bottom:1px solid #eaeaea;display:flex;padding:10px}.uppy-Dashboard:not(.uppy-Dashboard--singleFile) .uppy-Dashboard-Item{padding-inline-end:0}[data-uppy-theme=dark] .uppy-Dashboard-Item{border-bottom:1px solid #333}.uppy-size--md .uppy-Dashboard-Item{border-bottom:0;display:block;float:inline-start;height:215px;margin:5px 15px;padding:0;position:relative;width:calc(33.333% - 30px)}.uppy-size--lg .uppy-Dashboard-Item{height:190px;margin:5px 15px;padding:0;width:calc(25% - 30px)}.uppy-size--xl .uppy-Dashboard-Item{height:210px;padding:0;width:calc(20% - 30px)}.uppy-Dashboard--singleFile .uppy-Dashboard-Item{border-bottom:0;display:flex;flex-direction:column;height:100%;max-width:400px;padding:15px;position:relative;width:100%}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-previewInnerWrap{opacity:.2}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-name{opacity:.7}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35' height='39' viewBox='0 0 35 39'%3E%3Cpath fill='%2523000' d='M1.708 38.66c1.709 0 3.417-3.417 6.834-3.417s5.125 3.417 8.61 3.417c3.348 0 5.056-3.417 8.473-3.417 4.305 0 5.125 3.417 6.833 3.417.889 0 1.709-.889 1.709-1.709v-19.68C34.167-5.757 0-5.757 0 17.271v19.68c0 .82.888 1.709 1.708 1.709m8.542-17.084a3.383 3.383 0 0 1-3.417-3.416 3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.417 3.417 3.383 3.383 0 0 1-3.417 3.416m13.667 0A3.383 3.383 0 0 1 20.5 18.16a3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.416 3.417 3.383 3.383 0 0 1-3.416 3.416'/%3E%3C/svg%3E");background-position:50% 10px;background-repeat:no-repeat;background-size:25px;content:"";inset:0;opacity:.5;position:absolute;z-index:1005}.uppy-size--md .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:40px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:30%}.uppy-Dashboard-Item-preview{flex-grow:0;flex-shrink:0;height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-Item-preview{height:140px;width:100%}.uppy-size--lg .uppy-Dashboard-Item-preview{height:120px}.uppy-size--xl .uppy-Dashboard-Item-preview{height:140px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview{flex-grow:1;max-height:75%;width:100%}.uppy-Dashboard--singleFile.uppy-size--md .uppy-Dashboard-Item-preview{max-height:100%}.uppy-Dashboard-Item-fileInfoAndButtons{align-items:center;display:flex;flex-grow:1;justify-content:space-between;padding-inline-end:8px;padding-inline-start:12px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons,.uppy-size--md .uppy-Dashboard-Item-fileInfoAndButtons{align-items:flex-start;padding:9px 0 0}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons{flex-grow:0;width:100%}.uppy-Dashboard-Item-fileInfo{flex-grow:1;flex-shrink:1}.uppy-Dashboard-Item-actionWrapper{flex-grow:0;flex-shrink:0}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-previewInnerWrap:after,.uppy-Dashboard-Item.is-inprogress .uppy-Dashboard-Item-previewInnerWrap:after{display:block}.uppy-Dashboard-Item-errorDetails{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#939393;border:none;border-radius:50%;color:#fff;cursor:help;flex-shrink:0;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;width:13px}.uppy-Dashboard-Item-errorDetails:after{line-height:1.3;word-wrap:break-word}.uppy-Dashboard-FileCard{background-color:#fff;border-radius:5px;box-shadow:0 0 10px 4px #0000001a;display:flex;flex-direction:column;height:100%;inset:0;position:absolute;width:100%;z-index:1005}.uppy-Dashboard-FileCard .uppy-DashboardContent-bar{border-top-left-radius:5px;border-top-right-radius:5px}.uppy-Dashboard-FileCard .uppy-Dashboard-FileCard-actions{border-bottom-left-radius:5px;border-bottom-right-radius:5px}.uppy-Dashboard-FileCard-inner{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;height:100%;min-height:0}.uppy-Dashboard-FileCard-preview{align-items:center;border-bottom:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:1;height:60%;justify-content:center;min-height:0;position:relative}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-preview{background-color:#333;border-bottom:0}.uppy-Dashboard-FileCard-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;box-shadow:0 3px 20px #00000026;flex:0 0 auto;max-height:90%;max-width:90%;-o-object-fit:cover;object-fit:cover}.uppy-Dashboard-FileCard-edit{background-color:#00000080;border-radius:50px;color:#fff;font-size:13px;inset-inline-end:10px;padding:7px 15px;position:absolute;top:10px}.uppy-Dashboard-FileCard-edit:focus{outline:none}.uppy-Dashboard-FileCard-edit::-moz-focus-inner{border:0}.uppy-Dashboard-FileCard-edit:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-FileCard-edit:hover{background-color:#000c}.uppy-Dashboard-FileCard-info{flex-grow:0;flex-shrink:0;height:40%;overflow-y:auto;padding:30px 20px 20px;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-info{background-color:#1f1f1f}.uppy-Dashboard-FileCard-fieldset{border:0;font-size:0;margin:auto auto 12px;max-width:640px;padding:0}.uppy-Dashboard-FileCard-label{color:#525252;display:inline-block;font-size:12px;vertical-align:middle;width:22%}.uppy-size--md .uppy-Dashboard-FileCard-label{font-size:14px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-label{color:#eaeaea}.uppy-Dashboard-FileCard-input{display:inline-block;vertical-align:middle;width:78%}.uppy-Dashboard-FileCard-actions{align-items:center;background-color:#fafafa;border-top:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:0;height:55px;padding:0 15px}.uppy-size--md .uppy-Dashboard-FileCard-actions{height:65px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-actions{background-color:#1f1f1f;border-top:1px solid #333}.uppy-Dashboard-FileCard-actionsBtn{margin-inline-end:10px}.uppy-Informer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1005}.uppy-Informer span>div{margin-bottom:6px}.uppy-Informer-animated{opacity:0;transform:translateY(350%);transition:all .3s ease-in;z-index:-1000}.uppy-Informer p{background-color:#757575;border-radius:18px;color:#fff;display:inline-block;font-size:12px;font-weight:400;line-height:1.4;margin:0;max-width:90%;padding:6px 15px}.uppy-size--md .uppy-Informer p{font-size:14px;line-height:1.3;max-width:500px;padding:10px 20px}[data-uppy-theme=dark] .uppy-Informer p{background-color:#333}.uppy-Informer p span{background-color:#fff;border-radius:50%;color:#525252;display:inline-block;font-size:10px;height:13px;inset-inline-start:3px;line-height:12px;margin-inline-start:-1px;position:relative;top:-1px;vertical-align:middle;width:13px}.uppy-Informer p span:hover{cursor:help}.uppy-Informer p span:after{line-height:1.3;word-wrap:break-word}.uppy-Root [aria-label][role~=tooltip]{position:relative}.uppy-Root [aria-label][role~=tooltip]:after,.uppy-Root [aria-label][role~=tooltip]:before{backface-visibility:hidden;box-sizing:border-box;opacity:0;pointer-events:none;position:absolute;transform:translateZ(0);transform-origin:top;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);will-change:transform;z-index:10}.uppy-Root [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.uppy-Root [aria-label][role~=tooltip]:after{background:#111111e6;border-radius:4px;box-sizing:initial;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);padding:.5em 1em;text-transform:var(--microtip-text-transform,none);white-space:nowrap}.uppy-Root [aria-label][role~=tooltip]:focus:after,.uppy-Root [aria-label][role~=tooltip]:focus:before,.uppy-Root [aria-label][role~=tooltip]:hover:after,.uppy-Root [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto}.uppy-Root [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002S8.594 0 2.658 0'/%3E%3C/svg%3E") no-repeat;bottom:100%;height:6px;left:50%;margin-bottom:5px;transform:translate3d(-50%,0,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=top]:after{bottom:100%;left:50%;margin-bottom:11px;transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:after{bottom:100%;transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:after{bottom:100%;transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(-16px,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002S27.406 12 33.342 12'/%3E%3C/svg%3E") no-repeat;bottom:auto;height:6px;left:50%;margin-bottom:0;margin-top:5px;top:100%;transform:translate3d(-50%,-10px,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:after{left:50%;margin-top:11px;top:100%;transform:translate3d(-50%,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:after{top:100%;transform:translate3d(calc(-100% + 16px),-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:after{top:100%;transform:translate3d(-16px,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:before{inset:50% 100% auto auto;transform:translate3d(10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002S0 27.406 0 33.342'/%3E%3C/svg%3E") no-repeat;height:18px;margin-bottom:0;margin-right:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002S12 8.594 12 2.658'/%3E%3C/svg%3E") no-repeat;height:18px;margin-bottom:0;margin-left:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.uppy-Root [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:150px}.uppy-Root [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.uppy-StatusBar{background-color:#fff;color:#fff;display:flex;font-size:12px;font-weight:400;height:46px;line-height:40px;position:relative;transition:height .2s;z-index:1001}[data-uppy-theme=dark] .uppy-StatusBar{background-color:#1f1f1f}.uppy-StatusBar:before{background-color:#eaeaea;content:"";height:2px;inset:0;position:absolute;width:100%}[data-uppy-theme=dark] .uppy-StatusBar:before{background-color:#757575}.uppy-StatusBar[aria-hidden=true]{height:0;overflow-y:hidden}.uppy-StatusBar.is-complete .uppy-StatusBar-progress{background-color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-progress{background-color:#e32437}.uppy-StatusBar.is-complete .uppy-StatusBar-statusIndicator{color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-statusIndicator{color:#e32437}.uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#fff;border-top:1px solid #eaeaea;height:65px}[data-uppy-theme=dark] .uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#1f1f1f;border-top:1px solid #333}.uppy-StatusBar-progress{background-color:#1269cf;height:2px;position:absolute;transition:background-color,width .3s ease-out;z-index:1001}.uppy-StatusBar-progress.is-indeterminate{animation:uppy-StatusBar-ProgressStripes 1s linear infinite;background-image:linear-gradient(45deg,#0000004d 25%,#0000 0 50%,#0000004d 0 75%,#0000 0,#0000);background-size:64px 64px}@keyframes uppy-StatusBar-ProgressStripes{0%{background-position:0 0}to{background-position:64px 0}}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-progress,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-progress{background-color:#f6a623}.uppy-StatusBar.is-waiting .uppy-StatusBar-progress{display:none}.uppy-StatusBar-content{align-items:center;color:#333;display:flex;height:100%;padding-inline-start:10px;position:relative;text-overflow:ellipsis;white-space:nowrap;z-index:1002}.uppy-size--md .uppy-StatusBar-content{padding-inline-start:15px}[data-uppy-theme=dark] .uppy-StatusBar-content{color:#eaeaea}.uppy-StatusBar-status{display:flex;flex-direction:column;font-weight:400;justify-content:center;line-height:1.4;padding-inline-end:.3em}.uppy-StatusBar-statusPrimary{display:flex;font-weight:500;line-height:1}.uppy-StatusBar-statusPrimary button.uppy-StatusBar-details{margin-left:5px}[data-uppy-theme=dark] .uppy-StatusBar-statusPrimary{color:#eaeaea}.uppy-StatusBar-statusSecondary{color:#757575;display:inline-block;font-size:11px;line-height:1.2;margin-top:1px;white-space:nowrap}[data-uppy-theme=dark] .uppy-StatusBar-statusSecondary{color:#bbb}.uppy-StatusBar-statusSecondaryHint{display:inline-block;line-height:1;margin-inline-end:5px;vertical-align:middle}.uppy-size--md .uppy-StatusBar-statusSecondaryHint{margin-inline-end:8px}.uppy-StatusBar-statusIndicator{color:#525252;margin-inline-end:7px;position:relative;top:1px}.uppy-StatusBar-statusIndicator svg{vertical-align:text-bottom}.uppy-StatusBar-actions{align-items:center;bottom:0;display:flex;inset-inline-end:10px;position:absolute;top:0;z-index:1004}.uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#fafafa;height:100%;padding:0 15px;position:static;width:100%}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#1f1f1f}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:column;height:90px}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:row;height:65px}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:column;justify-content:center}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:row;justify-content:normal}.uppy-StatusBar-actionCircleBtn{cursor:pointer;line-height:1;margin:3px;opacity:.9}.uppy-StatusBar-actionCircleBtn:focus{outline:none}.uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}.uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionCircleBtn:hover{opacity:1}.uppy-StatusBar-actionCircleBtn:focus{border-radius:50%}.uppy-StatusBar-actionCircleBtn svg{vertical-align:bottom}.uppy-StatusBar-actionBtn{color:#1269cf;display:inline-block;font-size:10px;line-height:inherit;vertical-align:middle}.uppy-size--md .uppy-StatusBar-actionBtn{font-size:11px}.uppy-StatusBar-actionBtn--disabled{opacity:.4}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--disabled{opacity:.7}.uppy-StatusBar-actionBtn--retry{background-color:#ff4b23;border-radius:8px;color:#fff;height:16px;line-height:1;margin-inline-end:6px;padding:1px 6px 3px 18px;position:relative}.uppy-StatusBar-actionBtn--retry:focus{outline:none}.uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionBtn--retry:hover{background-color:#f92d00}.uppy-StatusBar-actionBtn--retry svg{inset-inline-start:6px;position:absolute;top:3px}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1bb240;color:#fff;font-size:14px;line-height:1;padding:15px 10px;width:100%}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#189c38}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1c8b37}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#18762f}.uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{padding:13px 22px;width:auto}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1bb240;cursor:not-allowed}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1c8b37}.uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload{background-color:initial;color:#1269cf}.uppy-StatusBar-actionBtn--uploadNewlyAdded{border-radius:3px;padding-inline-end:3px;padding-bottom:1px;padding-inline-start:3px}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}.uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded{display:none}.uppy-StatusBar-actionBtn--done{border-radius:3px;line-height:1;padding:7px 8px}.uppy-StatusBar-actionBtn--done:focus{outline:none}.uppy-StatusBar-actionBtn--done::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--done:hover{color:#0e51a0}.uppy-StatusBar-actionBtn--done:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done:focus{background-color:#333}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done{color:#02baf2}.uppy-size--md .uppy-StatusBar-actionBtn--done{font-size:14px}.uppy-StatusBar-serviceMsg{color:#000;font-size:11px;line-height:1.1;padding-left:10px}.uppy-size--md .uppy-StatusBar-serviceMsg{font-size:14px;padding-left:15px}[data-uppy-theme=dark] .uppy-StatusBar-serviceMsg{color:#eaeaea}.uppy-StatusBar-serviceMsg-ghostsIcon{left:6px;opacity:.5;position:relative;top:2px;vertical-align:text-bottom;width:10px}.uppy-size--md .uppy-StatusBar-serviceMsg-ghostsIcon{left:10px;top:1px;width:15px}.uppy-StatusBar-details{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#939393;border-radius:50%;color:#fff;cursor:help;display:inline-block;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;vertical-align:middle;width:13px}.uppy-StatusBar-details:after{line-height:1.3;word-wrap:break-word}.uppy-StatusBar-spinner{animation-duration:1s;animation-iteration-count:infinite;animation-name:uppy-StatusBar-spinnerAnimation;animation-timing-function:linear;fill:#1269cf;margin-inline-end:10px}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-spinner,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-spinner{fill:#f6a623}@keyframes uppy-StatusBar-spinnerAnimation{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.uppy-transition-slideDownUp-enter{opacity:.01;transform:translate3d(0,-105%,0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-enter.uppy-transition-slideDownUp-enter-active{opacity:1;transform:translateZ(0)}.uppy-transition-slideDownUp-leave{opacity:1;transform:translateZ(0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-leave.uppy-transition-slideDownUp-leave-active{opacity:.01;transform:translate3d(0,-105%,0)}@keyframes uppy-Dashboard-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes uppy-Dashboard-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes uppy-Dashboard-slideDownAndFadeIn{0%{opacity:0;transform:translate3d(-50%,-70%,0)}to{opacity:1;transform:translate3d(-50%,-50%,0)}}@keyframes uppy-Dashboard-slideDownAndFadeIn--small{0%{opacity:0;transform:translate3d(0,-20%,0)}to{opacity:1;transform:translateZ(0)}}@keyframes uppy-Dashboard-slideUpFadeOut{0%{opacity:1;transform:translate3d(-50%,-50%,0)}to{opacity:0;transform:translate3d(-50%,-70%,0)}}@keyframes uppy-Dashboard-slideUpFadeOut--small{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20%,0)}}.uppy-Dashboard--modal{z-index:1001}.uppy-Dashboard--modal[aria-hidden=true]{display:none}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeIn .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeOut .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard-isFixed{height:100vh;overflow:hidden}.uppy-Dashboard--modal .uppy-Dashboard-overlay{background-color:#00000080;inset:0;position:fixed;z-index:1001}.uppy-Dashboard-inner{background-color:#f4f4f4;border:1px solid #eaeaea;border-radius:5px;max-height:100%;max-width:100%;outline:none;position:relative}.uppy-size--md .uppy-Dashboard-inner{min-height:auto}@media only screen and (min-width:820px){.uppy-Dashboard-inner{height:500px;width:650px}}.uppy-Dashboard--modal .uppy-Dashboard-inner{z-index:1002}[data-uppy-theme=dark] .uppy-Dashboard-inner{background-color:#1f1f1f}.uppy-Dashboard--isDisabled .uppy-Dashboard-inner{cursor:not-allowed}.uppy-Dashboard-innerWrap{border-radius:5px;display:flex;flex-direction:column;height:100%;opacity:0;overflow:hidden;position:relative}.uppy-Dashboard--isInnerWrapVisible .uppy-Dashboard-innerWrap{opacity:1}.uppy-Dashboard--isDisabled .uppy-Dashboard-innerWrap{cursor:not-allowed;filter:grayscale(100%);opacity:.6;-webkit-user-select:none;-moz-user-select:none;user-select:none}.uppy-Dashboard--isDisabled .uppy-ProviderIconBg{fill:#9f9f9f}.uppy-Dashboard--isDisabled [aria-disabled],.uppy-Dashboard--isDisabled [disabled]{cursor:not-allowed;pointer-events:none}.uppy-Dashboard--modal .uppy-Dashboard-inner{border:none;inset:35px 15px 15px;position:fixed}@media only screen and (min-width:820px){.uppy-Dashboard--modal .uppy-Dashboard-inner{box-shadow:0 5px 15px 4px #00000026;left:50%;right:auto;top:50%;transform:translate(-50%,-50%)}}.uppy-Dashboard-close{color:#ffffffe6;cursor:pointer;display:block;font-size:27px;inset-inline-end:-2px;position:absolute;top:-33px;z-index:1005}.uppy-Dashboard-close:focus{outline:none}.uppy-Dashboard-close::-moz-focus-inner{border:0}.uppy-Dashboard-close:focus{color:#6eabf2}@media only screen and (min-width:820px){.uppy-Dashboard-close{font-size:35px;inset-inline-end:-35px;top:-10px}}.uppy-Dashboard-serviceMsg{background-color:#fffbf7;border-bottom:1px solid #edd4b9;border-top:1px solid #edd4b9;font-size:12px;font-weight:500;line-height:1.3;padding:12px 0;position:relative;top:-1px;z-index:1004}.uppy-size--md .uppy-Dashboard-serviceMsg{font-size:14px;line-height:1.4}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg{background-color:#1f1f1f;border-bottom:1px solid #333;border-top:1px solid #333;color:#eaeaea}.uppy-Dashboard-serviceMsg-title{display:block;line-height:1;margin-bottom:4px;padding-left:42px}.uppy-Dashboard-serviceMsg-text{padding:0 15px}.uppy-Dashboard-serviceMsg-actionBtn{color:#1269cf;font-size:inherit;font-weight:inherit;vertical-align:initial}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg-actionBtn{color:#02baf2e6}.uppy-Dashboard-serviceMsg-icon{left:15px;position:absolute;top:10px}.uppy-Dashboard-AddFiles{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;position:relative;text-align:center}[data-uppy-drag-drop-supported=true] .uppy-Dashboard-AddFiles{border:1px dashed #dfdfdf;border-radius:3px;height:calc(100% - 14px);margin:7px}.uppy-Dashboard-AddFilesPanel .uppy-Dashboard-AddFiles{border:none;height:calc(100% - 54px)}.uppy-Dashboard--modal .uppy-Dashboard-AddFiles{border-color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles{border-color:#757575}.uppy-Dashboard-AddFiles-info{display:none;margin-top:auto;padding-bottom:15px;padding-top:15px}.uppy-size--height-md .uppy-Dashboard-AddFiles-info{display:block}.uppy-size--md .uppy-Dashboard-AddFiles-info{bottom:25px;left:0;padding-bottom:0;padding-top:30px;position:absolute;right:0}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-info{margin-top:0}.uppy-Dashboard-browse{color:#1269cf;cursor:pointer}.uppy-Dashboard-browse:focus{outline:none}.uppy-Dashboard-browse::-moz-focus-inner{border:0}.uppy-Dashboard-browse:focus,.uppy-Dashboard-browse:hover{border-bottom:1px solid #1269cf}[data-uppy-theme=dark] .uppy-Dashboard-browse{color:#02baf2e6}[data-uppy-theme=dark] .uppy-Dashboard-browse:focus,[data-uppy-theme=dark] .uppy-Dashboard-browse:hover{border-bottom:1px solid #02baf2}.uppy-Dashboard-browseBtn{display:block;font-size:14px;font-weight:500;margin-bottom:5px;margin-top:8px;width:100%}.uppy-size--md .uppy-Dashboard-browseBtn{font-size:15px;margin:15px auto;padding:13px 44px;width:auto}.uppy-Dashboard-AddFiles-list{display:flex;flex:1;flex-direction:column;margin-top:2px;overflow-y:auto;padding:2px 0;width:100%;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;margin-top:15px;max-width:600px;overflow-y:visible;padding-top:0}.uppy-DashboardTab{border-bottom:1px solid #eaeaea;text-align:center;width:100%}[data-uppy-theme=dark] .uppy-DashboardTab{border-bottom:1px solid #333}.uppy-size--md .uppy-DashboardTab{border-bottom:none;display:inline-block;margin-bottom:10px;width:auto}.uppy-DashboardTab-btn{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:initial;color:#525252;cursor:pointer;flex-direction:row;height:100%;justify-content:left;padding:12px 15px;width:100%}.uppy-DashboardTab-btn:focus{outline:none}.uppy-size--md .uppy-DashboardTab-btn{border-radius:5px;flex-direction:column;margin-inline-end:1px;padding:10px 3px;width:86px}[data-uppy-theme=dark] .uppy-DashboardTab-btn{color:#eaeaea}.uppy-DashboardTab-btn::-moz-focus-inner{border:0}.uppy-DashboardTab-btn:hover{background-color:#e9ecef}[data-uppy-theme=dark] .uppy-DashboardTab-btn:hover{background-color:#333}.uppy-DashboardTab-btn:active,.uppy-DashboardTab-btn:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardTab-btn:active,[data-uppy-theme=dark] .uppy-DashboardTab-btn:focus{background-color:#525252}.uppy-DashboardTab-btn svg{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;transition:transform .15s ease-in-out;vertical-align:text-top}.uppy-DashboardTab-inner{align-items:center;background-color:#fff;border-radius:8px;box-shadow:0 1px 1px #0000001a,0 1px 2px #0000001a,0 2px 3px #00000005;display:flex;height:32px;justify-content:center;margin-inline-end:10px;width:32px}.uppy-size--md .uppy-DashboardTab-inner{margin-inline-end:0}[data-uppy-theme=dark] .uppy-DashboardTab-inner{background-color:#323232;box-shadow:0 1px 1px #0003,0 1px 2px #0003,0 2px 3px #00000014}.uppy-DashboardTab-name{font-size:14px;font-weight:400}.uppy-size--md .uppy-DashboardTab-name{font-size:12px;line-height:15px;margin-bottom:0;margin-top:8px}.uppy-DashboardTab-iconMyDevice{color:#1269cf}[data-uppy-theme=dark] .uppy-DashboardTab-iconMyDevice{color:#02baf2}.uppy-DashboardTab-iconBox{color:#0061d5}[data-uppy-theme=dark] .uppy-DashboardTab-iconBox{color:#eaeaea}.uppy-DashboardTab-iconDropbox{color:#0061fe}[data-uppy-theme=dark] .uppy-DashboardTab-iconDropbox{color:#eaeaea}.uppy-DashboardTab-iconUnsplash{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconUnsplash{color:#eaeaea}.uppy-DashboardTab-iconWebdav{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconWebdav{color:#eaeaea}.uppy-DashboardTab-iconScreenRec{color:#2c3e50}[data-uppy-theme=dark] .uppy-DashboardTab-iconScreenRec{color:#eaeaea}.uppy-DashboardTab-iconAudio{color:#8030a3}[data-uppy-theme=dark] .uppy-DashboardTab-iconAudio{color:#bf6ee3}.uppy-Dashboard-input{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px;z-index:-1}.uppy-DashboardContent-bar{align-items:center;background-color:#fafafa;border-bottom:1px solid #eaeaea;display:flex;flex-shrink:0;height:40px;justify-content:space-between;padding:0 10px;position:relative;width:100%;z-index:1004}.uppy-size--md .uppy-DashboardContent-bar{height:50px;padding:0 15px}[data-uppy-theme=dark] .uppy-DashboardContent-bar{background-color:#1f1f1f;border-bottom:1px solid #333}.uppy-DashboardContent-title{font-size:12px;font-weight:500;left:0;line-height:40px;margin:auto;max-width:170px;overflow-x:hidden;position:absolute;right:0;text-align:center;text-overflow:ellipsis;top:0;white-space:nowrap;width:100%}.uppy-size--md .uppy-DashboardContent-title{font-size:14px;line-height:50px;max-width:300px}[data-uppy-theme=dark] .uppy-DashboardContent-title{color:#eaeaea}.uppy-DashboardContent-back,.uppy-DashboardContent-save{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-size:12px;font-weight:400;line-height:1;margin:0;margin-inline-start:-6px;padding:7px 6px}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{outline:none}.uppy-DashboardContent-back::-moz-focus-inner,.uppy-DashboardContent-save::-moz-focus-inner{border:0}.uppy-DashboardContent-back:hover,.uppy-DashboardContent-save:hover{color:#0e51a0}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-back:focus,[data-uppy-theme=dark] .uppy-DashboardContent-save:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-back,.uppy-size--md .uppy-DashboardContent-save{font-size:14px}[data-uppy-theme=dark] .uppy-DashboardContent-back,[data-uppy-theme=dark] .uppy-DashboardContent-save{color:#02baf2}.uppy-DashboardContent-addMore{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:500;height:29px;line-height:1;margin:0;margin-inline-end:-5px;padding:7px 8px;width:29px}.uppy-DashboardContent-addMore:focus{outline:none}.uppy-DashboardContent-addMore::-moz-focus-inner{border:0}.uppy-DashboardContent-addMore:hover{color:#0e51a0}.uppy-DashboardContent-addMore:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-addMore:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-addMore{font-size:14px;height:auto;margin-inline-end:-8px;width:auto}[data-uppy-theme=dark] .uppy-DashboardContent-addMore{color:#02baf2}.uppy-DashboardContent-addMore svg{margin-inline-end:4px;vertical-align:initial}.uppy-size--md .uppy-DashboardContent-addMore svg{height:11px;width:11px}.uppy-DashboardContent-addMoreCaption{display:none}.uppy-size--md .uppy-DashboardContent-addMoreCaption{display:inline}.uppy-DashboardContent-panel{background-color:#f5f5f5;flex:1}.uppy-Dashboard-AddFilesPanel,.uppy-DashboardContent-panel{border-radius:5px;display:flex;flex-direction:column;inset:0;overflow:hidden;position:absolute;z-index:1005}.uppy-Dashboard-AddFilesPanel{background:#fafafa;background:linear-gradient(0deg,#fafafa 35%,#fafafad9);box-shadow:0 0 10px 5px #00000026}[data-uppy-theme=dark] .uppy-Dashboard-AddFilesPanel{background-color:#333;background-image:linear-gradient(0deg,#1f1f1f 35%,#1f1f1fd9)}.uppy-Dashboard--isAddFilesPanelVisible .uppy-Dashboard-files{filter:blur(2px)}.uppy-Dashboard-progress{bottom:0;height:12%;left:0;position:absolute;width:100%}.uppy-Dashboard-progressBarContainer.is-active{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1004}.uppy-Dashboard-filesContainer{flex:1;margin:0;overflow-y:hidden;position:relative}.uppy-Dashboard-filesContainer:after{clear:both;content:"";display:table}.uppy-Dashboard-files{flex:1;margin:0;overflow-y:auto;padding:0 0 10px;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-files{padding-top:10px}.uppy-Dashboard--singleFile .uppy-Dashboard-filesInner{align-items:center;display:flex;height:100%;justify-content:center}.uppy-Dashboard-dropFilesHereHint{align-items:center;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%231269CF' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;border:1px dashed #1269cf;border-radius:3px;color:#757575;display:flex;font-size:16px;justify-content:center;inset:7px;padding-top:90px;position:absolute;text-align:center;visibility:hidden;z-index:2000}[data-uppy-theme=dark] .uppy-Dashboard-dropFilesHereHint{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%2302BAF2' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");border-color:#02baf2;color:#bbb}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-dropFilesHereHint{pointer-events:none;visibility:visible}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-files,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-progressindicators,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-serviceMsg,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-DashboardContent-bar{opacity:.15}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-AddFiles{opacity:.03}.uppy-Dashboard-AddFiles-title{color:#000;font-size:17px;font-weight:500;line-height:1.35;margin-bottom:5px;margin-top:15px;padding:0 15px;text-align:inline-start;width:100%}.uppy-size--md .uppy-Dashboard-AddFiles-title{font-size:21px;font-weight:400;margin-top:5px;max-width:480px;padding:0 35px;text-align:center}[data-uppy-num-acquirers="0"] .uppy-Dashboard-AddFiles-title{text-align:center}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title{color:#eaeaea}.uppy-Dashboard-AddFiles-title button{font-weight:500}.uppy-size--md .uppy-Dashboard-AddFiles-title button{font-weight:400}.uppy-Dashboard-note{color:#757575;font-size:14px;line-height:1.25;margin:auto;max-width:350px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Dashboard-note{line-height:1.35;max-width:600px}[data-uppy-theme=dark] .uppy-Dashboard-note{color:#cfcfcf}a.uppy-Dashboard-poweredBy{color:#939393;display:inline-block;font-size:11px;margin-top:8px;text-align:center;text-decoration:none}.uppy-Dashboard-poweredByIcon{margin-left:1px;margin-right:1px;opacity:.9;position:relative;top:1px;vertical-align:text-top;fill:none;stroke:#939393}.uppy-Dashboard-Item-previewIcon{height:25px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:25px;z-index:100}.uppy-size--md .uppy-Dashboard-Item-previewIcon{height:38px;width:38px}.uppy-Dashboard-Item-previewIcon svg{height:100%;width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIcon{height:100%;max-height:60%;max-width:60%;width:100%}.uppy-Dashboard-Item-previewIconWrap{height:76px;max-height:75%;position:relative}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIconWrap{height:100%;width:100%}.uppy-Dashboard-Item-previewIconBg{filter:drop-shadow(rgba(0,0,0,.1) 0 1px 1px);height:100%;width:100%}.uppy-Dashboard-upload{height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-upload{height:60px;width:60px}.uppy-Dashboard-upload .uppy-c-icon{position:relative;top:1px;width:50%}.uppy-Dashboard-uploadCount{background-color:#1bb240;border-radius:50%;color:#fff;font-size:8px;height:16px;inset-inline-end:-12px;line-height:16px;position:absolute;top:-12px;width:16px}.uppy-size--md .uppy-Dashboard-uploadCount{font-size:9px;height:18px;line-height:18px;width:18px}.uppy-Dashboard-inner{border:none!important;background:transparent!important}.uppy-Dashboard-innerWrap{border-radius:.5rem;overflow:hidden}.uppy-Dashboard-AddFiles{border:2px dashed hsl(var(--border))!important;border-radius:.5rem!important;background:hsl(var(--muted) / .3)!important;transition:all .2s ease}.uppy-Dashboard-AddFiles:hover{border-color:hsl(var(--primary))!important;background:hsl(var(--muted) / .5)!important}.uppy-Dashboard-AddFiles-title{color:hsl(var(--foreground))!important;font-weight:500!important}.uppy-Dashboard-AddFiles-info{color:hsl(var(--muted-foreground))!important}.uppy-Dashboard-browse{color:hsl(var(--primary))!important;font-weight:500!important}.uppy-Dashboard-browse:hover{text-decoration:underline!important}.uppy-Dashboard-files{background:transparent!important}.uppy-Dashboard-Item{border-bottom-color:hsl(var(--border))!important}.uppy-Dashboard-Item-name{color:hsl(var(--foreground))!important}.uppy-Dashboard-Item-status{color:hsl(var(--muted-foreground))!important}.uppy-StatusBar{background:hsl(var(--muted))!important;border-top:1px solid hsl(var(--border))!important}.uppy-StatusBar-progress{background:hsl(var(--primary))!important}.uppy-StatusBar-content{color:hsl(var(--foreground))!important}.uppy-StatusBar-actionBtn--upload{background:hsl(var(--primary))!important;color:hsl(var(--primary-foreground))!important;border-radius:.375rem!important;font-weight:500!important;padding:.5rem 1rem!important}.uppy-StatusBar-actionBtn--upload:hover{background:hsl(var(--primary) / .9)!important}.uppy-Dashboard-note{color:hsl(var(--muted-foreground))!important;font-size:.75rem!important}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles,.dark .uppy-Dashboard-AddFiles{background:hsl(var(--muted) / .2)!important}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title,.dark .uppy-Dashboard-AddFiles-title{color:hsl(var(--foreground))!important}[data-uppy-theme=dark] .uppy-StatusBar,.dark .uppy-StatusBar{background:hsl(var(--muted) / .5)!important}.uppy-Dashboard{font-family:inherit!important}.uppy-Dashboard-Item-preview{border-radius:.375rem!important;overflow:hidden}.uppy-Dashboard-Item-action--remove{color:hsl(var(--destructive))!important}.uppy-Dashboard-Item-action--remove:hover{opacity:.8}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{color:hsl(var(--success, 142 76% 36%))!important}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progress{color:hsl(var(--destructive))!important}.uppy-Dashboard-files::-webkit-scrollbar{width:6px}.uppy-Dashboard-files::-webkit-scrollbar-track{background:transparent}.uppy-Dashboard-files::-webkit-scrollbar-thumb{background:hsl(var(--muted-foreground) / .3);border-radius:3px}.uppy-Dashboard-files::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground) / .5)}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:grab}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%} diff --git a/webui/dist/assets/misc-Ii-X5qWA.js b/webui/dist/assets/misc-DyBU7ISD.js similarity index 99% rename from webui/dist/assets/misc-Ii-X5qWA.js rename to webui/dist/assets/misc-DyBU7ISD.js index b03b5728..922264e9 100644 --- a/webui/dist/assets/misc-Ii-X5qWA.js +++ b/webui/dist/assets/misc-DyBU7ISD.js @@ -1,4 +1,4 @@ -import{k as Lo,u as Ve,R as Bo,o as $o,O as Ho,C as Uo,r as ct}from"./radix-core-BlBHu_Lw.js";import{r as b,j as zo,R as w,c as Et,b as kt}from"./router-CWhjJi2n.js";import{g as Dt}from"./react-vendor-Dtc2IqVY.js";import{ai as T}from"./charts-Dhri-zxi.js";import{a as Yo,b as qo,d as Go,e as Vo,f as Ko,g as Zo,h as Jo,i as Xo,j as Qo,k as ei,l as ti,m as ni,n as ri,o as oi,p as ii,q as si,r as ai,s as li,t as ci,u as ui,v as fi,w as di,x as pi,y as hi,z as mi,A as yi,B as vi,C as gi,D as bi,E as wi,F as Oi,G as Si,H as cr}from"./utils-CCeOswSm.js";var Sn=1,Ei=.9,ki=.8,Ci=.17,$t=.1,Ht=.999,Ti=.9999,Mi=.99,xi=/[\\\/_+.#"@\[\(\{&]/,Ni=/[\\\/_+.#"@\[\(\{&]/g,Pi=/[\s-]/,ur=/[\s-]/g;function Qt(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?Sn:Mi;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(i),u=n.indexOf(l,o),f=0,c,d,p,h;u>=0;)c=Qt(e,t,n,r,u+1,i+1,a),c>f&&(u===o?c*=Sn:xi.test(e.charAt(u-1))?(c*=ki,p=e.slice(o,u-1).match(Ni),p&&o>0&&(c*=Math.pow(Ht,p.length))):Pi.test(e.charAt(u-1))?(c*=Ei,h=e.slice(o,u-1).match(ur),h&&o>0&&(c*=Math.pow(Ht,h.length))):(c*=Ci,o>0&&(c*=Math.pow(Ht,u-o))),e.charAt(u)!==t.charAt(i)&&(c*=Ti)),(c<$t&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=Qt(e,t,n,r,u+1,i+2,a),d*$t>c&&(c=d*$t)),c>f&&(f=c),u=n.indexOf(l,u+1);return a[s]=f,f}function En(e){return e.toLowerCase().replace(ur," ")}function Di(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Qt(e,t,En(e),En(t),0,0,{})}var Ii=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=Ii.reduce((e,t)=>{const n=Lo(`Primitive.${t}`),r=b.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),zo.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),nt='[cmdk-group=""]',Ut='[cmdk-group-items=""]',Ri='[cmdk-group-heading=""]',fr='[cmdk-item=""]',kn=`${fr}:not([aria-disabled="true"])`,en="cmdk-item-select",qe="data-value",Wi=(e,t,n)=>Di(e,t,n),dr=b.createContext(void 0),dt=()=>b.useContext(dr),pr=b.createContext(void 0),cn=()=>b.useContext(pr),hr=b.createContext(void 0),mr=b.forwardRef((e,t)=>{let n=Ge(()=>{var k,W;return{search:"",value:(W=(k=e.value)!=null?k:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ge(()=>new Set),o=Ge(()=>new Map),i=Ge(()=>new Map),a=Ge(()=>new Set),s=yr(e),{label:l,children:u,value:f,onValueChange:c,filter:d,shouldFilter:p,loop:h,disablePointerSelection:v=!1,vimBindings:O=!0,...y}=e,m=Ve(),S=Ve(),D=Ve(),E=b.useRef(null),C=Yi();Be(()=>{if(f!==void 0){let k=f.trim();n.current.value=k,M.emit()}},[f]),Be(()=>{C(6,Me)},[]);let M=b.useMemo(()=>({subscribe:k=>(a.current.add(k),()=>a.current.delete(k)),snapshot:()=>n.current,setState:(k,W,F)=>{var R,U,G,ee;if(!Object.is(n.current[k],W)){if(n.current[k]=W,k==="search")re(),Y(),C(1,Q);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(D);X?X.focus():(R=document.getElementById(m))==null||R.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=le())==null?void 0:X.id,M.emit()}),F||C(5,Me),((U=s.current)==null?void 0:U.value)!==void 0){let X=W??"";(ee=(G=s.current).onValueChange)==null||ee.call(G,X);return}}M.emit()}},emit:()=>{a.current.forEach(k=>k())}}),[]),j=b.useMemo(()=>({value:(k,W,F)=>{var R;W!==((R=i.current.get(k))==null?void 0:R.value)&&(i.current.set(k,{value:W,keywords:F}),n.current.filtered.items.set(k,J(W,F)),C(2,()=>{Y(),M.emit()}))},item:(k,W)=>(r.current.add(k),W&&(o.current.has(W)?o.current.get(W).add(k):o.current.set(W,new Set([k]))),C(3,()=>{re(),Y(),n.current.value||Q(),M.emit()}),()=>{i.current.delete(k),r.current.delete(k),n.current.filtered.items.delete(k);let F=le();C(4,()=>{re(),F?.getAttribute("id")===k&&Q(),M.emit()})}),group:k=>(o.current.has(k)||o.current.set(k,new Set),()=>{i.current.delete(k),o.current.delete(k)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:m,inputId:D,labelId:S,listInnerRef:E}),[]);function J(k,W){var F,R;let U=(R=(F=s.current)==null?void 0:F.filter)!=null?R:Wi;return k?U(k,n.current.search,W):0}function Y(){if(!n.current.search||s.current.shouldFilter===!1)return;let k=n.current.filtered.items,W=[];n.current.filtered.groups.forEach(R=>{let U=o.current.get(R),G=0;U.forEach(ee=>{let X=k.get(ee);G=Math.max(X,G)}),W.push([R,G])});let F=E.current;de().sort((R,U)=>{var G,ee;let X=R.getAttribute("id"),ze=U.getAttribute("id");return((G=k.get(ze))!=null?G:0)-((ee=k.get(X))!=null?ee:0)}).forEach(R=>{let U=R.closest(Ut);U?U.appendChild(R.parentElement===U?R:R.closest(`${Ut} > *`)):F.appendChild(R.parentElement===F?R:R.closest(`${Ut} > *`))}),W.sort((R,U)=>U[1]-R[1]).forEach(R=>{var U;let G=(U=E.current)==null?void 0:U.querySelector(`${nt}[${qe}="${encodeURIComponent(R[0])}"]`);G?.parentElement.appendChild(G)})}function Q(){let k=de().find(F=>F.getAttribute("aria-disabled")!=="true"),W=k?.getAttribute(qe);M.setState("value",W||void 0)}function re(){var k,W,F,R;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let U=0;for(let G of r.current){let ee=(W=(k=i.current.get(G))==null?void 0:k.value)!=null?W:"",X=(R=(F=i.current.get(G))==null?void 0:F.keywords)!=null?R:[],ze=J(ee,X);n.current.filtered.items.set(G,ze),ze>0&&U++}for(let[G,ee]of o.current)for(let X of ee)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=U}function Me(){var k,W,F;let R=le();R&&(((k=R.parentElement)==null?void 0:k.firstChild)===R&&((F=(W=R.closest(nt))==null?void 0:W.querySelector(Ri))==null||F.scrollIntoView({block:"nearest"})),R.scrollIntoView({block:"nearest"}))}function le(){var k;return(k=E.current)==null?void 0:k.querySelector(`${fr}[aria-selected="true"]`)}function de(){var k;return Array.from(((k=E.current)==null?void 0:k.querySelectorAll(kn))||[])}function Ie(k){let W=de()[k];W&&M.setState("value",W.getAttribute(qe))}function je(k){var W;let F=le(),R=de(),U=R.findIndex(ee=>ee===F),G=R[U+k];(W=s.current)!=null&&W.loop&&(G=U+k<0?R[R.length-1]:U+k===R.length?R[0]:R[U+k]),G&&M.setState("value",G.getAttribute(qe))}function ie(k){let W=le(),F=W?.closest(nt),R;for(;F&&!R;)F=k>0?Ui(F,nt):zi(F,nt),R=F?.querySelector(kn);R?M.setState("value",R.getAttribute(qe)):je(k)}let se=()=>Ie(de().length-1),pe=k=>{k.preventDefault(),k.metaKey?se():k.altKey?ie(1):je(1)},Ue=k=>{k.preventDefault(),k.metaKey?Ie(0):k.altKey?ie(-1):je(-1)};return b.createElement(_e.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:k=>{var W;(W=y.onKeyDown)==null||W.call(y,k);let F=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||F))switch(k.key){case"n":case"j":{O&&k.ctrlKey&&pe(k);break}case"ArrowDown":{pe(k);break}case"p":case"k":{O&&k.ctrlKey&&Ue(k);break}case"ArrowUp":{Ue(k);break}case"Home":{k.preventDefault(),Ie(0);break}case"End":{k.preventDefault(),se();break}case"Enter":{k.preventDefault();let R=le();if(R){let U=new Event(en);R.dispatchEvent(U)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Gi},l),It(e,k=>b.createElement(pr.Provider,{value:M},b.createElement(dr.Provider,{value:j},k))))}),Ai=b.forwardRef((e,t)=>{var n,r;let o=Ve(),i=b.useRef(null),a=b.useContext(hr),s=dt(),l=yr(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Be(()=>{if(!u)return s.item(o,a?.id)},[u]);let f=vr(o,i,[e.value,e.children,i],e.keywords),c=cn(),d=We(C=>C.value&&C.value===f.current),p=We(C=>u||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);b.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(en,h),()=>C.removeEventListener(en,h)},[p,e.onSelect,e.disabled]);function h(){var C,M;v(),(M=(C=l.current).onSelect)==null||M.call(C,f.current)}function v(){c.setState("value",f.current,!0)}if(!p)return null;let{disabled:O,value:y,onSelect:m,forceMount:S,keywords:D,...E}=e;return b.createElement(_e.div,{ref:ct(i,t),...E,id:o,"cmdk-item":"",role:"option","aria-disabled":!!O,"aria-selected":!!d,"data-disabled":!!O,"data-selected":!!d,onPointerMove:O||s.getDisablePointerSelection()?void 0:v,onClick:O?void 0:h},e.children)}),_i=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=Ve(),s=b.useRef(null),l=b.useRef(null),u=Ve(),f=dt(),c=We(p=>o||f.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Be(()=>f.group(a),[]),vr(a,s,[e.value,e.heading,l]);let d=b.useMemo(()=>({id:a,forceMount:o}),[o]);return b.createElement(_e.div,{ref:ct(s,t),...i,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),It(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(hr.Provider,{value:d},p))))}),ji=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=We(a=>!a.search);return!n&&!i?null:b.createElement(_e.div,{ref:ct(o,t),...r,"cmdk-separator":"",role:"separator"})}),Fi=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=cn(),a=We(u=>u.search),s=We(u=>u.selectedItemId),l=dt();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(_e.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),Li=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),a=b.useRef(null),s=We(u=>u.selectedItemId),l=dt();return b.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let p=u.offsetHeight;f.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(c),d.unobserve(u)}}},[]),b.createElement(_e.div,{ref:ct(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},It(e,u=>b.createElement("div",{ref:ct(a,l.listInnerRef),"cmdk-list-sizer":""},u)))}),Bi=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return b.createElement(Bo,{open:n,onOpenChange:r},b.createElement($o,{container:a},b.createElement(Ho,{"cmdk-overlay":"",className:o}),b.createElement(Uo,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(mr,{ref:t,...s}))))}),$i=b.forwardRef((e,t)=>We(n=>n.filtered.count===0)?b.createElement(_e.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Hi=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(_e.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},It(e,a=>b.createElement("div",{"aria-hidden":!0},a)))}),ou=Object.assign(mr,{List:Li,Item:Ai,Input:Fi,Group:_i,Separator:ji,Dialog:Bi,Empty:$i,Loading:Hi});function Ui(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zi(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yr(e){let t=b.useRef(e);return Be(()=>{t.current=e}),t}var Be=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Ge(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function We(e){let t=cn(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function vr(e,t,n,r=[]){let o=b.useRef(),i=dt();return Be(()=>{var a;let s=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,s,l),(a=t.current)==null||a.setAttribute(qe,s),o.current=s}),o}var Yi=()=>{let[e,t]=b.useState(),n=Ge(()=>new Map);return Be(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qi(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function It({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(qi(t),{ref:t.ref},n(t.props.children)):n(t)}var Gi={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function gr(e){return t=>typeof t===e}var Vi=gr("function"),Ki=e=>e===null,Cn=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",Tn=e=>!Zi(e)&&!Ki(e)&&(Vi(e)||typeof e=="object"),Zi=gr("undefined");function Ji(e,t){const{length:n}=e;if(n!==t.length)return!1;for(let r=n;r--!==0;)if(!oe(e[r],t[r]))return!1;return!0}function Xi(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),r=new DataView(t.buffer);let o=e.byteLength;for(;o--;)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function Qi(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!oe(n[1],t.get(n[0])))return!1;return!0}function es(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}function oe(e,t){if(e===t)return!0;if(e&&Tn(e)&&t&&Tn(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return Ji(e,t);if(e instanceof Map&&t instanceof Map)return Qi(e,t);if(e instanceof Set&&t instanceof Set)return es(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return Xi(e,t);if(Cn(e)&&Cn(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=n.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=n.length;o--!==0;){const i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!oe(e[i],t[i]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}var ts=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],ns=["bigint","boolean","null","number","string","symbol","undefined"];function Rt(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(rs(t))return t}function ge(e){return t=>Rt(t)===e}function rs(e){return ts.includes(e)}function Qe(e){return t=>typeof t===e}function os(e){return ns.includes(e)}var is=["innerHTML","ownerDocument","style","attributes","nodeValue"];function x(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(x.array(e))return"Array";if(x.plainFunction(e))return"Function";const t=Rt(e);return t||"Object"}x.array=Array.isArray;x.arrayOf=(e,t)=>!x.array(e)&&!x.function(t)?!1:e.every(n=>t(n));x.asyncGeneratorFunction=e=>Rt(e)==="AsyncGeneratorFunction";x.asyncFunction=ge("AsyncFunction");x.bigint=Qe("bigint");x.boolean=e=>e===!0||e===!1;x.date=ge("Date");x.defined=e=>!x.undefined(e);x.domElement=e=>x.object(e)&&!x.plainObject(e)&&e.nodeType===1&&x.string(e.nodeName)&&is.every(t=>t in e);x.empty=e=>x.string(e)&&e.length===0||x.array(e)&&e.length===0||x.object(e)&&!x.map(e)&&!x.set(e)&&Object.keys(e).length===0||x.set(e)&&e.size===0||x.map(e)&&e.size===0;x.error=ge("Error");x.function=Qe("function");x.generator=e=>x.iterable(e)&&x.function(e.next)&&x.function(e.throw);x.generatorFunction=ge("GeneratorFunction");x.instanceOf=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype;x.iterable=e=>!x.nullOrUndefined(e)&&x.function(e[Symbol.iterator]);x.map=ge("Map");x.nan=e=>Number.isNaN(e);x.null=e=>e===null;x.nullOrUndefined=e=>x.null(e)||x.undefined(e);x.number=e=>Qe("number")(e)&&!x.nan(e);x.numericString=e=>x.string(e)&&e.length>0&&!Number.isNaN(Number(e));x.object=e=>!x.nullOrUndefined(e)&&(x.function(e)||typeof e=="object");x.oneOf=(e,t)=>x.array(e)?e.indexOf(t)>-1:!1;x.plainFunction=ge("Function");x.plainObject=e=>{if(Rt(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};x.primitive=e=>x.null(e)||os(typeof e);x.promise=ge("Promise");x.propertyOf=(e,t,n)=>{if(!x.object(e)||!t)return!1;const r=e[t];return x.function(n)?n(r):x.defined(r)};x.regexp=ge("RegExp");x.set=ge("Set");x.string=Qe("string");x.symbol=Qe("symbol");x.undefined=Qe("undefined");x.weakMap=ge("WeakMap");x.weakSet=ge("WeakSet");var N=x;function ss(...e){return e.every(t=>N.string(t)||N.array(t)||N.plainObject(t))}function as(e,t,n){return br(e,t)?[e,t].every(N.array)?!e.some(Dn(n))&&t.some(Dn(n)):[e,t].every(N.plainObject)?!Object.entries(e).some(Pn(n))&&Object.entries(t).some(Pn(n)):t===n:!1}function Mn(e,t,n){const{actual:r,key:o,previous:i,type:a}=n,s=Ee(e,o),l=Ee(t,o);let u=[s,l].every(N.number)&&(a==="increased"?sl);return N.undefined(r)||(u=u&&l===r),N.undefined(i)||(u=u&&s===i),u}function xn(e,t,n){const{key:r,type:o,value:i}=n,a=Ee(e,r),s=Ee(t,r),l=o==="added"?a:s,u=o==="added"?s:a;if(!N.nullOrUndefined(i)){if(N.defined(l)){if(N.array(l)||N.plainObject(l))return as(l,u,i)}else return oe(u,i);return!1}return[a,s].every(N.array)?!u.every(un(l)):[a,s].every(N.plainObject)?ls(Object.keys(l),Object.keys(u)):![a,s].every(f=>N.primitive(f)&&N.defined(f))&&(o==="added"?!N.defined(a)&&N.defined(s):N.defined(a)&&!N.defined(s))}function Nn(e,t,{key:n}={}){let r=Ee(e,n),o=Ee(t,n);if(!br(r,o))throw new TypeError("Inputs have different types");if(!ss(r,o))throw new TypeError("Inputs don't have length");return[r,o].every(N.plainObject)&&(r=Object.keys(r),o=Object.keys(o)),[r,o]}function Pn(e){return([t,n])=>N.array(e)?oe(e,n)||e.some(r=>oe(r,n)||N.array(n)&&un(n)(r)):N.plainObject(e)&&e[t]?!!e[t]&&oe(e[t],n):oe(e,n)}function ls(e,t){return t.some(n=>!e.includes(n))}function Dn(e){return t=>N.array(e)?e.some(n=>oe(n,t)||N.array(t)&&un(t)(n)):oe(e,t)}function rt(e,t){return N.array(e)?e.some(n=>oe(n,t)):oe(e,t)}function un(e){return t=>e.some(n=>oe(n,t))}function br(...e){return e.every(N.array)||e.every(N.number)||e.every(N.plainObject)||e.every(N.string)}function Ee(e,t){return N.plainObject(e)||N.array(e)?N.string(t)?t.split(".").reduce((r,o)=>r&&r[o],e):N.number(t)?e[t]:e:e}function Mt(e,t){if([e,t].some(N.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(f=>N.plainObject(f)||N.array(f)))throw new Error("Expected plain objects or array");return{added:(f,c)=>{try{return xn(e,t,{key:f,type:"added",value:c})}catch{return!1}},changed:(f,c,d)=>{try{const p=Ee(e,f),h=Ee(t,f),v=N.defined(c),O=N.defined(d);if(v||O){const y=O?rt(d,p):!rt(c,p),m=rt(c,h);return y&&m}return[p,h].every(N.array)||[p,h].every(N.plainObject)?!oe(p,h):p!==h}catch{return!1}},changedFrom:(f,c,d)=>{if(!N.defined(f))return!1;try{const p=Ee(e,f),h=Ee(t,f),v=N.defined(d);return rt(c,p)&&(v?rt(d,h):!v)}catch{return!1}},decreased:(f,c,d)=>{if(!N.defined(f))return!1;try{return Mn(e,t,{key:f,actual:c,previous:d,type:"decreased"})}catch{return!1}},emptied:f=>{try{const[c,d]=Nn(e,t,{key:f});return!!c.length&&!d.length}catch{return!1}},filled:f=>{try{const[c,d]=Nn(e,t,{key:f});return!c.length&&!!d.length}catch{return!1}},increased:(f,c,d)=>{if(!N.defined(f))return!1;try{return Mn(e,t,{key:f,actual:c,previous:d,type:"increased"})}catch{return!1}},removed:(f,c)=>{try{return xn(e,t,{key:f,type:"removed",value:c})}catch{return!1}}}}var zt,In;function cs(){if(In)return zt;In=1;var e=new Error("Element already at target scroll position"),t=new Error("Scroll cancelled"),n=Math.min,r=Date.now;zt={left:o("scrollLeft"),top:o("scrollTop")};function o(s){return function(u,f,c,d){c=c||{},typeof c=="function"&&(d=c,c={}),typeof d!="function"&&(d=a);var p=r(),h=u[s],v=c.ease||i,O=isNaN(c.duration)?350:+c.duration,y=!1;return h===f?d(e,u[s]):requestAnimationFrame(S),m;function m(){y=!0}function S(D){if(y)return d(t,u[s]);var E=r(),C=n(1,(E-p)/O),M=v(C);u[s]=M*(f-h)+h,C<1?requestAnimationFrame(S):requestAnimationFrame(function(){d(null,u[s])})}}}function i(s){return .5*(1-Math.cos(Math.PI*s))}function a(){}return zt}var us=cs();const fs=Dt(us);var Ct={exports:{}},ds=Ct.exports,Rn;function ps(){return Rn||(Rn=1,(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(ds,function(){function t(r){var o=getComputedStyle(r,null).getPropertyValue("overflow");return o.indexOf("scroll")>-1||o.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var o=r.parentNode;o.parentNode;){if(t(o))return o;o=o.parentNode}return document.scrollingElement||document.documentElement}}return n})})(Ct)),Ct.exports}var hs=ps();const wr=Dt(hs);var Yt,Wn;function ms(){if(Wn)return Yt;Wn=1;var e=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},t=function(r,o){return r+n(o)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(t,""):e(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,Yt=n,Yt}var ys=ms();const An=Dt(ys);var qt,_n;function vs(){if(_n)return qt;_n=1;var e=function(m){return t(m)&&!n(m)};function t(y){return!!y&&typeof y=="object"}function n(y){var m=Object.prototype.toString.call(y);return m==="[object RegExp]"||m==="[object Date]"||i(y)}var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103;function i(y){return y.$$typeof===o}function a(y){return Array.isArray(y)?[]:{}}function s(y,m){return m.clone!==!1&&m.isMergeableObject(y)?v(a(y),y,m):y}function l(y,m,S){return y.concat(m).map(function(D){return s(D,S)})}function u(y,m){if(!m.customMerge)return v;var S=m.customMerge(y);return typeof S=="function"?S:v}function f(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(m){return Object.propertyIsEnumerable.call(y,m)}):[]}function c(y){return Object.keys(y).concat(f(y))}function d(y,m){try{return m in y}catch{return!1}}function p(y,m){return d(y,m)&&!(Object.hasOwnProperty.call(y,m)&&Object.propertyIsEnumerable.call(y,m))}function h(y,m,S){var D={};return S.isMergeableObject(y)&&c(y).forEach(function(E){D[E]=s(y[E],S)}),c(m).forEach(function(E){p(y,E)||(d(y,E)&&S.isMergeableObject(m[E])?D[E]=u(E,S)(y[E],m[E],S):D[E]=s(m[E],S))}),D}function v(y,m,S){S=S||{},S.arrayMerge=S.arrayMerge||l,S.isMergeableObject=S.isMergeableObject||e,S.cloneUnlessOtherwiseSpecified=s;var D=Array.isArray(m),E=Array.isArray(y),C=D===E;return C?D?S.arrayMerge(y,m,S):h(y,m,S):s(m,S)}v.all=function(m,S){if(!Array.isArray(m))throw new Error("first argument should be an array");return m.reduce(function(D,E){return v(D,E,S)},{})};var O=v;return qt=O,qt}var gs=vs();const ye=Dt(gs);var pt=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",bs=(function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0})();function ws(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function Os(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},bs))}}var Ss=pt&&window.Promise,Es=Ss?ws:Os;function Or(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function He(e,t){if(e.nodeType!==1)return[];var n=e.ownerDocument.defaultView,r=n.getComputedStyle(e,null);return t?r[t]:r}function fn(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function ht(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=He(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:ht(fn(e))}function Sr(e){return e&&e.referenceNode?e.referenceNode:e}var jn=pt&&!!(window.MSInputMethodContext&&document.documentMode),Fn=pt&&/MSIE 10/.test(navigator.userAgent);function et(e){return e===11?jn:e===10?Fn:jn||Fn}function Ke(e){if(!e)return document.documentElement;for(var t=et(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&He(n,"position")==="static"?Ke(n):n}function ks(e){var t=e.nodeName;return t==="BODY"?!1:t==="HTML"||Ke(e.firstElementChild)===e}function tn(e){return e.parentNode!==null?tn(e.parentNode):e}function xt(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return ks(a)?a:Ke(a);var s=tn(e);return s.host?xt(s.host,t):xt(e,tn(t).host)}function Ze(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=t==="top"?"scrollTop":"scrollLeft",r=e.nodeName;if(r==="BODY"||r==="HTML"){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function Cs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=Ze(t,"top"),o=Ze(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function Ln(e,t){var n=t==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function Bn(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],et(10)?parseInt(n["offset"+e])+parseInt(r["margin"+(e==="Height"?"Top":"Left")])+parseInt(r["margin"+(e==="Height"?"Bottom":"Right")]):0)}function Er(e){var t=e.body,n=e.documentElement,r=et(10)&&getComputedStyle(n);return{height:Bn("Height",t,n,r),width:Bn("Width",t,n,r)}}var Ts=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ms=(function(){function e(t,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=et(10),o=t.nodeName==="HTML",i=nn(e),a=nn(t),s=ht(e),l=He(t),u=parseFloat(l.borderTopWidth),f=parseFloat(l.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var c=Ae({top:i.top-a.top-u,left:i.left-a.left-f,width:i.width,height:i.height});if(c.marginTop=0,c.marginLeft=0,!r&&o){var d=parseFloat(l.marginTop),p=parseFloat(l.marginLeft);c.top-=u-d,c.bottom-=u-d,c.left-=f-p,c.right-=f-p,c.marginTop=d,c.marginLeft=p}return(r&&!n?t.contains(s):t===s&&s.nodeName!=="BODY")&&(c=Cs(c,t)),c}function xs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.ownerDocument.documentElement,r=dn(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:Ze(n),s=t?0:Ze(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i};return Ae(l)}function kr(e){var t=e.nodeName;if(t==="BODY"||t==="HTML")return!1;if(He(e,"position")==="fixed")return!0;var n=fn(e);return n?kr(n):!1}function Cr(e){if(!e||!e.parentElement||et())return document.documentElement;for(var t=e.parentElement;t&&He(t,"transform")==="none";)t=t.parentElement;return t||document.documentElement}function pn(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=o?Cr(e):xt(e,Sr(t));if(r==="viewport")i=xs(a,o);else{var s=void 0;r==="scrollParent"?(s=ht(fn(t)),s.nodeName==="BODY"&&(s=e.ownerDocument.documentElement)):r==="window"?s=e.ownerDocument.documentElement:s=r;var l=dn(s,a,o);if(s.nodeName==="HTML"&&!kr(a)){var u=Er(e.ownerDocument),f=u.height,c=u.width;i.top+=l.top-l.marginTop,i.bottom=f+l.top,i.left+=l.left-l.marginLeft,i.right=c+l.left}else i=l}n=n||0;var d=typeof n=="number";return i.left+=d?n:n.left||0,i.top+=d?n:n.top||0,i.right-=d?n:n.right||0,i.bottom-=d?n:n.bottom||0,i}function Ns(e){var t=e.width,n=e.height;return t*n}function Tr(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var a=pn(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map(function(d){return he({key:d},s[d],{area:Ns(s[d])})}).sort(function(d,p){return p.area-d.area}),u=l.filter(function(d){var p=d.width,h=d.height;return p>=n.clientWidth&&h>=n.clientHeight}),f=u.length>0?u[0].key:l[0].key,c=e.split("-")[1];return f+(c?"-"+c:"")}function Mr(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=r?Cr(t):xt(t,Sr(n));return dn(n,o,r)}function xr(e){var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),o=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:e.offsetWidth+o,height:e.offsetHeight+r};return i}function Nt(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(n){return t[n]})}function Nr(e,t,n){n=n.split("-")[0];var r=xr(e),o={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",s=i?"left":"top",l=i?"height":"width",u=i?"width":"height";return o[a]=t[a]+t[l]/2-r[l]/2,n===s?o[s]=t[s]-r[u]:o[s]=t[Nt(s)],o}function mt(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Ps(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(o){return o[t]===n});var r=mt(e,function(o){return o[t]===n});return e.indexOf(r)}function Pr(e,t,n){var r=n===void 0?e:e.slice(0,Ps(e,"name",n));return r.forEach(function(o){o.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=o.function||o.fn;o.enabled&&Or(i)&&(t.offsets.popper=Ae(t.offsets.popper),t.offsets.reference=Ae(t.offsets.reference),t=i(t,o))}),t}function Ds(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=Mr(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=Tr(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=Nr(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=Pr(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function Dr(e,t){return e.some(function(n){var r=n.name,o=n.enabled;return o&&r===t})}function hn(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;ra[p]&&(e.offsets.popper[c]+=s[c]+h-a[p]),e.offsets.popper=Ae(e.offsets.popper);var v=s[c]+s[u]/2-h/2,O=He(e.instance.popper),y=parseFloat(O["margin"+f]),m=parseFloat(O["border"+f+"Width"]),S=v-e.offsets.popper[c]-y-m;return S=Math.max(Math.min(a[u]-h,S),0),e.arrowElement=r,e.offsets.arrow=(n={},Je(n,c,Math.round(S)),Je(n,d,""),n),e}function zs(e){return e==="end"?"start":e==="start"?"end":e}var Ar=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Gt=Ar.slice(3);function $n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Gt.indexOf(e),r=Gt.slice(n+1).concat(Gt.slice(0,n));return t?r.reverse():r}var Vt={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Ys(e,t){if(Dr(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=pn(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=Nt(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case Vt.FLIP:a=[r,o];break;case Vt.CLOCKWISE:a=$n(r);break;case Vt.COUNTERCLOCKWISE:a=$n(r,!0);break;default:a=t.behavior}return a.forEach(function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],o=Nt(r);var u=e.offsets.popper,f=e.offsets.reference,c=Math.floor,d=r==="left"&&c(u.right)>c(f.left)||r==="right"&&c(u.left)c(f.top)||r==="bottom"&&c(u.top)c(n.right),v=c(u.top)c(n.bottom),y=r==="left"&&p||r==="right"&&h||r==="top"&&v||r==="bottom"&&O,m=["top","bottom"].indexOf(r)!==-1,S=!!t.flipVariations&&(m&&i==="start"&&p||m&&i==="end"&&h||!m&&i==="start"&&v||!m&&i==="end"&&O),D=!!t.flipVariationsByContent&&(m&&i==="start"&&h||m&&i==="end"&&p||!m&&i==="start"&&O||!m&&i==="end"&&v),E=S||D;(d||y||E)&&(e.flipped=!0,(d||y)&&(r=a[l+1]),E&&(i=zs(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=he({},e.offsets.popper,Nr(e.instance.popper,e.offsets.reference,e.placement)),e=Pr(e.instance.modifiers,e,"flip"))}),e}function qs(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(o)!==-1,s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]i(r[s])&&(e.offsets.popper[l]=i(r[s])),e}function Gs(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(a.indexOf("%")===0){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}var l=Ae(s);return l[t]/100*i}else if(a==="vh"||a==="vw"){var u=void 0;return a==="vh"?u=Math.max(document.documentElement.clientHeight,window.innerHeight||0):u=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u/100*i}else return i}function Vs(e,t,n,r){var o=[0,0],i=["right","left"].indexOf(r)!==-1,a=e.split(/(\+|\-)/).map(function(f){return f.trim()}),s=a.indexOf(mt(a,function(f){return f.search(/,|\s/)!==-1}));a[s]&&a[s].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=s!==-1?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return u=u.map(function(f,c){var d=(c===1?!i:i)?"height":"width",p=!1;return f.reduce(function(h,v){return h[h.length-1]===""&&["+","-"].indexOf(v)!==-1?(h[h.length-1]=v,p=!0,h):p?(h[h.length-1]+=v,p=!1,h):h.concat(v)},[]).map(function(h){return Gs(h,d,t,n)})}),u.forEach(function(f,c){f.forEach(function(d,p){mn(d)&&(o[c]+=d*(f[p-1]==="-"?-1:1))})}),o}function Ks(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],l=void 0;return mn(+n)?l=[+n,0]:l=Vs(n,i,a,s),s==="left"?(i.top+=l[0],i.left-=l[1]):s==="right"?(i.top+=l[0],i.left+=l[1]):s==="top"?(i.left+=l[0],i.top-=l[1]):s==="bottom"&&(i.left+=l[0],i.top+=l[1]),e.popper=i,e}function Zs(e,t){var n=t.boundariesElement||Ke(e.instance.popper);e.instance.reference===n&&(n=Ke(n));var r=hn("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var l=pn(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=l;var u=t.priority,f=e.offsets.popper,c={primary:function(p){var h=f[p];return f[p]l[p]&&!t.escapeWithReference&&(v=Math.min(f[h],l[p]-(p==="right"?f.width:f.height))),Je({},h,v)}};return u.forEach(function(d){var p=["left","top"].indexOf(d)!==-1?"primary":"secondary";f=he({},f,c[p](d))}),e.offsets.popper=f,e}function Js(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=["bottom","top"].indexOf(n)!==-1,l=s?"left":"top",u=s?"width":"height",f={start:Je({},l,i[l]),end:Je({},l,i[l]+i[u]-a[u])};e.offsets.popper=he({},a,f[r])}return e}function Xs(e){if(!Wr(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=mt(e.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&arguments[2]!==void 0?arguments[2]:{};Ts(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Es(this.update.bind(this)),this.options=he({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(he({},e.Defaults.modifiers,o.modifiers)).forEach(function(a){r.options.modifiers[a]=he({},e.Defaults.modifiers[a]||{},o.modifiers?o.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return he({name:a},r.options.modifiers[a])}).sort(function(a,s){return a.order-s.order}),this.modifiers.forEach(function(a){a.enabled&&Or(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Ms(e,[{key:"update",value:function(){return Ds.call(this)}},{key:"destroy",value:function(){return Is.call(this)}},{key:"enableEventListeners",value:function(){return Ws.call(this)}},{key:"disableEventListeners",value:function(){return _s.call(this)}}]),e})();ut.Utils=(typeof window<"u"?window:global).PopperUtils;ut.placements=Ar;ut.Defaults=ta;var na=["innerHTML","ownerDocument","style","attributes","nodeValue"],ra=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],oa=["bigint","boolean","null","number","string","symbol","undefined"];function Wt(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(ia(t))return t}function be(e){return function(t){return Wt(t)===e}}function ia(e){return ra.includes(e)}function tt(e){return function(t){return typeof t===e}}function sa(e){return oa.includes(e)}function g(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(g.array(e))return"Array";if(g.plainFunction(e))return"Function";var t=Wt(e);return t||"Object"}g.array=Array.isArray;g.arrayOf=function(e,t){return!g.array(e)&&!g.function(t)?!1:e.every(function(n){return t(n)})};g.asyncGeneratorFunction=function(e){return Wt(e)==="AsyncGeneratorFunction"};g.asyncFunction=be("AsyncFunction");g.bigint=tt("bigint");g.boolean=function(e){return e===!0||e===!1};g.date=be("Date");g.defined=function(e){return!g.undefined(e)};g.domElement=function(e){return g.object(e)&&!g.plainObject(e)&&e.nodeType===1&&g.string(e.nodeName)&&na.every(function(t){return t in e})};g.empty=function(e){return g.string(e)&&e.length===0||g.array(e)&&e.length===0||g.object(e)&&!g.map(e)&&!g.set(e)&&Object.keys(e).length===0||g.set(e)&&e.size===0||g.map(e)&&e.size===0};g.error=be("Error");g.function=tt("function");g.generator=function(e){return g.iterable(e)&&g.function(e.next)&&g.function(e.throw)};g.generatorFunction=be("GeneratorFunction");g.instanceOf=function(e,t){return!e||!t?!1:Object.getPrototypeOf(e)===t.prototype};g.iterable=function(e){return!g.nullOrUndefined(e)&&g.function(e[Symbol.iterator])};g.map=be("Map");g.nan=function(e){return Number.isNaN(e)};g.null=function(e){return e===null};g.nullOrUndefined=function(e){return g.null(e)||g.undefined(e)};g.number=function(e){return tt("number")(e)&&!g.nan(e)};g.numericString=function(e){return g.string(e)&&e.length>0&&!Number.isNaN(Number(e))};g.object=function(e){return!g.nullOrUndefined(e)&&(g.function(e)||typeof e=="object")};g.oneOf=function(e,t){return g.array(e)?e.indexOf(t)>-1:!1};g.plainFunction=be("Function");g.plainObject=function(e){if(Wt(e)!=="Object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};g.primitive=function(e){return g.null(e)||sa(typeof e)};g.promise=be("Promise");g.propertyOf=function(e,t,n){if(!g.object(e)||!t)return!1;var r=e[t];return g.function(n)?n(r):g.defined(r)};g.regexp=be("RegExp");g.set=be("Set");g.string=tt("string");g.symbol=tt("symbol");g.undefined=tt("undefined");g.weakMap=be("WeakMap");g.weakSet=be("WeakSet");function _r(e){return function(t){return typeof t===e}}var aa=_r("function"),la=function(e){return e===null},Hn=function(e){return Object.prototype.toString.call(e).slice(8,-1)==="RegExp"},Un=function(e){return!ca(e)&&!la(e)&&(aa(e)||typeof e=="object")},ca=_r("undefined"),on=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function ua(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=n;r--!==0;)if(!ae(e[r],t[r]))return!1;return!0}function fa(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e.buffer),r=new DataView(t.buffer),o=e.byteLength;o--;)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function da(e,t){var n,r,o,i;if(e.size!==t.size)return!1;try{for(var a=on(e.entries()),s=a.next();!s.done;s=a.next()){var l=s.value;if(!t.has(l[0]))return!1}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var u=on(e.entries()),f=u.next();!f.done;f=u.next()){var l=f.value;if(!ae(l[1],t.get(l[0])))return!1}}catch(c){o={error:c}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return!0}function pa(e,t){var n,r;if(e.size!==t.size)return!1;try{for(var o=on(e.entries()),i=o.next();!i.done;i=o.next()){var a=i.value;if(!t.has(a[0]))return!1}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}function ae(e,t){if(e===t)return!0;if(e&&Un(e)&&t&&Un(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return ua(e,t);if(e instanceof Map&&t instanceof Map)return da(e,t);if(e instanceof Set&&t instanceof Set)return pa(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return fa(e,t);if(Hn(e)&&Hn(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=n.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(var o=n.length;o--!==0;){var i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!ae(e[i],t[i]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}function ha(){for(var e=[],t=0;tl);return g.undefined(r)||(u=u&&l===r),g.undefined(i)||(u=u&&s===i),u}function Yn(e,t,n){var r=n.key,o=n.type,i=n.value,a=ke(e,r),s=ke(t,r),l=o==="added"?a:s,u=o==="added"?s:a;if(!g.nullOrUndefined(i)){if(g.defined(l)){if(g.array(l)||g.plainObject(l))return ma(l,u,i)}else return ae(u,i);return!1}return[a,s].every(g.array)?!u.every(yn(l)):[a,s].every(g.plainObject)?ya(Object.keys(l),Object.keys(u)):![a,s].every(function(f){return g.primitive(f)&&g.defined(f)})&&(o==="added"?!g.defined(a)&&g.defined(s):g.defined(a)&&!g.defined(s))}function qn(e,t,n){var r=n===void 0?{}:n,o=r.key,i=ke(e,o),a=ke(t,o);if(!jr(i,a))throw new TypeError("Inputs have different types");if(!ha(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(g.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function Gn(e){return function(t){var n=t[0],r=t[1];return g.array(e)?ae(e,r)||e.some(function(o){return ae(o,r)||g.array(r)&&yn(r)(o)}):g.plainObject(e)&&e[n]?!!e[n]&&ae(e[n],r):ae(e,r)}}function ya(e,t){return t.some(function(n){return!e.includes(n)})}function Vn(e){return function(t){return g.array(e)?e.some(function(n){return ae(n,t)||g.array(t)&&yn(t)(n)}):ae(e,t)}}function ot(e,t){return g.array(e)?e.some(function(n){return ae(n,t)}):ae(e,t)}function yn(e){return function(t){return e.some(function(n){return ae(n,t)})}}function jr(){for(var e=[],t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wa(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Fr(e,t){if(e==null)return{};var n=wa(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oa(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xe(e)}function bt(e){var t=ba();return function(){var r=Pt(e),o;if(t){var i=Pt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Oa(this,o)}}function Sa(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e){var t=Sa(e,"string");return typeof t=="symbol"?t:String(t)}var Ea={flip:{padding:20},preventOverflow:{padding:10}},ka="The typeValidator argument must be a function with the signature function(props, propName, componentName).",Ca="The error message is optional, but must be a string if provided.";function Ta(e,t,n,r){return typeof e=="boolean"?e:typeof e=="function"?e(t,n,r):e?!!e:!1}function Ma(e,t){return Object.hasOwnProperty.call(e,t)}function xa(e,t,n,r){return new Error("Required ".concat(e[t]," `").concat(t,"` was not specified in `").concat(n,"`."))}function Na(e,t){if(typeof e!="function")throw new TypeError(ka);if(t&&typeof t!="string")throw new TypeError(Ca)}function Zn(e,t,n){return Na(e,n),function(r,o,i){for(var a=arguments.length,s=new Array(a>3?a-3:0),l=3;l3&&arguments[3]!==void 0?arguments[3]:!1;e.addEventListener(t,n,r)}function Da(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;e.removeEventListener(t,n,r)}function Ia(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o;o=function(a){n(a),Da(e,t,o)},Pa(e,t,o,r)}function Jn(){}var Br=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"componentDidMount",value:function(){Oe()&&(this.node||this.appendNode(),it||this.renderPortal())}},{key:"componentDidUpdate",value:function(){Oe()&&(it||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!Oe()||!this.node||(it||Et.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var o=this.props,i=o.id,a=o.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!Oe())return null;var o=this.props,i=o.children,a=o.setRef;if(this.node||this.appendNode(),it)return Et.createPortal(i,this.node);var s=Et.unstable_renderSubtreeIntoContainer(this,i.length>1?w.createElement("div",null,i):i[0],this.node);return a(s),null}},{key:"renderReact16",value:function(){var o=this.props,i=o.hasChildren,a=o.placement,s=o.target;return i?this.renderPortal():s||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return it?this.renderReact16():null}}]),n})(w.Component);ne(Br,"propTypes",{children:T.oneOfType([T.element,T.array]),hasChildren:T.bool,id:T.oneOfType([T.string,T.number]),placement:T.string,setRef:T.func.isRequired,target:T.oneOfType([T.object,T.string]),zIndex:T.number});var $r=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"parentStyle",get:function(){var o=this.props,i=o.placement,a=o.styles,s=a.arrow.length,l={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(l.bottom=0,l.left=0,l.right=0,l.height=s):i.startsWith("bottom")?(l.left=0,l.right=0,l.top=0,l.height=s):i.startsWith("left")?(l.right=0,l.top=0,l.bottom=0):i.startsWith("right")&&(l.left=0,l.top=0),l}},{key:"render",value:function(){var o=this.props,i=o.placement,a=o.setArrowRef,s=o.styles,l=s.arrow,u=l.color,f=l.display,c=l.length,d=l.margin,p=l.position,h=l.spread,v={display:f,position:p},O,y=h,m=c;return i.startsWith("top")?(O="0,0 ".concat(y/2,",").concat(m," ").concat(y,",0"),v.bottom=0,v.marginLeft=d,v.marginRight=d):i.startsWith("bottom")?(O="".concat(y,",").concat(m," ").concat(y/2,",0 0,").concat(m),v.top=0,v.marginLeft=d,v.marginRight=d):i.startsWith("left")?(m=h,y=c,O="0,0 ".concat(y,",").concat(m/2," 0,").concat(m),v.right=0,v.marginTop=d,v.marginBottom=d):i.startsWith("right")&&(m=h,y=c,O="".concat(y,",").concat(m," ").concat(y,",0 0,").concat(m/2),v.left=0,v.marginTop=d,v.marginBottom=d),w.createElement("div",{className:"__floater__arrow",style:this.parentStyle},w.createElement("span",{ref:a,style:v},w.createElement("svg",{width:y,height:m,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},w.createElement("polygon",{points:O,fill:u}))))}}]),n})(w.Component);ne($r,"propTypes",{placement:T.string.isRequired,setArrowRef:T.func.isRequired,styles:T.object.isRequired});var Ra=["color","height","width"];function Hr(e){var t=e.handleClick,n=e.styles,r=n.color,o=n.height,i=n.width,a=Fr(n,Ra);return w.createElement("button",{"aria-label":"close",onClick:t,style:a,type:"button"},w.createElement("svg",{width:"".concat(i,"px"),height:"".concat(o,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},w.createElement("g",null,w.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}Hr.propTypes={handleClick:T.func.isRequired,styles:T.object.isRequired};function Ur(e){var t=e.content,n=e.footer,r=e.handleClick,o=e.open,i=e.positionWrapper,a=e.showCloseButton,s=e.title,l=e.styles,u={content:w.isValidElement(t)?t:w.createElement("div",{className:"__floater__content",style:l.content},t)};return s&&(u.title=w.isValidElement(s)?s:w.createElement("div",{className:"__floater__title",style:l.title},s)),n&&(u.footer=w.isValidElement(n)?n:w.createElement("div",{className:"__floater__footer",style:l.footer},n)),(a||i)&&!g.boolean(o)&&(u.close=w.createElement(Hr,{styles:l.close,handleClick:r})),w.createElement("div",{className:"__floater__container",style:l.container},u.close,u.title,u.content,u.footer)}Ur.propTypes={content:T.node.isRequired,footer:T.node,handleClick:T.func.isRequired,open:T.bool,positionWrapper:T.bool.isRequired,showCloseButton:T.bool.isRequired,styles:T.object.isRequired,title:T.node};var zr=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"style",get:function(){var o=this.props,i=o.disableAnimation,a=o.component,s=o.placement,l=o.hideArrow,u=o.status,f=o.styles,c=f.arrow.length,d=f.floater,p=f.floaterCentered,h=f.floaterClosing,v=f.floaterOpening,O=f.floaterWithAnimation,y=f.floaterWithComponent,m={};return l||(s.startsWith("top")?m.padding="0 0 ".concat(c,"px"):s.startsWith("bottom")?m.padding="".concat(c,"px 0 0"):s.startsWith("left")?m.padding="0 ".concat(c,"px 0 0"):s.startsWith("right")&&(m.padding="0 0 0 ".concat(c,"px"))),[$.OPENING,$.OPEN].indexOf(u)!==-1&&(m=K(K({},m),v)),u===$.CLOSING&&(m=K(K({},m),h)),u===$.OPEN&&!i&&(m=K(K({},m),O)),s==="center"&&(m=K(K({},m),p)),a&&(m=K(K({},m),y)),K(K({},d),m)}},{key:"render",value:function(){var o=this.props,i=o.component,a=o.handleClick,s=o.hideArrow,l=o.setFloaterRef,u=o.status,f={},c=["__floater"];return i?w.isValidElement(i)?f.content=w.cloneElement(i,{closeFn:a}):f.content=i({closeFn:a}):f.content=w.createElement(Ur,this.props),u===$.OPEN&&c.push("__floater__open"),s||(f.arrow=w.createElement($r,this.props)),w.createElement("div",{ref:l,className:c.join(" "),style:this.style},w.createElement("div",{className:"__floater__body"},f.content,f.arrow))}}]),n})(w.Component);ne(zr,"propTypes",{component:T.oneOfType([T.func,T.element]),content:T.node,disableAnimation:T.bool.isRequired,footer:T.node,handleClick:T.func.isRequired,hideArrow:T.bool.isRequired,open:T.bool,placement:T.string.isRequired,positionWrapper:T.bool.isRequired,setArrowRef:T.func.isRequired,setFloaterRef:T.func.isRequired,showCloseButton:T.bool,status:T.string.isRequired,styles:T.object.isRequired,title:T.node});var Yr=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"render",value:function(){var o=this.props,i=o.children,a=o.handleClick,s=o.handleMouseEnter,l=o.handleMouseLeave,u=o.setChildRef,f=o.setWrapperRef,c=o.style,d=o.styles,p;if(i)if(w.Children.count(i)===1)if(!w.isValidElement(i))p=w.createElement("span",null,i);else{var h=g.function(i.type)?"innerRef":"ref";p=w.cloneElement(w.Children.only(i),ne({},h,u))}else p=i;return p?w.createElement("span",{ref:f,style:K(K({},d),c),onClick:a,onMouseEnter:s,onMouseLeave:l},p):null}}]),n})(w.Component);ne(Yr,"propTypes",{children:T.node,handleClick:T.func.isRequired,handleMouseEnter:T.func.isRequired,handleMouseLeave:T.func.isRequired,setChildRef:T.func.isRequired,setWrapperRef:T.func.isRequired,style:T.object,styles:T.object.isRequired});var Wa={zIndex:100};function Aa(e){var t=ye(Wa,e.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:t.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:t.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:t}}var _a=["arrow","flip","offset"],ja=["position","top","right","bottom","left"],vn=(function(e){gt(n,e);var t=bt(n);function n(r){var o;return yt(this,n),o=t.call(this,r),ne(xe(o),"setArrowRef",function(i){o.arrowRef=i}),ne(xe(o),"setChildRef",function(i){o.childRef=i}),ne(xe(o),"setFloaterRef",function(i){o.floaterRef=i}),ne(xe(o),"setWrapperRef",function(i){o.wrapperRef=i}),ne(xe(o),"handleTransitionEnd",function(){var i=o.state.status,a=o.props.callback;o.wrapperPopper&&o.wrapperPopper.instance.update(),o.setState({status:i===$.OPENING?$.OPEN:$.IDLE},function(){var s=o.state.status;a(s===$.OPEN?"open":"close",o.props)})}),ne(xe(o),"handleClick",function(){var i=o.props,a=i.event,s=i.open;if(!g.boolean(s)){var l=o.state,u=l.positionWrapper,f=l.status;(o.event==="click"||o.event==="hover"&&u)&&(St({title:"click",data:[{event:a,status:f===$.OPEN?"closing":"opening"}],debug:o.debug}),o.toggle())}}),ne(xe(o),"handleMouseEnter",function(){var i=o.props,a=i.event,s=i.open;if(!(g.boolean(s)||Kt())){var l=o.state.status;o.event==="hover"&&l===$.IDLE&&(St({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:o.debug}),clearTimeout(o.eventDelayTimeout),o.toggle())}}),ne(xe(o),"handleMouseLeave",function(){var i=o.props,a=i.event,s=i.eventDelay,l=i.open;if(!(g.boolean(l)||Kt())){var u=o.state,f=u.status,c=u.positionWrapper;o.event==="hover"&&(St({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:o.debug}),s?[$.OPENING,$.OPEN].indexOf(f)!==-1&&!c&&!o.eventDelayTimeout&&(o.eventDelayTimeout=setTimeout(function(){delete o.eventDelayTimeout,o.toggle()},s*1e3)):o.toggle($.IDLE))}}),o.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:$.INIT,statusWrapper:$.INIT},o._isMounted=!1,o.hasMounted=!1,Oe()&&window.addEventListener("load",function(){o.popper&&o.popper.instance.update(),o.wrapperPopper&&o.wrapperPopper.instance.update()}),o}return vt(n,[{key:"componentDidMount",value:function(){if(Oe()){var o=this.state.positionWrapper,i=this.props,a=i.children,s=i.open,l=i.target;this._isMounted=!0,St({title:"init",data:{hasChildren:!!a,hasTarget:!!l,isControlled:g.boolean(s),positionWrapper:o,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&l&&g.boolean(s)}}},{key:"componentDidUpdate",value:function(o,i){if(Oe()){var a=this.props,s=a.autoOpen,l=a.open,u=a.target,f=a.wrapperOptions,c=va(i,this.state),d=c.changedFrom,p=c.changed;if(o.open!==l){var h;g.boolean(l)&&(h=l?$.OPENING:$.CLOSING),this.toggle(h)}(o.wrapperOptions.position!==f.position||o.target!==u)&&this.changeWrapperPosition(this.props),p("status",$.IDLE)&&l?this.toggle($.OPEN):d("status",$.INIT,$.IDLE)&&s&&this.toggle($.OPEN),this.popper&&p("status",$.OPENING)&&this.popper.instance.update(),this.floaterRef&&(p("status",$.OPENING)||p("status",$.CLOSING))&&Ia(this.floaterRef,"transitionend",this.handleTransitionEnd),p("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){Oe()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,s=this.props,l=s.disableFlip,u=s.getPopper,f=s.hideArrow,c=s.offset,d=s.placement,p=s.wrapperOptions,h=d==="top"||d==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(d==="center")this.setState({status:$.IDLE});else if(i&&this.floaterRef){var v=this.options,O=v.arrow,y=v.flip,m=v.offset,S=Fr(v,_a);new ut(i,this.floaterRef,{placement:d,modifiers:K({arrow:K({enabled:!f,element:this.arrowRef},O),flip:K({enabled:!l,behavior:h},y),offset:K({offset:"0, ".concat(c,"px")},m)},S),onCreate:function(C){var M;if(o.popper=C,!((M=o.floaterRef)!==null&&M!==void 0&&M.isConnected)){o.setState({needsUpdate:!0});return}u(C,"floater"),o._isMounted&&o.setState({currentPlacement:C.placement,status:$.IDLE}),d!==C.placement&&setTimeout(function(){C.instance.update()},1)},onUpdate:function(C){o.popper=C;var M=o.state.currentPlacement;o._isMounted&&C.placement!==M&&o.setState({currentPlacement:C.placement})}})}if(a){var D=g.undefined(p.offset)?0:p.offset;new ut(this.target,this.wrapperRef,{placement:p.placement||d,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(D,"px")},flip:{enabled:!1}},onCreate:function(C){o.wrapperPopper=C,o._isMounted&&o.setState({statusWrapper:$.IDLE}),u(C,"wrapper"),d!==C.placement&&setTimeout(function(){C.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var o=this;this.floaterRefInterval=setInterval(function(){var i;(i=o.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(o.floaterRefInterval),o.setState({needsUpdate:!1}),o.initPopper())},50)}},{key:"changeWrapperPosition",value:function(o){var i=o.target,a=o.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(o){var i=this.state.status,a=i===$.OPEN?$.CLOSING:$.OPENING;g.undefined(o)||(a=o),this.setState({status:a})}},{key:"debug",get:function(){var o=this.props.debug;return o||Oe()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var o=this.props,i=o.disableHoverToClick,a=o.event;return a==="hover"&&Kt()&&!i?"click":a}},{key:"options",get:function(){var o=this.props.options;return ye(Ea,o||{})}},{key:"styles",get:function(){var o=this,i=this.state,a=i.status,s=i.positionWrapper,l=i.statusWrapper,u=this.props.styles,f=ye(Aa(u),u);if(s){var c;[$.IDLE].indexOf(a)===-1||[$.IDLE].indexOf(l)===-1?c=f.wrapperPosition:c=this.wrapperPopper.styles,f.wrapper=K(K({},f.wrapper),c)}if(this.target){var d=window.getComputedStyle(this.target);this.wrapperStyles?f.wrapper=K(K({},f.wrapper),this.wrapperStyles):["relative","static"].indexOf(d.position)===-1&&(this.wrapperStyles={},s||(ja.forEach(function(p){o.wrapperStyles[p]=d[p]}),f.wrapper=K(K({},f.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return f}},{key:"target",get:function(){if(!Oe())return null;var o=this.props.target;return o?g.domElement(o)?o:document.querySelector(o):this.childRef||this.wrapperRef}},{key:"render",value:function(){var o=this.state,i=o.currentPlacement,a=o.positionWrapper,s=o.status,l=this.props,u=l.children,f=l.component,c=l.content,d=l.disableAnimation,p=l.footer,h=l.hideArrow,v=l.id,O=l.open,y=l.showCloseButton,m=l.style,S=l.target,D=l.title,E=w.createElement(Yr,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:m,styles:this.styles.wrapper},u),C={};return a?C.wrapperInPortal=E:C.wrapperAsChildren=E,w.createElement("span",null,w.createElement(Br,{hasChildren:!!u,id:v,placement:i,setRef:this.setFloaterRef,target:S,zIndex:this.styles.options.zIndex},w.createElement(zr,{component:f,content:c,disableAnimation:d,footer:p,handleClick:this.handleClick,hideArrow:h||i==="center",open:O,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:y,status:s,styles:this.styles,title:D}),C.wrapperInPortal),C.wrapperAsChildren)}}]),n})(w.Component);ne(vn,"propTypes",{autoOpen:T.bool,callback:T.func,children:T.node,component:Zn(T.oneOfType([T.func,T.element]),function(e){return!e.content}),content:Zn(T.node,function(e){return!e.component}),debug:T.bool,disableAnimation:T.bool,disableFlip:T.bool,disableHoverToClick:T.bool,event:T.oneOf(["hover","click"]),eventDelay:T.number,footer:T.node,getPopper:T.func,hideArrow:T.bool,id:T.oneOfType([T.string,T.number]),offset:T.number,open:T.bool,options:T.object,placement:T.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:T.bool,style:T.object,styles:T.object,target:T.oneOfType([T.object,T.string]),title:T.node,wrapperOptions:T.shape({offset:T.number,placement:T.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:T.bool})});ne(vn,"defaultProps",{autoOpen:!1,callback:Jn,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:Jn,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var Fa=Object.defineProperty,La=(e,t,n)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>La(e,typeof t!="symbol"?t+"":t,n),z={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},me={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},A={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},B={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function Re(){var e;return!!(typeof window<"u"&&((e=window.document)!=null&&e.createElement))}function qr(e){return e?e.getBoundingClientRect():null}function Ba(e=!1){const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),o=Math.floor(r.length/2);return r.length%2===0?(r[o-1]+r[o])/2:r[o]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Ne(e){if(typeof e=="string")try{return document.querySelector(e)}catch{return null}return e}function $a(e){return!e||e.nodeType!==1?null:getComputedStyle(e)}function ft(e,t,n){if(!e)return Fe();const r=wr(e);if(r){if(r.isSameNode(Fe()))return n?document:Fe();if(!(r.scrollHeight>r.offsetHeight)&&!t)return r.style.overflow="initial",Fe()}return r}function At(e,t){if(!e)return!1;const n=ft(e,t);return n?!n.isSameNode(Fe()):!1}function Ha(e){return e.offsetParent!==document.body}function Xe(e,t="fixed"){if(!e||!(e instanceof HTMLElement))return!1;const{nodeName:n}=e,r=$a(e);return n==="BODY"||n==="HTML"?!1:r&&r.position===t?!0:e.parentNode?Xe(e.parentNode,t):!1}function Ua(e){var t;if(!e)return!1;let n=e;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:o}=getComputedStyle(n);if(r==="none"||o==="hidden")return!1}n=(t=n.parentElement)!=null?t:null}return!0}function za(e,t,n){var r,o,i;const a=qr(e),s=ft(e,n),l=At(e,n),u=Xe(e);let f=0,c=(r=a?.top)!=null?r:0;if(l&&u){const d=(o=e?.offsetTop)!=null?o:0,p=(i=s?.scrollTop)!=null?i:0;c=d-p}else s instanceof HTMLElement&&(f=s.scrollTop,!l&&!Xe(e)&&(c+=f),s.isSameNode(Fe())||(c+=Fe().scrollTop));return Math.floor(c-t)}function Ya(e,t,n){var r;if(!e)return 0;const{offsetTop:o=0,scrollTop:i=0}=(r=wr(e))!=null?r:{};let a=e.getBoundingClientRect().top+i;o&&(At(e,n)||Ha(e))&&(a-=o);const s=Math.floor(a-t);return s<0?0:s}function Fe(){var e;return(e=document.scrollingElement)!=null?e:document.documentElement}function qa(e,t){const{duration:n,element:r}=t;return new Promise((o,i)=>{const{scrollTop:a}=r,s=e>a?e-a:a-e;fs.top(r,e,{duration:s<100?50:n},l=>l&&l.message!=="Element already at target scroll position"?i(l):o())})}var st=kt.createPortal!==void 0;function Gr(e=navigator.userAgent){let t=e;return typeof window>"u"?t="node":document.documentMode?t="ie":/Edge/.test(e)?t="edge":window.opera||e.includes(" OPR/")?t="opera":typeof window.InstallTrigger<"u"?t="firefox":window.chrome?t="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(e)&&(t="safari"),t}function Tt(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function Se(e,t={}){const{defaultValue:n,step:r,steps:o}=t;let i=An(e);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&o&&(i=i.replace("{step}",r.toString()).replace("{steps}",o.toString()));else if(b.isValidElement(e)&&!Object.values(e.props).length&&Tt(e.type)==="function"){const a=e.type({});i=Se(a,t)}else i=An(n);return i}function Ga(e,t){return!N.plainObject(e)||!N.array(t)?!1:Object.keys(e).every(n=>t.includes(n))}function Va(e){const t=/^#?([\da-f])([\da-f])([\da-f])$/i,n=e.replace(t,(o,i,a,s)=>i+i+a+a+s+s),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function Xn(e){return e.disableBeacon||e.placement==="center"}function Qn(){return!["chrome","safari","firefox","opera"].includes(Gr())}function $e({data:e,debug:t=!1,title:n,warn:r=!1}){const o=r?console.warn||console.error:console.log;t&&(n&&e?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(e)?e.forEach(i=>{N.plainObject(i)&&i.key?o.apply(console,[i.key,i.value]):o.apply(console,[i])}):o.apply(console,[e]),console.groupEnd()):console.error("Missing title or data props"))}function Ka(e){return Object.keys(e)}function Vr(e,...t){if(!N.plainObject(e))throw new TypeError("Expected an object");const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}function Za(e,...t){if(!N.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(n[r]=e[r]);return n}function an(e,t,n){const r=i=>i.replace("{step}",String(t)).replace("{steps}",String(n));if(Tt(e)==="string")return r(e);if(!b.isValidElement(e))return e;const{children:o}=e.props;if(Tt(o)==="string"&&o.includes("{step}"))return b.cloneElement(e,{children:r(o)});if(Array.isArray(o))return b.cloneElement(e,{children:o.map(i=>typeof i=="string"?r(i):an(i,t,n))});if(Tt(e.type)==="function"&&!Object.values(e.props).length){const i=e.type({});return an(i,t,n)}return e}function Ja(e){const{isFirstStep:t,lifecycle:n,previousLifecycle:r,scrollToFirstStep:o,step:i,target:a}=e;return!i.disableScrolling&&(!t||o||n===A.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!Xe(a))&&r!==n&&[A.BEACON,A.TOOLTIP].includes(n)}var Xa={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},Kr={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},Qa={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:Kr,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},el={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},tl={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},at={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},er={borderRadius:4,position:"absolute"};function nl(e,t){var n,r,o,i,a;const{floaterProps:s,styles:l}=e,u=ye((n=t.floaterProps)!=null?n:{},s??{}),f=ye(l??{},(r=t.styles)!=null?r:{}),c=ye(tl,f.options||{}),d=t.placement==="center"||t.disableBeacon;let{width:p}=c;window.innerWidth>480&&(p=380),"width"in c&&(p=typeof c.width=="number"&&window.innerWidthZr(n,t)):($e({title:"validateSteps",data:"steps must be an array",warn:!0,debug:t}),!1)}var Jr={action:"init",controlled:!1,index:0,lifecycle:A.INIT,origin:null,size:0,status:B.IDLE},nr=Ka(Vr(Jr,"controlled","size")),ol=class{constructor(e){P(this,"beaconPopper"),P(this,"tooltipPopper"),P(this,"data",new Map),P(this,"listener"),P(this,"store",new Map),P(this,"addListener",o=>{this.listener=o}),P(this,"setSteps",o=>{const{size:i,status:a}=this.getState(),s={size:o.length,status:a};this.data.set("steps",o),a===B.WAITING&&!i&&o.length&&(s.status=B.RUNNING),this.setState(s)}),P(this,"getPopper",o=>o==="beacon"?this.beaconPopper:this.tooltipPopper),P(this,"setPopper",(o,i)=>{o==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),P(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),P(this,"close",(o=null)=>{const{index:i,status:a}=this.getState();a===B.RUNNING&&this.setState({...this.getNextState({action:z.CLOSE,index:i+1,origin:o})})}),P(this,"go",o=>{const{controlled:i,status:a}=this.getState();if(i||a!==B.RUNNING)return;const s=this.getSteps()[o];this.setState({...this.getNextState({action:z.GO,index:o}),status:s?a:B.FINISHED})}),P(this,"info",()=>this.getState()),P(this,"next",()=>{const{index:o,status:i}=this.getState();i===B.RUNNING&&this.setState(this.getNextState({action:z.NEXT,index:o+1}))}),P(this,"open",()=>{const{status:o}=this.getState();o===B.RUNNING&&this.setState({...this.getNextState({action:z.UPDATE,lifecycle:A.TOOLTIP})})}),P(this,"prev",()=>{const{index:o,status:i}=this.getState();i===B.RUNNING&&this.setState({...this.getNextState({action:z.PREV,index:o-1})})}),P(this,"reset",(o=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:z.RESET,index:0}),status:o?B.RUNNING:B.READY})}),P(this,"skip",()=>{const{status:o}=this.getState();o===B.RUNNING&&this.setState({action:z.SKIP,lifecycle:A.INIT,status:B.SKIPPED})}),P(this,"start",o=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:z.START,index:N.number(o)?o:i},!0),status:a?B.RUNNING:B.WAITING})}),P(this,"stop",(o=!1)=>{const{index:i,status:a}=this.getState();[B.FINISHED,B.SKIPPED].includes(a)||this.setState({...this.getNextState({action:z.STOP,index:i+(o?1:0)}),status:B.PAUSED})}),P(this,"update",o=>{var i,a;if(!Ga(o,nr))throw new Error(`State is not valid. Valid keys: ${nr.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...o,action:(i=o.action)!=null?i:z.UPDATE,origin:(a=o.origin)!=null?a:null},!0)})});const{continuous:t=!1,stepIndex:n,steps:r=[]}=e??{};this.setState({action:z.INIT,controlled:N.number(n),continuous:t,index:N.number(n)?n:0,lifecycle:A.INIT,origin:null,status:r.length?B.READY:B.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...Jr}}getNextState(e,t=!1){var n,r,o,i,a;const{action:s,controlled:l,index:u,size:f,status:c}=this.getState(),d=N.number(e.index)?e.index:u,p=l&&!t?u:Math.min(Math.max(d,0),f);return{action:(n=e.action)!=null?n:s,controlled:l,index:p,lifecycle:(r=e.lifecycle)!=null?r:A.INIT,origin:(o=e.origin)!=null?o:null,size:(i=e.size)!=null?i:f,status:p===f?B.FINISHED:(a=e.status)!=null?a:c}}getSteps(){const e=this.data.get("steps");return Array.isArray(e)?e:[]}hasUpdatedState(e){const t=JSON.stringify(e),n=JSON.stringify(this.getState());return t!==n}setState(e,t=!1){const n=this.getState(),{action:r,index:o,lifecycle:i,origin:a=null,size:s,status:l}={...n,...e};this.store.set("action",r),this.store.set("index",o),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",s),this.store.set("status",l),t&&(this.store.set("controlled",e.controlled),this.store.set("continuous",e.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function il(e){return new ol(e)}function sl({styles:e}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:e})}var al=sl,ll=class extends b.Component{constructor(){super(...arguments),P(this,"isActive",!1),P(this,"resizeTimeout"),P(this,"scrollTimeout"),P(this,"scrollParent"),P(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),P(this,"hideSpotlight",()=>{const{continuous:e,disableOverlay:t,lifecycle:n}=this.props,r=[A.INIT,A.BEACON,A.COMPLETE,A.ERROR];return t||(e?r.includes(n):n!==A.TOOLTIP)}),P(this,"handleMouseMove",e=>{const{mouseOverSpotlight:t}=this.state,{height:n,left:r,position:o,top:i,width:a}=this.spotlightStyles,s=o==="fixed"?e.clientY:e.pageY,l=o==="fixed"?e.clientX:e.pageX,u=s>=i&&s<=i+n,c=l>=r&&l<=r+a&&u;c!==t&&this.updateState({mouseOverSpotlight:c})}),P(this,"handleScroll",()=>{const{target:e}=this.props,t=Ne(e);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else Xe(t,"sticky")&&this.updateState({})}),P(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:r}=this.props,o=Ne(r);this.scrollParent=ft(o??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:o,target:i}=this.props,{changed:a}=Mt(e,this.props);if(a("target")||a("disableScrollParentFix")){const s=Ne(i);this.scrollParent=ft(s??document.body,n,!0)}a("lifecycle",A.TOOLTIP)&&((t=this.scrollParent)==null||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:s}=this.state;s||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(o&&r===A.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==A.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(e=this.scrollParent)==null||e.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:e}=this.state,{disableOverlayClose:t,placement:n,styles:r}=this.props;let o=r.overlay;return Qn()&&(o=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:t?"default":"pointer",height:Ba(),pointerEvents:e?"none":"auto",...o}}get spotlightStyles(){var e,t,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:o=!1,spotlightClicks:i,spotlightPadding:a=0,styles:s,target:l}=this.props,u=Ne(l),f=qr(u),c=Xe(u),d=za(u,a,o);return{...Qn()?s.spotlightLegacy:s.spotlight,height:Math.round(((e=f?.height)!=null?e:0)+a*2),left:Math.round(((t=f?.left)!=null?t:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:c?"fixed":"absolute",top:d,transition:"opacity 0.2s",width:Math.round(((n=f?.width)!=null?n:0)+a*2)}}updateState(e){this.isActive&&this.setState(t=>({...t,...e}))}render(){const{showSpotlight:e}=this.state,{onClickOverlay:t,placement:n}=this.props,{hideSpotlight:r,overlayStyles:o,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&e&&b.createElement(al,{styles:i});if(Gr()==="safari"){const{mixBlendMode:s,zIndex:l,...u}=o;a=b.createElement("div",{style:{...u}},a),delete o.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:t,role:"presentation",style:o},a)}},cl=class extends b.Component{constructor(){super(...arguments),P(this,"node",null)}componentDidMount(){const{id:e}=this.props;Re()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),st||this.renderReact15())}componentDidUpdate(){Re()&&(st||this.renderReact15())}componentWillUnmount(){!Re()||!this.node||(st||kt.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Re())return;const{children:e}=this.props;this.node&&kt.unstable_renderSubtreeIntoContainer(this,e,this.node)}renderReact16(){if(!Re()||!st)return null;const{children:e}=this.props;return this.node?kt.createPortal(e,this.node):null}render(){return st?this.renderReact16():null}},ul=class{constructor(e,t){if(P(this,"element"),P(this,"options"),P(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),P(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,o=n.nodeName.toLowerCase();return(r.test(o)&&!n.getAttribute("disabled")||o==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),P(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),P(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),P(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:o}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!o&&i+1===r.length?i=0:o&&i===0?i=r.length-1:i+=o?-1:1,r[i].focus()}),P(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,o=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&o.getPropertyValue("overflow")!=="visible"||o.getPropertyValue("display")==="none"}),P(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),P(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),P(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),P(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(e instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=e,this.options=t,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},fl=class extends b.Component{constructor(e){if(super(e),P(this,"beacon",null),P(this,"setBeaconRef",o=>{this.beacon=o}),e.beaconComponent)return;const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",e.nonce&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode(` +import{k as Lo,u as Ve,R as Bo,o as $o,O as Ho,C as Uo,r as ct}from"./radix-core-C3XKqQJw.js";import{r as b,j as zo,R as w,c as Et,b as kt}from"./router-CWhjJi2n.js";import{g as Dt}from"./react-vendor-Dtc2IqVY.js";import{ai as T}from"./charts-Dhri-zxi.js";import{a as Yo,b as qo,d as Go,e as Vo,f as Ko,g as Zo,h as Jo,i as Xo,j as Qo,k as ei,l as ti,m as ni,n as ri,o as oi,p as ii,q as si,r as ai,s as li,t as ci,u as ui,v as fi,w as di,x as pi,y as hi,z as mi,A as yi,B as vi,C as gi,D as bi,E as wi,F as Oi,G as Si,H as cr}from"./utils-CCeOswSm.js";var Sn=1,Ei=.9,ki=.8,Ci=.17,$t=.1,Ht=.999,Ti=.9999,Mi=.99,xi=/[\\\/_+.#"@\[\(\{&]/,Ni=/[\\\/_+.#"@\[\(\{&]/g,Pi=/[\s-]/,ur=/[\s-]/g;function Qt(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?Sn:Mi;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(i),u=n.indexOf(l,o),f=0,c,d,p,h;u>=0;)c=Qt(e,t,n,r,u+1,i+1,a),c>f&&(u===o?c*=Sn:xi.test(e.charAt(u-1))?(c*=ki,p=e.slice(o,u-1).match(Ni),p&&o>0&&(c*=Math.pow(Ht,p.length))):Pi.test(e.charAt(u-1))?(c*=Ei,h=e.slice(o,u-1).match(ur),h&&o>0&&(c*=Math.pow(Ht,h.length))):(c*=Ci,o>0&&(c*=Math.pow(Ht,u-o))),e.charAt(u)!==t.charAt(i)&&(c*=Ti)),(c<$t&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(d=Qt(e,t,n,r,u+1,i+2,a),d*$t>c&&(c=d*$t)),c>f&&(f=c),u=n.indexOf(l,u+1);return a[s]=f,f}function En(e){return e.toLowerCase().replace(ur," ")}function Di(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Qt(e,t,En(e),En(t),0,0,{})}var Ii=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=Ii.reduce((e,t)=>{const n=Lo(`Primitive.${t}`),r=b.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),zo.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),nt='[cmdk-group=""]',Ut='[cmdk-group-items=""]',Ri='[cmdk-group-heading=""]',fr='[cmdk-item=""]',kn=`${fr}:not([aria-disabled="true"])`,en="cmdk-item-select",qe="data-value",Wi=(e,t,n)=>Di(e,t,n),dr=b.createContext(void 0),dt=()=>b.useContext(dr),pr=b.createContext(void 0),cn=()=>b.useContext(pr),hr=b.createContext(void 0),mr=b.forwardRef((e,t)=>{let n=Ge(()=>{var k,W;return{search:"",value:(W=(k=e.value)!=null?k:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ge(()=>new Set),o=Ge(()=>new Map),i=Ge(()=>new Map),a=Ge(()=>new Set),s=yr(e),{label:l,children:u,value:f,onValueChange:c,filter:d,shouldFilter:p,loop:h,disablePointerSelection:v=!1,vimBindings:O=!0,...y}=e,m=Ve(),S=Ve(),D=Ve(),E=b.useRef(null),C=Yi();Be(()=>{if(f!==void 0){let k=f.trim();n.current.value=k,M.emit()}},[f]),Be(()=>{C(6,Me)},[]);let M=b.useMemo(()=>({subscribe:k=>(a.current.add(k),()=>a.current.delete(k)),snapshot:()=>n.current,setState:(k,W,F)=>{var R,U,G,ee;if(!Object.is(n.current[k],W)){if(n.current[k]=W,k==="search")re(),Y(),C(1,Q);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(D);X?X.focus():(R=document.getElementById(m))==null||R.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=le())==null?void 0:X.id,M.emit()}),F||C(5,Me),((U=s.current)==null?void 0:U.value)!==void 0){let X=W??"";(ee=(G=s.current).onValueChange)==null||ee.call(G,X);return}}M.emit()}},emit:()=>{a.current.forEach(k=>k())}}),[]),j=b.useMemo(()=>({value:(k,W,F)=>{var R;W!==((R=i.current.get(k))==null?void 0:R.value)&&(i.current.set(k,{value:W,keywords:F}),n.current.filtered.items.set(k,J(W,F)),C(2,()=>{Y(),M.emit()}))},item:(k,W)=>(r.current.add(k),W&&(o.current.has(W)?o.current.get(W).add(k):o.current.set(W,new Set([k]))),C(3,()=>{re(),Y(),n.current.value||Q(),M.emit()}),()=>{i.current.delete(k),r.current.delete(k),n.current.filtered.items.delete(k);let F=le();C(4,()=>{re(),F?.getAttribute("id")===k&&Q(),M.emit()})}),group:k=>(o.current.has(k)||o.current.set(k,new Set),()=>{i.current.delete(k),o.current.delete(k)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:m,inputId:D,labelId:S,listInnerRef:E}),[]);function J(k,W){var F,R;let U=(R=(F=s.current)==null?void 0:F.filter)!=null?R:Wi;return k?U(k,n.current.search,W):0}function Y(){if(!n.current.search||s.current.shouldFilter===!1)return;let k=n.current.filtered.items,W=[];n.current.filtered.groups.forEach(R=>{let U=o.current.get(R),G=0;U.forEach(ee=>{let X=k.get(ee);G=Math.max(X,G)}),W.push([R,G])});let F=E.current;de().sort((R,U)=>{var G,ee;let X=R.getAttribute("id"),ze=U.getAttribute("id");return((G=k.get(ze))!=null?G:0)-((ee=k.get(X))!=null?ee:0)}).forEach(R=>{let U=R.closest(Ut);U?U.appendChild(R.parentElement===U?R:R.closest(`${Ut} > *`)):F.appendChild(R.parentElement===F?R:R.closest(`${Ut} > *`))}),W.sort((R,U)=>U[1]-R[1]).forEach(R=>{var U;let G=(U=E.current)==null?void 0:U.querySelector(`${nt}[${qe}="${encodeURIComponent(R[0])}"]`);G?.parentElement.appendChild(G)})}function Q(){let k=de().find(F=>F.getAttribute("aria-disabled")!=="true"),W=k?.getAttribute(qe);M.setState("value",W||void 0)}function re(){var k,W,F,R;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let U=0;for(let G of r.current){let ee=(W=(k=i.current.get(G))==null?void 0:k.value)!=null?W:"",X=(R=(F=i.current.get(G))==null?void 0:F.keywords)!=null?R:[],ze=J(ee,X);n.current.filtered.items.set(G,ze),ze>0&&U++}for(let[G,ee]of o.current)for(let X of ee)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=U}function Me(){var k,W,F;let R=le();R&&(((k=R.parentElement)==null?void 0:k.firstChild)===R&&((F=(W=R.closest(nt))==null?void 0:W.querySelector(Ri))==null||F.scrollIntoView({block:"nearest"})),R.scrollIntoView({block:"nearest"}))}function le(){var k;return(k=E.current)==null?void 0:k.querySelector(`${fr}[aria-selected="true"]`)}function de(){var k;return Array.from(((k=E.current)==null?void 0:k.querySelectorAll(kn))||[])}function Ie(k){let W=de()[k];W&&M.setState("value",W.getAttribute(qe))}function je(k){var W;let F=le(),R=de(),U=R.findIndex(ee=>ee===F),G=R[U+k];(W=s.current)!=null&&W.loop&&(G=U+k<0?R[R.length-1]:U+k===R.length?R[0]:R[U+k]),G&&M.setState("value",G.getAttribute(qe))}function ie(k){let W=le(),F=W?.closest(nt),R;for(;F&&!R;)F=k>0?Ui(F,nt):zi(F,nt),R=F?.querySelector(kn);R?M.setState("value",R.getAttribute(qe)):je(k)}let se=()=>Ie(de().length-1),pe=k=>{k.preventDefault(),k.metaKey?se():k.altKey?ie(1):je(1)},Ue=k=>{k.preventDefault(),k.metaKey?Ie(0):k.altKey?ie(-1):je(-1)};return b.createElement(_e.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:k=>{var W;(W=y.onKeyDown)==null||W.call(y,k);let F=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||F))switch(k.key){case"n":case"j":{O&&k.ctrlKey&&pe(k);break}case"ArrowDown":{pe(k);break}case"p":case"k":{O&&k.ctrlKey&&Ue(k);break}case"ArrowUp":{Ue(k);break}case"Home":{k.preventDefault(),Ie(0);break}case"End":{k.preventDefault(),se();break}case"Enter":{k.preventDefault();let R=le();if(R){let U=new Event(en);R.dispatchEvent(U)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Gi},l),It(e,k=>b.createElement(pr.Provider,{value:M},b.createElement(dr.Provider,{value:j},k))))}),Ai=b.forwardRef((e,t)=>{var n,r;let o=Ve(),i=b.useRef(null),a=b.useContext(hr),s=dt(),l=yr(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Be(()=>{if(!u)return s.item(o,a?.id)},[u]);let f=vr(o,i,[e.value,e.children,i],e.keywords),c=cn(),d=We(C=>C.value&&C.value===f.current),p=We(C=>u||s.filter()===!1?!0:C.search?C.filtered.items.get(o)>0:!0);b.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(en,h),()=>C.removeEventListener(en,h)},[p,e.onSelect,e.disabled]);function h(){var C,M;v(),(M=(C=l.current).onSelect)==null||M.call(C,f.current)}function v(){c.setState("value",f.current,!0)}if(!p)return null;let{disabled:O,value:y,onSelect:m,forceMount:S,keywords:D,...E}=e;return b.createElement(_e.div,{ref:ct(i,t),...E,id:o,"cmdk-item":"",role:"option","aria-disabled":!!O,"aria-selected":!!d,"data-disabled":!!O,"data-selected":!!d,onPointerMove:O||s.getDisablePointerSelection()?void 0:v,onClick:O?void 0:h},e.children)}),_i=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=Ve(),s=b.useRef(null),l=b.useRef(null),u=Ve(),f=dt(),c=We(p=>o||f.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Be(()=>f.group(a),[]),vr(a,s,[e.value,e.heading,l]);let d=b.useMemo(()=>({id:a,forceMount:o}),[o]);return b.createElement(_e.div,{ref:ct(s,t),...i,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),It(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(hr.Provider,{value:d},p))))}),ji=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=We(a=>!a.search);return!n&&!i?null:b.createElement(_e.div,{ref:ct(o,t),...r,"cmdk-separator":"",role:"separator"})}),Fi=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=cn(),a=We(u=>u.search),s=We(u=>u.selectedItemId),l=dt();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(_e.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?e.value:a,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),Li=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),a=b.useRef(null),s=We(u=>u.selectedItemId),l=dt();return b.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let p=u.offsetHeight;f.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(c),d.unobserve(u)}}},[]),b.createElement(_e.div,{ref:ct(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},It(e,u=>b.createElement("div",{ref:ct(a,l.listInnerRef),"cmdk-list-sizer":""},u)))}),Bi=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return b.createElement(Bo,{open:n,onOpenChange:r},b.createElement($o,{container:a},b.createElement(Ho,{"cmdk-overlay":"",className:o}),b.createElement(Uo,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(mr,{ref:t,...s}))))}),$i=b.forwardRef((e,t)=>We(n=>n.filtered.count===0)?b.createElement(_e.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Hi=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(_e.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},It(e,a=>b.createElement("div",{"aria-hidden":!0},a)))}),ou=Object.assign(mr,{List:Li,Item:Ai,Input:Fi,Group:_i,Separator:ji,Dialog:Bi,Empty:$i,Loading:Hi});function Ui(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function zi(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yr(e){let t=b.useRef(e);return Be(()=>{t.current=e}),t}var Be=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Ge(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function We(e){let t=cn(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function vr(e,t,n,r=[]){let o=b.useRef(),i=dt();return Be(()=>{var a;let s=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,s,l),(a=t.current)==null||a.setAttribute(qe,s),o.current=s}),o}var Yi=()=>{let[e,t]=b.useState(),n=Ge(()=>new Map);return Be(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qi(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function It({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(qi(t),{ref:t.ref},n(t.props.children)):n(t)}var Gi={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function gr(e){return t=>typeof t===e}var Vi=gr("function"),Ki=e=>e===null,Cn=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",Tn=e=>!Zi(e)&&!Ki(e)&&(Vi(e)||typeof e=="object"),Zi=gr("undefined");function Ji(e,t){const{length:n}=e;if(n!==t.length)return!1;for(let r=n;r--!==0;)if(!oe(e[r],t[r]))return!1;return!0}function Xi(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),r=new DataView(t.buffer);let o=e.byteLength;for(;o--;)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function Qi(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!oe(n[1],t.get(n[0])))return!1;return!0}function es(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}function oe(e,t){if(e===t)return!0;if(e&&Tn(e)&&t&&Tn(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return Ji(e,t);if(e instanceof Map&&t instanceof Map)return Qi(e,t);if(e instanceof Set&&t instanceof Set)return es(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return Xi(e,t);if(Cn(e)&&Cn(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=n.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=n.length;o--!==0;){const i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!oe(e[i],t[i]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}var ts=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],ns=["bigint","boolean","null","number","string","symbol","undefined"];function Rt(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(rs(t))return t}function ge(e){return t=>Rt(t)===e}function rs(e){return ts.includes(e)}function Qe(e){return t=>typeof t===e}function os(e){return ns.includes(e)}var is=["innerHTML","ownerDocument","style","attributes","nodeValue"];function x(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(x.array(e))return"Array";if(x.plainFunction(e))return"Function";const t=Rt(e);return t||"Object"}x.array=Array.isArray;x.arrayOf=(e,t)=>!x.array(e)&&!x.function(t)?!1:e.every(n=>t(n));x.asyncGeneratorFunction=e=>Rt(e)==="AsyncGeneratorFunction";x.asyncFunction=ge("AsyncFunction");x.bigint=Qe("bigint");x.boolean=e=>e===!0||e===!1;x.date=ge("Date");x.defined=e=>!x.undefined(e);x.domElement=e=>x.object(e)&&!x.plainObject(e)&&e.nodeType===1&&x.string(e.nodeName)&&is.every(t=>t in e);x.empty=e=>x.string(e)&&e.length===0||x.array(e)&&e.length===0||x.object(e)&&!x.map(e)&&!x.set(e)&&Object.keys(e).length===0||x.set(e)&&e.size===0||x.map(e)&&e.size===0;x.error=ge("Error");x.function=Qe("function");x.generator=e=>x.iterable(e)&&x.function(e.next)&&x.function(e.throw);x.generatorFunction=ge("GeneratorFunction");x.instanceOf=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype;x.iterable=e=>!x.nullOrUndefined(e)&&x.function(e[Symbol.iterator]);x.map=ge("Map");x.nan=e=>Number.isNaN(e);x.null=e=>e===null;x.nullOrUndefined=e=>x.null(e)||x.undefined(e);x.number=e=>Qe("number")(e)&&!x.nan(e);x.numericString=e=>x.string(e)&&e.length>0&&!Number.isNaN(Number(e));x.object=e=>!x.nullOrUndefined(e)&&(x.function(e)||typeof e=="object");x.oneOf=(e,t)=>x.array(e)?e.indexOf(t)>-1:!1;x.plainFunction=ge("Function");x.plainObject=e=>{if(Rt(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};x.primitive=e=>x.null(e)||os(typeof e);x.promise=ge("Promise");x.propertyOf=(e,t,n)=>{if(!x.object(e)||!t)return!1;const r=e[t];return x.function(n)?n(r):x.defined(r)};x.regexp=ge("RegExp");x.set=ge("Set");x.string=Qe("string");x.symbol=Qe("symbol");x.undefined=Qe("undefined");x.weakMap=ge("WeakMap");x.weakSet=ge("WeakSet");var N=x;function ss(...e){return e.every(t=>N.string(t)||N.array(t)||N.plainObject(t))}function as(e,t,n){return br(e,t)?[e,t].every(N.array)?!e.some(Dn(n))&&t.some(Dn(n)):[e,t].every(N.plainObject)?!Object.entries(e).some(Pn(n))&&Object.entries(t).some(Pn(n)):t===n:!1}function Mn(e,t,n){const{actual:r,key:o,previous:i,type:a}=n,s=Ee(e,o),l=Ee(t,o);let u=[s,l].every(N.number)&&(a==="increased"?sl);return N.undefined(r)||(u=u&&l===r),N.undefined(i)||(u=u&&s===i),u}function xn(e,t,n){const{key:r,type:o,value:i}=n,a=Ee(e,r),s=Ee(t,r),l=o==="added"?a:s,u=o==="added"?s:a;if(!N.nullOrUndefined(i)){if(N.defined(l)){if(N.array(l)||N.plainObject(l))return as(l,u,i)}else return oe(u,i);return!1}return[a,s].every(N.array)?!u.every(un(l)):[a,s].every(N.plainObject)?ls(Object.keys(l),Object.keys(u)):![a,s].every(f=>N.primitive(f)&&N.defined(f))&&(o==="added"?!N.defined(a)&&N.defined(s):N.defined(a)&&!N.defined(s))}function Nn(e,t,{key:n}={}){let r=Ee(e,n),o=Ee(t,n);if(!br(r,o))throw new TypeError("Inputs have different types");if(!ss(r,o))throw new TypeError("Inputs don't have length");return[r,o].every(N.plainObject)&&(r=Object.keys(r),o=Object.keys(o)),[r,o]}function Pn(e){return([t,n])=>N.array(e)?oe(e,n)||e.some(r=>oe(r,n)||N.array(n)&&un(n)(r)):N.plainObject(e)&&e[t]?!!e[t]&&oe(e[t],n):oe(e,n)}function ls(e,t){return t.some(n=>!e.includes(n))}function Dn(e){return t=>N.array(e)?e.some(n=>oe(n,t)||N.array(t)&&un(t)(n)):oe(e,t)}function rt(e,t){return N.array(e)?e.some(n=>oe(n,t)):oe(e,t)}function un(e){return t=>e.some(n=>oe(n,t))}function br(...e){return e.every(N.array)||e.every(N.number)||e.every(N.plainObject)||e.every(N.string)}function Ee(e,t){return N.plainObject(e)||N.array(e)?N.string(t)?t.split(".").reduce((r,o)=>r&&r[o],e):N.number(t)?e[t]:e:e}function Mt(e,t){if([e,t].some(N.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(f=>N.plainObject(f)||N.array(f)))throw new Error("Expected plain objects or array");return{added:(f,c)=>{try{return xn(e,t,{key:f,type:"added",value:c})}catch{return!1}},changed:(f,c,d)=>{try{const p=Ee(e,f),h=Ee(t,f),v=N.defined(c),O=N.defined(d);if(v||O){const y=O?rt(d,p):!rt(c,p),m=rt(c,h);return y&&m}return[p,h].every(N.array)||[p,h].every(N.plainObject)?!oe(p,h):p!==h}catch{return!1}},changedFrom:(f,c,d)=>{if(!N.defined(f))return!1;try{const p=Ee(e,f),h=Ee(t,f),v=N.defined(d);return rt(c,p)&&(v?rt(d,h):!v)}catch{return!1}},decreased:(f,c,d)=>{if(!N.defined(f))return!1;try{return Mn(e,t,{key:f,actual:c,previous:d,type:"decreased"})}catch{return!1}},emptied:f=>{try{const[c,d]=Nn(e,t,{key:f});return!!c.length&&!d.length}catch{return!1}},filled:f=>{try{const[c,d]=Nn(e,t,{key:f});return!c.length&&!!d.length}catch{return!1}},increased:(f,c,d)=>{if(!N.defined(f))return!1;try{return Mn(e,t,{key:f,actual:c,previous:d,type:"increased"})}catch{return!1}},removed:(f,c)=>{try{return xn(e,t,{key:f,type:"removed",value:c})}catch{return!1}}}}var zt,In;function cs(){if(In)return zt;In=1;var e=new Error("Element already at target scroll position"),t=new Error("Scroll cancelled"),n=Math.min,r=Date.now;zt={left:o("scrollLeft"),top:o("scrollTop")};function o(s){return function(u,f,c,d){c=c||{},typeof c=="function"&&(d=c,c={}),typeof d!="function"&&(d=a);var p=r(),h=u[s],v=c.ease||i,O=isNaN(c.duration)?350:+c.duration,y=!1;return h===f?d(e,u[s]):requestAnimationFrame(S),m;function m(){y=!0}function S(D){if(y)return d(t,u[s]);var E=r(),C=n(1,(E-p)/O),M=v(C);u[s]=M*(f-h)+h,C<1?requestAnimationFrame(S):requestAnimationFrame(function(){d(null,u[s])})}}}function i(s){return .5*(1-Math.cos(Math.PI*s))}function a(){}return zt}var us=cs();const fs=Dt(us);var Ct={exports:{}},ds=Ct.exports,Rn;function ps(){return Rn||(Rn=1,(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(ds,function(){function t(r){var o=getComputedStyle(r,null).getPropertyValue("overflow");return o.indexOf("scroll")>-1||o.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var o=r.parentNode;o.parentNode;){if(t(o))return o;o=o.parentNode}return document.scrollingElement||document.documentElement}}return n})})(Ct)),Ct.exports}var hs=ps();const wr=Dt(hs);var Yt,Wn;function ms(){if(Wn)return Yt;Wn=1;var e=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},t=function(r,o){return r+n(o)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(t,""):e(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,Yt=n,Yt}var ys=ms();const An=Dt(ys);var qt,_n;function vs(){if(_n)return qt;_n=1;var e=function(m){return t(m)&&!n(m)};function t(y){return!!y&&typeof y=="object"}function n(y){var m=Object.prototype.toString.call(y);return m==="[object RegExp]"||m==="[object Date]"||i(y)}var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103;function i(y){return y.$$typeof===o}function a(y){return Array.isArray(y)?[]:{}}function s(y,m){return m.clone!==!1&&m.isMergeableObject(y)?v(a(y),y,m):y}function l(y,m,S){return y.concat(m).map(function(D){return s(D,S)})}function u(y,m){if(!m.customMerge)return v;var S=m.customMerge(y);return typeof S=="function"?S:v}function f(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(m){return Object.propertyIsEnumerable.call(y,m)}):[]}function c(y){return Object.keys(y).concat(f(y))}function d(y,m){try{return m in y}catch{return!1}}function p(y,m){return d(y,m)&&!(Object.hasOwnProperty.call(y,m)&&Object.propertyIsEnumerable.call(y,m))}function h(y,m,S){var D={};return S.isMergeableObject(y)&&c(y).forEach(function(E){D[E]=s(y[E],S)}),c(m).forEach(function(E){p(y,E)||(d(y,E)&&S.isMergeableObject(m[E])?D[E]=u(E,S)(y[E],m[E],S):D[E]=s(m[E],S))}),D}function v(y,m,S){S=S||{},S.arrayMerge=S.arrayMerge||l,S.isMergeableObject=S.isMergeableObject||e,S.cloneUnlessOtherwiseSpecified=s;var D=Array.isArray(m),E=Array.isArray(y),C=D===E;return C?D?S.arrayMerge(y,m,S):h(y,m,S):s(m,S)}v.all=function(m,S){if(!Array.isArray(m))throw new Error("first argument should be an array");return m.reduce(function(D,E){return v(D,E,S)},{})};var O=v;return qt=O,qt}var gs=vs();const ye=Dt(gs);var pt=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",bs=(function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0})();function ws(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function Os(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},bs))}}var Ss=pt&&window.Promise,Es=Ss?ws:Os;function Or(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function He(e,t){if(e.nodeType!==1)return[];var n=e.ownerDocument.defaultView,r=n.getComputedStyle(e,null);return t?r[t]:r}function fn(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function ht(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=He(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:ht(fn(e))}function Sr(e){return e&&e.referenceNode?e.referenceNode:e}var jn=pt&&!!(window.MSInputMethodContext&&document.documentMode),Fn=pt&&/MSIE 10/.test(navigator.userAgent);function et(e){return e===11?jn:e===10?Fn:jn||Fn}function Ke(e){if(!e)return document.documentElement;for(var t=et(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&He(n,"position")==="static"?Ke(n):n}function ks(e){var t=e.nodeName;return t==="BODY"?!1:t==="HTML"||Ke(e.firstElementChild)===e}function tn(e){return e.parentNode!==null?tn(e.parentNode):e}function xt(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return ks(a)?a:Ke(a);var s=tn(e);return s.host?xt(s.host,t):xt(e,tn(t).host)}function Ze(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=t==="top"?"scrollTop":"scrollLeft",r=e.nodeName;if(r==="BODY"||r==="HTML"){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function Cs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=Ze(t,"top"),o=Ze(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function Ln(e,t){var n=t==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function Bn(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],et(10)?parseInt(n["offset"+e])+parseInt(r["margin"+(e==="Height"?"Top":"Left")])+parseInt(r["margin"+(e==="Height"?"Bottom":"Right")]):0)}function Er(e){var t=e.body,n=e.documentElement,r=et(10)&&getComputedStyle(n);return{height:Bn("Height",t,n,r),width:Bn("Width",t,n,r)}}var Ts=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ms=(function(){function e(t,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=et(10),o=t.nodeName==="HTML",i=nn(e),a=nn(t),s=ht(e),l=He(t),u=parseFloat(l.borderTopWidth),f=parseFloat(l.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var c=Ae({top:i.top-a.top-u,left:i.left-a.left-f,width:i.width,height:i.height});if(c.marginTop=0,c.marginLeft=0,!r&&o){var d=parseFloat(l.marginTop),p=parseFloat(l.marginLeft);c.top-=u-d,c.bottom-=u-d,c.left-=f-p,c.right-=f-p,c.marginTop=d,c.marginLeft=p}return(r&&!n?t.contains(s):t===s&&s.nodeName!=="BODY")&&(c=Cs(c,t)),c}function xs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.ownerDocument.documentElement,r=dn(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:Ze(n),s=t?0:Ze(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i};return Ae(l)}function kr(e){var t=e.nodeName;if(t==="BODY"||t==="HTML")return!1;if(He(e,"position")==="fixed")return!0;var n=fn(e);return n?kr(n):!1}function Cr(e){if(!e||!e.parentElement||et())return document.documentElement;for(var t=e.parentElement;t&&He(t,"transform")==="none";)t=t.parentElement;return t||document.documentElement}function pn(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=o?Cr(e):xt(e,Sr(t));if(r==="viewport")i=xs(a,o);else{var s=void 0;r==="scrollParent"?(s=ht(fn(t)),s.nodeName==="BODY"&&(s=e.ownerDocument.documentElement)):r==="window"?s=e.ownerDocument.documentElement:s=r;var l=dn(s,a,o);if(s.nodeName==="HTML"&&!kr(a)){var u=Er(e.ownerDocument),f=u.height,c=u.width;i.top+=l.top-l.marginTop,i.bottom=f+l.top,i.left+=l.left-l.marginLeft,i.right=c+l.left}else i=l}n=n||0;var d=typeof n=="number";return i.left+=d?n:n.left||0,i.top+=d?n:n.top||0,i.right-=d?n:n.right||0,i.bottom-=d?n:n.bottom||0,i}function Ns(e){var t=e.width,n=e.height;return t*n}function Tr(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var a=pn(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map(function(d){return he({key:d},s[d],{area:Ns(s[d])})}).sort(function(d,p){return p.area-d.area}),u=l.filter(function(d){var p=d.width,h=d.height;return p>=n.clientWidth&&h>=n.clientHeight}),f=u.length>0?u[0].key:l[0].key,c=e.split("-")[1];return f+(c?"-"+c:"")}function Mr(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=r?Cr(t):xt(t,Sr(n));return dn(n,o,r)}function xr(e){var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),o=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:e.offsetWidth+o,height:e.offsetHeight+r};return i}function Nt(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(n){return t[n]})}function Nr(e,t,n){n=n.split("-")[0];var r=xr(e),o={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",s=i?"left":"top",l=i?"height":"width",u=i?"width":"height";return o[a]=t[a]+t[l]/2-r[l]/2,n===s?o[s]=t[s]-r[u]:o[s]=t[Nt(s)],o}function mt(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Ps(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(o){return o[t]===n});var r=mt(e,function(o){return o[t]===n});return e.indexOf(r)}function Pr(e,t,n){var r=n===void 0?e:e.slice(0,Ps(e,"name",n));return r.forEach(function(o){o.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=o.function||o.fn;o.enabled&&Or(i)&&(t.offsets.popper=Ae(t.offsets.popper),t.offsets.reference=Ae(t.offsets.reference),t=i(t,o))}),t}function Ds(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=Mr(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=Tr(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=Nr(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=Pr(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function Dr(e,t){return e.some(function(n){var r=n.name,o=n.enabled;return o&&r===t})}function hn(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;ra[p]&&(e.offsets.popper[c]+=s[c]+h-a[p]),e.offsets.popper=Ae(e.offsets.popper);var v=s[c]+s[u]/2-h/2,O=He(e.instance.popper),y=parseFloat(O["margin"+f]),m=parseFloat(O["border"+f+"Width"]),S=v-e.offsets.popper[c]-y-m;return S=Math.max(Math.min(a[u]-h,S),0),e.arrowElement=r,e.offsets.arrow=(n={},Je(n,c,Math.round(S)),Je(n,d,""),n),e}function zs(e){return e==="end"?"start":e==="start"?"end":e}var Ar=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Gt=Ar.slice(3);function $n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Gt.indexOf(e),r=Gt.slice(n+1).concat(Gt.slice(0,n));return t?r.reverse():r}var Vt={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Ys(e,t){if(Dr(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=pn(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=Nt(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case Vt.FLIP:a=[r,o];break;case Vt.CLOCKWISE:a=$n(r);break;case Vt.COUNTERCLOCKWISE:a=$n(r,!0);break;default:a=t.behavior}return a.forEach(function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],o=Nt(r);var u=e.offsets.popper,f=e.offsets.reference,c=Math.floor,d=r==="left"&&c(u.right)>c(f.left)||r==="right"&&c(u.left)c(f.top)||r==="bottom"&&c(u.top)c(n.right),v=c(u.top)c(n.bottom),y=r==="left"&&p||r==="right"&&h||r==="top"&&v||r==="bottom"&&O,m=["top","bottom"].indexOf(r)!==-1,S=!!t.flipVariations&&(m&&i==="start"&&p||m&&i==="end"&&h||!m&&i==="start"&&v||!m&&i==="end"&&O),D=!!t.flipVariationsByContent&&(m&&i==="start"&&h||m&&i==="end"&&p||!m&&i==="start"&&O||!m&&i==="end"&&v),E=S||D;(d||y||E)&&(e.flipped=!0,(d||y)&&(r=a[l+1]),E&&(i=zs(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=he({},e.offsets.popper,Nr(e.instance.popper,e.offsets.reference,e.placement)),e=Pr(e.instance.modifiers,e,"flip"))}),e}function qs(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(o)!==-1,s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]i(r[s])&&(e.offsets.popper[l]=i(r[s])),e}function Gs(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(a.indexOf("%")===0){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}var l=Ae(s);return l[t]/100*i}else if(a==="vh"||a==="vw"){var u=void 0;return a==="vh"?u=Math.max(document.documentElement.clientHeight,window.innerHeight||0):u=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u/100*i}else return i}function Vs(e,t,n,r){var o=[0,0],i=["right","left"].indexOf(r)!==-1,a=e.split(/(\+|\-)/).map(function(f){return f.trim()}),s=a.indexOf(mt(a,function(f){return f.search(/,|\s/)!==-1}));a[s]&&a[s].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=s!==-1?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return u=u.map(function(f,c){var d=(c===1?!i:i)?"height":"width",p=!1;return f.reduce(function(h,v){return h[h.length-1]===""&&["+","-"].indexOf(v)!==-1?(h[h.length-1]=v,p=!0,h):p?(h[h.length-1]+=v,p=!1,h):h.concat(v)},[]).map(function(h){return Gs(h,d,t,n)})}),u.forEach(function(f,c){f.forEach(function(d,p){mn(d)&&(o[c]+=d*(f[p-1]==="-"?-1:1))})}),o}function Ks(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],l=void 0;return mn(+n)?l=[+n,0]:l=Vs(n,i,a,s),s==="left"?(i.top+=l[0],i.left-=l[1]):s==="right"?(i.top+=l[0],i.left+=l[1]):s==="top"?(i.left+=l[0],i.top-=l[1]):s==="bottom"&&(i.left+=l[0],i.top+=l[1]),e.popper=i,e}function Zs(e,t){var n=t.boundariesElement||Ke(e.instance.popper);e.instance.reference===n&&(n=Ke(n));var r=hn("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var l=pn(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=l;var u=t.priority,f=e.offsets.popper,c={primary:function(p){var h=f[p];return f[p]l[p]&&!t.escapeWithReference&&(v=Math.min(f[h],l[p]-(p==="right"?f.width:f.height))),Je({},h,v)}};return u.forEach(function(d){var p=["left","top"].indexOf(d)!==-1?"primary":"secondary";f=he({},f,c[p](d))}),e.offsets.popper=f,e}function Js(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=["bottom","top"].indexOf(n)!==-1,l=s?"left":"top",u=s?"width":"height",f={start:Je({},l,i[l]),end:Je({},l,i[l]+i[u]-a[u])};e.offsets.popper=he({},a,f[r])}return e}function Xs(e){if(!Wr(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=mt(e.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&arguments[2]!==void 0?arguments[2]:{};Ts(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Es(this.update.bind(this)),this.options=he({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(he({},e.Defaults.modifiers,o.modifiers)).forEach(function(a){r.options.modifiers[a]=he({},e.Defaults.modifiers[a]||{},o.modifiers?o.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return he({name:a},r.options.modifiers[a])}).sort(function(a,s){return a.order-s.order}),this.modifiers.forEach(function(a){a.enabled&&Or(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Ms(e,[{key:"update",value:function(){return Ds.call(this)}},{key:"destroy",value:function(){return Is.call(this)}},{key:"enableEventListeners",value:function(){return Ws.call(this)}},{key:"disableEventListeners",value:function(){return _s.call(this)}}]),e})();ut.Utils=(typeof window<"u"?window:global).PopperUtils;ut.placements=Ar;ut.Defaults=ta;var na=["innerHTML","ownerDocument","style","attributes","nodeValue"],ra=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],oa=["bigint","boolean","null","number","string","symbol","undefined"];function Wt(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(ia(t))return t}function be(e){return function(t){return Wt(t)===e}}function ia(e){return ra.includes(e)}function tt(e){return function(t){return typeof t===e}}function sa(e){return oa.includes(e)}function g(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(g.array(e))return"Array";if(g.plainFunction(e))return"Function";var t=Wt(e);return t||"Object"}g.array=Array.isArray;g.arrayOf=function(e,t){return!g.array(e)&&!g.function(t)?!1:e.every(function(n){return t(n)})};g.asyncGeneratorFunction=function(e){return Wt(e)==="AsyncGeneratorFunction"};g.asyncFunction=be("AsyncFunction");g.bigint=tt("bigint");g.boolean=function(e){return e===!0||e===!1};g.date=be("Date");g.defined=function(e){return!g.undefined(e)};g.domElement=function(e){return g.object(e)&&!g.plainObject(e)&&e.nodeType===1&&g.string(e.nodeName)&&na.every(function(t){return t in e})};g.empty=function(e){return g.string(e)&&e.length===0||g.array(e)&&e.length===0||g.object(e)&&!g.map(e)&&!g.set(e)&&Object.keys(e).length===0||g.set(e)&&e.size===0||g.map(e)&&e.size===0};g.error=be("Error");g.function=tt("function");g.generator=function(e){return g.iterable(e)&&g.function(e.next)&&g.function(e.throw)};g.generatorFunction=be("GeneratorFunction");g.instanceOf=function(e,t){return!e||!t?!1:Object.getPrototypeOf(e)===t.prototype};g.iterable=function(e){return!g.nullOrUndefined(e)&&g.function(e[Symbol.iterator])};g.map=be("Map");g.nan=function(e){return Number.isNaN(e)};g.null=function(e){return e===null};g.nullOrUndefined=function(e){return g.null(e)||g.undefined(e)};g.number=function(e){return tt("number")(e)&&!g.nan(e)};g.numericString=function(e){return g.string(e)&&e.length>0&&!Number.isNaN(Number(e))};g.object=function(e){return!g.nullOrUndefined(e)&&(g.function(e)||typeof e=="object")};g.oneOf=function(e,t){return g.array(e)?e.indexOf(t)>-1:!1};g.plainFunction=be("Function");g.plainObject=function(e){if(Wt(e)!=="Object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};g.primitive=function(e){return g.null(e)||sa(typeof e)};g.promise=be("Promise");g.propertyOf=function(e,t,n){if(!g.object(e)||!t)return!1;var r=e[t];return g.function(n)?n(r):g.defined(r)};g.regexp=be("RegExp");g.set=be("Set");g.string=tt("string");g.symbol=tt("symbol");g.undefined=tt("undefined");g.weakMap=be("WeakMap");g.weakSet=be("WeakSet");function _r(e){return function(t){return typeof t===e}}var aa=_r("function"),la=function(e){return e===null},Hn=function(e){return Object.prototype.toString.call(e).slice(8,-1)==="RegExp"},Un=function(e){return!ca(e)&&!la(e)&&(aa(e)||typeof e=="object")},ca=_r("undefined"),on=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function ua(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=n;r--!==0;)if(!ae(e[r],t[r]))return!1;return!0}function fa(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e.buffer),r=new DataView(t.buffer),o=e.byteLength;o--;)if(n.getUint8(o)!==r.getUint8(o))return!1;return!0}function da(e,t){var n,r,o,i;if(e.size!==t.size)return!1;try{for(var a=on(e.entries()),s=a.next();!s.done;s=a.next()){var l=s.value;if(!t.has(l[0]))return!1}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var u=on(e.entries()),f=u.next();!f.done;f=u.next()){var l=f.value;if(!ae(l[1],t.get(l[0])))return!1}}catch(c){o={error:c}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return!0}function pa(e,t){var n,r;if(e.size!==t.size)return!1;try{for(var o=on(e.entries()),i=o.next();!i.done;i=o.next()){var a=i.value;if(!t.has(a[0]))return!1}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}function ae(e,t){if(e===t)return!0;if(e&&Un(e)&&t&&Un(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return ua(e,t);if(e instanceof Map&&t instanceof Map)return da(e,t);if(e instanceof Set&&t instanceof Set)return pa(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return fa(e,t);if(Hn(e)&&Hn(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=n.length;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(var o=n.length;o--!==0;){var i=n[o];if(!(i==="_owner"&&e.$$typeof)&&!ae(e[i],t[i]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}function ha(){for(var e=[],t=0;tl);return g.undefined(r)||(u=u&&l===r),g.undefined(i)||(u=u&&s===i),u}function Yn(e,t,n){var r=n.key,o=n.type,i=n.value,a=ke(e,r),s=ke(t,r),l=o==="added"?a:s,u=o==="added"?s:a;if(!g.nullOrUndefined(i)){if(g.defined(l)){if(g.array(l)||g.plainObject(l))return ma(l,u,i)}else return ae(u,i);return!1}return[a,s].every(g.array)?!u.every(yn(l)):[a,s].every(g.plainObject)?ya(Object.keys(l),Object.keys(u)):![a,s].every(function(f){return g.primitive(f)&&g.defined(f)})&&(o==="added"?!g.defined(a)&&g.defined(s):g.defined(a)&&!g.defined(s))}function qn(e,t,n){var r=n===void 0?{}:n,o=r.key,i=ke(e,o),a=ke(t,o);if(!jr(i,a))throw new TypeError("Inputs have different types");if(!ha(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(g.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function Gn(e){return function(t){var n=t[0],r=t[1];return g.array(e)?ae(e,r)||e.some(function(o){return ae(o,r)||g.array(r)&&yn(r)(o)}):g.plainObject(e)&&e[n]?!!e[n]&&ae(e[n],r):ae(e,r)}}function ya(e,t){return t.some(function(n){return!e.includes(n)})}function Vn(e){return function(t){return g.array(e)?e.some(function(n){return ae(n,t)||g.array(t)&&yn(t)(n)}):ae(e,t)}}function ot(e,t){return g.array(e)?e.some(function(n){return ae(n,t)}):ae(e,t)}function yn(e){return function(t){return e.some(function(n){return ae(n,t)})}}function jr(){for(var e=[],t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wa(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Fr(e,t){if(e==null)return{};var n=wa(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oa(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xe(e)}function bt(e){var t=ba();return function(){var r=Pt(e),o;if(t){var i=Pt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Oa(this,o)}}function Sa(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e){var t=Sa(e,"string");return typeof t=="symbol"?t:String(t)}var Ea={flip:{padding:20},preventOverflow:{padding:10}},ka="The typeValidator argument must be a function with the signature function(props, propName, componentName).",Ca="The error message is optional, but must be a string if provided.";function Ta(e,t,n,r){return typeof e=="boolean"?e:typeof e=="function"?e(t,n,r):e?!!e:!1}function Ma(e,t){return Object.hasOwnProperty.call(e,t)}function xa(e,t,n,r){return new Error("Required ".concat(e[t]," `").concat(t,"` was not specified in `").concat(n,"`."))}function Na(e,t){if(typeof e!="function")throw new TypeError(ka);if(t&&typeof t!="string")throw new TypeError(Ca)}function Zn(e,t,n){return Na(e,n),function(r,o,i){for(var a=arguments.length,s=new Array(a>3?a-3:0),l=3;l3&&arguments[3]!==void 0?arguments[3]:!1;e.addEventListener(t,n,r)}function Da(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;e.removeEventListener(t,n,r)}function Ia(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o;o=function(a){n(a),Da(e,t,o)},Pa(e,t,o,r)}function Jn(){}var Br=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"componentDidMount",value:function(){Oe()&&(this.node||this.appendNode(),it||this.renderPortal())}},{key:"componentDidUpdate",value:function(){Oe()&&(it||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!Oe()||!this.node||(it||Et.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var o=this.props,i=o.id,a=o.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!Oe())return null;var o=this.props,i=o.children,a=o.setRef;if(this.node||this.appendNode(),it)return Et.createPortal(i,this.node);var s=Et.unstable_renderSubtreeIntoContainer(this,i.length>1?w.createElement("div",null,i):i[0],this.node);return a(s),null}},{key:"renderReact16",value:function(){var o=this.props,i=o.hasChildren,a=o.placement,s=o.target;return i?this.renderPortal():s||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return it?this.renderReact16():null}}]),n})(w.Component);ne(Br,"propTypes",{children:T.oneOfType([T.element,T.array]),hasChildren:T.bool,id:T.oneOfType([T.string,T.number]),placement:T.string,setRef:T.func.isRequired,target:T.oneOfType([T.object,T.string]),zIndex:T.number});var $r=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"parentStyle",get:function(){var o=this.props,i=o.placement,a=o.styles,s=a.arrow.length,l={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(l.bottom=0,l.left=0,l.right=0,l.height=s):i.startsWith("bottom")?(l.left=0,l.right=0,l.top=0,l.height=s):i.startsWith("left")?(l.right=0,l.top=0,l.bottom=0):i.startsWith("right")&&(l.left=0,l.top=0),l}},{key:"render",value:function(){var o=this.props,i=o.placement,a=o.setArrowRef,s=o.styles,l=s.arrow,u=l.color,f=l.display,c=l.length,d=l.margin,p=l.position,h=l.spread,v={display:f,position:p},O,y=h,m=c;return i.startsWith("top")?(O="0,0 ".concat(y/2,",").concat(m," ").concat(y,",0"),v.bottom=0,v.marginLeft=d,v.marginRight=d):i.startsWith("bottom")?(O="".concat(y,",").concat(m," ").concat(y/2,",0 0,").concat(m),v.top=0,v.marginLeft=d,v.marginRight=d):i.startsWith("left")?(m=h,y=c,O="0,0 ".concat(y,",").concat(m/2," 0,").concat(m),v.right=0,v.marginTop=d,v.marginBottom=d):i.startsWith("right")&&(m=h,y=c,O="".concat(y,",").concat(m," ").concat(y,",0 0,").concat(m/2),v.left=0,v.marginTop=d,v.marginBottom=d),w.createElement("div",{className:"__floater__arrow",style:this.parentStyle},w.createElement("span",{ref:a,style:v},w.createElement("svg",{width:y,height:m,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},w.createElement("polygon",{points:O,fill:u}))))}}]),n})(w.Component);ne($r,"propTypes",{placement:T.string.isRequired,setArrowRef:T.func.isRequired,styles:T.object.isRequired});var Ra=["color","height","width"];function Hr(e){var t=e.handleClick,n=e.styles,r=n.color,o=n.height,i=n.width,a=Fr(n,Ra);return w.createElement("button",{"aria-label":"close",onClick:t,style:a,type:"button"},w.createElement("svg",{width:"".concat(i,"px"),height:"".concat(o,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},w.createElement("g",null,w.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}Hr.propTypes={handleClick:T.func.isRequired,styles:T.object.isRequired};function Ur(e){var t=e.content,n=e.footer,r=e.handleClick,o=e.open,i=e.positionWrapper,a=e.showCloseButton,s=e.title,l=e.styles,u={content:w.isValidElement(t)?t:w.createElement("div",{className:"__floater__content",style:l.content},t)};return s&&(u.title=w.isValidElement(s)?s:w.createElement("div",{className:"__floater__title",style:l.title},s)),n&&(u.footer=w.isValidElement(n)?n:w.createElement("div",{className:"__floater__footer",style:l.footer},n)),(a||i)&&!g.boolean(o)&&(u.close=w.createElement(Hr,{styles:l.close,handleClick:r})),w.createElement("div",{className:"__floater__container",style:l.container},u.close,u.title,u.content,u.footer)}Ur.propTypes={content:T.node.isRequired,footer:T.node,handleClick:T.func.isRequired,open:T.bool,positionWrapper:T.bool.isRequired,showCloseButton:T.bool.isRequired,styles:T.object.isRequired,title:T.node};var zr=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"style",get:function(){var o=this.props,i=o.disableAnimation,a=o.component,s=o.placement,l=o.hideArrow,u=o.status,f=o.styles,c=f.arrow.length,d=f.floater,p=f.floaterCentered,h=f.floaterClosing,v=f.floaterOpening,O=f.floaterWithAnimation,y=f.floaterWithComponent,m={};return l||(s.startsWith("top")?m.padding="0 0 ".concat(c,"px"):s.startsWith("bottom")?m.padding="".concat(c,"px 0 0"):s.startsWith("left")?m.padding="0 ".concat(c,"px 0 0"):s.startsWith("right")&&(m.padding="0 0 0 ".concat(c,"px"))),[$.OPENING,$.OPEN].indexOf(u)!==-1&&(m=K(K({},m),v)),u===$.CLOSING&&(m=K(K({},m),h)),u===$.OPEN&&!i&&(m=K(K({},m),O)),s==="center"&&(m=K(K({},m),p)),a&&(m=K(K({},m),y)),K(K({},d),m)}},{key:"render",value:function(){var o=this.props,i=o.component,a=o.handleClick,s=o.hideArrow,l=o.setFloaterRef,u=o.status,f={},c=["__floater"];return i?w.isValidElement(i)?f.content=w.cloneElement(i,{closeFn:a}):f.content=i({closeFn:a}):f.content=w.createElement(Ur,this.props),u===$.OPEN&&c.push("__floater__open"),s||(f.arrow=w.createElement($r,this.props)),w.createElement("div",{ref:l,className:c.join(" "),style:this.style},w.createElement("div",{className:"__floater__body"},f.content,f.arrow))}}]),n})(w.Component);ne(zr,"propTypes",{component:T.oneOfType([T.func,T.element]),content:T.node,disableAnimation:T.bool.isRequired,footer:T.node,handleClick:T.func.isRequired,hideArrow:T.bool.isRequired,open:T.bool,placement:T.string.isRequired,positionWrapper:T.bool.isRequired,setArrowRef:T.func.isRequired,setFloaterRef:T.func.isRequired,showCloseButton:T.bool,status:T.string.isRequired,styles:T.object.isRequired,title:T.node});var Yr=(function(e){gt(n,e);var t=bt(n);function n(){return yt(this,n),t.apply(this,arguments)}return vt(n,[{key:"render",value:function(){var o=this.props,i=o.children,a=o.handleClick,s=o.handleMouseEnter,l=o.handleMouseLeave,u=o.setChildRef,f=o.setWrapperRef,c=o.style,d=o.styles,p;if(i)if(w.Children.count(i)===1)if(!w.isValidElement(i))p=w.createElement("span",null,i);else{var h=g.function(i.type)?"innerRef":"ref";p=w.cloneElement(w.Children.only(i),ne({},h,u))}else p=i;return p?w.createElement("span",{ref:f,style:K(K({},d),c),onClick:a,onMouseEnter:s,onMouseLeave:l},p):null}}]),n})(w.Component);ne(Yr,"propTypes",{children:T.node,handleClick:T.func.isRequired,handleMouseEnter:T.func.isRequired,handleMouseLeave:T.func.isRequired,setChildRef:T.func.isRequired,setWrapperRef:T.func.isRequired,style:T.object,styles:T.object.isRequired});var Wa={zIndex:100};function Aa(e){var t=ye(Wa,e.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:t.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:t.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:t}}var _a=["arrow","flip","offset"],ja=["position","top","right","bottom","left"],vn=(function(e){gt(n,e);var t=bt(n);function n(r){var o;return yt(this,n),o=t.call(this,r),ne(xe(o),"setArrowRef",function(i){o.arrowRef=i}),ne(xe(o),"setChildRef",function(i){o.childRef=i}),ne(xe(o),"setFloaterRef",function(i){o.floaterRef=i}),ne(xe(o),"setWrapperRef",function(i){o.wrapperRef=i}),ne(xe(o),"handleTransitionEnd",function(){var i=o.state.status,a=o.props.callback;o.wrapperPopper&&o.wrapperPopper.instance.update(),o.setState({status:i===$.OPENING?$.OPEN:$.IDLE},function(){var s=o.state.status;a(s===$.OPEN?"open":"close",o.props)})}),ne(xe(o),"handleClick",function(){var i=o.props,a=i.event,s=i.open;if(!g.boolean(s)){var l=o.state,u=l.positionWrapper,f=l.status;(o.event==="click"||o.event==="hover"&&u)&&(St({title:"click",data:[{event:a,status:f===$.OPEN?"closing":"opening"}],debug:o.debug}),o.toggle())}}),ne(xe(o),"handleMouseEnter",function(){var i=o.props,a=i.event,s=i.open;if(!(g.boolean(s)||Kt())){var l=o.state.status;o.event==="hover"&&l===$.IDLE&&(St({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:o.debug}),clearTimeout(o.eventDelayTimeout),o.toggle())}}),ne(xe(o),"handleMouseLeave",function(){var i=o.props,a=i.event,s=i.eventDelay,l=i.open;if(!(g.boolean(l)||Kt())){var u=o.state,f=u.status,c=u.positionWrapper;o.event==="hover"&&(St({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:o.debug}),s?[$.OPENING,$.OPEN].indexOf(f)!==-1&&!c&&!o.eventDelayTimeout&&(o.eventDelayTimeout=setTimeout(function(){delete o.eventDelayTimeout,o.toggle()},s*1e3)):o.toggle($.IDLE))}}),o.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:$.INIT,statusWrapper:$.INIT},o._isMounted=!1,o.hasMounted=!1,Oe()&&window.addEventListener("load",function(){o.popper&&o.popper.instance.update(),o.wrapperPopper&&o.wrapperPopper.instance.update()}),o}return vt(n,[{key:"componentDidMount",value:function(){if(Oe()){var o=this.state.positionWrapper,i=this.props,a=i.children,s=i.open,l=i.target;this._isMounted=!0,St({title:"init",data:{hasChildren:!!a,hasTarget:!!l,isControlled:g.boolean(s),positionWrapper:o,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&l&&g.boolean(s)}}},{key:"componentDidUpdate",value:function(o,i){if(Oe()){var a=this.props,s=a.autoOpen,l=a.open,u=a.target,f=a.wrapperOptions,c=va(i,this.state),d=c.changedFrom,p=c.changed;if(o.open!==l){var h;g.boolean(l)&&(h=l?$.OPENING:$.CLOSING),this.toggle(h)}(o.wrapperOptions.position!==f.position||o.target!==u)&&this.changeWrapperPosition(this.props),p("status",$.IDLE)&&l?this.toggle($.OPEN):d("status",$.INIT,$.IDLE)&&s&&this.toggle($.OPEN),this.popper&&p("status",$.OPENING)&&this.popper.instance.update(),this.floaterRef&&(p("status",$.OPENING)||p("status",$.CLOSING))&&Ia(this.floaterRef,"transitionend",this.handleTransitionEnd),p("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){Oe()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,s=this.props,l=s.disableFlip,u=s.getPopper,f=s.hideArrow,c=s.offset,d=s.placement,p=s.wrapperOptions,h=d==="top"||d==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(d==="center")this.setState({status:$.IDLE});else if(i&&this.floaterRef){var v=this.options,O=v.arrow,y=v.flip,m=v.offset,S=Fr(v,_a);new ut(i,this.floaterRef,{placement:d,modifiers:K({arrow:K({enabled:!f,element:this.arrowRef},O),flip:K({enabled:!l,behavior:h},y),offset:K({offset:"0, ".concat(c,"px")},m)},S),onCreate:function(C){var M;if(o.popper=C,!((M=o.floaterRef)!==null&&M!==void 0&&M.isConnected)){o.setState({needsUpdate:!0});return}u(C,"floater"),o._isMounted&&o.setState({currentPlacement:C.placement,status:$.IDLE}),d!==C.placement&&setTimeout(function(){C.instance.update()},1)},onUpdate:function(C){o.popper=C;var M=o.state.currentPlacement;o._isMounted&&C.placement!==M&&o.setState({currentPlacement:C.placement})}})}if(a){var D=g.undefined(p.offset)?0:p.offset;new ut(this.target,this.wrapperRef,{placement:p.placement||d,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(D,"px")},flip:{enabled:!1}},onCreate:function(C){o.wrapperPopper=C,o._isMounted&&o.setState({statusWrapper:$.IDLE}),u(C,"wrapper"),d!==C.placement&&setTimeout(function(){C.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var o=this;this.floaterRefInterval=setInterval(function(){var i;(i=o.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(o.floaterRefInterval),o.setState({needsUpdate:!1}),o.initPopper())},50)}},{key:"changeWrapperPosition",value:function(o){var i=o.target,a=o.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(o){var i=this.state.status,a=i===$.OPEN?$.CLOSING:$.OPENING;g.undefined(o)||(a=o),this.setState({status:a})}},{key:"debug",get:function(){var o=this.props.debug;return o||Oe()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var o=this.props,i=o.disableHoverToClick,a=o.event;return a==="hover"&&Kt()&&!i?"click":a}},{key:"options",get:function(){var o=this.props.options;return ye(Ea,o||{})}},{key:"styles",get:function(){var o=this,i=this.state,a=i.status,s=i.positionWrapper,l=i.statusWrapper,u=this.props.styles,f=ye(Aa(u),u);if(s){var c;[$.IDLE].indexOf(a)===-1||[$.IDLE].indexOf(l)===-1?c=f.wrapperPosition:c=this.wrapperPopper.styles,f.wrapper=K(K({},f.wrapper),c)}if(this.target){var d=window.getComputedStyle(this.target);this.wrapperStyles?f.wrapper=K(K({},f.wrapper),this.wrapperStyles):["relative","static"].indexOf(d.position)===-1&&(this.wrapperStyles={},s||(ja.forEach(function(p){o.wrapperStyles[p]=d[p]}),f.wrapper=K(K({},f.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return f}},{key:"target",get:function(){if(!Oe())return null;var o=this.props.target;return o?g.domElement(o)?o:document.querySelector(o):this.childRef||this.wrapperRef}},{key:"render",value:function(){var o=this.state,i=o.currentPlacement,a=o.positionWrapper,s=o.status,l=this.props,u=l.children,f=l.component,c=l.content,d=l.disableAnimation,p=l.footer,h=l.hideArrow,v=l.id,O=l.open,y=l.showCloseButton,m=l.style,S=l.target,D=l.title,E=w.createElement(Yr,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:m,styles:this.styles.wrapper},u),C={};return a?C.wrapperInPortal=E:C.wrapperAsChildren=E,w.createElement("span",null,w.createElement(Br,{hasChildren:!!u,id:v,placement:i,setRef:this.setFloaterRef,target:S,zIndex:this.styles.options.zIndex},w.createElement(zr,{component:f,content:c,disableAnimation:d,footer:p,handleClick:this.handleClick,hideArrow:h||i==="center",open:O,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:y,status:s,styles:this.styles,title:D}),C.wrapperInPortal),C.wrapperAsChildren)}}]),n})(w.Component);ne(vn,"propTypes",{autoOpen:T.bool,callback:T.func,children:T.node,component:Zn(T.oneOfType([T.func,T.element]),function(e){return!e.content}),content:Zn(T.node,function(e){return!e.component}),debug:T.bool,disableAnimation:T.bool,disableFlip:T.bool,disableHoverToClick:T.bool,event:T.oneOf(["hover","click"]),eventDelay:T.number,footer:T.node,getPopper:T.func,hideArrow:T.bool,id:T.oneOfType([T.string,T.number]),offset:T.number,open:T.bool,options:T.object,placement:T.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:T.bool,style:T.object,styles:T.object,target:T.oneOfType([T.object,T.string]),title:T.node,wrapperOptions:T.shape({offset:T.number,placement:T.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:T.bool})});ne(vn,"defaultProps",{autoOpen:!1,callback:Jn,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:Jn,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var Fa=Object.defineProperty,La=(e,t,n)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>La(e,typeof t!="symbol"?t+"":t,n),z={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},me={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},A={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},B={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function Re(){var e;return!!(typeof window<"u"&&((e=window.document)!=null&&e.createElement))}function qr(e){return e?e.getBoundingClientRect():null}function Ba(e=!1){const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),o=Math.floor(r.length/2);return r.length%2===0?(r[o-1]+r[o])/2:r[o]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Ne(e){if(typeof e=="string")try{return document.querySelector(e)}catch{return null}return e}function $a(e){return!e||e.nodeType!==1?null:getComputedStyle(e)}function ft(e,t,n){if(!e)return Fe();const r=wr(e);if(r){if(r.isSameNode(Fe()))return n?document:Fe();if(!(r.scrollHeight>r.offsetHeight)&&!t)return r.style.overflow="initial",Fe()}return r}function At(e,t){if(!e)return!1;const n=ft(e,t);return n?!n.isSameNode(Fe()):!1}function Ha(e){return e.offsetParent!==document.body}function Xe(e,t="fixed"){if(!e||!(e instanceof HTMLElement))return!1;const{nodeName:n}=e,r=$a(e);return n==="BODY"||n==="HTML"?!1:r&&r.position===t?!0:e.parentNode?Xe(e.parentNode,t):!1}function Ua(e){var t;if(!e)return!1;let n=e;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:o}=getComputedStyle(n);if(r==="none"||o==="hidden")return!1}n=(t=n.parentElement)!=null?t:null}return!0}function za(e,t,n){var r,o,i;const a=qr(e),s=ft(e,n),l=At(e,n),u=Xe(e);let f=0,c=(r=a?.top)!=null?r:0;if(l&&u){const d=(o=e?.offsetTop)!=null?o:0,p=(i=s?.scrollTop)!=null?i:0;c=d-p}else s instanceof HTMLElement&&(f=s.scrollTop,!l&&!Xe(e)&&(c+=f),s.isSameNode(Fe())||(c+=Fe().scrollTop));return Math.floor(c-t)}function Ya(e,t,n){var r;if(!e)return 0;const{offsetTop:o=0,scrollTop:i=0}=(r=wr(e))!=null?r:{};let a=e.getBoundingClientRect().top+i;o&&(At(e,n)||Ha(e))&&(a-=o);const s=Math.floor(a-t);return s<0?0:s}function Fe(){var e;return(e=document.scrollingElement)!=null?e:document.documentElement}function qa(e,t){const{duration:n,element:r}=t;return new Promise((o,i)=>{const{scrollTop:a}=r,s=e>a?e-a:a-e;fs.top(r,e,{duration:s<100?50:n},l=>l&&l.message!=="Element already at target scroll position"?i(l):o())})}var st=kt.createPortal!==void 0;function Gr(e=navigator.userAgent){let t=e;return typeof window>"u"?t="node":document.documentMode?t="ie":/Edge/.test(e)?t="edge":window.opera||e.includes(" OPR/")?t="opera":typeof window.InstallTrigger<"u"?t="firefox":window.chrome?t="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(e)&&(t="safari"),t}function Tt(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function Se(e,t={}){const{defaultValue:n,step:r,steps:o}=t;let i=An(e);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&o&&(i=i.replace("{step}",r.toString()).replace("{steps}",o.toString()));else if(b.isValidElement(e)&&!Object.values(e.props).length&&Tt(e.type)==="function"){const a=e.type({});i=Se(a,t)}else i=An(n);return i}function Ga(e,t){return!N.plainObject(e)||!N.array(t)?!1:Object.keys(e).every(n=>t.includes(n))}function Va(e){const t=/^#?([\da-f])([\da-f])([\da-f])$/i,n=e.replace(t,(o,i,a,s)=>i+i+a+a+s+s),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function Xn(e){return e.disableBeacon||e.placement==="center"}function Qn(){return!["chrome","safari","firefox","opera"].includes(Gr())}function $e({data:e,debug:t=!1,title:n,warn:r=!1}){const o=r?console.warn||console.error:console.log;t&&(n&&e?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(e)?e.forEach(i=>{N.plainObject(i)&&i.key?o.apply(console,[i.key,i.value]):o.apply(console,[i])}):o.apply(console,[e]),console.groupEnd()):console.error("Missing title or data props"))}function Ka(e){return Object.keys(e)}function Vr(e,...t){if(!N.plainObject(e))throw new TypeError("Expected an object");const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}function Za(e,...t){if(!N.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(n[r]=e[r]);return n}function an(e,t,n){const r=i=>i.replace("{step}",String(t)).replace("{steps}",String(n));if(Tt(e)==="string")return r(e);if(!b.isValidElement(e))return e;const{children:o}=e.props;if(Tt(o)==="string"&&o.includes("{step}"))return b.cloneElement(e,{children:r(o)});if(Array.isArray(o))return b.cloneElement(e,{children:o.map(i=>typeof i=="string"?r(i):an(i,t,n))});if(Tt(e.type)==="function"&&!Object.values(e.props).length){const i=e.type({});return an(i,t,n)}return e}function Ja(e){const{isFirstStep:t,lifecycle:n,previousLifecycle:r,scrollToFirstStep:o,step:i,target:a}=e;return!i.disableScrolling&&(!t||o||n===A.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!Xe(a))&&r!==n&&[A.BEACON,A.TOOLTIP].includes(n)}var Xa={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},Kr={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},Qa={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:Kr,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},el={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},tl={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},at={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},er={borderRadius:4,position:"absolute"};function nl(e,t){var n,r,o,i,a;const{floaterProps:s,styles:l}=e,u=ye((n=t.floaterProps)!=null?n:{},s??{}),f=ye(l??{},(r=t.styles)!=null?r:{}),c=ye(tl,f.options||{}),d=t.placement==="center"||t.disableBeacon;let{width:p}=c;window.innerWidth>480&&(p=380),"width"in c&&(p=typeof c.width=="number"&&window.innerWidthZr(n,t)):($e({title:"validateSteps",data:"steps must be an array",warn:!0,debug:t}),!1)}var Jr={action:"init",controlled:!1,index:0,lifecycle:A.INIT,origin:null,size:0,status:B.IDLE},nr=Ka(Vr(Jr,"controlled","size")),ol=class{constructor(e){P(this,"beaconPopper"),P(this,"tooltipPopper"),P(this,"data",new Map),P(this,"listener"),P(this,"store",new Map),P(this,"addListener",o=>{this.listener=o}),P(this,"setSteps",o=>{const{size:i,status:a}=this.getState(),s={size:o.length,status:a};this.data.set("steps",o),a===B.WAITING&&!i&&o.length&&(s.status=B.RUNNING),this.setState(s)}),P(this,"getPopper",o=>o==="beacon"?this.beaconPopper:this.tooltipPopper),P(this,"setPopper",(o,i)=>{o==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),P(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),P(this,"close",(o=null)=>{const{index:i,status:a}=this.getState();a===B.RUNNING&&this.setState({...this.getNextState({action:z.CLOSE,index:i+1,origin:o})})}),P(this,"go",o=>{const{controlled:i,status:a}=this.getState();if(i||a!==B.RUNNING)return;const s=this.getSteps()[o];this.setState({...this.getNextState({action:z.GO,index:o}),status:s?a:B.FINISHED})}),P(this,"info",()=>this.getState()),P(this,"next",()=>{const{index:o,status:i}=this.getState();i===B.RUNNING&&this.setState(this.getNextState({action:z.NEXT,index:o+1}))}),P(this,"open",()=>{const{status:o}=this.getState();o===B.RUNNING&&this.setState({...this.getNextState({action:z.UPDATE,lifecycle:A.TOOLTIP})})}),P(this,"prev",()=>{const{index:o,status:i}=this.getState();i===B.RUNNING&&this.setState({...this.getNextState({action:z.PREV,index:o-1})})}),P(this,"reset",(o=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:z.RESET,index:0}),status:o?B.RUNNING:B.READY})}),P(this,"skip",()=>{const{status:o}=this.getState();o===B.RUNNING&&this.setState({action:z.SKIP,lifecycle:A.INIT,status:B.SKIPPED})}),P(this,"start",o=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:z.START,index:N.number(o)?o:i},!0),status:a?B.RUNNING:B.WAITING})}),P(this,"stop",(o=!1)=>{const{index:i,status:a}=this.getState();[B.FINISHED,B.SKIPPED].includes(a)||this.setState({...this.getNextState({action:z.STOP,index:i+(o?1:0)}),status:B.PAUSED})}),P(this,"update",o=>{var i,a;if(!Ga(o,nr))throw new Error(`State is not valid. Valid keys: ${nr.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...o,action:(i=o.action)!=null?i:z.UPDATE,origin:(a=o.origin)!=null?a:null},!0)})});const{continuous:t=!1,stepIndex:n,steps:r=[]}=e??{};this.setState({action:z.INIT,controlled:N.number(n),continuous:t,index:N.number(n)?n:0,lifecycle:A.INIT,origin:null,status:r.length?B.READY:B.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...Jr}}getNextState(e,t=!1){var n,r,o,i,a;const{action:s,controlled:l,index:u,size:f,status:c}=this.getState(),d=N.number(e.index)?e.index:u,p=l&&!t?u:Math.min(Math.max(d,0),f);return{action:(n=e.action)!=null?n:s,controlled:l,index:p,lifecycle:(r=e.lifecycle)!=null?r:A.INIT,origin:(o=e.origin)!=null?o:null,size:(i=e.size)!=null?i:f,status:p===f?B.FINISHED:(a=e.status)!=null?a:c}}getSteps(){const e=this.data.get("steps");return Array.isArray(e)?e:[]}hasUpdatedState(e){const t=JSON.stringify(e),n=JSON.stringify(this.getState());return t!==n}setState(e,t=!1){const n=this.getState(),{action:r,index:o,lifecycle:i,origin:a=null,size:s,status:l}={...n,...e};this.store.set("action",r),this.store.set("index",o),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",s),this.store.set("status",l),t&&(this.store.set("controlled",e.controlled),this.store.set("continuous",e.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function il(e){return new ol(e)}function sl({styles:e}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:e})}var al=sl,ll=class extends b.Component{constructor(){super(...arguments),P(this,"isActive",!1),P(this,"resizeTimeout"),P(this,"scrollTimeout"),P(this,"scrollParent"),P(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),P(this,"hideSpotlight",()=>{const{continuous:e,disableOverlay:t,lifecycle:n}=this.props,r=[A.INIT,A.BEACON,A.COMPLETE,A.ERROR];return t||(e?r.includes(n):n!==A.TOOLTIP)}),P(this,"handleMouseMove",e=>{const{mouseOverSpotlight:t}=this.state,{height:n,left:r,position:o,top:i,width:a}=this.spotlightStyles,s=o==="fixed"?e.clientY:e.pageY,l=o==="fixed"?e.clientX:e.pageX,u=s>=i&&s<=i+n,c=l>=r&&l<=r+a&&u;c!==t&&this.updateState({mouseOverSpotlight:c})}),P(this,"handleScroll",()=>{const{target:e}=this.props,t=Ne(e);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else Xe(t,"sticky")&&this.updateState({})}),P(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:r}=this.props,o=Ne(r);this.scrollParent=ft(o??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:o,target:i}=this.props,{changed:a}=Mt(e,this.props);if(a("target")||a("disableScrollParentFix")){const s=Ne(i);this.scrollParent=ft(s??document.body,n,!0)}a("lifecycle",A.TOOLTIP)&&((t=this.scrollParent)==null||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:s}=this.state;s||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(o&&r===A.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==A.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(e=this.scrollParent)==null||e.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:e}=this.state,{disableOverlayClose:t,placement:n,styles:r}=this.props;let o=r.overlay;return Qn()&&(o=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:t?"default":"pointer",height:Ba(),pointerEvents:e?"none":"auto",...o}}get spotlightStyles(){var e,t,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:o=!1,spotlightClicks:i,spotlightPadding:a=0,styles:s,target:l}=this.props,u=Ne(l),f=qr(u),c=Xe(u),d=za(u,a,o);return{...Qn()?s.spotlightLegacy:s.spotlight,height:Math.round(((e=f?.height)!=null?e:0)+a*2),left:Math.round(((t=f?.left)!=null?t:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:c?"fixed":"absolute",top:d,transition:"opacity 0.2s",width:Math.round(((n=f?.width)!=null?n:0)+a*2)}}updateState(e){this.isActive&&this.setState(t=>({...t,...e}))}render(){const{showSpotlight:e}=this.state,{onClickOverlay:t,placement:n}=this.props,{hideSpotlight:r,overlayStyles:o,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&e&&b.createElement(al,{styles:i});if(Gr()==="safari"){const{mixBlendMode:s,zIndex:l,...u}=o;a=b.createElement("div",{style:{...u}},a),delete o.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:t,role:"presentation",style:o},a)}},cl=class extends b.Component{constructor(){super(...arguments),P(this,"node",null)}componentDidMount(){const{id:e}=this.props;Re()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),st||this.renderReact15())}componentDidUpdate(){Re()&&(st||this.renderReact15())}componentWillUnmount(){!Re()||!this.node||(st||kt.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Re())return;const{children:e}=this.props;this.node&&kt.unstable_renderSubtreeIntoContainer(this,e,this.node)}renderReact16(){if(!Re()||!st)return null;const{children:e}=this.props;return this.node?kt.createPortal(e,this.node):null}render(){return st?this.renderReact16():null}},ul=class{constructor(e,t){if(P(this,"element"),P(this,"options"),P(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),P(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,o=n.nodeName.toLowerCase();return(r.test(o)&&!n.getAttribute("disabled")||o==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),P(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),P(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),P(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:o}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!o&&i+1===r.length?i=0:o&&i===0?i=r.length-1:i+=o?-1:1,r[i].focus()}),P(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,o=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&o.getPropertyValue("overflow")!=="visible"||o.getPropertyValue("display")==="none"}),P(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),P(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),P(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),P(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(e instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=e,this.options=t,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},fl=class extends b.Component{constructor(e){if(super(e),P(this,"beacon",null),P(this,"setBeaconRef",o=>{this.beacon=o}),e.beaconComponent)return;const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",e.nonce&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode(` @keyframes joyride-beacon-inner { 20% { opacity: 0.9; diff --git a/webui/dist/assets/radix-core-BlBHu_Lw.js b/webui/dist/assets/radix-core-C3XKqQJw.js similarity index 99% rename from webui/dist/assets/radix-core-BlBHu_Lw.js rename to webui/dist/assets/radix-core-C3XKqQJw.js index 2195079c..d16e79af 100644 --- a/webui/dist/assets/radix-core-BlBHu_Lw.js +++ b/webui/dist/assets/radix-core-C3XKqQJw.js @@ -42,4 +42,4 @@ import{r as i,j as v,R as Ee,a as sn,b as Ye,c as ds}from"./router-CWhjJi2n.js"; If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aa="DialogDescriptionWarning",ca=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jo(aa).contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Xl=Eo,Gl=To,ql=Po,Zl=Ao,Ql=Oo,Jl=No,eu=Do,tu=Lo;const la=["top","right","bottom","left"],ve=Math.min,G=Math.max,dt=Math.round,rt=Math.floor,ae=e=>({x:e,y:e}),ua={left:"right",right:"left",bottom:"top",top:"bottom"},da={start:"end",end:"start"};function zt(e,t,n){return G(e,ve(t,n))}function fe(e,t){return typeof e=="function"?e(t):e}function pe(e){return e.split("-")[0]}function We(e){return e.split("-")[1]}function fn(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}const fa=new Set(["top","bottom"]);function ie(e){return fa.has(pe(e))?"y":"x"}function mn(e){return fn(ie(e))}function pa(e,t,n){n===void 0&&(n=!1);const o=We(e),r=mn(e),s=pn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=ft(a)),[a,ft(a)]}function ma(e){const t=ft(e);return[Yt(e),t,Yt(t)]}function Yt(e){return e.replace(/start|end/g,t=>da[t])}const Vn=["left","right"],Hn=["right","left"],ha=["top","bottom"],va=["bottom","top"];function ga(e,t,n){switch(e){case"top":case"bottom":return n?t?Hn:Vn:t?Vn:Hn;case"left":case"right":return t?ha:va;default:return[]}}function ya(e,t,n,o){const r=We(e);let s=ga(pe(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(Yt)))),s}function ft(e){return e.replace(/left|right|bottom|top/g,t=>ua[t])}function wa(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fo(e){return typeof e!="number"?wa(e):{top:e,right:e,bottom:e,left:e}}function pt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Un(e,t,n){let{reference:o,floating:r}=e;const s=ie(t),a=mn(t),c=pn(a),l=pe(t),u=s==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,y=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-r.width,y:p};break;default:h={x:o.x,y:o.y}}switch(We(t)){case"start":h[a]-=y*(n&&u?-1:1);break;case"end":h[a]+=y*(n&&u?-1:1);break}return h}const xa=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,c=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:p}=Un(u,o,l),y=o,h={},x=0;for(let d=0;d({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=fe(e,t)||{};if(u==null)return{};const p=Fo(f),y={x:n,y:o},h=mn(r),x=pn(h),d=await a.getDimensions(u),m=h==="y",w=m?"top":"left",g=m?"bottom":"right",C=m?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[h]-y[h]-s.floating[x],E=y[h]-s.reference[h],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let S=R?R[C]:0;(!S||!await(a.isElement==null?void 0:a.isElement(R)))&&(S=c.floating[C]||s.floating[x]);const O=b/2-E/2,M=S/2-d[x]/2-1,L=ve(p[w],M),k=ve(p[g],M),$=L,F=S-d[x]-k,T=S/2-d[x]/2+O,j=zt($,T,F),I=!l.arrow&&We(r)!=null&&T!==j&&s.reference[x]/2-(T<$?L:k)-d[x]/2<0,_=I?T<$?T-$:T-F:0;return{[h]:y[h]+_,data:{[h]:j,centerOffset:T-j-_,...I&&{alignmentOffset:_}},reset:I}}}),ba=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:d=!0,...m}=fe(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=pe(r),g=ie(c),C=pe(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=y||(C||!d?[ft(c)]:ma(c)),R=x!=="none";!y&&R&&E.push(...ya(c,d,x,b));const S=[c,...E],O=await Ue(t,m),M=[];let L=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&M.push(O[w]),p){const T=pa(r,a,b);M.push(O[T[0]],O[T[1]])}if(L=[...L,{placement:r,overflows:M}],!M.every(T=>T<=0)){var k,$;const T=(((k=s.flip)==null?void 0:k.index)||0)+1,j=S[T];if(j&&(!(p==="alignment"?g!==ie(j):!1)||L.every(P=>ie(P.placement)===g?P.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:j}};let I=($=L.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:$.placement;if(!I)switch(h){case"bestFit":{var F;const _=(F=L.filter(P=>{if(R){const W=ie(P.placement);return W===g||W==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(W=>W>0).reduce((W,Y)=>W+Y,0)]).sort((P,W)=>P[1]-W[1])[0])==null?void 0:F[0];_&&(I=_);break}case"initialPlacement":I=c;break}if(r!==I)return{reset:{placement:I}}}return{}}}};function Kn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zn(e){return la.some(t=>e[t]>=0)}const Ea=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=fe(e,t);switch(o){case"referenceHidden":{const s=await Ue(t,{...r,elementContext:"reference"}),a=Kn(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:zn(a)}}}case"escaped":{const s=await Ue(t,{...r,altBoundary:!0}),a=Kn(s,n.floating);return{data:{escapedOffsets:a,escaped:zn(a)}}}default:return{}}}}},$o=new Set(["left","top"]);async function Sa(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=pe(n),c=We(n),l=ie(n)==="y",u=$o.has(a)?-1:1,f=s&&l?-1:1,p=fe(t,e);let{mainAxis:y,crossAxis:h,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(h=c==="end"?x*-1:x),l?{x:h*f,y:y*u}:{x:y*u,y:h*f}}const Ta=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:c}=t,l=await Sa(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},Ra=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:m=>{let{x:w,y:g}=m;return{x:w,y:g}}},...l}=fe(e,t),u={x:n,y:o},f=await Ue(t,l),p=ie(pe(r)),y=fn(p);let h=u[y],x=u[p];if(s){const m=y==="y"?"top":"left",w=y==="y"?"bottom":"right",g=h+f[m],C=h-f[w];h=zt(g,h,C)}if(a){const m=p==="y"?"top":"left",w=p==="y"?"bottom":"right",g=x+f[m],C=x-f[w];x=zt(g,x,C)}const d=c.fn({...t,[y]:h,[p]:x});return{...d,data:{x:d.x-n,y:d.y-o,enabled:{[y]:s,[p]:a}}}}}},Pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=fe(e,t),f={x:n,y:o},p=ie(r),y=fn(p);let h=f[y],x=f[p];const d=fe(c,t),m=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(l){const C=y==="y"?"height":"width",b=s.reference[y]-s.floating[C]+m.mainAxis,E=s.reference[y]+s.reference[C]-m.mainAxis;hE&&(h=E)}if(u){var w,g;const C=y==="y"?"width":"height",b=$o.has(pe(r)),E=s.reference[p]-s.floating[C]+(b&&((w=a.offset)==null?void 0:w[p])||0)+(b?0:m.crossAxis),R=s.reference[p]+s.reference[C]+(b?0:((g=a.offset)==null?void 0:g[p])||0)-(b?m.crossAxis:0);xR&&(x=R)}return{[y]:h,[p]:x}}}},Aa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:c}=t,{apply:l=()=>{},...u}=fe(e,t),f=await Ue(t,u),p=pe(r),y=We(r),h=ie(r)==="y",{width:x,height:d}=s.floating;let m,w;p==="top"||p==="bottom"?(m=p,w=y===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=p,m=y==="end"?"top":"bottom");const g=d-f.top-f.bottom,C=x-f.left-f.right,b=ve(d-f[m],g),E=ve(x-f[w],C),R=!t.middlewareData.shift;let S=b,O=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=g),R&&!y){const L=G(f.left,0),k=G(f.right,0),$=G(f.top,0),F=G(f.bottom,0);h?O=x-2*(L!==0||k!==0?L+k:G(f.left,f.right)):S=d-2*($!==0||F!==0?$+F:G(f.top,f.bottom))}await l({...t,availableWidth:O,availableHeight:S});const M=await a.getDimensions(c.floating);return x!==M.width||d!==M.height?{reset:{rects:!0}}:{}}}};function yt(){return typeof window<"u"}function Be(e){return Wo(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(Wo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wo(e){return yt()?e instanceof Node||e instanceof q(e).Node:!1}function te(e){return yt()?e instanceof Element||e instanceof q(e).Element:!1}function ce(e){return yt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Yn(e){return!yt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const Oa=new Set(["inline","contents"]);function qe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Oa.has(r)}const Ia=new Set(["table","td","th"]);function Na(e){return Ia.has(Be(e))}const _a=[":popover-open",":modal"];function wt(e){return _a.some(t=>{try{return e.matches(t)}catch{return!1}})}const Da=["transform","translate","scale","rotate","perspective"],Ma=["transform","translate","scale","rotate","perspective","filter"],La=["paint","layout","strict","content"];function hn(e){const t=vn(),n=te(e)?ne(e):e;return Da.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ma.some(o=>(n.willChange||"").includes(o))||La.some(o=>(n.contain||"").includes(o))}function ka(e){let t=ge(e);for(;ce(t)&&!je(t);){if(hn(t))return t;if(wt(t))return null;t=ge(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ja=new Set(["html","body","#document"]);function je(e){return ja.has(Be(e))}function ne(e){return q(e).getComputedStyle(e)}function xt(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if(Be(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||le(e);return Yn(t)?t.host:t}function Bo(e){const t=ge(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&qe(t)?t:Bo(t)}function Ke(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Bo(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=q(r);if(s){const c=Xt(a);return t.concat(a,a.visualViewport||[],qe(r)?r:[],c&&n?Ke(c):[])}return t.concat(r,Ke(r,[],n))}function Xt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vo(e){const t=ne(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ce(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=dt(n)!==s||dt(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function gn(e){return te(e)?e:e.contextElement}function Le(e){const t=gn(e);if(!ce(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Vo(t);let a=(s?dt(n.width):n.width)/o,c=(s?dt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Fa=ae(0);function Ho(e){const t=q(e);return!vn()||!t.visualViewport?Fa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $a(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function Re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=gn(e);let a=ae(1);t&&(o?te(o)&&(a=Le(o)):a=Le(e));const c=$a(s,n,o)?Ho(s):ae(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,p=r.height/a.y;if(s){const y=q(s),h=o&&te(o)?q(o):o;let x=y,d=Xt(x);for(;d&&o&&h!==x;){const m=Le(d),w=d.getBoundingClientRect(),g=ne(d),C=w.left+(d.clientLeft+parseFloat(g.paddingLeft))*m.x,b=w.top+(d.clientTop+parseFloat(g.paddingTop))*m.y;l*=m.x,u*=m.y,f*=m.x,p*=m.y,l+=C,u+=b,x=q(d),d=Xt(x)}}return pt({width:f,height:p,x:l,y:u})}function Ct(e,t){const n=xt(e).scrollLeft;return t?t.left+n:Re(le(e)).left+n}function Uo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ct(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Wa(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=le(o),c=t?wt(t.floating):!1;if(o===a||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ae(1);const f=ae(0),p=ce(o);if((p||!p&&!s)&&((Be(o)!=="body"||qe(a))&&(l=xt(o)),ce(o))){const h=Re(o);u=Le(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const y=a&&!p&&!s?Uo(a,l):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+y.x,y:n.y*u.y-l.scrollTop*u.y+f.y+y.y}}function Ba(e){return Array.from(e.getClientRects())}function Va(e){const t=le(e),n=xt(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Ct(e);const c=-n.scrollTop;return ne(o).direction==="rtl"&&(a+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:c}}const Xn=25;function Ha(e,t){const n=q(e),o=le(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){s=r.width,a=r.height;const f=vn();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const u=Ct(o);if(u<=0){const f=o.ownerDocument,p=f.body,y=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(o.clientWidth-p.clientWidth-h);x<=Xn&&(s-=x)}else u<=Xn&&(s+=u);return{width:s,height:a,x:c,y:l}}const Ua=new Set(["absolute","fixed"]);function Ka(e,t){const n=Re(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ce(e)?Le(e):ae(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,u=o*s.y;return{width:a,height:c,x:l,y:u}}function Gn(e,t,n){let o;if(t==="viewport")o=Ha(e,n);else if(t==="document")o=Va(le(e));else if(te(t))o=Ka(t,n);else{const r=Ho(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return pt(o)}function Ko(e,t){const n=ge(e);return n===t||!te(n)||je(n)?!1:ne(n).position==="fixed"||Ko(n,t)}function za(e,t){const n=t.get(e);if(n)return n;let o=Ke(e,[],!1).filter(c=>te(c)&&Be(c)!=="body"),r=null;const s=ne(e).position==="fixed";let a=s?ge(e):e;for(;te(a)&&!je(a);){const c=ne(a),l=hn(a);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&Ua.has(r.position)||qe(a)&&!l&&Ko(e,a))?o=o.filter(f=>f!==a):r=c,a=ge(a)}return t.set(e,o),o}function Ya(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?wt(t)?[]:za(t,this._c):[].concat(n),o],c=a[0],l=a.reduce((u,f)=>{const p=Gn(t,f,r);return u.top=G(p.top,u.top),u.right=ve(p.right,u.right),u.bottom=ve(p.bottom,u.bottom),u.left=G(p.left,u.left),u},Gn(t,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Xa(e){const{width:t,height:n}=Vo(e);return{width:t,height:n}}function Ga(e,t,n){const o=ce(t),r=le(t),s=n==="fixed",a=Re(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=ae(0);function u(){l.x=Ct(r)}if(o||!o&&!s)if((Be(t)!=="body"||qe(r))&&(c=xt(t)),o){const h=Re(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else r&&u();s&&!o&&r&&u();const f=r&&!o&&!s?Uo(r,c):ae(0),p=a.left+c.scrollLeft-l.x-f.x,y=a.top+c.scrollTop-l.y-f.y;return{x:p,y,width:a.width,height:a.height}}function Bt(e){return ne(e).position==="static"}function qn(e,t){if(!ce(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function zo(e,t){const n=q(e);if(wt(e))return n;if(!ce(e)){let r=ge(e);for(;r&&!je(r);){if(te(r)&&!Bt(r))return r;r=ge(r)}return n}let o=qn(e,t);for(;o&&Na(o)&&Bt(o);)o=qn(o,t);return o&&je(o)&&Bt(o)&&!hn(o)?n:o||ka(e)||n}const qa=async function(e){const t=this.getOffsetParent||zo,n=this.getDimensions,o=await n(e.floating);return{reference:Ga(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Za(e){return ne(e).direction==="rtl"}const Qa={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:le,getClippingRect:Ya,getOffsetParent:zo,getElementRects:qa,getClientRects:Ba,getDimensions:Xa,getScale:Le,isElement:te,isRTL:Za};function Yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(e,t){let n=null,o;const r=le(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:y,height:h}=u;if(c||t(),!y||!h)return;const x=rt(p),d=rt(r.clientWidth-(f+y)),m=rt(r.clientHeight-(p+h)),w=rt(f),C={rootMargin:-x+"px "+-d+"px "+-m+"px "+-w+"px",threshold:G(0,ve(1,l))||1};let b=!0;function E(R){const S=R[0].intersectionRatio;if(S!==l){if(!b)return a();S?a(!1,S):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!Yo(u,e.getBoundingClientRect())&&a(),b=!1}try{n=new IntersectionObserver(E,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,C)}n.observe(e)}return a(!0),s}function ec(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=gn(e),f=r||s?[...u?Ke(u):[],...Ke(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=u&&c?Ja(u,n):null;let y=-1,h=null;a&&(h=new ResizeObserver(w=>{let[g]=w;g&&g.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let x,d=l?Re(e):null;l&&m();function m(){const w=Re(e);d&&!Yo(d,w)&&n(),d=w,x=requestAnimationFrame(m)}return n(),()=>{var w;f.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),p?.(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const tc=Ta,nc=Ra,oc=ba,rc=Aa,sc=Ea,Zn=Ca,ic=Pa,ac=(e,t,n)=>{const o=new Map,r={platform:Qa,...n},s={...r.platform,_c:o};return xa(e,t,{...r,platform:s})};var cc=typeof document<"u",lc=function(){},ct=cc?i.useLayoutEffect:lc;function mt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!mt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!mt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Xo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qn(e,t){const n=Xo(e);return Math.round(t*n)/n}function Vt(e){const t=i.useRef(e);return ct(()=>{t.current=e}),t}function uc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,p]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,h]=i.useState(o);mt(y,o)||h(o);const[x,d]=i.useState(null),[m,w]=i.useState(null),g=i.useCallback(P=>{P!==R.current&&(R.current=P,d(P))},[]),C=i.useCallback(P=>{P!==S.current&&(S.current=P,w(P))},[]),b=s||x,E=a||m,R=i.useRef(null),S=i.useRef(null),O=i.useRef(f),M=l!=null,L=Vt(l),k=Vt(r),$=Vt(u),F=i.useCallback(()=>{if(!R.current||!S.current)return;const P={placement:t,strategy:n,middleware:y};k.current&&(P.platform=k.current),ac(R.current,S.current,P).then(W=>{const Y={...W,isPositioned:$.current!==!1};T.current&&!mt(O.current,Y)&&(O.current=Y,Ye.flushSync(()=>{p(Y)}))})},[y,t,n,k,$]);ct(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[u]);const T=i.useRef(!1);ct(()=>(T.current=!0,()=>{T.current=!1}),[]),ct(()=>{if(b&&(R.current=b),E&&(S.current=E),b&&E){if(L.current)return L.current(b,E,F);F()}},[b,E,F,L,M]);const j=i.useMemo(()=>({reference:R,floating:S,setReference:g,setFloating:C}),[g,C]),I=i.useMemo(()=>({reference:b,floating:E}),[b,E]),_=i.useMemo(()=>{const P={position:n,left:0,top:0};if(!I.floating)return P;const W=Qn(I.floating,f.x),Y=Qn(I.floating,f.y);return c?{...P,transform:"translate("+W+"px, "+Y+"px)",...Xo(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:Y}},[n,c,I.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:F,refs:j,elements:I,floatingStyles:_}),[f,F,j,I,_])}const dc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Zn({element:o.current,padding:r}).fn(n):{}:o?Zn({element:o,padding:r}).fn(n):{}}}},fc=(e,t)=>({...tc(e),options:[e,t]}),pc=(e,t)=>({...nc(e),options:[e,t]}),mc=(e,t)=>({...ic(e),options:[e,t]}),hc=(e,t)=>({...oc(e),options:[e,t]}),vc=(e,t)=>({...rc(e),options:[e,t]}),gc=(e,t)=>({...sc(e),options:[e,t]}),yc=(e,t)=>({...dc(e),options:[e,t]});var wc="Arrow",Go=i.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return v.jsx(D.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Go.displayName=wc;var xc=Go,yn="Popper",[qo,bt]=Oe(yn),[Cc,Zo]=qo(yn),Qo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=i.useState(null);return v.jsx(Cc,{scope:t,anchor:o,onAnchorChange:r,children:n})};Qo.displayName=yn;var Jo="PopperAnchor",er=i.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Zo(Jo,n),a=i.useRef(null),c=B(t,a),l=i.useRef(null);return i.useEffect(()=>{const u=l.current;l.current=o?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),o?null:v.jsx(D.div,{...r,ref:c})});er.displayName=Jo;var wn="PopperContent",[bc,Ec]=qo(wn),tr=i.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:y=!1,updatePositionStrategy:h="optimized",onPlaced:x,...d}=e,m=Zo(wn,n),[w,g]=i.useState(null),C=B(t,A=>g(A)),[b,E]=i.useState(null),R=so(b),S=R?.width??0,O=R?.height??0,M=o+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],$=k.length>0,F={padding:L,boundary:k.filter(Tc),altBoundary:$},{refs:T,floatingStyles:j,placement:I,isPositioned:_,middlewareData:P}=uc({strategy:"fixed",placement:M,whileElementsMounted:(...A)=>ec(...A,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[fc({mainAxis:r+O,alignmentAxis:a}),l&&pc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?mc():void 0,...F}),l&&hc({...F}),vc({...F,apply:({elements:A,rects:U,availableWidth:X,availableHeight:V})=>{const{width:H,height:K}=U.reference,Z=A.floating.style;Z.setProperty("--radix-popper-available-width",`${X}px`),Z.setProperty("--radix-popper-available-height",`${V}px`),Z.setProperty("--radix-popper-anchor-width",`${H}px`),Z.setProperty("--radix-popper-anchor-height",`${K}px`)}}),b&&yc({element:b,padding:c}),Rc({arrowWidth:S,arrowHeight:O}),y&&gc({strategy:"referenceHidden",...F})]}),[W,Y]=rr(I),ue=ee(x);z(()=>{_&&ue?.()},[_,ue]);const de=P.arrow?.x,re=P.arrow?.y,Q=P.arrow?.centerOffset!==0,[Ie,Ce]=i.useState();return z(()=>{w&&Ce(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:_?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(bc,{scope:n,placedSide:W,onArrowChange:E,arrowX:de,arrowY:re,shouldHideArrow:Q,children:v.jsx(D.div,{"data-side":W,"data-align":Y,...d,ref:C,style:{...d.style,animation:_?void 0:"none"}})})})});tr.displayName=wn;var nr="PopperArrow",Sc={top:"bottom",right:"left",bottom:"top",left:"right"},or=i.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Ec(nr,o),a=Sc[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(xc,{...r,ref:n,style:{...r.style,display:"block"}})})});or.displayName=nr;function Tc(e){return e!==null}var Rc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=rr(n),p={start:"0%",center:"50%",end:"100%"}[f],y=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+l/2;let x="",d="";return u==="bottom"?(x=a?p:`${y}px`,d=`${-l}px`):u==="top"?(x=a?p:`${y}px`,d=`${o.floating.height+l}px`):u==="right"?(x=`${-l}px`,d=a?p:`${h}px`):u==="left"&&(x=`${o.floating.width+l}px`,d=a?p:`${h}px`),{data:{x,y:d}}}});function rr(e){const[t,n="center"]=e.split("-");return[t,n]}var sr=Qo,ir=er,ar=tr,cr=or;function Pc(e){const t=Ac(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Ic);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Ac(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=_c(r),c=Nc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function Ic(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Nc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function _c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Dc="VisuallyHidden",Et=i.forwardRef((e,t)=>v.jsx(D.span,{...e,ref:t,style:{...lr,...e.style}}));Et.displayName=Dc;var Mc=Et,Lc=[" ","Enter","ArrowUp","ArrowDown"],kc=[" ","Enter"],Pe="Select",[St,Tt,jc]=eo(Pe),[Ve]=Oe(Pe,[jc,bt]),Rt=bt(),[Fc,we]=Ve(Pe),[$c,Wc]=Ve(Pe),ur=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:p,disabled:y,required:h,form:x}=e,d=Rt(t),[m,w]=i.useState(null),[g,C]=i.useState(null),[b,E]=i.useState(!1),R=_s(u),[S,O]=ke({prop:o,defaultProp:r??!1,onChange:s,caller:Pe}),[M,L]=ke({prop:a,defaultProp:c,onChange:l,caller:Pe}),k=i.useRef(null),$=m?x||!!m.closest("form"):!0,[F,T]=i.useState(new Set),j=Array.from(F).map(I=>I.props.value).join(";");return v.jsx(sr,{...d,children:v.jsxs(Fc,{required:h,scope:t,trigger:m,onTriggerChange:w,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:b,onValueNodeHasChildrenChange:E,contentId:Se(),value:M,onValueChange:L,open:S,onOpenChange:O,dir:R,triggerPointerDownPosRef:k,disabled:y,children:[v.jsx(St.Provider,{scope:t,children:v.jsx($c,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(I=>{T(_=>new Set(_).add(I))},[]),onNativeOptionRemove:i.useCallback(I=>{T(_=>{const P=new Set(_);return P.delete(I),P})},[]),children:n})}),$?v.jsxs(Mr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:M,onChange:I=>L(I.target.value),disabled:y,form:x,children:[M===void 0?v.jsx("option",{value:""}):null,Array.from(F)]},j):null]})})};ur.displayName=Pe;var dr="SelectTrigger",fr=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=Rt(n),a=we(dr,n),c=a.disabled||o,l=B(t,a.onTriggerChange),u=Tt(n),f=i.useRef("touch"),[p,y,h]=kr(d=>{const m=u().filter(C=>!C.disabled),w=m.find(C=>C.value===a.value),g=jr(m,d,w);g!==void 0&&a.onValueChange(g.value)}),x=d=>{c||(a.onOpenChange(!0),h()),d&&(a.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return v.jsx(ir,{asChild:!0,...s,children:v.jsx(D.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Lr(a.value)?"":void 0,...r,ref:l,onClick:N(r.onClick,d=>{d.currentTarget.focus(),f.current!=="mouse"&&x(d)}),onPointerDown:N(r.onPointerDown,d=>{f.current=d.pointerType;const m=d.target;m.hasPointerCapture(d.pointerId)&&m.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(x(d),d.preventDefault())}),onKeyDown:N(r.onKeyDown,d=>{const m=p.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&y(d.key),!(m&&d.key===" ")&&Lc.includes(d.key)&&(x(),d.preventDefault())})})})});fr.displayName=dr;var pr="SelectValue",mr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...c}=e,l=we(pr,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,p=B(t,l.onValueNodeChange);return z(()=>{u(f)},[u,f]),v.jsx(D.span,{...c,ref:p,style:{pointerEvents:"none"},children:Lr(l.value)?v.jsx(v.Fragment,{children:a}):s})});mr.displayName=pr;var Bc="SelectIcon",hr=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return v.jsx(D.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});hr.displayName=Bc;var Vc="SelectPortal",vr=e=>v.jsx(Ge,{asChild:!0,...e});vr.displayName=Vc;var Ae="SelectContent",gr=i.forwardRef((e,t)=>{const n=we(Ae,e.__scopeSelect),[o,r]=i.useState();if(z(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Ye.createPortal(v.jsx(yr,{scope:e.__scopeSelect,children:v.jsx(St.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),s):null}return v.jsx(wr,{...e,ref:t})});gr.displayName=Ae;var J=10,[yr,xe]=Ve(Ae),Hc="SelectContentImpl",Uc=Pc("SelectContent.RemoveScroll"),wr=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:y,collisionPadding:h,sticky:x,hideWhenDetached:d,avoidCollisions:m,...w}=e,g=we(Ae,n),[C,b]=i.useState(null),[E,R]=i.useState(null),S=B(t,A=>b(A)),[O,M]=i.useState(null),[L,k]=i.useState(null),$=Tt(n),[F,T]=i.useState(!1),j=i.useRef(!1);i.useEffect(()=>{if(C)return Co(C)},[C]),fo();const I=i.useCallback(A=>{const[U,...X]=$().map(K=>K.ref.current),[V]=X.slice(-1),H=document.activeElement;for(const K of A)if(K===H||(K?.scrollIntoView({block:"nearest"}),K===U&&E&&(E.scrollTop=0),K===V&&E&&(E.scrollTop=E.scrollHeight),K?.focus(),document.activeElement!==H))return},[$,E]),_=i.useCallback(()=>I([O,C]),[I,O,C]);i.useEffect(()=>{F&&_()},[F,_]);const{onOpenChange:P,triggerPointerDownPosRef:W}=g;i.useEffect(()=>{if(C){let A={x:0,y:0};const U=V=>{A={x:Math.abs(Math.round(V.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(W.current?.y??0))}},X=V=>{A.x<=10&&A.y<=10?V.preventDefault():C.contains(V.target)||P(!1),document.removeEventListener("pointermove",U),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",X,{capture:!0})}}},[C,P,W]),i.useEffect(()=>{const A=()=>P(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[P]);const[Y,ue]=kr(A=>{const U=$().filter(H=>!H.disabled),X=U.find(H=>H.ref.current===document.activeElement),V=jr(U,A,X);V&&setTimeout(()=>V.ref.current.focus())}),de=i.useCallback((A,U,X)=>{const V=!j.current&&!X;(g.value!==void 0&&g.value===U||V)&&(M(A),V&&(j.current=!0))},[g.value]),re=i.useCallback(()=>C?.focus(),[C]),Q=i.useCallback((A,U,X)=>{const V=!j.current&&!X;(g.value!==void 0&&g.value===U||V)&&k(A)},[g.value]),Ie=o==="popper"?Gt:xr,Ce=Ie===Gt?{side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:y,collisionPadding:h,sticky:x,hideWhenDetached:d,avoidCollisions:m}:{};return v.jsx(yr,{scope:n,content:C,viewport:E,onViewportChange:R,itemRefCallback:de,selectedItem:O,onItemLeave:re,itemTextRefCallback:Q,focusSelectedItem:_,selectedItemText:L,position:o,isPositioned:F,searchRef:Y,children:v.jsx(cn,{as:Uc,allowPinchZoom:!0,children:v.jsx(an,{asChild:!0,trapped:g.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:N(r,A=>{g.trigger?.focus({preventScroll:!0}),A.preventDefault()}),children:v.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:v.jsx(Ie,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:A=>A.preventDefault(),...w,...Ce,onPlaced:()=>T(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:N(w.onKeyDown,A=>{const U=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!U&&A.key.length===1&&ue(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let V=$().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(A.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const H=A.target,K=V.indexOf(H);V=V.slice(K+1)}setTimeout(()=>I(V)),A.preventDefault()}})})})})})})});wr.displayName=Hc;var Kc="SelectItemAlignedPosition",xr=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=we(Ae,n),a=xe(Ae,n),[c,l]=i.useState(null),[u,f]=i.useState(null),p=B(t,S=>f(S)),y=Tt(n),h=i.useRef(!1),x=i.useRef(!0),{viewport:d,selectedItem:m,selectedItemText:w,focusSelectedItem:g}=a,C=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&d&&m&&w){const S=s.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=w.getBoundingClientRect();if(s.dir!=="rtl"){const H=L.left-O.left,K=M.left-H,Z=S.left-K,be=S.width+Z,Nt=Math.max(be,O.width),_t=window.innerWidth-J,Dt=On(K,[J,Math.max(J,_t-Nt)]);c.style.minWidth=be+"px",c.style.left=Dt+"px"}else{const H=O.right-L.right,K=window.innerWidth-M.right-H,Z=window.innerWidth-S.right-K,be=S.width+Z,Nt=Math.max(be,O.width),_t=window.innerWidth-J,Dt=On(K,[J,Math.max(J,_t-Nt)]);c.style.minWidth=be+"px",c.style.right=Dt+"px"}const k=y(),$=window.innerHeight-J*2,F=d.scrollHeight,T=window.getComputedStyle(u),j=parseInt(T.borderTopWidth,10),I=parseInt(T.paddingTop,10),_=parseInt(T.borderBottomWidth,10),P=parseInt(T.paddingBottom,10),W=j+I+F+P+_,Y=Math.min(m.offsetHeight*5,W),ue=window.getComputedStyle(d),de=parseInt(ue.paddingTop,10),re=parseInt(ue.paddingBottom,10),Q=S.top+S.height/2-J,Ie=$-Q,Ce=m.offsetHeight/2,A=m.offsetTop+Ce,U=j+I+A,X=W-U;if(U<=Q){const H=k.length>0&&m===k[k.length-1].ref.current;c.style.bottom="0px";const K=u.clientHeight-d.offsetTop-d.offsetHeight,Z=Math.max(Ie,Ce+(H?re:0)+K+_),be=U+Z;c.style.height=be+"px"}else{const H=k.length>0&&m===k[0].ref.current;c.style.top="0px";const Z=Math.max(Q,j+d.offsetTop+(H?de:0)+Ce)+X;c.style.height=Z+"px",d.scrollTop=U-Q+d.offsetTop}c.style.margin=`${J}px 0`,c.style.minHeight=Y+"px",c.style.maxHeight=$+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[y,s.trigger,s.valueNode,c,u,d,m,w,s.dir,o]);z(()=>C(),[C]);const[b,E]=i.useState();z(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const R=i.useCallback(S=>{S&&x.current===!0&&(C(),g?.(),x.current=!1)},[C,g]);return v.jsx(Yc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:v.jsx(D.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});xr.displayName=Kc;var zc="SelectPopperPosition",Gt=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=J,...s}=e,a=Rt(n);return v.jsx(ar,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gt.displayName=zc;var[Yc,xn]=Ve(Ae,{}),qt="SelectViewport",Cr=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=xe(qt,n),a=xn(qt,n),c=B(t,s.onViewportChange),l=i.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),v.jsx(St.Slot,{scope:n,children:v.jsx(D.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=a;if(y?.current&&p){const h=Math.abs(l.current-f.scrollTop);if(h>0){const x=window.innerHeight-J*2,d=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),w=Math.max(d,m);if(w0?b:0,p.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Cr.displayName=qt;var br="SelectGroup",[Xc,Gc]=Ve(br),qc=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Se();return v.jsx(Xc,{scope:n,id:r,children:v.jsx(D.div,{role:"group","aria-labelledby":r,...o,ref:t})})});qc.displayName=br;var Er="SelectLabel",Sr=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Gc(Er,n);return v.jsx(D.div,{id:r.id,...o,ref:t})});Sr.displayName=Er;var ht="SelectItem",[Zc,Tr]=Ve(ht),Rr=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,c=we(ht,n),l=xe(ht,n),u=c.value===o,[f,p]=i.useState(s??""),[y,h]=i.useState(!1),x=B(t,g=>l.itemRefCallback?.(g,o,r)),d=Se(),m=i.useRef("touch"),w=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Zc,{scope:n,value:o,disabled:r,textId:d,isSelected:u,onItemTextChange:i.useCallback(g=>{p(C=>C||(g?.textContent??"").trim())},[]),children:v.jsx(St.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:v.jsx(D.div,{role:"option","aria-labelledby":d,"data-highlighted":y?"":void 0,"aria-selected":u&&y,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:x,onFocus:N(a.onFocus,()=>h(!0)),onBlur:N(a.onBlur,()=>h(!1)),onClick:N(a.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:N(a.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:N(a.onPointerDown,g=>{m.current=g.pointerType}),onPointerMove:N(a.onPointerMove,g=>{m.current=g.pointerType,r?l.onItemLeave?.():m.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(a.onPointerLeave,g=>{g.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:N(a.onKeyDown,g=>{l.searchRef?.current!==""&&g.key===" "||(kc.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});Rr.displayName=ht;var He="SelectItemText",Pr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=we(He,n),c=xe(He,n),l=Tr(He,n),u=Wc(He,n),[f,p]=i.useState(null),y=B(t,w=>p(w),l.onItemTextChange,w=>c.itemTextRefCallback?.(w,l.value,l.disabled)),h=f?.textContent,x=i.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:d,onNativeOptionRemove:m}=u;return z(()=>(d(x),()=>m(x)),[d,m,x]),v.jsxs(v.Fragment,{children:[v.jsx(D.span,{id:l.textId,...s,ref:y}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ye.createPortal(s.children,a.valueNode):null]})});Pr.displayName=He;var Ar="SelectItemIndicator",Or=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Tr(Ar,n).isSelected?v.jsx(D.span,{"aria-hidden":!0,...o,ref:t}):null});Or.displayName=Ar;var Zt="SelectScrollUpButton",Ir=i.forwardRef((e,t)=>{const n=xe(Zt,e.__scopeSelect),o=xn(Zt,e.__scopeSelect),[r,s]=i.useState(!1),a=B(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?v.jsx(_r,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ir.displayName=Zt;var Qt="SelectScrollDownButton",Nr=i.forwardRef((e,t)=>{const n=xe(Qt,e.__scopeSelect),o=xn(Qt,e.__scopeSelect),[r,s]=i.useState(!1),a=B(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?v.jsx(_r,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Nr.displayName=Qt;var _r=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=xe("SelectScrollButton",n),a=i.useRef(null),c=Tt(n),l=i.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),z(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),v.jsx(D.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{l()})})}),Qc="SelectSeparator",Dr=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return v.jsx(D.div,{"aria-hidden":!0,...o,ref:t})});Dr.displayName=Qc;var Jt="SelectArrow",Jc=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Rt(n),s=we(Jt,n),a=xe(Jt,n);return s.open&&a.position==="popper"?v.jsx(cr,{...r,...o,ref:t}):null});Jc.displayName=Jt;var el="SelectBubbleInput",Mr=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),s=B(o,r),a=ro(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(p)}},[a,t]),v.jsx(D.select,{...n,style:{...lr,...n.style},ref:s,defaultValue:t})});Mr.displayName=el;function Lr(e){return e===""||e===void 0}function kr(e){const t=ee(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(a=>{const c=n.current+a;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function jr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=tl(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function tl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var nu=ur,ou=fr,ru=mr,su=hr,iu=vr,au=gr,cu=Cr,lu=Sr,uu=Rr,du=Pr,fu=Or,pu=Ir,mu=Nr,hu=Dr,Pt="Checkbox",[nl]=Oe(Pt),[ol,Cn]=nl(Pt);function rl(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:c,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:p}=e,[y,h]=ke({prop:n,defaultProp:r??!1,onChange:l,caller:Pt}),[x,d]=i.useState(null),[m,w]=i.useState(null),g=i.useRef(!1),C=x?!!a||!!x.closest("form"):!0,b={checked:y,disabled:s,setChecked:h,control:x,setControl:d,name:c,form:a,value:f,hasConsumerStoppedPropagationRef:g,required:u,defaultChecked:he(r)?!1:r,isFormControl:C,bubbleInput:m,setBubbleInput:w};return v.jsx(ol,{scope:t,...b,children:al(p)?p(b):o})}var Fr="CheckboxTrigger",$r=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:c,checked:l,required:u,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:y,isFormControl:h,bubbleInput:x}=Cn(Fr,e),d=B(r,f),m=i.useRef(l);return i.useEffect(()=>{const w=s?.form;if(w){const g=()=>p(m.current);return w.addEventListener("reset",g),()=>w.removeEventListener("reset",g)}},[s,p]),v.jsx(D.button,{type:"button",role:"checkbox","aria-checked":he(l)?"mixed":l,"aria-required":u,"data-state":Hr(l),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:d,onKeyDown:N(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:N(n,w=>{p(g=>he(g)?!0:!g),x&&h&&(y.current=w.isPropagationStopped(),y.current||w.stopPropagation())})})});$r.displayName=Fr;var sl=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l,onCheckedChange:u,form:f,...p}=e;return v.jsx(rl,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:a,onCheckedChange:u,name:o,form:f,value:l,internal_do_not_use_render:({isFormControl:y})=>v.jsxs(v.Fragment,{children:[v.jsx($r,{...p,ref:t,__scopeCheckbox:n}),y&&v.jsx(Vr,{__scopeCheckbox:n})]})})});sl.displayName=Pt;var Wr="CheckboxIndicator",il=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Cn(Wr,n);return v.jsx(ye,{present:o||he(s.checked)||s.checked===!0,children:v.jsx(D.span,{"data-state":Hr(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});il.displayName=Wr;var Br="CheckboxBubbleInput",Vr=i.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:c,disabled:l,name:u,value:f,form:p,bubbleInput:y,setBubbleInput:h}=Cn(Br,e),x=B(n,h),d=ro(s),m=so(o);i.useEffect(()=>{const g=y;if(!g)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,R=!r.current;if(d!==s&&E){const S=new Event("click",{bubbles:R});g.indeterminate=he(s),E.call(g,he(s)?!1:s),g.dispatchEvent(S)}},[y,d,s,r]);const w=i.useRef(he(s)?!1:s);return v.jsx(D.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:c,disabled:l,name:u,value:f,form:p,...t,tabIndex:-1,ref:x,style:{...t.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Vr.displayName=Br;function al(e){return typeof e=="function"}function he(e){return e==="indeterminate"}function Hr(e){return he(e)?"indeterminate":e?"checked":"unchecked"}var cl=Symbol("radix.slottable");function ll(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=cl,t}var[At]=Oe("Tooltip",[bt]),Ot=bt(),Ur="TooltipProvider",ul=700,en="tooltip.open",[dl,bn]=At(Ur),Kr=e=>{const{__scopeTooltip:t,delayDuration:n=ul,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,a=i.useRef(!0),c=i.useRef(!1),l=i.useRef(0);return i.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),v.jsx(dl,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:i.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};Kr.displayName=Ur;var ze="Tooltip",[fl,Ze]=At(ze),zr=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,l=bn(ze,e.__scopeTooltip),u=Ot(t),[f,p]=i.useState(null),y=Se(),h=i.useRef(0),x=a??l.disableHoverableContent,d=c??l.delayDuration,m=i.useRef(!1),[w,g]=ke({prop:o,defaultProp:r??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(en))):l.onClose(),s?.(S)},caller:ze}),C=i.useMemo(()=>w?m.current?"delayed-open":"instant-open":"closed",[w]),b=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m.current=!1,g(!0)},[g]),E=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),R=i.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=!0,g(!0),h.current=0},d)},[d,g]);return i.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),v.jsx(sr,{...u,children:v.jsx(fl,{scope:t,contentId:y,open:w,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{l.isOpenDelayedRef.current?R():b()},[l.isOpenDelayedRef,R,b]),onTriggerLeave:i.useCallback(()=>{x?E():(window.clearTimeout(h.current),h.current=0)},[E,x]),onOpen:b,onClose:E,disableHoverableContent:x,children:n})})};zr.displayName=ze;var tn="TooltipTrigger",Yr=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ze(tn,n),s=bn(tn,n),a=Ot(n),c=i.useRef(null),l=B(t,c,r.onTriggerChange),u=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),v.jsx(ir,{asChild:!0,...a,children:v.jsx(D.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:N(e.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:N(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:N(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:N(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:N(e.onBlur,r.onClose),onClick:N(e.onClick,r.onClose)})})});Yr.displayName=tn;var En="TooltipPortal",[pl,ml]=At(En,{forceMount:void 0}),Xr=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=Ze(En,t);return v.jsx(pl,{scope:t,forceMount:n,children:v.jsx(ye,{present:n||s.open,children:v.jsx(Ge,{asChild:!0,container:r,children:o})})})};Xr.displayName=En;var Fe="TooltipContent",Gr=i.forwardRef((e,t)=>{const n=ml(Fe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=Ze(Fe,e.__scopeTooltip);return v.jsx(ye,{present:o||a.open,children:a.disableHoverableContent?v.jsx(qr,{side:r,...s,ref:t}):v.jsx(hl,{side:r,...s,ref:t})})}),hl=i.forwardRef((e,t)=>{const n=Ze(Fe,e.__scopeTooltip),o=bn(Fe,e.__scopeTooltip),r=i.useRef(null),s=B(t,r),[a,c]=i.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:p}=o,y=i.useCallback(()=>{c(null),p(!1)},[p]),h=i.useCallback((x,d)=>{const m=x.currentTarget,w={x:x.clientX,y:x.clientY},g=xl(w,m.getBoundingClientRect()),C=Cl(w,g),b=bl(d.getBoundingClientRect()),E=Sl([...C,...b]);c(E),p(!0)},[p]);return i.useEffect(()=>()=>y(),[y]),i.useEffect(()=>{if(l&&f){const x=m=>h(m,f),d=m=>h(m,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",d),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",d)}}},[l,f,h,y]),i.useEffect(()=>{if(a){const x=d=>{const m=d.target,w={x:d.clientX,y:d.clientY},g=l?.contains(m)||f?.contains(m),C=!El(w,a);g?y():C&&(y(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,a,u,y]),v.jsx(qr,{...e,ref:s})}),[vl,gl]=At(ze,{isInside:!1}),yl=ll("TooltipContent"),qr=i.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,l=Ze(Fe,n),u=Ot(n),{onClose:f}=l;return i.useEffect(()=>(document.addEventListener(en,f),()=>document.removeEventListener(en,f)),[f]),i.useEffect(()=>{if(l.trigger){const p=y=>{y.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,f]),v.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:v.jsxs(ar,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(yl,{children:o}),v.jsx(vl,{scope:n,isInside:!0,children:v.jsx(Mc,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Gr.displayName=Fe;var Zr="TooltipArrow",wl=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ot(n);return gl(Zr,n).isInside?null:v.jsx(cr,{...r,...o,ref:t})});wl.displayName=Zr;function xl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Cl(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function bl(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function El(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;so!=y>o&&n<(p-u)*(o-f)/(y-f)+u&&(r=!r)}return r}function Sl(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Tl(t)}function Tl(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vu=Kr,gu=zr,yu=Yr,wu=Xr,xu=Gr,Sn="ToastProvider",[Tn,Rl,Pl]=eo("Toast"),[Qr]=Oe("Toast",[Pl]),[Al,It]=Qr(Sn),Jr=e=>{const{__scopeToast:t,label:n="Notification",duration:o=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:a}=e,[c,l]=i.useState(null),[u,f]=i.useState(0),p=i.useRef(!1),y=i.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Sn}\`. Expected non-empty \`string\`.`),v.jsx(Tn.Provider,{scope:t,children:v.jsx(Al,{scope:t,label:n,duration:o,swipeDirection:r,swipeThreshold:s,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:i.useCallback(()=>f(h=>h+1),[]),onToastRemove:i.useCallback(()=>f(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:y,children:a})})};Jr.displayName=Sn;var es="ToastViewport",Ol=["F8"],nn="toast.viewportPause",on="toast.viewportResume",ts=i.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=Ol,label:r="Notifications ({hotkey})",...s}=e,a=It(es,n),c=Rl(n),l=i.useRef(null),u=i.useRef(null),f=i.useRef(null),p=i.useRef(null),y=B(t,p,a.onViewportChange),h=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=a.toastCount>0;i.useEffect(()=>{const m=w=>{o.length!==0&&o.every(C=>w[C]||w.code===C)&&p.current?.focus()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]),i.useEffect(()=>{const m=l.current,w=p.current;if(x&&m&&w){const g=()=>{if(!a.isClosePausedRef.current){const R=new CustomEvent(nn);w.dispatchEvent(R),a.isClosePausedRef.current=!0}},C=()=>{if(a.isClosePausedRef.current){const R=new CustomEvent(on);w.dispatchEvent(R),a.isClosePausedRef.current=!1}},b=R=>{!m.contains(R.relatedTarget)&&C()},E=()=>{m.contains(document.activeElement)||C()};return m.addEventListener("focusin",g),m.addEventListener("focusout",b),m.addEventListener("pointermove",g),m.addEventListener("pointerleave",E),window.addEventListener("blur",g),window.addEventListener("focus",C),()=>{m.removeEventListener("focusin",g),m.removeEventListener("focusout",b),m.removeEventListener("pointermove",g),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",g),window.removeEventListener("focus",C)}}},[x,a.isClosePausedRef]);const d=i.useCallback(({tabbingDirection:m})=>{const g=c().map(C=>{const b=C.ref.current,E=[b,...Vl(b)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?g.reverse():g).flat()},[c]);return i.useEffect(()=>{const m=p.current;if(m){const w=g=>{const C=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!C){const E=document.activeElement,R=g.shiftKey;if(g.target===m&&R){u.current?.focus();return}const M=d({tabbingDirection:R?"backwards":"forwards"}),L=M.findIndex(k=>k===E);Ht(M.slice(L+1))?g.preventDefault():R?u.current?.focus():f.current?.focus()}};return m.addEventListener("keydown",w),()=>m.removeEventListener("keydown",w)}},[c,d]),v.jsxs(ei,{ref:l,role:"region","aria-label":r.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&v.jsx(rn,{ref:u,onFocusFromOutsideViewport:()=>{const m=d({tabbingDirection:"forwards"});Ht(m)}}),v.jsx(Tn.Slot,{scope:n,children:v.jsx(D.ol,{tabIndex:-1,...s,ref:y})}),x&&v.jsx(rn,{ref:f,onFocusFromOutsideViewport:()=>{const m=d({tabbingDirection:"backwards"});Ht(m)}})]})});ts.displayName=es;var ns="ToastFocusProxy",rn=i.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,s=It(ns,n);return v.jsx(Et,{tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:a=>{const c=a.relatedTarget;!s.viewport?.contains(c)&&o()}})});rn.displayName=ns;var Qe="Toast",Il="toast.swipeStart",Nl="toast.swipeMove",_l="toast.swipeCancel",Dl="toast.swipeEnd",os=i.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:s,...a}=e,[c,l]=ke({prop:o,defaultProp:r??!0,onChange:s,caller:Qe});return v.jsx(ye,{present:n||c,children:v.jsx(kl,{open:c,...a,ref:t,onClose:()=>l(!1),onPause:ee(e.onPause),onResume:ee(e.onResume),onSwipeStart:N(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:N(e.onSwipeMove,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:N(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:N(e.onSwipeEnd,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),l(!1)})})})});os.displayName=Qe;var[Ml,Ll]=Qr(Qe,{onClose(){}}),kl=i.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:s,onClose:a,onEscapeKeyDown:c,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:y,onSwipeEnd:h,...x}=e,d=It(Qe,n),[m,w]=i.useState(null),g=B(t,T=>w(T)),C=i.useRef(null),b=i.useRef(null),E=r||d.duration,R=i.useRef(0),S=i.useRef(E),O=i.useRef(0),{onToastAdd:M,onToastRemove:L}=d,k=ee(()=>{m?.contains(document.activeElement)&&d.viewport?.focus(),a()}),$=i.useCallback(T=>{!T||T===1/0||(window.clearTimeout(O.current),R.current=new Date().getTime(),O.current=window.setTimeout(k,T))},[k]);i.useEffect(()=>{const T=d.viewport;if(T){const j=()=>{$(S.current),u?.()},I=()=>{const _=new Date().getTime()-R.current;S.current=S.current-_,window.clearTimeout(O.current),l?.()};return T.addEventListener(nn,I),T.addEventListener(on,j),()=>{T.removeEventListener(nn,I),T.removeEventListener(on,j)}}},[d.viewport,E,l,u,$]),i.useEffect(()=>{s&&!d.isClosePausedRef.current&&$(E)},[s,E,d.isClosePausedRef,$]),i.useEffect(()=>(M(),()=>L()),[M,L]);const F=i.useMemo(()=>m?us(m):null,[m]);return d.viewport?v.jsxs(v.Fragment,{children:[F&&v.jsx(jl,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:F}),v.jsx(Ml,{scope:n,onClose:k,children:Ye.createPortal(v.jsx(Tn.ItemSlot,{scope:n,children:v.jsx(Js,{asChild:!0,onEscapeKeyDown:N(c,()=>{d.isFocusedToastEscapeKeyDownRef.current||k(),d.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(D.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":d.swipeDirection,...x,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:N(e.onKeyDown,T=>{T.key==="Escape"&&(c?.(T.nativeEvent),T.nativeEvent.defaultPrevented||(d.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:N(e.onPointerDown,T=>{T.button===0&&(C.current={x:T.clientX,y:T.clientY})}),onPointerMove:N(e.onPointerMove,T=>{if(!C.current)return;const j=T.clientX-C.current.x,I=T.clientY-C.current.y,_=!!b.current,P=["left","right"].includes(d.swipeDirection),W=["left","up"].includes(d.swipeDirection)?Math.min:Math.max,Y=P?W(0,j):0,ue=P?0:W(0,I),de=T.pointerType==="touch"?10:2,re={x:Y,y:ue},Q={originalEvent:T,delta:re};_?(b.current=re,st(Nl,p,Q,{discrete:!1})):Jn(re,d.swipeDirection,de)?(b.current=re,st(Il,f,Q,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(j)>de||Math.abs(I)>de)&&(C.current=null)}),onPointerUp:N(e.onPointerUp,T=>{const j=b.current,I=T.target;if(I.hasPointerCapture(T.pointerId)&&I.releasePointerCapture(T.pointerId),b.current=null,C.current=null,j){const _=T.currentTarget,P={originalEvent:T,delta:j};Jn(j,d.swipeDirection,d.swipeThreshold)?st(Dl,h,P,{discrete:!0}):st(_l,y,P,{discrete:!0}),_.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),d.viewport)})]}):null}),jl=e=>{const{__scopeToast:t,children:n,...o}=e,r=It(Qe,t),[s,a]=i.useState(!1),[c,l]=i.useState(!1);return Wl(()=>a(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:v.jsx(Ge,{asChild:!0,children:v.jsx(Et,{...o,children:s&&v.jsxs(v.Fragment,{children:[r.label," ",n]})})})},Fl="ToastTitle",rs=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return v.jsx(D.div,{...o,ref:t})});rs.displayName=Fl;var $l="ToastDescription",ss=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return v.jsx(D.div,{...o,ref:t})});ss.displayName=$l;var is="ToastAction",as=i.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?v.jsx(ls,{altText:n,asChild:!0,children:v.jsx(Rn,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${is}\`. Expected non-empty \`string\`.`),null)});as.displayName=is;var cs="ToastClose",Rn=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=Ll(cs,n);return v.jsx(ls,{asChild:!0,children:v.jsx(D.button,{type:"button",...o,ref:t,onClick:N(e.onClick,r.onClose)})})});Rn.displayName=cs;var ls=i.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return v.jsx(D.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function us(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),Bl(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",s=o.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const a=o.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...us(o))}}),t}function st(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?to(r,s):r.dispatchEvent(s)}var Jn=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),s=o>r;return t==="left"||t==="right"?s&&o>n:!s&&r>n};function Wl(e=()=>{}){const t=ee(e);z(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function Bl(e){return e.nodeType===e.ELEMENT_NODE}function Vl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ht(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Cu=Jr,bu=ts,Eu=os,Su=rs,Tu=ss,Ru=as,Pu=Rn;export{ru as $,sr as A,ir as B,Ql as C,eu as D,cr as E,an as F,to as G,Kl as H,ou as I,su as J,pu as K,mu as L,iu as M,au as N,Zl as O,D as P,lu as Q,Xl as R,Ul as S,Jl as T,uu as U,cu as V,Yl as W,fu as X,du as Y,hu as Z,nu as _,eo as a,sl as a0,il as a1,wu as a2,xu as a3,vu as a4,gu as a5,yu as a6,bu as a7,Eu as a8,Ru as a9,Pu as aa,Su as ab,Tu as ac,Cu as ad,N as b,Oe as c,B as d,_s as e,ke as f,ee as g,ye as h,z as i,On as j,oo as k,ro as l,so as m,zl as n,ql as o,tu as p,Gl as q,$e as r,Ge as s,bt as t,Se as u,Co as v,cn as w,fo as x,Xe as y,ar as z}; +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aa="DialogDescriptionWarning",ca=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jo(aa).contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Xl=Eo,Gl=To,ql=Po,Zl=Ao,Ql=Oo,Jl=No,eu=Do,tu=Lo;const la=["top","right","bottom","left"],ve=Math.min,G=Math.max,dt=Math.round,rt=Math.floor,ae=e=>({x:e,y:e}),ua={left:"right",right:"left",bottom:"top",top:"bottom"},da={start:"end",end:"start"};function zt(e,t,n){return G(e,ve(t,n))}function fe(e,t){return typeof e=="function"?e(t):e}function pe(e){return e.split("-")[0]}function We(e){return e.split("-")[1]}function fn(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}const fa=new Set(["top","bottom"]);function ie(e){return fa.has(pe(e))?"y":"x"}function mn(e){return fn(ie(e))}function pa(e,t,n){n===void 0&&(n=!1);const o=We(e),r=mn(e),s=pn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=ft(a)),[a,ft(a)]}function ma(e){const t=ft(e);return[Yt(e),t,Yt(t)]}function Yt(e){return e.replace(/start|end/g,t=>da[t])}const Vn=["left","right"],Hn=["right","left"],ha=["top","bottom"],va=["bottom","top"];function ga(e,t,n){switch(e){case"top":case"bottom":return n?t?Hn:Vn:t?Vn:Hn;case"left":case"right":return t?ha:va;default:return[]}}function ya(e,t,n,o){const r=We(e);let s=ga(pe(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(Yt)))),s}function ft(e){return e.replace(/left|right|bottom|top/g,t=>ua[t])}function wa(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fo(e){return typeof e!="number"?wa(e):{top:e,right:e,bottom:e,left:e}}function pt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Un(e,t,n){let{reference:o,floating:r}=e;const s=ie(t),a=mn(t),c=pn(a),l=pe(t),u=s==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,y=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-r.width,y:p};break;default:h={x:o.x,y:o.y}}switch(We(t)){case"start":h[a]-=y*(n&&u?-1:1);break;case"end":h[a]+=y*(n&&u?-1:1);break}return h}const xa=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,c=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:p}=Un(u,o,l),y=o,h={},x=0;for(let d=0;d({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=fe(e,t)||{};if(u==null)return{};const p=Fo(f),y={x:n,y:o},h=mn(r),x=pn(h),d=await a.getDimensions(u),m=h==="y",w=m?"top":"left",g=m?"bottom":"right",C=m?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[h]-y[h]-s.floating[x],E=y[h]-s.reference[h],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let S=R?R[C]:0;(!S||!await(a.isElement==null?void 0:a.isElement(R)))&&(S=c.floating[C]||s.floating[x]);const O=b/2-E/2,M=S/2-d[x]/2-1,L=ve(p[w],M),k=ve(p[g],M),$=L,F=S-d[x]-k,T=S/2-d[x]/2+O,j=zt($,T,F),I=!l.arrow&&We(r)!=null&&T!==j&&s.reference[x]/2-(T<$?L:k)-d[x]/2<0,_=I?T<$?T-$:T-F:0;return{[h]:y[h]+_,data:{[h]:j,centerOffset:T-j-_,...I&&{alignmentOffset:_}},reset:I}}}),ba=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:d=!0,...m}=fe(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=pe(r),g=ie(c),C=pe(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=y||(C||!d?[ft(c)]:ma(c)),R=x!=="none";!y&&R&&E.push(...ya(c,d,x,b));const S=[c,...E],O=await Ue(t,m),M=[];let L=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&M.push(O[w]),p){const T=pa(r,a,b);M.push(O[T[0]],O[T[1]])}if(L=[...L,{placement:r,overflows:M}],!M.every(T=>T<=0)){var k,$;const T=(((k=s.flip)==null?void 0:k.index)||0)+1,j=S[T];if(j&&(!(p==="alignment"?g!==ie(j):!1)||L.every(P=>ie(P.placement)===g?P.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:j}};let I=($=L.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:$.placement;if(!I)switch(h){case"bestFit":{var F;const _=(F=L.filter(P=>{if(R){const W=ie(P.placement);return W===g||W==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(W=>W>0).reduce((W,Y)=>W+Y,0)]).sort((P,W)=>P[1]-W[1])[0])==null?void 0:F[0];_&&(I=_);break}case"initialPlacement":I=c;break}if(r!==I)return{reset:{placement:I}}}return{}}}};function Kn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zn(e){return la.some(t=>e[t]>=0)}const Ea=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=fe(e,t);switch(o){case"referenceHidden":{const s=await Ue(t,{...r,elementContext:"reference"}),a=Kn(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:zn(a)}}}case"escaped":{const s=await Ue(t,{...r,altBoundary:!0}),a=Kn(s,n.floating);return{data:{escapedOffsets:a,escaped:zn(a)}}}default:return{}}}}},$o=new Set(["left","top"]);async function Sa(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=pe(n),c=We(n),l=ie(n)==="y",u=$o.has(a)?-1:1,f=s&&l?-1:1,p=fe(t,e);let{mainAxis:y,crossAxis:h,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(h=c==="end"?x*-1:x),l?{x:h*f,y:y*u}:{x:y*u,y:h*f}}const Ta=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:c}=t,l=await Sa(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},Ra=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:m=>{let{x:w,y:g}=m;return{x:w,y:g}}},...l}=fe(e,t),u={x:n,y:o},f=await Ue(t,l),p=ie(pe(r)),y=fn(p);let h=u[y],x=u[p];if(s){const m=y==="y"?"top":"left",w=y==="y"?"bottom":"right",g=h+f[m],C=h-f[w];h=zt(g,h,C)}if(a){const m=p==="y"?"top":"left",w=p==="y"?"bottom":"right",g=x+f[m],C=x-f[w];x=zt(g,x,C)}const d=c.fn({...t,[y]:h,[p]:x});return{...d,data:{x:d.x-n,y:d.y-o,enabled:{[y]:s,[p]:a}}}}}},Pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=fe(e,t),f={x:n,y:o},p=ie(r),y=fn(p);let h=f[y],x=f[p];const d=fe(c,t),m=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(l){const C=y==="y"?"height":"width",b=s.reference[y]-s.floating[C]+m.mainAxis,E=s.reference[y]+s.reference[C]-m.mainAxis;hE&&(h=E)}if(u){var w,g;const C=y==="y"?"width":"height",b=$o.has(pe(r)),E=s.reference[p]-s.floating[C]+(b&&((w=a.offset)==null?void 0:w[p])||0)+(b?0:m.crossAxis),R=s.reference[p]+s.reference[C]+(b?0:((g=a.offset)==null?void 0:g[p])||0)-(b?m.crossAxis:0);xR&&(x=R)}return{[y]:h,[p]:x}}}},Aa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:c}=t,{apply:l=()=>{},...u}=fe(e,t),f=await Ue(t,u),p=pe(r),y=We(r),h=ie(r)==="y",{width:x,height:d}=s.floating;let m,w;p==="top"||p==="bottom"?(m=p,w=y===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=p,m=y==="end"?"top":"bottom");const g=d-f.top-f.bottom,C=x-f.left-f.right,b=ve(d-f[m],g),E=ve(x-f[w],C),R=!t.middlewareData.shift;let S=b,O=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=g),R&&!y){const L=G(f.left,0),k=G(f.right,0),$=G(f.top,0),F=G(f.bottom,0);h?O=x-2*(L!==0||k!==0?L+k:G(f.left,f.right)):S=d-2*($!==0||F!==0?$+F:G(f.top,f.bottom))}await l({...t,availableWidth:O,availableHeight:S});const M=await a.getDimensions(c.floating);return x!==M.width||d!==M.height?{reset:{rects:!0}}:{}}}};function yt(){return typeof window<"u"}function Be(e){return Wo(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(Wo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wo(e){return yt()?e instanceof Node||e instanceof q(e).Node:!1}function te(e){return yt()?e instanceof Element||e instanceof q(e).Element:!1}function ce(e){return yt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Yn(e){return!yt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}const Oa=new Set(["inline","contents"]);function qe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Oa.has(r)}const Ia=new Set(["table","td","th"]);function Na(e){return Ia.has(Be(e))}const _a=[":popover-open",":modal"];function wt(e){return _a.some(t=>{try{return e.matches(t)}catch{return!1}})}const Da=["transform","translate","scale","rotate","perspective"],Ma=["transform","translate","scale","rotate","perspective","filter"],La=["paint","layout","strict","content"];function hn(e){const t=vn(),n=te(e)?ne(e):e;return Da.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ma.some(o=>(n.willChange||"").includes(o))||La.some(o=>(n.contain||"").includes(o))}function ka(e){let t=ge(e);for(;ce(t)&&!je(t);){if(hn(t))return t;if(wt(t))return null;t=ge(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ja=new Set(["html","body","#document"]);function je(e){return ja.has(Be(e))}function ne(e){return q(e).getComputedStyle(e)}function xt(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if(Be(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||le(e);return Yn(t)?t.host:t}function Bo(e){const t=ge(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&qe(t)?t:Bo(t)}function Ke(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Bo(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=q(r);if(s){const c=Xt(a);return t.concat(a,a.visualViewport||[],qe(r)?r:[],c&&n?Ke(c):[])}return t.concat(r,Ke(r,[],n))}function Xt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vo(e){const t=ne(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ce(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=dt(n)!==s||dt(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function gn(e){return te(e)?e:e.contextElement}function Le(e){const t=gn(e);if(!ce(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Vo(t);let a=(s?dt(n.width):n.width)/o,c=(s?dt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Fa=ae(0);function Ho(e){const t=q(e);return!vn()||!t.visualViewport?Fa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $a(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function Re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=gn(e);let a=ae(1);t&&(o?te(o)&&(a=Le(o)):a=Le(e));const c=$a(s,n,o)?Ho(s):ae(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,p=r.height/a.y;if(s){const y=q(s),h=o&&te(o)?q(o):o;let x=y,d=Xt(x);for(;d&&o&&h!==x;){const m=Le(d),w=d.getBoundingClientRect(),g=ne(d),C=w.left+(d.clientLeft+parseFloat(g.paddingLeft))*m.x,b=w.top+(d.clientTop+parseFloat(g.paddingTop))*m.y;l*=m.x,u*=m.y,f*=m.x,p*=m.y,l+=C,u+=b,x=q(d),d=Xt(x)}}return pt({width:f,height:p,x:l,y:u})}function Ct(e,t){const n=xt(e).scrollLeft;return t?t.left+n:Re(le(e)).left+n}function Uo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ct(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Wa(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=le(o),c=t?wt(t.floating):!1;if(o===a||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ae(1);const f=ae(0),p=ce(o);if((p||!p&&!s)&&((Be(o)!=="body"||qe(a))&&(l=xt(o)),ce(o))){const h=Re(o);u=Le(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const y=a&&!p&&!s?Uo(a,l):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+y.x,y:n.y*u.y-l.scrollTop*u.y+f.y+y.y}}function Ba(e){return Array.from(e.getClientRects())}function Va(e){const t=le(e),n=xt(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Ct(e);const c=-n.scrollTop;return ne(o).direction==="rtl"&&(a+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:c}}const Xn=25;function Ha(e,t){const n=q(e),o=le(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){s=r.width,a=r.height;const f=vn();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const u=Ct(o);if(u<=0){const f=o.ownerDocument,p=f.body,y=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(o.clientWidth-p.clientWidth-h);x<=Xn&&(s-=x)}else u<=Xn&&(s+=u);return{width:s,height:a,x:c,y:l}}const Ua=new Set(["absolute","fixed"]);function Ka(e,t){const n=Re(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ce(e)?Le(e):ae(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,u=o*s.y;return{width:a,height:c,x:l,y:u}}function Gn(e,t,n){let o;if(t==="viewport")o=Ha(e,n);else if(t==="document")o=Va(le(e));else if(te(t))o=Ka(t,n);else{const r=Ho(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return pt(o)}function Ko(e,t){const n=ge(e);return n===t||!te(n)||je(n)?!1:ne(n).position==="fixed"||Ko(n,t)}function za(e,t){const n=t.get(e);if(n)return n;let o=Ke(e,[],!1).filter(c=>te(c)&&Be(c)!=="body"),r=null;const s=ne(e).position==="fixed";let a=s?ge(e):e;for(;te(a)&&!je(a);){const c=ne(a),l=hn(a);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&Ua.has(r.position)||qe(a)&&!l&&Ko(e,a))?o=o.filter(f=>f!==a):r=c,a=ge(a)}return t.set(e,o),o}function Ya(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?wt(t)?[]:za(t,this._c):[].concat(n),o],c=a[0],l=a.reduce((u,f)=>{const p=Gn(t,f,r);return u.top=G(p.top,u.top),u.right=ve(p.right,u.right),u.bottom=ve(p.bottom,u.bottom),u.left=G(p.left,u.left),u},Gn(t,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Xa(e){const{width:t,height:n}=Vo(e);return{width:t,height:n}}function Ga(e,t,n){const o=ce(t),r=le(t),s=n==="fixed",a=Re(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=ae(0);function u(){l.x=Ct(r)}if(o||!o&&!s)if((Be(t)!=="body"||qe(r))&&(c=xt(t)),o){const h=Re(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else r&&u();s&&!o&&r&&u();const f=r&&!o&&!s?Uo(r,c):ae(0),p=a.left+c.scrollLeft-l.x-f.x,y=a.top+c.scrollTop-l.y-f.y;return{x:p,y,width:a.width,height:a.height}}function Bt(e){return ne(e).position==="static"}function qn(e,t){if(!ce(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function zo(e,t){const n=q(e);if(wt(e))return n;if(!ce(e)){let r=ge(e);for(;r&&!je(r);){if(te(r)&&!Bt(r))return r;r=ge(r)}return n}let o=qn(e,t);for(;o&&Na(o)&&Bt(o);)o=qn(o,t);return o&&je(o)&&Bt(o)&&!hn(o)?n:o||ka(e)||n}const qa=async function(e){const t=this.getOffsetParent||zo,n=this.getDimensions,o=await n(e.floating);return{reference:Ga(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Za(e){return ne(e).direction==="rtl"}const Qa={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:le,getClippingRect:Ya,getOffsetParent:zo,getElementRects:qa,getClientRects:Ba,getDimensions:Xa,getScale:Le,isElement:te,isRTL:Za};function Yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(e,t){let n=null,o;const r=le(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:p,width:y,height:h}=u;if(c||t(),!y||!h)return;const x=rt(p),d=rt(r.clientWidth-(f+y)),m=rt(r.clientHeight-(p+h)),w=rt(f),C={rootMargin:-x+"px "+-d+"px "+-m+"px "+-w+"px",threshold:G(0,ve(1,l))||1};let b=!0;function E(R){const S=R[0].intersectionRatio;if(S!==l){if(!b)return a();S?a(!1,S):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!Yo(u,e.getBoundingClientRect())&&a(),b=!1}try{n=new IntersectionObserver(E,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,C)}n.observe(e)}return a(!0),s}function ec(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=gn(e),f=r||s?[...u?Ke(u):[],...Ke(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=u&&c?Ja(u,n):null;let y=-1,h=null;a&&(h=new ResizeObserver(w=>{let[g]=w;g&&g.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let x,d=l?Re(e):null;l&&m();function m(){const w=Re(e);d&&!Yo(d,w)&&n(),d=w,x=requestAnimationFrame(m)}return n(),()=>{var w;f.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),p?.(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const tc=Ta,nc=Ra,oc=ba,rc=Aa,sc=Ea,Zn=Ca,ic=Pa,ac=(e,t,n)=>{const o=new Map,r={platform:Qa,...n},s={...r.platform,_c:o};return xa(e,t,{...r,platform:s})};var cc=typeof document<"u",lc=function(){},ct=cc?i.useLayoutEffect:lc;function mt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!mt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!mt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Xo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qn(e,t){const n=Xo(e);return Math.round(t*n)/n}function Vt(e){const t=i.useRef(e);return ct(()=>{t.current=e}),t}function uc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,p]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,h]=i.useState(o);mt(y,o)||h(o);const[x,d]=i.useState(null),[m,w]=i.useState(null),g=i.useCallback(P=>{P!==R.current&&(R.current=P,d(P))},[]),C=i.useCallback(P=>{P!==S.current&&(S.current=P,w(P))},[]),b=s||x,E=a||m,R=i.useRef(null),S=i.useRef(null),O=i.useRef(f),M=l!=null,L=Vt(l),k=Vt(r),$=Vt(u),F=i.useCallback(()=>{if(!R.current||!S.current)return;const P={placement:t,strategy:n,middleware:y};k.current&&(P.platform=k.current),ac(R.current,S.current,P).then(W=>{const Y={...W,isPositioned:$.current!==!1};T.current&&!mt(O.current,Y)&&(O.current=Y,Ye.flushSync(()=>{p(Y)}))})},[y,t,n,k,$]);ct(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[u]);const T=i.useRef(!1);ct(()=>(T.current=!0,()=>{T.current=!1}),[]),ct(()=>{if(b&&(R.current=b),E&&(S.current=E),b&&E){if(L.current)return L.current(b,E,F);F()}},[b,E,F,L,M]);const j=i.useMemo(()=>({reference:R,floating:S,setReference:g,setFloating:C}),[g,C]),I=i.useMemo(()=>({reference:b,floating:E}),[b,E]),_=i.useMemo(()=>{const P={position:n,left:0,top:0};if(!I.floating)return P;const W=Qn(I.floating,f.x),Y=Qn(I.floating,f.y);return c?{...P,transform:"translate("+W+"px, "+Y+"px)",...Xo(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:Y}},[n,c,I.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:F,refs:j,elements:I,floatingStyles:_}),[f,F,j,I,_])}const dc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Zn({element:o.current,padding:r}).fn(n):{}:o?Zn({element:o,padding:r}).fn(n):{}}}},fc=(e,t)=>({...tc(e),options:[e,t]}),pc=(e,t)=>({...nc(e),options:[e,t]}),mc=(e,t)=>({...ic(e),options:[e,t]}),hc=(e,t)=>({...oc(e),options:[e,t]}),vc=(e,t)=>({...rc(e),options:[e,t]}),gc=(e,t)=>({...sc(e),options:[e,t]}),yc=(e,t)=>({...dc(e),options:[e,t]});var wc="Arrow",Go=i.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return v.jsx(D.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Go.displayName=wc;var xc=Go,yn="Popper",[qo,bt]=Oe(yn),[Cc,Zo]=qo(yn),Qo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=i.useState(null);return v.jsx(Cc,{scope:t,anchor:o,onAnchorChange:r,children:n})};Qo.displayName=yn;var Jo="PopperAnchor",er=i.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Zo(Jo,n),a=i.useRef(null),c=B(t,a),l=i.useRef(null);return i.useEffect(()=>{const u=l.current;l.current=o?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),o?null:v.jsx(D.div,{...r,ref:c})});er.displayName=Jo;var wn="PopperContent",[bc,Ec]=qo(wn),tr=i.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:y=!1,updatePositionStrategy:h="optimized",onPlaced:x,...d}=e,m=Zo(wn,n),[w,g]=i.useState(null),C=B(t,A=>g(A)),[b,E]=i.useState(null),R=so(b),S=R?.width??0,O=R?.height??0,M=o+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],$=k.length>0,F={padding:L,boundary:k.filter(Tc),altBoundary:$},{refs:T,floatingStyles:j,placement:I,isPositioned:_,middlewareData:P}=uc({strategy:"fixed",placement:M,whileElementsMounted:(...A)=>ec(...A,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[fc({mainAxis:r+O,alignmentAxis:a}),l&&pc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?mc():void 0,...F}),l&&hc({...F}),vc({...F,apply:({elements:A,rects:U,availableWidth:X,availableHeight:V})=>{const{width:H,height:K}=U.reference,Z=A.floating.style;Z.setProperty("--radix-popper-available-width",`${X}px`),Z.setProperty("--radix-popper-available-height",`${V}px`),Z.setProperty("--radix-popper-anchor-width",`${H}px`),Z.setProperty("--radix-popper-anchor-height",`${K}px`)}}),b&&yc({element:b,padding:c}),Rc({arrowWidth:S,arrowHeight:O}),y&&gc({strategy:"referenceHidden",...F})]}),[W,Y]=rr(I),ue=ee(x);z(()=>{_&&ue?.()},[_,ue]);const de=P.arrow?.x,re=P.arrow?.y,Q=P.arrow?.centerOffset!==0,[Ie,Ce]=i.useState();return z(()=>{w&&Ce(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:_?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(bc,{scope:n,placedSide:W,onArrowChange:E,arrowX:de,arrowY:re,shouldHideArrow:Q,children:v.jsx(D.div,{"data-side":W,"data-align":Y,...d,ref:C,style:{...d.style,animation:_?void 0:"none"}})})})});tr.displayName=wn;var nr="PopperArrow",Sc={top:"bottom",right:"left",bottom:"top",left:"right"},or=i.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Ec(nr,o),a=Sc[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(xc,{...r,ref:n,style:{...r.style,display:"block"}})})});or.displayName=nr;function Tc(e){return e!==null}var Rc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=rr(n),p={start:"0%",center:"50%",end:"100%"}[f],y=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+l/2;let x="",d="";return u==="bottom"?(x=a?p:`${y}px`,d=`${-l}px`):u==="top"?(x=a?p:`${y}px`,d=`${o.floating.height+l}px`):u==="right"?(x=`${-l}px`,d=a?p:`${h}px`):u==="left"&&(x=`${o.floating.width+l}px`,d=a?p:`${h}px`),{data:{x,y:d}}}});function rr(e){const[t,n="center"]=e.split("-");return[t,n]}var sr=Qo,ir=er,ar=tr,cr=or;function Pc(e){const t=Ac(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Ic);if(l){const u=l.props.children,f=c.map(p=>p===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:p);return v.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return v.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Ac(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=_c(r),c=Nc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?$e(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function Ic(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Nc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function _c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Dc="VisuallyHidden",Et=i.forwardRef((e,t)=>v.jsx(D.span,{...e,ref:t,style:{...lr,...e.style}}));Et.displayName=Dc;var Mc=Et,Lc=[" ","Enter","ArrowUp","ArrowDown"],kc=[" ","Enter"],Pe="Select",[St,Tt,jc]=eo(Pe),[Ve]=Oe(Pe,[jc,bt]),Rt=bt(),[Fc,we]=Ve(Pe),[$c,Wc]=Ve(Pe),ur=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:p,disabled:y,required:h,form:x}=e,d=Rt(t),[m,w]=i.useState(null),[g,C]=i.useState(null),[b,E]=i.useState(!1),R=_s(u),[S,O]=ke({prop:o,defaultProp:r??!1,onChange:s,caller:Pe}),[M,L]=ke({prop:a,defaultProp:c,onChange:l,caller:Pe}),k=i.useRef(null),$=m?x||!!m.closest("form"):!0,[F,T]=i.useState(new Set),j=Array.from(F).map(I=>I.props.value).join(";");return v.jsx(sr,{...d,children:v.jsxs(Fc,{required:h,scope:t,trigger:m,onTriggerChange:w,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:b,onValueNodeHasChildrenChange:E,contentId:Se(),value:M,onValueChange:L,open:S,onOpenChange:O,dir:R,triggerPointerDownPosRef:k,disabled:y,children:[v.jsx(St.Provider,{scope:t,children:v.jsx($c,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(I=>{T(_=>new Set(_).add(I))},[]),onNativeOptionRemove:i.useCallback(I=>{T(_=>{const P=new Set(_);return P.delete(I),P})},[]),children:n})}),$?v.jsxs(Mr,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:M,onChange:I=>L(I.target.value),disabled:y,form:x,children:[M===void 0?v.jsx("option",{value:""}):null,Array.from(F)]},j):null]})})};ur.displayName=Pe;var dr="SelectTrigger",fr=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=Rt(n),a=we(dr,n),c=a.disabled||o,l=B(t,a.onTriggerChange),u=Tt(n),f=i.useRef("touch"),[p,y,h]=kr(d=>{const m=u().filter(C=>!C.disabled),w=m.find(C=>C.value===a.value),g=jr(m,d,w);g!==void 0&&a.onValueChange(g.value)}),x=d=>{c||(a.onOpenChange(!0),h()),d&&(a.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return v.jsx(ir,{asChild:!0,...s,children:v.jsx(D.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Lr(a.value)?"":void 0,...r,ref:l,onClick:N(r.onClick,d=>{d.currentTarget.focus(),f.current!=="mouse"&&x(d)}),onPointerDown:N(r.onPointerDown,d=>{f.current=d.pointerType;const m=d.target;m.hasPointerCapture(d.pointerId)&&m.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(x(d),d.preventDefault())}),onKeyDown:N(r.onKeyDown,d=>{const m=p.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&y(d.key),!(m&&d.key===" ")&&Lc.includes(d.key)&&(x(),d.preventDefault())})})})});fr.displayName=dr;var pr="SelectValue",mr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...c}=e,l=we(pr,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,p=B(t,l.onValueNodeChange);return z(()=>{u(f)},[u,f]),v.jsx(D.span,{...c,ref:p,style:{pointerEvents:"none"},children:Lr(l.value)?v.jsx(v.Fragment,{children:a}):s})});mr.displayName=pr;var Bc="SelectIcon",hr=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return v.jsx(D.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});hr.displayName=Bc;var Vc="SelectPortal",vr=e=>v.jsx(Ge,{asChild:!0,...e});vr.displayName=Vc;var Ae="SelectContent",gr=i.forwardRef((e,t)=>{const n=we(Ae,e.__scopeSelect),[o,r]=i.useState();if(z(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Ye.createPortal(v.jsx(yr,{scope:e.__scopeSelect,children:v.jsx(St.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),s):null}return v.jsx(wr,{...e,ref:t})});gr.displayName=Ae;var J=10,[yr,xe]=Ve(Ae),Hc="SelectContentImpl",Uc=Pc("SelectContent.RemoveScroll"),wr=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:y,collisionPadding:h,sticky:x,hideWhenDetached:d,avoidCollisions:m,...w}=e,g=we(Ae,n),[C,b]=i.useState(null),[E,R]=i.useState(null),S=B(t,A=>b(A)),[O,M]=i.useState(null),[L,k]=i.useState(null),$=Tt(n),[F,T]=i.useState(!1),j=i.useRef(!1);i.useEffect(()=>{if(C)return Co(C)},[C]),fo();const I=i.useCallback(A=>{const[U,...X]=$().map(K=>K.ref.current),[V]=X.slice(-1),H=document.activeElement;for(const K of A)if(K===H||(K?.scrollIntoView({block:"nearest"}),K===U&&E&&(E.scrollTop=0),K===V&&E&&(E.scrollTop=E.scrollHeight),K?.focus(),document.activeElement!==H))return},[$,E]),_=i.useCallback(()=>I([O,C]),[I,O,C]);i.useEffect(()=>{F&&_()},[F,_]);const{onOpenChange:P,triggerPointerDownPosRef:W}=g;i.useEffect(()=>{if(C){let A={x:0,y:0};const U=V=>{A={x:Math.abs(Math.round(V.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(W.current?.y??0))}},X=V=>{A.x<=10&&A.y<=10?V.preventDefault():C.contains(V.target)||P(!1),document.removeEventListener("pointermove",U),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",X,{capture:!0})}}},[C,P,W]),i.useEffect(()=>{const A=()=>P(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[P]);const[Y,ue]=kr(A=>{const U=$().filter(H=>!H.disabled),X=U.find(H=>H.ref.current===document.activeElement),V=jr(U,A,X);V&&setTimeout(()=>V.ref.current.focus())}),de=i.useCallback((A,U,X)=>{const V=!j.current&&!X;(g.value!==void 0&&g.value===U||V)&&(M(A),V&&(j.current=!0))},[g.value]),re=i.useCallback(()=>C?.focus(),[C]),Q=i.useCallback((A,U,X)=>{const V=!j.current&&!X;(g.value!==void 0&&g.value===U||V)&&k(A)},[g.value]),Ie=o==="popper"?Gt:xr,Ce=Ie===Gt?{side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:y,collisionPadding:h,sticky:x,hideWhenDetached:d,avoidCollisions:m}:{};return v.jsx(yr,{scope:n,content:C,viewport:E,onViewportChange:R,itemRefCallback:de,selectedItem:O,onItemLeave:re,itemTextRefCallback:Q,focusSelectedItem:_,selectedItemText:L,position:o,isPositioned:F,searchRef:Y,children:v.jsx(cn,{as:Uc,allowPinchZoom:!0,children:v.jsx(an,{asChild:!0,trapped:g.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:N(r,A=>{g.trigger?.focus({preventScroll:!0}),A.preventDefault()}),children:v.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:v.jsx(Ie,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:A=>A.preventDefault(),...w,...Ce,onPlaced:()=>T(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:N(w.onKeyDown,A=>{const U=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!U&&A.key.length===1&&ue(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let V=$().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(A.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const H=A.target,K=V.indexOf(H);V=V.slice(K+1)}setTimeout(()=>I(V)),A.preventDefault()}})})})})})})});wr.displayName=Hc;var Kc="SelectItemAlignedPosition",xr=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=we(Ae,n),a=xe(Ae,n),[c,l]=i.useState(null),[u,f]=i.useState(null),p=B(t,S=>f(S)),y=Tt(n),h=i.useRef(!1),x=i.useRef(!0),{viewport:d,selectedItem:m,selectedItemText:w,focusSelectedItem:g}=a,C=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&d&&m&&w){const S=s.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=w.getBoundingClientRect();if(s.dir!=="rtl"){const H=L.left-O.left,K=M.left-H,Z=S.left-K,be=S.width+Z,Nt=Math.max(be,O.width),_t=window.innerWidth-J,Dt=On(K,[J,Math.max(J,_t-Nt)]);c.style.minWidth=be+"px",c.style.left=Dt+"px"}else{const H=O.right-L.right,K=window.innerWidth-M.right-H,Z=window.innerWidth-S.right-K,be=S.width+Z,Nt=Math.max(be,O.width),_t=window.innerWidth-J,Dt=On(K,[J,Math.max(J,_t-Nt)]);c.style.minWidth=be+"px",c.style.right=Dt+"px"}const k=y(),$=window.innerHeight-J*2,F=d.scrollHeight,T=window.getComputedStyle(u),j=parseInt(T.borderTopWidth,10),I=parseInt(T.paddingTop,10),_=parseInt(T.borderBottomWidth,10),P=parseInt(T.paddingBottom,10),W=j+I+F+P+_,Y=Math.min(m.offsetHeight*5,W),ue=window.getComputedStyle(d),de=parseInt(ue.paddingTop,10),re=parseInt(ue.paddingBottom,10),Q=S.top+S.height/2-J,Ie=$-Q,Ce=m.offsetHeight/2,A=m.offsetTop+Ce,U=j+I+A,X=W-U;if(U<=Q){const H=k.length>0&&m===k[k.length-1].ref.current;c.style.bottom="0px";const K=u.clientHeight-d.offsetTop-d.offsetHeight,Z=Math.max(Ie,Ce+(H?re:0)+K+_),be=U+Z;c.style.height=be+"px"}else{const H=k.length>0&&m===k[0].ref.current;c.style.top="0px";const Z=Math.max(Q,j+d.offsetTop+(H?de:0)+Ce)+X;c.style.height=Z+"px",d.scrollTop=U-Q+d.offsetTop}c.style.margin=`${J}px 0`,c.style.minHeight=Y+"px",c.style.maxHeight=$+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[y,s.trigger,s.valueNode,c,u,d,m,w,s.dir,o]);z(()=>C(),[C]);const[b,E]=i.useState();z(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const R=i.useCallback(S=>{S&&x.current===!0&&(C(),g?.(),x.current=!1)},[C,g]);return v.jsx(Yc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:v.jsx(D.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});xr.displayName=Kc;var zc="SelectPopperPosition",Gt=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=J,...s}=e,a=Rt(n);return v.jsx(ar,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gt.displayName=zc;var[Yc,xn]=Ve(Ae,{}),qt="SelectViewport",Cr=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=xe(qt,n),a=xn(qt,n),c=B(t,s.onViewportChange),l=i.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),v.jsx(St.Slot,{scope:n,children:v.jsx(D.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:N(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=a;if(y?.current&&p){const h=Math.abs(l.current-f.scrollTop);if(h>0){const x=window.innerHeight-J*2,d=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),w=Math.max(d,m);if(w0?b:0,p.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Cr.displayName=qt;var br="SelectGroup",[Xc,Gc]=Ve(br),qc=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Se();return v.jsx(Xc,{scope:n,id:r,children:v.jsx(D.div,{role:"group","aria-labelledby":r,...o,ref:t})})});qc.displayName=br;var Er="SelectLabel",Sr=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Gc(Er,n);return v.jsx(D.div,{id:r.id,...o,ref:t})});Sr.displayName=Er;var ht="SelectItem",[Zc,Tr]=Ve(ht),Rr=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,c=we(ht,n),l=xe(ht,n),u=c.value===o,[f,p]=i.useState(s??""),[y,h]=i.useState(!1),x=B(t,g=>l.itemRefCallback?.(g,o,r)),d=Se(),m=i.useRef("touch"),w=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Zc,{scope:n,value:o,disabled:r,textId:d,isSelected:u,onItemTextChange:i.useCallback(g=>{p(C=>C||(g?.textContent??"").trim())},[]),children:v.jsx(St.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:v.jsx(D.div,{role:"option","aria-labelledby":d,"data-highlighted":y?"":void 0,"aria-selected":u&&y,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:x,onFocus:N(a.onFocus,()=>h(!0)),onBlur:N(a.onBlur,()=>h(!1)),onClick:N(a.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:N(a.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:N(a.onPointerDown,g=>{m.current=g.pointerType}),onPointerMove:N(a.onPointerMove,g=>{m.current=g.pointerType,r?l.onItemLeave?.():m.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(a.onPointerLeave,g=>{g.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:N(a.onKeyDown,g=>{l.searchRef?.current!==""&&g.key===" "||(kc.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});Rr.displayName=ht;var He="SelectItemText",Pr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=we(He,n),c=xe(He,n),l=Tr(He,n),u=Wc(He,n),[f,p]=i.useState(null),y=B(t,w=>p(w),l.onItemTextChange,w=>c.itemTextRefCallback?.(w,l.value,l.disabled)),h=f?.textContent,x=i.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:d,onNativeOptionRemove:m}=u;return z(()=>(d(x),()=>m(x)),[d,m,x]),v.jsxs(v.Fragment,{children:[v.jsx(D.span,{id:l.textId,...s,ref:y}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ye.createPortal(s.children,a.valueNode):null]})});Pr.displayName=He;var Ar="SelectItemIndicator",Or=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Tr(Ar,n).isSelected?v.jsx(D.span,{"aria-hidden":!0,...o,ref:t}):null});Or.displayName=Ar;var Zt="SelectScrollUpButton",Ir=i.forwardRef((e,t)=>{const n=xe(Zt,e.__scopeSelect),o=xn(Zt,e.__scopeSelect),[r,s]=i.useState(!1),a=B(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?v.jsx(_r,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ir.displayName=Zt;var Qt="SelectScrollDownButton",Nr=i.forwardRef((e,t)=>{const n=xe(Qt,e.__scopeSelect),o=xn(Qt,e.__scopeSelect),[r,s]=i.useState(!1),a=B(t,o.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?v.jsx(_r,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Nr.displayName=Qt;var _r=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=xe("SelectScrollButton",n),a=i.useRef(null),c=Tt(n),l=i.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),z(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),v.jsx(D.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:N(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:N(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:N(r.onPointerLeave,()=>{l()})})}),Qc="SelectSeparator",Dr=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return v.jsx(D.div,{"aria-hidden":!0,...o,ref:t})});Dr.displayName=Qc;var Jt="SelectArrow",Jc=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Rt(n),s=we(Jt,n),a=xe(Jt,n);return s.open&&a.position==="popper"?v.jsx(cr,{...r,...o,ref:t}):null});Jc.displayName=Jt;var el="SelectBubbleInput",Mr=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),s=B(o,r),a=ro(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(p)}},[a,t]),v.jsx(D.select,{...n,style:{...lr,...n.style},ref:s,defaultValue:t})});Mr.displayName=el;function Lr(e){return e===""||e===void 0}function kr(e){const t=ee(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(a=>{const c=n.current+a;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function jr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=tl(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function tl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var nu=ur,ou=fr,ru=mr,su=hr,iu=vr,au=gr,cu=Cr,lu=Sr,uu=Rr,du=Pr,fu=Or,pu=Ir,mu=Nr,hu=Dr,Pt="Checkbox",[nl]=Oe(Pt),[ol,Cn]=nl(Pt);function rl(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:c,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:p}=e,[y,h]=ke({prop:n,defaultProp:r??!1,onChange:l,caller:Pt}),[x,d]=i.useState(null),[m,w]=i.useState(null),g=i.useRef(!1),C=x?!!a||!!x.closest("form"):!0,b={checked:y,disabled:s,setChecked:h,control:x,setControl:d,name:c,form:a,value:f,hasConsumerStoppedPropagationRef:g,required:u,defaultChecked:he(r)?!1:r,isFormControl:C,bubbleInput:m,setBubbleInput:w};return v.jsx(ol,{scope:t,...b,children:al(p)?p(b):o})}var Fr="CheckboxTrigger",$r=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:c,checked:l,required:u,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:y,isFormControl:h,bubbleInput:x}=Cn(Fr,e),d=B(r,f),m=i.useRef(l);return i.useEffect(()=>{const w=s?.form;if(w){const g=()=>p(m.current);return w.addEventListener("reset",g),()=>w.removeEventListener("reset",g)}},[s,p]),v.jsx(D.button,{type:"button",role:"checkbox","aria-checked":he(l)?"mixed":l,"aria-required":u,"data-state":Hr(l),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:d,onKeyDown:N(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:N(n,w=>{p(g=>he(g)?!0:!g),x&&h&&(y.current=w.isPropagationStopped(),y.current||w.stopPropagation())})})});$r.displayName=Fr;var sl=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l,onCheckedChange:u,form:f,...p}=e;return v.jsx(rl,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:a,onCheckedChange:u,name:o,form:f,value:l,internal_do_not_use_render:({isFormControl:y})=>v.jsxs(v.Fragment,{children:[v.jsx($r,{...p,ref:t,__scopeCheckbox:n}),y&&v.jsx(Vr,{__scopeCheckbox:n})]})})});sl.displayName=Pt;var Wr="CheckboxIndicator",il=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Cn(Wr,n);return v.jsx(ye,{present:o||he(s.checked)||s.checked===!0,children:v.jsx(D.span,{"data-state":Hr(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});il.displayName=Wr;var Br="CheckboxBubbleInput",Vr=i.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:c,disabled:l,name:u,value:f,form:p,bubbleInput:y,setBubbleInput:h}=Cn(Br,e),x=B(n,h),d=ro(s),m=so(o);i.useEffect(()=>{const g=y;if(!g)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,R=!r.current;if(d!==s&&E){const S=new Event("click",{bubbles:R});g.indeterminate=he(s),E.call(g,he(s)?!1:s),g.dispatchEvent(S)}},[y,d,s,r]);const w=i.useRef(he(s)?!1:s);return v.jsx(D.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:c,disabled:l,name:u,value:f,form:p,...t,tabIndex:-1,ref:x,style:{...t.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Vr.displayName=Br;function al(e){return typeof e=="function"}function he(e){return e==="indeterminate"}function Hr(e){return he(e)?"indeterminate":e?"checked":"unchecked"}var cl=Symbol("radix.slottable");function ll(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=cl,t}var[At]=Oe("Tooltip",[bt]),Ot=bt(),Ur="TooltipProvider",ul=700,en="tooltip.open",[dl,bn]=At(Ur),Kr=e=>{const{__scopeTooltip:t,delayDuration:n=ul,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,a=i.useRef(!0),c=i.useRef(!1),l=i.useRef(0);return i.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),v.jsx(dl,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:i.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};Kr.displayName=Ur;var ze="Tooltip",[fl,Ze]=At(ze),zr=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,l=bn(ze,e.__scopeTooltip),u=Ot(t),[f,p]=i.useState(null),y=Se(),h=i.useRef(0),x=a??l.disableHoverableContent,d=c??l.delayDuration,m=i.useRef(!1),[w,g]=ke({prop:o,defaultProp:r??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(en))):l.onClose(),s?.(S)},caller:ze}),C=i.useMemo(()=>w?m.current?"delayed-open":"instant-open":"closed",[w]),b=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m.current=!1,g(!0)},[g]),E=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),R=i.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{m.current=!0,g(!0),h.current=0},d)},[d,g]);return i.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),v.jsx(sr,{...u,children:v.jsx(fl,{scope:t,contentId:y,open:w,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{l.isOpenDelayedRef.current?R():b()},[l.isOpenDelayedRef,R,b]),onTriggerLeave:i.useCallback(()=>{x?E():(window.clearTimeout(h.current),h.current=0)},[E,x]),onOpen:b,onClose:E,disableHoverableContent:x,children:n})})};zr.displayName=ze;var tn="TooltipTrigger",Yr=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ze(tn,n),s=bn(tn,n),a=Ot(n),c=i.useRef(null),l=B(t,c,r.onTriggerChange),u=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),v.jsx(ir,{asChild:!0,...a,children:v.jsx(D.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:N(e.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:N(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:N(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:N(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:N(e.onBlur,r.onClose),onClick:N(e.onClick,r.onClose)})})});Yr.displayName=tn;var En="TooltipPortal",[pl,ml]=At(En,{forceMount:void 0}),Xr=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=Ze(En,t);return v.jsx(pl,{scope:t,forceMount:n,children:v.jsx(ye,{present:n||s.open,children:v.jsx(Ge,{asChild:!0,container:r,children:o})})})};Xr.displayName=En;var Fe="TooltipContent",Gr=i.forwardRef((e,t)=>{const n=ml(Fe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=Ze(Fe,e.__scopeTooltip);return v.jsx(ye,{present:o||a.open,children:a.disableHoverableContent?v.jsx(qr,{side:r,...s,ref:t}):v.jsx(hl,{side:r,...s,ref:t})})}),hl=i.forwardRef((e,t)=>{const n=Ze(Fe,e.__scopeTooltip),o=bn(Fe,e.__scopeTooltip),r=i.useRef(null),s=B(t,r),[a,c]=i.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:p}=o,y=i.useCallback(()=>{c(null),p(!1)},[p]),h=i.useCallback((x,d)=>{const m=x.currentTarget,w={x:x.clientX,y:x.clientY},g=xl(w,m.getBoundingClientRect()),C=Cl(w,g),b=bl(d.getBoundingClientRect()),E=Sl([...C,...b]);c(E),p(!0)},[p]);return i.useEffect(()=>()=>y(),[y]),i.useEffect(()=>{if(l&&f){const x=m=>h(m,f),d=m=>h(m,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",d),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",d)}}},[l,f,h,y]),i.useEffect(()=>{if(a){const x=d=>{const m=d.target,w={x:d.clientX,y:d.clientY},g=l?.contains(m)||f?.contains(m),C=!El(w,a);g?y():C&&(y(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,a,u,y]),v.jsx(qr,{...e,ref:s})}),[vl,gl]=At(ze,{isInside:!1}),yl=ll("TooltipContent"),qr=i.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,l=Ze(Fe,n),u=Ot(n),{onClose:f}=l;return i.useEffect(()=>(document.addEventListener(en,f),()=>document.removeEventListener(en,f)),[f]),i.useEffect(()=>{if(l.trigger){const p=y=>{y.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,f]),v.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:v.jsxs(ar,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(yl,{children:o}),v.jsx(vl,{scope:n,isInside:!0,children:v.jsx(Mc,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Gr.displayName=Fe;var Zr="TooltipArrow",wl=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ot(n);return gl(Zr,n).isInside?null:v.jsx(cr,{...r,...o,ref:t})});wl.displayName=Zr;function xl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Cl(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function bl(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function El(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;so!=y>o&&n<(p-u)*(o-f)/(y-f)+u&&(r=!r)}return r}function Sl(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Tl(t)}function Tl(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vu=Kr,gu=zr,yu=Yr,wu=Xr,xu=Gr,Sn="ToastProvider",[Tn,Rl,Pl]=eo("Toast"),[Qr]=Oe("Toast",[Pl]),[Al,It]=Qr(Sn),Jr=e=>{const{__scopeToast:t,label:n="Notification",duration:o=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:a}=e,[c,l]=i.useState(null),[u,f]=i.useState(0),p=i.useRef(!1),y=i.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Sn}\`. Expected non-empty \`string\`.`),v.jsx(Tn.Provider,{scope:t,children:v.jsx(Al,{scope:t,label:n,duration:o,swipeDirection:r,swipeThreshold:s,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:i.useCallback(()=>f(h=>h+1),[]),onToastRemove:i.useCallback(()=>f(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:y,children:a})})};Jr.displayName=Sn;var es="ToastViewport",Ol=["F8"],nn="toast.viewportPause",on="toast.viewportResume",ts=i.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=Ol,label:r="Notifications ({hotkey})",...s}=e,a=It(es,n),c=Rl(n),l=i.useRef(null),u=i.useRef(null),f=i.useRef(null),p=i.useRef(null),y=B(t,p,a.onViewportChange),h=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=a.toastCount>0;i.useEffect(()=>{const m=w=>{o.length!==0&&o.every(C=>w[C]||w.code===C)&&p.current?.focus()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]),i.useEffect(()=>{const m=l.current,w=p.current;if(x&&m&&w){const g=()=>{if(!a.isClosePausedRef.current){const R=new CustomEvent(nn);w.dispatchEvent(R),a.isClosePausedRef.current=!0}},C=()=>{if(a.isClosePausedRef.current){const R=new CustomEvent(on);w.dispatchEvent(R),a.isClosePausedRef.current=!1}},b=R=>{!m.contains(R.relatedTarget)&&C()},E=()=>{m.contains(document.activeElement)||C()};return m.addEventListener("focusin",g),m.addEventListener("focusout",b),m.addEventListener("pointermove",g),m.addEventListener("pointerleave",E),window.addEventListener("blur",g),window.addEventListener("focus",C),()=>{m.removeEventListener("focusin",g),m.removeEventListener("focusout",b),m.removeEventListener("pointermove",g),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",g),window.removeEventListener("focus",C)}}},[x,a.isClosePausedRef]);const d=i.useCallback(({tabbingDirection:m})=>{const g=c().map(C=>{const b=C.ref.current,E=[b,...Vl(b)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?g.reverse():g).flat()},[c]);return i.useEffect(()=>{const m=p.current;if(m){const w=g=>{const C=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!C){const E=document.activeElement,R=g.shiftKey;if(g.target===m&&R){u.current?.focus();return}const M=d({tabbingDirection:R?"backwards":"forwards"}),L=M.findIndex(k=>k===E);Ht(M.slice(L+1))?g.preventDefault():R?u.current?.focus():f.current?.focus()}};return m.addEventListener("keydown",w),()=>m.removeEventListener("keydown",w)}},[c,d]),v.jsxs(ei,{ref:l,role:"region","aria-label":r.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&v.jsx(rn,{ref:u,onFocusFromOutsideViewport:()=>{const m=d({tabbingDirection:"forwards"});Ht(m)}}),v.jsx(Tn.Slot,{scope:n,children:v.jsx(D.ol,{tabIndex:-1,...s,ref:y})}),x&&v.jsx(rn,{ref:f,onFocusFromOutsideViewport:()=>{const m=d({tabbingDirection:"backwards"});Ht(m)}})]})});ts.displayName=es;var ns="ToastFocusProxy",rn=i.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,s=It(ns,n);return v.jsx(Et,{tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:a=>{const c=a.relatedTarget;!s.viewport?.contains(c)&&o()}})});rn.displayName=ns;var Qe="Toast",Il="toast.swipeStart",Nl="toast.swipeMove",_l="toast.swipeCancel",Dl="toast.swipeEnd",os=i.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:s,...a}=e,[c,l]=ke({prop:o,defaultProp:r??!0,onChange:s,caller:Qe});return v.jsx(ye,{present:n||c,children:v.jsx(kl,{open:c,...a,ref:t,onClose:()=>l(!1),onPause:ee(e.onPause),onResume:ee(e.onResume),onSwipeStart:N(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:N(e.onSwipeMove,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:N(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:N(e.onSwipeEnd,u=>{const{x:f,y:p}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),l(!1)})})})});os.displayName=Qe;var[Ml,Ll]=Qr(Qe,{onClose(){}}),kl=i.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:s,onClose:a,onEscapeKeyDown:c,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:y,onSwipeEnd:h,...x}=e,d=It(Qe,n),[m,w]=i.useState(null),g=B(t,T=>w(T)),C=i.useRef(null),b=i.useRef(null),E=r||d.duration,R=i.useRef(0),S=i.useRef(E),O=i.useRef(0),{onToastAdd:M,onToastRemove:L}=d,k=ee(()=>{m?.contains(document.activeElement)&&d.viewport?.focus(),a()}),$=i.useCallback(T=>{!T||T===1/0||(window.clearTimeout(O.current),R.current=new Date().getTime(),O.current=window.setTimeout(k,T))},[k]);i.useEffect(()=>{const T=d.viewport;if(T){const j=()=>{$(S.current),u?.()},I=()=>{const _=new Date().getTime()-R.current;S.current=S.current-_,window.clearTimeout(O.current),l?.()};return T.addEventListener(nn,I),T.addEventListener(on,j),()=>{T.removeEventListener(nn,I),T.removeEventListener(on,j)}}},[d.viewport,E,l,u,$]),i.useEffect(()=>{s&&!d.isClosePausedRef.current&&$(E)},[s,E,d.isClosePausedRef,$]),i.useEffect(()=>(M(),()=>L()),[M,L]);const F=i.useMemo(()=>m?us(m):null,[m]);return d.viewport?v.jsxs(v.Fragment,{children:[F&&v.jsx(jl,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:F}),v.jsx(Ml,{scope:n,onClose:k,children:Ye.createPortal(v.jsx(Tn.ItemSlot,{scope:n,children:v.jsx(Js,{asChild:!0,onEscapeKeyDown:N(c,()=>{d.isFocusedToastEscapeKeyDownRef.current||k(),d.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(D.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":d.swipeDirection,...x,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:N(e.onKeyDown,T=>{T.key==="Escape"&&(c?.(T.nativeEvent),T.nativeEvent.defaultPrevented||(d.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:N(e.onPointerDown,T=>{T.button===0&&(C.current={x:T.clientX,y:T.clientY})}),onPointerMove:N(e.onPointerMove,T=>{if(!C.current)return;const j=T.clientX-C.current.x,I=T.clientY-C.current.y,_=!!b.current,P=["left","right"].includes(d.swipeDirection),W=["left","up"].includes(d.swipeDirection)?Math.min:Math.max,Y=P?W(0,j):0,ue=P?0:W(0,I),de=T.pointerType==="touch"?10:2,re={x:Y,y:ue},Q={originalEvent:T,delta:re};_?(b.current=re,st(Nl,p,Q,{discrete:!1})):Jn(re,d.swipeDirection,de)?(b.current=re,st(Il,f,Q,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(j)>de||Math.abs(I)>de)&&(C.current=null)}),onPointerUp:N(e.onPointerUp,T=>{const j=b.current,I=T.target;if(I.hasPointerCapture(T.pointerId)&&I.releasePointerCapture(T.pointerId),b.current=null,C.current=null,j){const _=T.currentTarget,P={originalEvent:T,delta:j};Jn(j,d.swipeDirection,d.swipeThreshold)?st(Dl,h,P,{discrete:!0}):st(_l,y,P,{discrete:!0}),_.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),d.viewport)})]}):null}),jl=e=>{const{__scopeToast:t,children:n,...o}=e,r=It(Qe,t),[s,a]=i.useState(!1),[c,l]=i.useState(!1);return Wl(()=>a(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:v.jsx(Ge,{asChild:!0,children:v.jsx(Et,{...o,children:s&&v.jsxs(v.Fragment,{children:[r.label," ",n]})})})},Fl="ToastTitle",rs=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return v.jsx(D.div,{...o,ref:t})});rs.displayName=Fl;var $l="ToastDescription",ss=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return v.jsx(D.div,{...o,ref:t})});ss.displayName=$l;var is="ToastAction",as=i.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?v.jsx(ls,{altText:n,asChild:!0,children:v.jsx(Rn,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${is}\`. Expected non-empty \`string\`.`),null)});as.displayName=is;var cs="ToastClose",Rn=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=Ll(cs,n);return v.jsx(ls,{asChild:!0,children:v.jsx(D.button,{type:"button",...o,ref:t,onClick:N(e.onClick,r.onClose)})})});Rn.displayName=cs;var ls=i.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return v.jsx(D.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function us(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),Bl(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",s=o.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const a=o.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...us(o))}}),t}function st(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?to(r,s):r.dispatchEvent(s)}var Jn=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),s=o>r;return t==="left"||t==="right"?s&&o>n:!s&&r>n};function Wl(e=()=>{}){const t=ee(e);z(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function Bl(e){return e.nodeType===e.ELEMENT_NODE}function Vl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ht(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Cu=Jr,bu=ts,Eu=os,Su=rs,Tu=ss,Ru=as,Pu=Rn;export{sl as $,sr as A,ir as B,Ql as C,eu as D,cr as E,an as F,Kl as G,ou as H,su as I,pu as J,mu as K,iu as L,au as M,lu as N,Zl as O,D as P,uu as Q,Xl as R,Ul as S,Jl as T,fu as U,cu as V,Yl as W,du as X,hu as Y,nu as Z,ru as _,eo as a,il as a0,wu as a1,xu as a2,vu as a3,gu as a4,yu as a5,bu as a6,Eu as a7,Ru as a8,Pu as a9,Su as aa,Tu as ab,Cu as ac,N as b,Oe as c,B as d,_s as e,ke as f,ee as g,ye as h,z as i,On as j,oo as k,ro as l,so as m,zl as n,ql as o,tu as p,Gl as q,$e as r,Ge as s,bt as t,Se as u,Co as v,cn as w,fo as x,Xe as y,ar as z}; diff --git a/webui/dist/assets/radix-extra-BM7iD6Dt.js b/webui/dist/assets/radix-extra-BM7iD6Dt.js new file mode 100644 index 00000000..1f95f7b8 --- /dev/null +++ b/webui/dist/assets/radix-extra-BM7iD6Dt.js @@ -0,0 +1,12 @@ +import{r as i,j as u,d as Po}from"./router-CWhjJi2n.js";import{c as k,a as ke,u as re,P as A,b as P,d as T,e as ne,f as G,g as F,h as V,i as Z,j as be,k as Se,l as Ve,m as Be,n as He,O as Co,o as Ro,W as Ao,C as yo,T as Eo,D as _o,p as ze,R as To,q as Do,r as Io,s as No,t as Ke,v as jo,w as Oo,x as Mo,F as Lo,y as Fo,z as $o,A as ko,B as We,E as Vo}from"./radix-core-C3XKqQJw.js";var pe="rovingFocusGroup.onEntryFocus",Bo={bubbles:!1,cancelable:!0},J="RovingFocusGroup",[ve,Ue,Ho]=ke(J),[zo,Ge]=k(J,[Ho]),[Ko,Wo]=zo(J),Ye=i.forwardRef((e,t)=>u.jsx(ve.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(ve.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Uo,{...e,ref:t})})}));Ye.displayName=J;var Uo=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,orientation:n,loop:r=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,v=i.useRef(null),m=T(t,v),g=ne(a),[S,h]=G({prop:s,defaultProp:c??null,onChange:l,caller:J}),[b,C]=i.useState(!1),x=F(d),w=Ue(o),D=i.useRef(!1),[j,O]=i.useState(0);return i.useEffect(()=>{const E=v.current;if(E)return E.addEventListener(pe,x),()=>E.removeEventListener(pe,x)},[x]),u.jsx(Ko,{scope:o,orientation:n,dir:g,loop:r,currentTabStopId:S,onItemFocus:i.useCallback(E=>h(E),[h]),onItemShiftTab:i.useCallback(()=>C(!0),[]),onFocusableItemAdd:i.useCallback(()=>O(E=>E+1),[]),onFocusableItemRemove:i.useCallback(()=>O(E=>E-1),[]),children:u.jsx(A.div,{tabIndex:b||j===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:P(e.onMouseDown,()=>{D.current=!0}),onFocus:P(e.onFocus,E=>{const y=!D.current;if(E.target===E.currentTarget&&y&&!b){const _=new CustomEvent(pe,Bo);if(E.currentTarget.dispatchEvent(_),!_.defaultPrevented){const R=w().filter(I=>I.focusable),M=R.find(I=>I.active),X=R.find(I=>I.id===S),q=[M,X,...R].filter(Boolean).map(I=>I.ref.current);Ze(q,f)}}D.current=!1}),onBlur:P(e.onBlur,()=>C(!1))})})}),Xe="RovingFocusGroupItem",qe=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,focusable:n=!0,active:r=!1,tabStopId:a,children:s,...c}=e,l=re(),d=a||l,f=Wo(Xe,o),p=f.currentTabStopId===d,v=Ue(o),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:S}=f;return i.useEffect(()=>{if(n)return m(),()=>g()},[n,m,g]),u.jsx(ve.ItemSlot,{scope:o,id:d,focusable:n,active:r,children:u.jsx(A.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:P(e.onMouseDown,h=>{n?f.onItemFocus(d):h.preventDefault()}),onFocus:P(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:P(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const b=Xo(h,f.orientation,f.dir);if(b!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let x=v().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(h.currentTarget);x=f.loop?qo(x,w+1):x.slice(w+1)}setTimeout(()=>Ze(x))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:S!=null}):s})})});qe.displayName=Xe;var Go={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yo(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Xo(e,t,o){const n=Yo(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Go[n]}function Ze(e,t=!1){const o=document.activeElement;for(const n of e)if(n===o||(n.focus({preventScroll:t}),document.activeElement!==o))return}function qo(e,t){return e.map((o,n)=>e[(t+n)%e.length])}var Zo=Ye,Jo=qe,ae="Tabs",[Qo]=k(ae,[Ge]),Je=Ge(),[er,xe]=Qo(ae),Qe=i.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,onValueChange:r,defaultValue:a,orientation:s="horizontal",dir:c,activationMode:l="automatic",...d}=e,f=ne(c),[p,v]=G({prop:n,onChange:r,defaultProp:a??"",caller:ae});return u.jsx(er,{scope:o,baseId:re(),value:p,onValueChange:v,orientation:s,dir:f,activationMode:l,children:u.jsx(A.div,{dir:f,"data-orientation":s,...d,ref:t})})});Qe.displayName=ae;var et="TabsList",tt=i.forwardRef((e,t)=>{const{__scopeTabs:o,loop:n=!0,...r}=e,a=xe(et,o),s=Je(o);return u.jsx(Zo,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:n,children:u.jsx(A.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});tt.displayName=et;var ot="TabsTrigger",rt=i.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,disabled:r=!1,...a}=e,s=xe(ot,o),c=Je(o),l=st(s.baseId,n),d=it(s.baseId,n),f=n===s.value;return u.jsx(Jo,{asChild:!0,...c,focusable:!r,active:f,children:u.jsx(A.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...a,ref:t,onMouseDown:P(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:P(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:P(e.onFocus,()=>{const p=s.activationMode!=="manual";!f&&!r&&p&&s.onValueChange(n)})})})});rt.displayName=ot;var nt="TabsContent",at=i.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,forceMount:r,children:a,...s}=e,c=xe(nt,o),l=st(c.baseId,n),d=it(c.baseId,n),f=n===c.value,p=i.useRef(f);return i.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),u.jsx(V,{present:r||f,children:({present:v})=>u.jsx(A.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!v,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});at.displayName=nt;function st(e,t){return`${e}-trigger-${t}`}function it(e,t){return`${e}-content-${t}`}var Fn=Qe,$n=tt,kn=rt,Vn=at;function tr(e,t){return i.useReducer((o,n)=>t[o][n]??o,e)}var we="ScrollArea",[ct]=k(we),[or,N]=ct(we),lt=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,type:n="hover",dir:r,scrollHideDelay:a=600,...s}=e,[c,l]=i.useState(null),[d,f]=i.useState(null),[p,v]=i.useState(null),[m,g]=i.useState(null),[S,h]=i.useState(null),[b,C]=i.useState(0),[x,w]=i.useState(0),[D,j]=i.useState(!1),[O,E]=i.useState(!1),y=T(t,R=>l(R)),_=ne(r);return u.jsx(or,{scope:o,type:n,dir:_,scrollHideDelay:a,scrollArea:c,viewport:d,onViewportChange:f,content:p,onContentChange:v,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:D,onScrollbarXEnabledChange:j,scrollbarY:S,onScrollbarYChange:h,scrollbarYEnabled:O,onScrollbarYEnabledChange:E,onCornerWidthChange:C,onCornerHeightChange:w,children:u.jsx(A.div,{dir:_,...s,ref:y,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});lt.displayName=we;var ut="ScrollAreaViewport",dt=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,children:n,nonce:r,...a}=e,s=N(ut,o),c=i.useRef(null),l=T(t,c,s.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(A.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});dt.displayName=ut;var L="ScrollAreaScrollbar",rr=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=N(L,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=r,c=e.orientation==="horizontal";return i.useEffect(()=>(c?a(!0):s(!0),()=>{c?a(!1):s(!1)}),[c,a,s]),r.type==="hover"?u.jsx(nr,{...n,ref:t,forceMount:o}):r.type==="scroll"?u.jsx(ar,{...n,ref:t,forceMount:o}):r.type==="auto"?u.jsx(ft,{...n,ref:t,forceMount:o}):r.type==="always"?u.jsx(Pe,{...n,ref:t}):null});rr.displayName=L;var nr=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=N(L,e.__scopeScrollArea),[a,s]=i.useState(!1);return i.useEffect(()=>{const c=r.scrollArea;let l=0;if(c){const d=()=>{window.clearTimeout(l),s(!0)},f=()=>{l=window.setTimeout(()=>s(!1),r.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",f)}}},[r.scrollArea,r.scrollHideDelay]),u.jsx(V,{present:o||a,children:u.jsx(ft,{"data-state":a?"visible":"hidden",...n,ref:t})})}),ar=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=N(L,e.__scopeScrollArea),a=e.orientation==="horizontal",s=ie(()=>l("SCROLL_END"),100),[c,l]=tr("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,r.scrollHideDelay,l]),i.useEffect(()=>{const d=r.viewport,f=a?"scrollLeft":"scrollTop";if(d){let p=d[f];const v=()=>{const m=d[f];p!==m&&(l("SCROLL"),s()),p=m};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[r.viewport,a,l,s]),u.jsx(V,{present:o||c!=="hidden",children:u.jsx(Pe,{"data-state":c==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:P(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:P(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),ft=i.forwardRef((e,t)=>{const o=N(L,e.__scopeScrollArea),{forceMount:n,...r}=e,[a,s]=i.useState(!1),c=e.orientation==="horizontal",l=ie(()=>{if(o.viewport){const d=o.viewport.offsetWidth{const{orientation:o="vertical",...n}=e,r=N(L,e.__scopeScrollArea),a=i.useRef(null),s=i.useRef(0),[c,l]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ht(c.viewport,c.content),f={...n,sizes:c,onSizesChange:l,hasThumb:d>0&&d<1,onThumbChange:v=>a.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function p(v,m){return fr(v,s.current,c,m)}return o==="horizontal"?u.jsx(sr,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&a.current){const v=r.viewport.scrollLeft,m=Oe(v,c,r.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollLeft=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollLeft=p(v,r.dir))}}):o==="vertical"?u.jsx(ir,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&a.current){const v=r.viewport.scrollTop,m=Oe(v,c);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollTop=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollTop=p(v))}}):null}),sr=i.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,a=N(L,e.__scopeScrollArea),[s,c]=i.useState(),l=i.useRef(null),d=T(t,l,a.onScrollbarXChange);return i.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),u.jsx(vt,{"data-orientation":"horizontal",...r,ref:d,sizes:o,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":se(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,p)=>{if(a.viewport){const v=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(v),bt(v,p)&&f.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:te(s.paddingLeft),paddingEnd:te(s.paddingRight)}})}})}),ir=i.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,a=N(L,e.__scopeScrollArea),[s,c]=i.useState(),l=i.useRef(null),d=T(t,l,a.onScrollbarYChange);return i.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),u.jsx(vt,{"data-orientation":"vertical",...r,ref:d,sizes:o,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":se(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,p)=>{if(a.viewport){const v=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(v),bt(v,p)&&f.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:te(s.paddingTop),paddingEnd:te(s.paddingBottom)}})}})}),[cr,pt]=ct(L),vt=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:f,onResize:p,...v}=e,m=N(L,o),[g,S]=i.useState(null),h=T(t,y=>S(y)),b=i.useRef(null),C=i.useRef(""),x=m.viewport,w=n.content-n.viewport,D=F(f),j=F(l),O=ie(p,10);function E(y){if(b.current){const _=y.clientX-b.current.left,R=y.clientY-b.current.top;d({x:_,y:R})}}return i.useEffect(()=>{const y=_=>{const R=_.target;g?.contains(R)&&D(_,w)};return document.addEventListener("wheel",y,{passive:!1}),()=>document.removeEventListener("wheel",y,{passive:!1})},[x,g,w,D]),i.useEffect(j,[n,j]),W(g,O),W(m.content,O),u.jsx(cr,{scope:o,scrollbar:g,hasThumb:r,onThumbChange:F(a),onThumbPointerUp:F(s),onThumbPositionChange:j,onThumbPointerDown:F(c),children:u.jsx(A.div,{...v,ref:h,style:{position:"absolute",...v.style},onPointerDown:P(e.onPointerDown,y=>{y.button===0&&(y.target.setPointerCapture(y.pointerId),b.current=g.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(y))}),onPointerMove:P(e.onPointerMove,E),onPointerUp:P(e.onPointerUp,y=>{const _=y.target;_.hasPointerCapture(y.pointerId)&&_.releasePointerCapture(y.pointerId),document.body.style.webkitUserSelect=C.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),ee="ScrollAreaThumb",lr=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=pt(ee,e.__scopeScrollArea);return u.jsx(V,{present:o||r.hasThumb,children:u.jsx(ur,{ref:t,...n})})}),ur=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,style:n,...r}=e,a=N(ee,o),s=pt(ee,o),{onThumbPositionChange:c}=s,l=T(t,p=>s.onThumbChange(p)),d=i.useRef(void 0),f=ie(()=>{d.current&&(d.current(),d.current=void 0)},100);return i.useEffect(()=>{const p=a.viewport;if(p){const v=()=>{if(f(),!d.current){const m=pr(p,c);d.current=m,c()}};return c(),p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[a.viewport,f,c]),u.jsx(A.div,{"data-state":s.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:P(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),g=p.clientX-m.left,S=p.clientY-m.top;s.onThumbPointerDown({x:g,y:S})}),onPointerUp:P(e.onPointerUp,s.onThumbPointerUp)})});lr.displayName=ee;var Ce="ScrollAreaCorner",mt=i.forwardRef((e,t)=>{const o=N(Ce,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&n?u.jsx(dr,{...e,ref:t}):null});mt.displayName=Ce;var dr=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,...n}=e,r=N(Ce,o),[a,s]=i.useState(0),[c,l]=i.useState(0),d=!!(a&&c);return W(r.scrollbarX,()=>{const f=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(f),l(f)}),W(r.scrollbarY,()=>{const f=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(f),s(f)}),d?u.jsx(A.div,{...n,ref:t,style:{width:a,height:c,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function te(e){return e?parseInt(e,10):0}function ht(e,t){const o=e/t;return isNaN(o)?0:o}function se(e){const t=ht(e.viewport,e.content),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-o)*t;return Math.max(n,18)}function fr(e,t,o,n="ltr"){const r=se(o),a=r/2,s=t||a,c=r-s,l=o.scrollbar.paddingStart+s,d=o.scrollbar.size-o.scrollbar.paddingEnd-c,f=o.content-o.viewport,p=n==="ltr"?[0,f]:[f*-1,0];return gt([l,d],p)(e)}function Oe(e,t,o="ltr"){const n=se(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-r,s=t.content-t.viewport,c=a-n,l=o==="ltr"?[0,s]:[s*-1,0],d=be(e,l);return gt([0,s],[0,c])(d)}function gt(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function bt(e,t){return e>0&&e{})=>{let o={left:e.scrollLeft,top:e.scrollTop},n=0;return(function r(){const a={left:e.scrollLeft,top:e.scrollTop},s=o.left!==a.left,c=o.top!==a.top;(s||c)&&t(),o=a,n=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(n)};function ie(e,t){const o=F(e),n=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),i.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)},[o,t])}function W(e,t){const o=F(t);Z(()=>{let n=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(o)});return r.observe(e),()=>{window.cancelAnimationFrame(n),r.unobserve(e)}}},[e,o])}var Bn=lt,Hn=dt,zn=mt;function vr(e,t=[]){let o=[];function n(a,s){const c=i.createContext(s);c.displayName=a+"Context";const l=o.length;o=[...o,s];const d=p=>{const{scope:v,children:m,...g}=p,S=v?.[e]?.[l]||c,h=i.useMemo(()=>g,Object.values(g));return u.jsx(S.Provider,{value:h,children:m})};d.displayName=a+"Provider";function f(p,v){const m=v?.[e]?.[l]||c,g=i.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=o.map(s=>i.createContext(s));return function(c){const l=c?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[n,mr(r,...t)]}function mr(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const s=n.reduce((c,{useScope:l,scopeName:d})=>{const p=l(a)[`__scope${d}`];return{...c,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return o.scopeName=t.scopeName,o}var hr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=hr.reduce((e,t)=>{const o=Se(`Primitive.${t}`),n=i.forwardRef((r,a)=>{const{asChild:s,...c}=r,l=s?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Re="Progress",Ae=100,[gr]=vr(Re),[br,Sr]=gr(Re),xt=i.forwardRef((e,t)=>{const{__scopeProgress:o,value:n=null,max:r,getValueLabel:a=xr,...s}=e;(r||r===0)&&!Me(r)&&console.error(wr(`${r}`,"Progress"));const c=Me(r)?r:Ae;n!==null&&!Le(n,c)&&console.error(Pr(`${n}`,"Progress"));const l=Le(n,c)?n:null,d=oe(l)?a(l,c):void 0;return u.jsx(br,{scope:o,value:l,max:c,children:u.jsx(St.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":oe(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":Ct(l,c),"data-value":l??void 0,"data-max":c,...s,ref:t})})});xt.displayName=Re;var wt="ProgressIndicator",Pt=i.forwardRef((e,t)=>{const{__scopeProgress:o,...n}=e,r=Sr(wt,o);return u.jsx(St.div,{"data-state":Ct(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...n,ref:t})});Pt.displayName=wt;function xr(e,t){return`${Math.round(e/t*100)}%`}function Ct(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function oe(e){return typeof e=="number"}function Me(e){return oe(e)&&!isNaN(e)&&e>0}function Le(e,t){return oe(e)&&!isNaN(e)&&e<=t&&e>=0}function wr(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ae}\`.`}function Pr(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${Ae} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var Kn=xt,Wn=Pt,ce="Switch",[Cr]=k(ce),[Rr,Ar]=Cr(ce),Rt=i.forwardRef((e,t)=>{const{__scopeSwitch:o,name:n,checked:r,defaultChecked:a,required:s,disabled:c,value:l="on",onCheckedChange:d,form:f,...p}=e,[v,m]=i.useState(null),g=T(t,x=>m(x)),S=i.useRef(!1),h=v?f||!!v.closest("form"):!0,[b,C]=G({prop:r,defaultProp:a??!1,onChange:d,caller:ce});return u.jsxs(Rr,{scope:o,checked:b,disabled:c,children:[u.jsx(A.button,{type:"button",role:"switch","aria-checked":b,"aria-required":s,"data-state":_t(b),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:g,onClick:P(e.onClick,x=>{C(w=>!w),h&&(S.current=x.isPropagationStopped(),S.current||x.stopPropagation())})}),h&&u.jsx(Et,{control:v,bubbles:!S.current,name:n,value:l,checked:b,required:s,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Rt.displayName=ce;var At="SwitchThumb",yt=i.forwardRef((e,t)=>{const{__scopeSwitch:o,...n}=e,r=Ar(At,o);return u.jsx(A.span,{"data-state":_t(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});yt.displayName=At;var yr="SwitchBubbleInput",Et=i.forwardRef(({__scopeSwitch:e,control:t,checked:o,bubbles:n=!0,...r},a)=>{const s=i.useRef(null),c=T(s,a),l=Ve(o),d=Be(t);return i.useEffect(()=>{const f=s.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(l!==o&&m){const g=new Event("click",{bubbles:n});m.call(f,o),f.dispatchEvent(g)}},[l,o,n]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:c,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Et.displayName=yr;function _t(e){return e?"checked":"unchecked"}var Un=Rt,Gn=yt,Tt=["PageUp","PageDown"],Dt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],It={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Y="Slider",[me,Er,_r]=ke(Y),[Nt]=k(Y,[_r]),[Tr,le]=Nt(Y),jt=i.forwardRef((e,t)=>{const{name:o,min:n=0,max:r=100,step:a=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:l=0,defaultValue:d=[n],value:f,onValueChange:p=()=>{},onValueCommit:v=()=>{},inverted:m=!1,form:g,...S}=e,h=i.useRef(new Set),b=i.useRef(0),x=s==="horizontal"?Dr:Ir,[w=[],D]=G({prop:f,defaultProp:d,onChange:R=>{[...h.current][b.current]?.focus(),p(R)}}),j=i.useRef(w);function O(R){const M=Lr(w,R);_(R,M)}function E(R){_(R,b.current)}function y(){const R=j.current[b.current];w[b.current]!==R&&v(w)}function _(R,M,{commit:X}={commit:!1}){const fe=Vr(a),q=Br(Math.round((R-n)/a)*a+n,fe),I=be(q,[n,r]);D((z=[])=>{const H=Or(z,I,M);if(kr(H,l*a)){b.current=H.indexOf(I);const je=String(H)!==String(z);return je&&X&&v(H),je?H:z}else return z})}return u.jsx(Tr,{scope:e.__scopeSlider,name:o,disabled:c,min:n,max:r,valueIndexToChangeRef:b,thumbs:h.current,values:w,orientation:s,form:g,children:u.jsx(me.Provider,{scope:e.__scopeSlider,children:u.jsx(me.Slot,{scope:e.__scopeSlider,children:u.jsx(x,{"aria-disabled":c,"data-disabled":c?"":void 0,...S,ref:t,onPointerDown:P(S.onPointerDown,()=>{c||(j.current=w)}),min:n,max:r,inverted:m,onSlideStart:c?void 0:O,onSlideMove:c?void 0:E,onSlideEnd:c?void 0:y,onHomeKeyDown:()=>!c&&_(n,0,{commit:!0}),onEndKeyDown:()=>!c&&_(r,w.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:M})=>{if(!c){const q=Tt.includes(R.key)||R.shiftKey&&Dt.includes(R.key)?10:1,I=b.current,z=w[I],H=a*q*M;_(z+H,I,{commit:!0})}}})})})})});jt.displayName=Y;var[Ot,Mt]=Nt(Y,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Dr=i.forwardRef((e,t)=>{const{min:o,max:n,dir:r,inverted:a,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:d,...f}=e,[p,v]=i.useState(null),m=T(t,x=>v(x)),g=i.useRef(void 0),S=ne(r),h=S==="ltr",b=h&&!a||!h&&a;function C(x){const w=g.current||p.getBoundingClientRect(),D=[0,w.width],O=ye(D,b?[o,n]:[n,o]);return g.current=w,O(x-w.left)}return u.jsx(Ot,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:u.jsx(Lt,{dir:S,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const w=C(x.clientX);s?.(w)},onSlideMove:x=>{const w=C(x.clientX);c?.(w)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:x=>{const D=It[b?"from-left":"from-right"].includes(x.key);d?.({event:x,direction:D?-1:1})}})})}),Ir=i.forwardRef((e,t)=>{const{min:o,max:n,inverted:r,onSlideStart:a,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...d}=e,f=i.useRef(null),p=T(t,f),v=i.useRef(void 0),m=!r;function g(S){const h=v.current||f.current.getBoundingClientRect(),b=[0,h.height],x=ye(b,m?[n,o]:[o,n]);return v.current=h,x(S-h.top)}return u.jsx(Ot,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:u.jsx(Lt,{"data-orientation":"vertical",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const h=g(S.clientY);a?.(h)},onSlideMove:S=>{const h=g(S.clientY);s?.(h)},onSlideEnd:()=>{v.current=void 0,c?.()},onStepKeyDown:S=>{const b=It[m?"from-bottom":"from-top"].includes(S.key);l?.({event:S,direction:b?-1:1})}})})}),Lt=i.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:r,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...d}=e,f=le(Y,o);return u.jsx(A.span,{...d,ref:t,onKeyDown:P(e.onKeyDown,p=>{p.key==="Home"?(s(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):Tt.concat(Dt).includes(p.key)&&(l(p),p.preventDefault())}),onPointerDown:P(e.onPointerDown,p=>{const v=p.target;v.setPointerCapture(p.pointerId),p.preventDefault(),f.thumbs.has(v)?v.focus():n(p)}),onPointerMove:P(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&r(p)}),onPointerUp:P(e.onPointerUp,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&(v.releasePointerCapture(p.pointerId),a(p))})})}),Ft="SliderTrack",$t=i.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=le(Ft,o);return u.jsx(A.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...n,ref:t})});$t.displayName=Ft;var he="SliderRange",kt=i.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=le(he,o),a=Mt(he,o),s=i.useRef(null),c=T(t,s),l=r.values.length,d=r.values.map(v=>Ht(v,r.min,r.max)),f=l>1?Math.min(...d):0,p=100-Math.max(...d);return u.jsx(A.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...n,ref:c,style:{...e.style,[a.startEdge]:f+"%",[a.endEdge]:p+"%"}})});kt.displayName=he;var ge="SliderThumb",Vt=i.forwardRef((e,t)=>{const o=Er(e.__scopeSlider),[n,r]=i.useState(null),a=T(t,c=>r(c)),s=i.useMemo(()=>n?o().findIndex(c=>c.ref.current===n):-1,[o,n]);return u.jsx(Nr,{...e,ref:a,index:s})}),Nr=i.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:r,...a}=e,s=le(ge,o),c=Mt(ge,o),[l,d]=i.useState(null),f=T(t,C=>d(C)),p=l?s.form||!!l.closest("form"):!0,v=Be(l),m=s.values[n],g=m===void 0?0:Ht(m,s.min,s.max),S=Mr(n,s.values.length),h=v?.[c.size],b=h?Fr(h,g,c.direction):0;return i.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${b}px)`},children:[u.jsx(me.ItemSlot,{scope:e.__scopeSlider,children:u.jsx(A.span,{role:"slider","aria-label":e["aria-label"]||S,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:f,style:m===void 0?{display:"none"}:e.style,onFocus:P(e.onFocus,()=>{s.valueIndexToChangeRef.current=n})})}),p&&u.jsx(Bt,{name:r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:m},n)]})});Vt.displayName=ge;var jr="RadioBubbleInput",Bt=i.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const r=i.useRef(null),a=T(r,n),s=Ve(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&f){const p=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(p)}},[s,t]),u.jsx(A.input,{style:{display:"none"},...o,ref:a,defaultValue:t})});Bt.displayName=jr;function Or(e=[],t,o){const n=[...e];return n[o]=t,n.sort((r,a)=>r-a)}function Ht(e,t,o){const a=100/(o-t)*(e-t);return be(a,[0,100])}function Mr(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Lr(e,t){if(e.length===1)return 0;const o=e.map(r=>Math.abs(r-t)),n=Math.min(...o);return o.indexOf(n)}function Fr(e,t,o){const n=e/2,a=ye([0,50],[0,n]);return(n-a(t)*o)*o}function $r(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function kr(e,t){if(t>0){const o=$r(e);return Math.min(...o)>=t}return!0}function ye(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function Vr(e){return(String(e).split(".")[1]||"").length}function Br(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Yn=jt,Xn=$t,qn=kt,Zn=Vt,Hr=Symbol("radix.slottable");function zr(e){const t=({children:o})=>u.jsx(u.Fragment,{children:o});return t.displayName=`${e}.Slottable`,t.__radixId=Hr,t}var zt="AlertDialog",[Kr]=k(zt,[He]),$=He(),Kt=e=>{const{__scopeAlertDialog:t,...o}=e,n=$(t);return u.jsx(To,{...n,...o,modal:!0})};Kt.displayName=zt;var Wr="AlertDialogTrigger",Wt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(Do,{...r,...n,ref:t})});Wt.displayName=Wr;var Ur="AlertDialogPortal",Ut=e=>{const{__scopeAlertDialog:t,...o}=e,n=$(t);return u.jsx(Ro,{...n,...o})};Ut.displayName=Ur;var Gr="AlertDialogOverlay",Gt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(Co,{...r,...n,ref:t})});Gt.displayName=Gr;var K="AlertDialogContent",[Yr,Xr]=Kr(K),qr=zr("AlertDialogContent"),Yt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:n,...r}=e,a=$(o),s=i.useRef(null),c=T(t,s),l=i.useRef(null);return u.jsx(Ao,{contentName:K,titleName:Xt,docsSlug:"alert-dialog",children:u.jsx(Yr,{scope:o,cancelRef:l,children:u.jsxs(yo,{role:"alertdialog",...a,...r,ref:c,onOpenAutoFocus:P(r.onOpenAutoFocus,d=>{d.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[u.jsx(qr,{children:n}),u.jsx(Jr,{contentRef:s})]})})})});Yt.displayName=K;var Xt="AlertDialogTitle",qt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(Eo,{...r,...n,ref:t})});qt.displayName=Xt;var Zt="AlertDialogDescription",Jt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(_o,{...r,...n,ref:t})});Jt.displayName=Zt;var Zr="AlertDialogAction",Qt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(ze,{...r,...n,ref:t})});Qt.displayName=Zr;var eo="AlertDialogCancel",to=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,{cancelRef:r}=Xr(eo,o),a=$(o),s=T(t,r);return u.jsx(ze,{...a,...n,ref:s})});to.displayName=eo;var Jr=({contentRef:e})=>{const t=`\`${K}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${K}\` by passing a \`${Zt}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${K}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Jn=Kt,Qn=Wt,ea=Ut,ta=Gt,oa=Yt,ra=Qt,na=to,aa=qt,sa=Jt,Qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],en=Qr.reduce((e,t)=>{const o=Se(`Primitive.${t}`),n=i.forwardRef((r,a)=>{const{asChild:s,...c}=r,l=s?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),tn="Separator",Fe="horizontal",on=["horizontal","vertical"],oo=i.forwardRef((e,t)=>{const{decorative:o,orientation:n=Fe,...r}=e,a=rn(n)?n:Fe,c=o?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return u.jsx(en.div,{"data-orientation":a,...c,...r,ref:t})});oo.displayName=tn;function rn(e){return on.includes(e)}var ia=oo;function nn(e){const t=an(e),o=i.forwardRef((n,r)=>{const{children:a,...s}=n,c=i.Children.toArray(a),l=c.find(cn);if(l){const d=l.props.children,f=c.map(p=>p===l?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:p);return u.jsx(t,{...s,ref:r,children:i.isValidElement(d)?i.cloneElement(d,void 0,f):null})}return u.jsx(t,{...s,ref:r,children:a})});return o.displayName=`${e}.Slot`,o}function an(e){const t=i.forwardRef((o,n)=>{const{children:r,...a}=o;if(i.isValidElement(r)){const s=un(r),c=ln(a,r.props);return r.type!==i.Fragment&&(c.ref=n?Io(n,s):s),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sn=Symbol("radix.slottable");function cn(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sn}function ln(e,t){const o={...t};for(const n in t){const r=e[n],a=t[n];/^on[A-Z]/.test(n)?r&&a?o[n]=(...c)=>{const l=a(...c);return r(...c),l}:r&&(o[n]=r):n==="style"?o[n]={...r,...a}:n==="className"&&(o[n]=[r,a].filter(Boolean).join(" "))}return{...e,...o}}function un(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var ue="Popover",[ro]=k(ue,[Ke]),Q=Ke(),[dn,B]=ro(ue),no=e=>{const{__scopePopover:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:s=!1}=e,c=Q(t),l=i.useRef(null),[d,f]=i.useState(!1),[p,v]=G({prop:n,defaultProp:r??!1,onChange:a,caller:ue});return u.jsx(ko,{...c,children:u.jsx(dn,{scope:t,contentId:re(),triggerRef:l,open:p,onOpenChange:v,onOpenToggle:i.useCallback(()=>v(m=>!m),[v]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>f(!0),[]),onCustomAnchorRemove:i.useCallback(()=>f(!1),[]),modal:s,children:o})})};no.displayName=ue;var ao="PopoverAnchor",fn=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=B(ao,o),a=Q(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=r;return i.useEffect(()=>(s(),()=>c()),[s,c]),u.jsx(We,{...a,...n,ref:t})});fn.displayName=ao;var so="PopoverTrigger",io=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=B(so,o),a=Q(o),s=T(t,r.triggerRef),c=u.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":po(r.open),...n,ref:s,onClick:P(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:u.jsx(We,{asChild:!0,...a,children:c})});io.displayName=so;var Ee="PopoverPortal",[pn,vn]=ro(Ee,{forceMount:void 0}),co=e=>{const{__scopePopover:t,forceMount:o,children:n,container:r}=e,a=B(Ee,t);return u.jsx(pn,{scope:t,forceMount:o,children:u.jsx(V,{present:o||a.open,children:u.jsx(No,{asChild:!0,container:r,children:n})})})};co.displayName=Ee;var U="PopoverContent",lo=i.forwardRef((e,t)=>{const o=vn(U,e.__scopePopover),{forceMount:n=o.forceMount,...r}=e,a=B(U,e.__scopePopover);return u.jsx(V,{present:n||a.open,children:a.modal?u.jsx(hn,{...r,ref:t}):u.jsx(gn,{...r,ref:t})})});lo.displayName=U;var mn=nn("PopoverContent.RemoveScroll"),hn=i.forwardRef((e,t)=>{const o=B(U,e.__scopePopover),n=i.useRef(null),r=T(t,n),a=i.useRef(!1);return i.useEffect(()=>{const s=n.current;if(s)return jo(s)},[]),u.jsx(Oo,{as:mn,allowPinchZoom:!0,children:u.jsx(uo,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,d=c.button===2||l;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),gn=i.forwardRef((e,t)=>{const o=B(U,e.__scopePopover),n=i.useRef(!1),r=i.useRef(!1);return u.jsx(uo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),uo=i.forwardRef((e,t)=>{const{__scopePopover:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:f,...p}=e,v=B(U,o),m=Q(o);return Mo(),u.jsx(Lo,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:u.jsx(Fo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:u.jsx($o,{"data-state":po(v.open),role:"dialog",id:v.contentId,...m,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),fo="PopoverClose",bn=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=B(fo,o);return u.jsx(A.button,{type:"button",...n,ref:t,onClick:P(e.onClick,()=>r.onOpenChange(!1))})});bn.displayName=fo;var Sn="PopoverArrow",xn=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Q(o);return u.jsx(Vo,{...r,...n,ref:t})});xn.displayName=Sn;function po(e){return e?"open":"closed"}var ca=no,la=io,ua=co,da=lo,de="Collapsible",[wn]=k(de),[Pn,_e]=wn(de),vo=i.forwardRef((e,t)=>{const{__scopeCollapsible:o,open:n,defaultOpen:r,disabled:a,onOpenChange:s,...c}=e,[l,d]=G({prop:n,defaultProp:r??!1,onChange:s,caller:de});return u.jsx(Pn,{scope:o,disabled:a,contentId:re(),open:l,onOpenToggle:i.useCallback(()=>d(f=>!f),[d]),children:u.jsx(A.div,{"data-state":De(l),"data-disabled":a?"":void 0,...c,ref:t})})});vo.displayName=de;var mo="CollapsibleTrigger",Cn=i.forwardRef((e,t)=>{const{__scopeCollapsible:o,...n}=e,r=_e(mo,o);return u.jsx(A.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":De(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...n,ref:t,onClick:P(e.onClick,r.onOpenToggle)})});Cn.displayName=mo;var Te="CollapsibleContent",Rn=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=_e(Te,e.__scopeCollapsible);return u.jsx(V,{present:o||r.open,children:({present:a})=>u.jsx(An,{...n,ref:t,present:a})})});Rn.displayName=Te;var An=i.forwardRef((e,t)=>{const{__scopeCollapsible:o,present:n,children:r,...a}=e,s=_e(Te,o),[c,l]=i.useState(n),d=i.useRef(null),f=T(t,d),p=i.useRef(0),v=p.current,m=i.useRef(0),g=m.current,S=s.open||c,h=i.useRef(S),b=i.useRef(void 0);return i.useEffect(()=>{const C=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(C)},[]),Z(()=>{const C=d.current;if(C){b.current=b.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const x=C.getBoundingClientRect();p.current=x.height,m.current=x.width,h.current||(C.style.transitionDuration=b.current.transitionDuration,C.style.animationName=b.current.animationName),l(n)}},[s.open,n]),u.jsx(A.div,{"data-state":De(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!S,...a,ref:f,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:S&&r})});function De(e){return e?"open":"closed"}var fa=vo;function yn(e,t=[]){let o=[];function n(a,s){const c=i.createContext(s);c.displayName=a+"Context";const l=o.length;o=[...o,s];const d=p=>{const{scope:v,children:m,...g}=p,S=v?.[e]?.[l]||c,h=i.useMemo(()=>g,Object.values(g));return u.jsx(S.Provider,{value:h,children:m})};d.displayName=a+"Provider";function f(p,v){const m=v?.[e]?.[l]||c,g=i.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=o.map(s=>i.createContext(s));return function(c){const l=c?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[n,En(r,...t)]}function En(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const s=n.reduce((c,{useScope:l,scopeName:d})=>{const p=l(a)[`__scope${d}`];return{...c,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return o.scopeName=t.scopeName,o}var _n=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=_n.reduce((e,t)=>{const o=Se(`Primitive.${t}`),n=i.forwardRef((r,a)=>{const{asChild:s,...c}=r,l=s?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Tn=Po();function Dn(){return Tn.useSyncExternalStore(In,()=>!0,()=>!1)}function In(){return()=>{}}var Ne="Avatar",[Nn]=yn(Ne),[jn,ho]=Nn(Ne),go=i.forwardRef((e,t)=>{const{__scopeAvatar:o,...n}=e,[r,a]=i.useState("idle");return u.jsx(jn,{scope:o,imageLoadingStatus:r,onImageLoadingStatusChange:a,children:u.jsx(Ie.span,{...n,ref:t})})});go.displayName=Ne;var bo="AvatarImage",So=i.forwardRef((e,t)=>{const{__scopeAvatar:o,src:n,onLoadingStatusChange:r=()=>{},...a}=e,s=ho(bo,o),c=On(n,a),l=F(d=>{r(d),s.onImageLoadingStatusChange(d)});return Z(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?u.jsx(Ie.img,{...a,ref:t,src:n}):null});So.displayName=bo;var xo="AvatarFallback",wo=i.forwardRef((e,t)=>{const{__scopeAvatar:o,delayMs:n,...r}=e,a=ho(xo,o),[s,c]=i.useState(n===void 0);return i.useEffect(()=>{if(n!==void 0){const l=window.setTimeout(()=>c(!0),n);return()=>window.clearTimeout(l)}},[n]),s&&a.imageLoadingStatus!=="loaded"?u.jsx(Ie.span,{...r,ref:t}):null});wo.displayName=xo;function $e(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function On(e,{referrerPolicy:t,crossOrigin:o}){const n=Dn(),r=i.useRef(null),a=n?(r.current||(r.current=new window.Image),r.current):null,[s,c]=i.useState(()=>$e(a,e));return Z(()=>{c($e(a,e))},[a,e]),Z(()=>{const l=p=>()=>{c(p)};if(!a)return;const d=l("loaded"),f=l("error");return a.addEventListener("load",d),a.addEventListener("error",f),t&&(a.referrerPolicy=t),typeof o=="string"&&(a.crossOrigin=o),()=>{a.removeEventListener("load",d),a.removeEventListener("error",f)}},[a,o,t]),s}var pa=go,va=So,ma=wo;export{ra as A,Vn as C,sa as D,ma as F,Wn as I,$n as L,ta as O,ea as P,Fn as R,rr as S,kn as T,Hn as V,Bn as a,zn as b,lr as c,Kn as d,Un as e,Gn as f,Yn as g,Xn as h,qn as i,Zn as j,oa as k,aa as l,na as m,Jn as n,Qn as o,ia as p,ua as q,da as r,ca as s,la as t,fa as u,Cn as v,Rn as w,pa as x,va as y}; diff --git a/webui/dist/assets/radix-extra-Cw1azsjZ.js b/webui/dist/assets/radix-extra-Cw1azsjZ.js deleted file mode 100644 index d86d108d..00000000 --- a/webui/dist/assets/radix-extra-Cw1azsjZ.js +++ /dev/null @@ -1,12 +0,0 @@ -import{r as a,j as l,d as nr}from"./router-CWhjJi2n.js";import{c as G,a as Ge,u as ne,P as _,b as g,d as A,e as pe,f as Q,g as k,h as B,i as ue,j as Ue,k as He,l as _t,m as Et,n as yt,O as rr,o as ar,W as sr,C as ir,T as cr,D as lr,p as Mt,R as ur,q as dr,r as We,s as At,t as _e,v as Tt,w as It,x as Nt,F as Dt,y as Ot,z as jt,A as ze,B as Ye,E as Lt,G as fr}from"./radix-core-BlBHu_Lw.js";var Fe="rovingFocusGroup.onEntryFocus",pr={bubbles:!1,cancelable:!0},ve="RovingFocusGroup",[$e,Ft,vr]=Ge(ve),[mr,Ee]=G(ve,[vr]),[hr,gr]=mr(ve),$t=a.forwardRef((e,t)=>l.jsx($e.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx($e.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(xr,{...e,ref:t})})}));$t.displayName=ve;var xr=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,orientation:n,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...d}=e,v=a.useRef(null),m=A(t,v),h=pe(s),[C,x]=Q({prop:i,defaultProp:c??null,onChange:u,caller:ve}),[S,R]=a.useState(!1),w=k(p),P=Ft(o),I=a.useRef(!1),[j,N]=a.useState(0);return a.useEffect(()=>{const T=v.current;if(T)return T.addEventListener(Fe,w),()=>T.removeEventListener(Fe,w)},[w]),l.jsx(hr,{scope:o,orientation:n,dir:h,loop:r,currentTabStopId:C,onItemFocus:a.useCallback(T=>x(T),[x]),onItemShiftTab:a.useCallback(()=>R(!0),[]),onFocusableItemAdd:a.useCallback(()=>N(T=>T+1),[]),onFocusableItemRemove:a.useCallback(()=>N(T=>T-1),[]),children:l.jsx(_.div,{tabIndex:S||j===0?-1:0,"data-orientation":n,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:g(e.onMouseDown,()=>{I.current=!0}),onFocus:g(e.onFocus,T=>{const E=!I.current;if(T.target===T.currentTarget&&E&&!S){const M=new CustomEvent(Fe,pr);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const y=P().filter(O=>O.focusable),L=y.find(O=>O.active),W=y.find(O=>O.id===C),Z=[L,W,...y].filter(Boolean).map(O=>O.ref.current);Bt(Z,f)}}I.current=!1}),onBlur:g(e.onBlur,()=>R(!1))})})}),kt="RovingFocusGroupItem",Vt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,focusable:n=!0,active:r=!1,tabStopId:s,children:i,...c}=e,u=ne(),p=s||u,f=gr(kt,o),d=f.currentTabStopId===p,v=Ft(o),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:C}=f;return a.useEffect(()=>{if(n)return m(),()=>h()},[n,m,h]),l.jsx($e.ItemSlot,{scope:o,id:p,focusable:n,active:r,children:l.jsx(_.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:g(e.onMouseDown,x=>{n?f.onItemFocus(p):x.preventDefault()}),onFocus:g(e.onFocus,()=>f.onItemFocus(p)),onKeyDown:g(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=br(x,f.orientation,f.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=v().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const P=w.indexOf(x.currentTarget);w=f.loop?wr(w,P+1):w.slice(P+1)}setTimeout(()=>Bt(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:C!=null}):i})})});Vt.displayName=kt;var Sr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function br(e,t,o){const n=Cr(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Sr[n]}function Bt(e,t=!1){const o=document.activeElement;for(const n of e)if(n===o||(n.focus({preventScroll:t}),document.activeElement!==o))return}function wr(e,t){return e.map((o,n)=>e[(t+n)%e.length])}var Kt=$t,Gt=Vt,ye="Tabs",[Pr]=G(ye,[Ee]),Ut=Ee(),[Rr,Xe]=Pr(ye),Ht=a.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:u="automatic",...p}=e,f=pe(c),[d,v]=Q({prop:n,onChange:r,defaultProp:s??"",caller:ye});return l.jsx(Rr,{scope:o,baseId:ne(),value:d,onValueChange:v,orientation:i,dir:f,activationMode:u,children:l.jsx(_.div,{dir:f,"data-orientation":i,...p,ref:t})})});Ht.displayName=ye;var Wt="TabsList",zt=a.forwardRef((e,t)=>{const{__scopeTabs:o,loop:n=!0,...r}=e,s=Xe(Wt,o),i=Ut(o);return l.jsx(Kt,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:l.jsx(_.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});zt.displayName=Wt;var Yt="TabsTrigger",Xt=a.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,disabled:r=!1,...s}=e,i=Xe(Yt,o),c=Ut(o),u=Jt(i.baseId,n),p=Qt(i.baseId,n),f=n===i.value;return l.jsx(Gt,{asChild:!0,...c,focusable:!r,active:f,children:l.jsx(_.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...s,ref:t,onMouseDown:g(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:g(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:g(e.onFocus,()=>{const d=i.activationMode!=="manual";!f&&!r&&d&&i.onValueChange(n)})})})});Xt.displayName=Yt;var qt="TabsContent",Zt=a.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,forceMount:r,children:s,...i}=e,c=Xe(qt,o),u=Jt(c.baseId,n),p=Qt(c.baseId,n),f=n===c.value,d=a.useRef(f);return a.useEffect(()=>{const v=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(B,{present:r||f,children:({present:v})=>l.jsx(_.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:p,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:v&&s})})});Zt.displayName=qt;function Jt(e,t){return`${e}-trigger-${t}`}function Qt(e,t){return`${e}-content-${t}`}var xi=Ht,Si=zt,Ci=Xt,bi=Zt;function _r(e,t){return a.useReducer((o,n)=>t[o][n]??o,e)}var qe="ScrollArea",[eo]=G(qe),[Er,K]=eo(qe),to=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,type:n="hover",dir:r,scrollHideDelay:s=600,...i}=e,[c,u]=a.useState(null),[p,f]=a.useState(null),[d,v]=a.useState(null),[m,h]=a.useState(null),[C,x]=a.useState(null),[S,R]=a.useState(0),[w,P]=a.useState(0),[I,j]=a.useState(!1),[N,T]=a.useState(!1),E=A(t,y=>u(y)),M=pe(r);return l.jsx(Er,{scope:o,type:n,dir:M,scrollHideDelay:s,scrollArea:c,viewport:p,onViewportChange:f,content:d,onContentChange:v,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:I,onScrollbarXEnabledChange:j,scrollbarY:C,onScrollbarYChange:x,scrollbarYEnabled:N,onScrollbarYEnabledChange:T,onCornerWidthChange:R,onCornerHeightChange:P,children:l.jsx(_.div,{dir:M,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});to.displayName=qe;var oo="ScrollAreaViewport",no=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,children:n,nonce:r,...s}=e,i=K(oo,o),c=a.useRef(null),u=A(t,c,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(_.div,{"data-radix-scroll-area-viewport":"",...s,ref:u,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});no.displayName=oo;var U="ScrollAreaScrollbar",yr=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=K(U,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,c=e.orientation==="horizontal";return a.useEffect(()=>(c?s(!0):i(!0),()=>{c?s(!1):i(!1)}),[c,s,i]),r.type==="hover"?l.jsx(Mr,{...n,ref:t,forceMount:o}):r.type==="scroll"?l.jsx(Ar,{...n,ref:t,forceMount:o}):r.type==="auto"?l.jsx(ro,{...n,ref:t,forceMount:o}):r.type==="always"?l.jsx(Ze,{...n,ref:t}):null});yr.displayName=U;var Mr=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=K(U,e.__scopeScrollArea),[s,i]=a.useState(!1);return a.useEffect(()=>{const c=r.scrollArea;let u=0;if(c){const p=()=>{window.clearTimeout(u),i(!0)},f=()=>{u=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return c.addEventListener("pointerenter",p),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",p),c.removeEventListener("pointerleave",f)}}},[r.scrollArea,r.scrollHideDelay]),l.jsx(B,{present:o||s,children:l.jsx(ro,{"data-state":s?"visible":"hidden",...n,ref:t})})}),Ar=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=K(U,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Ae(()=>u("SCROLL_END"),100),[c,u]=_r("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>u("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,r.scrollHideDelay,u]),a.useEffect(()=>{const p=r.viewport,f=s?"scrollLeft":"scrollTop";if(p){let d=p[f];const v=()=>{const m=p[f];d!==m&&(u("SCROLL"),i()),d=m};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[r.viewport,s,u,i]),l.jsx(B,{present:o||c!=="hidden",children:l.jsx(Ze,{"data-state":c==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:g(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:g(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),ro=a.forwardRef((e,t)=>{const o=K(U,e.__scopeScrollArea),{forceMount:n,...r}=e,[s,i]=a.useState(!1),c=e.orientation==="horizontal",u=Ae(()=>{if(o.viewport){const p=o.viewport.offsetWidth{const{orientation:o="vertical",...n}=e,r=K(U,e.__scopeScrollArea),s=a.useRef(null),i=a.useRef(0),[c,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=co(c.viewport,c.content),f={...n,sizes:c,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function d(v,m){return Lr(v,i.current,c,m)}return o==="horizontal"?l.jsx(Tr,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const v=r.viewport.scrollLeft,m=St(v,c,r.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollLeft=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollLeft=d(v,r.dir))}}):o==="vertical"?l.jsx(Ir,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const v=r.viewport.scrollTop,m=St(v,c);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollTop=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollTop=d(v))}}):null}),Tr=a.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,s=K(U,e.__scopeScrollArea),[i,c]=a.useState(),u=a.useRef(null),p=A(t,u,s.onScrollbarXChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(so,{"data-orientation":"horizontal",...r,ref:p,sizes:o,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Me(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(s.viewport){const v=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(v),uo(v,d)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:be(i.paddingLeft),paddingEnd:be(i.paddingRight)}})}})}),Ir=a.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,s=K(U,e.__scopeScrollArea),[i,c]=a.useState(),u=a.useRef(null),p=A(t,u,s.onScrollbarYChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(so,{"data-orientation":"vertical",...r,ref:p,sizes:o,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Me(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(s.viewport){const v=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(v),uo(v,d)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:be(i.paddingTop),paddingEnd:be(i.paddingBottom)}})}})}),[Nr,ao]=eo(U),so=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,sizes:n,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:f,onResize:d,...v}=e,m=K(U,o),[h,C]=a.useState(null),x=A(t,E=>C(E)),S=a.useRef(null),R=a.useRef(""),w=m.viewport,P=n.content-n.viewport,I=k(f),j=k(u),N=Ae(d,10);function T(E){if(S.current){const M=E.clientX-S.current.left,y=E.clientY-S.current.top;p({x:M,y})}}return a.useEffect(()=>{const E=M=>{const y=M.target;h?.contains(y)&&I(M,P)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[w,h,P,I]),a.useEffect(j,[n,j]),re(h,N),re(m.content,N),l.jsx(Nr,{scope:o,scrollbar:h,hasThumb:r,onThumbChange:k(s),onThumbPointerUp:k(i),onThumbPositionChange:j,onThumbPointerDown:k(c),children:l.jsx(_.div,{...v,ref:x,style:{position:"absolute",...v.style},onPointerDown:g(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),S.current=h.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),T(E))}),onPointerMove:g(e.onPointerMove,T),onPointerUp:g(e.onPointerUp,E=>{const M=E.target;M.hasPointerCapture(E.pointerId)&&M.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=R.current,m.viewport&&(m.viewport.style.scrollBehavior=""),S.current=null})})})}),Ce="ScrollAreaThumb",Dr=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=ao(Ce,e.__scopeScrollArea);return l.jsx(B,{present:o||r.hasThumb,children:l.jsx(Or,{ref:t,...n})})}),Or=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,style:n,...r}=e,s=K(Ce,o),i=ao(Ce,o),{onThumbPositionChange:c}=i,u=A(t,d=>i.onThumbChange(d)),p=a.useRef(void 0),f=Ae(()=>{p.current&&(p.current(),p.current=void 0)},100);return a.useEffect(()=>{const d=s.viewport;if(d){const v=()=>{if(f(),!p.current){const m=Fr(d,c);p.current=m,c()}};return c(),d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[s.viewport,f,c]),l.jsx(_.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:g(e.onPointerDownCapture,d=>{const m=d.target.getBoundingClientRect(),h=d.clientX-m.left,C=d.clientY-m.top;i.onThumbPointerDown({x:h,y:C})}),onPointerUp:g(e.onPointerUp,i.onThumbPointerUp)})});Dr.displayName=Ce;var Je="ScrollAreaCorner",io=a.forwardRef((e,t)=>{const o=K(Je,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&n?l.jsx(jr,{...e,ref:t}):null});io.displayName=Je;var jr=a.forwardRef((e,t)=>{const{__scopeScrollArea:o,...n}=e,r=K(Je,o),[s,i]=a.useState(0),[c,u]=a.useState(0),p=!!(s&&c);return re(r.scrollbarX,()=>{const f=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(f),u(f)}),re(r.scrollbarY,()=>{const f=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(f),i(f)}),p?l.jsx(_.div,{...n,ref:t,style:{width:s,height:c,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function be(e){return e?parseInt(e,10):0}function co(e,t){const o=e/t;return isNaN(o)?0:o}function Me(e){const t=co(e.viewport,e.content),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-o)*t;return Math.max(n,18)}function Lr(e,t,o,n="ltr"){const r=Me(o),s=r/2,i=t||s,c=r-i,u=o.scrollbar.paddingStart+i,p=o.scrollbar.size-o.scrollbar.paddingEnd-c,f=o.content-o.viewport,d=n==="ltr"?[0,f]:[f*-1,0];return lo([u,p],d)(e)}function St(e,t,o="ltr"){const n=Me(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-r,i=t.content-t.viewport,c=s-n,u=o==="ltr"?[0,i]:[i*-1,0],p=Ue(e,u);return lo([0,i],[0,c])(p)}function lo(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function uo(e,t){return e>0&&e{})=>{let o={left:e.scrollLeft,top:e.scrollTop},n=0;return(function r(){const s={left:e.scrollLeft,top:e.scrollTop},i=o.left!==s.left,c=o.top!==s.top;(i||c)&&t(),o=s,n=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(n)};function Ae(e,t){const o=k(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)},[o,t])}function re(e,t){const o=k(t);ue(()=>{let n=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(o)});return r.observe(e),()=>{window.cancelAnimationFrame(n),r.unobserve(e)}}},[e,o])}var wi=to,Pi=no,Ri=io;function $r(e,t=[]){let o=[];function n(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=o.length;o=[...o,i];const p=d=>{const{scope:v,children:m,...h}=d,C=v?.[e]?.[u]||c,x=a.useMemo(()=>h,Object.values(h));return l.jsx(C.Provider,{value:x,children:m})};p.displayName=s+"Provider";function f(d,v){const m=v?.[e]?.[u]||c,h=a.useContext(m);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[p,f]}const r=()=>{const s=o.map(i=>a.createContext(i));return function(c){const u=c?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[n,kr(r,...t)]}function kr(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=n.reduce((c,{useScope:u,scopeName:p})=>{const d=u(s)[`__scope${p}`];return{...c,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}var Vr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fo=Vr.reduce((e,t)=>{const o=He(`Primitive.${t}`),n=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Qe="Progress",et=100,[Br]=$r(Qe),[Kr,Gr]=Br(Qe),po=a.forwardRef((e,t)=>{const{__scopeProgress:o,value:n=null,max:r,getValueLabel:s=Ur,...i}=e;(r||r===0)&&!Ct(r)&&console.error(Hr(`${r}`,"Progress"));const c=Ct(r)?r:et;n!==null&&!bt(n,c)&&console.error(Wr(`${n}`,"Progress"));const u=bt(n,c)?n:null,p=we(u)?s(u,c):void 0;return l.jsx(Kr,{scope:o,value:u,max:c,children:l.jsx(fo.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":we(u)?u:void 0,"aria-valuetext":p,role:"progressbar","data-state":ho(u,c),"data-value":u??void 0,"data-max":c,...i,ref:t})})});po.displayName=Qe;var vo="ProgressIndicator",mo=a.forwardRef((e,t)=>{const{__scopeProgress:o,...n}=e,r=Gr(vo,o);return l.jsx(fo.div,{"data-state":ho(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...n,ref:t})});mo.displayName=vo;function Ur(e,t){return`${Math.round(e/t*100)}%`}function ho(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function we(e){return typeof e=="number"}function Ct(e){return we(e)&&!isNaN(e)&&e>0}function bt(e,t){return we(e)&&!isNaN(e)&&e<=t&&e>=0}function Hr(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${et}\`.`}function Wr(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${et} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var _i=po,Ei=mo,Te="Switch",[zr]=G(Te),[Yr,Xr]=zr(Te),go=a.forwardRef((e,t)=>{const{__scopeSwitch:o,name:n,checked:r,defaultChecked:s,required:i,disabled:c,value:u="on",onCheckedChange:p,form:f,...d}=e,[v,m]=a.useState(null),h=A(t,w=>m(w)),C=a.useRef(!1),x=v?f||!!v.closest("form"):!0,[S,R]=Q({prop:r,defaultProp:s??!1,onChange:p,caller:Te});return l.jsxs(Yr,{scope:o,checked:S,disabled:c,children:[l.jsx(_.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":bo(S),"data-disabled":c?"":void 0,disabled:c,value:u,...d,ref:h,onClick:g(e.onClick,w=>{R(P=>!P),x&&(C.current=w.isPropagationStopped(),C.current||w.stopPropagation())})}),x&&l.jsx(Co,{control:v,bubbles:!C.current,name:n,value:u,checked:S,required:i,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});go.displayName=Te;var xo="SwitchThumb",So=a.forwardRef((e,t)=>{const{__scopeSwitch:o,...n}=e,r=Xr(xo,o);return l.jsx(_.span,{"data-state":bo(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});So.displayName=xo;var qr="SwitchBubbleInput",Co=a.forwardRef(({__scopeSwitch:e,control:t,checked:o,bubbles:n=!0,...r},s)=>{const i=a.useRef(null),c=A(i,s),u=_t(o),p=Et(t);return a.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(u!==o&&m){const h=new Event("click",{bubbles:n});m.call(f,o),f.dispatchEvent(h)}},[u,o,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:c,style:{...r.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Co.displayName=qr;function bo(e){return e?"checked":"unchecked"}var yi=go,Mi=So,wo=["PageUp","PageDown"],Po=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ro={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},se="Slider",[ke,Zr,Jr]=Ge(se),[_o]=G(se,[Jr]),[Qr,Ie]=_o(se),Eo=a.forwardRef((e,t)=>{const{name:o,min:n=0,max:r=100,step:s=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:p=[n],value:f,onValueChange:d=()=>{},onValueCommit:v=()=>{},inverted:m=!1,form:h,...C}=e,x=a.useRef(new Set),S=a.useRef(0),w=i==="horizontal"?ea:ta,[P=[],I]=Q({prop:f,defaultProp:p,onChange:y=>{[...x.current][S.current]?.focus(),d(y)}}),j=a.useRef(P);function N(y){const L=sa(P,y);M(y,L)}function T(y){M(y,S.current)}function E(){const y=j.current[S.current];P[S.current]!==y&&v(P)}function M(y,L,{commit:W}={commit:!1}){const q=ua(s),Z=da(Math.round((y-n)/s)*s+n,q),O=Ue(Z,[n,r]);I((z=[])=>{const F=ra(z,O,L);if(la(F,u*s)){S.current=F.indexOf(O);const b=String(F)!==String(z);return b&&W&&v(F),b?F:z}else return z})}return l.jsx(Qr,{scope:e.__scopeSlider,name:o,disabled:c,min:n,max:r,valueIndexToChangeRef:S,thumbs:x.current,values:P,orientation:i,form:h,children:l.jsx(ke.Provider,{scope:e.__scopeSlider,children:l.jsx(ke.Slot,{scope:e.__scopeSlider,children:l.jsx(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...C,ref:t,onPointerDown:g(C.onPointerDown,()=>{c||(j.current=P)}),min:n,max:r,inverted:m,onSlideStart:c?void 0:N,onSlideMove:c?void 0:T,onSlideEnd:c?void 0:E,onHomeKeyDown:()=>!c&&M(n,0,{commit:!0}),onEndKeyDown:()=>!c&&M(r,P.length-1,{commit:!0}),onStepKeyDown:({event:y,direction:L})=>{if(!c){const Z=wo.includes(y.key)||y.shiftKey&&Po.includes(y.key)?10:1,O=S.current,z=P[O],F=s*Z*L;M(z+F,O,{commit:!0})}}})})})})});Eo.displayName=se;var[yo,Mo]=_o(se,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ea=a.forwardRef((e,t)=>{const{min:o,max:n,dir:r,inverted:s,onSlideStart:i,onSlideMove:c,onSlideEnd:u,onStepKeyDown:p,...f}=e,[d,v]=a.useState(null),m=A(t,w=>v(w)),h=a.useRef(void 0),C=pe(r),x=C==="ltr",S=x&&!s||!x&&s;function R(w){const P=h.current||d.getBoundingClientRect(),I=[0,P.width],N=tt(I,S?[o,n]:[n,o]);return h.current=P,N(w-P.left)}return l.jsx(yo,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:l.jsx(Ao,{dir:C,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const P=R(w.clientX);i?.(P)},onSlideMove:w=>{const P=R(w.clientX);c?.(P)},onSlideEnd:()=>{h.current=void 0,u?.()},onStepKeyDown:w=>{const I=Ro[S?"from-left":"from-right"].includes(w.key);p?.({event:w,direction:I?-1:1})}})})}),ta=a.forwardRef((e,t)=>{const{min:o,max:n,inverted:r,onSlideStart:s,onSlideMove:i,onSlideEnd:c,onStepKeyDown:u,...p}=e,f=a.useRef(null),d=A(t,f),v=a.useRef(void 0),m=!r;function h(C){const x=v.current||f.current.getBoundingClientRect(),S=[0,x.height],w=tt(S,m?[n,o]:[o,n]);return v.current=x,w(C-x.top)}return l.jsx(yo,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:l.jsx(Ao,{"data-orientation":"vertical",...p,ref:d,style:{...p.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const x=h(C.clientY);s?.(x)},onSlideMove:C=>{const x=h(C.clientY);i?.(x)},onSlideEnd:()=>{v.current=void 0,c?.()},onStepKeyDown:C=>{const S=Ro[m?"from-bottom":"from-top"].includes(C.key);u?.({event:C,direction:S?-1:1})}})})}),Ao=a.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:u,...p}=e,f=Ie(se,o);return l.jsx(_.span,{...p,ref:t,onKeyDown:g(e.onKeyDown,d=>{d.key==="Home"?(i(d),d.preventDefault()):d.key==="End"?(c(d),d.preventDefault()):wo.concat(Po).includes(d.key)&&(u(d),d.preventDefault())}),onPointerDown:g(e.onPointerDown,d=>{const v=d.target;v.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(v)?v.focus():n(d)}),onPointerMove:g(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&r(d)}),onPointerUp:g(e.onPointerUp,d=>{const v=d.target;v.hasPointerCapture(d.pointerId)&&(v.releasePointerCapture(d.pointerId),s(d))})})}),To="SliderTrack",Io=a.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=Ie(To,o);return l.jsx(_.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...n,ref:t})});Io.displayName=To;var Ve="SliderRange",No=a.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=Ie(Ve,o),s=Mo(Ve,o),i=a.useRef(null),c=A(t,i),u=r.values.length,p=r.values.map(v=>jo(v,r.min,r.max)),f=u>1?Math.min(...p):0,d=100-Math.max(...p);return l.jsx(_.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...n,ref:c,style:{...e.style,[s.startEdge]:f+"%",[s.endEdge]:d+"%"}})});No.displayName=Ve;var Be="SliderThumb",Do=a.forwardRef((e,t)=>{const o=Zr(e.__scopeSlider),[n,r]=a.useState(null),s=A(t,c=>r(c)),i=a.useMemo(()=>n?o().findIndex(c=>c.ref.current===n):-1,[o,n]);return l.jsx(oa,{...e,ref:s,index:i})}),oa=a.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:r,...s}=e,i=Ie(Be,o),c=Mo(Be,o),[u,p]=a.useState(null),f=A(t,R=>p(R)),d=u?i.form||!!u.closest("form"):!0,v=Et(u),m=i.values[n],h=m===void 0?0:jo(m,i.min,i.max),C=aa(n,i.values.length),x=v?.[c.size],S=x?ia(x,h,c.direction):0;return a.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${h}% + ${S}px)`},children:[l.jsx(ke.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(_.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":i.min,"aria-valuenow":m,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:f,style:m===void 0?{display:"none"}:e.style,onFocus:g(e.onFocus,()=>{i.valueIndexToChangeRef.current=n})})}),d&&l.jsx(Oo,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:m},n)]})});Do.displayName=Be;var na="RadioBubbleInput",Oo=a.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const r=a.useRef(null),s=A(r,n),i=_t(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&f){const d=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[i,t]),l.jsx(_.input,{style:{display:"none"},...o,ref:s,defaultValue:t})});Oo.displayName=na;function ra(e=[],t,o){const n=[...e];return n[o]=t,n.sort((r,s)=>r-s)}function jo(e,t,o){const s=100/(o-t)*(e-t);return Ue(s,[0,100])}function aa(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function sa(e,t){if(e.length===1)return 0;const o=e.map(r=>Math.abs(r-t)),n=Math.min(...o);return o.indexOf(n)}function ia(e,t,o){const n=e/2,s=tt([0,50],[0,n]);return(n-s(t)*o)*o}function ca(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function la(e,t){if(t>0){const o=ca(e);return Math.min(...o)>=t}return!0}function tt(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function ua(e){return(String(e).split(".")[1]||"").length}function da(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ai=Eo,Ti=Io,Ii=No,Ni=Do,fa=Symbol("radix.slottable");function pa(e){const t=({children:o})=>l.jsx(l.Fragment,{children:o});return t.displayName=`${e}.Slottable`,t.__radixId=fa,t}var Lo="AlertDialog",[va]=G(Lo,[yt]),H=yt(),Fo=e=>{const{__scopeAlertDialog:t,...o}=e,n=H(t);return l.jsx(ur,{...n,...o,modal:!0})};Fo.displayName=Lo;var ma="AlertDialogTrigger",$o=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(dr,{...r,...n,ref:t})});$o.displayName=ma;var ha="AlertDialogPortal",ko=e=>{const{__scopeAlertDialog:t,...o}=e,n=H(t);return l.jsx(ar,{...n,...o})};ko.displayName=ha;var ga="AlertDialogOverlay",Vo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(rr,{...r,...n,ref:t})});Vo.displayName=ga;var oe="AlertDialogContent",[xa,Sa]=va(oe),Ca=pa("AlertDialogContent"),Bo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:n,...r}=e,s=H(o),i=a.useRef(null),c=A(t,i),u=a.useRef(null);return l.jsx(sr,{contentName:oe,titleName:Ko,docsSlug:"alert-dialog",children:l.jsx(xa,{scope:o,cancelRef:u,children:l.jsxs(ir,{role:"alertdialog",...s,...r,ref:c,onOpenAutoFocus:g(r.onOpenAutoFocus,p=>{p.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:[l.jsx(Ca,{children:n}),l.jsx(wa,{contentRef:i})]})})})});Bo.displayName=oe;var Ko="AlertDialogTitle",Go=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(cr,{...r,...n,ref:t})});Go.displayName=Ko;var Uo="AlertDialogDescription",Ho=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(lr,{...r,...n,ref:t})});Ho.displayName=Uo;var ba="AlertDialogAction",Wo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=H(o);return l.jsx(Mt,{...r,...n,ref:t})});Wo.displayName=ba;var zo="AlertDialogCancel",Yo=a.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,{cancelRef:r}=Sa(zo,o),s=H(o),i=A(t,r);return l.jsx(Mt,{...s,...n,ref:i})});Yo.displayName=zo;var wa=({contentRef:e})=>{const t=`\`${oe}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${oe}\` by passing a \`${Uo}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${oe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Di=Fo,Oi=$o,ji=ko,Li=Vo,Fi=Bo,$i=Wo,ki=Yo,Vi=Go,Bi=Ho,Pa=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ra=Pa.reduce((e,t)=>{const o=He(`Primitive.${t}`),n=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),_a="Separator",wt="horizontal",Ea=["horizontal","vertical"],Xo=a.forwardRef((e,t)=>{const{decorative:o,orientation:n=wt,...r}=e,s=ya(n)?n:wt,c=o?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(Ra.div,{"data-orientation":s,...c,...r,ref:t})});Xo.displayName=_a;function ya(e){return Ea.includes(e)}var Ki=Xo;function Ma(e){const t=Aa(e),o=a.forwardRef((n,r)=>{const{children:s,...i}=n,c=a.Children.toArray(s),u=c.find(Ia);if(u){const p=u.props.children,f=c.map(d=>d===u?a.Children.count(p)>1?a.Children.only(null):a.isValidElement(p)?p.props.children:null:d);return l.jsx(t,{...i,ref:r,children:a.isValidElement(p)?a.cloneElement(p,void 0,f):null})}return l.jsx(t,{...i,ref:r,children:s})});return o.displayName=`${e}.Slot`,o}function Aa(e){const t=a.forwardRef((o,n)=>{const{children:r,...s}=o;if(a.isValidElement(r)){const i=Da(r),c=Na(s,r.props);return r.type!==a.Fragment&&(c.ref=n?We(n,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ta=Symbol("radix.slottable");function Ia(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ta}function Na(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...c)=>{const u=s(...c);return r(...c),u}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}function Da(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ne="Popover",[qo]=G(Ne,[_e]),me=_e(),[Oa,Y]=qo(Ne),Zo=e=>{const{__scopePopover:t,children:o,open:n,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,c=me(t),u=a.useRef(null),[p,f]=a.useState(!1),[d,v]=Q({prop:n,defaultProp:r??!1,onChange:s,caller:Ne});return l.jsx(ze,{...c,children:l.jsx(Oa,{scope:t,contentId:ne(),triggerRef:u,open:d,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(m=>!m),[v]),hasCustomAnchor:p,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:i,children:o})})};Zo.displayName=Ne;var Jo="PopoverAnchor",ja=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Y(Jo,o),s=me(o),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=r;return a.useEffect(()=>(i(),()=>c()),[i,c]),l.jsx(Ye,{...s,...n,ref:t})});ja.displayName=Jo;var Qo="PopoverTrigger",en=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Y(Qo,o),s=me(o),i=A(t,r.triggerRef),c=l.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":an(r.open),...n,ref:i,onClick:g(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:l.jsx(Ye,{asChild:!0,...s,children:c})});en.displayName=Qo;var ot="PopoverPortal",[La,Fa]=qo(ot,{forceMount:void 0}),tn=e=>{const{__scopePopover:t,forceMount:o,children:n,container:r}=e,s=Y(ot,t);return l.jsx(La,{scope:t,forceMount:o,children:l.jsx(B,{present:o||s.open,children:l.jsx(At,{asChild:!0,container:r,children:n})})})};tn.displayName=ot;var ae="PopoverContent",on=a.forwardRef((e,t)=>{const o=Fa(ae,e.__scopePopover),{forceMount:n=o.forceMount,...r}=e,s=Y(ae,e.__scopePopover);return l.jsx(B,{present:n||s.open,children:s.modal?l.jsx(ka,{...r,ref:t}):l.jsx(Va,{...r,ref:t})})});on.displayName=ae;var $a=Ma("PopoverContent.RemoveScroll"),ka=a.forwardRef((e,t)=>{const o=Y(ae,e.__scopePopover),n=a.useRef(null),r=A(t,n),s=a.useRef(!1);return a.useEffect(()=>{const i=n.current;if(i)return Tt(i)},[]),l.jsx(It,{as:$a,allowPinchZoom:!0,children:l.jsx(nn,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,p=c.button===2||u;s.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:g(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Va=a.forwardRef((e,t)=>{const o=Y(ae,e.__scopePopover),n=a.useRef(!1),r=a.useRef(!1);return l.jsx(nn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||o.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;o.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),nn=a.forwardRef((e,t)=>{const{__scopePopover:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,...d}=e,v=Y(ae,o),m=me(o);return Nt(),l.jsx(Dt,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:s,children:l.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:p,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(jt,{"data-state":an(v.open),role:"dialog",id:v.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rn="PopoverClose",Ba=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Y(rn,o);return l.jsx(_.button,{type:"button",...n,ref:t,onClick:g(e.onClick,()=>r.onOpenChange(!1))})});Ba.displayName=rn;var Ka="PopoverArrow",Ga=a.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=me(o);return l.jsx(Lt,{...r,...n,ref:t})});Ga.displayName=Ka;function an(e){return e?"open":"closed"}var Gi=Zo,Ui=en,Hi=tn,Wi=on,De="Collapsible",[Ua]=G(De),[Ha,nt]=Ua(De),sn=a.forwardRef((e,t)=>{const{__scopeCollapsible:o,open:n,defaultOpen:r,disabled:s,onOpenChange:i,...c}=e,[u,p]=Q({prop:n,defaultProp:r??!1,onChange:i,caller:De});return l.jsx(Ha,{scope:o,disabled:s,contentId:ne(),open:u,onOpenToggle:a.useCallback(()=>p(f=>!f),[p]),children:l.jsx(_.div,{"data-state":at(u),"data-disabled":s?"":void 0,...c,ref:t})})});sn.displayName=De;var cn="CollapsibleTrigger",Wa=a.forwardRef((e,t)=>{const{__scopeCollapsible:o,...n}=e,r=nt(cn,o);return l.jsx(_.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":at(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...n,ref:t,onClick:g(e.onClick,r.onOpenToggle)})});Wa.displayName=cn;var rt="CollapsibleContent",za=a.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=nt(rt,e.__scopeCollapsible);return l.jsx(B,{present:o||r.open,children:({present:s})=>l.jsx(Ya,{...n,ref:t,present:s})})});za.displayName=rt;var Ya=a.forwardRef((e,t)=>{const{__scopeCollapsible:o,present:n,children:r,...s}=e,i=nt(rt,o),[c,u]=a.useState(n),p=a.useRef(null),f=A(t,p),d=a.useRef(0),v=d.current,m=a.useRef(0),h=m.current,C=i.open||c,x=a.useRef(C),S=a.useRef(void 0);return a.useEffect(()=>{const R=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(R)},[]),ue(()=>{const R=p.current;if(R){S.current=S.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";const w=R.getBoundingClientRect();d.current=w.height,m.current=w.width,x.current||(R.style.transitionDuration=S.current.transitionDuration,R.style.animationName=S.current.animationName),u(n)}},[i.open,n]),l.jsx(_.div,{"data-state":at(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!C,...s,ref:f,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:C&&r})});function at(e){return e?"open":"closed"}var zi=sn;function Xa(e,t=[]){let o=[];function n(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=o.length;o=[...o,i];const p=d=>{const{scope:v,children:m,...h}=d,C=v?.[e]?.[u]||c,x=a.useMemo(()=>h,Object.values(h));return l.jsx(C.Provider,{value:x,children:m})};p.displayName=s+"Provider";function f(d,v){const m=v?.[e]?.[u]||c,h=a.useContext(m);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[p,f]}const r=()=>{const s=o.map(i=>a.createContext(i));return function(c){const u=c?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[n,qa(r,...t)]}function qa(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=n.reduce((c,{useScope:u,scopeName:p})=>{const d=u(s)[`__scope${p}`];return{...c,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}var Za=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=Za.reduce((e,t)=>{const o=He(`Primitive.${t}`),n=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ja=nr();function Qa(){return Ja.useSyncExternalStore(es,()=>!0,()=>!1)}function es(){return()=>{}}var it="Avatar",[ts]=Xa(it),[os,ln]=ts(it),un=a.forwardRef((e,t)=>{const{__scopeAvatar:o,...n}=e,[r,s]=a.useState("idle");return l.jsx(os,{scope:o,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:l.jsx(st.span,{...n,ref:t})})});un.displayName=it;var dn="AvatarImage",fn=a.forwardRef((e,t)=>{const{__scopeAvatar:o,src:n,onLoadingStatusChange:r=()=>{},...s}=e,i=ln(dn,o),c=ns(n,s),u=k(p=>{r(p),i.onImageLoadingStatusChange(p)});return ue(()=>{c!=="idle"&&u(c)},[c,u]),c==="loaded"?l.jsx(st.img,{...s,ref:t,src:n}):null});fn.displayName=dn;var pn="AvatarFallback",vn=a.forwardRef((e,t)=>{const{__scopeAvatar:o,delayMs:n,...r}=e,s=ln(pn,o),[i,c]=a.useState(n===void 0);return a.useEffect(()=>{if(n!==void 0){const u=window.setTimeout(()=>c(!0),n);return()=>window.clearTimeout(u)}},[n]),i&&s.imageLoadingStatus!=="loaded"?l.jsx(st.span,{...r,ref:t}):null});vn.displayName=pn;function Pt(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function ns(e,{referrerPolicy:t,crossOrigin:o}){const n=Qa(),r=a.useRef(null),s=n?(r.current||(r.current=new window.Image),r.current):null,[i,c]=a.useState(()=>Pt(s,e));return ue(()=>{c(Pt(s,e))},[s,e]),ue(()=>{const u=d=>()=>{c(d)};if(!s)return;const p=u("loaded"),f=u("error");return s.addEventListener("load",p),s.addEventListener("error",f),t&&(s.referrerPolicy=t),typeof o=="string"&&(s.crossOrigin=o),()=>{s.removeEventListener("load",p),s.removeEventListener("error",f)}},[s,o,t]),i}var Yi=un,Xi=fn,qi=vn;function rs(e){const t=as(e),o=a.forwardRef((n,r)=>{const{children:s,...i}=n,c=a.Children.toArray(s),u=c.find(is);if(u){const p=u.props.children,f=c.map(d=>d===u?a.Children.count(p)>1?a.Children.only(null):a.isValidElement(p)?p.props.children:null:d);return l.jsx(t,{...i,ref:r,children:a.isValidElement(p)?a.cloneElement(p,void 0,f):null})}return l.jsx(t,{...i,ref:r,children:s})});return o.displayName=`${e}.Slot`,o}function as(e){const t=a.forwardRef((o,n)=>{const{children:r,...s}=o;if(a.isValidElement(r)){const i=ls(r),c=cs(s,r.props);return r.type!==a.Fragment&&(c.ref=n?We(n,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ss=Symbol("radix.slottable");function is(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ss}function cs(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...c)=>{const u=s(...c);return r(...c),u}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}function ls(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ke=["Enter"," "],us=["ArrowDown","PageUp","Home"],mn=["ArrowUp","PageDown","End"],ds=[...us,...mn],fs={ltr:[...Ke,"ArrowRight"],rtl:[...Ke,"ArrowLeft"]},ps={ltr:["ArrowLeft"],rtl:["ArrowRight"]},he="Menu",[de,vs,ms]=Ge(he),[ee,hn]=G(he,[ms,_e,Ee]),ge=_e(),gn=Ee(),[xn,X]=ee(he),[hs,xe]=ee(he),Sn=e=>{const{__scopeMenu:t,open:o=!1,children:n,dir:r,onOpenChange:s,modal:i=!0}=e,c=ge(t),[u,p]=a.useState(null),f=a.useRef(!1),d=k(s),v=pe(r);return a.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(ze,{...c,children:l.jsx(xn,{scope:t,open:o,onOpenChange:d,content:u,onContentChange:p,children:l.jsx(hs,{scope:t,onClose:a.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:v,modal:i,children:n})})})};Sn.displayName=he;var gs="MenuAnchor",ct=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=ge(o);return l.jsx(Ye,{...r,...n,ref:t})});ct.displayName=gs;var lt="MenuPortal",[xs,Cn]=ee(lt,{forceMount:void 0}),bn=e=>{const{__scopeMenu:t,forceMount:o,children:n,container:r}=e,s=X(lt,t);return l.jsx(xs,{scope:t,forceMount:o,children:l.jsx(B,{present:o||s.open,children:l.jsx(At,{asChild:!0,container:r,children:n})})})};bn.displayName=lt;var V="MenuContent",[Ss,ut]=ee(V),wn=a.forwardRef((e,t)=>{const o=Cn(V,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,s=X(V,e.__scopeMenu),i=xe(V,e.__scopeMenu);return l.jsx(de.Provider,{scope:e.__scopeMenu,children:l.jsx(B,{present:n||s.open,children:l.jsx(de.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Cs,{...r,ref:t}):l.jsx(bs,{...r,ref:t})})})})}),Cs=a.forwardRef((e,t)=>{const o=X(V,e.__scopeMenu),n=a.useRef(null),r=A(t,n);return a.useEffect(()=>{const s=n.current;if(s)return Tt(s)},[]),l.jsx(dt,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:g(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),bs=a.forwardRef((e,t)=>{const o=X(V,e.__scopeMenu);return l.jsx(dt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),ws=rs("MenuContent.ScrollLock"),dt=a.forwardRef((e,t)=>{const{__scopeMenu:o,loop:n=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:v,onDismiss:m,disableOutsideScroll:h,...C}=e,x=X(V,o),S=xe(V,o),R=ge(o),w=gn(o),P=vs(o),[I,j]=a.useState(null),N=a.useRef(null),T=A(t,N,x.onContentChange),E=a.useRef(0),M=a.useRef(""),y=a.useRef(0),L=a.useRef(null),W=a.useRef("right"),q=a.useRef(0),Z=h?It:a.Fragment,O=h?{as:ws,allowPinchZoom:!0}:void 0,z=b=>{const te=M.current+b,J=P().filter($=>!$.disabled),ie=document.activeElement,je=J.find($=>$.ref.current===ie)?.textValue,Le=J.map($=>$.textValue),gt=Os(Le,te,je),ce=J.find($=>$.textValue===gt)?.ref.current;(function $(xt){M.current=xt,window.clearTimeout(E.current),xt!==""&&(E.current=window.setTimeout(()=>$(""),1e3))})(te),ce&&setTimeout(()=>ce.focus())};a.useEffect(()=>()=>window.clearTimeout(E.current),[]),Nt();const F=a.useCallback(b=>W.current===L.current?.side&&Ls(b,L.current?.area),[]);return l.jsx(Ss,{scope:o,searchRef:M,onItemEnter:a.useCallback(b=>{F(b)&&b.preventDefault()},[F]),onItemLeave:a.useCallback(b=>{F(b)||(N.current?.focus(),j(null))},[F]),onTriggerLeave:a.useCallback(b=>{F(b)&&b.preventDefault()},[F]),pointerGraceTimerRef:y,onPointerGraceIntentChange:a.useCallback(b=>{L.current=b},[]),children:l.jsx(Z,{...O,children:l.jsx(Dt,{asChild:!0,trapped:r,onMountAutoFocus:g(s,b=>{b.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:v,onDismiss:m,children:l.jsx(Kt,{asChild:!0,...w,dir:S.dir,orientation:"vertical",loop:n,currentTabStopId:I,onCurrentTabStopIdChange:j,onEntryFocus:g(u,b=>{S.isUsingKeyboardRef.current||b.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(jt,{role:"menu","aria-orientation":"vertical","data-state":kn(x.open),"data-radix-menu-content":"",dir:S.dir,...R,...C,ref:T,style:{outline:"none",...C.style},onKeyDown:g(C.onKeyDown,b=>{const J=b.target.closest("[data-radix-menu-content]")===b.currentTarget,ie=b.ctrlKey||b.altKey||b.metaKey,je=b.key.length===1;J&&(b.key==="Tab"&&b.preventDefault(),!ie&&je&&z(b.key));const Le=N.current;if(b.target!==Le||!ds.includes(b.key))return;b.preventDefault();const ce=P().filter($=>!$.disabled).map($=>$.ref.current);mn.includes(b.key)&&ce.reverse(),Ns(ce)}),onBlur:g(e.onBlur,b=>{b.currentTarget.contains(b.target)||(window.clearTimeout(E.current),M.current="")}),onPointerMove:g(e.onPointerMove,fe(b=>{const te=b.target,J=q.current!==b.clientX;if(b.currentTarget.contains(te)&&J){const ie=b.clientX>q.current?"right":"left";W.current=ie,q.current=b.clientX}}))})})})})})})});wn.displayName=V;var Ps="MenuGroup",ft=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return l.jsx(_.div,{role:"group",...n,ref:t})});ft.displayName=Ps;var Rs="MenuLabel",Pn=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return l.jsx(_.div,{...n,ref:t})});Pn.displayName=Rs;var Pe="MenuItem",Rt="menu.itemSelect",Oe=a.forwardRef((e,t)=>{const{disabled:o=!1,onSelect:n,...r}=e,s=a.useRef(null),i=xe(Pe,e.__scopeMenu),c=ut(Pe,e.__scopeMenu),u=A(t,s),p=a.useRef(!1),f=()=>{const d=s.current;if(!o&&d){const v=new CustomEvent(Rt,{bubbles:!0,cancelable:!0});d.addEventListener(Rt,m=>n?.(m),{once:!0}),fr(d,v),v.defaultPrevented?p.current=!1:i.onClose()}};return l.jsx(Rn,{...r,ref:u,disabled:o,onClick:g(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),p.current=!0},onPointerUp:g(e.onPointerUp,d=>{p.current||d.currentTarget?.click()}),onKeyDown:g(e.onKeyDown,d=>{const v=c.searchRef.current!=="";o||v&&d.key===" "||Ke.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Oe.displayName=Pe;var Rn=a.forwardRef((e,t)=>{const{__scopeMenu:o,disabled:n=!1,textValue:r,...s}=e,i=ut(Pe,o),c=gn(o),u=a.useRef(null),p=A(t,u),[f,d]=a.useState(!1),[v,m]=a.useState("");return a.useEffect(()=>{const h=u.current;h&&m((h.textContent??"").trim())},[s.children]),l.jsx(de.ItemSlot,{scope:o,disabled:n,textValue:r??v,children:l.jsx(Gt,{asChild:!0,...c,focusable:!n,children:l.jsx(_.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:p,onPointerMove:g(e.onPointerMove,fe(h=>{n?i.onItemLeave(h):(i.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:g(e.onPointerLeave,fe(h=>i.onItemLeave(h))),onFocus:g(e.onFocus,()=>d(!0)),onBlur:g(e.onBlur,()=>d(!1))})})})}),_s="MenuCheckboxItem",_n=a.forwardRef((e,t)=>{const{checked:o=!1,onCheckedChange:n,...r}=e;return l.jsx(Tn,{scope:e.__scopeMenu,checked:o,children:l.jsx(Oe,{role:"menuitemcheckbox","aria-checked":Re(o)?"mixed":o,...r,ref:t,"data-state":mt(o),onSelect:g(r.onSelect,()=>n?.(Re(o)?!0:!o),{checkForDefaultPrevented:!1})})})});_n.displayName=_s;var En="MenuRadioGroup",[Es,ys]=ee(En,{value:void 0,onValueChange:()=>{}}),yn=a.forwardRef((e,t)=>{const{value:o,onValueChange:n,...r}=e,s=k(n);return l.jsx(Es,{scope:e.__scopeMenu,value:o,onValueChange:s,children:l.jsx(ft,{...r,ref:t})})});yn.displayName=En;var Mn="MenuRadioItem",An=a.forwardRef((e,t)=>{const{value:o,...n}=e,r=ys(Mn,e.__scopeMenu),s=o===r.value;return l.jsx(Tn,{scope:e.__scopeMenu,checked:s,children:l.jsx(Oe,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":mt(s),onSelect:g(n.onSelect,()=>r.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});An.displayName=Mn;var pt="MenuItemIndicator",[Tn,Ms]=ee(pt,{checked:!1}),In=a.forwardRef((e,t)=>{const{__scopeMenu:o,forceMount:n,...r}=e,s=Ms(pt,o);return l.jsx(B,{present:n||Re(s.checked)||s.checked===!0,children:l.jsx(_.span,{...r,ref:t,"data-state":mt(s.checked)})})});In.displayName=pt;var As="MenuSeparator",Nn=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return l.jsx(_.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Nn.displayName=As;var Ts="MenuArrow",Dn=a.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=ge(o);return l.jsx(Lt,{...r,...n,ref:t})});Dn.displayName=Ts;var vt="MenuSub",[Is,On]=ee(vt),jn=e=>{const{__scopeMenu:t,children:o,open:n=!1,onOpenChange:r}=e,s=X(vt,t),i=ge(t),[c,u]=a.useState(null),[p,f]=a.useState(null),d=k(r);return a.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),l.jsx(ze,{...i,children:l.jsx(xn,{scope:t,open:n,onOpenChange:d,content:p,onContentChange:f,children:l.jsx(Is,{scope:t,contentId:ne(),triggerId:ne(),trigger:c,onTriggerChange:u,children:o})})})};jn.displayName=vt;var le="MenuSubTrigger",Ln=a.forwardRef((e,t)=>{const o=X(le,e.__scopeMenu),n=xe(le,e.__scopeMenu),r=On(le,e.__scopeMenu),s=ut(le,e.__scopeMenu),i=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,p={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return a.useEffect(()=>f,[f]),a.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),u(null)}},[c,u]),l.jsx(ct,{asChild:!0,...p,children:l.jsx(Rn,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":r.contentId,"data-state":kn(o.open),...e,ref:We(t,r.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:g(e.onPointerMove,fe(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!o.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100))})),onPointerLeave:g(e.onPointerLeave,fe(d=>{f();const v=o.content?.getBoundingClientRect();if(v){const m=o.content?.dataset.side,h=m==="right",C=h?-5:5,x=v[h?"left":"right"],S=v[h?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+C,y:d.clientY},{x,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x,y:v.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:g(e.onKeyDown,d=>{const v=s.searchRef.current!=="";e.disabled||v&&d.key===" "||fs[n.dir].includes(d.key)&&(o.onOpenChange(!0),o.content?.focus(),d.preventDefault())})})})});Ln.displayName=le;var Fn="MenuSubContent",$n=a.forwardRef((e,t)=>{const o=Cn(V,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,s=X(V,e.__scopeMenu),i=xe(V,e.__scopeMenu),c=On(Fn,e.__scopeMenu),u=a.useRef(null),p=A(t,u);return l.jsx(de.Provider,{scope:e.__scopeMenu,children:l.jsx(B,{present:n||s.open,children:l.jsx(de.Slot,{scope:e.__scopeMenu,children:l.jsx(dt,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:p,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:g(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:g(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:g(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),v=ps[i.dir].includes(f.key);d&&v&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});$n.displayName=Fn;function kn(e){return e?"open":"closed"}function Re(e){return e==="indeterminate"}function mt(e){return Re(e)?"indeterminate":e?"checked":"unchecked"}function Ns(e){const t=document.activeElement;for(const o of e)if(o===t||(o.focus(),document.activeElement!==t))return}function Ds(e,t){return e.map((o,n)=>e[(t+n)%e.length])}function Os(e,t,o){const r=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=o?e.indexOf(o):-1;let i=Ds(e,Math.max(s,0));r.length===1&&(i=i.filter(p=>p!==o));const u=i.find(p=>p.toLowerCase().startsWith(r.toLowerCase()));return u!==o?u:void 0}function js(e,t){const{x:o,y:n}=e;let r=!1;for(let s=0,i=t.length-1;sn!=v>n&&o<(d-p)*(n-f)/(v-f)+p&&(r=!r)}return r}function Ls(e,t){if(!t)return!1;const o={x:e.clientX,y:e.clientY};return js(o,t)}function fe(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Fs=Sn,$s=ct,ks=bn,Vs=wn,Bs=ft,Ks=Pn,Gs=Oe,Us=_n,Hs=yn,Ws=An,zs=In,Ys=Nn,Xs=Dn,qs=jn,Zs=Ln,Js=$n,ht="ContextMenu",[Qs]=G(ht,[hn]),D=hn(),[ei,Vn]=Qs(ht),Bn=e=>{const{__scopeContextMenu:t,children:o,onOpenChange:n,dir:r,modal:s=!0}=e,[i,c]=a.useState(!1),u=D(t),p=k(n),f=a.useCallback(d=>{c(d),p(d)},[p]);return l.jsx(ei,{scope:t,open:i,onOpenChange:f,modal:s,children:l.jsx(Fs,{...u,dir:r,open:i,onOpenChange:f,modal:s,children:o})})};Bn.displayName=ht;var Kn="ContextMenuTrigger",Gn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,disabled:n=!1,...r}=e,s=Vn(Kn,o),i=D(o),c=a.useRef({x:0,y:0}),u=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),p=a.useRef(0),f=a.useCallback(()=>window.clearTimeout(p.current),[]),d=v=>{c.current={x:v.clientX,y:v.clientY},s.onOpenChange(!0)};return a.useEffect(()=>f,[f]),a.useEffect(()=>void(n&&f()),[n,f]),l.jsxs(l.Fragment,{children:[l.jsx($s,{...i,virtualRef:u}),l.jsx(_.span,{"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,...r,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:g(e.onContextMenu,v=>{f(),d(v),v.preventDefault()}),onPointerDown:n?e.onPointerDown:g(e.onPointerDown,Se(v=>{f(),p.current=window.setTimeout(()=>d(v),700)})),onPointerMove:n?e.onPointerMove:g(e.onPointerMove,Se(f)),onPointerCancel:n?e.onPointerCancel:g(e.onPointerCancel,Se(f)),onPointerUp:n?e.onPointerUp:g(e.onPointerUp,Se(f))})]})});Gn.displayName=Kn;var ti="ContextMenuPortal",Un=e=>{const{__scopeContextMenu:t,...o}=e,n=D(t);return l.jsx(ks,{...n,...o})};Un.displayName=ti;var Hn="ContextMenuContent",Wn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=Vn(Hn,o),s=D(o),i=a.useRef(!1);return l.jsx(Vs,{...s,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),!c.defaultPrevented&&i.current&&c.preventDefault(),i.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(i.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Wn.displayName=Hn;var oi="ContextMenuGroup",ni=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Bs,{...r,...n,ref:t})});ni.displayName=oi;var ri="ContextMenuLabel",zn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Ks,{...r,...n,ref:t})});zn.displayName=ri;var ai="ContextMenuItem",Yn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Gs,{...r,...n,ref:t})});Yn.displayName=ai;var si="ContextMenuCheckboxItem",Xn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Us,{...r,...n,ref:t})});Xn.displayName=si;var ii="ContextMenuRadioGroup",ci=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Hs,{...r,...n,ref:t})});ci.displayName=ii;var li="ContextMenuRadioItem",qn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Ws,{...r,...n,ref:t})});qn.displayName=li;var ui="ContextMenuItemIndicator",Zn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(zs,{...r,...n,ref:t})});Zn.displayName=ui;var di="ContextMenuSeparator",Jn=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Ys,{...r,...n,ref:t})});Jn.displayName=di;var fi="ContextMenuArrow",pi=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Xs,{...r,...n,ref:t})});pi.displayName=fi;var Qn="ContextMenuSub",er=e=>{const{__scopeContextMenu:t,children:o,onOpenChange:n,open:r,defaultOpen:s}=e,i=D(t),[c,u]=Q({prop:r,defaultProp:s??!1,onChange:n,caller:Qn});return l.jsx(qs,{...i,open:c,onOpenChange:u,children:o})};er.displayName=Qn;var vi="ContextMenuSubTrigger",tr=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Zs,{...r,...n,ref:t})});tr.displayName=vi;var mi="ContextMenuSubContent",or=a.forwardRef((e,t)=>{const{__scopeContextMenu:o,...n}=e,r=D(o);return l.jsx(Js,{...r,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});or.displayName=mi;function Se(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Zi=Bn,Ji=Gn,Qi=Un,ec=Wn,tc=zn,oc=Yn,nc=Xn,rc=qn,ac=Zn,sc=Jn,ic=er,cc=tr,lc=or;export{$i as A,lc as B,bi as C,Bi as D,Qi as E,qi as F,ec as G,oc as H,Ei as I,nc as J,ac as K,Si as L,rc as M,tc as N,Li as O,ji as P,sc as Q,xi as R,yr as S,Ci as T,Zi as U,Pi as V,Ji as W,ic as X,wi as a,Ri as b,Dr as c,_i as d,yi as e,Mi as f,Ai as g,Ti as h,Ii as i,Ni as j,Fi as k,Vi as l,ki as m,Di as n,Oi as o,Ki as p,Hi as q,Wi as r,Gi as s,Ui as t,zi as u,Wa as v,za as w,Yi as x,Xi as y,cc as z}; diff --git a/webui/dist/assets/uppy-DSH7n_-V.js b/webui/dist/assets/uppy-BHC3OXBx.js similarity index 99% rename from webui/dist/assets/uppy-DSH7n_-V.js rename to webui/dist/assets/uppy-BHC3OXBx.js index 30adbfe5..c7c36e95 100644 --- a/webui/dist/assets/uppy-DSH7n_-V.js +++ b/webui/dist/assets/uppy-BHC3OXBx.js @@ -1,4 +1,4 @@ -import{ag as us,ah as hs}from"./charts-Dhri-zxi.js";import{g as ce}from"./react-vendor-Dtc2IqVY.js";import"./router-CWhjJi2n.js";import"./radix-extra-Cw1azsjZ.js";const cs=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ps(i,e,t){const s=cs.exec(i),n=e.mimeType??s?.[1]??"plain/text";let r;if(s?.[2]!=null){const a=atob(decodeURIComponent(s[3])),o=new Uint8Array(a.length);for(let d=0;d(e+=`-${ms(t)}`,"/"))+e}function gs(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${At(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${At(i.meta.relativePath.toLowerCase())}`),i.data?.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function ys(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function bs(i,e){if(ys(i))return i.id;const t=Fi(i);return gs({...i,type:t},e)}const re=Array.from;function vs(i){const e=re(i.files);return Promise.resolve(e)}function Si(i,e,t,{onSuccess:s}){i.readEntries(n=>{const r=[...e,...n];n.length?queueMicrotask(()=>{Si(i,r,t,{onSuccess:s})}):s(r)},n=>{t(n),s(e)})}function Pi(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,s)=>i.file(t,s))},async*values(){const t=i.createReader();yield*await new Promise(n=>{Si(t,[],e,{onSuccess:r=>n(r.map(a=>Pi(a,e)))})})},isSameEntry:void 0}}async function*Ti(i,e,t=void 0){const s=()=>`${e}/${i.name}`;if(i.kind==="file"){const n=await i.getFile();n!=null?(n.relativePath=e?s():null,yield n):t!=null&&(yield t)}else if(i.kind==="directory")for await(const n of i.values())yield*Ti(n,e?s():i.name);else t!=null&&(yield t)}async function*ws(i,e){const t=await Promise.all(Array.from(i.items,async s=>{let n;return n??=Pi(typeof s.getAsEntry=="function"?s.getAsEntry():s.webkitGetAsEntry(),e),{fileSystemHandle:n,lastResortFile:s.getAsFile()}}));for(const{lastResortFile:s,fileSystemHandle:n}of t)if(n!=null)try{yield*Ti(n,"",s)}catch(r){s!=null?yield s:e(r)}else s!=null&&(yield s)}async function _s(i,e){const t=e?.logDropError??Function.prototype;try{const s=[];for await(const n of ws(i,t))s.push(n);return s}catch{return vs(i)}}function Fs(i){for(;i&&!i.dir;)i=i.parentNode;return i?.dir}function Ie(i){return i<10?`0${i}`:i.toString()}function Ce(){const i=new Date,e=Ie(i.getHours()),t=Ie(i.getMinutes()),s=Ie(i.getSeconds());return`${e}:${t}:${s}`}function Ss(){if(typeof window>"u")return!1;const i=document.body;return!(i==null||window==null||!("draggable"in i)||!("ondragstart"in i)||!("ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}function Ut(i){return i.startsWith("blob:")}function Ot(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Ps(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,s=Math.floor(i%60);return{hours:e,minutes:t,seconds:s}}function Ts(i){const e=Ps(i),t=e.hours===0?"":`${e.hours}h`,s=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,n=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${s}${n}`}function Cs(i,e,t){const s=[];return i.forEach(n=>typeof n!="string"?s.push(n):e[Symbol.split](n).forEach((r,a,o)=>{r!==""&&s.push(r),a{throw new Error(`missing string: ${i}`)};class Ci{locale;constructor(e,{onMissingKey:t=Es}={}){this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=t}#e;#t(e){if(!e?.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let s=this.locale.strings[e];if(s==null&&(this.#e(e),s=e),typeof s=="object"){if(t&&typeof t.smart_count<"u"){const r=this.locale.pluralize(t.smart_count);return Nt(s[r],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof s!="string")throw new Error("string was not a string");return Nt(s,t)}}const Be="...";function Ei(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Be.length+1)return`${i.slice(0,e-1)}…`;const t=e-Be.length,s=Math.ceil(t/2),n=Math.floor(t/2);return i.slice(0,s)+Be+i.slice(-n)}var pe,S,ki,K,Dt,Ai,Ui,Oi,at,Qe,Je,oe={},Ni=[],ks=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fe=Array.isArray;function H(i,e){for(var t in e)i[t]=e[t];return i}function ot(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function lt(i,e,t){var s,n,r,a={};for(r in e)r=="key"?s=e[r]:r=="ref"?n=e[r]:a[r]=e[r];if(arguments.length>2&&(a.children=arguments.length>3?pe.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)a[r]===void 0&&(a[r]=i.defaultProps[r]);return ae(i,a,s,n,null)}function ae(i,e,t,s,n){var r={type:i,props:e,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++ki,__i:-1,__u:0};return n==null&&S.vnode!=null&&S.vnode(r),r}function As(){return{current:null}}function V(i){return i.children}function q(i,e){this.props=i,this.context=e}function Z(i,e){if(e==null)return i.__?Z(i.__,i.__i+1):null;for(var t;eo&&K.sort(Ui),i=K.shift(),o=K.length,i.__d&&(t=void 0,s=void 0,n=(s=(e=i).__v).__e,r=[],a=[],e.__P&&((t=H({},s)).__v=s.__v+1,S.vnode&&S.vnode(t),dt(e.__P,t,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??Z(s),!!(32&s.__u),a),t.__v=s.__v,t.__.__k[t.__i]=t,Mi(r,t,a),s.__e=s.__=null,t.__e!=n&&Di(t)));ke.__r=0}function Ii(i,e,t,s,n,r,a,o,d,u,c){var h,p,f,m,b,v,g,y=s&&s.__k||Ni,w=e.length;for(d=Us(t,e,y,d,w),h=0;h0?ae(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,o=null,(u=a.__i=Os(a,t,d,h))!=-1&&(h--,(o=t[u])&&(o.__u|=2)),o==null||o.__v==null?(u==-1&&(n>c?p--:nd?p--:p++,a.__u|=4))):i.__k[r]=null;if(h)for(r=0;r(c?1:0)){for(n=t-1,r=t+1;n>=0||r=0?n--:r++])!=null&&(2&u.__u)==0&&o==u.key&&d==u.type)return a}return-1}function Bt(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||ks.test(e)?t:t+"px"}function ge(i,e,t,s,n){var r,a;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof s=="string"&&(i.style.cssText=s=""),s)for(e in s)t&&e in t||Bt(i.style,e,"");if(t)for(e in t)s&&t[e]==s[e]||Bt(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Oi,"$1")),a=e.toLowerCase(),e=a in i||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+r]=t,t?s?t.u=s.u:(t.u=at,i.addEventListener(e,r?Je:Qe,r)):i.removeEventListener(e,r?Je:Qe,r);else{if(n=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function Mt(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=at++;else if(e.t0?i:fe(i)?i.map(xi):H({},i)}function Ns(i,e,t,s,n,r,a,o,d){var u,c,h,p,f,m,b,v=t.props,g=e.props,y=e.type;if(y=="svg"?n="http://www.w3.org/2000/svg":y=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(u=0;u2&&(o.children=arguments.length>3?pe.call(arguments,2):t),ae(i.type,o,s||i.key,n||i.ref,null)}pe=Ni.slice,S={__e:function(i,e,t,s){for(var n,r,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(i)),a=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,s||{}),a=n.__d),a)return n.__E=n}catch(o){i=o}throw i}},ki=0,q.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=H({},this.state),typeof i=="function"&&(i=i(H({},t),this.props)),i&&H(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),It(this))},q.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),It(this))},q.prototype.render=V,K=[],Ai=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ui=function(i,e){return i.__v.__b-e.__v.__b},ke.__r=0,Oi=/(PointerCapture)$|Capture$/i,at=0,Qe=Mt(!1),Je=Mt(!0);var Is=0;function l(i,e,t,s,n,r){e||(e={});var a,o,d=e;if("ref"in d)for(o in d={},e)o=="ref"?a=e[o]:d[o]=e[o];var u={type:i,props:d,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Is,__i:-1,__u:0,__source:n,__self:r};if(typeof i=="function"&&(a=i.defaultProps))for(o in a)d[o]===void 0&&(d[o]=a[o]);return S.vnode&&S.vnode(u),u}var le,C,Me,Rt,de=0,zi=[],E=S,Lt=E.__b,zt=E.__r,$t=E.diffed,Ht=E.__c,qt=E.unmount,jt=E.__;function ht(i,e){E.__h&&E.__h(C,i,de||e),de=0;var t=C.__H||(C.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function ee(i){return de=1,Bs(Hi,i)}function Bs(i,e,t){var s=ht(le++,2);if(s.t=i,!s.__c&&(s.__=[Hi(void 0,e),function(o){var d=s.__N?s.__N[0]:s.__[0],u=s.t(d,o);d!==u&&(s.__N=[u,s.__[1]],s.__c.setState({}))}],s.__c=C,!C.__f)){var n=function(o,d,u){if(!s.__c.__H)return!0;var c=s.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!r||r.call(this,o,d,u);var h=s.__c.props!==o;return c.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),r&&r.call(this,o,d,u)||h};C.__f=!0;var r=C.shouldComponentUpdate,a=C.componentWillUpdate;C.componentWillUpdate=function(o,d,u){if(this.__e){var c=r;r=void 0,n(o,d,u),r=c}a&&a.call(this,o,d,u)},C.shouldComponentUpdate=n}return s.__N||s.__}function Ae(i,e){var t=ht(le++,3);!E.__s&&$i(t.__H,e)&&(t.__=i,t.u=e,C.__H.__h.push(t))}function J(i){return de=5,ct(function(){return{current:i}},[])}function ct(i,e){var t=ht(le++,7);return $i(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Ue(i,e){return de=8,ct(function(){return i},e)}function Ms(){for(var i;i=zi.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ee),i.__H.__h.forEach(et),i.__H.__h=[]}catch(e){i.__H.__h=[],E.__e(e,i.__v)}}E.__b=function(i){C=null,Lt&&Lt(i)},E.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),jt&&jt(i,e)},E.__r=function(i){zt&&zt(i),le=0;var e=(C=i.__c).__H;e&&(Me===C?(e.__h=[],C.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Ee),e.__h.forEach(et),e.__h=[],le=0)),Me=C},E.diffed=function(i){$t&&$t(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(zi.push(e)!==1&&Rt===E.requestAnimationFrame||((Rt=E.requestAnimationFrame)||xs)(Ms)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Me=C=null},E.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ee),t.__h=t.__h.filter(function(s){return!s.__||et(s)})}catch(s){e.some(function(n){n.__h&&(n.__h=[])}),e=[],E.__e(s,t.__v)}}),Ht&&Ht(i,e)},E.unmount=function(i){qt&&qt(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(s){try{Ee(s)}catch(n){e=n}}),t.__H=void 0,e&&E.__e(e,t.__v))};var Vt=typeof requestAnimationFrame=="function";function xs(i){var e,t=function(){clearTimeout(s),Vt&&cancelAnimationFrame(e),setTimeout(i)},s=setTimeout(t,35);Vt&&(e=requestAnimationFrame(t))}function Ee(i){var e=C,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),C=e}function et(i){var e=C;i.__c=i.__(),C=e}function $i(i,e){return!i||i.length!==e.length||e.some(function(t,s){return t!==i[s]})}function Hi(i,e){return typeof e=="function"?e(i):e}const Rs={position:"relative",width:"100%",minHeight:"100%"},Ls={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function zs({data:i,rowHeight:e,renderRow:t,overscanCount:s=10,padding:n=4,...r}){const a=J(null),[o,d]=ee(0),[u,c]=ee(0);Ae(()=>{function y(){a.current!=null&&u!==a.current.offsetHeight&&c(a.current.offsetHeight)}return y(),window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)}},[u]);const h=Ue(()=>{a.current&&d(a.current.scrollTop)},[]);let p=Math.floor(o/e),f=Math.floor(u/e);s&&(p=Math.max(0,p-p%s),f+=s);const m=p+f+n,b=i.slice(p,m),v={...Rs,height:i.length*e},g={...Ls,top:p*e};return l("div",{onScroll:h,ref:a,...r,children:l("div",{role:"presentation",style:v,children:l("div",{role:"presentation",style:g,children:b.map(t)})})})}class $s{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new Ci([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}const Hs={debug:()=>{},warn:()=>{},error:(...i)=>console.error(`[Uppy] [${Ce()}]`,...i)},qs={debug:(...i)=>console.debug(`[Uppy] [${Ce()}]`,...i),warn:(...i)=>console.warn(`[Uppy] [${Ce()}]`,...i),error:(...i)=>console.error(`[Uppy] [${Ce()}]`,...i)};var xe,Wt;function js(){return Wt||(Wt=1,xe=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let s=Math.abs(e);if(t&&(s=-s),s===0)return"0 B";const n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(s)/Math.log(1024)),n.length-1),a=Number(s/1024**r),o=n[r];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${o}`}),xe}var Vs=js();const X=ce(Vs);var Re,Gt;function Ws(){if(Gt)return Re;Gt=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,s=this.parts,n,r=s.length,a;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||"").split(this.separator),n=0;t&&n=2}return s?n(s.split(";")[0]):n},Le}var Ks=Gs();const Xs=ce(Ks),Ys={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class I extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class Qs{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{const s=e();if(s.restrictions?.allowedFileTypes!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:s,maxNumberOfFiles:n}=this.getOpts().restrictions;if(n&&e.filter(a=>!a.isGhost).length+t.length>n)throw new I(`${this.getI18n()("youCanOnlyUploadX",{smart_count:n})}`);if(s){const r=[...e,...t].reduce((a,o)=>a+(o.size??0),0);if(r>s)throw new I(this.getI18n()("aggregateExceedsSize",{sizeAllowed:X(s),size:X(r)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:s,allowedFileTypes:n}=this.getOpts().restrictions;if(n&&!n.some(a=>a.includes("/")?e.type?Xs(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){const a=n.join(", ");throw new I(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new I(this.getI18n()("exceedsSize",{size:X(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(s&&e.size!=null&&e.size{this.validateSingleFile(s)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length(t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e)}class ue extends $s{#e;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof ue||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:ue}}));else if(typeof e=="function"){const s=e;this.uppy.iteratePlugins(n=>{n instanceof s&&(t=n)})}return t}mount(e,t){const s=t.id,n=fs(e);if(n){this.isTargetDOMEl=!0;const o=document.createElement("div");return o.classList.add("uppy-Root"),this.#e=Js(d=>{this.uppy.getPlugin(this.id)&&(xt(this.render(d,o),o),this.afterUpdate())}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),xt(this.render(this.uppy.getState(),o),o),this.el=o,n.appendChild(o),o.dir=this.opts.direction||Fs(o)||"ltr",this.onMount(),this.el}const r=this.getTargetPlugin(e);if(r)return this.uppy.log(`Installing ${s} to ${r.id}`),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${s}`);let a=`Invalid target option given to ${s}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the + - - + + - + - + - + - +