From 1d36e5f51c871c004040b5ad1c153e253107a978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E6=A2=93=E6=9F=92?= <1787882683@qq.com> Date: Sat, 27 Dec 2025 21:04:25 +0800 Subject: [PATCH] WebUI 797d72d7fe63c71594a090436dd4b62ecf96d161 --- .../{icons-CsRP4psU.js => icons-DpP4XnTW.js} | 2 +- webui/dist/assets/index-CumJbTTG.css | 1 + .../{index-wJs3C6WG.js => index-DLMaPlTZ.js} | 62 +++++++++---------- webui/dist/assets/index-DUbuoQZO.css | 1 - webui/dist/index.html | 6 +- 5 files changed, 36 insertions(+), 36 deletions(-) rename webui/dist/assets/{icons-CsRP4psU.js => icons-DpP4XnTW.js} (98%) create mode 100644 webui/dist/assets/index-CumJbTTG.css rename webui/dist/assets/{index-wJs3C6WG.js => index-DLMaPlTZ.js} (62%) delete mode 100644 webui/dist/assets/index-DUbuoQZO.css diff --git a/webui/dist/assets/icons-CsRP4psU.js b/webui/dist/assets/icons-DpP4XnTW.js similarity index 98% rename from webui/dist/assets/icons-CsRP4psU.js rename to webui/dist/assets/icons-DpP4XnTW.js index 51746f84..8e30e1a4 100644 --- a/webui/dist/assets/icons-CsRP4psU.js +++ b/webui/dist/assets/icons-DpP4XnTW.js @@ -1 +1 @@ -import{r as h}from"./router-9vIXuQkh.js";const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=_(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(),x=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var m={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 v=h.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:n="",children:y,iconNode:r,...s},p)=>h.createElement("svg",{ref:p,...m,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",n),...!y&&!x(s)&&{"aria-hidden":"true"},...s},[...r.map(([i,l])=>h.createElement(i,l)),...Array.isArray(y)?y:[y]]));const e=(t,a)=>{const c=h.forwardRef(({className:o,...n},y)=>h.createElement(v,{ref:y,iconNode:a,className:k(`lucide-${M(d(t))}`,`lucide-${t}`,o),...n}));return c.displayName=d(t),c};const g=[["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"}]],z2=e("activity",g);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],q2=e("arrow-left",u);const f=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],b2=e("arrow-right",f);const w=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],j2=e("arrow-up-down",w);const N=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],C2=e("arrow-up",N);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],A2=e("ban",$);const z=[["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"}]],L2=e("book-open",z);const q=[["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"}]],V2=e("bot",q);const b=[["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"}]],H2=e("boxes",b);const j=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],S2=e("brain",j);const C=[["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",C);const A=[["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"}]],U2=e("calendar",A);const L=[["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"}]],B2=e("chart-column",L);const V=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],T2=e("check",V);const H=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D2=e("chevron-down",H);const S=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],R2=e("chevron-left",S);const P=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],E2=e("chevron-right",P);const U=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Z2=e("chevron-up",U);const B=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],F2=e("chevrons-left",B);const T=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],G2=e("chevrons-right",T);const D=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],O2=e("chevrons-up-down",D);const R=[["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"}]],I2=e("circle-alert",R);const E=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],W2=e("circle-check-big",E);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],K2=e("circle-check",Z);const F=[["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"}]],Q2=e("circle-question-mark",F);const G=[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],J2=e("circle-user-round",G);const O=[["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"}]],X2=e("circle-user",O);const I=[["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"}]],Y2=e("circle-x",I);const W=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],e0=e("circle",W);const K=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],a0=e("clipboard-list",K);const Q=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],t0=e("clock",Q);const J=[["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"}]],c0=e("code-xml",J);const X=[["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"}]],o0=e("container",X);const Y=[["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"}]],y0=e("copy",Y);const e1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],h0=e("cpu",e1);const a1=[["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"}]],n0=e("database",a1);const t1=[["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"}]],s0=e("dollar-sign",t1);const c1=[["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"}]],d0=e("download",c1);const o1=[["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"}]],k0=e("external-link",o1);const y1=[["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"}]],r0=e("eye-off",y1);const h1=[["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"}]],p0=e("eye",h1);const n1=[["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:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],i0=e("file-question-mark",n1);const s1=[["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"}]],l0=e("file-search",s1);const d1=[["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"}]],M0=e("file-text",d1);const k1=[["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"}]],_0=e("folder-open",k1);const r1=[["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"}]],x0=e("funnel",r1);const p1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],m0=e("git-branch",p1);const i1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v0=e("globe",i1);const l1=[["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"}]],g0=e("graduation-cap",l1);const M1=[["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"}]],u0=e("grip-vertical",M1);const _1=[["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"}]],f0=e("hard-drive",_1);const x1=[["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"}]],w0=e("hash",x1);const m1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],N0=e("heart",m1);const v1=[["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"}]],$0=e("house",v1);const g1=[["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"}]],z0=e("image",g1);const u1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],q0=e("info",u1);const f1=[["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"}]],b0=e("key",f1);const w1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],j0=e("layers",w1);const N1=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],C0=e("layout-grid",N1);const $1=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],A0=e("list-checks",$1);const z1=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],L0=e("list",z1);const q1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],V0=e("loader-circle",q1);const b1=[["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"}]],H0=e("lock",b1);const j1=[["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"}]],S0=e("log-out",j1);const C1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],P0=e("menu",C1);const A1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],U0=e("message-circle",A1);const L1=[["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"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],B0=e("message-square-text",L1);const V1=[["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"}]],T0=e("message-square",V1);const H1=[["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"}]],D0=e("moon",H1);const S1=[["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"}]],R0=e("network",S1);const P1=[["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"}]],E0=e("package",P1);const U1=[["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"}]],Z0=e("palette",U1);const B1=[["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"}]],F0=e("panels-top-left",B1);const T1=[["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"}]],G0=e("pause",T1);const D1=[["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"}]],O0=e("pen",D1);const R1=[["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"}]],I0=e("pencil",R1);const E1=[["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"}]],W0=e("play",E1);const Z1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],K0=e("plus",Z1);const F1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Q0=e("power",F1);const G1=[["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"}]],J0=e("puzzle",G1);const O1=[["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"}]],X0=e("refresh-cw",O1);const I1=[["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"}]],Y0=e("rotate-ccw",I1);const W1=[["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"}]],ee=e("rotate-cw",W1);const K1=[["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"}]],ae=e("save",K1);const Q1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],te=e("search",Q1);const J1=[["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"}]],ce=e("send",J1);const X1=[["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"}]],oe=e("server",X1);const Y1=[["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"}]],ye=e("settings-2",Y1);const e2=[["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"}]],he=e("settings",e2);const a2=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ne=e("share-2",a2);const t2=[["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"}]],se=e("shield",t2);const c2=[["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"}]],de=e("skip-forward",c2);const o2=[["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"}]],ke=e("sliders-vertical",o2);const y2=[["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"}]],re=e("smile",y2);const h2=[["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"}]],pe=e("sparkles",h2);const n2=[["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"}]],ie=e("square-pen",n2);const s2=[["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"}]],le=e("star",s2);const d2=[["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"}]],Me=e("sun",d2);const k2=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],_e=e("tag",k2);const r2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xe=e("terminal",r2);const p2=[["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"}]],me=e("thumbs-down",p2);const i2=[["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"}]],ve=e("thumbs-up",i2);const l2=[["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"}]],ge=e("trash-2",l2);const M2=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ue=e("trending-up",M2);const _2=[["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"}]],fe=e("triangle-alert",_2);const x2=[["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"}]],we=e("type",x2);const m2=[["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"}]],Ne=e("upload",m2);const v2=[["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"}]],$e=e("user",v2);const g2=[["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"}]],ze=e("users",g2);const u2=[["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"}]],qe=e("wifi-off",u2);const f2=[["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"}]],be=e("wifi",f2);const w2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],je=e("x",w2);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"}]],Ce=e("zap",N2);export{F0 as $,z2 as A,V2 as B,I2 as C,s0 as D,r0 as E,M0 as F,te as G,f0 as H,q0 as I,$0 as J,b0 as K,V0 as L,T0 as M,q2 as N,K0 as O,Q0 as P,D2 as Q,X0 as R,he as S,ue as T,Ne as U,Z2 as V,l0 as W,je as X,u0 as Y,Ce as Z,ae as _,Y0 as a,c0 as a0,I0 as a1,F2 as a2,R2 as a3,E2 as a4,G2 as a5,O2 as a6,ne as a7,E0 as a8,oe as a9,le as aA,C0 as aB,ve as aC,me as aD,m0 as aE,J2 as aF,be as aG,qe as aH,O0 as aI,ce as aJ,e0 as aK,i0 as aL,N0 as aM,j2 as aN,H2 as aO,X2 as aP,B2 as aQ,C2 as aR,ke as aS,P0 as aT,L2 as aU,S0 as aV,P2 as aW,j0 as aa,A0 as ab,_e as ac,g0 as ad,o0 as ae,_0 as af,z0 as ag,x0 as ah,ie as ai,A2 as aj,w0 as ak,U0 as al,v0 as am,ze as an,R0 as ao,G0 as ap,W0 as aq,U2 as ar,we as as,S2 as at,L0 as au,W2 as av,h0 as aw,B0 as ax,ee as ay,ye as az,K2 as b,J0 as c,a0 as d,n0 as e,t0 as f,Z0 as g,se as h,fe as i,T2 as j,y0 as k,p0 as l,Y2 as m,ge as n,d0 as o,Me as p,D0 as q,H0 as r,Q2 as s,xe as t,k0 as u,pe as v,$e as w,re as x,de as y,b2 as z}; +import{r as h}from"./router-9vIXuQkh.js";const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=_(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(),x=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var m={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 v=h.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:n="",children:y,iconNode:r,...s},p)=>h.createElement("svg",{ref:p,...m,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",n),...!y&&!x(s)&&{"aria-hidden":"true"},...s},[...r.map(([i,l])=>h.createElement(i,l)),...Array.isArray(y)?y:[y]]));const e=(t,a)=>{const c=h.forwardRef(({className:o,...n},y)=>h.createElement(v,{ref:y,iconNode:a,className:k(`lucide-${M(d(t))}`,`lucide-${t}`,o),...n}));return c.displayName=d(t),c};const g=[["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"}]],z2=e("activity",g);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],q2=e("arrow-left",u);const f=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],b2=e("arrow-right",f);const w=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],j2=e("arrow-up-down",w);const N=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],C2=e("arrow-up",N);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],A2=e("ban",$);const z=[["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"}]],L2=e("book-open",z);const q=[["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"}]],V2=e("bot",q);const b=[["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"}]],H2=e("boxes",b);const j=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],S2=e("brain",j);const C=[["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",C);const A=[["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"}]],U2=e("calendar",A);const L=[["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"}]],B2=e("chart-column",L);const V=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],T2=e("check",V);const H=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D2=e("chevron-down",H);const S=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],R2=e("chevron-left",S);const P=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],E2=e("chevron-right",P);const U=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Z2=e("chevron-up",U);const B=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],F2=e("chevrons-left",B);const T=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],G2=e("chevrons-right",T);const D=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],O2=e("chevrons-up-down",D);const R=[["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"}]],I2=e("circle-alert",R);const E=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],W2=e("circle-check-big",E);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],K2=e("circle-check",Z);const F=[["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"}]],Q2=e("circle-question-mark",F);const G=[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],J2=e("circle-user-round",G);const O=[["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"}]],X2=e("circle-user",O);const I=[["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"}]],Y2=e("circle-x",I);const W=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],e0=e("circle",W);const K=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],a0=e("clipboard-list",K);const Q=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],t0=e("clock",Q);const J=[["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"}]],c0=e("code-xml",J);const X=[["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"}]],o0=e("container",X);const Y=[["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"}]],y0=e("copy",Y);const e1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],h0=e("cpu",e1);const a1=[["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"}]],n0=e("database",a1);const t1=[["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"}]],s0=e("dollar-sign",t1);const c1=[["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"}]],d0=e("download",c1);const o1=[["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"}]],k0=e("external-link",o1);const y1=[["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"}]],r0=e("eye-off",y1);const h1=[["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"}]],p0=e("eye",h1);const n1=[["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:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],i0=e("file-question-mark",n1);const s1=[["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"}]],l0=e("file-search",s1);const d1=[["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"}]],M0=e("file-text",d1);const k1=[["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"}]],_0=e("folder-open",k1);const r1=[["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"}]],x0=e("funnel",r1);const p1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],m0=e("git-branch",p1);const i1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v0=e("globe",i1);const l1=[["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"}]],g0=e("graduation-cap",l1);const M1=[["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"}]],u0=e("grip-vertical",M1);const _1=[["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"}]],f0=e("hard-drive",_1);const x1=[["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"}]],w0=e("hash",x1);const m1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],N0=e("heart",m1);const v1=[["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"}]],$0=e("house",v1);const g1=[["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"}]],z0=e("image",g1);const u1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],q0=e("info",u1);const f1=[["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"}]],b0=e("key",f1);const w1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],j0=e("layers",w1);const N1=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],C0=e("layout-grid",N1);const $1=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],A0=e("list-checks",$1);const z1=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],L0=e("list",z1);const q1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],V0=e("loader-circle",q1);const b1=[["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"}]],H0=e("lock",b1);const j1=[["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"}]],S0=e("log-out",j1);const C1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],P0=e("menu",C1);const A1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],U0=e("message-circle",A1);const L1=[["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"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],B0=e("message-square-text",L1);const V1=[["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"}]],T0=e("message-square",V1);const H1=[["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"}]],D0=e("moon",H1);const S1=[["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"}]],R0=e("network",S1);const P1=[["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"}]],E0=e("package",P1);const U1=[["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"}]],Z0=e("palette",U1);const B1=[["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"}]],F0=e("panels-top-left",B1);const T1=[["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"}]],G0=e("pause",T1);const D1=[["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"}]],O0=e("pen",D1);const R1=[["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"}]],I0=e("pencil",R1);const E1=[["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"}]],W0=e("play",E1);const Z1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],K0=e("plus",Z1);const F1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Q0=e("power",F1);const G1=[["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"}]],J0=e("puzzle",G1);const O1=[["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"}]],X0=e("refresh-cw",O1);const I1=[["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"}]],Y0=e("rotate-ccw",I1);const W1=[["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"}]],ee=e("rotate-cw",W1);const K1=[["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"}]],ae=e("save",K1);const Q1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],te=e("search",Q1);const J1=[["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"}]],ce=e("send",J1);const X1=[["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"}]],oe=e("server",X1);const Y1=[["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"}]],ye=e("settings-2",Y1);const e2=[["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"}]],he=e("settings",e2);const a2=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ne=e("share-2",a2);const t2=[["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"}]],se=e("shield",t2);const c2=[["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"}]],de=e("skip-forward",c2);const o2=[["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"}]],ke=e("sliders-vertical",o2);const y2=[["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"}]],re=e("smile",y2);const h2=[["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"}]],pe=e("sparkles",h2);const n2=[["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"}]],ie=e("square-pen",n2);const s2=[["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"}]],le=e("star",s2);const d2=[["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"}]],Me=e("sun",d2);const k2=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],_e=e("tag",k2);const r2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xe=e("terminal",r2);const p2=[["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"}]],me=e("thumbs-down",p2);const i2=[["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"}]],ve=e("thumbs-up",i2);const l2=[["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"}]],ge=e("trash-2",l2);const M2=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ue=e("trending-up",M2);const _2=[["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"}]],fe=e("triangle-alert",_2);const x2=[["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"}]],we=e("type",x2);const m2=[["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"}]],Ne=e("upload",m2);const v2=[["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"}]],$e=e("user",v2);const g2=[["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"}]],ze=e("users",g2);const u2=[["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"}]],qe=e("wifi-off",u2);const f2=[["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"}]],be=e("wifi",f2);const w2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],je=e("x",w2);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"}]],Ce=e("zap",N2);export{F0 as $,z2 as A,V2 as B,I2 as C,s0 as D,r0 as E,M0 as F,te as G,f0 as H,q0 as I,$0 as J,b0 as K,V0 as L,T0 as M,q2 as N,K0 as O,Q0 as P,D2 as Q,X0 as R,he as S,ue as T,Ne as U,Z2 as V,l0 as W,je as X,u0 as Y,Ce as Z,ae as _,Y0 as a,c0 as a0,I0 as a1,F2 as a2,R2 as a3,E2 as a4,G2 as a5,O2 as a6,ne as a7,E0 as a8,oe as a9,ye as aA,le as aB,C0 as aC,ve as aD,me as aE,m0 as aF,J2 as aG,be as aH,qe as aI,O0 as aJ,ce as aK,i0 as aL,N0 as aM,j2 as aN,H2 as aO,X2 as aP,B2 as aQ,C2 as aR,ke as aS,P0 as aT,L2 as aU,S0 as aV,P2 as aW,j0 as aa,A0 as ab,_e as ac,g0 as ad,o0 as ae,_0 as af,z0 as ag,x0 as ah,ie as ai,A2 as aj,w0 as ak,e0 as al,U0 as am,v0 as an,ze as ao,R0 as ap,G0 as aq,W0 as ar,U2 as as,we as at,S2 as au,L0 as av,W2 as aw,h0 as ax,B0 as ay,ee as az,K2 as b,J0 as c,a0 as d,n0 as e,t0 as f,Z0 as g,se as h,fe as i,T2 as j,y0 as k,p0 as l,Y2 as m,ge as n,d0 as o,Me as p,D0 as q,H0 as r,Q2 as s,xe as t,k0 as u,pe as v,$e as w,re as x,de as y,b2 as z}; diff --git a/webui/dist/assets/index-CumJbTTG.css b/webui/dist/assets/index-CumJbTTG.css new file mode 100644 index 00000000..826b1276 --- /dev/null +++ b/webui/dist/assets/index-CumJbTTG.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: 210 40% 98%;--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}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-16{inset:4rem}.inset-8{inset:2rem}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-24{bottom:6rem}.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\/3{right:33.333333%}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.right-8{right:2rem}.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-3\/4{top:75%}.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-1{margin-left:.25rem;margin-right:.25rem}.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-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-1{margin-top:-.25rem}.-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-0\.5{margin-left:.125rem}.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-1\.5{margin-right:.375rem}.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-block{display:inline-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-24{height:6rem}.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-96{height:24rem}.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-\[600px\]{height:600px}.h-\[70vh\]{height:70vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.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-\[calc\(85vh-220px\)\]{height:calc(85vh - 220px)}.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-32{max-height:8rem}.max-h-64{max-height:16rem}.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-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[60vh\]{max-height:60vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.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-\[400px\]{min-height:400px}.min-h-\[40px\]{min-height:40px}.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-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.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-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[140px\]{width:140px}.w-\[1px\]{width:1px}.w-\[200px\]{width:200px}.w-\[600px\]{width:600px}.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-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[200px\]{min-width:200px}.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-\[100px\]{max-width:100px}.max-w-\[150px\]{max-width:150px}.max-w-\[180px\]{max-width:180px}.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-none{flex:none}.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-1\/2{--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-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-32{--tw-translate-x: 8rem;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-90{--tw-rotate: -90deg;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))}.animate-\[ping_3s_ease-in-out_infinite\]{animation:ping 3s ease-in-out infinite}.animate-\[ping_3s_ease-in-out_infinite_0\.5s\]{animation:ping 3s ease-in-out infinite .5s}.animate-\[ping_3s_ease-in-out_infinite_1s\]{animation:ping 3s ease-in-out infinite 1s}@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 ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) 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-none{resize:none}.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))}.grid-rows-\[auto_1fr_auto\]{grid-template-rows:auto 1fr auto}.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-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\/20{border-color:#f59e0b33}.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-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / 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-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / 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\/10{border-color:hsl(var(--primary) / .1)}.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-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.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-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.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\/50{background-color:hsl(var(--card) / .5)}.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-muted\/60{background-color:hsl(var(--muted) / .6)}.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-foreground\/20{background-color:hsl(var(--primary-foreground) / .2)}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/15{background-color:hsl(var(--primary) / .15)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-primary\/60{background-color:hsl(var(--primary) / .6)}.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-red-500{fill:#ef4444}.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-0\.5{padding:.125rem}.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-\[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-6{padding-left:1.5rem;padding-right:1.5rem}.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}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.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-2\.5{padding-right:.625rem}.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-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.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-800{--tw-text-opacity: 1;color:rgb(146 64 14 / 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-400{--tw-text-opacity: 1;color:rgb(156 163 175 / 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\/10{color:hsl(var(--muted-foreground) / .1)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.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-foreground\/70{color:hsl(var(--primary-foreground) / .7)}.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-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.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-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.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}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,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\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}.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-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.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:hover{background-color:hsl(var(--muted))}.hover\:bg-muted-foreground\/20:hover{background-color:hsl(var(--muted-foreground) / .2)}.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-amber-900:hover{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.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:hover{color:hsl(var(--primary))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.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\:opacity-80:hover{opacity:.8}.hover\:shadow-2xl:hover{--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)}.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\:shadow-md:hover{--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)}.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\:-translate-y-1{--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))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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-\[state\=inactive\]\:hidden[data-state=inactive]{display:none}.data-\[state\=inactive\]\:h-0[data-state=inactive]{height:0px}.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-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / 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-green-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(20 83 45 / 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-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / 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\/20:is(.dark *){background-color:#450a0a33}.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-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / 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-amber-500:is(.dark *){--tw-text-opacity: 1;color:rgb(245 158 11 / 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-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / 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-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / 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\:hover\:text-amber-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 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\: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-2\.5{height:.625rem}.sm\:h-24{height:6rem}.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-220px\)\]{height:calc(100vh - 220px)}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-2\.5{width:.625rem}.sm\:w-24{width:6rem}.sm\:w-28{width:7rem}.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-\[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-\[500px\]{max-width:500px}.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\: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-3{padding-bottom:.75rem}.sm\:text-left{text-align:left}.sm\:text-right{text-align:right}.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\:inline{display:inline}.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\:inline{display:inline}.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-\[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-7{grid-template-columns:repeat(7,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-4{padding:1rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:pb-4{padding-bottom:1rem}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.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}.\[\&\:\:-webkit-scrollbar-thumb\:hover\]\:bg-border\/80::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--border) / .8)}.\[\&\:\:-webkit-scrollbar-thumb\]\:rounded-full::-webkit-scrollbar-thumb{border-radius:9999px}.\[\&\:\:-webkit-scrollbar-thumb\]\:bg-border::-webkit-scrollbar-thumb{background-color:hsl(var(--border))}.\[\&\:\:-webkit-scrollbar-track\]\:bg-transparent::-webkit-scrollbar-track{background-color:transparent}.\[\&\:\:-webkit-scrollbar\]\:w-2\.5::-webkit-scrollbar{width:.625rem}.\[\&\: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))}.\[\&\>div\]\:bg-green-500>div{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.\[\&\>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}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--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))}.\[\&_\.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}@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.27"}.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}.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-truncate-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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)}.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-wJs3C6WG.js b/webui/dist/assets/index-DLMaPlTZ.js similarity index 62% rename from webui/dist/assets/index-wJs3C6WG.js rename to webui/dist/assets/index-DLMaPlTZ.js index 67503570..f74940b3 100644 --- a/webui/dist/assets/index-wJs3C6WG.js +++ b/webui/dist/assets/index-DLMaPlTZ.js @@ -1,79 +1,79 @@ -import{r as m,j as e,L as Dr,e as ia,R as zs,b as u0,f as m0,g as x0,h as h0,k as f0,l as Js,m as p0,n as g0,O as Eg,o as j0}from"./router-9vIXuQkh.js";import{a as v0,b as N0,g as b0}from"./react-vendor-BmxF9s7Q.js";import{N as y0,c as w0,O as Hr,P as _0,g as mm}from"./utils-BqoaXoQ1.js";import{L as Mg,T as Ag,C as zg,R as S0,a as Dg,V as k0,b as C0,S as Og,c as T0,d as Rg,I as E0,e as Lg,f as M0,g as Ug,h as A0,i as z0,j as D0,O as Bg,P as O0,k as $g,l as Ig,D as Pg,A as Hg,m as Fg,n as R0,o as L0,p as Gg,q as U0,r as Vg,s as B0,t as $0,u as qg,v as I0,w as P0,x as Kg,y as Qg,F as Yg,z as Jg,B as H0,E as F0,G as Xg,H as G0,J as V0,K as q0,M as K0,N as Q0,Q as Y0,U as J0,W as X0,X as Z0,Y as W0,Z as ew,_ as sw,$ as tw,a0 as aw,a1 as lw,a2 as Zg,a3 as nw,a4 as rw}from"./radix-extra-CTMrA3du.js";import{R as iw,T as cw,L as ow,g as dw,C as jo,X as vo,Y as Oi,h as uw,B as xm,j as No,P as mw,k as xw,l as hw}from"./charts-simvewUa.js";import{S as fw,H as Wg,O as ej,o as pw,C as sj,p as gw,T as tj,D as aj,R as jw,q as vw,I as lj,J as Nw,K as nj,L as rj,M as bw,N as ij,V as yw,Q as cj,U as oj,X as ww,Y as _w,Z as dj,_ as Sw,$ as kw,a0 as uj,a1 as Cw,e as mj,f as Io,c as Po,P as Gn,d as Ho,b as un,h as Tw,l as Ew,m as Mw,u as Mm,r as Aw,a as zw,a2 as Dw,a3 as xj,a4 as Ow,a5 as Rw,a6 as Lw,a7 as hj,a8 as fj,a9 as pj,aa as gj,ab as jj,ac as vj,ad as Uw}from"./radix-core-BdJoVJLV.js";import{R as ft,a as Vi,C as St,b as la,L as Ls,P as ec,Z as El,F as Sa,c as Bw,S as mn,d as $w,M as Pa,A as $m,D as Iw,e as Br,f as Ya,T as Im,X as Ca,g as Pw,h as Nj,I as Yt,i as Qt,j as _t,k as Eo,E as qi,l as na,m as Mo,H as Hw,n as ns,o as Zt,U as Ki,p as bj,q as yj,r as Xp,K as Pm,s as wj,t as Fw,u as _o,v as Gw,B as Bi,w as Bn,x as Hm,y as Vw,z as qw,G as Ot,J as Fo,N as ka,O as Zs,Q as Ta,V as $r,W as Fm,Y as _j,_ as sc,$ as Sj,a0 as kj,a1 as $n,a2 as xn,a3 as Fa,a4 as ea,a5 as hn,a6 as Gm,a7 as Cj,a8 as aa,a9 as Al,aa as In,ab as Pn,ac as Go,ad as Kw,ae as Qw,af as Yw,ag as Tj,ah as So,ai as Hn,aj as Jw,ak as Ir,al as Xw,am as Ao,an as Am,ao as Ej,ap as Zw,aq as Ww,ar as Zp,as as e1,at as Mj,au as s1,av as Wp,aw as t1,ax as a1,ay as Aj,az as l1,aA as rn,aB as zj,aC as hm,aD as eg,aE as n1,aF as fm,aG as r1,aH as i1,aI as c1,aJ as o1,aK as Dj,aL as Oj,aM as zo,aN as d1,aO as Rj,aP as Lj,aQ as u1,aR as m1,aS as sg,aT as x1,aU as h1,aV as f1,aW as p1}from"./icons-CsRP4psU.js";import{S as g1,p as j1,j as v1,a as N1,E as tg,R as b1,o as y1}from"./codemirror-TZqPU532.js";import{u as Uj,a as Do,s as Bj,K as $j,P as Ij,b as Pj,D as Hj,c as Fj,S as Gj,v as w1,d as Vj,C as qj,h as _1}from"./dnd-BiPfFtVp.js";import{_ as pa,c as S1,g as Kj,D as k1,z as bo}from"./misc-CDy9pI_Y.js";import{D as C1,U as T1}from"./uppy-x-2TBvZ1.js";import{M as E1,r as M1,a as A1,b as z1}from"./markdown-CKA5gBQ9.js";import{c as D1,H as Oo,P as Ro,u as O1,d as R1,R as L1,B as U1,e as B1,C as $1,M as I1,f as P1}from"./reactflow-DtsZHOR4.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))c(u);new MutationObserver(u=>{for(const x of u)if(x.type==="childList")for(const h of x.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(u){const x={};return u.integrity&&(x.integrity=u.integrity),u.referrerPolicy&&(x.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?x.credentials="include":u.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function c(u){if(u.ep)return;u.ep=!0;const x=i(u);fetch(u.href,x)}})();var pm={exports:{}},Ri={},gm={exports:{}},jm={};var ag;function H1(){return ag||(ag=1,(function(l){function n(z,Q){var $=z.length;z.push(Q);e:for(;0<$;){var L=$-1>>>1,I=z[L];if(0>>1;L<_e;){var je=2*(L+1)-1,Se=z[je],K=je+1,U=z[K];if(0>u(Se,$))Ku(U,Se)?(z[L]=U,z[K]=$,L=K):(z[L]=Se,z[je]=$,L=je);else if(Ku(U,$))z[L]=U,z[K]=$,L=K;else break e}}return Q}function u(z,Q){var $=z.sortIndex-Q.sortIndex;return $!==0?$:z.id-Q.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;l.unstable_now=function(){return x.now()}}else{var h=Date,f=h.now();l.unstable_now=function(){return h.now()-f}}var p=[],g=[],N=1,v=null,y=3,w=!1,b=!1,D=!1,A=!1,_=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function C(z){for(var Q=i(g);Q!==null;){if(Q.callback===null)c(g);else if(Q.startTime<=z)c(g),Q.sortIndex=Q.expirationTime,n(p,Q);else break;Q=i(g)}}function M(z){if(D=!1,C(z),!b)if(i(p)!==null)b=!0,G||(G=!0,ve());else{var Q=i(g);Q!==null&&fe(M,Q.startTime-z)}}var G=!1,O=-1,ee=5,R=-1;function me(){return A?!0:!(l.unstable_now()-Rz&&me());){var L=v.callback;if(typeof L=="function"){v.callback=null,y=v.priorityLevel;var I=L(v.expirationTime<=z);if(z=l.unstable_now(),typeof I=="function"){v.callback=I,C(z),Q=!0;break s}v===i(p)&&c(p),C(z)}else c(p);v=i(p)}if(v!==null)Q=!0;else{var _e=i(g);_e!==null&&fe(M,_e.startTime-z),Q=!1}}break e}finally{v=null,y=$,w=!1}Q=void 0}}finally{Q?ve():G=!1}}}var ve;if(typeof E=="function")ve=function(){E(ce)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ge=se.port2;se.port1.onmessage=ce,ve=function(){ge.postMessage(null)}}else ve=function(){_(ce,0)};function fe(z,Q){O=_(function(){z(l.unstable_now())},Q)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125L?(z.sortIndex=$,n(g,z),i(p)===null&&z===i(g)&&(D?(P(O),O=-1):D=!0,fe(M,$-L))):(z.sortIndex=I,n(p,z),b||w||(b=!0,G||(G=!0,ve()))),z},l.unstable_shouldYield=me,l.unstable_wrapCallback=function(z){var Q=y;return function(){var $=y;y=Q;try{return z.apply(this,arguments)}finally{y=$}}}})(jm)),jm}var lg;function F1(){return lg||(lg=1,gm.exports=H1()),gm.exports}var ng;function G1(){if(ng)return Ri;ng=1;var l=F1(),n=v0(),i=N0();function c(s){var t="https://react.dev/errors/"+s;if(1I||(s.current=L[I],L[I]=null,I--)}function Se(s,t){I++,L[I]=s.current,s.current=t}var K=_e(null),U=_e(null),V=_e(null),xe=_e(null);function Ae(s,t){switch(Se(V,t),Se(U,s),Se(K,null),t.nodeType){case 9:case 11:s=(s=t.documentElement)&&(s=s.namespaceURI)?Np(s):0;break;default:if(s=t.tagName,t=t.namespaceURI)t=Np(t),s=bp(t,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}je(K),Se(K,s)}function X(){je(K),je(U),je(V)}function oe(s){s.memoizedState!==null&&Se(xe,s);var t=K.current,a=bp(t,s.type);t!==a&&(Se(U,s),Se(K,a))}function Fe(s){U.current===s&&(je(K),je(U)),xe.current===s&&(je(xe),Mi._currentValue=$)}var Y,te;function Oe(s){if(Y===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Y=t&&t[1]||"",te=-1{for(const x of u)if(x.type==="childList")for(const h of x.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(u){const x={};return u.integrity&&(x.integrity=u.integrity),u.referrerPolicy&&(x.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?x.credentials="include":u.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function c(u){if(u.ep)return;u.ep=!0;const x=i(u);fetch(u.href,x)}})();var gm={exports:{}},Ri={},jm={exports:{}},vm={};var lg;function H1(){return lg||(lg=1,(function(l){function n(z,Q){var I=z.length;z.push(Q);e:for(;0>>1,$=z[L];if(0>>1;L<_e;){var je=2*(L+1)-1,Se=z[je],K=je+1,U=z[K];if(0>u(Se,I))K<$&&0>u(U,Se)?(z[L]=U,z[K]=I,L=K):(z[L]=Se,z[je]=I,L=je);else if(K<$&&0>u(U,I))z[L]=U,z[K]=I,L=K;else break e}}return Q}function u(z,Q){var I=z.sortIndex-Q.sortIndex;return I!==0?I:z.id-Q.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;l.unstable_now=function(){return x.now()}}else{var h=Date,f=h.now();l.unstable_now=function(){return h.now()-f}}var p=[],g=[],N=1,v=null,y=3,w=!1,b=!1,D=!1,A=!1,_=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function C(z){for(var Q=i(g);Q!==null;){if(Q.callback===null)c(g);else if(Q.startTime<=z)c(g),Q.sortIndex=Q.expirationTime,n(p,Q);else break;Q=i(g)}}function M(z){if(D=!1,C(z),!b)if(i(p)!==null)b=!0,G||(G=!0,ve());else{var Q=i(g);Q!==null&&fe(M,Q.startTime-z)}}var G=!1,O=-1,ee=5,R=-1;function me(){return A?!0:!(l.unstable_now()-Rz&&me());){var L=v.callback;if(typeof L=="function"){v.callback=null,y=v.priorityLevel;var $=L(v.expirationTime<=z);if(z=l.unstable_now(),typeof $=="function"){v.callback=$,C(z),Q=!0;break s}v===i(p)&&c(p),C(z)}else c(p);v=i(p)}if(v!==null)Q=!0;else{var _e=i(g);_e!==null&&fe(M,_e.startTime-z),Q=!1}}break e}finally{v=null,y=I,w=!1}Q=void 0}}finally{Q?ve():G=!1}}}var ve;if(typeof E=="function")ve=function(){E(ce)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ge=se.port2;se.port1.onmessage=ce,ve=function(){ge.postMessage(null)}}else ve=function(){_(ce,0)};function fe(z,Q){O=_(function(){z(l.unstable_now())},Q)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125L?(z.sortIndex=I,n(g,z),i(p)===null&&z===i(g)&&(D?(H(O),O=-1):D=!0,fe(M,I-L))):(z.sortIndex=$,n(p,z),b||w||(b=!0,G||(G=!0,ve()))),z},l.unstable_shouldYield=me,l.unstable_wrapCallback=function(z){var Q=y;return function(){var I=y;y=Q;try{return z.apply(this,arguments)}finally{y=I}}}})(vm)),vm}var ng;function F1(){return ng||(ng=1,jm.exports=H1()),jm.exports}var rg;function G1(){if(rg)return Ri;rg=1;var l=F1(),n=v0(),i=N0();function c(s){var t="https://react.dev/errors/"+s;if(1$||(s.current=L[$],L[$]=null,$--)}function Se(s,t){$++,L[$]=s.current,s.current=t}var K=_e(null),U=_e(null),V=_e(null),xe=_e(null);function Ae(s,t){switch(Se(V,t),Se(U,s),Se(K,null),t.nodeType){case 9:case 11:s=(s=t.documentElement)&&(s=s.namespaceURI)?bp(s):0;break;default:if(s=t.tagName,t=t.namespaceURI)t=bp(t),s=yp(t,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}je(K),Se(K,s)}function X(){je(K),je(U),je(V)}function oe(s){s.memoizedState!==null&&Se(xe,s);var t=K.current,a=yp(t,s.type);t!==a&&(Se(U,s),Se(K,a))}function Ge(s){U.current===s&&(je(K),je(U)),xe.current===s&&(je(xe),Mi._currentValue=I)}var Y,te;function Oe(s){if(Y===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Y=t&&t[1]||"",te=-1)":-1o||B[r]!==le[o]){var pe=` `+B[r].replace(" at new "," at ");return s.displayName&&pe.includes("")&&(pe=pe.replace("",s.displayName)),pe}while(1<=r&&0<=o);break}}}finally{De=!1,Error.prepareStackTrace=a}return(a=s?s.displayName||s.name:"")?Oe(a):""}function de(s,t){switch(s.tag){case 26:case 27:case 5:return Oe(s.type);case 16:return Oe("Lazy");case 13:return s.child!==t&&t!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Me(s.type,!1);case 11:return Me(s.type.render,!1);case 1:return Me(s.type,!0);case 31:return Oe("Activity");default:return""}}function Te(s){try{var t="",a=null;do t+=de(s,a),a=s,s=s.return;while(s);return t}catch(r){return` Error generating stack: `+r.message+` -`+r.stack}}var rs=Object.prototype.hasOwnProperty,Rt=l.unstable_scheduleCallback,sa=l.unstable_cancelCallback,Ga=l.unstable_shouldYield,Pt=l.unstable_requestPaint,ut=l.unstable_now,q=l.unstable_getCurrentPriorityLevel,qe=l.unstable_ImmediatePriority,Qe=l.unstable_UserBlockingPriority,We=l.unstable_NormalPriority,Ds=l.unstable_LowPriority,as=l.unstable_IdlePriority,ks=l.log,Ee=l.unstable_setDisableYieldValue,vs=null,ls=null;function es(s){if(typeof ks=="function"&&Ee(s),ls&&typeof ls.setStrictMode=="function")try{ls.setStrictMode(vs,s)}catch{}}var Ns=Math.clz32?Math.clz32:tt,pt=Math.log,Lt=Math.LN2;function tt(s){return s>>>=0,s===0?32:31-(pt(s)/Lt|0)|0}var Es=256,kt=262144,Ut=4194304;function Ea(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 Za(s,t,a){var r=s.pendingLanes;if(r===0)return 0;var o=0,d=s.suspendedLanes,j=s.pingedLanes;s=s.warmLanes;var k=r&134217727;return k!==0?(r=k&~d,r!==0?o=Ea(r):(j&=k,j!==0?o=Ea(j):a||(a=k&~s,a!==0&&(o=Ea(a))))):(k=r&~d,k!==0?o=Ea(k):j!==0?o=Ea(j):a||(a=r&~s,a!==0&&(o=Ea(a)))),o===0?0:t!==0&&t!==o&&(t&d)===0&&(d=o&-o,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:o}function il(s,t){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&t)===0}function Kn(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 Z(){var s=Ut;return Ut<<=1,(Ut&62914560)===0&&(Ut=4194304),s}function ye(s){for(var t=[],a=0;31>a;a++)t.push(s);return t}function ze(s,t){s.pendingLanes|=t,t!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Hs(s,t,a,r,o,d){var j=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 k=s.entanglements,B=s.expirationTimes,le=s.hiddenUpdates;for(a=j&~a;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var nb=/[\n"\\]/g;function Aa(s){return s.replace(nb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rd(s,t,a,r,o,d,j,k){s.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?s.type=j:s.removeAttribute("type"),t!=null?j==="number"?(t===0&&s.value===""||s.value!=t)&&(s.value=""+Ma(t)):s.value!==""+Ma(t)&&(s.value=""+Ma(t)):j!=="submit"&&j!=="reset"||s.removeAttribute("value"),t!=null?id(s,j,Ma(t)):a!=null?id(s,j,Ma(a)):r!=null&&s.removeAttribute("value"),o==null&&d!=null&&(s.defaultChecked=!!d),o!=null&&(s.checked=o&&typeof o!="function"&&typeof o!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.name=""+Ma(k):s.removeAttribute("name")}function xx(s,t,a,r,o,d,j,k){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(s.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){nd(s);return}a=a!=null?""+Ma(a):"",t=t!=null?""+Ma(t):a,k||t===s.value||(s.value=t),s.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,s.checked=k?s.checked:!!r,s.defaultChecked=!!r,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(s.name=j),nd(s)}function id(s,t,a){t==="number"&&ic(s.ownerDocument)===s||s.defaultValue===""+a||(s.defaultValue=""+a)}function Wn(s,t,a,r){if(s=s.options,t){t={};for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),md=!1;if(dl)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){md=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{md=!1}var Ul=null,xd=null,oc=null;function Nx(){if(oc)return oc;var s,t=xd,a=t.length,r,o="value"in Ul?Ul.value:Ul.textContent,d=o.length;for(s=0;s=Xr),kx=" ",Cx=!1;function Tx(s,t){switch(s){case"keyup":return Db.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ex(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ar=!1;function Rb(s,t){switch(s){case"compositionend":return Ex(t);case"keypress":return t.which!==32?null:(Cx=!0,kx);case"textInput":return s=t.data,s===kx&&Cx?null:s;default:return null}}function Lb(s,t){if(ar)return s==="compositionend"||!jd&&Tx(s,t)?(s=Nx(),oc=xd=Ul=null,ar=!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=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ux(a)}}function $x(s,t){return s&&t?s===t?!0:s&&s.nodeType===3?!1:t&&t.nodeType===3?$x(s,t.parentNode):"contains"in s?s.contains(t):s.compareDocumentPosition?!!(s.compareDocumentPosition(t)&16):!1:!1}function Ix(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var t=ic(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=ic(s.document)}return t}function bd(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 Gb=dl&&"documentMode"in document&&11>=document.documentMode,lr=null,yd=null,si=null,wd=!1;function Px(s,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wd||lr==null||lr!==ic(r)||(r=lr,"selectionStart"in r&&bd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&ei(si,r)||(si=r,r=to(yd,"onSelect"),0>=j,o-=j,Wa=1<<32-Ns(t)+o|a<os?(Ts=Ge,Ge=null):Ts=Ge.sibling;var Rs=ie(J,Ge,ae[os],Ne);if(Rs===null){Ge===null&&(Ge=Ts);break}s&&Ge&&Rs.alternate===null&&t(J,Ge),F=d(Rs,F,os),Os===null?Ye=Rs:Os.sibling=Rs,Os=Rs,Ge=Ts}if(os===ae.length)return a(J,Ge),Ms&&ml(J,os),Ye;if(Ge===null){for(;osos?(Ts=Ge,Ge=null):Ts=Ge.sibling;var nn=ie(J,Ge,Rs.value,Ne);if(nn===null){Ge===null&&(Ge=Ts);break}s&&Ge&&nn.alternate===null&&t(J,Ge),F=d(nn,F,os),Os===null?Ye=nn:Os.sibling=nn,Os=nn,Ge=Ts}if(Rs.done)return a(J,Ge),Ms&&ml(J,os),Ye;if(Ge===null){for(;!Rs.done;os++,Rs=ae.next())Rs=be(J,Rs.value,Ne),Rs!==null&&(F=d(Rs,F,os),Os===null?Ye=Rs:Os.sibling=Rs,Os=Rs);return Ms&&ml(J,os),Ye}for(Ge=r(Ge);!Rs.done;os++,Rs=ae.next())Rs=ue(Ge,J,os,Rs.value,Ne),Rs!==null&&(s&&Rs.alternate!==null&&Ge.delete(Rs.key===null?os:Rs.key),F=d(Rs,F,os),Os===null?Ye=Rs:Os.sibling=Rs,Os=Rs);return s&&Ge.forEach(function(d0){return t(J,d0)}),Ms&&ml(J,os),Ye}function Qs(J,F,ae,Ne){if(typeof ae=="object"&&ae!==null&&ae.type===D&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:e:{for(var Ye=ae.key;F!==null;){if(F.key===Ye){if(Ye=ae.type,Ye===D){if(F.tag===7){a(J,F.sibling),Ne=o(F,ae.props.children),Ne.return=J,J=Ne;break e}}else if(F.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===ee&&En(Ye)===F.type){a(J,F.sibling),Ne=o(F,ae.props),ii(Ne,ae),Ne.return=J,J=Ne;break e}a(J,F);break}else t(J,F);F=F.sibling}ae.type===D?(Ne=_n(ae.props.children,J.mode,Ne,ae.key),Ne.return=J,J=Ne):(Ne=vc(ae.type,ae.key,ae.props,null,J.mode,Ne),ii(Ne,ae),Ne.return=J,J=Ne)}return j(J);case b:e:{for(Ye=ae.key;F!==null;){if(F.key===Ye)if(F.tag===4&&F.stateNode.containerInfo===ae.containerInfo&&F.stateNode.implementation===ae.implementation){a(J,F.sibling),Ne=o(F,ae.children||[]),Ne.return=J,J=Ne;break e}else{a(J,F);break}else t(J,F);F=F.sibling}Ne=Md(ae,J.mode,Ne),Ne.return=J,J=Ne}return j(J);case ee:return ae=En(ae),Qs(J,F,ae,Ne)}if(fe(ae))return Ie(J,F,ae,Ne);if(ve(ae)){if(Ye=ve(ae),typeof Ye!="function")throw Error(c(150));return ae=Ye.call(ae),Xe(J,F,ae,Ne)}if(typeof ae.then=="function")return Qs(J,F,kc(ae),Ne);if(ae.$$typeof===E)return Qs(J,F,yc(J,ae),Ne);Cc(J,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,F!==null&&F.tag===6?(a(J,F.sibling),Ne=o(F,ae),Ne.return=J,J=Ne):(a(J,F),Ne=Ed(ae,J.mode,Ne),Ne.return=J,J=Ne),j(J)):a(J,F)}return function(J,F,ae,Ne){try{ri=0;var Ye=Qs(J,F,ae,Ne);return fr=null,Ye}catch(Ge){if(Ge===hr||Ge===_c)throw Ge;var Os=ja(29,Ge,null,J.mode);return Os.lanes=Ne,Os.return=J,Os}finally{}}}var An=dh(!0),uh=dh(!1),Hl=!1;function Hd(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fd(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 Fl(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Gl(s,t,a){var r=s.updateQueue;if(r===null)return null;if(r=r.shared,(Is&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=jc(s),Qx(s,null,a),t}return gc(s,r,t,a),jc(s)}function ci(s,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=s.pendingLanes,a|=r,t.lanes=a,Jt(s,a)}}function Gd(s,t){var a=s.updateQueue,r=s.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var j={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?o=d=j:d=d.next=j,a=a.next}while(a!==null);d===null?o=d=t:d=d.next=t}else o=d=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},s.updateQueue=a;return}s=a.lastBaseUpdate,s===null?a.firstBaseUpdate=t:s.next=t,a.lastBaseUpdate=t}var Vd=!1;function oi(){if(Vd){var s=xr;if(s!==null)throw s}}function di(s,t,a,r){Vd=!1;var o=s.updateQueue;Hl=!1;var d=o.firstBaseUpdate,j=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var B=k,le=B.next;B.next=null,j===null?d=le:j.next=le,j=B;var pe=s.alternate;pe!==null&&(pe=pe.updateQueue,k=pe.lastBaseUpdate,k!==j&&(k===null?pe.firstBaseUpdate=le:k.next=le,pe.lastBaseUpdate=B))}if(d!==null){var be=o.baseState;j=0,pe=le=B=null,k=d;do{var ie=k.lane&-536870913,ue=ie!==k.lane;if(ue?(Cs&ie)===ie:(r&ie)===ie){ie!==0&&ie===mr&&(Vd=!0),pe!==null&&(pe=pe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ie=s,Xe=k;ie=t;var Qs=a;switch(Xe.tag){case 1:if(Ie=Xe.payload,typeof Ie=="function"){be=Ie.call(Qs,be,ie);break e}be=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Xe.payload,ie=typeof Ie=="function"?Ie.call(Qs,be,ie):Ie,ie==null)break e;be=v({},be,ie);break e;case 2:Hl=!0}}ie=k.callback,ie!==null&&(s.flags|=64,ue&&(s.flags|=8192),ue=o.callbacks,ue===null?o.callbacks=[ie]:ue.push(ie))}else ue={lane:ie,tag:k.tag,payload:k.payload,callback:k.callback,next:null},pe===null?(le=pe=ue,B=be):pe=pe.next=ue,j|=ie;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;ue=k,k=ue.next,ue.next=null,o.lastBaseUpdate=ue,o.shared.pending=null}}while(!0);pe===null&&(B=be),o.baseState=B,o.firstBaseUpdate=le,o.lastBaseUpdate=pe,d===null&&(o.shared.lanes=0),Yl|=j,s.lanes=j,s.memoizedState=be}}function mh(s,t){if(typeof s!="function")throw Error(c(191,s));s.call(t)}function xh(s,t){var a=s.callbacks;if(a!==null)for(s.callbacks=null,s=0;sd?d:8;var j=z.T,k={};z.T=k,du(s,!1,t,a);try{var B=o(),le=z.S;if(le!==null&&le(k,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var pe=Wb(B,r);xi(s,t,pe,wa(s))}else xi(s,t,r,wa(s))}catch(be){xi(s,t,{then:function(){},status:"rejected",reason:be},wa())}finally{Q.p=d,j!==null&&k.types!==null&&(j.types=k.types),z.T=j}}function ny(){}function cu(s,t,a,r){if(s.tag!==5)throw Error(c(476));var o=Vh(s).queue;Gh(s,o,t,$,a===null?ny:function(){return qh(s),a(r)})}function Vh(s){var t=s.memoizedState;if(t!==null)return t;t={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:$},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:a},next:null},s.memoizedState=t,s=s.alternate,s!==null&&(s.memoizedState=t),t}function qh(s){var t=Vh(s);t.next===null&&(t=s.alternate.memoizedState),xi(s,t.next.queue,{},wa())}function ou(){return Ft(Mi)}function Kh(){return wt().memoizedState}function Qh(){return wt().memoizedState}function ry(s){for(var t=s.return;t!==null;){switch(t.tag){case 24:case 3:var a=wa();s=Fl(a);var r=Gl(t,s,a);r!==null&&(ha(r,t,a),ci(r,t,a)),t={cache:Bd()},s.payload=t;return}t=t.return}}function iy(s,t,a){var r=wa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Uc(s)?Jh(t,a):(a=Cd(s,t,a,r),a!==null&&(ha(a,s,r),Xh(a,t,r)))}function Yh(s,t,a){var r=wa();xi(s,t,a,r)}function xi(s,t,a,r){var o={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Uc(s))Jh(t,o);else{var d=s.alternate;if(s.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var j=t.lastRenderedState,k=d(j,a);if(o.hasEagerState=!0,o.eagerState=k,ga(k,j))return gc(s,t,o,0),Xs===null&&pc(),!1}catch{}finally{}if(a=Cd(s,t,o,r),a!==null)return ha(a,s,r),Xh(a,t,r),!0}return!1}function du(s,t,a,r){if(r={lane:2,revertLane:Hu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Uc(s)){if(t)throw Error(c(479))}else t=Cd(s,a,r,2),t!==null&&ha(t,s,2)}function Uc(s){var t=s.alternate;return s===is||t!==null&&t===is}function Jh(s,t){gr=Mc=!0;var a=s.pending;a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t}function Xh(s,t,a){if((a&4194048)!==0){var r=t.lanes;r&=s.pendingLanes,a|=r,t.lanes=a,Jt(s,a)}}var hi={readContext:Ft,use:Dc,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};hi.useEffectEvent=gt;var Zh={readContext:Ft,use:Dc,useCallback:function(s,t){return ta().memoizedState=[s,t===void 0?null:t],s},useContext:Ft,useEffect:Rh,useImperativeHandle:function(s,t,a){a=a!=null?a.concat([s]):null,Rc(4194308,4,$h.bind(null,t,s),a)},useLayoutEffect:function(s,t){return Rc(4194308,4,s,t)},useInsertionEffect:function(s,t){Rc(4,2,s,t)},useMemo:function(s,t){var a=ta();t=t===void 0?null:t;var r=s();if(zn){es(!0);try{s()}finally{es(!1)}}return a.memoizedState=[r,t],r},useReducer:function(s,t,a){var r=ta();if(a!==void 0){var o=a(t);if(zn){es(!0);try{a(t)}finally{es(!1)}}}else o=t;return r.memoizedState=r.baseState=o,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:o},r.queue=s,s=s.dispatch=iy.bind(null,is,s),[r.memoizedState,s]},useRef:function(s){var t=ta();return s={current:s},t.memoizedState=s},useState:function(s){s=au(s);var t=s.queue,a=Yh.bind(null,is,t);return t.dispatch=a,[s.memoizedState,a]},useDebugValue:ru,useDeferredValue:function(s,t){var a=ta();return iu(a,s,t)},useTransition:function(){var s=au(!1);return s=Gh.bind(null,is,s.queue,!0,!1),ta().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,t,a){var r=is,o=ta();if(Ms){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Xs===null)throw Error(c(349));(Cs&127)!==0||vh(r,t,a)}o.memoizedState=a;var d={value:a,getSnapshot:t};return o.queue=d,Rh(bh.bind(null,r,d,s),[s]),r.flags|=2048,vr(9,{destroy:void 0},Nh.bind(null,r,d,a,t),null),a},useId:function(){var s=ta(),t=Xs.identifierPrefix;if(Ms){var a=el,r=Wa;a=(r&~(1<<32-Ns(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Ac++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?j.createElement("select",{is:r.is}):j.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?j.createElement(o,{is:r.is}):j.createElement(o)}}d[gs]=t,d[cs]=r;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)d.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=d;e:switch(Vt(d,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&jl(t)}}return rt(t),_u(t,t.type,s===null?null:s.memoizedProps,t.pendingProps,a),null;case 6:if(s&&t.stateNode!=null)s.memoizedProps!==r&&jl(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(s=V.current,dr(t)){if(s=t.stateNode,a=t.memoizedProps,r=null,o=Ht,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}s[gs]=t,s=!!(s.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||jp(s.nodeValue,a)),s||Il(t,!0)}else s=ao(s).createTextNode(r),s[gs]=t,t.stateNode=s}return rt(t),null;case 31:if(a=t.memoizedState,s===null||s.memoizedState!==null){if(r=dr(t),a!==null){if(s===null){if(!r)throw Error(c(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(c(557));s[gs]=t}else Sn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),s=!1}else a=Od(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=a),s=!0;if(!s)return t.flags&256?(Na(t),t):(Na(t),null);if((t.flags&128)!==0)throw Error(c(558))}return rt(t),null;case 13:if(r=t.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(o=dr(t),r!==null&&r.dehydrated!==null){if(s===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[gs]=t}else Sn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),o=!1}else o=Od(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Na(t),t):(Na(t),null)}return Na(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,s=s!==null&&s.memoizedState!==null,a&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==o&&(r.flags|=2048)),a!==s&&a&&(t.child.flags|=8192),Hc(t,t.updateQueue),rt(t),null);case 4:return X(),s===null&&qu(t.stateNode.containerInfo),rt(t),null;case 10:return hl(t.type),rt(t),null;case 19:if(je(yt),r=t.memoizedState,r===null)return rt(t),null;if(o=(t.flags&128)!==0,d=r.rendering,d===null)if(o)pi(r,!1);else{if(jt!==0||s!==null&&(s.flags&128)!==0)for(s=t.child;s!==null;){if(d=Ec(s),d!==null){for(t.flags|=128,pi(r,!1),s=d.updateQueue,t.updateQueue=s,Hc(t,s),t.subtreeFlags=0,s=a,a=t.child;a!==null;)Yx(a,s),a=a.sibling;return Se(yt,yt.current&1|2),Ms&&ml(t,r.treeForkCount),t.child}s=s.sibling}r.tail!==null&&ut()>Kc&&(t.flags|=128,o=!0,pi(r,!1),t.lanes=4194304)}else{if(!o)if(s=Ec(d),s!==null){if(t.flags|=128,o=!0,s=s.updateQueue,t.updateQueue=s,Hc(t,s),pi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Ms)return rt(t),null}else 2*ut()-r.renderingStartTime>Kc&&a!==536870912&&(t.flags|=128,o=!0,pi(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(s=r.last,s!==null?s.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(s=r.tail,r.rendering=s,r.tail=s.sibling,r.renderingStartTime=ut(),s.sibling=null,a=yt.current,Se(yt,o?a&1|2:a&1),Ms&&ml(t,r.treeForkCount),s):(rt(t),null);case 22:case 23:return Na(t),Kd(),r=t.memoizedState!==null,s!==null?s.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),a=t.updateQueue,a!==null&&Hc(t,a.retryQueue),a=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),s!==null&&je(Tn),null;case 24:return a=null,s!==null&&(a=s.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hl(Tt),rt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function my(s,t){switch(zd(t),t.tag){case 1:return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 3:return hl(Tt),X(),s=t.flags,(s&65536)!==0&&(s&128)===0?(t.flags=s&-65537|128,t):null;case 26:case 27:case 5:return Fe(t),null;case 31:if(t.memoizedState!==null){if(Na(t),t.alternate===null)throw Error(c(340));Sn()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 13:if(Na(t),s=t.memoizedState,s!==null&&s.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Sn()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 19:return je(yt),null;case 4:return X(),null;case 10:return hl(t.type),null;case 22:case 23:return Na(t),Kd(),s!==null&&je(Tn),s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 24:return hl(Tt),null;case 25:return null;default:return null}}function wf(s,t){switch(zd(t),t.tag){case 3:hl(Tt),X();break;case 26:case 27:case 5:Fe(t);break;case 4:X();break;case 31:t.memoizedState!==null&&Na(t);break;case 13:Na(t);break;case 19:je(yt);break;case 10:hl(t.type);break;case 22:case 23:Na(t),Kd(),s!==null&&je(Tn);break;case 24:hl(Tt)}}function gi(s,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var o=r.next;a=o;do{if((a.tag&s)===s){r=void 0;var d=a.create,j=a.inst;r=d(),j.destroy=r}a=a.next}while(a!==o)}}catch(k){Vs(t,t.return,k)}}function Kl(s,t,a){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var d=o.next;r=d;do{if((r.tag&s)===s){var j=r.inst,k=j.destroy;if(k!==void 0){j.destroy=void 0,o=t;var B=a,le=k;try{le()}catch(pe){Vs(o,B,pe)}}}r=r.next}while(r!==d)}}catch(pe){Vs(t,t.return,pe)}}function _f(s){var t=s.updateQueue;if(t!==null){var a=s.stateNode;try{xh(t,a)}catch(r){Vs(s,s.return,r)}}}function Sf(s,t,a){a.props=Dn(s.type,s.memoizedProps),a.state=s.memoizedState;try{a.componentWillUnmount()}catch(r){Vs(s,t,r)}}function ji(s,t){try{var a=s.ref;if(a!==null){switch(s.tag){case 26:case 27:case 5:var r=s.stateNode;break;case 30:r=s.stateNode;break;default:r=s.stateNode}typeof a=="function"?s.refCleanup=a(r):a.current=r}}catch(o){Vs(s,t,o)}}function sl(s,t){var a=s.ref,r=s.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(o){Vs(s,t,o)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){Vs(s,t,o)}else a.current=null}function kf(s){var t=s.type,a=s.memoizedProps,r=s.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(o){Vs(s,s.return,o)}}function Su(s,t,a){try{var r=s.stateNode;Oy(r,s.type,a,t),r[cs]=t}catch(o){Vs(s,s.return,o)}}function Cf(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&en(s.type)||s.tag===4}function ku(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Cf(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&&en(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 Cu(s,t,a){var r=s.tag;if(r===5||r===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=ol));else if(r!==4&&(r===27&&en(s.type)&&(a=s.stateNode,t=null),s=s.child,s!==null))for(Cu(s,t,a),s=s.sibling;s!==null;)Cu(s,t,a),s=s.sibling}function Fc(s,t,a){var r=s.tag;if(r===5||r===6)s=s.stateNode,t?a.insertBefore(s,t):a.appendChild(s);else if(r!==4&&(r===27&&en(s.type)&&(a=s.stateNode),s=s.child,s!==null))for(Fc(s,t,a),s=s.sibling;s!==null;)Fc(s,t,a),s=s.sibling}function Tf(s){var t=s.stateNode,a=s.memoizedProps;try{for(var r=s.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Vt(t,r,a),t[gs]=s,t[cs]=a}catch(d){Vs(s,s.return,d)}}var vl=!1,At=!1,Tu=!1,Ef=typeof WeakSet=="function"?WeakSet:Set,$t=null;function xy(s,t){if(s=s.containerInfo,Yu=uo,s=Ix(s),bd(s)){if("selectionStart"in s)var a={start:s.selectionStart,end:s.selectionEnd};else e:{a=(a=s.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var j=0,k=-1,B=-1,le=0,pe=0,be=s,ie=null;s:for(;;){for(var ue;be!==a||o!==0&&be.nodeType!==3||(k=j+o),be!==d||r!==0&&be.nodeType!==3||(B=j+r),be.nodeType===3&&(j+=be.nodeValue.length),(ue=be.firstChild)!==null;)ie=be,be=ue;for(;;){if(be===s)break s;if(ie===a&&++le===o&&(k=j),ie===d&&++pe===r&&(B=j),(ue=be.nextSibling)!==null)break;be=ie,ie=be.parentNode}be=ue}a=k===-1||B===-1?null:{start:k,end:B}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ju={focusedElem:s,selectionRange:a},uo=!1,$t=t;$t!==null;)if(t=$t,s=t.child,(t.subtreeFlags&1028)!==0&&s!==null)s.return=t,$t=s;else for(;$t!==null;){switch(t=$t,d=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"))),Vt(d,r,a),d[gs]=s,Bt(d),r=d;break e;case"link":var j=Rp("link","href",o).get(r+(a.href||""));if(j){for(var k=0;kQs&&(j=Qs,Qs=Xe,Xe=j);var J=Bx(k,Xe),F=Bx(k,Qs);if(J&&F&&(ue.rangeCount!==1||ue.anchorNode!==J.node||ue.anchorOffset!==J.offset||ue.focusNode!==F.node||ue.focusOffset!==F.offset)){var ae=be.createRange();ae.setStart(J.node,J.offset),ue.removeAllRanges(),Xe>Qs?(ue.addRange(ae),ue.extend(F.node,F.offset)):(ae.setEnd(F.node,F.offset),ue.addRange(ae))}}}}for(be=[],ue=k;ue=ue.parentNode;)ue.nodeType===1&&be.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;ka?32:a,z.T=null,a=Ru,Ru=null;var d=Xl,j=_l;if(Dt=0,_r=Xl=null,_l=0,(Is&6)!==0)throw Error(c(331));var k=Is;if(Is|=4,If(d.current),Uf(d,d.current,j,a),Is=k,_i(0,!1),ls&&typeof ls.onPostCommitFiberRoot=="function")try{ls.onPostCommitFiberRoot(vs,d)}catch{}return!0}finally{Q.p=o,z.T=r,lp(s,t)}}function rp(s,t,a){t=Da(a,t),t=hu(s.stateNode,t,2),s=Gl(s,t,2),s!==null&&(ze(s,2),tl(s))}function Vs(s,t,a){if(s.tag===3)rp(s,s,a);else for(;t!==null;){if(t.tag===3){rp(t,s,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Jl===null||!Jl.has(r))){s=Da(a,s),a=rf(2),r=Gl(t,a,2),r!==null&&(cf(a,r,t,s),ze(r,2),tl(r));break}}t=t.return}}function $u(s,t,a){var r=s.pingCache;if(r===null){r=s.pingCache=new py;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(Au=!0,o.add(a),s=by.bind(null,s,t,a),t.then(s,s))}function by(s,t,a){var r=s.pingCache;r!==null&&r.delete(t),s.pingedLanes|=s.suspendedLanes&a,s.warmLanes&=~a,Xs===s&&(Cs&a)===a&&(jt===4||jt===3&&(Cs&62914560)===Cs&&300>ut()-qc?(Is&2)===0&&Sr(s,0):zu|=a,wr===Cs&&(wr=0)),tl(s)}function ip(s,t){t===0&&(t=Z()),s=wn(s,t),s!==null&&(ze(s,t),tl(s))}function yy(s){var t=s.memoizedState,a=0;t!==null&&(a=t.retryLane),ip(s,a)}function wy(s,t){var a=0;switch(s.tag){case 31:case 13:var r=s.stateNode,o=s.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=s.stateNode;break;case 22:r=s.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),ip(s,a)}function _y(s,t){return Rt(s,t)}var Wc=null,Cr=null,Iu=!1,eo=!1,Pu=!1,Wl=0;function tl(s){s!==Cr&&s.next===null&&(Cr===null?Wc=Cr=s:Cr=Cr.next=s),eo=!0,Iu||(Iu=!0,ky())}function _i(s,t){if(!Pu&&eo){Pu=!0;do for(var a=!1,r=Wc;r!==null;){if(s!==0){var o=r.pendingLanes;if(o===0)var d=0;else{var j=r.suspendedLanes,k=r.pingedLanes;d=(1<<31-Ns(42|s)+1)-1,d&=o&~(j&~k),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,up(r,d))}else d=Cs,d=Za(r,r===Xs?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||il(r,d)||(a=!0,up(r,d));r=r.next}while(a);Pu=!1}}function Sy(){cp()}function cp(){eo=Iu=!1;var s=0;Wl!==0&&Ly()&&(s=Wl);for(var t=ut(),a=null,r=Wc;r!==null;){var o=r.next,d=op(r,t);d===0?(r.next=null,a===null?Wc=o:a.next=o,o===null&&(Cr=a)):(a=r,(s!==0||(d&3)!==0)&&(eo=!0)),r=o}Dt!==0&&Dt!==5||_i(s),Wl!==0&&(Wl=0)}function op(s,t){for(var a=s.suspendedLanes,r=s.pingedLanes,o=s.expirationTimes,d=s.pendingLanes&-62914561;0k)break;var pe=B.transferSize,be=B.initiatorType;pe&&vp(be)&&(B=B.responseEnd,j+=pe*(B"u"?null:document;function Ap(s,t,a){var r=Tr;if(r&&typeof t=="string"&&t){var o=Aa(t);o='link[rel="'+s+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Mp.has(o)||(Mp.add(o),s={rel:s,crossOrigin:a,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),Vt(t,"link",s),Bt(t),r.head.appendChild(t)))}}function Vy(s){Sl.D(s),Ap("dns-prefetch",s,null)}function qy(s,t){Sl.C(s,t),Ap("preconnect",s,t)}function Ky(s,t,a){Sl.L(s,t,a);var r=Tr;if(r&&s&&t){var o='link[rel="preload"][as="'+Aa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+Aa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+Aa(a.imageSizes)+'"]')):o+='[href="'+Aa(s)+'"]';var d=o;switch(t){case"style":d=Er(s);break;case"script":d=Mr(s)}$a.has(d)||(s=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:s,as:t},a),$a.set(d,s),r.querySelector(o)!==null||t==="style"&&r.querySelector(Ti(d))||t==="script"&&r.querySelector(Ei(d))||(t=r.createElement("link"),Vt(t,"link",s),Bt(t),r.head.appendChild(t)))}}function Qy(s,t){Sl.m(s,t);var a=Tr;if(a&&s){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Aa(r)+'"][href="'+Aa(s)+'"]',d=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Mr(s)}if(!$a.has(d)&&(s=v({rel:"modulepreload",href:s},t),$a.set(d,s),a.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ei(d)))return}r=a.createElement("link"),Vt(r,"link",s),Bt(r),a.head.appendChild(r)}}}function Yy(s,t,a){Sl.S(s,t,a);var r=Tr;if(r&&s){var o=Xn(r).hoistableStyles,d=Er(s);t=t||"default";var j=o.get(d);if(!j){var k={loading:0,preload:null};if(j=r.querySelector(Ti(d)))k.loading=5;else{s=v({rel:"stylesheet",href:s,"data-precedence":t},a),(a=$a.get(d))&&am(s,a);var B=j=r.createElement("link");Bt(B),Vt(B,"link",s),B._p=new Promise(function(le,pe){B.onload=le,B.onerror=pe}),B.addEventListener("load",function(){k.loading|=1}),B.addEventListener("error",function(){k.loading|=2}),k.loading|=4,no(j,t,r)}j={type:"stylesheet",instance:j,count:1,state:k},o.set(d,j)}}}function Jy(s,t){Sl.X(s,t);var a=Tr;if(a&&s){var r=Xn(a).hoistableScripts,o=Mr(s),d=r.get(o);d||(d=a.querySelector(Ei(o)),d||(s=v({src:s,async:!0},t),(t=$a.get(o))&&lm(s,t),d=a.createElement("script"),Bt(d),Vt(d,"link",s),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(o,d))}}function Xy(s,t){Sl.M(s,t);var a=Tr;if(a&&s){var r=Xn(a).hoistableScripts,o=Mr(s),d=r.get(o);d||(d=a.querySelector(Ei(o)),d||(s=v({src:s,async:!0,type:"module"},t),(t=$a.get(o))&&lm(s,t),d=a.createElement("script"),Bt(d),Vt(d,"link",s),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(o,d))}}function zp(s,t,a,r){var o=(o=V.current)?lo(o):null;if(!o)throw Error(c(446));switch(s){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Er(a.href),a=Xn(o).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){s=Er(a.href);var d=Xn(o).hoistableStyles,j=d.get(s);if(j||(o=o.ownerDocument||o,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(s,j),(d=o.querySelector(Ti(s)))&&!d._p&&(j.instance=d,j.state.loading=5),$a.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},$a.set(s,a),d||Zy(o,s,a,j.state))),t&&r===null)throw Error(c(528,""));return j}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Mr(a),a=Xn(o).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,s))}}function Er(s){return'href="'+Aa(s)+'"'}function Ti(s){return'link[rel="stylesheet"]['+s+"]"}function Dp(s){return v({},s,{"data-precedence":s.precedence,precedence:null})}function Zy(s,t,a,r){s.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=s.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Vt(t,"link",a),Bt(t),s.head.appendChild(t))}function Mr(s){return'[src="'+Aa(s)+'"]'}function Ei(s){return"script[async]"+s}function Op(s,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=s.querySelector('style[data-href~="'+Aa(a.href)+'"]');if(r)return t.instance=r,Bt(r),r;var o=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(s.ownerDocument||s).createElement("style"),Bt(r),Vt(r,"style",o),no(r,a.precedence,s),t.instance=r;case"stylesheet":o=Er(a.href);var d=s.querySelector(Ti(o));if(d)return t.state.loading|=4,t.instance=d,Bt(d),d;r=Dp(a),(o=$a.get(o))&&am(r,o),d=(s.ownerDocument||s).createElement("link"),Bt(d);var j=d;return j._p=new Promise(function(k,B){j.onload=k,j.onerror=B}),Vt(d,"link",r),t.state.loading|=4,no(d,a.precedence,s),t.instance=d;case"script":return d=Mr(a.src),(o=s.querySelector(Ei(d)))?(t.instance=o,Bt(o),o):(r=a,(o=$a.get(d))&&(r=v({},a),lm(r,o)),s=s.ownerDocument||s,o=s.createElement("script"),Bt(o),Vt(o,"link",r),s.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,no(r,a.precedence,s));return t.instance}function no(s,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,d=o,j=0;j title"):null)}function Wy(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 Up(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function e0(s,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=Er(r.href),d=t.querySelector(Ti(o));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(s.count++,s=io.bind(s),t.then(s,s)),a.state.loading|=4,a.instance=d,Bt(d);return}d=t.ownerDocument||t,r=Dp(r),(o=$a.get(o))&&am(r,o),d=d.createElement("link"),Bt(d);var j=d;j._p=new Promise(function(k,B){j.onload=k,j.onerror=B}),Vt(d,"link",r),a.instance=d}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(s.count++,a=io.bind(s),t.addEventListener("load",a),t.addEventListener("error",a))}}var nm=0;function s0(s,t){return s.stylesheets&&s.count===0&&oo(s,s.stylesheets),0nm?50:800)+t);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function io(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oo(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var co=null;function oo(s,t){s.stylesheets=null,s.unsuspend!==null&&(s.count++,co=new Map,t.forEach(t0,s),co=null,io.call(s))}function t0(s,t){if(!(t.state.loading&4)){var a=co.get(s);if(a)var r=a.get(null);else{a=new Map,co.set(s,a);for(var o=s.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(n){console.error(n)}}return l(),pm.exports=G1(),pm.exports}var q1=V1();function H(...l){return y0(w0(l))}const Ce=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("rounded-xl border bg-card text-card-foreground shadow",l),...n}));Ce.displayName="Card";const Pe=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("flex flex-col space-y-1.5 p-6",l),...n}));Pe.displayName="CardHeader";const He=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("font-semibold leading-none tracking-tight",l),...n}));He.displayName="CardTitle";const As=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("text-sm text-muted-foreground",l),...n}));As.displayName="CardDescription";const Re=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("p-6 pt-0",l),...n}));Re.displayName="CardContent";const Vo=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("flex items-center p-6 pt-0",l),...n}));Vo.displayName="CardFooter";const ra=S0,Wt=m.forwardRef(({className:l,...n},i)=>e.jsx(Mg,{ref:i,className:H("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",l),...n}));Wt.displayName=Mg.displayName;const ts=m.forwardRef(({className:l,...n},i)=>e.jsx(Ag,{ref:i,className:H("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",l),...n}));ts.displayName=Ag.displayName;const bs=m.forwardRef(({className:l,...n},i)=>e.jsx(zg,{ref:i,className:H("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",l),...n}));bs.displayName=zg.displayName;const Je=m.forwardRef(({className:l,children:n,viewportRef:i,...c},u)=>e.jsxs(Dg,{ref:u,className:H("relative overflow-hidden",l),...c,children:[e.jsx(k0,{ref:i,className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(zm,{}),e.jsx(zm,{orientation:"horizontal"}),e.jsx(C0,{})]}));Je.displayName=Dg.displayName;const zm=m.forwardRef(({className:l,orientation:n="vertical",...i},c)=>e.jsx(Og,{ref:c,orientation:n,className:H("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",l),...i,children:e.jsx(T0,{className:"relative flex-1 rounded-full bg-border"})}));zm.displayName=Og.displayName;function _s({className:l,...n}){return e.jsx("div",{className:H("animate-pulse rounded-md bg-primary/10",l),...n})}const Fn=m.forwardRef(({className:l,value:n,...i},c)=>e.jsx(Rg,{ref:c,className:H("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",l),...i,children:e.jsx(E0,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})}));Fn.displayName=Rg.displayName;async function we(l,n){const c=n?.body instanceof FormData?{...n?.headers}:{"Content-Type":"application/json",...n?.headers},u={...n,credentials:"include",headers:c},x=await fetch(l,u);if(x.status===401)throw window.location.href="/auth",new Error("่ฎค่ฏๅคฑ่ดฅ๏ผŒ่ฏท้‡ๆ–ฐ็™ปๅฝ•");return x}function Fs(){return{"Content-Type":"application/json"}}async function K1(){try{await fetch("/api/webui/auth/logout",{method:"POST",credentials:"include"})}catch(l){console.error("็™ปๅ‡บ่ฏทๆฑ‚ๅคฑ่ดฅ:",l)}window.location.href="/auth"}async function Qi(){try{return(await(await fetch("/api/webui/auth/check",{method:"GET",credentials:"include"})).json()).authenticated===!0}catch{return!1}}const Q1={light:"",dark:".dark"},Qj=m.createContext(null);function Yj(){const l=m.useContext(Qj);if(!l)throw new Error("useChart must be used within a ");return l}const Or=m.forwardRef(({id:l,className:n,children:i,config:c,...u},x)=>{const h=m.useId(),f=`chart-${l||h.replace(/:/g,"")}`;return e.jsx(Qj.Provider,{value:{config:c},children:e.jsxs("div",{"data-chart":f,ref:x,className:H("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",n),...u,children:[e.jsx(Y1,{id:f,config:c}),e.jsx(iw,{children:i})]})})});Or.displayName="Chart";const Y1=({id:l,config:n})=>{const i=Object.entries(n).filter(([,c])=>c.theme||c.color);return i.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Q1).map(([c,u])=>` +`+r.stack}}var rs=Object.prototype.hasOwnProperty,Rt=l.unstable_scheduleCallback,ta=l.unstable_cancelCallback,Ga=l.unstable_shouldYield,Ht=l.unstable_requestPaint,ut=l.unstable_now,q=l.unstable_getCurrentPriorityLevel,qe=l.unstable_ImmediatePriority,Qe=l.unstable_UserBlockingPriority,We=l.unstable_NormalPriority,Ds=l.unstable_LowPriority,as=l.unstable_IdlePriority,ks=l.log,Ee=l.unstable_setDisableYieldValue,vs=null,ls=null;function es(s){if(typeof ks=="function"&&Ee(s),ls&&typeof ls.setStrictMode=="function")try{ls.setStrictMode(vs,s)}catch{}}var Ns=Math.clz32?Math.clz32:tt,pt=Math.log,Lt=Math.LN2;function tt(s){return s>>>=0,s===0?32:31-(pt(s)/Lt|0)|0}var Es=256,kt=262144,Ut=4194304;function Ea(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 Za(s,t,a){var r=s.pendingLanes;if(r===0)return 0;var o=0,d=s.suspendedLanes,j=s.pingedLanes;s=s.warmLanes;var k=r&134217727;return k!==0?(r=k&~d,r!==0?o=Ea(r):(j&=k,j!==0?o=Ea(j):a||(a=k&~s,a!==0&&(o=Ea(a))))):(k=r&~d,k!==0?o=Ea(k):j!==0?o=Ea(j):a||(a=r&~s,a!==0&&(o=Ea(a)))),o===0?0:t!==0&&t!==o&&(t&d)===0&&(d=o&-o,a=t&-t,d>=a||d===32&&(a&4194048)!==0)?t:o}function il(s,t){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&t)===0}function Kn(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 Z(){var s=Ut;return Ut<<=1,(Ut&62914560)===0&&(Ut=4194304),s}function ye(s){for(var t=[],a=0;31>a;a++)t.push(s);return t}function ze(s,t){s.pendingLanes|=t,t!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Hs(s,t,a,r,o,d){var j=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 k=s.entanglements,B=s.expirationTimes,le=s.hiddenUpdates;for(a=j&~a;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var nb=/[\n"\\]/g;function Aa(s){return s.replace(nb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function id(s,t,a,r,o,d,j,k){s.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?s.type=j:s.removeAttribute("type"),t!=null?j==="number"?(t===0&&s.value===""||s.value!=t)&&(s.value=""+Ma(t)):s.value!==""+Ma(t)&&(s.value=""+Ma(t)):j!=="submit"&&j!=="reset"||s.removeAttribute("value"),t!=null?cd(s,j,Ma(t)):a!=null?cd(s,j,Ma(a)):r!=null&&s.removeAttribute("value"),o==null&&d!=null&&(s.defaultChecked=!!d),o!=null&&(s.checked=o&&typeof o!="function"&&typeof o!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.name=""+Ma(k):s.removeAttribute("name")}function hx(s,t,a,r,o,d,j,k){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(s.type=d),t!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){rd(s);return}a=a!=null?""+Ma(a):"",t=t!=null?""+Ma(t):a,k||t===s.value||(s.value=t),s.defaultValue=t}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,s.checked=k?s.checked:!!r,s.defaultChecked=!!r,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(s.name=j),rd(s)}function cd(s,t,a){t==="number"&&cc(s.ownerDocument)===s||s.defaultValue===""+a||(s.defaultValue=""+a)}function Wn(s,t,a,r){if(s=s.options,t){t={};for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xd=!1;if(dl)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){xd=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{xd=!1}var Ul=null,hd=null,dc=null;function bx(){if(dc)return dc;var s,t=hd,a=t.length,r,o="value"in Ul?Ul.value:Ul.textContent,d=o.length;for(s=0;s=Xr),Cx=" ",Tx=!1;function Ex(s,t){switch(s){case"keyup":return Db.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mx(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ar=!1;function Rb(s,t){switch(s){case"compositionend":return Mx(t);case"keypress":return t.which!==32?null:(Tx=!0,Cx);case"textInput":return s=t.data,s===Cx&&Tx?null:s;default:return null}}function Lb(s,t){if(ar)return s==="compositionend"||!vd&&Ex(s,t)?(s=bx(),dc=hd=Ul=null,ar=!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=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Bx(a)}}function Ix(s,t){return s&&t?s===t?!0:s&&s.nodeType===3?!1:t&&t.nodeType===3?Ix(s,t.parentNode):"contains"in s?s.contains(t):s.compareDocumentPosition?!!(s.compareDocumentPosition(t)&16):!1:!1}function Px(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var t=cc(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=cc(s.document)}return t}function yd(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 Gb=dl&&"documentMode"in document&&11>=document.documentMode,lr=null,wd=null,si=null,_d=!1;function Hx(s,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;_d||lr==null||lr!==cc(r)||(r=lr,"selectionStart"in r&&yd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&ei(si,r)||(si=r,r=ao(wd,"onSelect"),0>=j,o-=j,Wa=1<<32-Ns(t)+o|a<os?(Ts=Ve,Ve=null):Ts=Ve.sibling;var Rs=ie(J,Ve,ae[os],Ne);if(Rs===null){Ve===null&&(Ve=Ts);break}s&&Ve&&Rs.alternate===null&&t(J,Ve),F=d(Rs,F,os),Os===null?Ye=Rs:Os.sibling=Rs,Os=Rs,Ve=Ts}if(os===ae.length)return a(J,Ve),Ms&&ml(J,os),Ye;if(Ve===null){for(;osos?(Ts=Ve,Ve=null):Ts=Ve.sibling;var nn=ie(J,Ve,Rs.value,Ne);if(nn===null){Ve===null&&(Ve=Ts);break}s&&Ve&&nn.alternate===null&&t(J,Ve),F=d(nn,F,os),Os===null?Ye=nn:Os.sibling=nn,Os=nn,Ve=Ts}if(Rs.done)return a(J,Ve),Ms&&ml(J,os),Ye;if(Ve===null){for(;!Rs.done;os++,Rs=ae.next())Rs=be(J,Rs.value,Ne),Rs!==null&&(F=d(Rs,F,os),Os===null?Ye=Rs:Os.sibling=Rs,Os=Rs);return Ms&&ml(J,os),Ye}for(Ve=r(Ve);!Rs.done;os++,Rs=ae.next())Rs=ue(Ve,J,os,Rs.value,Ne),Rs!==null&&(s&&Rs.alternate!==null&&Ve.delete(Rs.key===null?os:Rs.key),F=d(Rs,F,os),Os===null?Ye=Rs:Os.sibling=Rs,Os=Rs);return s&&Ve.forEach(function(d0){return t(J,d0)}),Ms&&ml(J,os),Ye}function Qs(J,F,ae,Ne){if(typeof ae=="object"&&ae!==null&&ae.type===D&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:e:{for(var Ye=ae.key;F!==null;){if(F.key===Ye){if(Ye=ae.type,Ye===D){if(F.tag===7){a(J,F.sibling),Ne=o(F,ae.props.children),Ne.return=J,J=Ne;break e}}else if(F.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===ee&&En(Ye)===F.type){a(J,F.sibling),Ne=o(F,ae.props),ii(Ne,ae),Ne.return=J,J=Ne;break e}a(J,F);break}else t(J,F);F=F.sibling}ae.type===D?(Ne=_n(ae.props.children,J.mode,Ne,ae.key),Ne.return=J,J=Ne):(Ne=Nc(ae.type,ae.key,ae.props,null,J.mode,Ne),ii(Ne,ae),Ne.return=J,J=Ne)}return j(J);case b:e:{for(Ye=ae.key;F!==null;){if(F.key===Ye)if(F.tag===4&&F.stateNode.containerInfo===ae.containerInfo&&F.stateNode.implementation===ae.implementation){a(J,F.sibling),Ne=o(F,ae.children||[]),Ne.return=J,J=Ne;break e}else{a(J,F);break}else t(J,F);F=F.sibling}Ne=Ad(ae,J.mode,Ne),Ne.return=J,J=Ne}return j(J);case ee:return ae=En(ae),Qs(J,F,ae,Ne)}if(fe(ae))return Ie(J,F,ae,Ne);if(ve(ae)){if(Ye=ve(ae),typeof Ye!="function")throw Error(c(150));return ae=Ye.call(ae),Xe(J,F,ae,Ne)}if(typeof ae.then=="function")return Qs(J,F,Cc(ae),Ne);if(ae.$$typeof===E)return Qs(J,F,wc(J,ae),Ne);Tc(J,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,F!==null&&F.tag===6?(a(J,F.sibling),Ne=o(F,ae),Ne.return=J,J=Ne):(a(J,F),Ne=Md(ae,J.mode,Ne),Ne.return=J,J=Ne),j(J)):a(J,F)}return function(J,F,ae,Ne){try{ri=0;var Ye=Qs(J,F,ae,Ne);return fr=null,Ye}catch(Ve){if(Ve===hr||Ve===Sc)throw Ve;var Os=ja(29,Ve,null,J.mode);return Os.lanes=Ne,Os.return=J,Os}finally{}}}var An=uh(!0),mh=uh(!1),Hl=!1;function Fd(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gd(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 Fl(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Gl(s,t,a){var r=s.updateQueue;if(r===null)return null;if(r=r.shared,(Is&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=vc(s),Yx(s,null,a),t}return jc(s,r,t,a),vc(s)}function ci(s,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=s.pendingLanes,a|=r,t.lanes=a,Jt(s,a)}}function Vd(s,t){var a=s.updateQueue,r=s.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var j={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?o=d=j:d=d.next=j,a=a.next}while(a!==null);d===null?o=d=t:d=d.next=t}else o=d=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},s.updateQueue=a;return}s=a.lastBaseUpdate,s===null?a.firstBaseUpdate=t:s.next=t,a.lastBaseUpdate=t}var qd=!1;function oi(){if(qd){var s=xr;if(s!==null)throw s}}function di(s,t,a,r){qd=!1;var o=s.updateQueue;Hl=!1;var d=o.firstBaseUpdate,j=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var B=k,le=B.next;B.next=null,j===null?d=le:j.next=le,j=B;var pe=s.alternate;pe!==null&&(pe=pe.updateQueue,k=pe.lastBaseUpdate,k!==j&&(k===null?pe.firstBaseUpdate=le:k.next=le,pe.lastBaseUpdate=B))}if(d!==null){var be=o.baseState;j=0,pe=le=B=null,k=d;do{var ie=k.lane&-536870913,ue=ie!==k.lane;if(ue?(Cs&ie)===ie:(r&ie)===ie){ie!==0&&ie===mr&&(qd=!0),pe!==null&&(pe=pe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Ie=s,Xe=k;ie=t;var Qs=a;switch(Xe.tag){case 1:if(Ie=Xe.payload,typeof Ie=="function"){be=Ie.call(Qs,be,ie);break e}be=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Xe.payload,ie=typeof Ie=="function"?Ie.call(Qs,be,ie):Ie,ie==null)break e;be=v({},be,ie);break e;case 2:Hl=!0}}ie=k.callback,ie!==null&&(s.flags|=64,ue&&(s.flags|=8192),ue=o.callbacks,ue===null?o.callbacks=[ie]:ue.push(ie))}else ue={lane:ie,tag:k.tag,payload:k.payload,callback:k.callback,next:null},pe===null?(le=pe=ue,B=be):pe=pe.next=ue,j|=ie;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;ue=k,k=ue.next,ue.next=null,o.lastBaseUpdate=ue,o.shared.pending=null}}while(!0);pe===null&&(B=be),o.baseState=B,o.firstBaseUpdate=le,o.lastBaseUpdate=pe,d===null&&(o.shared.lanes=0),Yl|=j,s.lanes=j,s.memoizedState=be}}function xh(s,t){if(typeof s!="function")throw Error(c(191,s));s.call(t)}function hh(s,t){var a=s.callbacks;if(a!==null)for(s.callbacks=null,s=0;sd?d:8;var j=z.T,k={};z.T=k,uu(s,!1,t,a);try{var B=o(),le=z.S;if(le!==null&&le(k,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var pe=Wb(B,r);xi(s,t,pe,wa(s))}else xi(s,t,r,wa(s))}catch(be){xi(s,t,{then:function(){},status:"rejected",reason:be},wa())}finally{Q.p=d,j!==null&&k.types!==null&&(j.types=k.types),z.T=j}}function ny(){}function ou(s,t,a,r){if(s.tag!==5)throw Error(c(476));var o=qh(s).queue;Vh(s,o,t,I,a===null?ny:function(){return Kh(s),a(r)})}function qh(s){var t=s.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:I},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:a},next:null},s.memoizedState=t,s=s.alternate,s!==null&&(s.memoizedState=t),t}function Kh(s){var t=qh(s);t.next===null&&(t=s.alternate.memoizedState),xi(s,t.next.queue,{},wa())}function du(){return Gt(Mi)}function Qh(){return wt().memoizedState}function Yh(){return wt().memoizedState}function ry(s){for(var t=s.return;t!==null;){switch(t.tag){case 24:case 3:var a=wa();s=Fl(a);var r=Gl(t,s,a);r!==null&&(ha(r,t,a),ci(r,t,a)),t={cache:$d()},s.payload=t;return}t=t.return}}function iy(s,t,a){var r=wa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bc(s)?Xh(t,a):(a=Td(s,t,a,r),a!==null&&(ha(a,s,r),Zh(a,t,r)))}function Jh(s,t,a){var r=wa();xi(s,t,a,r)}function xi(s,t,a,r){var o={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bc(s))Xh(t,o);else{var d=s.alternate;if(s.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var j=t.lastRenderedState,k=d(j,a);if(o.hasEagerState=!0,o.eagerState=k,ga(k,j))return jc(s,t,o,0),Xs===null&&gc(),!1}catch{}finally{}if(a=Td(s,t,o,r),a!==null)return ha(a,s,r),Zh(a,t,r),!0}return!1}function uu(s,t,a,r){if(r={lane:2,revertLane:Fu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bc(s)){if(t)throw Error(c(479))}else t=Td(s,a,r,2),t!==null&&ha(t,s,2)}function Bc(s){var t=s.alternate;return s===is||t!==null&&t===is}function Xh(s,t){gr=Ac=!0;var a=s.pending;a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t}function Zh(s,t,a){if((a&4194048)!==0){var r=t.lanes;r&=s.pendingLanes,a|=r,t.lanes=a,Jt(s,a)}}var hi={readContext:Gt,use:Oc,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};hi.useEffectEvent=gt;var Wh={readContext:Gt,use:Oc,useCallback:function(s,t){return aa().memoizedState=[s,t===void 0?null:t],s},useContext:Gt,useEffect:Lh,useImperativeHandle:function(s,t,a){a=a!=null?a.concat([s]):null,Lc(4194308,4,Ih.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=aa();t=t===void 0?null:t;var r=s();if(zn){es(!0);try{s()}finally{es(!1)}}return a.memoizedState=[r,t],r},useReducer:function(s,t,a){var r=aa();if(a!==void 0){var o=a(t);if(zn){es(!0);try{a(t)}finally{es(!1)}}}else o=t;return r.memoizedState=r.baseState=o,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:o},r.queue=s,s=s.dispatch=iy.bind(null,is,s),[r.memoizedState,s]},useRef:function(s){var t=aa();return s={current:s},t.memoizedState=s},useState:function(s){s=lu(s);var t=s.queue,a=Jh.bind(null,is,t);return t.dispatch=a,[s.memoizedState,a]},useDebugValue:iu,useDeferredValue:function(s,t){var a=aa();return cu(a,s,t)},useTransition:function(){var s=lu(!1);return s=Vh.bind(null,is,s.queue,!0,!1),aa().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,t,a){var r=is,o=aa();if(Ms){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Xs===null)throw Error(c(349));(Cs&127)!==0||Nh(r,t,a)}o.memoizedState=a;var d={value:a,getSnapshot:t};return o.queue=d,Lh(yh.bind(null,r,d,s),[s]),r.flags|=2048,vr(9,{destroy:void 0},bh.bind(null,r,d,a,t),null),a},useId:function(){var s=aa(),t=Xs.identifierPrefix;if(Ms){var a=el,r=Wa;a=(r&~(1<<32-Ns(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=zc++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?j.createElement("select",{is:r.is}):j.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?j.createElement(o,{is:r.is}):j.createElement(o)}}d[gs]=t,d[cs]=r;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)d.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=d;e:switch(qt(d,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&jl(t)}}return ct(t),Su(t,t.type,s===null?null:s.memoizedProps,t.pendingProps,a),null;case 6:if(s&&t.stateNode!=null)s.memoizedProps!==r&&jl(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(s=V.current,dr(t)){if(s=t.stateNode,a=t.memoizedProps,r=null,o=Ft,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}s[gs]=t,s=!!(s.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||vp(s.nodeValue,a)),s||Il(t,!0)}else s=lo(s).createTextNode(r),s[gs]=t,t.stateNode=s}return ct(t),null;case 31:if(a=t.memoizedState,s===null||s.memoizedState!==null){if(r=dr(t),a!==null){if(s===null){if(!r)throw Error(c(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(c(557));s[gs]=t}else Sn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),s=!1}else a=Rd(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=a),s=!0;if(!s)return t.flags&256?(Na(t),t):(Na(t),null);if((t.flags&128)!==0)throw Error(c(558))}return ct(t),null;case 13:if(r=t.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(o=dr(t),r!==null&&r.dehydrated!==null){if(s===null){if(!o)throw Error(c(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));o[gs]=t}else Sn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),o=!1}else o=Rd(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Na(t),t):(Na(t),null)}return Na(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,s=s!==null&&s.memoizedState!==null,a&&(r=t.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==o&&(r.flags|=2048)),a!==s&&a&&(t.child.flags|=8192),Fc(t,t.updateQueue),ct(t),null);case 4:return X(),s===null&&Ku(t.stateNode.containerInfo),ct(t),null;case 10:return hl(t.type),ct(t),null;case 19:if(je(yt),r=t.memoizedState,r===null)return ct(t),null;if(o=(t.flags&128)!==0,d=r.rendering,d===null)if(o)pi(r,!1);else{if(jt!==0||s!==null&&(s.flags&128)!==0)for(s=t.child;s!==null;){if(d=Mc(s),d!==null){for(t.flags|=128,pi(r,!1),s=d.updateQueue,t.updateQueue=s,Fc(t,s),t.subtreeFlags=0,s=a,a=t.child;a!==null;)Jx(a,s),a=a.sibling;return Se(yt,yt.current&1|2),Ms&&ml(t,r.treeForkCount),t.child}s=s.sibling}r.tail!==null&&ut()>Qc&&(t.flags|=128,o=!0,pi(r,!1),t.lanes=4194304)}else{if(!o)if(s=Mc(d),s!==null){if(t.flags|=128,o=!0,s=s.updateQueue,t.updateQueue=s,Fc(t,s),pi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Ms)return ct(t),null}else 2*ut()-r.renderingStartTime>Qc&&a!==536870912&&(t.flags|=128,o=!0,pi(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(s=r.last,s!==null?s.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(s=r.tail,r.rendering=s,r.tail=s.sibling,r.renderingStartTime=ut(),s.sibling=null,a=yt.current,Se(yt,o?a&1|2:a&1),Ms&&ml(t,r.treeForkCount),s):(ct(t),null);case 22:case 23:return Na(t),Qd(),r=t.memoizedState!==null,s!==null?s.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),a=t.updateQueue,a!==null&&Fc(t,a.retryQueue),a=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),s!==null&&je(Tn),null;case 24:return a=null,s!==null&&(a=s.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hl(Tt),ct(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function my(s,t){switch(Dd(t),t.tag){case 1:return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 3:return hl(Tt),X(),s=t.flags,(s&65536)!==0&&(s&128)===0?(t.flags=s&-65537|128,t):null;case 26:case 27:case 5:return Ge(t),null;case 31:if(t.memoizedState!==null){if(Na(t),t.alternate===null)throw Error(c(340));Sn()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 13:if(Na(t),s=t.memoizedState,s!==null&&s.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Sn()}return s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 19:return je(yt),null;case 4:return X(),null;case 10:return hl(t.type),null;case 22:case 23:return Na(t),Qd(),s!==null&&je(Tn),s=t.flags,s&65536?(t.flags=s&-65537|128,t):null;case 24:return hl(Tt),null;case 25:return null;default:return null}}function _f(s,t){switch(Dd(t),t.tag){case 3:hl(Tt),X();break;case 26:case 27:case 5:Ge(t);break;case 4:X();break;case 31:t.memoizedState!==null&&Na(t);break;case 13:Na(t);break;case 19:je(yt);break;case 10:hl(t.type);break;case 22:case 23:Na(t),Qd(),s!==null&&je(Tn);break;case 24:hl(Tt)}}function gi(s,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var o=r.next;a=o;do{if((a.tag&s)===s){r=void 0;var d=a.create,j=a.inst;r=d(),j.destroy=r}a=a.next}while(a!==o)}}catch(k){Vs(t,t.return,k)}}function Kl(s,t,a){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var d=o.next;r=d;do{if((r.tag&s)===s){var j=r.inst,k=j.destroy;if(k!==void 0){j.destroy=void 0,o=t;var B=a,le=k;try{le()}catch(pe){Vs(o,B,pe)}}}r=r.next}while(r!==d)}}catch(pe){Vs(t,t.return,pe)}}function Sf(s){var t=s.updateQueue;if(t!==null){var a=s.stateNode;try{hh(t,a)}catch(r){Vs(s,s.return,r)}}}function kf(s,t,a){a.props=Dn(s.type,s.memoizedProps),a.state=s.memoizedState;try{a.componentWillUnmount()}catch(r){Vs(s,t,r)}}function ji(s,t){try{var a=s.ref;if(a!==null){switch(s.tag){case 26:case 27:case 5:var r=s.stateNode;break;case 30:r=s.stateNode;break;default:r=s.stateNode}typeof a=="function"?s.refCleanup=a(r):a.current=r}}catch(o){Vs(s,t,o)}}function sl(s,t){var a=s.ref,r=s.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(o){Vs(s,t,o)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){Vs(s,t,o)}else a.current=null}function Cf(s){var t=s.type,a=s.memoizedProps,r=s.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(o){Vs(s,s.return,o)}}function ku(s,t,a){try{var r=s.stateNode;Oy(r,s.type,a,t),r[cs]=t}catch(o){Vs(s,s.return,o)}}function Tf(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&en(s.type)||s.tag===4}function Cu(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Tf(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&&en(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 Tu(s,t,a){var r=s.tag;if(r===5||r===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=ol));else if(r!==4&&(r===27&&en(s.type)&&(a=s.stateNode,t=null),s=s.child,s!==null))for(Tu(s,t,a),s=s.sibling;s!==null;)Tu(s,t,a),s=s.sibling}function Gc(s,t,a){var r=s.tag;if(r===5||r===6)s=s.stateNode,t?a.insertBefore(s,t):a.appendChild(s);else if(r!==4&&(r===27&&en(s.type)&&(a=s.stateNode),s=s.child,s!==null))for(Gc(s,t,a),s=s.sibling;s!==null;)Gc(s,t,a),s=s.sibling}function Ef(s){var t=s.stateNode,a=s.memoizedProps;try{for(var r=s.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);qt(t,r,a),t[gs]=s,t[cs]=a}catch(d){Vs(s,s.return,d)}}var vl=!1,At=!1,Eu=!1,Mf=typeof WeakSet=="function"?WeakSet:Set,$t=null;function xy(s,t){if(s=s.containerInfo,Ju=mo,s=Px(s),yd(s)){if("selectionStart"in s)var a={start:s.selectionStart,end:s.selectionEnd};else e:{a=(a=s.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var j=0,k=-1,B=-1,le=0,pe=0,be=s,ie=null;s:for(;;){for(var ue;be!==a||o!==0&&be.nodeType!==3||(k=j+o),be!==d||r!==0&&be.nodeType!==3||(B=j+r),be.nodeType===3&&(j+=be.nodeValue.length),(ue=be.firstChild)!==null;)ie=be,be=ue;for(;;){if(be===s)break s;if(ie===a&&++le===o&&(k=j),ie===d&&++pe===r&&(B=j),(ue=be.nextSibling)!==null)break;be=ie,ie=be.parentNode}be=ue}a=k===-1||B===-1?null:{start:k,end:B}}else a=null}a=a||{start:0,end:0}}else a=null;for(Xu={focusedElem:s,selectionRange:a},mo=!1,$t=t;$t!==null;)if(t=$t,s=t.child,(t.subtreeFlags&1028)!==0&&s!==null)s.return=t,$t=s;else for(;$t!==null;){switch(t=$t,d=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"))),qt(d,r,a),d[gs]=s,Bt(d),r=d;break e;case"link":var j=Lp("link","href",o).get(r+(a.href||""));if(j){for(var k=0;kQs&&(j=Qs,Qs=Xe,Xe=j);var J=$x(k,Xe),F=$x(k,Qs);if(J&&F&&(ue.rangeCount!==1||ue.anchorNode!==J.node||ue.anchorOffset!==J.offset||ue.focusNode!==F.node||ue.focusOffset!==F.offset)){var ae=be.createRange();ae.setStart(J.node,J.offset),ue.removeAllRanges(),Xe>Qs?(ue.addRange(ae),ue.extend(F.node,F.offset)):(ae.setEnd(F.node,F.offset),ue.addRange(ae))}}}}for(be=[],ue=k;ue=ue.parentNode;)ue.nodeType===1&&be.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;ka?32:a,z.T=null,a=Lu,Lu=null;var d=Xl,j=_l;if(Dt=0,_r=Xl=null,_l=0,(Is&6)!==0)throw Error(c(331));var k=Is;if(Is|=4,Pf(d.current),Bf(d,d.current,j,a),Is=k,_i(0,!1),ls&&typeof ls.onPostCommitFiberRoot=="function")try{ls.onPostCommitFiberRoot(vs,d)}catch{}return!0}finally{Q.p=o,z.T=r,np(s,t)}}function ip(s,t,a){t=Da(a,t),t=fu(s.stateNode,t,2),s=Gl(s,t,2),s!==null&&(ze(s,2),tl(s))}function Vs(s,t,a){if(s.tag===3)ip(s,s,a);else for(;t!==null;){if(t.tag===3){ip(t,s,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Jl===null||!Jl.has(r))){s=Da(a,s),a=cf(2),r=Gl(t,a,2),r!==null&&(of(a,r,t,s),ze(r,2),tl(r));break}}t=t.return}}function Iu(s,t,a){var r=s.pingCache;if(r===null){r=s.pingCache=new py;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(zu=!0,o.add(a),s=by.bind(null,s,t,a),t.then(s,s))}function by(s,t,a){var r=s.pingCache;r!==null&&r.delete(t),s.pingedLanes|=s.suspendedLanes&a,s.warmLanes&=~a,Xs===s&&(Cs&a)===a&&(jt===4||jt===3&&(Cs&62914560)===Cs&&300>ut()-Kc?(Is&2)===0&&Sr(s,0):Du|=a,wr===Cs&&(wr=0)),tl(s)}function cp(s,t){t===0&&(t=Z()),s=wn(s,t),s!==null&&(ze(s,t),tl(s))}function yy(s){var t=s.memoizedState,a=0;t!==null&&(a=t.retryLane),cp(s,a)}function wy(s,t){var a=0;switch(s.tag){case 31:case 13:var r=s.stateNode,o=s.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=s.stateNode;break;case 22:r=s.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),cp(s,a)}function _y(s,t){return Rt(s,t)}var eo=null,Cr=null,Pu=!1,so=!1,Hu=!1,Wl=0;function tl(s){s!==Cr&&s.next===null&&(Cr===null?eo=Cr=s:Cr=Cr.next=s),so=!0,Pu||(Pu=!0,ky())}function _i(s,t){if(!Hu&&so){Hu=!0;do for(var a=!1,r=eo;r!==null;){if(s!==0){var o=r.pendingLanes;if(o===0)var d=0;else{var j=r.suspendedLanes,k=r.pingedLanes;d=(1<<31-Ns(42|s)+1)-1,d&=o&~(j&~k),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,mp(r,d))}else d=Cs,d=Za(r,r===Xs?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||il(r,d)||(a=!0,mp(r,d));r=r.next}while(a);Hu=!1}}function Sy(){op()}function op(){so=Pu=!1;var s=0;Wl!==0&&Ly()&&(s=Wl);for(var t=ut(),a=null,r=eo;r!==null;){var o=r.next,d=dp(r,t);d===0?(r.next=null,a===null?eo=o:a.next=o,o===null&&(Cr=a)):(a=r,(s!==0||(d&3)!==0)&&(so=!0)),r=o}Dt!==0&&Dt!==5||_i(s),Wl!==0&&(Wl=0)}function dp(s,t){for(var a=s.suspendedLanes,r=s.pingedLanes,o=s.expirationTimes,d=s.pendingLanes&-62914561;0k)break;var pe=B.transferSize,be=B.initiatorType;pe&&Np(be)&&(B=B.responseEnd,j+=pe*(B"u"?null:document;function zp(s,t,a){var r=Tr;if(r&&typeof t=="string"&&t){var o=Aa(t);o='link[rel="'+s+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Ap.has(o)||(Ap.add(o),s={rel:s,crossOrigin:a,href:t},r.querySelector(o)===null&&(t=r.createElement("link"),qt(t,"link",s),Bt(t),r.head.appendChild(t)))}}function Vy(s){Sl.D(s),zp("dns-prefetch",s,null)}function qy(s,t){Sl.C(s,t),zp("preconnect",s,t)}function Ky(s,t,a){Sl.L(s,t,a);var r=Tr;if(r&&s&&t){var o='link[rel="preload"][as="'+Aa(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+Aa(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+Aa(a.imageSizes)+'"]')):o+='[href="'+Aa(s)+'"]';var d=o;switch(t){case"style":d=Er(s);break;case"script":d=Mr(s)}$a.has(d)||(s=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:s,as:t},a),$a.set(d,s),r.querySelector(o)!==null||t==="style"&&r.querySelector(Ti(d))||t==="script"&&r.querySelector(Ei(d))||(t=r.createElement("link"),qt(t,"link",s),Bt(t),r.head.appendChild(t)))}}function Qy(s,t){Sl.m(s,t);var a=Tr;if(a&&s){var r=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Aa(r)+'"][href="'+Aa(s)+'"]',d=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Mr(s)}if(!$a.has(d)&&(s=v({rel:"modulepreload",href:s},t),$a.set(d,s),a.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ei(d)))return}r=a.createElement("link"),qt(r,"link",s),Bt(r),a.head.appendChild(r)}}}function Yy(s,t,a){Sl.S(s,t,a);var r=Tr;if(r&&s){var o=Xn(r).hoistableStyles,d=Er(s);t=t||"default";var j=o.get(d);if(!j){var k={loading:0,preload:null};if(j=r.querySelector(Ti(d)))k.loading=5;else{s=v({rel:"stylesheet",href:s,"data-precedence":t},a),(a=$a.get(d))&&lm(s,a);var B=j=r.createElement("link");Bt(B),qt(B,"link",s),B._p=new Promise(function(le,pe){B.onload=le,B.onerror=pe}),B.addEventListener("load",function(){k.loading|=1}),B.addEventListener("error",function(){k.loading|=2}),k.loading|=4,ro(j,t,r)}j={type:"stylesheet",instance:j,count:1,state:k},o.set(d,j)}}}function Jy(s,t){Sl.X(s,t);var a=Tr;if(a&&s){var r=Xn(a).hoistableScripts,o=Mr(s),d=r.get(o);d||(d=a.querySelector(Ei(o)),d||(s=v({src:s,async:!0},t),(t=$a.get(o))&&nm(s,t),d=a.createElement("script"),Bt(d),qt(d,"link",s),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(o,d))}}function Xy(s,t){Sl.M(s,t);var a=Tr;if(a&&s){var r=Xn(a).hoistableScripts,o=Mr(s),d=r.get(o);d||(d=a.querySelector(Ei(o)),d||(s=v({src:s,async:!0,type:"module"},t),(t=$a.get(o))&&nm(s,t),d=a.createElement("script"),Bt(d),qt(d,"link",s),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(o,d))}}function Dp(s,t,a,r){var o=(o=V.current)?no(o):null;if(!o)throw Error(c(446));switch(s){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Er(a.href),a=Xn(o).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){s=Er(a.href);var d=Xn(o).hoistableStyles,j=d.get(s);if(j||(o=o.ownerDocument||o,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(s,j),(d=o.querySelector(Ti(s)))&&!d._p&&(j.instance=d,j.state.loading=5),$a.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},$a.set(s,a),d||Zy(o,s,a,j.state))),t&&r===null)throw Error(c(528,""));return j}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Mr(a),a=Xn(o).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,s))}}function Er(s){return'href="'+Aa(s)+'"'}function Ti(s){return'link[rel="stylesheet"]['+s+"]"}function Op(s){return v({},s,{"data-precedence":s.precedence,precedence:null})}function Zy(s,t,a,r){s.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=s.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),qt(t,"link",a),Bt(t),s.head.appendChild(t))}function Mr(s){return'[src="'+Aa(s)+'"]'}function Ei(s){return"script[async]"+s}function Rp(s,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=s.querySelector('style[data-href~="'+Aa(a.href)+'"]');if(r)return t.instance=r,Bt(r),r;var o=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(s.ownerDocument||s).createElement("style"),Bt(r),qt(r,"style",o),ro(r,a.precedence,s),t.instance=r;case"stylesheet":o=Er(a.href);var d=s.querySelector(Ti(o));if(d)return t.state.loading|=4,t.instance=d,Bt(d),d;r=Op(a),(o=$a.get(o))&&lm(r,o),d=(s.ownerDocument||s).createElement("link"),Bt(d);var j=d;return j._p=new Promise(function(k,B){j.onload=k,j.onerror=B}),qt(d,"link",r),t.state.loading|=4,ro(d,a.precedence,s),t.instance=d;case"script":return d=Mr(a.src),(o=s.querySelector(Ei(d)))?(t.instance=o,Bt(o),o):(r=a,(o=$a.get(d))&&(r=v({},a),nm(r,o)),s=s.ownerDocument||s,o=s.createElement("script"),Bt(o),qt(o,"link",r),s.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,ro(r,a.precedence,s));return t.instance}function ro(s,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,d=o,j=0;j title"):null)}function Wy(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 Bp(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function e0(s,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=Er(r.href),d=t.querySelector(Ti(o));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(s.count++,s=co.bind(s),t.then(s,s)),a.state.loading|=4,a.instance=d,Bt(d);return}d=t.ownerDocument||t,r=Op(r),(o=$a.get(o))&&lm(r,o),d=d.createElement("link"),Bt(d);var j=d;j._p=new Promise(function(k,B){j.onload=k,j.onerror=B}),qt(d,"link",r),a.instance=d}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(s.count++,a=co.bind(s),t.addEventListener("load",a),t.addEventListener("error",a))}}var rm=0;function s0(s,t){return s.stylesheets&&s.count===0&&uo(s,s.stylesheets),0rm?50:800)+t);return s.unsuspend=a,function(){s.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function co(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uo(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var oo=null;function uo(s,t){s.stylesheets=null,s.unsuspend!==null&&(s.count++,oo=new Map,t.forEach(t0,s),oo=null,co.call(s))}function t0(s,t){if(!(t.state.loading&4)){var a=oo.get(s);if(a)var r=a.get(null);else{a=new Map,oo.set(s,a);for(var o=s.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(n){console.error(n)}}return l(),gm.exports=G1(),gm.exports}var q1=V1();function P(...l){return y0(w0(l))}const Ce=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("rounded-xl border bg-card text-card-foreground shadow",l),...n}));Ce.displayName="Card";const Pe=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("flex flex-col space-y-1.5 p-6",l),...n}));Pe.displayName="CardHeader";const He=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("font-semibold leading-none tracking-tight",l),...n}));He.displayName="CardTitle";const As=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("text-sm text-muted-foreground",l),...n}));As.displayName="CardDescription";const Re=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("p-6 pt-0",l),...n}));Re.displayName="CardContent";const qo=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("flex items-center p-6 pt-0",l),...n}));qo.displayName="CardFooter";const ra=S0,ea=m.forwardRef(({className:l,...n},i)=>e.jsx(Ag,{ref:i,className:P("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",l),...n}));ea.displayName=Ag.displayName;const ts=m.forwardRef(({className:l,...n},i)=>e.jsx(zg,{ref:i,className:P("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",l),...n}));ts.displayName=zg.displayName;const bs=m.forwardRef(({className:l,...n},i)=>e.jsx(Dg,{ref:i,className:P("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",l),...n}));bs.displayName=Dg.displayName;const Je=m.forwardRef(({className:l,children:n,viewportRef:i,...c},u)=>e.jsxs(Og,{ref:u,className:P("relative overflow-hidden",l),...c,children:[e.jsx(k0,{ref:i,className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(Dm,{}),e.jsx(Dm,{orientation:"horizontal"}),e.jsx(C0,{})]}));Je.displayName=Og.displayName;const Dm=m.forwardRef(({className:l,orientation:n="vertical",...i},c)=>e.jsx(Rg,{ref:c,orientation:n,className:P("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",l),...i,children:e.jsx(T0,{className:"relative flex-1 rounded-full bg-border"})}));Dm.displayName=Rg.displayName;function _s({className:l,...n}){return e.jsx("div",{className:P("animate-pulse rounded-md bg-primary/10",l),...n})}const Fn=m.forwardRef(({className:l,value:n,...i},c)=>e.jsx(Lg,{ref:c,className:P("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",l),...i,children:e.jsx(E0,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})}));Fn.displayName=Lg.displayName;async function we(l,n){const c=n?.body instanceof FormData?{...n?.headers}:{"Content-Type":"application/json",...n?.headers},u={...n,credentials:"include",headers:c},x=await fetch(l,u);if(x.status===401)throw window.location.href="/auth",new Error("่ฎค่ฏๅคฑ่ดฅ๏ผŒ่ฏท้‡ๆ–ฐ็™ปๅฝ•");return x}function Fs(){return{"Content-Type":"application/json"}}async function K1(){try{await fetch("/api/webui/auth/logout",{method:"POST",credentials:"include"})}catch(l){console.error("็™ปๅ‡บ่ฏทๆฑ‚ๅคฑ่ดฅ:",l)}window.location.href="/auth"}async function Yi(){try{return(await(await fetch("/api/webui/auth/check",{method:"GET",credentials:"include"})).json()).authenticated===!0}catch{return!1}}const Q1={light:"",dark:".dark"},Qj=m.createContext(null);function Yj(){const l=m.useContext(Qj);if(!l)throw new Error("useChart must be used within a ");return l}const Or=m.forwardRef(({id:l,className:n,children:i,config:c,...u},x)=>{const h=m.useId(),f=`chart-${l||h.replace(/:/g,"")}`;return e.jsx(Qj.Provider,{value:{config:c},children:e.jsxs("div",{"data-chart":f,ref:x,className:P("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",n),...u,children:[e.jsx(Y1,{id:f,config:c}),e.jsx(iw,{children:i})]})})});Or.displayName="Chart";const Y1=({id:l,config:n})=>{const i=Object.entries(n).filter(([,c])=>c.theme||c.color);return i.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Q1).map(([c,u])=>` ${u} [data-chart=${l}] { ${i.map(([x,h])=>{const f=h.theme?.[c]||h.color;return f?` --color-${x}: ${f};`:null}).join(` `)} } `).join(` -`)}}):null},Li=cw,Rr=m.forwardRef(({active:l,payload:n,className:i,indicator:c="dot",hideLabel:u=!1,hideIndicator:x=!1,label:h,labelFormatter:f,labelClassName:p,formatter:g,color:N,nameKey:v,labelKey:y},w)=>{const{config:b}=Yj(),D=m.useMemo(()=>{if(u||!n?.length)return null;const[_]=n,P=`${y||_?.dataKey||_?.name||"value"}`,E=Dm(b,_,P),C=!y&&typeof h=="string"?b[h]?.label||h:E?.label;return f?e.jsx("div",{className:H("font-medium",p),children:f(C,n)}):C?e.jsx("div",{className:H("font-medium",p),children:C}):null},[h,f,n,u,p,b,y]);if(!l||!n?.length)return null;const A=n.length===1&&c!=="dot";return e.jsxs("div",{ref:w,className:H("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",i),children:[A?null:D,e.jsx("div",{className:"grid gap-1.5",children:n.filter(_=>_.type!=="none").map((_,P)=>{const E=`${v||_.name||_.dataKey||"value"}`,C=Dm(b,_,E),M=N||_.payload.fill||_.color;return e.jsx("div",{className:H("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",c==="dot"&&"items-center"),children:g&&_?.value!==void 0&&_.name?g(_.value,_.name,_,P,_.payload):e.jsxs(e.Fragment,{children:[C?.icon?e.jsx(C.icon,{}):!x&&e.jsx("div",{className:H("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":c==="dot","w-1":c==="line","w-0 border-[1.5px] border-dashed bg-transparent":c==="dashed","my-0.5":A&&c==="dashed"}),style:{"--color-bg":M,"--color-border":M}}),e.jsxs("div",{className:H("flex flex-1 justify-between leading-none",A?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[A?D:null,e.jsx("span",{className:"text-muted-foreground",children:C?.label||_.name})]}),_.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:_.value.toLocaleString()})]})]})},_.dataKey)})})]})});Rr.displayName="ChartTooltip";const J1=ow,Jj=m.forwardRef(({className:l,hideIcon:n=!1,payload:i,verticalAlign:c="bottom",nameKey:u},x)=>{const{config:h}=Yj();return i?.length?e.jsx("div",{ref:x,className:H("flex items-center justify-center gap-4",c==="top"?"pb-3":"pt-3",l),children:i.filter(f=>f.type!=="none").map(f=>{const p=`${u||f.dataKey||"value"}`,g=Dm(h,f,p);return e.jsxs("div",{className:H("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[g?.icon&&!n?e.jsx(g.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:f.color}}),g?.label]},f.value)})}):null});Jj.displayName="ChartLegend";function Dm(l,n,i){if(typeof n!="object"||n===null)return;const c="payload"in n&&typeof n.payload=="object"&&n.payload!==null?n.payload:void 0;let u=i;return i in n&&typeof n[i]=="string"?u=n[i]:c&&i in c&&typeof c[i]=="string"&&(u=c[i]),u in l?l[u]:l[i]}const Pr=Hr("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"}}),S=m.forwardRef(({className:l,variant:n,size:i,asChild:c=!1,...u},x)=>{const h=c?fw:"button";return e.jsx(h,{className:H(Pr({variant:n,size:i,className:l})),ref:x,...u})});S.displayName="Button";const X1=Hr("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 ke({className:l,variant:n,...i}){return e.jsx("div",{className:H(X1({variant:n}),l),...i})}async function Z1(){const l=await we("/api/webui/system/restart",{method:"POST",headers:Fs()});if(!l.ok){const n=await l.json();throw new Error(n.detail||"้‡ๅฏๅคฑ่ดฅ")}return await l.json()}async function W1(){const l=await we("/api/webui/system/status",{method:"GET",headers:Fs()});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–็Šถๆ€ๅคฑ่ดฅ")}return await l.json()}const zr={INITIAL_DELAY:3e3,CHECK_INTERVAL:2e3,CHECK_TIMEOUT:3e3,MAX_ATTEMPTS:60,PROGRESS_INTERVAL:200,SUCCESS_REDIRECT_DELAY:1500},Xj=m.createContext(null);function Vn({children:l,onRestartComplete:n,onRestartFailed:i,healthCheckUrl:c="/api/webui/system/status",maxAttempts:u=zr.MAX_ATTEMPTS}){const[x,h]=m.useState({status:"idle",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:u}),[f,p]=m.useState({}),g=m.useCallback(()=>{f.progress&&clearInterval(f.progress),f.elapsed&&clearInterval(f.elapsed),f.check&&clearTimeout(f.check),p({})},[f]),N=m.useCallback(()=>{g(),h({status:"idle",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:u})},[g,u]),v=m.useCallback(async()=>{try{const A=new AbortController,_=setTimeout(()=>A.abort(),zr.CHECK_TIMEOUT),P=await fetch(c,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include",signal:A.signal});return clearTimeout(_),P.ok}catch{return!1}},[c]),y=m.useCallback(()=>{let A=0;const _=async()=>{if(A++,h(E=>({...E,status:"checking",checkAttempts:A})),await v())g(),h(E=>({...E,status:"success",progress:100})),setTimeout(()=>{n?.(),window.location.href="/auth"},zr.SUCCESS_REDIRECT_DELAY);else if(A>=u){g();const E=`ๅฅๅบทๆฃ€ๆŸฅ่ถ…ๆ—ถ (${A}/${u})`;h(C=>({...C,status:"failed",error:E})),i?.(E)}else{const E=setTimeout(_,zr.CHECK_INTERVAL);p(C=>({...C,check:E}))}};_()},[v,g,u,n,i]),w=m.useCallback(()=>{h(A=>({...A,status:"checking",checkAttempts:0,error:void 0})),y()},[y]),b=m.useCallback(async A=>{const{delay:_=0,skipApiCall:P=!1}=A??{};if(x.status!=="idle"&&x.status!=="failed")return;if(g(),h({status:"requesting",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:u}),_>0&&await new Promise(M=>setTimeout(M,_)),P)h(M=>({...M,status:"restarting"}));else try{h(M=>({...M,status:"restarting"})),await Promise.race([Z1(),new Promise(M=>setTimeout(M,5e3))])}catch{}const E=setInterval(()=>{h(M=>({...M,progress:M.progress>=90?M.progress:M.progress+1}))},zr.PROGRESS_INTERVAL),C=setInterval(()=>{h(M=>({...M,elapsedTime:M.elapsedTime+1}))},1e3);p({progress:E,elapsed:C}),setTimeout(()=>{y()},zr.INITIAL_DELAY)},[x.status,g,u,y]),D={state:x,isRestarting:x.status!=="idle",triggerRestart:b,resetState:N,retryHealthCheck:w};return e.jsx(Xj.Provider,{value:D,children:l})}function fn(){const l=m.useContext(Xj);if(!l)throw new Error("useRestart must be used within a RestartProvider");return l}function e2(){try{return fn()}catch{return null}}const s2=(l,n,i,c,u)=>({idle:{icon:null,title:"",description:"",tip:""},requesting:{icon:e.jsx(Ls,{className:"h-16 w-16 text-primary animate-spin"}),title:c??"ๅ‡†ๅค‡้‡ๅฏ",description:u??"ๆญฃๅœจๅ‘้€้‡ๅฏ่ฏทๆฑ‚...",tip:"๐Ÿ”„ ๆญฃๅœจๅ‡†ๅค‡้‡ๅฏ้บฆ้บฆ..."},restarting:{icon:e.jsx(Ls,{className:"h-16 w-16 text-primary animate-spin"}),title:c??"ๆญฃๅœจ้‡ๅฏ้บฆ้บฆ",description:u??"่ฏท็จๅ€™๏ผŒ้บฆ้บฆๆญฃๅœจ้‡ๅฏไธญ...",tip:"๐Ÿ”„ ้…็ฝฎๅทฒไฟๅญ˜๏ผŒๆญฃๅœจ้‡ๅฏไธป็จ‹ๅบ..."},checking:{icon:e.jsx(Ls,{className:"h-16 w-16 text-primary animate-spin"}),title:"ๆฃ€ๆŸฅๆœๅŠก็Šถๆ€",description:`็ญ‰ๅพ…ๆœๅŠกๆขๅค... (${n}/${i})`,tip:"โณ ๆญฃๅœจ็ญ‰ๅพ…ๆœๅŠกๆขๅค๏ผŒ่ฏทๅ‹ฟๅ…ณ้—ญ้กต้ข..."},success:{icon:e.jsx(la,{className:"h-16 w-16 text-green-500"}),title:"้‡ๅฏๆˆๅŠŸ",description:"ๆญฃๅœจ่ทณ่ฝฌๅˆฐ็™ปๅฝ•้กต้ข...",tip:"โœ… ้…็ฝฎๅทฒ็”Ÿๆ•ˆ๏ผŒๆœๅŠก่ฟ่กŒๆญฃๅธธ"},failed:{icon:e.jsx(St,{className:"h-16 w-16 text-destructive"}),title:"้‡ๅฏ่ถ…ๆ—ถ",description:"ๆœๅŠกๆœช่ƒฝๅœจ้ข„ๆœŸๆ—ถ้—ดๅ†…ๆขๅค",tip:"โš ๏ธ ๅฆ‚ๆžœ้•ฟๆ—ถ้—ดๆ— ๅ“ๅบ”๏ผŒ่ฏทๅฐ่ฏ•ๆ‰‹ๅŠจ้‡ๅฏ"}})[l];function qn({visible:l,onComplete:n,onFailed:i,title:c,description:u,showAnimation:x=!0,className:h}){const f=e2();return(f?f.isRestarting:l)?f?e.jsx(Zj,{state:f.state,onRetry:f.retryHealthCheck,onComplete:n,onFailed:i,title:c,description:u,showAnimation:x,className:h}):e.jsx(t2,{onComplete:n,onFailed:i,title:c,description:u,showAnimation:x,className:h}):null}function Zj({state:l,onRetry:n,onComplete:i,onFailed:c,title:u,description:x,showAnimation:h,className:f}){const{status:p,progress:g,elapsedTime:N,checkAttempts:v,maxAttempts:y}=l;m.useEffect(()=>{p==="success"&&i?i():p==="failed"&&c&&c()},[p,i,c]);const w=s2(p,v,y,u,x),b=D=>{const A=Math.floor(D/60),_=D%60;return`${A}:${_.toString().padStart(2,"0")}`};return e.jsxs("div",{className:H("fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",f),children:[h&&e.jsx(a2,{}),e.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8 relative z-10",children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsxs("div",{className:"relative",children:[w.icon,(p==="restarting"||p==="checking")&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/20 animate-ping"})]}),e.jsx("h2",{className:"text-2xl font-bold",children:w.title}),e.jsx("p",{className:"text-muted-foreground text-center",children:w.description})]}),p!=="failed"&&p!=="idle"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Fn,{value:g,className:"h-2"}),e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[g,"%"]}),e.jsxs("span",{children:["ๅทฒ็”จๆ—ถ: ",b(N)]})]})]}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:w.tip})}),p==="failed"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(S,{onClick:()=>window.location.reload(),variant:"default",className:"flex-1",children:[e.jsx(ft,{className:"mr-2 h-4 w-4"}),"ๅˆทๆ–ฐ้กต้ข"]}),e.jsxs(S,{onClick:n,variant:"secondary",className:"flex-1",children:[e.jsx(Vi,{className:"mr-2 h-4 w-4"}),"้‡่ฏ•ๆฃ€ๆต‹"]})]})]})]})}function t2({onComplete:l,onFailed:n,title:i,description:c,showAnimation:u,className:x}){const[h,f]=m.useState({status:"restarting",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:60}),p=m.useCallback(()=>{let g=0;const N=60,v=async()=>{g++,f(y=>({...y,status:"checking",checkAttempts:g}));try{if((await fetch("/api/webui/system/status",{method:"GET",signal:AbortSignal.timeout(3e3)})).ok){f(w=>({...w,status:"success",progress:100})),setTimeout(()=>{l?.(),window.location.href="/auth"},1500);return}}catch{}g>=N?(f(y=>({...y,status:"failed"})),n?.()):setTimeout(v,2e3)};v()},[l,n]);return m.useEffect(()=>{const g=setInterval(()=>{f(y=>({...y,progress:y.progress>=90?y.progress:y.progress+1}))},200),N=setInterval(()=>{f(y=>({...y,elapsedTime:y.elapsedTime+1}))},1e3),v=setTimeout(()=>{p()},3e3);return()=>{clearInterval(g),clearInterval(N),clearTimeout(v)}},[p]),e.jsx(Zj,{state:h,onRetry:p,onComplete:l,onFailed:n,title:i,description:c,showAnimation:u,className:x})}function a2(){return e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsxs("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px]",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border border-primary/10 animate-[ping_3s_ease-in-out_infinite]"}),e.jsx("div",{className:"absolute inset-8 rounded-full border border-primary/10 animate-[ping_3s_ease-in-out_infinite_0.5s]"}),e.jsx("div",{className:"absolute inset-16 rounded-full border border-primary/10 animate-[ping_3s_ease-in-out_infinite_1s]"})]}),e.jsx("div",{className:"absolute top-1/4 left-1/4 w-2 h-2 bg-primary/20 rounded-full animate-bounce"}),e.jsx("div",{className:"absolute top-3/4 right-1/4 w-3 h-3 bg-primary/15 rounded-full animate-bounce delay-150"}),e.jsx("div",{className:"absolute top-1/2 right-1/3 w-2 h-2 bg-primary/20 rounded-full animate-bounce delay-300"})]})}function l2(){return e.jsx(Vn,{children:e.jsx(r2,{})})}const n2=l=>{const n=[];for(let i=0;i{try{w(!0);const L=await _0.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");v({hitokoto:L.data.hitokoto,from:L.data.from||L.data.from_who||"ๆœช็Ÿฅ"})}catch(L){console.error("่Žทๅ–ไธ€่จ€ๅคฑ่ดฅ:",L),v({hitokoto:"ไบบ็”Ÿๅฐฑๅƒไธ€็›’ๅทงๅ…‹ๅŠ›๏ผŒไฝ ๆฐธ่ฟœไธ็Ÿฅ้“ไธ‹ไธ€้ข—ๆ˜ฏไป€ไนˆๅ‘ณ้“ใ€‚",from:"้˜ฟ็”˜ๆญฃไผ "})}finally{w(!1)}},[]),E=m.useCallback(async()=>{try{const L=await we("/api/webui/system/status");if(L.ok){const I=await L.json();D(I)}else D(null)}catch(L){console.error("่Žทๅ–ๆœบๅ™จไบบ็Šถๆ€ๅคฑ่ดฅ:",L),D(null)}},[]),C=async()=>{await A()},M=m.useCallback(async()=>{try{const L=await we(`/api/webui/statistics/dashboard?hours=${h}`);if(L.ok){const I=await L.json();n(I)}c(!1),x(100)}catch(L){console.error("Failed to fetch dashboard data:",L),c(!1),x(100)}},[h]);if(m.useEffect(()=>{if(!i)return;x(0);const L=setTimeout(()=>x(15),200),I=setTimeout(()=>x(30),800),_e=setTimeout(()=>x(45),2e3),je=setTimeout(()=>x(60),4e3),Se=setTimeout(()=>x(75),6500),K=setTimeout(()=>x(85),9e3),U=setTimeout(()=>x(92),11e3);return()=>{clearTimeout(L),clearTimeout(I),clearTimeout(_e),clearTimeout(je),clearTimeout(Se),clearTimeout(K),clearTimeout(U)}},[i]),m.useEffect(()=>{M(),P(),E()},[M,P,E]),m.useEffect(()=>{if(!p)return;const L=setInterval(()=>{M(),E()},3e4);return()=>clearInterval(L)},[p,M,E]),i||!l)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(ft,{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(Fn,{value:u,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[u,"%"]})]})]})});const{summary:G,model_stats:O=[],hourly_data:ee=[],daily_data:R=[],recent_activity:me=[]}=l,ce=G??{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},ve=L=>{const I=Math.floor(L/3600),_e=Math.floor(L%3600/60);return`${I}ๅฐๆ—ถ${_e}ๅˆ†้’Ÿ`},se=L=>{const I=L.toLocaleString("zh-CN");return L>=1e9?{display:`${(L/1e9).toFixed(2)}B`,exact:I,needsExact:!0}:L>=1e6?{display:`${(L/1e6).toFixed(2)}M`,exact:I,needsExact:!0}:L>=1e4?{display:`${(L/1e3).toFixed(1)}K`,exact:I,needsExact:!0}:L>=1e3?{display:`${(L/1e3).toFixed(2)}K`,exact:I,needsExact:!0}:{display:I,exact:I,needsExact:!1}},ge=L=>{const I=`ยฅ${L.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`;return L>=1e6?{display:`ยฅ${(L/1e6).toFixed(2)}M`,exact:I,needsExact:!0}:L>=1e4?{display:`ยฅ${(L/1e3).toFixed(1)}K`,exact:I,needsExact:!0}:L>=1e3?{display:`ยฅ${(L/1e3).toFixed(2)}K`,exact:I,needsExact:!0}:{display:I,exact:I,needsExact:!1}},fe=L=>new Date(L).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),z=n2(O.length),Q=O.map((L,I)=>({name:L.model_name,value:L.request_count,fill:z[I]})),$={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(Je,{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(ra,{value:h.toString(),onValueChange:L=>f(Number(L)),children:e.jsxs(Wt,{className:"grid grid-cols-3 w-full sm:w-auto",children:[e.jsx(ts,{value:"24",children:"24ๅฐๆ—ถ"}),e.jsx(ts,{value:"168",children:"7ๅคฉ"}),e.jsx(ts,{value:"720",children:"30ๅคฉ"})]})}),e.jsxs(S,{variant:p?"default":"outline",size:"sm",onClick:()=>g(!p),className:"gap-2",children:[e.jsx(ft,{className:`h-4 w-4 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"่‡ชๅŠจๅˆทๆ–ฐ"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:M,children:e.jsx(ft,{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:[y?e.jsx(_s,{className:"h-5 flex-1"}):N?e.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',N.hitokoto,'" โ€”โ€” ',N.from]}):null,e.jsx(S,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:P,disabled:y,children:e.jsx(ft,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[e.jsxs(Ce,{className:"lg:col-span-1",children:[e.jsx(Pe,{className:"pb-3",children:e.jsxs(He,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ec,{className:"h-4 w-4"}),"้บฆ้บฆ็Šถๆ€"]})}),e.jsx(Re,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:b?.running?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),e.jsxs(ke,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[e.jsx(la,{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(ke,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[e.jsx(St,{className:"h-3 w-3 mr-1"}),"ๅทฒๅœๆญข"]})]})}),b&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("span",{children:["v",b.version]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsxs("span",{children:["่ฟ่กŒ ",ve(b.uptime)]})]})]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"pb-3",children:e.jsxs(He,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(El,{className:"h-4 w-4"}),"ๅฟซ้€Ÿๆ“ไฝœ"]})}),e.jsx(Re,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:C,disabled:_,className:"gap-2",children:[e.jsx(Vi,{className:`h-4 w-4 ${_?"animate-spin":""}`}),_?"้‡ๅฏไธญ...":"้‡ๅฏ้บฆ้บฆ"]}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/logs",children:[e.jsx(Sa,{className:"h-4 w-4"}),"ๆŸฅ็œ‹ๆ—ฅๅฟ—"]})}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/plugins",children:[e.jsx(Bw,{className:"h-4 w-4"}),"ๆ’ไปถ็ฎก็†"]})}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/settings",children:[e.jsx(mn,{className:"h-4 w-4"}),"็ณป็ปŸ่ฎพ็ฝฎ"]})})]})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"pb-3",children:[e.jsxs(He,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx($w,{className:"h-4 w-4"}),"ๅ้ฆˆ้—ฎๅท"]}),e.jsx(As,{className:"text-xs",children:"ๅธฎๅŠฉๆˆ‘ไปฌๆ”น่ฟ›ไบงๅ“ไฝ“้ชŒ"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/survey/webui-feedback",children:[e.jsx(Sa,{className:"h-4 w-4"}),"WebUI ๅ้ฆˆ"]})}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/survey/maibot-feedback",children:[e.jsx(Pa,{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(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆ€ป่ฏทๆฑ‚ๆ•ฐ"}),e.jsx($m,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[se(ce.total_requests).display,se(ce.total_requests).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",se(ce.total_requests).exact,")"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["ๆœ€่ฟ‘",h<48?h+"ๅฐๆ—ถ":Math.floor(h/24)+"ๅคฉ"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆ€ป่Šฑ่ดน"}),e.jsx(Iw,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[ge(ce.total_cost).display,ge(ce.total_cost).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",ge(ce.total_cost).exact,")"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ce.cost_per_hour>0?`ยฅ${ce.cost_per_hour.toFixed(2)}/ๅฐๆ—ถ`:"ๆš‚ๆ— ๆ•ฐๆฎ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"Tokenๆถˆ่€—"}),e.jsx(Br,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[se(ce.total_tokens).display,se(ce.total_tokens).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",se(ce.total_tokens).exact,")"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ce.tokens_per_hour>0?`${se(ce.tokens_per_hour).display}/ๅฐๆ—ถ`:"ๆš‚ๆ— ๆ•ฐๆฎ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅนณๅ‡ๅ“ๅบ”"}),e.jsx(El,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[ce.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(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅœจ็บฟๆ—ถ้•ฟ"}),e.jsx(Ya,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"text-xl font-bold",children:[ve(ce.online_time),e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",ce.online_time.toLocaleString(),"็ง’)"]})]})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆถˆๆฏๅค„็†"}),e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-xl font-bold",children:[se(ce.total_messages).display,se(ce.total_messages).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",se(ce.total_messages).exact,")"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["ๅ›žๅค ",se(ce.total_replies).display,se(ce.total_replies).needsExact&&e.jsxs("span",{children:["(",se(ce.total_replies).exact,")"]})," ๆก"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆˆๆœฌๆ•ˆ็އ"}),e.jsx(Im,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-xl font-bold",children:ce.total_messages>0?`ยฅ${(ce.total_cost/ce.total_messages*100).toFixed(2)}`:"ยฅ0.00"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆฏ100ๆกๆถˆๆฏ"})]})]})]}),e.jsxs(ra,{defaultValue:"trends",className:"space-y-4",children:[e.jsxs(Wt,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[e.jsx(ts,{value:"trends",children:"่ถ‹ๅŠฟ"}),e.jsx(ts,{value:"models",children:"ๆจกๅž‹"}),e.jsx(ts,{value:"activity",children:"ๆดปๅŠจ"}),e.jsx(ts,{value:"daily",children:"ๆ—ฅ็ปŸ่ฎก"})]}),e.jsxs(bs,{value:"trends",className:"space-y-4",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่ฏทๆฑ‚่ถ‹ๅŠฟ"}),e.jsxs(As,{children:["ๆœ€่ฟ‘",h,"ๅฐๆ—ถ็š„่ฏทๆฑ‚้‡ๅ˜ๅŒ–"]})]}),e.jsx(Re,{children:e.jsx(Or,{config:$,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(dw,{data:ee,children:[e.jsx(jo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(vo,{dataKey:"timestamp",tickFormatter:L=>fe(L),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>fe(L)})}),e.jsx(uw,{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(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่Šฑ่ดน่ถ‹ๅŠฟ"}),e.jsx(As,{children:"API่ฐƒ็”จๆˆๆœฌๅ˜ๅŒ–"})]}),e.jsx(Re,{children:e.jsx(Or,{config:$,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(xm,{data:ee,children:[e.jsx(jo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(vo,{dataKey:"timestamp",tickFormatter:L=>fe(L),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>fe(L)})}),e.jsx(No,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"Tokenๆถˆ่€—"}),e.jsx(As,{children:"Tokenไฝฟ็”จ้‡ๅ˜ๅŒ–"})]}),e.jsx(Re,{children:e.jsx(Or,{config:$,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(xm,{data:ee,children:[e.jsx(jo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(vo,{dataKey:"timestamp",tickFormatter:L=>fe(L),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>fe(L)})}),e.jsx(No,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),e.jsx(bs,{value:"models",className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆจกๅž‹่ฏทๆฑ‚ๅˆ†ๅธƒ"}),e.jsxs(As,{children:["ๅ„ๆจกๅž‹ไฝฟ็”จๅ ๆฏ” (ๅ…ฑ ",O.length," ไธชๆจกๅž‹)"]})]}),e.jsx(Re,{children:e.jsx(Or,{config:Object.fromEntries(O.map((L,I)=>[L.model_name,{label:L.model_name,color:z[I]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(mw,{children:[e.jsx(Li,{content:e.jsx(Rr,{})}),e.jsx(xw,{data:Q,cx:"50%",cy:"50%",labelLine:!1,label:({name:L,percent:I})=>I&&I<.05?"":`${L} ${I?(I*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:Q.map((L,I)=>e.jsx(hw,{fill:L.fill},`cell-${I}`))})]})})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆจกๅž‹่ฏฆ็ป†็ปŸ่ฎก"}),e.jsx(As,{children:"่ฏทๆฑ‚ๆ•ฐใ€่Šฑ่ดนๅ’Œๆ€ง่ƒฝ"})]}),e.jsx(Re,{children:e.jsx(Je,{className:"h-[300px] sm:h-[400px]",children:e.jsx("div",{className:"space-y-3",children:O.map((L,I)=>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:L.model_name}),e.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${I%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:L.request_count.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"่Šฑ่ดน:"}),e.jsxs("span",{className:"ml-1 font-medium",children:["ยฅ",L.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:[(L.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:[L.avg_response_time.toFixed(2),"s"]})]})]})]},I))})})})]})]})}),e.jsx(bs,{value:"activity",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆœ€่ฟ‘ๆดปๅŠจ"}),e.jsx(As,{children:"ๆœ€ๆ–ฐ็š„API่ฐƒ็”จ่ฎฐๅฝ•"})]}),e.jsx(Re,{children:e.jsx(Je,{className:"h-[400px] sm:h-[500px]",children:e.jsx("div",{className:"space-y-2",children:me.map((L,I)=>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:L.model}),e.jsx("div",{className:"text-xs text-muted-foreground",children:L.request_type})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:fe(L.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:L.tokens})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"่Šฑ่ดน:"}),e.jsxs("span",{className:"ml-1",children:["ยฅ",L.cost.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"่€—ๆ—ถ:"}),e.jsxs("span",{className:"ml-1",children:[L.time_cost.toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"็Šถๆ€:"}),e.jsx("span",{className:`ml-1 ${L.status==="success"?"text-green-600":"text-red-600"}`,children:L.status})]})]})]},I))})})})]})}),e.jsx(bs,{value:"daily",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆฏๆ—ฅ็ปŸ่ฎก"}),e.jsx(As,{children:"ๆœ€่ฟ‘7ๅคฉ็š„ๆ•ฐๆฎๆฑ‡ๆ€ป"})]}),e.jsx(Re,{children:e.jsx(Or,{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(xm,{data:R,children:[e.jsx(jo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(vo,{dataKey:"timestamp",tickFormatter:L=>{const I=new Date(L);return`${I.getMonth()+1}/${I.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>new Date(L).toLocaleDateString("zh-CN")})}),e.jsx(J1,{content:e.jsx(Jj,{})}),e.jsx(No,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),e.jsx(No,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),e.jsx(qn,{})]})})}const i2={theme:"system",setTheme:()=>null},Wj=m.createContext(i2),Vm=()=>{const l=m.useContext(Wj);if(l===void 0)throw new Error("useTheme must be used within a ThemeProvider");return l},c2=(l,n,i)=>{const c=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||c){n(l);return}const u=i.clientX,x=i.clientY,h=Math.hypot(Math.max(u,innerWidth-u),Math.max(x,innerHeight-x));document.startViewTransition(()=>{n(l)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${u}px ${x}px)`,`circle(${h}px at ${u}px ${x}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},ev=m.createContext(void 0),sv=()=>{const l=m.useContext(ev);if(l===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return l},Ve=m.forwardRef(({className:l,...n},i)=>e.jsx(Lg,{className:H("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",l),...n,ref:i,children:e.jsx(M0,{className:H("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=Lg.displayName;const o2=Hr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),T=m.forwardRef(({className:l,...n},i)=>e.jsx(Wg,{ref:i,className:H(o2(),l),...n}));T.displayName=Wg.displayName;const ne=m.forwardRef(({className:l,type:n,...i},c)=>e.jsx("input",{type:n,className:H("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",l),ref:c,...i}));ne.displayName="Input";const d2=5,u2=5e3;let vm=0;function m2(){return vm=(vm+1)%Number.MAX_SAFE_INTEGER,vm.toString()}const Nm=new Map,ig=l=>{if(Nm.has(l))return;const n=setTimeout(()=>{Nm.delete(l),Hi({type:"REMOVE_TOAST",toastId:l})},u2);Nm.set(l,n)},x2=(l,n)=>{switch(n.type){case"ADD_TOAST":return{...l,toasts:[n.toast,...l.toasts].slice(0,d2)};case"UPDATE_TOAST":return{...l,toasts:l.toasts.map(i=>i.id===n.toast.id?{...i,...n.toast}:i)};case"DISMISS_TOAST":{const{toastId:i}=n;return i?ig(i):l.toasts.forEach(c=>{ig(c.id)}),{...l,toasts:l.toasts.map(c=>c.id===i||i===void 0?{...c,open:!1}:c)}}case"REMOVE_TOAST":return n.toastId===void 0?{...l,toasts:[]}:{...l,toasts:l.toasts.filter(i=>i.id!==n.toastId)}}},ko=[];let Co={toasts:[]};function Hi(l){Co=x2(Co,l),ko.forEach(n=>{n(Co)})}function qt({...l}){const n=m2(),i=u=>Hi({type:"UPDATE_TOAST",toast:{...u,id:n}}),c=()=>Hi({type:"DISMISS_TOAST",toastId:n});return Hi({type:"ADD_TOAST",toast:{...l,id:n,open:!0,onOpenChange:u=>{u||c()}}}),{id:n,dismiss:c,update:i}}function st(){const[l,n]=m.useState(Co);return m.useEffect(()=>(ko.push(n),()=>{const i=ko.indexOf(n);i>-1&&ko.splice(i,1)}),[l]),{...l,toast:qt,dismiss:i=>Hi({type:"DISMISS_TOAST",toastId:i})}}const h2=[{id:"minLength",label:"้•ฟๅบฆ่‡ณๅฐ‘ 10 ไฝ",description:"Token ้•ฟๅบฆๅฟ…้กปๅคงไบŽ็ญ‰ไบŽ 10 ไธชๅญ—็ฌฆ",validate:l=>l.length>=10},{id:"hasUppercase",label:"ๅŒ…ๅซๅคงๅ†™ๅญ—ๆฏ",description:"่‡ณๅฐ‘ๅŒ…ๅซไธ€ไธชๅคงๅ†™ๅญ—ๆฏ (A-Z)",validate:l=>/[A-Z]/.test(l)},{id:"hasLowercase",label:"ๅŒ…ๅซๅฐๅ†™ๅญ—ๆฏ",description:"่‡ณๅฐ‘ๅŒ…ๅซไธ€ไธชๅฐๅ†™ๅญ—ๆฏ (a-z)",validate:l=>/[a-z]/.test(l)},{id:"hasSpecialChar",label:"ๅŒ…ๅซ็‰นๆฎŠ็ฌฆๅท",description:"่‡ณๅฐ‘ๅŒ…ๅซไธ€ไธช็‰นๆฎŠ็ฌฆๅท (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:l=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(l)}];function f2(l){const n=h2.map(c=>({id:c.id,label:c.label,description:c.description,passed:c.validate(l)}));return{isValid:n.every(c=>c.passed),rules:n}}const qo="0.12.1",qm="MaiBot Dashboard",p2=`${qm} v${qo}`,g2=(l="v")=>`${l}${qo}`,fa={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"},ll={theme:"system",accentColor:"blue",enableAnimations:!0,enableWavesBackground:!0,logCacheSize:1e3,logAutoScroll:!0,logFontSize:"xs",logLineSpacing:4,dataSyncInterval:30,wsReconnectInterval:3e3,wsMaxReconnectAttempts:10};function Nt(l){const n=tv(l),i=localStorage.getItem(n);if(i===null)return ll[l];const c=ll[l];if(typeof c=="boolean")return i==="true";if(typeof c=="number"){const u=parseFloat(i);return isNaN(u)?c:u}return i}function Lr(l,n){const i=tv(l);localStorage.setItem(i,String(n)),window.dispatchEvent(new CustomEvent("maibot-settings-change",{detail:{key:l,value:n}}))}function j2(){return{theme:Nt("theme"),accentColor:Nt("accentColor"),enableAnimations:Nt("enableAnimations"),enableWavesBackground:Nt("enableWavesBackground"),logCacheSize:Nt("logCacheSize"),logAutoScroll:Nt("logAutoScroll"),logFontSize:Nt("logFontSize"),logLineSpacing:Nt("logLineSpacing"),dataSyncInterval:Nt("dataSyncInterval"),wsReconnectInterval:Nt("wsReconnectInterval"),wsMaxReconnectAttempts:Nt("wsMaxReconnectAttempts")}}function v2(){const l=j2(),n=localStorage.getItem(fa.COMPLETED_TOURS),i=n?JSON.parse(n):[];return{...l,completedTours:i}}function N2(l){const n=[],i=[];for(const[c,u]of Object.entries(l)){if(c==="completedTours"){Array.isArray(u)?(localStorage.setItem(fa.COMPLETED_TOURS,JSON.stringify(u)),n.push("completedTours")):i.push("completedTours");continue}if(c in ll){const x=c,h=ll[x];if(typeof u==typeof h){if(x==="theme"&&!["light","dark","system"].includes(u)){i.push(c);continue}if(x==="logFontSize"&&!["xs","sm","base"].includes(u)){i.push(c);continue}Lr(x,u),n.push(c)}else i.push(c)}else i.push(c)}return{success:n.length>0,imported:n,skipped:i}}function b2(){for(const l of Object.keys(ll))Lr(l,ll[l]);localStorage.removeItem(fa.COMPLETED_TOURS),window.dispatchEvent(new CustomEvent("maibot-settings-reset"))}function y2(){const l=[],n=[],i=[];for(let c=0;cc.size-i.size),{used:l,items:localStorage.length,details:n}}function w2(l){if(l===0)return"0 B";const n=1024,i=["B","KB","MB"],c=Math.floor(Math.log(l)/Math.log(n));return parseFloat((l/Math.pow(n,c)).toFixed(2))+" "+i[c]}function tv(l){return{theme:fa.THEME,accentColor:fa.ACCENT_COLOR,enableAnimations:fa.ENABLE_ANIMATIONS,enableWavesBackground:fa.ENABLE_WAVES_BACKGROUND,logCacheSize:fa.LOG_CACHE_SIZE,logAutoScroll:fa.LOG_AUTO_SCROLL,logFontSize:fa.LOG_FONT_SIZE,logLineSpacing:fa.LOG_LINE_SPACING,dataSyncInterval:fa.DATA_SYNC_INTERVAL,wsReconnectInterval:fa.WS_RECONNECT_INTERVAL,wsMaxReconnectAttempts:fa.WS_MAX_RECONNECT_ATTEMPTS}[l]}const _a=m.forwardRef(({className:l,...n},i)=>e.jsxs(Ug,{ref:i,className:H("relative flex w-full touch-none select-none items-center",l),...n,children:[e.jsx(A0,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(z0,{className:"absolute h-full bg-primary"})}),e.jsx(D0,{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"})]}));_a.displayName=Ug.displayName;class _2{ws=null;reconnectTimeout=null;reconnectAttempts=0;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];getMaxCacheSize(){return Nt("logCacheSize")}getMaxReconnectAttempts(){return Nt("wsMaxReconnectAttempts")}getReconnectInterval(){return Nt("wsReconnectInterval")}getWebSocketUrl(n){let i;{const c=window.location.protocol==="https:"?"wss:":"ws:",u=window.location.host;i=`${c}//${u}/ws/logs`}return n?`${i}?token=${encodeURIComponent(n)}`:i}async getWsToken(){try{const n=await we("/api/webui/ws-token",{method:"GET",credentials:"include"});if(!n.ok)return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",n.status),null;const i=await n.json();return i.success&&i.token?i.token:null}catch(n){return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",n),null}}async connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;if(window.location.pathname==="/auth"){console.log("๐Ÿ“ก ๅœจ็™ปๅฝ•้กต้ข๏ผŒ่ทณ่ฟ‡ WebSocket ่ฟžๆŽฅ");return}if(!await Qi()){console.log("๐Ÿ“ก ๆœช็™ปๅฝ•๏ผŒ่ทณ่ฟ‡ WebSocket ่ฟžๆŽฅ");return}const i=await this.getWsToken();if(!i){console.log("๐Ÿ“ก ๆ— ๆณ•่Žทๅ– WebSocket token๏ผŒ่ทณ่ฟ‡่ฟžๆŽฅ");return}const c=this.getWebSocketUrl(i);try{this.ws=new WebSocket(c),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=u=>{try{if(u.data==="pong")return;const x=JSON.parse(u.data);this.notifyLog(x)}catch(x){console.error("่งฃๆžๆ—ฅๅฟ—ๆถˆๆฏๅคฑ่ดฅ:",x)}},this.ws.onerror=u=>{console.error("โŒ WebSocket ้”™่ฏฏ:",u),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(u){console.error("ๅˆ›ๅปบ WebSocket ่ฟžๆŽฅๅคฑ่ดฅ:",u),this.attemptReconnect()}}attemptReconnect(){const n=this.getMaxReconnectAttempts();if(this.reconnectAttempts>=n)return;this.reconnectAttempts+=1;const i=this.getReconnectInterval(),c=Math.min(i*this.reconnectAttempts,3e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},c)}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(n){return this.logCallbacks.add(n),()=>this.logCallbacks.delete(n)}onConnectionChange(n){return this.connectionCallbacks.add(n),n(this.isConnected),()=>this.connectionCallbacks.delete(n)}notifyLog(n){if(!this.logCache.some(c=>c.id===n.id)){this.logCache.push(n);const c=this.getMaxCacheSize();this.logCache.length>c&&(this.logCache=this.logCache.slice(-c)),this.logCallbacks.forEach(u=>{try{u(n)}catch(x){console.error("ๆ—ฅๅฟ—ๅ›ž่ฐƒๆ‰ง่กŒๅคฑ่ดฅ:",x)}})}}notifyConnection(n){this.connectionCallbacks.forEach(i=>{try{i(n)}catch(c){console.error("่ฟžๆŽฅ็Šถๆ€ๅ›ž่ฐƒๆ‰ง่กŒๅคฑ่ดฅ:",c)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Ln=new _2;typeof window<"u"&&setTimeout(()=>{Ln.connect()},100);const Ps=jw,Ko=vw,S2=pw,av=m.forwardRef(({className:l,...n},i)=>e.jsx(ej,{ref:i,className:H("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",l),...n}));av.displayName=ej.displayName;const Us=m.forwardRef(({className:l,children:n,preventOutsideClose:i=!1,...c},u)=>e.jsxs(S2,{children:[e.jsx(av,{}),e.jsxs(sj,{ref:u,className:H("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",l),onPointerDownOutside:i?x=>x.preventDefault():void 0,onInteractOutside:i?x=>x.preventDefault():void 0,...c,children:[n,e.jsxs(gw,{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(Ca,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Us.displayName=sj.displayName;const Bs=({className:l,...n})=>e.jsx("div",{className:H("flex flex-col space-y-1.5 text-center sm:text-left",l),...n});Bs.displayName="DialogHeader";const et=({className:l,...n})=>e.jsx("div",{className:H("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",l),...n});et.displayName="DialogFooter";const $s=m.forwardRef(({className:l,...n},i)=>e.jsx(tj,{ref:i,className:H("text-lg font-semibold leading-none tracking-tight",l),...n}));$s.displayName=tj.displayName;const Ys=m.forwardRef(({className:l,...n},i)=>e.jsx(aj,{ref:i,className:H("text-sm text-muted-foreground",l),...n}));Ys.displayName=aj.displayName;const js=R0,bt=L0,k2=O0,lv=m.forwardRef(({className:l,...n},i)=>e.jsx(Bg,{className:H("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",l),...n,ref:i}));lv.displayName=Bg.displayName;const ds=m.forwardRef(({className:l,...n},i)=>e.jsxs(k2,{children:[e.jsx(lv,{}),e.jsx($g,{ref:i,className:H("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",l),...n})]}));ds.displayName=$g.displayName;const us=({className:l,...n})=>e.jsx("div",{className:H("flex flex-col space-y-2 text-center sm:text-left",l),...n});us.displayName="AlertDialogHeader";const ms=({className:l,...n})=>e.jsx("div",{className:H("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",l),...n});ms.displayName="AlertDialogFooter";const xs=m.forwardRef(({className:l,...n},i)=>e.jsx(Ig,{ref:i,className:H("text-lg font-semibold",l),...n}));xs.displayName=Ig.displayName;const hs=m.forwardRef(({className:l,...n},i)=>e.jsx(Pg,{ref:i,className:H("text-sm text-muted-foreground",l),...n}));hs.displayName=Pg.displayName;const fs=m.forwardRef(({className:l,variant:n,...i},c)=>e.jsx(Hg,{ref:c,className:H(Pr({variant:n}),l),...i}));fs.displayName=Hg.displayName;const ps=m.forwardRef(({className:l,...n},i)=>e.jsx(Fg,{ref:i,className:H(Pr({variant:"outline"}),"mt-2 sm:mt-0",l),...n}));ps.displayName=Fg.displayName;function C2(){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(ra,{defaultValue:"appearance",className:"w-full",children:[e.jsxs(Wt,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(ts,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Pw,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅค–่ง‚"})]}),e.jsxs(ts,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Nj,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅฎ‰ๅ…จ"})]}),e.jsxs(ts,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(mn,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅ…ถไป–"})]}),e.jsxs(ts,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Yt,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅ…ณไบŽ"})]})]}),e.jsxs(Je,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(bs,{value:"appearance",className:"mt-0",children:e.jsx(T2,{})}),e.jsx(bs,{value:"security",className:"mt-0",children:e.jsx(E2,{})}),e.jsx(bs,{value:"other",className:"mt-0",children:e.jsx(M2,{})}),e.jsx(bs,{value:"about",className:"mt-0",children:e.jsx(A2,{})})]})]})]})}function og(l){const n=document.documentElement,c={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%)"}}[l];if(c)n.style.setProperty("--primary",c.hsl),c.gradient?(n.style.setProperty("--primary-gradient",c.gradient),n.classList.add("has-gradient")):(n.style.removeProperty("--primary-gradient"),n.classList.remove("has-gradient"));else if(l.startsWith("#")){const u=x=>{x=x.replace("#","");const h=parseInt(x.substring(0,2),16)/255,f=parseInt(x.substring(2,4),16)/255,p=parseInt(x.substring(4,6),16)/255,g=Math.max(h,f,p),N=Math.min(h,f,p);let v=0,y=0;const w=(g+N)/2;if(g!==N){const b=g-N;switch(y=w>.5?b/(2-g-N):b/(g+N),g){case h:v=((f-p)/b+(flocalStorage.getItem("accent-color")||"blue");m.useEffect(()=>{const g=localStorage.getItem("accent-color")||"blue";og(g)},[]);const p=g=>{f(g),localStorage.setItem("accent-color",g),og(g)};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(bm,{value:"light",current:l,onChange:n,label:"ๆต…่‰ฒ",description:"ๅง‹็ปˆไฝฟ็”จๆต…่‰ฒไธป้ข˜"}),e.jsx(bm,{value:"dark",current:l,onChange:n,label:"ๆทฑ่‰ฒ",description:"ๅง‹็ปˆไฝฟ็”จๆทฑ่‰ฒไธป้ข˜"}),e.jsx(bm,{value:"system",current:l,onChange:n,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(Ia,{value:"blue",current:h,onChange:p,label:"่“่‰ฒ",colorClass:"bg-blue-500"}),e.jsx(Ia,{value:"purple",current:h,onChange:p,label:"็ดซ่‰ฒ",colorClass:"bg-purple-500"}),e.jsx(Ia,{value:"green",current:h,onChange:p,label:"็ปฟ่‰ฒ",colorClass:"bg-green-500"}),e.jsx(Ia,{value:"orange",current:h,onChange:p,label:"ๆฉ™่‰ฒ",colorClass:"bg-orange-500"}),e.jsx(Ia,{value:"pink",current:h,onChange:p,label:"็ฒ‰่‰ฒ",colorClass:"bg-pink-500"}),e.jsx(Ia,{value:"red",current:h,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(Ia,{value:"gradient-sunset",current:h,onChange:p,label:"ๆ—ฅ่ฝ",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),e.jsx(Ia,{value:"gradient-ocean",current:h,onChange:p,label:"ๆตทๆด‹",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsx(Ia,{value:"gradient-forest",current:h,onChange:p,label:"ๆฃฎๆž—",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),e.jsx(Ia,{value:"gradient-aurora",current:h,onChange:p,label:"ๆžๅ…‰",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),e.jsx(Ia,{value:"gradient-fire",current:h,onChange:p,label:"็ƒˆ็„ฐ",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),e.jsx(Ia,{value:"gradient-twilight",current:h,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:h.startsWith("#")?h:"#3b82f6",onChange:g=>p(g.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(ne,{type:"text",value:h,onChange:g=>p(g.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(T,{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:i,onCheckedChange:c})]})}),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(T,{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:u,onCheckedChange:x})]})})]})]})]})}function E2(){const l=ia(),[n,i]=m.useState(""),[c,u]=m.useState(""),[x,h]=m.useState(!1),[f,p]=m.useState(!1),[g,N]=m.useState(!1),[v,y]=m.useState(!1),[w,b]=m.useState(!1),[D,A]=m.useState(!1),[_,P]=m.useState(""),[E,C]=m.useState(!1),{toast:M}=st(),G=m.useMemo(()=>f2(c),[c]),O=async se=>{if(!n){M({title:"ๆ— ๆณ•ๅคๅˆถ",description:"Token ๅญ˜ๅ‚จๅœจๅฎ‰ๅ…จ Cookie ไธญ๏ผŒ่ฏท้‡ๆ–ฐ็”Ÿๆˆไปฅ่Žทๅ–ๆ–ฐ Token",variant:"destructive"});return}try{await navigator.clipboard.writeText(se),b(!0),M({title:"ๅคๅˆถๆˆๅŠŸ",description:"Token ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"}),setTimeout(()=>b(!1),2e3)}catch{M({title:"ๅคๅˆถๅคฑ่ดฅ",description:"่ฏทๆ‰‹ๅŠจๅคๅˆถ Token",variant:"destructive"})}},ee=async()=>{if(!c.trim()){M({title:"่พ“ๅ…ฅ้”™่ฏฏ",description:"่ฏท่พ“ๅ…ฅๆ–ฐ็š„ Token",variant:"destructive"});return}if(!G.isValid){const se=G.rules.filter(ge=>!ge.passed).map(ge=>ge.label).join(", ");M({title:"ๆ ผๅผ้”™่ฏฏ",description:`Token ไธ็ฌฆๅˆ่ฆๆฑ‚: ${se}`,variant:"destructive"});return}N(!0);try{const se=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({new_token:c.trim()})}),ge=await se.json();se.ok&&ge.success?(u(""),i(c.trim()),M({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:"Access Token ๅทฒๆ›ดๆ–ฐ๏ผŒๅณๅฐ†่ทณ่ฝฌๅˆฐ็™ปๅฝ•้กต"}),setTimeout(()=>{l({to:"/auth"})},1500)):M({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:ge.message||"ๆ— ๆณ•ๆ›ดๆ–ฐ Token",variant:"destructive"})}catch(se){console.error("ๆ›ดๆ–ฐ Token ้”™่ฏฏ:",se),M({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:"่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ",variant:"destructive"})}finally{N(!1)}},R=async()=>{y(!0);try{const se=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"}),ge=await se.json();se.ok&&ge.success?(i(ge.token),P(ge.token),A(!0),C(!1),M({title:"็”ŸๆˆๆˆๅŠŸ",description:"ๆ–ฐ็š„ Access Token ๅทฒ็”Ÿๆˆ๏ผŒ่ฏทๅŠๆ—ถไฟๅญ˜"})):M({title:"็”Ÿๆˆๅคฑ่ดฅ",description:ge.message||"ๆ— ๆณ•็”Ÿๆˆๆ–ฐ Token",variant:"destructive"})}catch(se){console.error("็”Ÿๆˆ Token ้”™่ฏฏ:",se),M({title:"็”Ÿๆˆๅคฑ่ดฅ",description:"่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ",variant:"destructive"})}finally{y(!1)}},me=async()=>{try{await navigator.clipboard.writeText(_),C(!0),M({title:"ๅคๅˆถๆˆๅŠŸ",description:"Token ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"})}catch{M({title:"ๅคๅˆถๅคฑ่ดฅ",description:"่ฏทๆ‰‹ๅŠจๅคๅˆถ Token",variant:"destructive"})}},ce=()=>{A(!1),setTimeout(()=>{P(""),C(!1)},300),setTimeout(()=>{l({to:"/auth"})},500)},ve=se=>{se||ce()};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(Ps,{open:D,onOpenChange:ve,children:e.jsxs(Us,{className:"sm:max-w-md",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Qt,{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(T,{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:_})]}),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(Qt,{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(et,{className:"gap-2 sm:gap-0",children:[e.jsx(S,{variant:"outline",onClick:me,className:"gap-2",children:E?e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"h-4 w-4 text-green-500"}),"ๅทฒๅคๅˆถ"]}):e.jsxs(e.Fragment,{children:[e.jsx(Eo,{className:"h-4 w-4"}),"ๅคๅˆถ Token"]})}),e.jsx(S,{onClick:ce,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(T,{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(ne,{id:"current-token",type:x?"text":"password",value:n||"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"Token ๅญ˜ๅ‚จๅœจๅฎ‰ๅ…จ Cookie ไธญ"}),e.jsx("button",{onClick:()=>{n?h(!x):M({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(qi,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(na,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(S,{variant:"outline",size:"icon",onClick:()=>O(n),title:"ๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ",className:"flex-shrink-0",disabled:!n,children:w?e.jsx(_t,{className:"h-4 w-4 text-green-500"}):e.jsx(Eo,{className:"h-4 w-4"})}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",disabled:v,className:"gap-2 flex-1 sm:flex-none",children:[e.jsx(ft,{className:H("h-4 w-4",v&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"้‡ๆ–ฐ็”Ÿๆˆ"}),e.jsx("span",{className:"sm:hidden",children:"็”Ÿๆˆ"})]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๆ–ฐ็”Ÿๆˆ Token"}),e.jsx(hs,{children:"่ฟ™ๅฐ†็”Ÿๆˆไธ€ไธชๆ–ฐ็š„ 64 ไฝๅฎ‰ๅ…จไปค็‰Œ๏ผŒๅนถไฝฟๅฝ“ๅ‰ Token ็ซ‹ๅณๅคฑๆ•ˆใ€‚ ๆ‚จ้œ€่ฆไฝฟ็”จๆ–ฐ Token ้‡ๆ–ฐ็™ปๅฝ•็ณป็ปŸใ€‚ๆญคๆ“ไฝœไธๅฏๆ’ค้”€๏ผŒ็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:R,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(T,{htmlFor:"new-token",className:"text-sm",children:"ๆ–ฐ็š„่ฎฟ้—ฎไปค็‰Œ"}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{id:"new-token",type:f?"text":"password",value:c,onChange:se=>u(se.target.value),className:"pr-10 font-mono text-sm",placeholder:"่พ“ๅ…ฅ่‡ชๅฎšไน‰ Token"}),e.jsx("button",{onClick:()=>p(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:f?"้š่—":"ๆ˜พ็คบ",children:f?e.jsx(qi,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(na,{className:"h-4 w-4 text-muted-foreground"})})]}),c&&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:G.rules.map(se=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[se.passed?e.jsx(la,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):e.jsx(Mo,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:H(se.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:se.label})]},se.id))}),G.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(_t,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:"Token ๆ ผๅผๆญฃ็กฎ๏ผŒๅฏไปฅไฝฟ็”จ"})]})})]})]}),e.jsx(S,{onClick:ee,disabled:g||!G.isValid||!c,className:"w-full sm:w-auto",children:g?"ๆ›ดๆ–ฐไธญ...":"ๆ›ดๆ–ฐ่‡ชๅฎšไน‰ 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 M2(){const l=ia(),{toast:n}=st(),[i,c]=m.useState(!1),[u,x]=m.useState(!1),[h,f]=m.useState(()=>Nt("logCacheSize")),[p,g]=m.useState(()=>Nt("wsReconnectInterval")),[N,v]=m.useState(()=>Nt("wsMaxReconnectAttempts")),[y,w]=m.useState(()=>Nt("dataSyncInterval")),[b,D]=m.useState(()=>cg()),[A,_]=m.useState(!1),[P,E]=m.useState(!1),C=m.useRef(null);if(u)throw new Error("่ฟ™ๆ˜ฏไธ€ไธชๆ‰‹ๅŠจ่งฆๅ‘็š„ๆต‹่ฏ•้”™่ฏฏ๏ผŒ็”จไบŽ้ชŒ่ฏ้”™่ฏฏ่พน็•Œ็ป„ไปถๆ˜ฏๅฆๆญฃๅธธๅทฅไฝœใ€‚");const M=()=>{D(cg())},G=z=>{const Q=z[0];f(Q),Lr("logCacheSize",Q)},O=z=>{const Q=z[0];g(Q),Lr("wsReconnectInterval",Q)},ee=z=>{const Q=z[0];v(Q),Lr("wsMaxReconnectAttempts",Q)},R=z=>{const Q=z[0];w(Q),Lr("dataSyncInterval",Q)},me=()=>{Ln.clearLogs(),n({title:"ๆ—ฅๅฟ—ๅทฒๆธ…้™ค",description:"ๆ—ฅๅฟ—็ผ“ๅญ˜ๅทฒๆธ…็ฉบ"})},ce=()=>{const z=y2();M(),n({title:"็ผ“ๅญ˜ๅทฒๆธ…้™ค",description:`ๅทฒๆธ…้™ค ${z.clearedKeys.length} ้กน็ผ“ๅญ˜ๆ•ฐๆฎ`})},ve=()=>{_(!0);try{const z=v2(),Q=JSON.stringify(z,null,2),$=new Blob([Q],{type:"application/json"}),L=URL.createObjectURL($),I=document.createElement("a");I.href=L,I.download=`maibot-webui-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(I),I.click(),document.body.removeChild(I),URL.revokeObjectURL(L),n({title:"ๅฏผๅ‡บๆˆๅŠŸ",description:"่ฎพ็ฝฎๅทฒๅฏผๅ‡บไธบ JSON ๆ–‡ไปถ"})}catch(z){console.error("ๅฏผๅ‡บ่ฎพ็ฝฎๅคฑ่ดฅ:",z),n({title:"ๅฏผๅ‡บๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅฏผๅ‡บ่ฎพ็ฝฎ",variant:"destructive"})}finally{_(!1)}},se=z=>{const Q=z.target.files?.[0];if(!Q)return;E(!0);const $=new FileReader;$.onload=L=>{try{const I=L.target?.result,_e=JSON.parse(I),je=N2(_e);je.success?(f(Nt("logCacheSize")),g(Nt("wsReconnectInterval")),v(Nt("wsMaxReconnectAttempts")),w(Nt("dataSyncInterval")),M(),n({title:"ๅฏผๅ…ฅๆˆๅŠŸ",description:`ๆˆๅŠŸๅฏผๅ…ฅ ${je.imported.length} ้กน่ฎพ็ฝฎ${je.skipped.length>0?`๏ผŒ่ทณ่ฟ‡ ${je.skipped.length} ้กน`:""}`}),(je.imported.includes("theme")||je.imported.includes("accentColor"))&&n({title:"ๆ็คบ",description:"้ƒจๅˆ†่ฎพ็ฝฎ้œ€่ฆๅˆทๆ–ฐ้กต้ขๆ‰่ƒฝๅฎŒๅ…จ็”Ÿๆ•ˆ"})):n({title:"ๅฏผๅ…ฅๅคฑ่ดฅ",description:"ๆฒกๆœ‰ๆœ‰ๆ•ˆ็š„่ฎพ็ฝฎ้กนๅฏๅฏผๅ…ฅ",variant:"destructive"})}catch(I){console.error("ๅฏผๅ…ฅ่ฎพ็ฝฎๅคฑ่ดฅ:",I),n({title:"ๅฏผๅ…ฅๅคฑ่ดฅ",description:"ๆ–‡ไปถๆ ผๅผๆ— ๆ•ˆ",variant:"destructive"})}finally{E(!1),C.current&&(C.current.value="")}},$.readAsText(Q)},ge=()=>{b2(),f(ll.logCacheSize),g(ll.wsReconnectInterval),v(ll.wsMaxReconnectAttempts),w(ll.dataSyncInterval),M(),n({title:"ๅทฒ้‡็ฝฎ",description:"ๆ‰€ๆœ‰่ฎพ็ฝฎๅทฒๆขๅคไธบ้ป˜่ฎคๅ€ผ๏ผŒๅˆทๆ–ฐ้กต้ขไปฅๅบ”็”จๆ›ดๆ”น"})},fe=async()=>{c(!0);try{const z=await we("/api/webui/setup/reset",{method:"POST"}),Q=await z.json();z.ok&&Q.success?(n({title:"้‡็ฝฎๆˆๅŠŸ",description:"ๅณๅฐ†่ฟ›ๅ…ฅๅˆๆฌก้…็ฝฎๅ‘ๅฏผ"}),setTimeout(()=>{l({to:"/setup"})},1e3)):n({title:"้‡็ฝฎๅคฑ่ดฅ",description:Q.message||"ๆ— ๆณ•้‡็ฝฎ้…็ฝฎ็Šถๆ€",variant:"destructive"})}catch(z){console.error("้‡็ฝฎ้…็ฝฎ็Šถๆ€้”™่ฏฏ:",z),n({title:"้‡็ฝฎๅคฑ่ดฅ",description:"่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ",variant:"destructive"})}finally{c(!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(Br,{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(Hw,{className:"h-4 w-4"}),"ๆœฌๅœฐๅญ˜ๅ‚จไฝฟ็”จ"]}),e.jsx(S,{variant:"ghost",size:"sm",onClick:M,className:"h-7 px-2",children:e.jsx(ft,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"text-2xl font-bold text-primary",children:w2(b.used)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[b.items," ไธชๅญ˜ๅ‚จ้กน"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๆ—ฅๅฟ—็ผ“ๅญ˜ๅคงๅฐ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[h," ๆก"]})]}),e.jsx(_a,{value:[h],onValueChange:G,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(T,{className:"text-sm font-medium",children:"้ฆ–้กตๆ•ฐๆฎๅˆทๆ–ฐ้—ด้š”"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[y," ็ง’"]})]}),e.jsx(_a,{value:[y],onValueChange:R,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(T,{className:"text-sm font-medium",children:"WebSocket ้‡่ฟž้—ด้š”"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[p/1e3," ็ง’"]})]}),e.jsx(_a,{value:[p],onValueChange:O,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(T,{className:"text-sm font-medium",children:"WebSocket ๆœ€ๅคง้‡่ฟžๆฌกๆ•ฐ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[N," ๆฌก"]})]}),e.jsx(_a,{value:[N],onValueChange:ee,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(S,{variant:"outline",size:"sm",onClick:me,className:"gap-2",children:[e.jsx(ns,{className:"h-4 w-4"}),"ๆธ…้™คๆ—ฅๅฟ—็ผ“ๅญ˜"]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(ns,{className:"h-4 w-4"}),"ๆธ…้™คๆœฌๅœฐ็ผ“ๅญ˜"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆธ…้™คๆœฌๅœฐ็ผ“ๅญ˜"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๆธ…้™คๆ‰€ๆœ‰ๆœฌๅœฐ็ผ“ๅญ˜็š„่ฎพ็ฝฎๅ’Œๆ•ฐๆฎ๏ผˆไธๅŒ…ๆ‹ฌ็™ปๅฝ•ๅ‡ญ่ฏ๏ผ‰ใ€‚ ๆ‚จๅฏ่ƒฝ้œ€่ฆ้‡ๆ–ฐ้…็ฝฎ้ƒจๅˆ†ๅๅฅฝ่ฎพ็ฝฎใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ce,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(Zt,{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(S,{variant:"outline",onClick:ve,disabled:A,className:"gap-2",children:[e.jsx(Zt,{className:"h-4 w-4"}),A?"ๅฏผๅ‡บไธญ...":"ๅฏผๅ‡บ่ฎพ็ฝฎ"]}),e.jsx("input",{ref:C,type:"file",accept:".json",onChange:se,className:"hidden"}),e.jsxs(S,{variant:"outline",onClick:()=>C.current?.click(),disabled:P,className:"gap-2",children:[e.jsx(Ki,{className:"h-4 w-4"}),P?"ๅฏผๅ…ฅไธญ...":"ๅฏผๅ…ฅ่ฎพ็ฝฎ"]})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2 text-destructive hover:text-destructive",children:[e.jsx(Vi,{className:"h-4 w-4"}),"้‡็ฝฎๆ‰€ๆœ‰่ฎพ็ฝฎไธบ้ป˜่ฎคๅ€ผ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡็ฝฎๆ‰€ๆœ‰่ฎพ็ฝฎ"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๆŠŠๆ‰€ๆœ‰็•Œ้ข่ฎพ็ฝฎๆขๅคไธบ้ป˜่ฎคๅ€ผ๏ผŒๅŒ…ๆ‹ฌไธป้ข˜ใ€้ขœ่‰ฒใ€ๅŠจ็”ป็ญ‰ๅๅฅฝ่ฎพ็ฝฎใ€‚ ๆญคๆ“ไฝœไธไผšๅฝฑๅ“ๆ‚จ็š„็™ปๅฝ•็Šถๆ€ใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ge,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(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",disabled:i,className:"gap-2",children:[e.jsx(Vi,{className:H("h-4 w-4",i&&"animate-spin")}),"้‡ๆ–ฐ่ฟ›่กŒๅˆๆฌก้…็ฝฎ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๆ–ฐ้…็ฝฎ"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๅธฆๆ‚จ้‡ๆ–ฐ่ฟ›ๅ…ฅๅˆๆฌก้…็ฝฎๅ‘ๅฏผใ€‚ๆ‚จๅฏไปฅ้‡ๆ–ฐ่ฎพ็ฝฎ็ณป็ปŸ็š„ๅŸบ็ก€้…็ฝฎ้กนใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:fe,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(Qt,{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(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"destructive",className:"gap-2",children:[e.jsx(Qt,{className:"h-4 w-4"}),"่งฆๅ‘ๆต‹่ฏ•้”™่ฏฏ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค่งฆๅ‘้”™่ฏฏ"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๆ‰‹ๅŠจ่งฆๅ‘ไธ€ไธช React ้”™่ฏฏ๏ผŒ็”จไบŽๆต‹่ฏ•้”™่ฏฏ่พน็•Œ็ป„ไปถ็š„ๆ˜พ็คบๆ•ˆๆžœใ€‚ ้กต้ขๅฐ†ๆ˜พ็คบ้”™่ฏฏ็•Œ้ข๏ผŒๆ‚จๅฏไปฅ้€š่ฟ‡ๅˆทๆ–ฐ้กต้ขๆˆ–็‚นๅ‡ป่ฟ”ๅ›ž้ฆ–้กตๆฅๆขๅคใ€‚"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>x(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎค่งฆๅ‘"})]})]})]})]})]})]})}function A2(){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:H("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:["ๅ…ณไบŽ ",qm]}),e.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("p",{children:["็‰ˆๆœฌ: ",qo]}),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(Je,{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(ht,{name:"React",description:"็”จๆˆท็•Œ้ขๆž„ๅปบๅบ“",license:"MIT"}),e.jsx(ht,{name:"shadcn/ui",description:"ไผ˜้›…็š„ React ็ป„ไปถๅบ“",license:"MIT"}),e.jsx(ht,{name:"Radix UI",description:"ๆ— ๆ ทๅผ็š„ๅฏ่ฎฟ้—ฎ็ป„ไปถๅบ“",license:"MIT"}),e.jsx(ht,{name:"Tailwind CSS",description:"ๅฎž็”จไผ˜ๅ…ˆ็š„ CSS ๆก†ๆžถ",license:"MIT"}),e.jsx(ht,{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(ht,{name:"TanStack Router",description:"็ฑปๅž‹ๅฎ‰ๅ…จ็š„่ทฏ็”ฑๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"React Hook Form",description:"้ซ˜ๆ€ง่ƒฝ่กจๅ•ๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"clsx",description:"ๆกไปถ className ๆž„ๅปบๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{name:"tailwind-merge",description:"Tailwind ็ฑปๅๅˆๅนถๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{name:"class-variance-authority",description:"็ป„ไปถๅ˜ไฝ“็ฎก็†",license:"Apache-2.0"}),e.jsx(ht,{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(ht,{name:"Framer Motion",description:"React ๅŠจ็”ปๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"FastAPI",description:"็ŽฐไปฃๅŒ– Python Web ๆก†ๆžถ",license:"MIT"}),e.jsx(ht,{name:"Uvicorn",description:"ASGI ๆœๅŠกๅ™จ",license:"BSD-3-Clause"}),e.jsx(ht,{name:"Pydantic",description:"ๆ•ฐๆฎ้ชŒ่ฏๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"TypeScript",description:"JavaScript ็š„่ถ…้›†",license:"Apache-2.0"}),e.jsx(ht,{name:"Vite",description:"ไธ‹ไธ€ไปฃๅ‰็ซฏๆž„ๅปบๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{name:"ESLint",description:"JavaScript ไปฃ็ ๆฃ€ๆŸฅๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{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 ht({name:l,description:n,license:i}){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:l}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:n})]}),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:i})]})}function bm({value:l,current:n,onChange:i,label:c,description:u}){const x=n===l;return e.jsxs("button",{onClick:()=>i(l),className:H("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:c}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:u})]}),e.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[l==="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"})]}),l==="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"})]}),l==="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 Ia({value:l,current:n,onChange:i,label:c,colorClass:u}){const x=n===l;return e.jsxs("button",{onClick:()=>i(l),className:H("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:H("h-8 w-8 sm:h-10 sm:w-10 rounded-full",u)}),e.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:c})]})]})}const z2=Date.now()%1e6;class D2{grad3;p;perm;constructor(n=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 i=0;i<256;i++)this.p[i]=Math.floor(Math.random()*256);this.perm=[];for(let i=0;i<512;i++)this.perm[i]=this.p[i&255]}dot(n,i,c){return n[0]*i+n[1]*c}mix(n,i,c){return(1-c)*n+c*i}fade(n){return n*n*n*(n*(n*6-15)+10)}perlin2(n,i){const c=Math.floor(n)&255,u=Math.floor(i)&255;n-=Math.floor(n),i-=Math.floor(i);const x=this.fade(n),h=this.fade(i),f=this.perm[c]+u,p=this.perm[f],g=this.perm[f+1],N=this.perm[c+1]+u,v=this.perm[N],y=this.perm[N+1];return this.mix(this.mix(this.dot(this.grad3[p%12],n,i),this.dot(this.grad3[v%12],n-1,i),x),this.mix(this.dot(this.grad3[g%12],n,i-1),this.dot(this.grad3[y%12],n-1,i-1),x),h)}}function dg(){const l=m.useRef(null),n=m.useRef(null),i=m.useRef(void 0),[c]=m.useState(()=>new D2(z2)),u=m.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:c,bounding:null});return m.useEffect(()=>{const x=n.current,h=l.current;if(!x||!h)return;const f=u.current;f.noise=c;const p=()=>{const A=x.getBoundingClientRect();f.bounding=A,h.style.width=`${A.width}px`,h.style.height=`${A.height}px`},g=()=>{if(!f.bounding)return;const{width:A,height:_}=f.bounding;f.lines=[],f.paths.forEach(me=>me.remove()),f.paths=[];const P=10,E=32,C=A+200,M=_+30,G=Math.ceil(C/P),O=Math.ceil(M/E),ee=(A-P*G)/2,R=(_-E*O)/2;for(let me=0;me<=G;me++){const ce=[];for(let se=0;se<=O;se++){const ge={x:ee+P*me,y:R+E*se,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};ce.push(ge)}const ve=document.createElementNS("http://www.w3.org/2000/svg","path");h.appendChild(ve),f.paths.push(ve),f.lines.push(ce)}},N=A=>{const{lines:_,mouse:P,noise:E}=f;_.forEach(C=>{C.forEach(M=>{const G=E.perlin2((M.x+A*.0125)*.002,(M.y+A*.005)*.0015)*12;M.wave.x=Math.cos(G)*32,M.wave.y=Math.sin(G)*16;const O=M.x-P.sx,ee=M.y-P.sy,R=Math.hypot(O,ee),me=Math.max(175,P.vs);if(R{const P={x:A.x+A.wave.x+(_?A.cursor.x:0),y:A.y+A.wave.y+(_?A.cursor.y:0)};return P.x=Math.round(P.x*10)/10,P.y=Math.round(P.y*10)/10,P},y=()=>{const{lines:A,paths:_}=f;A.forEach((P,E)=>{let C=v(P[0],!1),M=`M ${C.x} ${C.y}`;P.forEach((G,O)=>{const ee=O===P.length-1;C=v(G,!ee),M+=`L ${C.x} ${C.y}`}),_[E].setAttribute("d",M)})},w=A=>{const{mouse:_}=f;_.sx+=(_.x-_.sx)*.1,_.sy+=(_.y-_.sy)*.1;const P=_.x-_.lx,E=_.y-_.ly,C=Math.hypot(P,E);_.v=C,_.vs+=(C-_.vs)*.1,_.vs=Math.min(100,_.vs),_.lx=_.x,_.ly=_.y,_.a=Math.atan2(E,P),x&&(x.style.setProperty("--x",`${_.sx}px`),x.style.setProperty("--y",`${_.sy}px`)),N(A),y(),i.current=requestAnimationFrame(w)},b=A=>{if(!f.bounding)return;const{mouse:_}=f;_.x=A.pageX-f.bounding.left,_.y=A.pageY-f.bounding.top+window.scrollY,_.set||(_.sx=_.x,_.sy=_.y,_.lx=_.x,_.ly=_.y,_.set=!0)},D=()=>{p(),g()};return p(),g(),window.addEventListener("resize",D),window.addEventListener("mousemove",b),i.current=requestAnimationFrame(w),()=>{window.removeEventListener("resize",D),window.removeEventListener("mousemove",b),i.current&&cancelAnimationFrame(i.current)}},[c]),e.jsxs("div",{ref:n,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:l,style:{display:"block",width:"100%",height:"100%"},children:e.jsx("style",{children:` +`)}}):null},Li=cw,Rr=m.forwardRef(({active:l,payload:n,className:i,indicator:c="dot",hideLabel:u=!1,hideIndicator:x=!1,label:h,labelFormatter:f,labelClassName:p,formatter:g,color:N,nameKey:v,labelKey:y},w)=>{const{config:b}=Yj(),D=m.useMemo(()=>{if(u||!n?.length)return null;const[_]=n,H=`${y||_?.dataKey||_?.name||"value"}`,E=Om(b,_,H),C=!y&&typeof h=="string"?b[h]?.label||h:E?.label;return f?e.jsx("div",{className:P("font-medium",p),children:f(C,n)}):C?e.jsx("div",{className:P("font-medium",p),children:C}):null},[h,f,n,u,p,b,y]);if(!l||!n?.length)return null;const A=n.length===1&&c!=="dot";return e.jsxs("div",{ref:w,className:P("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",i),children:[A?null:D,e.jsx("div",{className:"grid gap-1.5",children:n.filter(_=>_.type!=="none").map((_,H)=>{const E=`${v||_.name||_.dataKey||"value"}`,C=Om(b,_,E),M=N||_.payload.fill||_.color;return e.jsx("div",{className:P("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",c==="dot"&&"items-center"),children:g&&_?.value!==void 0&&_.name?g(_.value,_.name,_,H,_.payload):e.jsxs(e.Fragment,{children:[C?.icon?e.jsx(C.icon,{}):!x&&e.jsx("div",{className:P("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":c==="dot","w-1":c==="line","w-0 border-[1.5px] border-dashed bg-transparent":c==="dashed","my-0.5":A&&c==="dashed"}),style:{"--color-bg":M,"--color-border":M}}),e.jsxs("div",{className:P("flex flex-1 justify-between leading-none",A?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[A?D:null,e.jsx("span",{className:"text-muted-foreground",children:C?.label||_.name})]}),_.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:_.value.toLocaleString()})]})]})},_.dataKey)})})]})});Rr.displayName="ChartTooltip";const J1=ow,Jj=m.forwardRef(({className:l,hideIcon:n=!1,payload:i,verticalAlign:c="bottom",nameKey:u},x)=>{const{config:h}=Yj();return i?.length?e.jsx("div",{ref:x,className:P("flex items-center justify-center gap-4",c==="top"?"pb-3":"pt-3",l),children:i.filter(f=>f.type!=="none").map(f=>{const p=`${u||f.dataKey||"value"}`,g=Om(h,f,p);return e.jsxs("div",{className:P("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[g?.icon&&!n?e.jsx(g.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:f.color}}),g?.label]},f.value)})}):null});Jj.displayName="ChartLegend";function Om(l,n,i){if(typeof n!="object"||n===null)return;const c="payload"in n&&typeof n.payload=="object"&&n.payload!==null?n.payload:void 0;let u=i;return i in n&&typeof n[i]=="string"?u=n[i]:c&&i in c&&typeof c[i]=="string"&&(u=c[i]),u in l?l[u]:l[i]}const Pr=Hr("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"}}),S=m.forwardRef(({className:l,variant:n,size:i,asChild:c=!1,...u},x)=>{const h=c?fw:"button";return e.jsx(h,{className:P(Pr({variant:n,size:i,className:l})),ref:x,...u})});S.displayName="Button";const X1=Hr("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 ke({className:l,variant:n,...i}){return e.jsx("div",{className:P(X1({variant:n}),l),...i})}async function Z1(){const l=await we("/api/webui/system/restart",{method:"POST",headers:Fs()});if(!l.ok){const n=await l.json();throw new Error(n.detail||"้‡ๅฏๅคฑ่ดฅ")}return await l.json()}async function W1(){const l=await we("/api/webui/system/status",{method:"GET",headers:Fs()});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–็Šถๆ€ๅคฑ่ดฅ")}return await l.json()}const zr={INITIAL_DELAY:3e3,CHECK_INTERVAL:2e3,CHECK_TIMEOUT:3e3,MAX_ATTEMPTS:60,PROGRESS_INTERVAL:200,SUCCESS_REDIRECT_DELAY:1500},Xj=m.createContext(null);function Vn({children:l,onRestartComplete:n,onRestartFailed:i,healthCheckUrl:c="/api/webui/system/status",maxAttempts:u=zr.MAX_ATTEMPTS}){const[x,h]=m.useState({status:"idle",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:u}),[f,p]=m.useState({}),g=m.useCallback(()=>{f.progress&&clearInterval(f.progress),f.elapsed&&clearInterval(f.elapsed),f.check&&clearTimeout(f.check),p({})},[f]),N=m.useCallback(()=>{g(),h({status:"idle",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:u})},[g,u]),v=m.useCallback(async()=>{try{const A=new AbortController,_=setTimeout(()=>A.abort(),zr.CHECK_TIMEOUT),H=await fetch(c,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include",signal:A.signal});return clearTimeout(_),H.ok}catch{return!1}},[c]),y=m.useCallback(()=>{let A=0;const _=async()=>{if(A++,h(E=>({...E,status:"checking",checkAttempts:A})),await v())g(),h(E=>({...E,status:"success",progress:100})),setTimeout(()=>{n?.(),window.location.href="/auth"},zr.SUCCESS_REDIRECT_DELAY);else if(A>=u){g();const E=`ๅฅๅบทๆฃ€ๆŸฅ่ถ…ๆ—ถ (${A}/${u})`;h(C=>({...C,status:"failed",error:E})),i?.(E)}else{const E=setTimeout(_,zr.CHECK_INTERVAL);p(C=>({...C,check:E}))}};_()},[v,g,u,n,i]),w=m.useCallback(()=>{h(A=>({...A,status:"checking",checkAttempts:0,error:void 0})),y()},[y]),b=m.useCallback(async A=>{const{delay:_=0,skipApiCall:H=!1}=A??{};if(x.status!=="idle"&&x.status!=="failed")return;if(g(),h({status:"requesting",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:u}),_>0&&await new Promise(M=>setTimeout(M,_)),H)h(M=>({...M,status:"restarting"}));else try{h(M=>({...M,status:"restarting"})),await Promise.race([Z1(),new Promise(M=>setTimeout(M,5e3))])}catch{}const E=setInterval(()=>{h(M=>({...M,progress:M.progress>=90?M.progress:M.progress+1}))},zr.PROGRESS_INTERVAL),C=setInterval(()=>{h(M=>({...M,elapsedTime:M.elapsedTime+1}))},1e3);p({progress:E,elapsed:C}),setTimeout(()=>{y()},zr.INITIAL_DELAY)},[x.status,g,u,y]),D={state:x,isRestarting:x.status!=="idle",triggerRestart:b,resetState:N,retryHealthCheck:w};return e.jsx(Xj.Provider,{value:D,children:l})}function fn(){const l=m.useContext(Xj);if(!l)throw new Error("useRestart must be used within a RestartProvider");return l}function e2(){try{return fn()}catch{return null}}const s2=(l,n,i,c,u)=>({idle:{icon:null,title:"",description:"",tip:""},requesting:{icon:e.jsx(Ls,{className:"h-16 w-16 text-primary animate-spin"}),title:c??"ๅ‡†ๅค‡้‡ๅฏ",description:u??"ๆญฃๅœจๅ‘้€้‡ๅฏ่ฏทๆฑ‚...",tip:"๐Ÿ”„ ๆญฃๅœจๅ‡†ๅค‡้‡ๅฏ้บฆ้บฆ..."},restarting:{icon:e.jsx(Ls,{className:"h-16 w-16 text-primary animate-spin"}),title:c??"ๆญฃๅœจ้‡ๅฏ้บฆ้บฆ",description:u??"่ฏท็จๅ€™๏ผŒ้บฆ้บฆๆญฃๅœจ้‡ๅฏไธญ...",tip:"๐Ÿ”„ ้…็ฝฎๅทฒไฟๅญ˜๏ผŒๆญฃๅœจ้‡ๅฏไธป็จ‹ๅบ..."},checking:{icon:e.jsx(Ls,{className:"h-16 w-16 text-primary animate-spin"}),title:"ๆฃ€ๆŸฅๆœๅŠก็Šถๆ€",description:`็ญ‰ๅพ…ๆœๅŠกๆขๅค... (${n}/${i})`,tip:"โณ ๆญฃๅœจ็ญ‰ๅพ…ๆœๅŠกๆขๅค๏ผŒ่ฏทๅ‹ฟๅ…ณ้—ญ้กต้ข..."},success:{icon:e.jsx(Wt,{className:"h-16 w-16 text-green-500"}),title:"้‡ๅฏๆˆๅŠŸ",description:"ๆญฃๅœจ่ทณ่ฝฌๅˆฐ็™ปๅฝ•้กต้ข...",tip:"โœ… ้…็ฝฎๅทฒ็”Ÿๆ•ˆ๏ผŒๆœๅŠก่ฟ่กŒๆญฃๅธธ"},failed:{icon:e.jsx(St,{className:"h-16 w-16 text-destructive"}),title:"้‡ๅฏ่ถ…ๆ—ถ",description:"ๆœๅŠกๆœช่ƒฝๅœจ้ข„ๆœŸๆ—ถ้—ดๅ†…ๆขๅค",tip:"โš ๏ธ ๅฆ‚ๆžœ้•ฟๆ—ถ้—ดๆ— ๅ“ๅบ”๏ผŒ่ฏทๅฐ่ฏ•ๆ‰‹ๅŠจ้‡ๅฏ"}})[l];function qn({visible:l,onComplete:n,onFailed:i,title:c,description:u,showAnimation:x=!0,className:h}){const f=e2();return(f?f.isRestarting:l)?f?e.jsx(Zj,{state:f.state,onRetry:f.retryHealthCheck,onComplete:n,onFailed:i,title:c,description:u,showAnimation:x,className:h}):e.jsx(t2,{onComplete:n,onFailed:i,title:c,description:u,showAnimation:x,className:h}):null}function Zj({state:l,onRetry:n,onComplete:i,onFailed:c,title:u,description:x,showAnimation:h,className:f}){const{status:p,progress:g,elapsedTime:N,checkAttempts:v,maxAttempts:y}=l;m.useEffect(()=>{p==="success"&&i?i():p==="failed"&&c&&c()},[p,i,c]);const w=s2(p,v,y,u,x),b=D=>{const A=Math.floor(D/60),_=D%60;return`${A}:${_.toString().padStart(2,"0")}`};return e.jsxs("div",{className:P("fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",f),children:[h&&e.jsx(a2,{}),e.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8 relative z-10",children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsxs("div",{className:"relative",children:[w.icon,(p==="restarting"||p==="checking")&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/20 animate-ping"})]}),e.jsx("h2",{className:"text-2xl font-bold",children:w.title}),e.jsx("p",{className:"text-muted-foreground text-center",children:w.description})]}),p!=="failed"&&p!=="idle"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Fn,{value:g,className:"h-2"}),e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[g,"%"]}),e.jsxs("span",{children:["ๅทฒ็”จๆ—ถ: ",b(N)]})]})]}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:w.tip})}),p==="failed"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(S,{onClick:()=>window.location.reload(),variant:"default",className:"flex-1",children:[e.jsx(ft,{className:"mr-2 h-4 w-4"}),"ๅˆทๆ–ฐ้กต้ข"]}),e.jsxs(S,{onClick:n,variant:"secondary",className:"flex-1",children:[e.jsx(Vi,{className:"mr-2 h-4 w-4"}),"้‡่ฏ•ๆฃ€ๆต‹"]})]})]})]})}function t2({onComplete:l,onFailed:n,title:i,description:c,showAnimation:u,className:x}){const[h,f]=m.useState({status:"restarting",progress:0,elapsedTime:0,checkAttempts:0,maxAttempts:60}),p=m.useCallback(()=>{let g=0;const N=60,v=async()=>{g++,f(y=>({...y,status:"checking",checkAttempts:g}));try{if((await fetch("/api/webui/system/status",{method:"GET",signal:AbortSignal.timeout(3e3)})).ok){f(w=>({...w,status:"success",progress:100})),setTimeout(()=>{l?.(),window.location.href="/auth"},1500);return}}catch{}g>=N?(f(y=>({...y,status:"failed"})),n?.()):setTimeout(v,2e3)};v()},[l,n]);return m.useEffect(()=>{const g=setInterval(()=>{f(y=>({...y,progress:y.progress>=90?y.progress:y.progress+1}))},200),N=setInterval(()=>{f(y=>({...y,elapsedTime:y.elapsedTime+1}))},1e3),v=setTimeout(()=>{p()},3e3);return()=>{clearInterval(g),clearInterval(N),clearTimeout(v)}},[p]),e.jsx(Zj,{state:h,onRetry:p,onComplete:l,onFailed:n,title:i,description:c,showAnimation:u,className:x})}function a2(){return e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsxs("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px]",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border border-primary/10 animate-[ping_3s_ease-in-out_infinite]"}),e.jsx("div",{className:"absolute inset-8 rounded-full border border-primary/10 animate-[ping_3s_ease-in-out_infinite_0.5s]"}),e.jsx("div",{className:"absolute inset-16 rounded-full border border-primary/10 animate-[ping_3s_ease-in-out_infinite_1s]"})]}),e.jsx("div",{className:"absolute top-1/4 left-1/4 w-2 h-2 bg-primary/20 rounded-full animate-bounce"}),e.jsx("div",{className:"absolute top-3/4 right-1/4 w-3 h-3 bg-primary/15 rounded-full animate-bounce delay-150"}),e.jsx("div",{className:"absolute top-1/2 right-1/3 w-2 h-2 bg-primary/20 rounded-full animate-bounce delay-300"})]})}function l2(){return e.jsx(Vn,{children:e.jsx(r2,{})})}const n2=l=>{const n=[];for(let i=0;i{try{w(!0);const L=await _0.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");v({hitokoto:L.data.hitokoto,from:L.data.from||L.data.from_who||"ๆœช็Ÿฅ"})}catch(L){console.error("่Žทๅ–ไธ€่จ€ๅคฑ่ดฅ:",L),v({hitokoto:"ไบบ็”Ÿๅฐฑๅƒไธ€็›’ๅทงๅ…‹ๅŠ›๏ผŒไฝ ๆฐธ่ฟœไธ็Ÿฅ้“ไธ‹ไธ€้ข—ๆ˜ฏไป€ไนˆๅ‘ณ้“ใ€‚",from:"้˜ฟ็”˜ๆญฃไผ "})}finally{w(!1)}},[]),E=m.useCallback(async()=>{try{const L=await we("/api/webui/system/status");if(L.ok){const $=await L.json();D($)}else D(null)}catch(L){console.error("่Žทๅ–ๆœบๅ™จไบบ็Šถๆ€ๅคฑ่ดฅ:",L),D(null)}},[]),C=async()=>{await A()},M=m.useCallback(async()=>{try{const L=await we(`/api/webui/statistics/dashboard?hours=${h}`);if(L.ok){const $=await L.json();n($)}c(!1),x(100)}catch(L){console.error("Failed to fetch dashboard data:",L),c(!1),x(100)}},[h]);if(m.useEffect(()=>{if(!i)return;x(0);const L=setTimeout(()=>x(15),200),$=setTimeout(()=>x(30),800),_e=setTimeout(()=>x(45),2e3),je=setTimeout(()=>x(60),4e3),Se=setTimeout(()=>x(75),6500),K=setTimeout(()=>x(85),9e3),U=setTimeout(()=>x(92),11e3);return()=>{clearTimeout(L),clearTimeout($),clearTimeout(_e),clearTimeout(je),clearTimeout(Se),clearTimeout(K),clearTimeout(U)}},[i]),m.useEffect(()=>{M(),H(),E()},[M,H,E]),m.useEffect(()=>{if(!p)return;const L=setInterval(()=>{M(),E()},3e4);return()=>clearInterval(L)},[p,M,E]),i||!l)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(ft,{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(Fn,{value:u,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[u,"%"]})]})]})});const{summary:G,model_stats:O=[],hourly_data:ee=[],daily_data:R=[],recent_activity:me=[]}=l,ce=G??{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},ve=L=>{const $=Math.floor(L/3600),_e=Math.floor(L%3600/60);return`${$}ๅฐๆ—ถ${_e}ๅˆ†้’Ÿ`},se=L=>{const $=L.toLocaleString("zh-CN");return L>=1e9?{display:`${(L/1e9).toFixed(2)}B`,exact:$,needsExact:!0}:L>=1e6?{display:`${(L/1e6).toFixed(2)}M`,exact:$,needsExact:!0}:L>=1e4?{display:`${(L/1e3).toFixed(1)}K`,exact:$,needsExact:!0}:L>=1e3?{display:`${(L/1e3).toFixed(2)}K`,exact:$,needsExact:!0}:{display:$,exact:$,needsExact:!1}},ge=L=>{const $=`ยฅ${L.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`;return L>=1e6?{display:`ยฅ${(L/1e6).toFixed(2)}M`,exact:$,needsExact:!0}:L>=1e4?{display:`ยฅ${(L/1e3).toFixed(1)}K`,exact:$,needsExact:!0}:L>=1e3?{display:`ยฅ${(L/1e3).toFixed(2)}K`,exact:$,needsExact:!0}:{display:$,exact:$,needsExact:!1}},fe=L=>new Date(L).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),z=n2(O.length),Q=O.map((L,$)=>({name:L.model_name,value:L.request_count,fill:z[$]})),I={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(Je,{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(ra,{value:h.toString(),onValueChange:L=>f(Number(L)),children:e.jsxs(ea,{className:"grid grid-cols-3 w-full sm:w-auto",children:[e.jsx(ts,{value:"24",children:"24ๅฐๆ—ถ"}),e.jsx(ts,{value:"168",children:"7ๅคฉ"}),e.jsx(ts,{value:"720",children:"30ๅคฉ"})]})}),e.jsxs(S,{variant:p?"default":"outline",size:"sm",onClick:()=>g(!p),className:"gap-2",children:[e.jsx(ft,{className:`h-4 w-4 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"่‡ชๅŠจๅˆทๆ–ฐ"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:M,children:e.jsx(ft,{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:[y?e.jsx(_s,{className:"h-5 flex-1"}):N?e.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',N.hitokoto,'" โ€”โ€” ',N.from]}):null,e.jsx(S,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:H,disabled:y,children:e.jsx(ft,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-3",children:[e.jsxs(Ce,{className:"lg:col-span-1",children:[e.jsx(Pe,{className:"pb-3",children:e.jsxs(He,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(sc,{className:"h-4 w-4"}),"้บฆ้บฆ็Šถๆ€"]})}),e.jsx(Re,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:b?.running?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-500 animate-pulse"}),e.jsxs(ke,{variant:"outline",className:"text-green-600 border-green-300 bg-green-50",children:[e.jsx(Wt,{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(ke,{variant:"outline",className:"text-red-600 border-red-300 bg-red-50",children:[e.jsx(St,{className:"h-3 w-3 mr-1"}),"ๅทฒๅœๆญข"]})]})}),b&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("span",{children:["v",b.version]}),e.jsx("span",{className:"mx-2",children:"|"}),e.jsxs("span",{children:["่ฟ่กŒ ",ve(b.uptime)]})]})]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"pb-3",children:e.jsxs(He,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(El,{className:"h-4 w-4"}),"ๅฟซ้€Ÿๆ“ไฝœ"]})}),e.jsx(Re,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:C,disabled:_,className:"gap-2",children:[e.jsx(Vi,{className:`h-4 w-4 ${_?"animate-spin":""}`}),_?"้‡ๅฏไธญ...":"้‡ๅฏ้บฆ้บฆ"]}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/logs",children:[e.jsx(Sa,{className:"h-4 w-4"}),"ๆŸฅ็œ‹ๆ—ฅๅฟ—"]})}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/plugins",children:[e.jsx(Bw,{className:"h-4 w-4"}),"ๆ’ไปถ็ฎก็†"]})}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/settings",children:[e.jsx(mn,{className:"h-4 w-4"}),"็ณป็ปŸ่ฎพ็ฝฎ"]})})]})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"pb-3",children:[e.jsxs(He,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx($w,{className:"h-4 w-4"}),"ๅ้ฆˆ้—ฎๅท"]}),e.jsx(As,{className:"text-xs",children:"ๅธฎๅŠฉๆˆ‘ไปฌๆ”น่ฟ›ไบงๅ“ไฝ“้ชŒ"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/survey/webui-feedback",children:[e.jsx(Sa,{className:"h-4 w-4"}),"WebUI ๅ้ฆˆ"]})}),e.jsx(S,{variant:"outline",size:"sm",asChild:!0,className:"gap-2",children:e.jsxs(Dr,{to:"/survey/maibot-feedback",children:[e.jsx(Pa,{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(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆ€ป่ฏทๆฑ‚ๆ•ฐ"}),e.jsx(Im,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[se(ce.total_requests).display,se(ce.total_requests).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",se(ce.total_requests).exact,")"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["ๆœ€่ฟ‘",h<48?h+"ๅฐๆ—ถ":Math.floor(h/24)+"ๅคฉ"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆ€ป่Šฑ่ดน"}),e.jsx(Iw,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[ge(ce.total_cost).display,ge(ce.total_cost).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",ge(ce.total_cost).exact,")"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ce.cost_per_hour>0?`ยฅ${ce.cost_per_hour.toFixed(2)}/ๅฐๆ—ถ`:"ๆš‚ๆ— ๆ•ฐๆฎ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"Tokenๆถˆ่€—"}),e.jsx(Br,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[se(ce.total_tokens).display,se(ce.total_tokens).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",se(ce.total_tokens).exact,")"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ce.tokens_per_hour>0?`${se(ce.tokens_per_hour).display}/ๅฐๆ—ถ`:"ๆš‚ๆ— ๆ•ฐๆฎ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅนณๅ‡ๅ“ๅบ”"}),e.jsx(El,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[ce.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(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅœจ็บฟๆ—ถ้•ฟ"}),e.jsx(Ya,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"text-xl font-bold",children:[ve(ce.online_time),e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",ce.online_time.toLocaleString(),"็ง’)"]})]})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆถˆๆฏๅค„็†"}),e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsxs("div",{className:"text-xl font-bold",children:[se(ce.total_messages).display,se(ce.total_messages).needsExact&&e.jsxs("span",{className:"text-xs font-normal text-muted-foreground ml-1",children:["(",se(ce.total_messages).exact,")"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["ๅ›žๅค ",se(ce.total_replies).display,se(ce.total_replies).needsExact&&e.jsxs("span",{children:["(",se(ce.total_replies).exact,")"]})," ๆก"]})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๆˆๆœฌๆ•ˆ็އ"}),e.jsx(Pm,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-xl font-bold",children:ce.total_messages>0?`ยฅ${(ce.total_cost/ce.total_messages*100).toFixed(2)}`:"ยฅ0.00"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆฏ100ๆกๆถˆๆฏ"})]})]})]}),e.jsxs(ra,{defaultValue:"trends",className:"space-y-4",children:[e.jsxs(ea,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[e.jsx(ts,{value:"trends",children:"่ถ‹ๅŠฟ"}),e.jsx(ts,{value:"models",children:"ๆจกๅž‹"}),e.jsx(ts,{value:"activity",children:"ๆดปๅŠจ"}),e.jsx(ts,{value:"daily",children:"ๆ—ฅ็ปŸ่ฎก"})]}),e.jsxs(bs,{value:"trends",className:"space-y-4",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่ฏทๆฑ‚่ถ‹ๅŠฟ"}),e.jsxs(As,{children:["ๆœ€่ฟ‘",h,"ๅฐๆ—ถ็š„่ฏทๆฑ‚้‡ๅ˜ๅŒ–"]})]}),e.jsx(Re,{children:e.jsx(Or,{config:I,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(dw,{data:ee,children:[e.jsx(vo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(No,{dataKey:"timestamp",tickFormatter:L=>fe(L),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>fe(L)})}),e.jsx(uw,{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(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่Šฑ่ดน่ถ‹ๅŠฟ"}),e.jsx(As,{children:"API่ฐƒ็”จๆˆๆœฌๅ˜ๅŒ–"})]}),e.jsx(Re,{children:e.jsx(Or,{config:I,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(hm,{data:ee,children:[e.jsx(vo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(No,{dataKey:"timestamp",tickFormatter:L=>fe(L),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>fe(L)})}),e.jsx(bo,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"Tokenๆถˆ่€—"}),e.jsx(As,{children:"Tokenไฝฟ็”จ้‡ๅ˜ๅŒ–"})]}),e.jsx(Re,{children:e.jsx(Or,{config:I,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(hm,{data:ee,children:[e.jsx(vo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(No,{dataKey:"timestamp",tickFormatter:L=>fe(L),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>fe(L)})}),e.jsx(bo,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),e.jsx(bs,{value:"models",className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆจกๅž‹่ฏทๆฑ‚ๅˆ†ๅธƒ"}),e.jsxs(As,{children:["ๅ„ๆจกๅž‹ไฝฟ็”จๅ ๆฏ” (ๅ…ฑ ",O.length," ไธชๆจกๅž‹)"]})]}),e.jsx(Re,{children:e.jsx(Or,{config:Object.fromEntries(O.map((L,$)=>[L.model_name,{label:L.model_name,color:z[$]}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(mw,{children:[e.jsx(Li,{content:e.jsx(Rr,{})}),e.jsx(xw,{data:Q,cx:"50%",cy:"50%",labelLine:!1,label:({name:L,percent:$})=>$&&$<.05?"":`${L} ${$?($*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:Q.map((L,$)=>e.jsx(hw,{fill:L.fill},`cell-${$}`))})]})})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆจกๅž‹่ฏฆ็ป†็ปŸ่ฎก"}),e.jsx(As,{children:"่ฏทๆฑ‚ๆ•ฐใ€่Šฑ่ดนๅ’Œๆ€ง่ƒฝ"})]}),e.jsx(Re,{children:e.jsx(Je,{className:"h-[300px] sm:h-[400px]",children:e.jsx("div",{className:"space-y-3",children:O.map((L,$)=>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:L.model_name}),e.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${$%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:L.request_count.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"่Šฑ่ดน:"}),e.jsxs("span",{className:"ml-1 font-medium",children:["ยฅ",L.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:[(L.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:[L.avg_response_time.toFixed(2),"s"]})]})]})]},$))})})})]})]})}),e.jsx(bs,{value:"activity",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆœ€่ฟ‘ๆดปๅŠจ"}),e.jsx(As,{children:"ๆœ€ๆ–ฐ็š„API่ฐƒ็”จ่ฎฐๅฝ•"})]}),e.jsx(Re,{children:e.jsx(Je,{className:"h-[400px] sm:h-[500px]",children:e.jsx("div",{className:"space-y-2",children:me.map((L,$)=>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:L.model}),e.jsx("div",{className:"text-xs text-muted-foreground",children:L.request_type})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:fe(L.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:L.tokens})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"่Šฑ่ดน:"}),e.jsxs("span",{className:"ml-1",children:["ยฅ",L.cost.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"่€—ๆ—ถ:"}),e.jsxs("span",{className:"ml-1",children:[L.time_cost.toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"็Šถๆ€:"}),e.jsx("span",{className:`ml-1 ${L.status==="success"?"text-green-600":"text-red-600"}`,children:L.status})]})]})]},$))})})})]})}),e.jsx(bs,{value:"daily",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆฏๆ—ฅ็ปŸ่ฎก"}),e.jsx(As,{children:"ๆœ€่ฟ‘7ๅคฉ็š„ๆ•ฐๆฎๆฑ‡ๆ€ป"})]}),e.jsx(Re,{children:e.jsx(Or,{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(hm,{data:R,children:[e.jsx(vo,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(No,{dataKey:"timestamp",tickFormatter:L=>{const $=new Date(L);return`${$.getMonth()+1}/${$.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Oi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Li,{content:e.jsx(Rr,{labelFormatter:L=>new Date(L).toLocaleDateString("zh-CN")})}),e.jsx(J1,{content:e.jsx(Jj,{})}),e.jsx(bo,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),e.jsx(bo,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),e.jsx(qn,{})]})})}const i2={theme:"system",setTheme:()=>null},Wj=m.createContext(i2),qm=()=>{const l=m.useContext(Wj);if(l===void 0)throw new Error("useTheme must be used within a ThemeProvider");return l},c2=(l,n,i)=>{const c=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||c){n(l);return}const u=i.clientX,x=i.clientY,h=Math.hypot(Math.max(u,innerWidth-u),Math.max(x,innerHeight-x));document.startViewTransition(()=>{n(l)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${u}px ${x}px)`,`circle(${h}px at ${u}px ${x}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},ev=m.createContext(void 0),sv=()=>{const l=m.useContext(ev);if(l===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return l},Fe=m.forwardRef(({className:l,...n},i)=>e.jsx(Ug,{className:P("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",l),...n,ref:i,children:e.jsx(M0,{className:P("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")})}));Fe.displayName=Ug.displayName;const o2=Hr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),T=m.forwardRef(({className:l,...n},i)=>e.jsx(ej,{ref:i,className:P(o2(),l),...n}));T.displayName=ej.displayName;const ne=m.forwardRef(({className:l,type:n,...i},c)=>e.jsx("input",{type:n,className:P("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",l),ref:c,...i}));ne.displayName="Input";const d2=5,u2=5e3;let Nm=0;function m2(){return Nm=(Nm+1)%Number.MAX_SAFE_INTEGER,Nm.toString()}const bm=new Map,cg=l=>{if(bm.has(l))return;const n=setTimeout(()=>{bm.delete(l),Hi({type:"REMOVE_TOAST",toastId:l})},u2);bm.set(l,n)},x2=(l,n)=>{switch(n.type){case"ADD_TOAST":return{...l,toasts:[n.toast,...l.toasts].slice(0,d2)};case"UPDATE_TOAST":return{...l,toasts:l.toasts.map(i=>i.id===n.toast.id?{...i,...n.toast}:i)};case"DISMISS_TOAST":{const{toastId:i}=n;return i?cg(i):l.toasts.forEach(c=>{cg(c.id)}),{...l,toasts:l.toasts.map(c=>c.id===i||i===void 0?{...c,open:!1}:c)}}case"REMOVE_TOAST":return n.toastId===void 0?{...l,toasts:[]}:{...l,toasts:l.toasts.filter(i=>i.id!==n.toastId)}}},Co=[];let To={toasts:[]};function Hi(l){To=x2(To,l),Co.forEach(n=>{n(To)})}function Kt({...l}){const n=m2(),i=u=>Hi({type:"UPDATE_TOAST",toast:{...u,id:n}}),c=()=>Hi({type:"DISMISS_TOAST",toastId:n});return Hi({type:"ADD_TOAST",toast:{...l,id:n,open:!0,onOpenChange:u=>{u||c()}}}),{id:n,dismiss:c,update:i}}function st(){const[l,n]=m.useState(To);return m.useEffect(()=>(Co.push(n),()=>{const i=Co.indexOf(n);i>-1&&Co.splice(i,1)}),[l]),{...l,toast:Kt,dismiss:i=>Hi({type:"DISMISS_TOAST",toastId:i})}}const h2=[{id:"minLength",label:"้•ฟๅบฆ่‡ณๅฐ‘ 10 ไฝ",description:"Token ้•ฟๅบฆๅฟ…้กปๅคงไบŽ็ญ‰ไบŽ 10 ไธชๅญ—็ฌฆ",validate:l=>l.length>=10},{id:"hasUppercase",label:"ๅŒ…ๅซๅคงๅ†™ๅญ—ๆฏ",description:"่‡ณๅฐ‘ๅŒ…ๅซไธ€ไธชๅคงๅ†™ๅญ—ๆฏ (A-Z)",validate:l=>/[A-Z]/.test(l)},{id:"hasLowercase",label:"ๅŒ…ๅซๅฐๅ†™ๅญ—ๆฏ",description:"่‡ณๅฐ‘ๅŒ…ๅซไธ€ไธชๅฐๅ†™ๅญ—ๆฏ (a-z)",validate:l=>/[a-z]/.test(l)},{id:"hasSpecialChar",label:"ๅŒ…ๅซ็‰นๆฎŠ็ฌฆๅท",description:"่‡ณๅฐ‘ๅŒ…ๅซไธ€ไธช็‰นๆฎŠ็ฌฆๅท (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:l=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(l)}];function f2(l){const n=h2.map(c=>({id:c.id,label:c.label,description:c.description,passed:c.validate(l)}));return{isValid:n.every(c=>c.passed),rules:n}}const Ko="0.12.1",Km="MaiBot Dashboard",p2=`${Km} v${Ko}`,g2=(l="v")=>`${l}${Ko}`,fa={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"},ll={theme:"system",accentColor:"blue",enableAnimations:!0,enableWavesBackground:!0,logCacheSize:1e3,logAutoScroll:!0,logFontSize:"xs",logLineSpacing:4,dataSyncInterval:30,wsReconnectInterval:3e3,wsMaxReconnectAttempts:10};function Nt(l){const n=tv(l),i=localStorage.getItem(n);if(i===null)return ll[l];const c=ll[l];if(typeof c=="boolean")return i==="true";if(typeof c=="number"){const u=parseFloat(i);return isNaN(u)?c:u}return i}function Lr(l,n){const i=tv(l);localStorage.setItem(i,String(n)),window.dispatchEvent(new CustomEvent("maibot-settings-change",{detail:{key:l,value:n}}))}function j2(){return{theme:Nt("theme"),accentColor:Nt("accentColor"),enableAnimations:Nt("enableAnimations"),enableWavesBackground:Nt("enableWavesBackground"),logCacheSize:Nt("logCacheSize"),logAutoScroll:Nt("logAutoScroll"),logFontSize:Nt("logFontSize"),logLineSpacing:Nt("logLineSpacing"),dataSyncInterval:Nt("dataSyncInterval"),wsReconnectInterval:Nt("wsReconnectInterval"),wsMaxReconnectAttempts:Nt("wsMaxReconnectAttempts")}}function v2(){const l=j2(),n=localStorage.getItem(fa.COMPLETED_TOURS),i=n?JSON.parse(n):[];return{...l,completedTours:i}}function N2(l){const n=[],i=[];for(const[c,u]of Object.entries(l)){if(c==="completedTours"){Array.isArray(u)?(localStorage.setItem(fa.COMPLETED_TOURS,JSON.stringify(u)),n.push("completedTours")):i.push("completedTours");continue}if(c in ll){const x=c,h=ll[x];if(typeof u==typeof h){if(x==="theme"&&!["light","dark","system"].includes(u)){i.push(c);continue}if(x==="logFontSize"&&!["xs","sm","base"].includes(u)){i.push(c);continue}Lr(x,u),n.push(c)}else i.push(c)}else i.push(c)}return{success:n.length>0,imported:n,skipped:i}}function b2(){for(const l of Object.keys(ll))Lr(l,ll[l]);localStorage.removeItem(fa.COMPLETED_TOURS),window.dispatchEvent(new CustomEvent("maibot-settings-reset"))}function y2(){const l=[],n=[],i=[];for(let c=0;cc.size-i.size),{used:l,items:localStorage.length,details:n}}function w2(l){if(l===0)return"0 B";const n=1024,i=["B","KB","MB"],c=Math.floor(Math.log(l)/Math.log(n));return parseFloat((l/Math.pow(n,c)).toFixed(2))+" "+i[c]}function tv(l){return{theme:fa.THEME,accentColor:fa.ACCENT_COLOR,enableAnimations:fa.ENABLE_ANIMATIONS,enableWavesBackground:fa.ENABLE_WAVES_BACKGROUND,logCacheSize:fa.LOG_CACHE_SIZE,logAutoScroll:fa.LOG_AUTO_SCROLL,logFontSize:fa.LOG_FONT_SIZE,logLineSpacing:fa.LOG_LINE_SPACING,dataSyncInterval:fa.DATA_SYNC_INTERVAL,wsReconnectInterval:fa.WS_RECONNECT_INTERVAL,wsMaxReconnectAttempts:fa.WS_MAX_RECONNECT_ATTEMPTS}[l]}const _a=m.forwardRef(({className:l,...n},i)=>e.jsxs(Bg,{ref:i,className:P("relative flex w-full touch-none select-none items-center",l),...n,children:[e.jsx(A0,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(z0,{className:"absolute h-full bg-primary"})}),e.jsx(D0,{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"})]}));_a.displayName=Bg.displayName;class _2{ws=null;reconnectTimeout=null;reconnectAttempts=0;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];getMaxCacheSize(){return Nt("logCacheSize")}getMaxReconnectAttempts(){return Nt("wsMaxReconnectAttempts")}getReconnectInterval(){return Nt("wsReconnectInterval")}getWebSocketUrl(n){let i;{const c=window.location.protocol==="https:"?"wss:":"ws:",u=window.location.host;i=`${c}//${u}/ws/logs`}return n?`${i}?token=${encodeURIComponent(n)}`:i}async getWsToken(){try{const n=await we("/api/webui/ws-token",{method:"GET",credentials:"include"});if(!n.ok)return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",n.status),null;const i=await n.json();return i.success&&i.token?i.token:null}catch(n){return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",n),null}}async connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;if(window.location.pathname==="/auth"){console.log("๐Ÿ“ก ๅœจ็™ปๅฝ•้กต้ข๏ผŒ่ทณ่ฟ‡ WebSocket ่ฟžๆŽฅ");return}if(!await Yi()){console.log("๐Ÿ“ก ๆœช็™ปๅฝ•๏ผŒ่ทณ่ฟ‡ WebSocket ่ฟžๆŽฅ");return}const i=await this.getWsToken();if(!i){console.log("๐Ÿ“ก ๆ— ๆณ•่Žทๅ– WebSocket token๏ผŒ่ทณ่ฟ‡่ฟžๆŽฅ");return}const c=this.getWebSocketUrl(i);try{this.ws=new WebSocket(c),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=u=>{try{if(u.data==="pong")return;const x=JSON.parse(u.data);this.notifyLog(x)}catch(x){console.error("่งฃๆžๆ—ฅๅฟ—ๆถˆๆฏๅคฑ่ดฅ:",x)}},this.ws.onerror=u=>{console.error("โŒ WebSocket ้”™่ฏฏ:",u),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(u){console.error("ๅˆ›ๅปบ WebSocket ่ฟžๆŽฅๅคฑ่ดฅ:",u),this.attemptReconnect()}}attemptReconnect(){const n=this.getMaxReconnectAttempts();if(this.reconnectAttempts>=n)return;this.reconnectAttempts+=1;const i=this.getReconnectInterval(),c=Math.min(i*this.reconnectAttempts,3e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},c)}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(n){return this.logCallbacks.add(n),()=>this.logCallbacks.delete(n)}onConnectionChange(n){return this.connectionCallbacks.add(n),n(this.isConnected),()=>this.connectionCallbacks.delete(n)}notifyLog(n){if(!this.logCache.some(c=>c.id===n.id)){this.logCache.push(n);const c=this.getMaxCacheSize();this.logCache.length>c&&(this.logCache=this.logCache.slice(-c)),this.logCallbacks.forEach(u=>{try{u(n)}catch(x){console.error("ๆ—ฅๅฟ—ๅ›ž่ฐƒๆ‰ง่กŒๅคฑ่ดฅ:",x)}})}}notifyConnection(n){this.connectionCallbacks.forEach(i=>{try{i(n)}catch(c){console.error("่ฟžๆŽฅ็Šถๆ€ๅ›ž่ฐƒๆ‰ง่กŒๅคฑ่ดฅ:",c)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Ln=new _2;typeof window<"u"&&setTimeout(()=>{Ln.connect()},100);const Ps=jw,Qo=vw,S2=pw,av=m.forwardRef(({className:l,...n},i)=>e.jsx(sj,{ref:i,className:P("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",l),...n}));av.displayName=sj.displayName;const Us=m.forwardRef(({className:l,children:n,preventOutsideClose:i=!1,...c},u)=>e.jsxs(S2,{children:[e.jsx(av,{}),e.jsxs(tj,{ref:u,className:P("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",l),onPointerDownOutside:i?x=>x.preventDefault():void 0,onInteractOutside:i?x=>x.preventDefault():void 0,...c,children:[n,e.jsxs(gw,{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(Ca,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Us.displayName=tj.displayName;const Bs=({className:l,...n})=>e.jsx("div",{className:P("flex flex-col space-y-1.5 text-center sm:text-left",l),...n});Bs.displayName="DialogHeader";const et=({className:l,...n})=>e.jsx("div",{className:P("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",l),...n});et.displayName="DialogFooter";const $s=m.forwardRef(({className:l,...n},i)=>e.jsx(aj,{ref:i,className:P("text-lg font-semibold leading-none tracking-tight",l),...n}));$s.displayName=aj.displayName;const Ys=m.forwardRef(({className:l,...n},i)=>e.jsx(lj,{ref:i,className:P("text-sm text-muted-foreground",l),...n}));Ys.displayName=lj.displayName;const js=R0,bt=L0,k2=O0,lv=m.forwardRef(({className:l,...n},i)=>e.jsx($g,{className:P("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",l),...n,ref:i}));lv.displayName=$g.displayName;const ds=m.forwardRef(({className:l,...n},i)=>e.jsxs(k2,{children:[e.jsx(lv,{}),e.jsx(Ig,{ref:i,className:P("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",l),...n})]}));ds.displayName=Ig.displayName;const us=({className:l,...n})=>e.jsx("div",{className:P("flex flex-col space-y-2 text-center sm:text-left",l),...n});us.displayName="AlertDialogHeader";const ms=({className:l,...n})=>e.jsx("div",{className:P("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",l),...n});ms.displayName="AlertDialogFooter";const xs=m.forwardRef(({className:l,...n},i)=>e.jsx(Pg,{ref:i,className:P("text-lg font-semibold",l),...n}));xs.displayName=Pg.displayName;const hs=m.forwardRef(({className:l,...n},i)=>e.jsx(Hg,{ref:i,className:P("text-sm text-muted-foreground",l),...n}));hs.displayName=Hg.displayName;const fs=m.forwardRef(({className:l,variant:n,...i},c)=>e.jsx(Fg,{ref:c,className:P(Pr({variant:n}),l),...i}));fs.displayName=Fg.displayName;const ps=m.forwardRef(({className:l,...n},i)=>e.jsx(Gg,{ref:i,className:P(Pr({variant:"outline"}),"mt-2 sm:mt-0",l),...n}));ps.displayName=Gg.displayName;function C2(){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(ra,{defaultValue:"appearance",className:"w-full",children:[e.jsxs(ea,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(ts,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Pw,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅค–่ง‚"})]}),e.jsxs(ts,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(bj,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅฎ‰ๅ…จ"})]}),e.jsxs(ts,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(mn,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅ…ถไป–"})]}),e.jsxs(ts,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Pt,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅ…ณไบŽ"})]})]}),e.jsxs(Je,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(bs,{value:"appearance",className:"mt-0",children:e.jsx(T2,{})}),e.jsx(bs,{value:"security",className:"mt-0",children:e.jsx(E2,{})}),e.jsx(bs,{value:"other",className:"mt-0",children:e.jsx(M2,{})}),e.jsx(bs,{value:"about",className:"mt-0",children:e.jsx(A2,{})})]})]})]})}function dg(l){const n=document.documentElement,c={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%)"}}[l];if(c)n.style.setProperty("--primary",c.hsl),c.gradient?(n.style.setProperty("--primary-gradient",c.gradient),n.classList.add("has-gradient")):(n.style.removeProperty("--primary-gradient"),n.classList.remove("has-gradient"));else if(l.startsWith("#")){const u=x=>{x=x.replace("#","");const h=parseInt(x.substring(0,2),16)/255,f=parseInt(x.substring(2,4),16)/255,p=parseInt(x.substring(4,6),16)/255,g=Math.max(h,f,p),N=Math.min(h,f,p);let v=0,y=0;const w=(g+N)/2;if(g!==N){const b=g-N;switch(y=w>.5?b/(2-g-N):b/(g+N),g){case h:v=((f-p)/b+(flocalStorage.getItem("accent-color")||"blue");m.useEffect(()=>{const g=localStorage.getItem("accent-color")||"blue";dg(g)},[]);const p=g=>{f(g),localStorage.setItem("accent-color",g),dg(g)};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(ym,{value:"light",current:l,onChange:n,label:"ๆต…่‰ฒ",description:"ๅง‹็ปˆไฝฟ็”จๆต…่‰ฒไธป้ข˜"}),e.jsx(ym,{value:"dark",current:l,onChange:n,label:"ๆทฑ่‰ฒ",description:"ๅง‹็ปˆไฝฟ็”จๆทฑ่‰ฒไธป้ข˜"}),e.jsx(ym,{value:"system",current:l,onChange:n,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(Ia,{value:"blue",current:h,onChange:p,label:"่“่‰ฒ",colorClass:"bg-blue-500"}),e.jsx(Ia,{value:"purple",current:h,onChange:p,label:"็ดซ่‰ฒ",colorClass:"bg-purple-500"}),e.jsx(Ia,{value:"green",current:h,onChange:p,label:"็ปฟ่‰ฒ",colorClass:"bg-green-500"}),e.jsx(Ia,{value:"orange",current:h,onChange:p,label:"ๆฉ™่‰ฒ",colorClass:"bg-orange-500"}),e.jsx(Ia,{value:"pink",current:h,onChange:p,label:"็ฒ‰่‰ฒ",colorClass:"bg-pink-500"}),e.jsx(Ia,{value:"red",current:h,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(Ia,{value:"gradient-sunset",current:h,onChange:p,label:"ๆ—ฅ่ฝ",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),e.jsx(Ia,{value:"gradient-ocean",current:h,onChange:p,label:"ๆตทๆด‹",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsx(Ia,{value:"gradient-forest",current:h,onChange:p,label:"ๆฃฎๆž—",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),e.jsx(Ia,{value:"gradient-aurora",current:h,onChange:p,label:"ๆžๅ…‰",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),e.jsx(Ia,{value:"gradient-fire",current:h,onChange:p,label:"็ƒˆ็„ฐ",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),e.jsx(Ia,{value:"gradient-twilight",current:h,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:h.startsWith("#")?h:"#3b82f6",onChange:g=>p(g.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(ne,{type:"text",value:h,onChange:g=>p(g.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(T,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"ๅฏ็”จๅŠจ็”ปๆ•ˆๆžœ"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅ…ณ้—ญๅŽๅฐ†็ฆ็”จๆ‰€ๆœ‰่ฟ‡ๆธกๅŠจ็”ปๅ’Œ็‰นๆ•ˆ๏ผŒๆๅ‡ๆ€ง่ƒฝ"})]}),e.jsx(Fe,{id:"animations",checked:i,onCheckedChange:c})]})}),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(T,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"็™ปๅฝ•้กตๆณขๆตช่ƒŒๆ™ฏ"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅ…ณ้—ญๅŽ็™ปๅฝ•้กตๅฐ†ไฝฟ็”จ็บฏ่‰ฒ่ƒŒๆ™ฏ๏ผŒ้€‚ๅˆไฝŽๆ€ง่ƒฝ่ฎพๅค‡"})]}),e.jsx(Fe,{id:"waves-background",checked:u,onCheckedChange:x})]})})]})]})]})}function E2(){const l=ia(),[n,i]=m.useState(""),[c,u]=m.useState(""),[x,h]=m.useState(!1),[f,p]=m.useState(!1),[g,N]=m.useState(!1),[v,y]=m.useState(!1),[w,b]=m.useState(!1),[D,A]=m.useState(!1),[_,H]=m.useState(""),[E,C]=m.useState(!1),{toast:M}=st(),G=m.useMemo(()=>f2(c),[c]),O=async se=>{if(!n){M({title:"ๆ— ๆณ•ๅคๅˆถ",description:"Token ๅญ˜ๅ‚จๅœจๅฎ‰ๅ…จ Cookie ไธญ๏ผŒ่ฏท้‡ๆ–ฐ็”Ÿๆˆไปฅ่Žทๅ–ๆ–ฐ Token",variant:"destructive"});return}try{await navigator.clipboard.writeText(se),b(!0),M({title:"ๅคๅˆถๆˆๅŠŸ",description:"Token ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"}),setTimeout(()=>b(!1),2e3)}catch{M({title:"ๅคๅˆถๅคฑ่ดฅ",description:"่ฏทๆ‰‹ๅŠจๅคๅˆถ Token",variant:"destructive"})}},ee=async()=>{if(!c.trim()){M({title:"่พ“ๅ…ฅ้”™่ฏฏ",description:"่ฏท่พ“ๅ…ฅๆ–ฐ็š„ Token",variant:"destructive"});return}if(!G.isValid){const se=G.rules.filter(ge=>!ge.passed).map(ge=>ge.label).join(", ");M({title:"ๆ ผๅผ้”™่ฏฏ",description:`Token ไธ็ฌฆๅˆ่ฆๆฑ‚: ${se}`,variant:"destructive"});return}N(!0);try{const se=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({new_token:c.trim()})}),ge=await se.json();se.ok&&ge.success?(u(""),i(c.trim()),M({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:"Access Token ๅทฒๆ›ดๆ–ฐ๏ผŒๅณๅฐ†่ทณ่ฝฌๅˆฐ็™ปๅฝ•้กต"}),setTimeout(()=>{l({to:"/auth"})},1500)):M({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:ge.message||"ๆ— ๆณ•ๆ›ดๆ–ฐ Token",variant:"destructive"})}catch(se){console.error("ๆ›ดๆ–ฐ Token ้”™่ฏฏ:",se),M({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:"่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ",variant:"destructive"})}finally{N(!1)}},R=async()=>{y(!0);try{const se=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"}),ge=await se.json();se.ok&&ge.success?(i(ge.token),H(ge.token),A(!0),C(!1),M({title:"็”ŸๆˆๆˆๅŠŸ",description:"ๆ–ฐ็š„ Access Token ๅทฒ็”Ÿๆˆ๏ผŒ่ฏทๅŠๆ—ถไฟๅญ˜"})):M({title:"็”Ÿๆˆๅคฑ่ดฅ",description:ge.message||"ๆ— ๆณ•็”Ÿๆˆๆ–ฐ Token",variant:"destructive"})}catch(se){console.error("็”Ÿๆˆ Token ้”™่ฏฏ:",se),M({title:"็”Ÿๆˆๅคฑ่ดฅ",description:"่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ",variant:"destructive"})}finally{y(!1)}},me=async()=>{try{await navigator.clipboard.writeText(_),C(!0),M({title:"ๅคๅˆถๆˆๅŠŸ",description:"Token ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"})}catch{M({title:"ๅคๅˆถๅคฑ่ดฅ",description:"่ฏทๆ‰‹ๅŠจๅคๅˆถ Token",variant:"destructive"})}},ce=()=>{A(!1),setTimeout(()=>{H(""),C(!1)},300),setTimeout(()=>{l({to:"/auth"})},500)},ve=se=>{se||ce()};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(Ps,{open:D,onOpenChange:ve,children:e.jsxs(Us,{className:"sm:max-w-md",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Yt,{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(T,{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:_})]}),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(Yt,{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(et,{className:"gap-2 sm:gap-0",children:[e.jsx(S,{variant:"outline",onClick:me,className:"gap-2",children:E?e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"h-4 w-4 text-green-500"}),"ๅทฒๅคๅˆถ"]}):e.jsxs(e.Fragment,{children:[e.jsx(Mo,{className:"h-4 w-4"}),"ๅคๅˆถ Token"]})}),e.jsx(S,{onClick:ce,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(T,{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(ne,{id:"current-token",type:x?"text":"password",value:n||"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"Token ๅญ˜ๅ‚จๅœจๅฎ‰ๅ…จ Cookie ไธญ"}),e.jsx("button",{onClick:()=>{n?h(!x):M({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(qi,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(na,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(S,{variant:"outline",size:"icon",onClick:()=>O(n),title:"ๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ",className:"flex-shrink-0",disabled:!n,children:w?e.jsx(_t,{className:"h-4 w-4 text-green-500"}):e.jsx(Mo,{className:"h-4 w-4"})}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",disabled:v,className:"gap-2 flex-1 sm:flex-none",children:[e.jsx(ft,{className:P("h-4 w-4",v&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"้‡ๆ–ฐ็”Ÿๆˆ"}),e.jsx("span",{className:"sm:hidden",children:"็”Ÿๆˆ"})]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๆ–ฐ็”Ÿๆˆ Token"}),e.jsx(hs,{children:"่ฟ™ๅฐ†็”Ÿๆˆไธ€ไธชๆ–ฐ็š„ 64 ไฝๅฎ‰ๅ…จไปค็‰Œ๏ผŒๅนถไฝฟๅฝ“ๅ‰ Token ็ซ‹ๅณๅคฑๆ•ˆใ€‚ ๆ‚จ้œ€่ฆไฝฟ็”จๆ–ฐ Token ้‡ๆ–ฐ็™ปๅฝ•็ณป็ปŸใ€‚ๆญคๆ“ไฝœไธๅฏๆ’ค้”€๏ผŒ็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:R,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(T,{htmlFor:"new-token",className:"text-sm",children:"ๆ–ฐ็š„่ฎฟ้—ฎไปค็‰Œ"}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{id:"new-token",type:f?"text":"password",value:c,onChange:se=>u(se.target.value),className:"pr-10 font-mono text-sm",placeholder:"่พ“ๅ…ฅ่‡ชๅฎšไน‰ Token"}),e.jsx("button",{onClick:()=>p(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:f?"้š่—":"ๆ˜พ็คบ",children:f?e.jsx(qi,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(na,{className:"h-4 w-4 text-muted-foreground"})})]}),c&&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:G.rules.map(se=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[se.passed?e.jsx(Wt,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):e.jsx(Ki,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:P(se.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:se.label})]},se.id))}),G.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(_t,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:"Token ๆ ผๅผๆญฃ็กฎ๏ผŒๅฏไปฅไฝฟ็”จ"})]})})]})]}),e.jsx(S,{onClick:ee,disabled:g||!G.isValid||!c,className:"w-full sm:w-auto",children:g?"ๆ›ดๆ–ฐไธญ...":"ๆ›ดๆ–ฐ่‡ชๅฎšไน‰ 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 M2(){const l=ia(),{toast:n}=st(),[i,c]=m.useState(!1),[u,x]=m.useState(!1),[h,f]=m.useState(()=>Nt("logCacheSize")),[p,g]=m.useState(()=>Nt("wsReconnectInterval")),[N,v]=m.useState(()=>Nt("wsMaxReconnectAttempts")),[y,w]=m.useState(()=>Nt("dataSyncInterval")),[b,D]=m.useState(()=>og()),[A,_]=m.useState(!1),[H,E]=m.useState(!1),C=m.useRef(null);if(u)throw new Error("่ฟ™ๆ˜ฏไธ€ไธชๆ‰‹ๅŠจ่งฆๅ‘็š„ๆต‹่ฏ•้”™่ฏฏ๏ผŒ็”จไบŽ้ชŒ่ฏ้”™่ฏฏ่พน็•Œ็ป„ไปถๆ˜ฏๅฆๆญฃๅธธๅทฅไฝœใ€‚");const M=()=>{D(og())},G=z=>{const Q=z[0];f(Q),Lr("logCacheSize",Q)},O=z=>{const Q=z[0];g(Q),Lr("wsReconnectInterval",Q)},ee=z=>{const Q=z[0];v(Q),Lr("wsMaxReconnectAttempts",Q)},R=z=>{const Q=z[0];w(Q),Lr("dataSyncInterval",Q)},me=()=>{Ln.clearLogs(),n({title:"ๆ—ฅๅฟ—ๅทฒๆธ…้™ค",description:"ๆ—ฅๅฟ—็ผ“ๅญ˜ๅทฒๆธ…็ฉบ"})},ce=()=>{const z=y2();M(),n({title:"็ผ“ๅญ˜ๅทฒๆธ…้™ค",description:`ๅทฒๆธ…้™ค ${z.clearedKeys.length} ้กน็ผ“ๅญ˜ๆ•ฐๆฎ`})},ve=()=>{_(!0);try{const z=v2(),Q=JSON.stringify(z,null,2),I=new Blob([Q],{type:"application/json"}),L=URL.createObjectURL(I),$=document.createElement("a");$.href=L,$.download=`maibot-webui-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(L),n({title:"ๅฏผๅ‡บๆˆๅŠŸ",description:"่ฎพ็ฝฎๅทฒๅฏผๅ‡บไธบ JSON ๆ–‡ไปถ"})}catch(z){console.error("ๅฏผๅ‡บ่ฎพ็ฝฎๅคฑ่ดฅ:",z),n({title:"ๅฏผๅ‡บๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅฏผๅ‡บ่ฎพ็ฝฎ",variant:"destructive"})}finally{_(!1)}},se=z=>{const Q=z.target.files?.[0];if(!Q)return;E(!0);const I=new FileReader;I.onload=L=>{try{const $=L.target?.result,_e=JSON.parse($),je=N2(_e);je.success?(f(Nt("logCacheSize")),g(Nt("wsReconnectInterval")),v(Nt("wsMaxReconnectAttempts")),w(Nt("dataSyncInterval")),M(),n({title:"ๅฏผๅ…ฅๆˆๅŠŸ",description:`ๆˆๅŠŸๅฏผๅ…ฅ ${je.imported.length} ้กน่ฎพ็ฝฎ${je.skipped.length>0?`๏ผŒ่ทณ่ฟ‡ ${je.skipped.length} ้กน`:""}`}),(je.imported.includes("theme")||je.imported.includes("accentColor"))&&n({title:"ๆ็คบ",description:"้ƒจๅˆ†่ฎพ็ฝฎ้œ€่ฆๅˆทๆ–ฐ้กต้ขๆ‰่ƒฝๅฎŒๅ…จ็”Ÿๆ•ˆ"})):n({title:"ๅฏผๅ…ฅๅคฑ่ดฅ",description:"ๆฒกๆœ‰ๆœ‰ๆ•ˆ็š„่ฎพ็ฝฎ้กนๅฏๅฏผๅ…ฅ",variant:"destructive"})}catch($){console.error("ๅฏผๅ…ฅ่ฎพ็ฝฎๅคฑ่ดฅ:",$),n({title:"ๅฏผๅ…ฅๅคฑ่ดฅ",description:"ๆ–‡ไปถๆ ผๅผๆ— ๆ•ˆ",variant:"destructive"})}finally{E(!1),C.current&&(C.current.value="")}},I.readAsText(Q)},ge=()=>{b2(),f(ll.logCacheSize),g(ll.wsReconnectInterval),v(ll.wsMaxReconnectAttempts),w(ll.dataSyncInterval),M(),n({title:"ๅทฒ้‡็ฝฎ",description:"ๆ‰€ๆœ‰่ฎพ็ฝฎๅทฒๆขๅคไธบ้ป˜่ฎคๅ€ผ๏ผŒๅˆทๆ–ฐ้กต้ขไปฅๅบ”็”จๆ›ดๆ”น"})},fe=async()=>{c(!0);try{const z=await we("/api/webui/setup/reset",{method:"POST"}),Q=await z.json();z.ok&&Q.success?(n({title:"้‡็ฝฎๆˆๅŠŸ",description:"ๅณๅฐ†่ฟ›ๅ…ฅๅˆๆฌก้…็ฝฎๅ‘ๅฏผ"}),setTimeout(()=>{l({to:"/setup"})},1e3)):n({title:"้‡็ฝฎๅคฑ่ดฅ",description:Q.message||"ๆ— ๆณ•้‡็ฝฎ้…็ฝฎ็Šถๆ€",variant:"destructive"})}catch(z){console.error("้‡็ฝฎ้…็ฝฎ็Šถๆ€้”™่ฏฏ:",z),n({title:"้‡็ฝฎๅคฑ่ดฅ",description:"่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ",variant:"destructive"})}finally{c(!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(Br,{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(Hw,{className:"h-4 w-4"}),"ๆœฌๅœฐๅญ˜ๅ‚จไฝฟ็”จ"]}),e.jsx(S,{variant:"ghost",size:"sm",onClick:M,className:"h-7 px-2",children:e.jsx(ft,{className:"h-3 w-3"})})]}),e.jsx("div",{className:"text-2xl font-bold text-primary",children:w2(b.used)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[b.items," ไธชๅญ˜ๅ‚จ้กน"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๆ—ฅๅฟ—็ผ“ๅญ˜ๅคงๅฐ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[h," ๆก"]})]}),e.jsx(_a,{value:[h],onValueChange:G,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(T,{className:"text-sm font-medium",children:"้ฆ–้กตๆ•ฐๆฎๅˆทๆ–ฐ้—ด้š”"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[y," ็ง’"]})]}),e.jsx(_a,{value:[y],onValueChange:R,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(T,{className:"text-sm font-medium",children:"WebSocket ้‡่ฟž้—ด้š”"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[p/1e3," ็ง’"]})]}),e.jsx(_a,{value:[p],onValueChange:O,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(T,{className:"text-sm font-medium",children:"WebSocket ๆœ€ๅคง้‡่ฟžๆฌกๆ•ฐ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[N," ๆฌก"]})]}),e.jsx(_a,{value:[N],onValueChange:ee,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(S,{variant:"outline",size:"sm",onClick:me,className:"gap-2",children:[e.jsx(ns,{className:"h-4 w-4"}),"ๆธ…้™คๆ—ฅๅฟ—็ผ“ๅญ˜"]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(ns,{className:"h-4 w-4"}),"ๆธ…้™คๆœฌๅœฐ็ผ“ๅญ˜"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆธ…้™คๆœฌๅœฐ็ผ“ๅญ˜"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๆธ…้™คๆ‰€ๆœ‰ๆœฌๅœฐ็ผ“ๅญ˜็š„่ฎพ็ฝฎๅ’Œๆ•ฐๆฎ๏ผˆไธๅŒ…ๆ‹ฌ็™ปๅฝ•ๅ‡ญ่ฏ๏ผ‰ใ€‚ ๆ‚จๅฏ่ƒฝ้œ€่ฆ้‡ๆ–ฐ้…็ฝฎ้ƒจๅˆ†ๅๅฅฝ่ฎพ็ฝฎใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ce,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(Zt,{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(S,{variant:"outline",onClick:ve,disabled:A,className:"gap-2",children:[e.jsx(Zt,{className:"h-4 w-4"}),A?"ๅฏผๅ‡บไธญ...":"ๅฏผๅ‡บ่ฎพ็ฝฎ"]}),e.jsx("input",{ref:C,type:"file",accept:".json",onChange:se,className:"hidden"}),e.jsxs(S,{variant:"outline",onClick:()=>C.current?.click(),disabled:H,className:"gap-2",children:[e.jsx(Qi,{className:"h-4 w-4"}),H?"ๅฏผๅ…ฅไธญ...":"ๅฏผๅ…ฅ่ฎพ็ฝฎ"]})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2 text-destructive hover:text-destructive",children:[e.jsx(Vi,{className:"h-4 w-4"}),"้‡็ฝฎๆ‰€ๆœ‰่ฎพ็ฝฎไธบ้ป˜่ฎคๅ€ผ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡็ฝฎๆ‰€ๆœ‰่ฎพ็ฝฎ"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๆŠŠๆ‰€ๆœ‰็•Œ้ข่ฎพ็ฝฎๆขๅคไธบ้ป˜่ฎคๅ€ผ๏ผŒๅŒ…ๆ‹ฌไธป้ข˜ใ€้ขœ่‰ฒใ€ๅŠจ็”ป็ญ‰ๅๅฅฝ่ฎพ็ฝฎใ€‚ ๆญคๆ“ไฝœไธไผšๅฝฑๅ“ๆ‚จ็š„็™ปๅฝ•็Šถๆ€ใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ge,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(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"outline",disabled:i,className:"gap-2",children:[e.jsx(Vi,{className:P("h-4 w-4",i&&"animate-spin")}),"้‡ๆ–ฐ่ฟ›่กŒๅˆๆฌก้…็ฝฎ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๆ–ฐ้…็ฝฎ"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๅธฆๆ‚จ้‡ๆ–ฐ่ฟ›ๅ…ฅๅˆๆฌก้…็ฝฎๅ‘ๅฏผใ€‚ๆ‚จๅฏไปฅ้‡ๆ–ฐ่ฎพ็ฝฎ็ณป็ปŸ็š„ๅŸบ็ก€้…็ฝฎ้กนใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:fe,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(Yt,{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(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{variant:"destructive",className:"gap-2",children:[e.jsx(Yt,{className:"h-4 w-4"}),"่งฆๅ‘ๆต‹่ฏ•้”™่ฏฏ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค่งฆๅ‘้”™่ฏฏ"}),e.jsx(hs,{children:"่ฟ™ๅฐ†ๆ‰‹ๅŠจ่งฆๅ‘ไธ€ไธช React ้”™่ฏฏ๏ผŒ็”จไบŽๆต‹่ฏ•้”™่ฏฏ่พน็•Œ็ป„ไปถ็š„ๆ˜พ็คบๆ•ˆๆžœใ€‚ ้กต้ขๅฐ†ๆ˜พ็คบ้”™่ฏฏ็•Œ้ข๏ผŒๆ‚จๅฏไปฅ้€š่ฟ‡ๅˆทๆ–ฐ้กต้ขๆˆ–็‚นๅ‡ป่ฟ”ๅ›ž้ฆ–้กตๆฅๆขๅคใ€‚"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>x(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎค่งฆๅ‘"})]})]})]})]})]})]})}function A2(){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:P("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:["ๅ…ณไบŽ ",Km]}),e.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("p",{children:["็‰ˆๆœฌ: ",Ko]}),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(Je,{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(ht,{name:"React",description:"็”จๆˆท็•Œ้ขๆž„ๅปบๅบ“",license:"MIT"}),e.jsx(ht,{name:"shadcn/ui",description:"ไผ˜้›…็š„ React ็ป„ไปถๅบ“",license:"MIT"}),e.jsx(ht,{name:"Radix UI",description:"ๆ— ๆ ทๅผ็š„ๅฏ่ฎฟ้—ฎ็ป„ไปถๅบ“",license:"MIT"}),e.jsx(ht,{name:"Tailwind CSS",description:"ๅฎž็”จไผ˜ๅ…ˆ็š„ CSS ๆก†ๆžถ",license:"MIT"}),e.jsx(ht,{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(ht,{name:"TanStack Router",description:"็ฑปๅž‹ๅฎ‰ๅ…จ็š„่ทฏ็”ฑๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"React Hook Form",description:"้ซ˜ๆ€ง่ƒฝ่กจๅ•ๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"clsx",description:"ๆกไปถ className ๆž„ๅปบๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{name:"tailwind-merge",description:"Tailwind ็ฑปๅๅˆๅนถๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{name:"class-variance-authority",description:"็ป„ไปถๅ˜ไฝ“็ฎก็†",license:"Apache-2.0"}),e.jsx(ht,{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(ht,{name:"Framer Motion",description:"React ๅŠจ็”ปๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"FastAPI",description:"็ŽฐไปฃๅŒ– Python Web ๆก†ๆžถ",license:"MIT"}),e.jsx(ht,{name:"Uvicorn",description:"ASGI ๆœๅŠกๅ™จ",license:"BSD-3-Clause"}),e.jsx(ht,{name:"Pydantic",description:"ๆ•ฐๆฎ้ชŒ่ฏๅบ“",license:"MIT"}),e.jsx(ht,{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(ht,{name:"TypeScript",description:"JavaScript ็š„่ถ…้›†",license:"Apache-2.0"}),e.jsx(ht,{name:"Vite",description:"ไธ‹ไธ€ไปฃๅ‰็ซฏๆž„ๅปบๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{name:"ESLint",description:"JavaScript ไปฃ็ ๆฃ€ๆŸฅๅทฅๅ…ท",license:"MIT"}),e.jsx(ht,{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 ht({name:l,description:n,license:i}){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:l}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:n})]}),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:i})]})}function ym({value:l,current:n,onChange:i,label:c,description:u}){const x=n===l;return e.jsxs("button",{onClick:()=>i(l),className:P("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:c}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:u})]}),e.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[l==="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"})]}),l==="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"})]}),l==="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 Ia({value:l,current:n,onChange:i,label:c,colorClass:u}){const x=n===l;return e.jsxs("button",{onClick:()=>i(l),className:P("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:P("h-8 w-8 sm:h-10 sm:w-10 rounded-full",u)}),e.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:c})]})]})}const z2=Date.now()%1e6;class D2{grad3;p;perm;constructor(n=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 i=0;i<256;i++)this.p[i]=Math.floor(Math.random()*256);this.perm=[];for(let i=0;i<512;i++)this.perm[i]=this.p[i&255]}dot(n,i,c){return n[0]*i+n[1]*c}mix(n,i,c){return(1-c)*n+c*i}fade(n){return n*n*n*(n*(n*6-15)+10)}perlin2(n,i){const c=Math.floor(n)&255,u=Math.floor(i)&255;n-=Math.floor(n),i-=Math.floor(i);const x=this.fade(n),h=this.fade(i),f=this.perm[c]+u,p=this.perm[f],g=this.perm[f+1],N=this.perm[c+1]+u,v=this.perm[N],y=this.perm[N+1];return this.mix(this.mix(this.dot(this.grad3[p%12],n,i),this.dot(this.grad3[v%12],n-1,i),x),this.mix(this.dot(this.grad3[g%12],n,i-1),this.dot(this.grad3[y%12],n-1,i-1),x),h)}}function ug(){const l=m.useRef(null),n=m.useRef(null),i=m.useRef(void 0),[c]=m.useState(()=>new D2(z2)),u=m.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:c,bounding:null});return m.useEffect(()=>{const x=n.current,h=l.current;if(!x||!h)return;const f=u.current;f.noise=c;const p=()=>{const A=x.getBoundingClientRect();f.bounding=A,h.style.width=`${A.width}px`,h.style.height=`${A.height}px`},g=()=>{if(!f.bounding)return;const{width:A,height:_}=f.bounding;f.lines=[],f.paths.forEach(me=>me.remove()),f.paths=[];const H=10,E=32,C=A+200,M=_+30,G=Math.ceil(C/H),O=Math.ceil(M/E),ee=(A-H*G)/2,R=(_-E*O)/2;for(let me=0;me<=G;me++){const ce=[];for(let se=0;se<=O;se++){const ge={x:ee+H*me,y:R+E*se,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};ce.push(ge)}const ve=document.createElementNS("http://www.w3.org/2000/svg","path");h.appendChild(ve),f.paths.push(ve),f.lines.push(ce)}},N=A=>{const{lines:_,mouse:H,noise:E}=f;_.forEach(C=>{C.forEach(M=>{const G=E.perlin2((M.x+A*.0125)*.002,(M.y+A*.005)*.0015)*12;M.wave.x=Math.cos(G)*32,M.wave.y=Math.sin(G)*16;const O=M.x-H.sx,ee=M.y-H.sy,R=Math.hypot(O,ee),me=Math.max(175,H.vs);if(R{const H={x:A.x+A.wave.x+(_?A.cursor.x:0),y:A.y+A.wave.y+(_?A.cursor.y:0)};return H.x=Math.round(H.x*10)/10,H.y=Math.round(H.y*10)/10,H},y=()=>{const{lines:A,paths:_}=f;A.forEach((H,E)=>{let C=v(H[0],!1),M=`M ${C.x} ${C.y}`;H.forEach((G,O)=>{const ee=O===H.length-1;C=v(G,!ee),M+=`L ${C.x} ${C.y}`}),_[E].setAttribute("d",M)})},w=A=>{const{mouse:_}=f;_.sx+=(_.x-_.sx)*.1,_.sy+=(_.y-_.sy)*.1;const H=_.x-_.lx,E=_.y-_.ly,C=Math.hypot(H,E);_.v=C,_.vs+=(C-_.vs)*.1,_.vs=Math.min(100,_.vs),_.lx=_.x,_.ly=_.y,_.a=Math.atan2(E,H),x&&(x.style.setProperty("--x",`${_.sx}px`),x.style.setProperty("--y",`${_.sy}px`)),N(A),y(),i.current=requestAnimationFrame(w)},b=A=>{if(!f.bounding)return;const{mouse:_}=f;_.x=A.pageX-f.bounding.left,_.y=A.pageY-f.bounding.top+window.scrollY,_.set||(_.sx=_.x,_.sy=_.y,_.lx=_.x,_.ly=_.y,_.set=!0)},D=()=>{p(),g()};return p(),g(),window.addEventListener("resize",D),window.addEventListener("mousemove",b),i.current=requestAnimationFrame(w),()=>{window.removeEventListener("resize",D),window.removeEventListener("mousemove",b),i.current&&cancelAnimationFrame(i.current)}},[c]),e.jsxs("div",{ref:n,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:l,style:{display:"block",width:"100%",height:"100%"},children:e.jsx("style",{children:` path { fill: none; stroke: hsl(var(--primary) / 0.20); stroke-width: 1px; } - `})})]})}function O2(){const[l,n]=m.useState(""),[i,c]=m.useState(!1),[u,x]=m.useState(""),[h,f]=m.useState(!0),p=ia(),{enableWavesBackground:g,setEnableWavesBackground:N}=sv(),{theme:v,setTheme:y}=Vm();m.useEffect(()=>{(async()=>{try{await Qi()&&p({to:"/"})}catch{}finally{f(!1)}})()},[p]);const b=v==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":v,D=()=>{y(b==="dark"?"light":"dark")},A=async _=>{if(_.preventDefault(),x(""),!l.trim()){x("่ฏท่พ“ๅ…ฅ Access Token");return}c(!0),console.log("ๅผ€ๅง‹้ชŒ่ฏ token...");try{const P=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:l.trim()})});console.log("Token ้ชŒ่ฏๅ“ๅบ”็Šถๆ€:",P.status);const E=await P.json();if(console.log("Token ้ชŒ่ฏๅ“ๅบ”ๆ•ฐๆฎ:",E),P.ok&&E.valid){console.log("Token ้ชŒ่ฏๆˆๅŠŸ๏ผŒๅ‡†ๅค‡่ทณ่ฝฌ..."),console.log("is_first_setup:",E.is_first_setup),await new Promise(M=>setTimeout(M,100));const C=await Qi();console.log("่ทณ่ฝฌๅ‰่ฎค่ฏ็Šถๆ€ๆฃ€ๆŸฅ:",C),E.is_first_setup?(console.log("่ทณ่ฝฌๅˆฐ้ฆ–ๆฌก้…็ฝฎ้กต้ข"),p({to:"/setup"})):(console.log("่ทณ่ฝฌๅˆฐ้ฆ–้กต"),p({to:"/"}))}else console.error("Token ้ชŒ่ฏๅคฑ่ดฅ:",E.message),x(E.message||"Token ้ชŒ่ฏๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅๅŽ้‡่ฏ•")}catch(P){console.error("Token ้ชŒ่ฏ้”™่ฏฏ:",P),x("่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ็ฝ‘็ปœ่ฟžๆŽฅ")}finally{c(!1)}};return h?e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[g&&e.jsx(dg,{}),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:[g&&e.jsx(dg,{}),e.jsxs(Ce,{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:D,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:b==="dark"?"ๅˆ‡ๆขๅˆฐๆต…่‰ฒๆจกๅผ":"ๅˆ‡ๆขๅˆฐๆทฑ่‰ฒๆจกๅผ",children:b==="dark"?e.jsx(bj,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):e.jsx(yj,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),e.jsxs(Pe,{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(Xp,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(He,{className:"text-2xl font-bold",children:"ๆฌข่ฟŽไฝฟ็”จ MaiBot"}),e.jsx(As,{className:"text-base",children:"่ฏท่พ“ๅ…ฅๆ‚จ็š„ Access Token ไปฅ็ปง็ปญ่ฎฟ้—ฎ็ณป็ปŸ"})]})]}),e.jsx(Re,{children:e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),e.jsxs("div",{className:"relative",children:[e.jsx(Pm,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),e.jsx(ne,{id:"token",type:"password",placeholder:"่ฏท่พ“ๅ…ฅๆ‚จ็š„ Access Token",value:l,onChange:_=>n(_.target.value),className:H("pl-10",u&&"border-red-500 focus-visible:ring-red-500"),disabled:i,autoFocus:!0,autoComplete:"off"})]})]}),u&&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(St,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{children:u})]}),e.jsx(S,{type:"submit",className:"w-full",disabled:i,children:i?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(Ps,{children:[e.jsx(Ko,{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(wj,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"ๆˆ‘ๆฒกๆœ‰ Token๏ผŒๆˆ‘่ฏฅๅŽปๅ“ช้‡Œ่Žทๅพ— Token๏ผŸ"]})}),e.jsxs(Us,{className:"sm:max-w-md",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Xp,{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(Fw,{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(Sa,{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(St,{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(js,{children:[e.jsx(bt,{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(El,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"ๆˆ‘่ง‰ๅพ—่ฟ™ไธช็•Œ้ขๅพˆๅกๆ€ŽไนˆๅŠž๏ผŸ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsxs(xs,{className:"flex items-center gap-2",children:[e.jsx(El,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"ๅ…ณ้—ญ่ƒŒๆ™ฏๅŠจ็”ป"]}),e.jsx(hs,{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(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>N(!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:p2})})]})}const at=m.forwardRef(({className:l,...n},i)=>e.jsx("textarea",{className:H("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",l),ref:i,...n}));at.displayName="Textarea";const Kt=m.forwardRef(({className:l,orientation:n="horizontal",decorative:i=!0,...c},u)=>e.jsx(Gg,{ref:u,decorative:i,orientation:n,className:H("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",l),...c}));Kt.displayName=Gg.displayName;function R2({config:l,onChange:n}){const i=u=>{u.trim()&&!l.alias_names.includes(u.trim())&&n({...l,alias_names:[...l.alias_names,u.trim()]})},c=u=>{n({...l,alias_names:l.alias_names.filter((x,h)=>h!==u)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"qq_account",children:"QQ่ดฆๅท *"}),e.jsx(ne,{id:"qq_account",type:"number",placeholder:"่ฏท่พ“ๅ…ฅๆœบๅ™จไบบ็š„QQ่ดฆๅท",value:l.qq_account||"",onChange:u=>n({...l,qq_account:Number(u.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบ็™ปๅฝ•ไฝฟ็”จ็š„QQ่ดฆๅท"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"nickname",children:"ๆ˜ต็งฐ *"}),e.jsx(ne,{id:"nickname",placeholder:"่ฏท่พ“ๅ…ฅๆœบๅ™จไบบ็š„ๆ˜ต็งฐ",value:l.nickname,onChange:u=>n({...l,nickname:u.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบ็š„ไธป่ฆ็งฐๅ‘ผๅ็งฐ"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{children:"ๅˆซๅ"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:l.alias_names.map((u,x)=>e.jsxs(ke,{variant:"secondary",className:"gap-1",children:[u,e.jsx("button",{type:"button",onClick:()=>c(x),className:"ml-1 hover:text-destructive",children:e.jsx(Ca,{className:"h-3 w-3"})})]},x))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{id:"alias_input",placeholder:"่พ“ๅ…ฅๅˆซๅๅŽๆŒ‰ๅ›ž่ฝฆๆทปๅŠ ",onKeyPress:u=>{u.key==="Enter"&&(i(u.target.value),u.target.value="")}}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>{const u=document.getElementById("alias_input");u&&(i(u.value),u.value="")},children:"ๆทปๅŠ "})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบ็š„ๅ…ถไป–็งฐๅ‘ผ๏ผŒๅฏไปฅๆทปๅŠ ๅคšไธช"})]})]})}function L2({config:l,onChange:n}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"personality",children:"ไบบๆ ผ็‰นๅพ *"}),e.jsx(at,{id:"personality",placeholder:"ๆ่ฟฐๆœบๅ™จไบบ็š„ไบบๆ ผ็‰น่ดจๅ’Œ่บซไปฝ็‰นๅพ๏ผˆๅปบ่ฎฎ120ๅญ—ไปฅๅ†…๏ผ‰",value:l.personality,onChange:i=>n({...l,personality:i.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไพ‹ๅฆ‚๏ผšๆ˜ฏไธ€ไธชๅฅณๅคงๅญฆ็”Ÿ๏ผŒ็Žฐๅœจๅœจ่ฏปๅคงไบŒ๏ผŒไผšๅˆท่ดดๅง"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"reply_style",children:"่กจ่พพ้ฃŽๆ ผ *"}),e.jsx(at,{id:"reply_style",placeholder:"ๆ่ฟฐๆœบๅ™จไบบ่ฏด่ฏ็š„่กจ่พพ้ฃŽๆ ผใ€่กจ่พพไน ๆƒฏ",value:l.reply_style,onChange:i=>n({...l,reply_style:i.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไพ‹ๅฆ‚๏ผšๅ›žๅคๅนณๆทกไธ€ไบ›๏ผŒ็ฎ€็Ÿญไธ€ไบ›๏ผŒ่ฏดไธญๆ–‡๏ผŒๅ‚่€ƒ่ดดๅงใ€็ŸฅไนŽๅ’Œๅพฎๅš็š„ๅ›žๅค้ฃŽๆ ผ"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"interest",children:"ๅ…ด่ถฃ *"}),e.jsx(at,{id:"interest",placeholder:"ๆ่ฟฐๆœบๅ™จไบบๆ„Ÿๅ…ด่ถฃ็š„่ฏ้ข˜",value:l.interest,onChange:i=>n({...l,interest:i.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไผšๅฝฑๅ“ๆœบๅ™จไบบๅฏนไป€ไนˆ่ฏ้ข˜่ฟ›่กŒๅ›žๅค"})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"plan_style",children:"็พค่Š่ฏด่ฏ่ง„ๅˆ™ *"}),e.jsx(at,{id:"plan_style",placeholder:"ๆœบๅ™จไบบๅœจ็พค่Šไธญ็š„่กŒไธบ้ฃŽๆ ผๅ’Œ่ง„ๅˆ™",value:l.plan_style,onChange:i=>n({...l,plan_style:i.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฎšไน‰ๆœบๅ™จไบบๅœจ็พค่Šไธญๅฆ‚ไฝ•่กŒๅŠจ๏ผŒไพ‹ๅฆ‚ๅ›žๅค้ข‘็އใ€ๆกไปถ็ญ‰"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"private_plan_style",children:"็ง่Š่ฏด่ฏ่ง„ๅˆ™ *"}),e.jsx(at,{id:"private_plan_style",placeholder:"ๆœบๅ™จไบบๅœจ็ง่Šไธญ็š„่กŒไธบ้ฃŽๆ ผๅ’Œ่ง„ๅˆ™",value:l.private_plan_style,onChange:i=>n({...l,private_plan_style:i.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฎšไน‰ๆœบๅ™จไบบๅœจ็ง่Šไธญ็š„่กŒไธบๆ–นๅผ"})]})]})}function U2({config:l,onChange:n}){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(T,{htmlFor:"emoji_chance",children:"่กจๆƒ…ๅŒ…ๆฟ€ๆดปๆฆ‚็އ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(l.emoji_chance*100).toFixed(0),"%"]})]}),e.jsx(ne,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:l.emoji_chance,onChange:i=>n({...l,emoji_chance:Number(i.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบๅ‘้€่กจๆƒ…ๅŒ…็š„ๆฆ‚็އ"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"max_reg_num",children:"ๆœ€ๅคง่กจๆƒ…ๅŒ…ๆ•ฐ้‡"}),e.jsx(ne,{id:"max_reg_num",type:"number",min:"1",max:"200",value:l.max_reg_num,onChange:i=>n({...l,max_reg_num:Number(i.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(T,{htmlFor:"do_replace",children:"่พพๅˆฐๆœ€ๅคงๆ•ฐ้‡ๆ—ถๆ›ฟๆข"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅผ€ๅฏๅŽไผšๅˆ ้™คๆ—ง่กจๆƒ…ๅŒ…๏ผŒๅ…ณ้—ญๅˆ™ไธๅ†ๆ”ถ้›†ๆ–ฐ่กจๆƒ…ๅŒ…"})]}),e.jsx(Ve,{id:"do_replace",checked:l.do_replace,onCheckedChange:i=>n({...l,do_replace:i})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"check_interval",children:"ๆฃ€ๆŸฅ้—ด้š”๏ผˆๅˆ†้’Ÿ๏ผ‰"}),e.jsx(ne,{id:"check_interval",type:"number",min:"1",max:"120",value:l.check_interval,onChange:i=>n({...l,check_interval:Number(i.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆฃ€ๆŸฅ่กจๆƒ…ๅŒ…ๆณจๅ†Œใ€็ ดๆŸใ€ๅˆ ้™ค็š„ๆ—ถ้—ด้—ด้š”"})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"steal_emoji",children:"ๅทๅ–่กจๆƒ…ๅŒ…"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ…่ฎธๆœบๅ™จไบบๅฐ†ไธ€ไบ›่กจๆƒ…ๅŒ…ๆฎไธบๅทฑๆœ‰"})]}),e.jsx(Ve,{id:"steal_emoji",checked:l.steal_emoji,onCheckedChange:i=>n({...l,steal_emoji:i})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"content_filtration",children:"ๅฏ็”จ่กจๆƒ…ๅŒ…่ฟ‡ๆปค"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅชไฟๅญ˜็ฌฆๅˆ่ฆๆฑ‚็š„่กจๆƒ…ๅŒ…"})]}),e.jsx(Ve,{id:"content_filtration",checked:l.content_filtration,onCheckedChange:i=>n({...l,content_filtration:i})})]}),l.content_filtration&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"filtration_prompt",children:"่ฟ‡ๆปค่ฆๆฑ‚"}),e.jsx(ne,{id:"filtration_prompt",placeholder:"ไพ‹ๅฆ‚๏ผš็ฌฆๅˆๅ…ฌๅบ่‰ฏไฟ—",value:l.filtration_prompt,onChange:i=>n({...l,filtration_prompt:i.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ่ฟฐ่กจๆƒ…ๅŒ…ๅบ”่ฏฅ็ฌฆๅˆ็š„่ฆๆฑ‚"})]})]})}function B2({config:l,onChange:n}){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(T,{htmlFor:"enable_tool",children:"ๅฏ็”จๅทฅๅ…ท็ณป็ปŸ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ…่ฎธๆœบๅ™จไบบไฝฟ็”จๅ„็งๅทฅๅ…ทๅขžๅผบๅŠŸ่ƒฝ"})]}),e.jsx(Ve,{id:"enable_tool",checked:l.enable_tool,onCheckedChange:i=>n({...l,enable_tool:i})})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"all_global",children:"ๅฏ็”จๅ…จๅฑ€้ป‘่ฏๆจกๅผ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ…่ฎธๆœบๅ™จไบบๅญฆไน ๅ’Œไฝฟ็”จ็พค็ป„้ป‘่ฏ"})]}),e.jsx(Ve,{id:"all_global",checked:l.all_global,onCheckedChange:i=>n({...l,all_global:i})})]})]})}function $2({config:l,onChange:n}){const[i,c]=m.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(_o,{className:"h-3 w-3"})]})]})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{id:"siliconflow_api_key",type:i?"text":"password",placeholder:"sk-...",value:l.api_key,onChange:u=>n({api_key:u.target.value}),className:"font-mono pr-10"}),e.jsx(S,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>c(!i),children:i?e.jsx(qi,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(na,{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 I2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–Bot้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config.bot||{};return{qq_account:i.qq_account||0,nickname:i.nickname||"",alias_names:i.alias_names||[]}}async function P2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–ไบบๆ ผ้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config.personality||{};return{personality:i.personality||"",reply_style:i.reply_style||"",interest:i.interest||"",plan_style:i.plan_style||"",private_plan_style:i.private_plan_style||""}}async function H2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–่กจๆƒ…ๅŒ…้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config.emoji||{};return{emoji_chance:i.emoji_chance??.4,max_reg_num:i.max_reg_num??40,do_replace:i.do_replace??!0,check_interval:i.check_interval??10,steal_emoji:i.steal_emoji??!0,content_filtration:i.content_filtration??!1,filtration_prompt:i.filtration_prompt||""}}async function F2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–ๅ…ถไป–้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config,c=i.tool||{},u=i.expression||{};return{enable_tool:c.enable_tool??!0,all_global:u.all_global_jargon??!0}}async function G2(){const l=await we("/api/webui/config/model",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");return{api_key:((await l.json()).config.api_providers||[]).find(x=>x.name==="SiliconFlow")?.api_key||""}}async function V2(l){const n=await we("/api/webui/config/bot/section/bot",{method:"POST",headers:Fs(),body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ไฟๅญ˜BotๅŸบ็ก€้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function q2(l){const n=await we("/api/webui/config/bot/section/personality",{method:"POST",headers:Fs(),body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ไฟๅญ˜ไบบๆ ผ้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function K2(l){const n=await we("/api/webui/config/bot/section/emoji",{method:"POST",headers:Fs(),body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ไฟๅญ˜่กจๆƒ…ๅŒ…้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function Q2(l){const n=[];n.push(we("/api/webui/config/bot/section/tool",{method:"POST",headers:Fs(),body:JSON.stringify({enable_tool:l.enable_tool})})),n.push(we("/api/webui/config/bot/section/expression",{method:"POST",headers:Fs(),body:JSON.stringify({all_global_jargon:l.all_global})}));const i=await Promise.all(n);for(const c of i)if(!c.ok){const u=await c.json();throw new Error(u.detail||"ไฟๅญ˜ๅ…ถไป–้…็ฝฎๅคฑ่ดฅ")}return{success:!0}}async function Y2(l){const n=await we("/api/webui/config/model",{method:"GET",headers:Fs()});if(!n.ok)throw new Error("่ฏปๅ–ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const c=(await n.json()).config,u=c.api_providers||[],x=u.findIndex(p=>p.name==="SiliconFlow");x>=0?u[x]={...u[x],api_key:l.api_key}:u.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:l.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const h={...c,api_providers:u},f=await we("/api/webui/config/model",{method:"POST",headers:Fs(),body:JSON.stringify(h)});if(!f.ok){const p=await f.json();throw new Error(p.detail||"ไฟๅญ˜ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ")}return await f.json()}async function ug(){const l=await we("/api/webui/setup/complete",{method:"POST"});if(!l.ok){const n=await l.json();throw new Error(n.message||"ๆ ‡่ฎฐ้…็ฝฎๅฎŒๆˆๅคฑ่ดฅ")}return await l.json()}function J2(){return e.jsx(Vn,{children:e.jsx(X2,{})})}function X2(){const l=ia(),{toast:n}=st(),{triggerRestart:i}=fn(),[c,u]=m.useState(0),[x,h]=m.useState(!1),[f,p]=m.useState(!1),[g,N]=m.useState(!0),[v,y]=m.useState({qq_account:0,nickname:"",alias_names:[]}),[w,b]=m.useState({personality:"ๆ˜ฏไธ€ไธชๅฅณๅคงๅญฆ็”Ÿ๏ผŒ็Žฐๅœจๅœจ่ฏปๅคงไบŒ๏ผŒไผšๅˆท่ดดๅงใ€‚",reply_style:"่ฏทๅ›žๅค็š„ๅนณๆทกไธ€ไบ›๏ผŒ็ฎ€็Ÿญไธ€ไบ›๏ผŒ่ฏดไธญๆ–‡๏ผŒไธ่ฆๅˆปๆ„็ชๅ‡บ่‡ช่บซๅญฆ็ง‘่ƒŒๆ™ฏใ€‚ๅฏไปฅๅ‚่€ƒ่ดดๅง๏ผŒ็ŸฅไนŽๅ’Œๅพฎๅš็š„ๅ›žๅค้ฃŽๆ ผใ€‚",interest:"ๅฏนๆŠ€ๆœฏ็›ธๅ…ณ่ฏ้ข˜๏ผŒๆธธๆˆๅ’ŒๅŠจๆผซ็›ธๅ…ณ่ฏ้ข˜ๆ„Ÿๅ…ด่ถฃ๏ผŒไนŸๅฏนๆ—ฅๅธธ่ฏ้ข˜ๆ„Ÿๅ…ด่ถฃ๏ผŒไธๅ–œๆฌขๅคช่ฟ‡ๆฒ‰้‡ไธฅ่‚ƒ็š„่ฏ้ข˜",plan_style:`1.ๆ€่€ƒ**ๆ‰€ๆœ‰**็š„ๅฏ็”จ็š„actionไธญ็š„**ๆฏไธชๅŠจไฝœ**ๆ˜ฏๅฆ็ฌฆๅˆๅฝ“ไธ‹ๆกไปถ๏ผŒๅฆ‚ๆžœๅŠจไฝœไฝฟ็”จๆกไปถ็ฌฆๅˆ่Šๅคฉๅ†…ๅฎนๅฐฑไฝฟ็”จ + `})})]})}function O2(){const[l,n]=m.useState(""),[i,c]=m.useState(!1),[u,x]=m.useState(""),[h,f]=m.useState(!0),p=ia(),{enableWavesBackground:g,setEnableWavesBackground:N}=sv(),{theme:v,setTheme:y}=qm();m.useEffect(()=>{(async()=>{try{await Yi()&&p({to:"/"})}catch{}finally{f(!1)}})()},[p]);const b=v==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":v,D=()=>{y(b==="dark"?"light":"dark")},A=async _=>{if(_.preventDefault(),x(""),!l.trim()){x("่ฏท่พ“ๅ…ฅ Access Token");return}c(!0),console.log("ๅผ€ๅง‹้ชŒ่ฏ token...");try{const H=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:l.trim()})});console.log("Token ้ชŒ่ฏๅ“ๅบ”็Šถๆ€:",H.status);const E=await H.json();if(console.log("Token ้ชŒ่ฏๅ“ๅบ”ๆ•ฐๆฎ:",E),H.ok&&E.valid){console.log("Token ้ชŒ่ฏๆˆๅŠŸ๏ผŒๅ‡†ๅค‡่ทณ่ฝฌ..."),console.log("is_first_setup:",E.is_first_setup),await new Promise(M=>setTimeout(M,100));const C=await Yi();console.log("่ทณ่ฝฌๅ‰่ฎค่ฏ็Šถๆ€ๆฃ€ๆŸฅ:",C),E.is_first_setup?(console.log("่ทณ่ฝฌๅˆฐ้ฆ–ๆฌก้…็ฝฎ้กต้ข"),p({to:"/setup"})):(console.log("่ทณ่ฝฌๅˆฐ้ฆ–้กต"),p({to:"/"}))}else console.error("Token ้ชŒ่ฏๅคฑ่ดฅ:",E.message),x(E.message||"Token ้ชŒ่ฏๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅๅŽ้‡่ฏ•")}catch(H){console.error("Token ้ชŒ่ฏ้”™่ฏฏ:",H),x("่ฟžๆŽฅๆœๅŠกๅ™จๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ็ฝ‘็ปœ่ฟžๆŽฅ")}finally{c(!1)}};return h?e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[g&&e.jsx(ug,{}),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:[g&&e.jsx(ug,{}),e.jsxs(Ce,{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:D,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:b==="dark"?"ๅˆ‡ๆขๅˆฐๆต…่‰ฒๆจกๅผ":"ๅˆ‡ๆขๅˆฐๆทฑ่‰ฒๆจกๅผ",children:b==="dark"?e.jsx(yj,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):e.jsx(wj,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),e.jsxs(Pe,{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(Zp,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(He,{className:"text-2xl font-bold",children:"ๆฌข่ฟŽไฝฟ็”จ MaiBot"}),e.jsx(As,{className:"text-base",children:"่ฏท่พ“ๅ…ฅๆ‚จ็š„ Access Token ไปฅ็ปง็ปญ่ฎฟ้—ฎ็ณป็ปŸ"})]})]}),e.jsx(Re,{children:e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),e.jsxs("div",{className:"relative",children:[e.jsx(Hm,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),e.jsx(ne,{id:"token",type:"password",placeholder:"่ฏท่พ“ๅ…ฅๆ‚จ็š„ Access Token",value:l,onChange:_=>n(_.target.value),className:P("pl-10",u&&"border-red-500 focus-visible:ring-red-500"),disabled:i,autoFocus:!0,autoComplete:"off"})]})]}),u&&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(St,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{children:u})]}),e.jsx(S,{type:"submit",className:"w-full",disabled:i,children:i?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(Ps,{children:[e.jsx(Qo,{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(_j,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"ๆˆ‘ๆฒกๆœ‰ Token๏ผŒๆˆ‘่ฏฅๅŽปๅ“ช้‡Œ่Žทๅพ— Token๏ผŸ"]})}),e.jsxs(Us,{className:"sm:max-w-md",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Zp,{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(Fw,{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(Sa,{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(St,{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(js,{children:[e.jsx(bt,{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(El,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"ๆˆ‘่ง‰ๅพ—่ฟ™ไธช็•Œ้ขๅพˆๅกๆ€ŽไนˆๅŠž๏ผŸ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsxs(xs,{className:"flex items-center gap-2",children:[e.jsx(El,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"ๅ…ณ้—ญ่ƒŒๆ™ฏๅŠจ็”ป"]}),e.jsx(hs,{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(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>N(!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:p2})})]})}const at=m.forwardRef(({className:l,...n},i)=>e.jsx("textarea",{className:P("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",l),ref:i,...n}));at.displayName="Textarea";const Qt=m.forwardRef(({className:l,orientation:n="horizontal",decorative:i=!0,...c},u)=>e.jsx(Vg,{ref:u,decorative:i,orientation:n,className:P("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",l),...c}));Qt.displayName=Vg.displayName;function R2({config:l,onChange:n}){const i=u=>{u.trim()&&!l.alias_names.includes(u.trim())&&n({...l,alias_names:[...l.alias_names,u.trim()]})},c=u=>{n({...l,alias_names:l.alias_names.filter((x,h)=>h!==u)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"qq_account",children:"QQ่ดฆๅท *"}),e.jsx(ne,{id:"qq_account",type:"number",placeholder:"่ฏท่พ“ๅ…ฅๆœบๅ™จไบบ็š„QQ่ดฆๅท",value:l.qq_account||"",onChange:u=>n({...l,qq_account:Number(u.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบ็™ปๅฝ•ไฝฟ็”จ็š„QQ่ดฆๅท"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"nickname",children:"ๆ˜ต็งฐ *"}),e.jsx(ne,{id:"nickname",placeholder:"่ฏท่พ“ๅ…ฅๆœบๅ™จไบบ็š„ๆ˜ต็งฐ",value:l.nickname,onChange:u=>n({...l,nickname:u.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบ็š„ไธป่ฆ็งฐๅ‘ผๅ็งฐ"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{children:"ๅˆซๅ"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:l.alias_names.map((u,x)=>e.jsxs(ke,{variant:"secondary",className:"gap-1",children:[u,e.jsx("button",{type:"button",onClick:()=>c(x),className:"ml-1 hover:text-destructive",children:e.jsx(Ca,{className:"h-3 w-3"})})]},x))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{id:"alias_input",placeholder:"่พ“ๅ…ฅๅˆซๅๅŽๆŒ‰ๅ›ž่ฝฆๆทปๅŠ ",onKeyPress:u=>{u.key==="Enter"&&(i(u.target.value),u.target.value="")}}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>{const u=document.getElementById("alias_input");u&&(i(u.value),u.value="")},children:"ๆทปๅŠ "})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบ็š„ๅ…ถไป–็งฐๅ‘ผ๏ผŒๅฏไปฅๆทปๅŠ ๅคšไธช"})]})]})}function L2({config:l,onChange:n}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"personality",children:"ไบบๆ ผ็‰นๅพ *"}),e.jsx(at,{id:"personality",placeholder:"ๆ่ฟฐๆœบๅ™จไบบ็š„ไบบๆ ผ็‰น่ดจๅ’Œ่บซไปฝ็‰นๅพ๏ผˆๅปบ่ฎฎ120ๅญ—ไปฅๅ†…๏ผ‰",value:l.personality,onChange:i=>n({...l,personality:i.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไพ‹ๅฆ‚๏ผšๆ˜ฏไธ€ไธชๅฅณๅคงๅญฆ็”Ÿ๏ผŒ็Žฐๅœจๅœจ่ฏปๅคงไบŒ๏ผŒไผšๅˆท่ดดๅง"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"reply_style",children:"่กจ่พพ้ฃŽๆ ผ *"}),e.jsx(at,{id:"reply_style",placeholder:"ๆ่ฟฐๆœบๅ™จไบบ่ฏด่ฏ็š„่กจ่พพ้ฃŽๆ ผใ€่กจ่พพไน ๆƒฏ",value:l.reply_style,onChange:i=>n({...l,reply_style:i.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไพ‹ๅฆ‚๏ผšๅ›žๅคๅนณๆทกไธ€ไบ›๏ผŒ็ฎ€็Ÿญไธ€ไบ›๏ผŒ่ฏดไธญๆ–‡๏ผŒๅ‚่€ƒ่ดดๅงใ€็ŸฅไนŽๅ’Œๅพฎๅš็š„ๅ›žๅค้ฃŽๆ ผ"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"interest",children:"ๅ…ด่ถฃ *"}),e.jsx(at,{id:"interest",placeholder:"ๆ่ฟฐๆœบๅ™จไบบๆ„Ÿๅ…ด่ถฃ็š„่ฏ้ข˜",value:l.interest,onChange:i=>n({...l,interest:i.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไผšๅฝฑๅ“ๆœบๅ™จไบบๅฏนไป€ไนˆ่ฏ้ข˜่ฟ›่กŒๅ›žๅค"})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"plan_style",children:"็พค่Š่ฏด่ฏ่ง„ๅˆ™ *"}),e.jsx(at,{id:"plan_style",placeholder:"ๆœบๅ™จไบบๅœจ็พค่Šไธญ็š„่กŒไธบ้ฃŽๆ ผๅ’Œ่ง„ๅˆ™",value:l.plan_style,onChange:i=>n({...l,plan_style:i.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฎšไน‰ๆœบๅ™จไบบๅœจ็พค่Šไธญๅฆ‚ไฝ•่กŒๅŠจ๏ผŒไพ‹ๅฆ‚ๅ›žๅค้ข‘็އใ€ๆกไปถ็ญ‰"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"private_plan_style",children:"็ง่Š่ฏด่ฏ่ง„ๅˆ™ *"}),e.jsx(at,{id:"private_plan_style",placeholder:"ๆœบๅ™จไบบๅœจ็ง่Šไธญ็š„่กŒไธบ้ฃŽๆ ผๅ’Œ่ง„ๅˆ™",value:l.private_plan_style,onChange:i=>n({...l,private_plan_style:i.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฎšไน‰ๆœบๅ™จไบบๅœจ็ง่Šไธญ็š„่กŒไธบๆ–นๅผ"})]})]})}function U2({config:l,onChange:n}){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(T,{htmlFor:"emoji_chance",children:"่กจๆƒ…ๅŒ…ๆฟ€ๆดปๆฆ‚็އ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(l.emoji_chance*100).toFixed(0),"%"]})]}),e.jsx(ne,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:l.emoji_chance,onChange:i=>n({...l,emoji_chance:Number(i.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœบๅ™จไบบๅ‘้€่กจๆƒ…ๅŒ…็š„ๆฆ‚็އ"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"max_reg_num",children:"ๆœ€ๅคง่กจๆƒ…ๅŒ…ๆ•ฐ้‡"}),e.jsx(ne,{id:"max_reg_num",type:"number",min:"1",max:"200",value:l.max_reg_num,onChange:i=>n({...l,max_reg_num:Number(i.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(T,{htmlFor:"do_replace",children:"่พพๅˆฐๆœ€ๅคงๆ•ฐ้‡ๆ—ถๆ›ฟๆข"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅผ€ๅฏๅŽไผšๅˆ ้™คๆ—ง่กจๆƒ…ๅŒ…๏ผŒๅ…ณ้—ญๅˆ™ไธๅ†ๆ”ถ้›†ๆ–ฐ่กจๆƒ…ๅŒ…"})]}),e.jsx(Fe,{id:"do_replace",checked:l.do_replace,onCheckedChange:i=>n({...l,do_replace:i})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"check_interval",children:"ๆฃ€ๆŸฅ้—ด้š”๏ผˆๅˆ†้’Ÿ๏ผ‰"}),e.jsx(ne,{id:"check_interval",type:"number",min:"1",max:"120",value:l.check_interval,onChange:i=>n({...l,check_interval:Number(i.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆฃ€ๆŸฅ่กจๆƒ…ๅŒ…ๆณจๅ†Œใ€็ ดๆŸใ€ๅˆ ้™ค็š„ๆ—ถ้—ด้—ด้š”"})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"steal_emoji",children:"ๅทๅ–่กจๆƒ…ๅŒ…"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ…่ฎธๆœบๅ™จไบบๅฐ†ไธ€ไบ›่กจๆƒ…ๅŒ…ๆฎไธบๅทฑๆœ‰"})]}),e.jsx(Fe,{id:"steal_emoji",checked:l.steal_emoji,onCheckedChange:i=>n({...l,steal_emoji:i})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"content_filtration",children:"ๅฏ็”จ่กจๆƒ…ๅŒ…่ฟ‡ๆปค"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅชไฟๅญ˜็ฌฆๅˆ่ฆๆฑ‚็š„่กจๆƒ…ๅŒ…"})]}),e.jsx(Fe,{id:"content_filtration",checked:l.content_filtration,onCheckedChange:i=>n({...l,content_filtration:i})})]}),l.content_filtration&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"filtration_prompt",children:"่ฟ‡ๆปค่ฆๆฑ‚"}),e.jsx(ne,{id:"filtration_prompt",placeholder:"ไพ‹ๅฆ‚๏ผš็ฌฆๅˆๅ…ฌๅบ่‰ฏไฟ—",value:l.filtration_prompt,onChange:i=>n({...l,filtration_prompt:i.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ่ฟฐ่กจๆƒ…ๅŒ…ๅบ”่ฏฅ็ฌฆๅˆ็š„่ฆๆฑ‚"})]})]})}function B2({config:l,onChange:n}){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(T,{htmlFor:"enable_tool",children:"ๅฏ็”จๅทฅๅ…ท็ณป็ปŸ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ…่ฎธๆœบๅ™จไบบไฝฟ็”จๅ„็งๅทฅๅ…ทๅขžๅผบๅŠŸ่ƒฝ"})]}),e.jsx(Fe,{id:"enable_tool",checked:l.enable_tool,onCheckedChange:i=>n({...l,enable_tool:i})})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"all_global",children:"ๅฏ็”จๅ…จๅฑ€้ป‘่ฏๆจกๅผ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ…่ฎธๆœบๅ™จไบบๅญฆไน ๅ’Œไฝฟ็”จ็พค็ป„้ป‘่ฏ"})]}),e.jsx(Fe,{id:"all_global",checked:l.all_global,onCheckedChange:i=>n({...l,all_global:i})})]})]})}function $2({config:l,onChange:n}){const[i,c]=m.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(So,{className:"h-3 w-3"})]})]})]})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{id:"siliconflow_api_key",type:i?"text":"password",placeholder:"sk-...",value:l.api_key,onChange:u=>n({api_key:u.target.value}),className:"font-mono pr-10"}),e.jsx(S,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>c(!i),children:i?e.jsx(qi,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(na,{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 I2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–Bot้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config.bot||{};return{qq_account:i.qq_account||0,nickname:i.nickname||"",alias_names:i.alias_names||[]}}async function P2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–ไบบๆ ผ้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config.personality||{};return{personality:i.personality||"",reply_style:i.reply_style||"",interest:i.interest||"",plan_style:i.plan_style||"",private_plan_style:i.private_plan_style||""}}async function H2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–่กจๆƒ…ๅŒ…้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config.emoji||{};return{emoji_chance:i.emoji_chance??.4,max_reg_num:i.max_reg_num??40,do_replace:i.do_replace??!0,check_interval:i.check_interval??10,steal_emoji:i.steal_emoji??!0,content_filtration:i.content_filtration??!1,filtration_prompt:i.filtration_prompt||""}}async function F2(){const l=await we("/api/webui/config/bot",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–ๅ…ถไป–้…็ฝฎๅคฑ่ดฅ");const i=(await l.json()).config,c=i.tool||{},u=i.expression||{};return{enable_tool:c.enable_tool??!0,all_global:u.all_global_jargon??!0}}async function G2(){const l=await we("/api/webui/config/model",{method:"GET",headers:Fs()});if(!l.ok)throw new Error("่ฏปๅ–ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");return{api_key:((await l.json()).config.api_providers||[]).find(x=>x.name==="SiliconFlow")?.api_key||""}}async function V2(l){const n=await we("/api/webui/config/bot/section/bot",{method:"POST",headers:Fs(),body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ไฟๅญ˜BotๅŸบ็ก€้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function q2(l){const n=await we("/api/webui/config/bot/section/personality",{method:"POST",headers:Fs(),body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ไฟๅญ˜ไบบๆ ผ้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function K2(l){const n=await we("/api/webui/config/bot/section/emoji",{method:"POST",headers:Fs(),body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ไฟๅญ˜่กจๆƒ…ๅŒ…้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function Q2(l){const n=[];n.push(we("/api/webui/config/bot/section/tool",{method:"POST",headers:Fs(),body:JSON.stringify({enable_tool:l.enable_tool})})),n.push(we("/api/webui/config/bot/section/expression",{method:"POST",headers:Fs(),body:JSON.stringify({all_global_jargon:l.all_global})}));const i=await Promise.all(n);for(const c of i)if(!c.ok){const u=await c.json();throw new Error(u.detail||"ไฟๅญ˜ๅ…ถไป–้…็ฝฎๅคฑ่ดฅ")}return{success:!0}}async function Y2(l){const n=await we("/api/webui/config/model",{method:"GET",headers:Fs()});if(!n.ok)throw new Error("่ฏปๅ–ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const c=(await n.json()).config,u=c.api_providers||[],x=u.findIndex(p=>p.name==="SiliconFlow");x>=0?u[x]={...u[x],api_key:l.api_key}:u.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:l.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const h={...c,api_providers:u},f=await we("/api/webui/config/model",{method:"POST",headers:Fs(),body:JSON.stringify(h)});if(!f.ok){const p=await f.json();throw new Error(p.detail||"ไฟๅญ˜ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ")}return await f.json()}async function mg(){const l=await we("/api/webui/setup/complete",{method:"POST"});if(!l.ok){const n=await l.json();throw new Error(n.message||"ๆ ‡่ฎฐ้…็ฝฎๅฎŒๆˆๅคฑ่ดฅ")}return await l.json()}function J2(){return e.jsx(Vn,{children:e.jsx(X2,{})})}function X2(){const l=ia(),{toast:n}=st(),{triggerRestart:i}=fn(),[c,u]=m.useState(0),[x,h]=m.useState(!1),[f,p]=m.useState(!1),[g,N]=m.useState(!0),[v,y]=m.useState({qq_account:0,nickname:"",alias_names:[]}),[w,b]=m.useState({personality:"ๆ˜ฏไธ€ไธชๅฅณๅคงๅญฆ็”Ÿ๏ผŒ็Žฐๅœจๅœจ่ฏปๅคงไบŒ๏ผŒไผšๅˆท่ดดๅงใ€‚",reply_style:"่ฏทๅ›žๅค็š„ๅนณๆทกไธ€ไบ›๏ผŒ็ฎ€็Ÿญไธ€ไบ›๏ผŒ่ฏดไธญๆ–‡๏ผŒไธ่ฆๅˆปๆ„็ชๅ‡บ่‡ช่บซๅญฆ็ง‘่ƒŒๆ™ฏใ€‚ๅฏไปฅๅ‚่€ƒ่ดดๅง๏ผŒ็ŸฅไนŽๅ’Œๅพฎๅš็š„ๅ›žๅค้ฃŽๆ ผใ€‚",interest:"ๅฏนๆŠ€ๆœฏ็›ธๅ…ณ่ฏ้ข˜๏ผŒๆธธๆˆๅ’ŒๅŠจๆผซ็›ธๅ…ณ่ฏ้ข˜ๆ„Ÿๅ…ด่ถฃ๏ผŒไนŸๅฏนๆ—ฅๅธธ่ฏ้ข˜ๆ„Ÿๅ…ด่ถฃ๏ผŒไธๅ–œๆฌขๅคช่ฟ‡ๆฒ‰้‡ไธฅ่‚ƒ็š„่ฏ้ข˜",plan_style:`1.ๆ€่€ƒ**ๆ‰€ๆœ‰**็š„ๅฏ็”จ็š„actionไธญ็š„**ๆฏไธชๅŠจไฝœ**ๆ˜ฏๅฆ็ฌฆๅˆๅฝ“ไธ‹ๆกไปถ๏ผŒๅฆ‚ๆžœๅŠจไฝœไฝฟ็”จๆกไปถ็ฌฆๅˆ่Šๅคฉๅ†…ๅฎนๅฐฑไฝฟ็”จ 2.ๅฆ‚ๆžœ็›ธๅŒ็š„ๅ†…ๅฎนๅทฒ็ป่ขซๆ‰ง่กŒ๏ผŒ่ฏทไธ่ฆ้‡ๅคๆ‰ง่กŒ 3.่ฏทๆŽงๅˆถไฝ ็š„ๅ‘่จ€้ข‘็އ๏ผŒไธ่ฆๅคช่ฟ‡้ข‘็น็š„ๅ‘่จ€ 4.ๅฆ‚ๆžœๆœ‰ไบบๅฏนไฝ ๆ„ŸๅˆฐๅŽŒ็ƒฆ๏ผŒ่ฏทๅ‡ๅฐ‘ๅ›žๅค 5.ๅฆ‚ๆžœๆœ‰ไบบๅฏนไฝ ่ฟ›่กŒๆ”ปๅ‡ป๏ผŒๆˆ–่€…ๆƒ…็ปชๆฟ€ๅŠจ๏ผŒ่ฏทไฝ ไปฅๅˆ้€‚็š„ๆ–นๆณ•ๅบ”ๅฏน`,private_plan_style:`1.ๆ€่€ƒ**ๆ‰€ๆœ‰**็š„ๅฏ็”จ็š„actionไธญ็š„**ๆฏไธชๅŠจไฝœ**ๆ˜ฏๅฆ็ฌฆๅˆๅฝ“ไธ‹ๆกไปถ๏ผŒๅฆ‚ๆžœๅŠจไฝœไฝฟ็”จๆกไปถ็ฌฆๅˆ่Šๅคฉๅ†…ๅฎนๅฐฑไฝฟ็”จ 2.ๅฆ‚ๆžœ็›ธๅŒ็š„ๅ†…ๅฎนๅทฒ็ป่ขซๆ‰ง่กŒ๏ผŒ่ฏทไธ่ฆ้‡ๅคๆ‰ง่กŒ -3.ๆŸๅฅ่ฏๅฆ‚ๆžœๅทฒ็ป่ขซๅ›žๅค่ฟ‡๏ผŒไธ่ฆ้‡ๅคๅ›žๅค`}),[D,A]=m.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"็ฌฆๅˆๅ…ฌๅบ่‰ฏไฟ—"}),[_,P]=m.useState({enable_tool:!0,all_global:!0}),[E,C]=m.useState({api_key:""}),M=[{id:"bot-basic",title:"BotๅŸบ็ก€",description:"้…็ฝฎๆœบๅ™จไบบ็š„ๅŸบๆœฌไฟกๆฏ",icon:Bi},{id:"personality",title:"ไบบๆ ผ้…็ฝฎ",description:"ๅฎšไน‰ๆœบๅ™จไบบ็š„ๆ€งๆ ผๅ’Œ่ฏด่ฏ้ฃŽๆ ผ",icon:Bn},{id:"emoji",title:"่กจๆƒ…ๅŒ…",description:"้…็ฝฎ่กจๆƒ…ๅŒ…็›ธๅ…ณ่ฎพ็ฝฎ",icon:Hm},{id:"other",title:"ๅ…ถไป–่ฎพ็ฝฎ",description:"ๅทฅๅ…ทใ€ๆƒ…็ปช็ณป็ปŸ็ญ‰้…็ฝฎ",icon:mn},{id:"siliconflow",title:"API้…็ฝฎ",description:"้…็ฝฎ็ก…ๅŸบๆตๅŠจAPIๅฏ†้’ฅ",icon:Pm}],G=(c+1)/M.length*100;m.useEffect(()=>{(async()=>{try{N(!0);const[ge,fe,z,Q,$]=await Promise.all([I2(),P2(),H2(),F2(),G2()]);y(ge),b(fe),A(z),P(Q),C($)}catch(ge){n({title:"ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ",description:ge instanceof Error?ge.message:"ๆ— ๆณ•ๅŠ ่ฝฝ็Žฐๆœ‰้…็ฝฎ๏ผŒๅฐ†ไฝฟ็”จ้ป˜่ฎคๅ€ผ",variant:"destructive"})}finally{N(!1)}})()},[n]);const O=async()=>{p(!0);try{switch(c){case 0:await V2(v);break;case 1:await q2(w);break;case 2:await K2(D);break;case 3:await Q2(_);break;case 4:await Y2(E);break}return n({title:"ไฟๅญ˜ๆˆๅŠŸ",description:`${M[c].title}้…็ฝฎๅทฒไฟๅญ˜`}),!0}catch(se){return n({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"}),!1}finally{p(!1)}},ee=async()=>{await O()&&c{c>0&&u(c-1)},me=async()=>{h(!0);try{if(!await O()){h(!1);return}await ug(),n({title:"้…็ฝฎๅฎŒๆˆ",description:"้บฆ้บฆๆญฃๅœจ้‡ๅฏไปฅๅบ”็”จๆ–ฐ้…็ฝฎ..."}),await i()}catch(se){n({title:"้…็ฝฎๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{h(!1)}},ce=async()=>{try{await ug(),l({to:"/"})}catch(se){n({title:"่ทณ่ฟ‡ๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},ve=()=>{switch(c){case 0:return e.jsx(R2,{config:v,onChange:y});case 1:return e.jsx(L2,{config:w,onChange:b});case 2:return e.jsx(U2,{config:D,onChange:A});case 3:return e.jsx(B2,{config:_,onChange:P});case 4:return e.jsx($2,{config:E,onChange:C});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:[e.jsx(qn,{}),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"})]}),g?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(Gw,{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:["่ฎฉๆˆ‘ไปฌไธ€่ตทๅฎŒๆˆ ",qm," ็š„ๅˆๅง‹้…็ฝฎ"]})]}),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," / ",M.length]}),e.jsxs("span",{className:"font-medium text-primary",children:[Math.round(G),"%"]})]}),e.jsx(Fn,{value:G,className:"h-2"})]}),e.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:M.map((se,ge)=>{const fe=se.icon;return e.jsxs("div",{className:H("flex flex-1 flex-col items-center gap-1 md:gap-2",gel({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[e.jsx(Fo,{className:"h-4 w-4"}),"่ฟ”ๅ›ž้ฆ–้กต"]}),e.jsxs(S,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[e.jsx(ka,{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 Z2=zs.memo(function({config:n,onChange:i}){const c=n.platforms||[],u=n.alias_names||[],x=()=>{i({...n,platforms:[...c,""]})},h=v=>{i({...n,platforms:c.filter((y,w)=>w!==v)})},f=(v,y)=>{const w=[...c];w[v]=y,i({...n,platforms:w})},p=()=>{i({...n,alias_names:[...u,""]})},g=v=>{i({...n,alias_names:u.filter((y,w)=>w!==v)})},N=(v,y)=>{const w=[...u];w[v]=y,i({...n,alias_names:w})};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(T,{htmlFor:"platform",children:"ๅนณๅฐ"}),e.jsx(ne,{id:"platform",value:n.platform,onChange:v=>i({...n,platform:v.target.value}),placeholder:"qq"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"qq_account",children:"QQ่ดฆๅท"}),e.jsx(ne,{id:"qq_account",value:n.qq_account,onChange:v=>i({...n,qq_account:v.target.value}),placeholder:"123456789"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"nickname",children:"ๆ˜ต็งฐ"}),e.jsx(ne,{id:"nickname",value:n.nickname,onChange:v=>i({...n,nickname:v.target.value}),placeholder:"้บฆ้บฆ"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๅ…ถไป–ๅนณๅฐ่ดฆๅท"}),e.jsxs(S,{onClick:x,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ "]})]}),e.jsxs("div",{className:"space-y-2",children:[c.map((v,y)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:v,onChange:w=>f(y,w.target.value),placeholder:"wx:114514"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๅนณๅฐ่ดฆๅท "',v||"(็ฉบ)",'" ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>h(y),children:"ๅˆ ้™ค"})]})]})]})]},y)),c.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(T,{children:"ๅˆซๅ"}),e.jsxs(S,{onClick:p,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ "]})]}),e.jsxs("div",{className:"space-y-2",children:[u.map((v,y)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:v,onChange:w=>N(y,w.target.value),placeholder:"ๅฐ้บฆ"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๅˆซๅ "',v||"(็ฉบ)",'" ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>g(y),children:"ๅˆ ้™ค"})]})]})]})]},y)),u.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆš‚ๆ— ๅˆซๅ"})]})]})]})]})})}),W2=zs.memo(function({config:n,onChange:i}){const c=()=>{i({...n,states:[...n.states,""]})},u=h=>{i({...n,states:n.states.filter((f,p)=>p!==h)})},x=(h,f)=>{const p=[...n.states];p[h]=f,i({...n,states:p})};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(T,{htmlFor:"personality",children:"ไบบๆ ผ็‰น่ดจ"}),e.jsx(at,{id:"personality",value:n.personality,onChange:h=>i({...n,personality:h.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(T,{htmlFor:"reply_style",children:"่กจ่พพ้ฃŽๆ ผ"}),e.jsx(at,{id:"reply_style",value:n.reply_style,onChange:h=>i({...n,reply_style:h.target.value}),placeholder:"ๆ่ฟฐ่ฏด่ฏ็š„่กจ่พพ้ฃŽๆ ผๅ’Œไน ๆƒฏ",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"interest",children:"ๅ…ด่ถฃ"}),e.jsx(at,{id:"interest",value:n.interest,onChange:h=>i({...n,interest:h.target.value}),placeholder:"ไผšๅฝฑๅ“้บฆ้บฆๅฏนไป€ไนˆ่ฏ้ข˜่ฟ›่กŒๅ›žๅค",rows:2})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"plan_style",children:"่ฏด่ฏ่ง„ๅˆ™ไธŽ่กŒไธบ้ฃŽๆ ผ"}),e.jsx(at,{id:"plan_style",value:n.plan_style,onChange:h=>i({...n,plan_style:h.target.value}),placeholder:"้บฆ้บฆ็š„่ฏด่ฏ่ง„ๅˆ™ๅ’Œ่กŒไธบ้ฃŽๆ ผ",rows:5})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"visual_style",children:"่ฏ†ๅ›พ่ง„ๅˆ™"}),e.jsx(at,{id:"visual_style",value:n.visual_style,onChange:h=>i({...n,visual_style:h.target.value}),placeholder:"่ฏ†ๅ›พๆ—ถ็š„ๅค„็†่ง„ๅˆ™",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"private_plan_style",children:"็ง่Š่ง„ๅˆ™"}),e.jsx(at,{id:"private_plan_style",value:n.private_plan_style,onChange:h=>i({...n,private_plan_style:h.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(T,{children:"็Šถๆ€ๅˆ—่กจ๏ผˆไบบๆ ผๅคšๆ ทๆ€ง๏ผ‰"}),e.jsxs(S,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ็Šถๆ€"]})]}),e.jsx("div",{className:"space-y-2",children:n.states.map((h,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(at,{value:h,onChange:p=>x(f,p.target.value),placeholder:"ๆ่ฟฐไธ€ไธชไบบๆ ผ็Šถๆ€",rows:2}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsx(hs,{children:"็กฎๅฎš่ฆๅˆ ้™ค่ฟ™ไธชไบบๆ ผ็Šถๆ€ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>u(f),children:"ๅˆ ้™ค"})]})]})]})]},f))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"state_probability",children:"็Šถๆ€ๆ›ฟๆขๆฆ‚็އ"}),e.jsx(ne,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:n.state_probability,onChange:h=>i({...n,state_probability:parseFloat(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆฏๆฌกๆž„ๅปบไบบๆ ผๆ—ถๆ›ฟๆข personality ็š„ๆฆ‚็އ๏ผˆ0.0-1.0๏ผ‰"})]})]})]})})}),Be=Sw,$e=kw,Le=m.forwardRef(({className:l,children:n,...i},c)=>e.jsxs(lj,{ref:c,className:H("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",l),...i,children:[n,e.jsx(Nw,{asChild:!0,children:e.jsx(Ta,{className:"h-4 w-4 opacity-50"})})]}));Le.displayName=lj.displayName;const rv=m.forwardRef(({className:l,...n},i)=>e.jsx(nj,{ref:i,className:H("flex cursor-default items-center justify-center py-1",l),...n,children:e.jsx($r,{className:"h-4 w-4"})}));rv.displayName=nj.displayName;const iv=m.forwardRef(({className:l,...n},i)=>e.jsx(rj,{ref:i,className:H("flex cursor-default items-center justify-center py-1",l),...n,children:e.jsx(Ta,{className:"h-4 w-4"})}));iv.displayName=rj.displayName;const Ue=m.forwardRef(({className:l,children:n,position:i="popper",...c},u)=>e.jsx(bw,{children:e.jsxs(ij,{ref:u,className:H("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]",i==="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",l),position:i,...c,children:[e.jsx(rv,{}),e.jsx(yw,{className:H("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),e.jsx(iv,{})]})}));Ue.displayName=ij.displayName;const e_=m.forwardRef(({className:l,...n},i)=>e.jsx(cj,{ref:i,className:H("px-2 py-1.5 text-sm font-semibold",l),...n}));e_.displayName=cj.displayName;const W=m.forwardRef(({className:l,children:n,...i},c)=>e.jsxs(oj,{ref:c,className:H("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",l),...i,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ww,{children:e.jsx(_t,{className:"h-4 w-4"})})}),e.jsx(_w,{children:n})]}));W.displayName=oj.displayName;const s_=m.forwardRef(({className:l,...n},i)=>e.jsx(dj,{ref:i,className:H("-mx-1 my-1 h-px bg-muted",l),...n}));s_.displayName=dj.displayName;const nl=B0,rl=$0,Ja=m.forwardRef(({className:l,align:n="center",sideOffset:i=4,...c},u)=>e.jsx(U0,{children:e.jsx(Vg,{ref:u,align:n,sideOffset:i,className:H("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]",l),...c})}));Ja.displayName=Vg.displayName;const t_=zs.memo(function({value:n,onChange:i}){const c=m.useMemo(()=>{const w=n.split("-");if(w.length===2){const[b,D]=w,[A,_]=b.split(":"),[P,E]=D.split(":");return{startHour:A?A.padStart(2,"0"):"00",startMinute:_?_.padStart(2,"0"):"00",endHour:P?P.padStart(2,"0"):"23",endMinute:E?E.padStart(2,"0"):"59"}}return{startHour:"00",startMinute:"00",endHour:"23",endMinute:"59"}},[n]),[u,x]=m.useState(c.startHour),[h,f]=m.useState(c.startMinute),[p,g]=m.useState(c.endHour),[N,v]=m.useState(c.endMinute);m.useEffect(()=>{x(c.startHour),f(c.startMinute),g(c.endHour),v(c.endMinute)},[c]);const y=(w,b,D,A)=>{const _=`${w}:${b}-${D}:${A}`;i(_)};return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[e.jsx(Ya,{className:"h-4 w-4 mr-2"}),n||"้€‰ๆ‹ฉๆ—ถ้—ดๆฎต"]})}),e.jsx(Ja,{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(T,{className:"text-xs",children:"ๅฐๆ—ถ"}),e.jsxs(Be,{value:u,onValueChange:w=>{x(w),y(w,h,p,N)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:24},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs",children:"ๅˆ†้’Ÿ"}),e.jsxs(Be,{value:h,onValueChange:w=>{f(w),y(u,w,p,N)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:60},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]})]})]}),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(T,{className:"text-xs",children:"ๅฐๆ—ถ"}),e.jsxs(Be,{value:p,onValueChange:w=>{g(w),y(u,h,w,N)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:24},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs",children:"ๅˆ†้’Ÿ"}),e.jsxs(Be,{value:N,onValueChange:w=>{v(w),y(u,h,p,w)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:60},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]})]})]})]})})]})}),a_=zs.memo(function({rule:n}){const i=`{ target = "${n.target}", time = "${n.time}", value = ${n.value.toFixed(1)} }`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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:i}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ๆ˜ฏไฟๅญ˜ๅˆฐ bot_config.toml ๆ–‡ไปถไธญ็š„ๆ ผๅผ"})]})})]})}),l_=zs.memo(function({config:n,onChange:i}){const c=()=>{i({...n,talk_value_rules:[...n.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},u=h=>{i({...n,talk_value_rules:n.talk_value_rules.filter((f,p)=>p!==h)})},x=(h,f,p)=>{const g=[...n.talk_value_rules];g[h]={...g[h],[f]:p},i({...n,talk_value_rules:g})};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(T,{htmlFor:"talk_value",children:"่Šๅคฉ้ข‘็އ๏ผˆๅŸบ็ก€ๅ€ผ๏ผ‰"}),e.jsx(ne,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:n.talk_value,onChange:h=>i({...n,talk_value:parseFloat(h.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:h=>i({...n,mentioned_bot_reply:h})}),e.jsx(T,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"ๅฏ็”จๆๅŠๅฟ…ๅ›žๅค"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_context_size",children:"ไธŠไธ‹ๆ–‡้•ฟๅบฆ"}),e.jsx(ne,{id:"max_context_size",type:"number",min:"1",value:n.max_context_size,onChange:h=>i({...n,max_context_size:parseInt(h.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"planner_smooth",children:"่ง„ๅˆ’ๅ™จๅนณๆป‘"}),e.jsx(ne,{id:"planner_smooth",type:"number",step:"1",min:"0",value:n.planner_smooth,onChange:h=>i({...n,planner_smooth:parseFloat(h.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:h=>i({...n,enable_talk_value_rules:h})}),e.jsx(T,{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:h=>i({...n,include_planner_reasoning:h})}),e.jsx(T,{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(S,{onClick:c,size:"sm",children:[e.jsx(Zs,{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((h,f)=>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:["่ง„ๅˆ™ #",f+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a_,{rule:h}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",children:e.jsx(ns,{className:"h-4 w-4 text-destructive"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค่ง„ๅˆ™ #",f+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>u(f),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"้…็ฝฎ็ฑปๅž‹"}),e.jsxs(Be,{value:h.target===""?"global":"specific",onValueChange:p=>{p==="global"?x(f,"target",""):x(f,"target","qq::group")},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"global",children:"ๅ…จๅฑ€้…็ฝฎ"}),e.jsx(W,{value:"specific",children:"่ฏฆ็ป†้…็ฝฎ"})]})]})]}),h.target!==""&&(()=>{const p=h.target.split(":"),g=p[0]||"qq",N=p[1]||"",v=p[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(T,{className:"text-xs font-medium",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:g,onValueChange:y=>{x(f,"target",`${y}:${N}:${v}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็พค ID"}),e.jsx(ne,{value:N,onChange:y=>{x(f,"target",`${g}:${y.target.value}:${v}`)},placeholder:"่พ“ๅ…ฅ็พค ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็ฑปๅž‹"}),e.jsxs(Be,{value:v,onValueChange:y=>{x(f,"target",`${g}:${N}:${y}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"group",children:"็พค็ป„๏ผˆgroup๏ผ‰"}),e.jsx(W,{value:"private",children:"็ง่Š๏ผˆprivate๏ผ‰"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉๆต ID๏ผš",h.target||"๏ผˆๆœช่ฎพ็ฝฎ๏ผ‰"]})]})})(),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"ๆ—ถ้—ดๆฎต (Time)"}),e.jsx(t_,{value:h.time,onChange:p=>x(f,"time",p)}),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(T,{htmlFor:`rule-value-${f}`,className:"text-xs font-medium",children:"ๅ‘่จ€้ข‘็އๅ€ผ (Value)"}),e.jsx(ne,{id:`rule-value-${f}`,type:"number",step:"0.01",min:"0.01",max:"1",value:h.value,onChange:p=>{const g=parseFloat(p.target.value);isNaN(g)||x(f,"value",Math.max(.01,Math.min(1,g)))},className:"w-20 h-8 text-xs"})]}),e.jsx(_a,{value:[h.value],onValueChange:p=>x(f,"value",p[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 (ๆญฃๅธธ)"})]})]})]})]},f))}):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 ่กจ็คบๆญฃๅธธๅ‘่จ€"]})]})]})]})]})}),n_=zs.memo(function({config:n,onChange:i}){const c=_=>{if(!_||!_.includes(":"))return{platform:"qq",userId:""};const[P,E]=_.split(":");return{platform:P,userId:E}},{platform:u,userId:x}=c(n.dream_send),[h,f]=m.useState(u),[p,g]=m.useState(x),N=_=>{const[P,E]=_.split("-");return{startTime:P||"09:00",endTime:E||"22:00"}},v=(_,P)=>{const E=P?`${_}:${P}`:"";i({...n,dream_send:E})},y=_=>{f(_),v(_,p)},w=_=>{g(_),v(h,_)},b=()=>{i({...n,dream_time_ranges:[...n.dream_time_ranges,"09:00-22:00"]})},D=_=>{i({...n,dream_time_ranges:n.dream_time_ranges.filter((P,E)=>E!==_)})},A=(_,P,E)=>{const C=[...n.dream_time_ranges],M=N(C[_]);P==="startTime"?M.startTime=E:M.endTime=E,C[_]=`${M.startTime}-${M.endTime}`,i({...n,dream_time_ranges:C})};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"ๅšๆขฆ้…็ฝฎ"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"interval_minutes",children:"ๅšๆขฆๆ—ถ้—ด้—ด้š”๏ผˆๅˆ†้’Ÿ๏ผ‰"}),e.jsx(ne,{id:"interval_minutes",type:"number",min:"1",value:n.interval_minutes,onChange:_=>i({...n,interval_minutes:Number(_.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค30ๅˆ†้’Ÿ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"max_iterations",children:"ๅšๆขฆๆœ€ๅคง่ฝฎๆฌก"}),e.jsx(ne,{id:"max_iterations",type:"number",min:"1",value:n.max_iterations,onChange:_=>i({...n,max_iterations:Number(_.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค20่ฝฎ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"first_delay_seconds",children:"้ฆ–ๆฌกๅšๆขฆๅปถ่ฟŸ๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"first_delay_seconds",type:"number",min:"0",value:n.first_delay_seconds,onChange:_=>i({...n,first_delay_seconds:Number(_.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"็จ‹ๅบๅฏๅŠจๅŽ้ฆ–ๆฌกๅšๆขฆๅ‰็š„ๅปถ่ฟŸๆ—ถ้—ด๏ผŒ้ป˜่ฎค60็ง’"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๅšๆขฆ็ป“ๆžœๆŽจ้€็›ฎๆ ‡"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Be,{value:h,onValueChange:y,children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅนณๅฐ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"}),e.jsx(W,{value:"webui",children:"WebUI"})]})]}),e.jsx(ne,{type:"text",placeholder:"่พ“ๅ…ฅ็”จๆˆทID (ไพ‹ๅฆ‚: 123456)",value:p,onChange:_=>w(_.target.value),className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้€‰ๆ‹ฉๅนณๅฐๅนถ่พ“ๅ…ฅ็”จๆˆทID๏ผŒๅšๆขฆ็ป“ๆŸๅŽๅฐ†ๆขฆๅขƒๅ‘้€็ป™่ฏฅ็”จๆˆทใ€‚็”จๆˆทIDไธบ็ฉบๅˆ™ไธๆŽจ้€"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๅšๆขฆๆ—ถ้—ดๆฎต้…็ฝฎ"}),e.jsx(S,{type:"button",size:"sm",onClick:b,children:"ๆทปๅŠ ๆ—ถ้—ดๆฎต"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฎพ็ฝฎๅ…่ฎธๅšๆขฆ็š„ๆ—ถ้—ดๆฎต๏ผŒๆ”ฏๆŒ่ทจๅคœๅŒบ้—ด๏ผˆๅฆ‚ 23:00 ๅˆฐๆฌกๆ—ฅ 02:00๏ผ‰ใ€‚ๅˆ—่กจไธบ็ฉบๅˆ™ๅ…จๅคฉๅ…่ฎธๅšๆขฆ"}),e.jsxs("div",{className:"space-y-2",children:[n.dream_time_ranges.map((_,P)=>{const{startTime:E,endTime:C}=N(_);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{type:"time",value:E,onChange:M=>A(P,"startTime",M.target.value),className:"w-[140px]"}),e.jsx("span",{className:"text-muted-foreground",children:"่‡ณ"}),e.jsx(ne,{type:"time",value:C,onChange:M=>A(P,"endTime",M.target.value),className:"w-[140px]"}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",onClick:()=>D(P),children:e.jsx(Ca,{className:"h-4 w-4"})})]},P)}),n.dream_time_ranges.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅฝ“ๅ‰้…็ฝฎไธบๅ…จๅคฉๅ…่ฎธๅšๆขฆ"})]})]})]})}),r_=zs.memo(function({config:n,onChange:i}){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(Ve,{checked:n.enable,onCheckedChange:c=>i({...n,enable:c})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ LPMM ็Ÿฅ่ฏ†ๅบ“"})]}),n.enable&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"LPMM ๆจกๅผ"}),e.jsxs(Be,{value:n.lpmm_mode,onValueChange:c=>i({...n,lpmm_mode:c}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ LPMM ๆจกๅผ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"classic",children:"็ปๅ…ธๆจกๅผ"}),e.jsx(W,{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(T,{children:"ๅŒไน‰่ฏๆœ็ดข TopK"}),e.jsx(ne,{type:"number",min:"1",value:n.rag_synonym_search_top_k,onChange:c=>i({...n,rag_synonym_search_top_k:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅŒไน‰่ฏ้˜ˆๅ€ผ"}),e.jsx(ne,{type:"number",step:"0.1",min:"0",max:"1",value:n.rag_synonym_threshold,onChange:c=>i({...n,rag_synonym_threshold:parseFloat(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅฎžไฝ“ๆๅ–็บฟ็จ‹ๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",value:n.info_extraction_workers,onChange:c=>i({...n,info_extraction_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅตŒๅ…ฅๅ‘้‡็ปดๅบฆ"}),e.jsx(ne,{type:"number",min:"1",value:n.embedding_dimension,onChange:c=>i({...n,embedding_dimension:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅตŒๅ…ฅๅนถๅ‘็บฟ็จ‹ๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",value:n.max_embedding_workers,onChange:c=>i({...n,max_embedding_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆฏๆ‰นๅตŒๅ…ฅๆกๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",value:n.embedding_chunk_size,onChange:c=>i({...n,embedding_chunk_size:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅŒไน‰ๅฎžไฝ“ๆ•ฐไธŠ้™"}),e.jsx(ne,{type:"number",min:"1",value:n.max_synonym_entities,onChange:c=>i({...n,max_synonym_entities:parseInt(c.target.value)})})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.enable_ppr,onCheckedChange:c=>i({...n,enable_ppr:c})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ PPR (ไฝŽ้…ๆœบๅ™จๅฏๅ…ณ้—ญ)"})]})]})]})]})}),i_=zs.memo(function({config:n,onChange:i}){const[c,u]=m.useState(""),[x,h]=m.useState("WARNING"),f=()=>{c&&!n.suppress_libraries.includes(c)&&(i({...n,suppress_libraries:[...n.suppress_libraries,c]}),u(""))},p=b=>{i({...n,suppress_libraries:n.suppress_libraries.filter(D=>D!==b)})},g=()=>{c&&!n.library_log_levels[c]&&(i({...n,library_log_levels:{...n.library_log_levels,[c]:x}}),u(""),h("WARNING"))},N=b=>{const D={...n.library_log_levels};delete D[b],i({...n,library_log_levels:D})},v=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],y=["FULL","compact","lite"],w=["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(T,{children:"ๆ—ฅๆœŸๆ ผๅผ"}),e.jsx(ne,{value:n.date_style,onChange:b=>i({...n,date_style:b.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(T,{children:"ๆ—ฅๅฟ—็บงๅˆซๆ ทๅผ"}),e.jsxs(Be,{value:n.log_level_style,onValueChange:b=>i({...n,log_level_style:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:y.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆ—ฅๅฟ—ๆ–‡ๆœฌ้ขœ่‰ฒ"}),e.jsxs(Be,{value:n.color_text,onValueChange:b=>i({...n,color_text:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:w.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅ…จๅฑ€ๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs(Be,{value:n.log_level,onValueChange:b=>i({...n,log_level:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆŽงๅˆถๅฐๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs(Be,{value:n.console_log_level,onValueChange:b=>i({...n,console_log_level:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆ–‡ไปถๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs(Be,{value:n.file_log_level,onValueChange:b=>i({...n,file_log_level:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]})]})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"mb-2 block",children:"ๅฎŒๅ…จๅฑ่”ฝ็š„ๅบ“"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:c,onChange:b=>u(b.target.value),placeholder:"่พ“ๅ…ฅๅบ“ๅ",className:"flex-1",onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),f())}}),e.jsx(S,{onClick:f,size:"sm",className:"flex-shrink-0",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.suppress_libraries.map(b=>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:b}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>p(b),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},b))})]}),e.jsxs("div",{children:[e.jsx(T,{className:"mb-2 block",children:"็‰นๅฎšๅบ“็š„ๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:c,onChange:b=>u(b.target.value),placeholder:"่พ“ๅ…ฅๅบ“ๅ",className:"flex-1"}),e.jsxs(Be,{value:x,onValueChange:h,children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]}),e.jsx(S,{onClick:g,size:"sm",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(n.library_log_levels).map(([b,D])=>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:b}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:D}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>N(b),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},b))})]})]})}),c_=zs.memo(function({config:n,onChange:i}){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(T,{children:"ๆ˜พ็คบ Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๅœจๆ—ฅๅฟ—ไธญๆ˜พ็คบๆ็คบ่ฏ"})]}),e.jsx(Ve,{checked:n.show_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบๅ›žๅคๅ™จ Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบๅ›žๅคๅ™จ็š„ๆ็คบ่ฏ"})]}),e.jsx(Ve,{checked:n.show_replyer_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบๅ›žๅคๅ™จๆŽจ็†"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบๅ›žๅคๅ™จ็š„ๆŽจ็†่ฟ‡็จ‹"})]}),e.jsx(Ve,{checked:n.show_replyer_reasoning,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ Jargon Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบๆœฏ่ฏญ็›ธๅ…ณ็š„ๆ็คบ่ฏ"})]}),e.jsx(Ve,{checked:n.show_jargon_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ่ฎฐๅฟ†ๆฃ€็ดข Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบ่ฎฐๅฟ†ๆฃ€็ดข็›ธๅ…ณ็š„ๆ็คบ่ฏ"})]}),e.jsx(Ve,{checked:n.show_memory_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ Planner Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบ Planner ็š„ๆ็คบ่ฏๅ’ŒๅŽŸๅง‹่ฟ”ๅ›ž็ป“ๆžœ"})]}),e.jsx(Ve,{checked:n.show_planner_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ LPMM ็›ธๅ…ณๆ–‡ๆฎต"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบ LPMM ็Ÿฅ่ฏ†ๅบ“ๆ‰พๅˆฐ็š„็›ธๅ…ณๆ–‡ๆฎตๆ—ฅๅฟ—"})]}),e.jsx(Ve,{checked:n.show_lpmm_paragraph,onCheckedChange:c=>i({...n,show_lpmm_paragraph:c})})]})]})]})}),o_=zs.memo(function({config:n,onChange:i}){const[c,u]=m.useState(""),[x,h]=m.useState(""),f=()=>{c&&!n.auth_token.includes(c)&&(i({...n,auth_token:[...n.auth_token,c]}),u(""))},p=v=>{i({...n,auth_token:n.auth_token.filter((y,w)=>w!==v)})},g=()=>{x&&!n.api_server_allowed_api_keys.includes(x)&&(i({...n,api_server_allowed_api_keys:[...n.api_server_allowed_api_keys,x]}),h(""))},N=v=>{i({...n,api_server_allowed_api_keys:n.api_server_allowed_api_keys.filter((y,w)=>w!==v)})};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-2",children:"ๆ—ง็‰ˆ API ่ฎค่ฏไปค็‰Œ"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"็”จไบŽๆ—ง็‰ˆ API ้ชŒ่ฏ๏ผŒไธบ็ฉบๅˆ™ไธๅฏ็”จ้ชŒ่ฏ"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:c,onChange:v=>u(v.target.value),placeholder:"่พ“ๅ…ฅ่ฎค่ฏไปค็‰Œ",onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),f())}}),e.jsx(S,{onClick:f,size:"sm",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.auth_token.map((v,y)=>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:v}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>p(y),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},y))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"ๆ–ฐ็‰ˆ API Server ้…็ฝฎ"}),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(T,{children:"ๅฏ็”จๆ–ฐ็‰ˆ API Server"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๅฏ็”จ้ขๅค–็š„ๆ–ฐ็‰ˆ API Server๏ผˆ้ขๅค–็›‘ๅฌ็ซฏๅฃ๏ผ‰"})]}),e.jsx(Ve,{checked:n.enable_api_server,onCheckedChange:v=>i({...n,enable_api_server:v})})]}),n.enable_api_server&&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(T,{children:"ไธปๆœบๅœฐๅ€"}),e.jsx(ne,{value:n.api_server_host,onChange:v=>i({...n,api_server_host:v.target.value}),placeholder:"0.0.0.0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"็ซฏๅฃๅท"}),e.jsx(ne,{type:"number",value:n.api_server_port,onChange:v=>i({...n,api_server_port:parseInt(v.target.value)}),placeholder:"8090"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.api_server_use_wss,onCheckedChange:v=>i({...n,api_server_use_wss:v})}),e.jsx(T,{children:"ๅฏ็”จ WSS ๅฎ‰ๅ…จ่ฟžๆŽฅ"})]}),n.api_server_use_wss&&e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"SSL ่ฏไนฆๆ–‡ไปถ่ทฏๅพ„"}),e.jsx(ne,{value:n.api_server_cert_file,onChange:v=>i({...n,api_server_cert_file:v.target.value}),placeholder:"cert.pem"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"SSL ๅฏ†้’ฅๆ–‡ไปถ่ทฏๅพ„"}),e.jsx(ne,{value:n.api_server_key_file,onChange:v=>i({...n,api_server_key_file:v.target.value}),placeholder:"key.pem"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"mb-2 block",children:"ๅ…่ฎธ็š„ API Key ๅˆ—่กจ"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"ไธบ็ฉบๅˆ™ๅ…่ฎธๆ‰€ๆœ‰่ฟžๆŽฅ"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:x,onChange:v=>h(v.target.value),placeholder:"่พ“ๅ…ฅ API Key",onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),g())}}),e.jsx(S,{onClick:g,size:"sm",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.api_server_allowed_api_keys.map((v,y)=>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:v}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>N(y),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},y))})]})]})]})]})]})}),d_=zs.memo(function({config:n,onChange:i}){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(T,{children:"ๅฏ็”จ็ปŸ่ฎกไฟกๆฏๅ‘้€"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅ‘้€ๅŒฟๅ็ปŸ่ฎกไฟกๆฏ๏ผŒๅธฎๅŠฉๆˆ‘ไปฌไบ†่งฃๅ…จ็ƒๆœ‰ๅคšๅฐ‘ๅช้บฆ้บฆๅœจ่ฟ่กŒ"})]}),e.jsx(Ve,{checked:n.enable,onCheckedChange:c=>i({...n,enable:c})})]})]})}),u_=zs.memo(function({emojiConfig:n,memoryConfig:i,toolConfig:c,voiceConfig:u,onEmojiChange:x,onMemoryChange:h,onToolChange:f,onVoiceChange:p}){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:"space-y-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_tool",checked:c.enable_tool,onCheckedChange:g=>f({...c,enable_tool:g})}),e.jsx(T,{htmlFor:"enable_tool",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 pt-2",children:[e.jsx(Ve,{id:"enable_asr",checked:u.enable_asr,onCheckedChange:g=>p({...u,enable_asr:g})}),e.jsx(T,{htmlFor:"enable_asr",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-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_agent_iterations",children:"่ฎฐๅฟ†ๆ€่€ƒๆทฑๅบฆ"}),e.jsx(ne,{id:"max_agent_iterations",type:"number",min:"1",value:i.max_agent_iterations,onChange:g=>h({...i,max_agent_iterations:parseInt(g.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœ€ไฝŽไธบ 1๏ผˆไธๆทฑๅ…ฅๆ€่€ƒ๏ผ‰"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"agent_timeout_seconds",children:"ๆœ€้•ฟๅ›žๅฟ†ๆ—ถ้—ด๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"agent_timeout_seconds",type:"number",min:"1",step:"0.1",value:i.agent_timeout_seconds??120,onChange:g=>h({...i,agent_timeout_seconds:parseFloat(g.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_jargon_detection",checked:i.enable_jargon_detection??!0,onCheckedChange:g=>h({...i,enable_jargon_detection:g})}),e.jsx(T,{htmlFor:"enable_jargon_detection",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:"global_memory",checked:i.global_memory??!1,onCheckedChange:g=>h({...i,global_memory:g})}),e.jsx(T,{htmlFor:"global_memory",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-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"emoji_chance",children:"่กจๆƒ…ๅŒ…ๆฟ€ๆดปๆฆ‚็އ"}),e.jsx(ne,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:n.emoji_chance,onChange:g=>x({...n,emoji_chance:parseFloat(g.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่Œƒๅ›ด 0-1๏ผŒ่ถŠๅคง่ถŠๅฎนๆ˜“ๅ‘้€่กจๆƒ…ๅŒ…"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_reg_num",children:"ๆœ€ๅคงๆณจๅ†Œๆ•ฐ้‡"}),e.jsx(ne,{id:"max_reg_num",type:"number",min:"1",value:n.max_reg_num,onChange:g=>x({...n,max_reg_num:parseInt(g.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆๆœ€ๅคšๅฏไปฅๆณจๅ†Œ็š„่กจๆƒ…ๅŒ…ๆ•ฐ้‡"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"check_interval",children:"ๆฃ€ๆŸฅ้—ด้š”๏ผˆๅˆ†้’Ÿ๏ผ‰"}),e.jsx(ne,{id:"check_interval",type:"number",min:"1",value:n.check_interval,onChange:g=>x({...n,check_interval:parseInt(g.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:g=>x({...n,do_replace:g})}),e.jsx(T,{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:g=>x({...n,steal_emoji:g})}),e.jsx(T,{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:g=>x({...n,content_filtration:g})}),e.jsx(T,{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(T,{htmlFor:"filtration_prompt",children:"่ฟ‡ๆปค่ฆๆฑ‚"}),e.jsx(ne,{id:"filtration_prompt",value:n.filtration_prompt,onChange:g=>x({...n,filtration_prompt:g.target.value}),placeholder:"็ฌฆๅˆๅ…ฌๅบ่‰ฏไฟ—"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅชๆœ‰็ฌฆๅˆๆญค่ฆๆฑ‚็š„่กจๆƒ…ๅŒ…ๆ‰ไผš่ขซไฟๅญ˜"})]})]})]})})]})}),m_=zs.memo(function({member:n,groupIndex:i,memberIndex:c,availableChatIds:u,onUpdate:x,onRemove:h}){const f=u.includes(n)||n==="*",[p,g]=m.useState(!f);return e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 flex gap-2",children:p?e.jsxs(e.Fragment,{children:[e.jsx(ne,{value:n,onChange:N=>x(i,c,N.target.value),placeholder:'่พ“ๅ…ฅ "*" ๆˆ– "qq:123456:group"',className:"flex-1"}),u.length>0&&e.jsx(S,{size:"sm",variant:"outline",onClick:()=>g(!1),title:"ๅˆ‡ๆขๅˆฐไธ‹ๆ‹‰้€‰ๆ‹ฉ",children:"ไธ‹ๆ‹‰"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{value:n,onValueChange:N=>x(i,c,N),children:[e.jsx(Le,{className:"flex-1",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ่Šๅคฉๆต"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"*",children:"* (ๅ…จๅฑ€ๅ…ฑไบซ)"}),u.map((N,v)=>e.jsx(W,{value:N,children:N},v))]})]}),e.jsx(S,{size:"sm",variant:"outline",onClick:()=>g(!0),title:"ๅˆ‡ๆขๅˆฐๆ‰‹ๅŠจ่พ“ๅ…ฅ",children:"่พ“ๅ…ฅ"})]})}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™ค็ป„ๆˆๅ‘˜ "',n||"(็ฉบ)",'" ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>h(i,c),children:"ๅˆ ้™ค"})]})]})]})]})}),x_=zs.memo(function({config:n,onChange:i}){const c=()=>{i({...n,learning_list:[...n.learning_list,["","enable","enable","1.0"]]})},u=y=>{i({...n,learning_list:n.learning_list.filter((w,b)=>b!==y)})},x=(y,w,b)=>{const D=[...n.learning_list];D[y][w]=b,i({...n,learning_list:D})},h=({rule:y})=>{const w=`["${y[0]}", "${y[1]}", "${y[2]}", "${y[3]}"]`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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:w}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ๆ˜ฏไฟๅญ˜ๅˆฐ bot_config.toml ๆ–‡ไปถไธญ็š„ๆ ผๅผ"})]})})]})},f=()=>{i({...n,expression_groups:[...n.expression_groups,[]]})},p=y=>{i({...n,expression_groups:n.expression_groups.filter((w,b)=>b!==y)})},g=y=>{const w=[...n.expression_groups];w[y]=[...w[y],""],i({...n,expression_groups:w})},N=(y,w)=>{const b=[...n.expression_groups];b[y]=b[y].filter((D,A)=>A!==w),i({...n,expression_groups:b})},v=(y,w,b)=>{const D=[...n.expression_groups];D[y][w]=b,i({...n,expression_groups:D})};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(S,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ่ง„ๅˆ™"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.learning_list.map((y,w)=>{const b=n.learning_list.some((C,M)=>M!==w&&C[0]===""),D=y[0]==="",A=y[0].split(":"),_=A[0]||"qq",P=A[1]||"",E=A[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:["่ง„ๅˆ™ ",w+1," ",D&&"๏ผˆๅ…จๅฑ€้…็ฝฎ๏ผ‰"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{rule:y}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๅญฆไน ่ง„ๅˆ™ ",w+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>u(w),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"้…็ฝฎ็ฑปๅž‹"}),e.jsxs(Be,{value:D?"global":"specific",onValueChange:C=>{C==="global"?x(w,0,""):x(w,0,"qq::group")},disabled:b&&!D,children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"global",children:"ๅ…จๅฑ€้…็ฝฎ"}),e.jsx(W,{value:"specific",disabled:b&&!D,children:"่ฏฆ็ป†้…็ฝฎ"})]})]}),b&&!D&&e.jsx("p",{className:"text-xs text-amber-600",children:"ๅทฒๅญ˜ๅœจๅ…จๅฑ€้…็ฝฎ๏ผŒๆ— ๆณ•ๅˆ›ๅปบๆ–ฐ็š„ๅ…จๅฑ€้…็ฝฎ"})]}),!D&&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(T,{className:"text-xs font-medium",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:_,onValueChange:C=>{x(w,0,`${C}:${P}:${E}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็พค ID"}),e.jsx(ne,{value:P,onChange:C=>{x(w,0,`${_}:${C.target.value}:${E}`)},placeholder:"่พ“ๅ…ฅ็พค ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็ฑปๅž‹"}),e.jsxs(Be,{value:E,onValueChange:C=>{x(w,0,`${_}:${P}:${C}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"group",children:"็พค็ป„๏ผˆgroup๏ผ‰"}),e.jsx(W,{value:"private",children:"็ง่Š๏ผˆprivate๏ผ‰"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉๆต ID๏ผš",y[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(T,{className:"text-xs font-medium",children:"ไฝฟ็”จๅญฆๅˆฐ็š„่กจ่พพ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๅ…่ฎธ้บฆ้บฆไฝฟ็”จไปŽ่Šๅคฉไธญๅญฆๅˆฐ็š„่กจ่พพๆ–นๅผ"})]}),e.jsx(Ve,{checked:y[1]==="enable",onCheckedChange:C=>x(w,1,C?"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(T,{className:"text-xs font-medium",children:"ๅญฆไน ่กจ่พพ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๅ…่ฎธ้บฆ้บฆไปŽ่Šๅคฉไธญๅญฆไน ๆ–ฐ็š„่กจ่พพๆ–นๅผ"})]}),e.jsx(Ve,{checked:y[2]==="enable",onCheckedChange:C=>x(w,2,C?"enable":"disable")})]})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-xs font-medium",children:"ๅญฆไน ๅผบๅบฆ"}),e.jsx(ne,{type:"number",step:"0.1",min:"0",max:"5",value:y[3],onChange:C=>{const M=parseFloat(C.target.value);isNaN(M)||x(w,3,Math.max(0,Math.min(5,M)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),e.jsx(_a,{value:[parseFloat(y[3])||1],onValueChange:C=>x(w,3,C[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/ๅญฆไน ๅผบๅบฆ๏ผˆ็ง’๏ผ‰"})]})]})]},w)}),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",{className:"space-y-6",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("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"expression_self_reflect",className:"cursor-pointer font-medium",children:"่‡ชๅŠจ่กจ่พพไผ˜ๅŒ–"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆไผš่‡ชๅŠจๆฃ€ๆŸฅๅนถไผ˜ๅŒ–่กจ่พพๆ–นๅผ๏ผŒๆ— ้œ€็ฎก็†ๅ‘˜ๆ‰‹ๅŠจๅนฒ้ข„"})]}),e.jsx(Ve,{id:"expression_self_reflect",checked:n.expression_self_reflect??!1,onCheckedChange:y=>i({...n,expression_self_reflect:y})})]}),n.expression_self_reflect&&e.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"expression_auto_check_interval",children:"่‡ชๅŠจๆฃ€ๆŸฅ้—ด้š”๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"expression_auto_check_interval",type:"number",min:"60",value:n.expression_auto_check_interval??3600,onChange:y=>i({...n,expression_auto_check_interval:parseInt(y.target.value)||3600})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค 3600 ็ง’๏ผˆ1ๅฐๆ—ถ๏ผ‰ใ€‚่ฎพ็ฝฎ้บฆ้บฆๅคšไน…ๆ‰ง่กŒไธ€ๆฌก่‡ชๅŠจ่กจ่พพๆฃ€ๆŸฅ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"expression_auto_check_count",children:"ๆฏๆฌกๆฃ€ๆŸฅๆ•ฐ้‡"}),e.jsx(ne,{id:"expression_auto_check_count",type:"number",min:"1",max:"100",value:n.expression_auto_check_count??10,onChange:y=>i({...n,expression_auto_check_count:parseInt(y.target.value)||10})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค 10 ๆกใ€‚ๆฏๆฌก่‡ชๅŠจๆฃ€ๆŸฅๆ—ถ้šๆœบ้€‰ๅ–็š„่กจ่พพๆ–นๅผๆ•ฐ้‡"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"่‡ชๅฎšไน‰่ฏ„ไผฐๆ ‡ๅ‡†"}),e.jsxs(S,{onClick:()=>{i({...n,expression_auto_check_custom_criteria:[...n.expression_auto_check_custom_criteria||[],""]})},size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๆ ‡ๅ‡†"]})]}),e.jsxs("div",{className:"space-y-2",children:[(n.expression_auto_check_custom_criteria||[]).map((y,w)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:y,onChange:b=>{const D=[...n.expression_auto_check_custom_criteria||[]];D[w]=b.target.value,i({...n,expression_auto_check_custom_criteria:D})},placeholder:"่พ“ๅ…ฅ่ฏ„ไผฐๆ ‡ๅ‡†๏ผŒไพ‹ๅฆ‚๏ผšๆ˜ฏๅฆ็ฌฆๅˆ่ง’่‰ฒไบบ่ฎพ",className:"flex-1"}),e.jsx(S,{onClick:()=>{i({...n,expression_auto_check_custom_criteria:(n.expression_auto_check_custom_criteria||[]).filter((b,D)=>D!==w)})},size:"icon",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},w)),(!n.expression_auto_check_custom_criteria||n.expression_auto_check_custom_criteria.length===0)&&e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:'ๆš‚ๆ— ่‡ชๅฎšไน‰ๆ ‡ๅ‡†๏ผŒ็‚นๅ‡ป"ๆทปๅŠ ๆ ‡ๅ‡†"ๅผ€ๅง‹้…็ฝฎ'})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ไบ›ๆ ‡ๅ‡†ไผš่ขซๆทปๅŠ ๅˆฐ่ฏ„ไผฐๆ็คบ่ฏไธญ๏ผŒไฝœไธบ้ขๅค–็š„่ฏ„ไผฐ่ฆๆฑ‚"})]})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"expression_checked_only",className:"cursor-pointer font-medium",children:"ไป…ไฝฟ็”จๅทฒๆฃ€ๆŸฅ็š„่กจ่พพๆ–นๅผ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅผ€ๅฏๅŽ๏ผŒๅชๆœ‰ checked=True ไธ” rejected=False ็š„่กจ่พพๆ–นๅผๆ‰ไผš่ขซ้€‰ๆ‹ฉไฝฟ็”จใ€‚ๅ…ณ้—ญๅŽ๏ผŒๅชๆŽ’้™ค rejected=True ็š„่กจ่พพๆ–นๅผ"})]}),e.jsx(Ve,{id:"expression_checked_only",checked:n.expression_checked_only??!1,onCheckedChange:y=>i({...n,expression_checked_only:y})})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"expression_manual_reflect",className:"cursor-pointer font-medium",children:"ๆ‰‹ๅŠจ่กจ่พพไผ˜ๅŒ–"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆไผšไธปๅŠจๅ‘็ฎก็†ๅ‘˜่ฏข้—ฎ่กจ่พพๆ–นๅผๆ˜ฏๅฆๅˆ้€‚"})]}),e.jsx(Ve,{id:"expression_manual_reflect",checked:n.expression_manual_reflect??!1,onCheckedChange:y=>i({...n,expression_manual_reflect:y})})]}),n.expression_manual_reflect&&e.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-primary/20",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 w=(n.manual_reflect_operator_id||"").split(":"),b=w[0]||"qq",D=w[1]||"",A=w[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(T,{className:"text-xs font-medium",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:b,onValueChange:_=>{i({...n,manual_reflect_operator_id:`${_}:${D}:${A}`})},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็”จๆˆท/็พค ID"}),e.jsx(ne,{value:D,onChange:_=>{i({...n,manual_reflect_operator_id:`${b}:${_.target.value}:${A}`})},placeholder:"่พ“ๅ…ฅ ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็ฑปๅž‹"}),e.jsxs(Be,{value:A,onValueChange:_=>{i({...n,manual_reflect_operator_id:`${b}:${D}:${_}`})},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"private",children:"็ง่Š๏ผˆprivate๏ผ‰"}),e.jsx(W,{value:"group",children:"็พค็ป„๏ผˆgroup๏ผ‰"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๅฝ“ๅ‰ๆ“ไฝœๅ‘˜ ID๏ผš",n.manual_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(S,{onClick:()=>{i({...n,allow_reflect:[...n.allow_reflect||[],"qq::group"]})},size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ่Šๅคฉๆต"]})]}),e.jsxs("div",{className:"space-y-2",children:[(n.allow_reflect||[]).map((y,w)=>{const b=y.split(":"),D=b[0]||"qq",A=b[1]||"",_=b[2]||"group";return e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50",children:[e.jsxs(Be,{value:D,onValueChange:P=>{const E=[...n.allow_reflect];E[w]=`${P}:${A}:${_}`,i({...n,allow_reflect:E})},children:[e.jsx(Le,{className:"w-24",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]}),e.jsx(ne,{value:A,onChange:P=>{const E=[...n.allow_reflect];E[w]=`${D}:${P.target.value}:${_}`,i({...n,allow_reflect:E})},placeholder:"ID",className:"flex-1 font-mono text-sm"}),e.jsxs(Be,{value:_,onValueChange:P=>{const E=[...n.allow_reflect];E[w]=`${D}:${A}:${P}`,i({...n,allow_reflect:E})},children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"group",children:"็พค็ป„"}),e.jsx(W,{value:"private",children:"็ง่Š"})]})]}),e.jsx(S,{onClick:()=>{i({...n,allow_reflect:n.allow_reflect.filter((P,E)=>E!==w)})},size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},w)}),(!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(S,{onClick:f,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๅ…ฑไบซ็ป„"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.expression_groups.map((y,w)=>{const b=n.learning_list.map(D=>D[0]).filter(D=>D!=="");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:["ๅ…ฑไบซ็ป„ ",w+1,y.length===1&&y[0]==="*"&&"๏ผˆๅ…จๅฑ€ๅ…ฑไบซ๏ผ‰"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{onClick:()=>g(w),size:"sm",variant:"outline",children:e.jsx(Zs,{className:"h-4 w-4"})}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๅ…ฑไบซ็ป„ ",w+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>p(w),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsx("div",{className:"space-y-2",children:y.map((D,A)=>e.jsx(m_,{member:D,groupIndex:w,memberIndex:A,availableChatIds:b,onUpdate:v,onRemove:N},`${w}-${A}`))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'ๆ็คบ๏ผšๅฏไปฅไปŽไธ‹ๆ‹‰ๆก†้€‰ๆ‹ฉๅทฒ้…็ฝฎ็š„่Šๅคฉๆต๏ผŒๆˆ–ๆ‰‹ๅŠจ่พ“ๅ…ฅใ€‚่พ“ๅ…ฅ "*" ๅฏ็”จๅ…จๅฑ€ๅ…ฑไบซ'})]},w)}),n.expression_groups.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-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"้ป‘่ฏ่ฎพ็ฝฎ"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"all_global_jargon",checked:n.all_global_jargon??!1,onCheckedChange:y=>i({...n,all_global_jargon:y})}),e.jsx(T,{htmlFor:"all_global_jargon",className:"cursor-pointer",children:"ๅ…จๅฑ€้ป‘่ฏๆจกๅผ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"ๅผ€ๅฏๅŽ๏ผŒๆ–ฐๅขž็š„้ป‘่ฏๅฐ†้ป˜่ฎค่ฎพไธบๅ…จๅฑ€๏ผˆๆ‰€ๆœ‰่Šๅคฉๆตๅ…ฑไบซ๏ผ‰ใ€‚ๅ…ณ้—ญๅŽ๏ผŒๅทฒ่ฎฐๅฝ•็š„ๅ…จๅฑ€้ป‘่ฏไธไผšๆ”นๅ˜๏ผŒ้œ€่ฆๆ‰‹ๅŠจๅˆ ้™คใ€‚"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"enable_jargon_explanation",checked:n.enable_jargon_explanation??!0,onCheckedChange:y=>i({...n,enable_jargon_explanation:y})}),e.jsx(T,{htmlFor:"enable_jargon_explanation",className:"cursor-pointer",children:"ๅฏ็”จ้ป‘่ฏ่งฃ้‡Š"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"ๅœจๅ›žๅคๅ‰ๅฐ่ฏ•ๅฏนไธŠไธ‹ๆ–‡ไธญ็š„้ป‘่ฏ่ฟ›่กŒ่งฃ้‡Šใ€‚ๅ…ณ้—ญๅฏๅ‡ๅฐ‘ไธ€ๆฌกLLM่ฐƒ็”จ๏ผŒไป…ๅฝฑๅ“ๅ›žๅคๅ‰็š„้ป‘่ฏๅŒน้…ไธŽ่งฃ้‡Š๏ผŒไธๅฝฑๅ“้ป‘่ฏๅญฆไน ใ€‚"})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"jargon_mode",children:"้ป‘่ฏ่งฃ้‡Šๆฅๆบๆจกๅผ"}),e.jsxs(Be,{value:n.jargon_mode??"context",onValueChange:y=>i({...n,jargon_mode:y}),children:[e.jsx(Le,{id:"jargon_mode",className:"mt-2",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ้ป‘่ฏ่งฃ้‡Šๆฅๆบ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"context",children:"ไธŠไธ‹ๆ–‡ๆจกๅผ๏ผˆ่‡ชๅŠจๅŒน้…้ป‘่ฏ๏ผ‰"}),e.jsx(W,{value:"planner",children:"Plannerๆจกๅผ๏ผˆไฝฟ็”จunknown_wordsๅˆ—่กจ๏ผ‰"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["ไธŠไธ‹ๆ–‡ๆจกๅผ๏ผšไฝฟ็”จไธŠไธ‹ๆ–‡่‡ชๅŠจๅŒน้…้ป‘่ฏๅนถ่งฃ้‡Š",e.jsx("br",{}),"Plannerๆจกๅผ๏ผšไป…ไฝฟ็”จPlannerๅœจreplyๅŠจไฝœไธญ็ป™ๅ‡บ็š„unknown_wordsๅˆ—่กจ่ฟ›่กŒ้ป‘่ฏๆฃ€็ดข"]})]})]})]})});function h_({regex:l,reaction:n,onRegexChange:i,onReactionChange:c}){const[u,x]=m.useState(!1),[h,f]=m.useState(""),[p,g]=m.useState(null),[N,v]=m.useState(""),[y,w]=m.useState({}),[b,D]=m.useState(""),A=m.useRef(null),[_,P]=m.useState("build"),E=O=>O.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),C=(O,ee=0)=>{const R=A.current;if(!R)return;const me=R.selectionStart||0,ce=R.selectionEnd||0,ve=l.substring(0,me)+O+l.substring(ce);i(ve),setTimeout(()=>{const se=me+O.length+ee;R.setSelectionRange(se,se),R.focus()},0)};m.useEffect(()=>{if(!l||!h){p!==null&&g(null),Object.keys(y).length>0&&w({}),b!==n&&D(n),N!==""&&v("");return}try{const O=E(l),ee=new RegExp(O,"g"),R=h.match(ee);g(R),v("");const ce=new RegExp(O).exec(h);if(ce&&ce.groups){w(ce.groups);let ve=n;Object.entries(ce.groups).forEach(([se,ge])=>{ve=ve.replace(new RegExp(`\\[${se}\\]`,"g"),ge||"")}),D(ve)}else w({}),D(n)}catch(O){v(O.message),g(null),w({}),D(n)}},[l,h,n,p,y,b,N]);const M=()=>{if(!h||!p||p.length===0)return e.jsx("span",{className:"text-muted-foreground",children:h||"่ฏท่พ“ๅ…ฅๆต‹่ฏ•ๆ–‡ๆœฌ"});try{const O=E(l),ee=new RegExp(O,"g");let R=0;const me=[];let ce;for(;(ce=ee.exec(h))!==null;)ce.index>R&&me.push(e.jsx("span",{children:h.substring(R,ce.index)},`text-${R}`)),me.push(e.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:ce[0]},`match-${ce.index}`)),R=ce.index+ce[0].length;return R)",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(Ps,{open:u,onOpenChange:x,children:[e.jsx(Ko,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(Fm,{className:"h-4 w-4 mr-1"}),"ๆญฃๅˆ™็ผ–่พ‘ๅ™จ"]})}),e.jsxs(Us,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ๆญฃๅˆ™่กจ่พพๅผ็ผ–่พ‘ๅ™จ"}),e.jsx(Ys,{className:"text-sm",children:"ไฝฟ็”จๅฏ่ง†ๅŒ–ๅทฅๅ…ทๆž„ๅปบๆญฃๅˆ™่กจ่พพๅผ๏ผŒๅนถๅฎžๆ—ถๆต‹่ฏ•ๆ•ˆๆžœ"})]}),e.jsx(Je,{className:"max-h-[calc(90vh-120px)]",children:e.jsxs(ra,{value:_,onValueChange:O=>P(O),className:"w-full",children:[e.jsxs(Wt,{className:"grid w-full grid-cols-2",children:[e.jsx(ts,{value:"build",children:"๐Ÿ”ง ๆž„ๅปบๅ™จ"}),e.jsx(ts,{value:"test",children:"๐Ÿงช ๆต‹่ฏ•ๅ™จ"})]}),e.jsxs(bs,{value:"build",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๆญฃๅˆ™่กจ่พพๅผ"}),e.jsx(ne,{ref:A,value:l,onChange:O=>i(O.target.value),className:"font-mono text-sm",placeholder:"็‚นๅ‡ปไธ‹ๆ–นๆŒ‰้’ฎๆž„ๅปบๆญฃๅˆ™่กจ่พพๅผ..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"Reaction ๅ†…ๅฎน"}),e.jsx(at,{value:n,onChange:O=>c(O.target.value),placeholder:"ไฝฟ็”จ [ๆ•่Žท็ป„ๅ] ๅผ•็”จๆ•่Žท็š„ๅ†…ๅฎน...",rows:3,className:"text-sm"})]}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[G.map(O=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:O.category}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:O.items.map(ee=>e.jsx(S,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>C(ee.pattern,ee.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:ee.label}),e.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ee.pattern})]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ee.desc})]})},ee.label))})]},O.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(S,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>i("^(?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(S,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>i("(?:[^๏ผŒใ€‚.\\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(S,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>i("(?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(bs,{value:"test",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๅฝ“ๅ‰ๆญฃๅˆ™่กจ่พพๅผ"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:l||"(ๆœช่ฎพ็ฝฎ)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"test-text",className:"text-sm font-medium",children:"ๆต‹่ฏ•ๆ–‡ๆœฌ"}),e.jsx(at,{id:"test-text",value:h,onChange:O=>f(O.target.value),placeholder:`ๅœจๆญค่พ“ๅ…ฅ่ฆๆต‹่ฏ•็š„ๆ–‡ๆœฌ... -ไพ‹ๅฆ‚๏ผšๆ‰“ๆธธๆˆๆ˜ฏ่ฟ™ๆ ท็š„`,className:"min-h-[100px] text-sm"})]}),N&&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:N})]}),!N&&h&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:p&&p.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:["ๅŒน้…ๆˆๅŠŸ (",p.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(T,{className:"text-sm font-medium",children:"ๅŒน้…้ซ˜ไบฎ"}),e.jsx(Je,{className:"h-40 rounded-md bg-muted p-3",children:e.jsx("div",{className:"text-sm break-words",children:M()})})]}),Object.keys(y).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๅ‘ฝๅๆ•่Žท็ป„"}),e.jsx(Je,{className:"h-32 rounded-md border p-3",children:e.jsx("div",{className:"space-y-2",children:Object.entries(y).map(([O,ee])=>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:["[",O,"]"]}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ee})]},O))})})]}),Object.keys(y).length>0&&n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"Reaction ๆ›ฟๆข้ข„่งˆ"}),e.jsx(Je,{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:b})}),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:"ๅฆ‚้œ€ไฟฎๆ”นๆญฃๅˆ™๏ผŒๅˆ‡ๆขๅ›žๆž„ๅปบๅ™จๆ ‡็ญพ้กต"})]})]})]})]})})]})]})}const f_=zs.memo(function({keywordReactionConfig:n,responsePostProcessConfig:i,chineseTypoConfig:c,responseSplitterConfig:u,onKeywordReactionChange:x,onResponsePostProcessChange:h,onChineseTypoChange:f,onResponseSplitterChange:p}){const g=()=>{x({...n,regex_rules:[...n.regex_rules,{regex:[""],reaction:""}]})},N=C=>{x({...n,regex_rules:n.regex_rules.filter((M,G)=>G!==C)})},v=(C,M,G)=>{const O=[...n.regex_rules];M==="regex"&&typeof G=="string"?O[C]={...O[C],regex:[G]}:M==="reaction"&&typeof G=="string"&&(O[C]={...O[C],reaction:G}),x({...n,regex_rules:O})},y=()=>{x({...n,keyword_rules:[...n.keyword_rules,{keywords:[],reaction:""}]})},w=C=>{x({...n,keyword_rules:n.keyword_rules.filter((M,G)=>G!==C)})},b=(C,M,G)=>{const O=[...n.keyword_rules];typeof G=="string"&&(O[C]={...O[C],reaction:G}),x({...n,keyword_rules:O})},D=C=>{const M=[...n.keyword_rules];M[C]={...M[C],keywords:[...M[C].keywords||[],""]},x({...n,keyword_rules:M})},A=(C,M)=>{const G=[...n.keyword_rules];G[C]={...G[C],keywords:(G[C].keywords||[]).filter((O,ee)=>ee!==M)},x({...n,keyword_rules:G})},_=(C,M,G)=>{const O=[...n.keyword_rules],ee=[...O[C].keywords||[]];ee[M]=G,O[C]={...O[C],keywords:ee},x({...n,keyword_rules:O})},P=({rule:C})=>{const M=`{ regex = [${(C.regex||[]).map(G=>`"${G}"`).join(", ")}], reaction = "${C.reaction}" }`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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(Je,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs break-all",children:M})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ๆ˜ฏไฟๅญ˜ๅˆฐ bot_config.toml ๆ–‡ไปถไธญ็š„ๆ ผๅผ"})]})})]})},E=({rule:C})=>{const M=`[[keyword_reaction.keyword_rules]] +3.ๆŸๅฅ่ฏๅฆ‚ๆžœๅทฒ็ป่ขซๅ›žๅค่ฟ‡๏ผŒไธ่ฆ้‡ๅคๅ›žๅค`}),[D,A]=m.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"็ฌฆๅˆๅ…ฌๅบ่‰ฏไฟ—"}),[_,H]=m.useState({enable_tool:!0,all_global:!0}),[E,C]=m.useState({api_key:""}),M=[{id:"bot-basic",title:"BotๅŸบ็ก€",description:"้…็ฝฎๆœบๅ™จไบบ็š„ๅŸบๆœฌไฟกๆฏ",icon:Bi},{id:"personality",title:"ไบบๆ ผ้…็ฝฎ",description:"ๅฎšไน‰ๆœบๅ™จไบบ็š„ๆ€งๆ ผๅ’Œ่ฏด่ฏ้ฃŽๆ ผ",icon:Bn},{id:"emoji",title:"่กจๆƒ…ๅŒ…",description:"้…็ฝฎ่กจๆƒ…ๅŒ…็›ธๅ…ณ่ฎพ็ฝฎ",icon:Fm},{id:"other",title:"ๅ…ถไป–่ฎพ็ฝฎ",description:"ๅทฅๅ…ทใ€ๆƒ…็ปช็ณป็ปŸ็ญ‰้…็ฝฎ",icon:mn},{id:"siliconflow",title:"API้…็ฝฎ",description:"้…็ฝฎ็ก…ๅŸบๆตๅŠจAPIๅฏ†้’ฅ",icon:Hm}],G=(c+1)/M.length*100;m.useEffect(()=>{(async()=>{try{N(!0);const[ge,fe,z,Q,I]=await Promise.all([I2(),P2(),H2(),F2(),G2()]);y(ge),b(fe),A(z),H(Q),C(I)}catch(ge){n({title:"ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ",description:ge instanceof Error?ge.message:"ๆ— ๆณ•ๅŠ ่ฝฝ็Žฐๆœ‰้…็ฝฎ๏ผŒๅฐ†ไฝฟ็”จ้ป˜่ฎคๅ€ผ",variant:"destructive"})}finally{N(!1)}})()},[n]);const O=async()=>{p(!0);try{switch(c){case 0:await V2(v);break;case 1:await q2(w);break;case 2:await K2(D);break;case 3:await Q2(_);break;case 4:await Y2(E);break}return n({title:"ไฟๅญ˜ๆˆๅŠŸ",description:`${M[c].title}้…็ฝฎๅทฒไฟๅญ˜`}),!0}catch(se){return n({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"}),!1}finally{p(!1)}},ee=async()=>{await O()&&c{c>0&&u(c-1)},me=async()=>{h(!0);try{if(!await O()){h(!1);return}await mg(),n({title:"้…็ฝฎๅฎŒๆˆ",description:"้บฆ้บฆๆญฃๅœจ้‡ๅฏไปฅๅบ”็”จๆ–ฐ้…็ฝฎ..."}),await i()}catch(se){n({title:"้…็ฝฎๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{h(!1)}},ce=async()=>{try{await mg(),l({to:"/"})}catch(se){n({title:"่ทณ่ฟ‡ๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},ve=()=>{switch(c){case 0:return e.jsx(R2,{config:v,onChange:y});case 1:return e.jsx(L2,{config:w,onChange:b});case 2:return e.jsx(U2,{config:D,onChange:A});case 3:return e.jsx(B2,{config:_,onChange:H});case 4:return e.jsx($2,{config:E,onChange:C});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:[e.jsx(qn,{}),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"})]}),g?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(Gw,{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:["่ฎฉๆˆ‘ไปฌไธ€่ตทๅฎŒๆˆ ",Km," ็š„ๅˆๅง‹้…็ฝฎ"]})]}),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," / ",M.length]}),e.jsxs("span",{className:"font-medium text-primary",children:[Math.round(G),"%"]})]}),e.jsx(Fn,{value:G,className:"h-2"})]}),e.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:M.map((se,ge)=>{const fe=se.icon;return e.jsxs("div",{className:P("flex flex-1 flex-col items-center gap-1 md:gap-2",gel({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[e.jsx(Go,{className:"h-4 w-4"}),"่ฟ”ๅ›ž้ฆ–้กต"]}),e.jsxs(S,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[e.jsx(ka,{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 Z2=zs.memo(function({config:n,onChange:i}){const c=n.platforms||[],u=n.alias_names||[],x=()=>{i({...n,platforms:[...c,""]})},h=v=>{i({...n,platforms:c.filter((y,w)=>w!==v)})},f=(v,y)=>{const w=[...c];w[v]=y,i({...n,platforms:w})},p=()=>{i({...n,alias_names:[...u,""]})},g=v=>{i({...n,alias_names:u.filter((y,w)=>w!==v)})},N=(v,y)=>{const w=[...u];w[v]=y,i({...n,alias_names:w})};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(T,{htmlFor:"platform",children:"ๅนณๅฐ"}),e.jsx(ne,{id:"platform",value:n.platform,onChange:v=>i({...n,platform:v.target.value}),placeholder:"qq"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"qq_account",children:"QQ่ดฆๅท"}),e.jsx(ne,{id:"qq_account",value:n.qq_account,onChange:v=>i({...n,qq_account:v.target.value}),placeholder:"123456789"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"nickname",children:"ๆ˜ต็งฐ"}),e.jsx(ne,{id:"nickname",value:n.nickname,onChange:v=>i({...n,nickname:v.target.value}),placeholder:"้บฆ้บฆ"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๅ…ถไป–ๅนณๅฐ่ดฆๅท"}),e.jsxs(S,{onClick:x,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ "]})]}),e.jsxs("div",{className:"space-y-2",children:[c.map((v,y)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:v,onChange:w=>f(y,w.target.value),placeholder:"wx:114514"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๅนณๅฐ่ดฆๅท "',v||"(็ฉบ)",'" ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>h(y),children:"ๅˆ ้™ค"})]})]})]})]},y)),c.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(T,{children:"ๅˆซๅ"}),e.jsxs(S,{onClick:p,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ "]})]}),e.jsxs("div",{className:"space-y-2",children:[u.map((v,y)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:v,onChange:w=>N(y,w.target.value),placeholder:"ๅฐ้บฆ"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๅˆซๅ "',v||"(็ฉบ)",'" ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>g(y),children:"ๅˆ ้™ค"})]})]})]})]},y)),u.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆš‚ๆ— ๅˆซๅ"})]})]})]})]})})}),W2=zs.memo(function({config:n,onChange:i}){const c=()=>{i({...n,states:[...n.states,""]})},u=h=>{i({...n,states:n.states.filter((f,p)=>p!==h)})},x=(h,f)=>{const p=[...n.states];p[h]=f,i({...n,states:p})};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(T,{htmlFor:"personality",children:"ไบบๆ ผ็‰น่ดจ"}),e.jsx(at,{id:"personality",value:n.personality,onChange:h=>i({...n,personality:h.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(T,{htmlFor:"reply_style",children:"่กจ่พพ้ฃŽๆ ผ"}),e.jsx(at,{id:"reply_style",value:n.reply_style,onChange:h=>i({...n,reply_style:h.target.value}),placeholder:"ๆ่ฟฐ่ฏด่ฏ็š„่กจ่พพ้ฃŽๆ ผๅ’Œไน ๆƒฏ",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"interest",children:"ๅ…ด่ถฃ"}),e.jsx(at,{id:"interest",value:n.interest,onChange:h=>i({...n,interest:h.target.value}),placeholder:"ไผšๅฝฑๅ“้บฆ้บฆๅฏนไป€ไนˆ่ฏ้ข˜่ฟ›่กŒๅ›žๅค",rows:2})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"plan_style",children:"่ฏด่ฏ่ง„ๅˆ™ไธŽ่กŒไธบ้ฃŽๆ ผ"}),e.jsx(at,{id:"plan_style",value:n.plan_style,onChange:h=>i({...n,plan_style:h.target.value}),placeholder:"้บฆ้บฆ็š„่ฏด่ฏ่ง„ๅˆ™ๅ’Œ่กŒไธบ้ฃŽๆ ผ",rows:5})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"visual_style",children:"่ฏ†ๅ›พ่ง„ๅˆ™"}),e.jsx(at,{id:"visual_style",value:n.visual_style,onChange:h=>i({...n,visual_style:h.target.value}),placeholder:"่ฏ†ๅ›พๆ—ถ็š„ๅค„็†่ง„ๅˆ™",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"private_plan_style",children:"็ง่Š่ง„ๅˆ™"}),e.jsx(at,{id:"private_plan_style",value:n.private_plan_style,onChange:h=>i({...n,private_plan_style:h.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(T,{children:"็Šถๆ€ๅˆ—่กจ๏ผˆไบบๆ ผๅคšๆ ทๆ€ง๏ผ‰"}),e.jsxs(S,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ็Šถๆ€"]})]}),e.jsx("div",{className:"space-y-2",children:n.states.map((h,f)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(at,{value:h,onChange:p=>x(f,p.target.value),placeholder:"ๆ่ฟฐไธ€ไธชไบบๆ ผ็Šถๆ€",rows:2}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsx(hs,{children:"็กฎๅฎš่ฆๅˆ ้™ค่ฟ™ไธชไบบๆ ผ็Šถๆ€ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>u(f),children:"ๅˆ ้™ค"})]})]})]})]},f))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"state_probability",children:"็Šถๆ€ๆ›ฟๆขๆฆ‚็އ"}),e.jsx(ne,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:n.state_probability,onChange:h=>i({...n,state_probability:parseFloat(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆฏๆฌกๆž„ๅปบไบบๆ ผๆ—ถๆ›ฟๆข personality ็š„ๆฆ‚็އ๏ผˆ0.0-1.0๏ผ‰"})]})]})]})})}),Be=Sw,$e=kw,Le=m.forwardRef(({className:l,children:n,...i},c)=>e.jsxs(nj,{ref:c,className:P("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",l),...i,children:[n,e.jsx(Nw,{asChild:!0,children:e.jsx(Ta,{className:"h-4 w-4 opacity-50"})})]}));Le.displayName=nj.displayName;const rv=m.forwardRef(({className:l,...n},i)=>e.jsx(rj,{ref:i,className:P("flex cursor-default items-center justify-center py-1",l),...n,children:e.jsx($r,{className:"h-4 w-4"})}));rv.displayName=rj.displayName;const iv=m.forwardRef(({className:l,...n},i)=>e.jsx(ij,{ref:i,className:P("flex cursor-default items-center justify-center py-1",l),...n,children:e.jsx(Ta,{className:"h-4 w-4"})}));iv.displayName=ij.displayName;const Ue=m.forwardRef(({className:l,children:n,position:i="popper",...c},u)=>e.jsx(bw,{children:e.jsxs(cj,{ref:u,className:P("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]",i==="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",l),position:i,...c,children:[e.jsx(rv,{}),e.jsx(yw,{className:P("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),e.jsx(iv,{})]})}));Ue.displayName=cj.displayName;const e_=m.forwardRef(({className:l,...n},i)=>e.jsx(oj,{ref:i,className:P("px-2 py-1.5 text-sm font-semibold",l),...n}));e_.displayName=oj.displayName;const W=m.forwardRef(({className:l,children:n,...i},c)=>e.jsxs(dj,{ref:c,className:P("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",l),...i,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ww,{children:e.jsx(_t,{className:"h-4 w-4"})})}),e.jsx(_w,{children:n})]}));W.displayName=dj.displayName;const s_=m.forwardRef(({className:l,...n},i)=>e.jsx(uj,{ref:i,className:P("-mx-1 my-1 h-px bg-muted",l),...n}));s_.displayName=uj.displayName;const nl=B0,rl=$0,Ja=m.forwardRef(({className:l,align:n="center",sideOffset:i=4,...c},u)=>e.jsx(U0,{children:e.jsx(qg,{ref:u,align:n,sideOffset:i,className:P("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]",l),...c})}));Ja.displayName=qg.displayName;const t_=zs.memo(function({value:n,onChange:i}){const c=m.useMemo(()=>{const w=n.split("-");if(w.length===2){const[b,D]=w,[A,_]=b.split(":"),[H,E]=D.split(":");return{startHour:A?A.padStart(2,"0"):"00",startMinute:_?_.padStart(2,"0"):"00",endHour:H?H.padStart(2,"0"):"23",endMinute:E?E.padStart(2,"0"):"59"}}return{startHour:"00",startMinute:"00",endHour:"23",endMinute:"59"}},[n]),[u,x]=m.useState(c.startHour),[h,f]=m.useState(c.startMinute),[p,g]=m.useState(c.endHour),[N,v]=m.useState(c.endMinute);m.useEffect(()=>{x(c.startHour),f(c.startMinute),g(c.endHour),v(c.endMinute)},[c]);const y=(w,b,D,A)=>{const _=`${w}:${b}-${D}:${A}`;i(_)};return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[e.jsx(Ya,{className:"h-4 w-4 mr-2"}),n||"้€‰ๆ‹ฉๆ—ถ้—ดๆฎต"]})}),e.jsx(Ja,{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(T,{className:"text-xs",children:"ๅฐๆ—ถ"}),e.jsxs(Be,{value:u,onValueChange:w=>{x(w),y(w,h,p,N)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:24},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs",children:"ๅˆ†้’Ÿ"}),e.jsxs(Be,{value:h,onValueChange:w=>{f(w),y(u,w,p,N)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:60},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]})]})]}),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(T,{className:"text-xs",children:"ๅฐๆ—ถ"}),e.jsxs(Be,{value:p,onValueChange:w=>{g(w),y(u,h,w,N)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:24},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs",children:"ๅˆ†้’Ÿ"}),e.jsxs(Be,{value:N,onValueChange:w=>{v(w),y(u,h,p,w)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:Array.from({length:60},(w,b)=>b).map(w=>e.jsx(W,{value:w.toString().padStart(2,"0"),children:w.toString().padStart(2,"0")},w))})]})]})]})]})]})})]})}),a_=zs.memo(function({rule:n}){const i=`{ target = "${n.target}", time = "${n.time}", value = ${n.value.toFixed(1)} }`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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:i}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ๆ˜ฏไฟๅญ˜ๅˆฐ bot_config.toml ๆ–‡ไปถไธญ็š„ๆ ผๅผ"})]})})]})}),l_=zs.memo(function({config:n,onChange:i}){const c=()=>{i({...n,talk_value_rules:[...n.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},u=h=>{i({...n,talk_value_rules:n.talk_value_rules.filter((f,p)=>p!==h)})},x=(h,f,p)=>{const g=[...n.talk_value_rules];g[h]={...g[h],[f]:p},i({...n,talk_value_rules:g})};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(T,{htmlFor:"talk_value",children:"่Šๅคฉ้ข‘็އ๏ผˆๅŸบ็ก€ๅ€ผ๏ผ‰"}),e.jsx(ne,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:n.talk_value,onChange:h=>i({...n,talk_value:parseFloat(h.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(Fe,{id:"mentioned_bot_reply",checked:n.mentioned_bot_reply,onCheckedChange:h=>i({...n,mentioned_bot_reply:h})}),e.jsx(T,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"ๅฏ็”จๆๅŠๅฟ…ๅ›žๅค"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_context_size",children:"ไธŠไธ‹ๆ–‡้•ฟๅบฆ"}),e.jsx(ne,{id:"max_context_size",type:"number",min:"1",value:n.max_context_size,onChange:h=>i({...n,max_context_size:parseInt(h.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"planner_smooth",children:"่ง„ๅˆ’ๅ™จๅนณๆป‘"}),e.jsx(ne,{id:"planner_smooth",type:"number",step:"1",min:"0",value:n.planner_smooth,onChange:h=>i({...n,planner_smooth:parseFloat(h.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(Fe,{id:"enable_talk_value_rules",checked:n.enable_talk_value_rules,onCheckedChange:h=>i({...n,enable_talk_value_rules:h})}),e.jsx(T,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"ๅฏ็”จๅŠจๆ€ๅ‘่จ€้ข‘็އ่ง„ๅˆ™"})]})]})]}),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(S,{onClick:c,size:"sm",children:[e.jsx(Zs,{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((h,f)=>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:["่ง„ๅˆ™ #",f+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a_,{rule:h}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",children:e.jsx(ns,{className:"h-4 w-4 text-destructive"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค่ง„ๅˆ™ #",f+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>u(f),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"้…็ฝฎ็ฑปๅž‹"}),e.jsxs(Be,{value:h.target===""?"global":"specific",onValueChange:p=>{p==="global"?x(f,"target",""):x(f,"target","qq::group")},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"global",children:"ๅ…จๅฑ€้…็ฝฎ"}),e.jsx(W,{value:"specific",children:"่ฏฆ็ป†้…็ฝฎ"})]})]})]}),h.target!==""&&(()=>{const p=h.target.split(":"),g=p[0]||"qq",N=p[1]||"",v=p[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(T,{className:"text-xs font-medium",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:g,onValueChange:y=>{x(f,"target",`${y}:${N}:${v}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็พค ID"}),e.jsx(ne,{value:N,onChange:y=>{x(f,"target",`${g}:${y.target.value}:${v}`)},placeholder:"่พ“ๅ…ฅ็พค ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็ฑปๅž‹"}),e.jsxs(Be,{value:v,onValueChange:y=>{x(f,"target",`${g}:${N}:${y}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"group",children:"็พค็ป„๏ผˆgroup๏ผ‰"}),e.jsx(W,{value:"private",children:"็ง่Š๏ผˆprivate๏ผ‰"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉๆต ID๏ผš",h.target||"๏ผˆๆœช่ฎพ็ฝฎ๏ผ‰"]})]})})(),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"ๆ—ถ้—ดๆฎต (Time)"}),e.jsx(t_,{value:h.time,onChange:p=>x(f,"time",p)}),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(T,{htmlFor:`rule-value-${f}`,className:"text-xs font-medium",children:"ๅ‘่จ€้ข‘็އๅ€ผ (Value)"}),e.jsx(ne,{id:`rule-value-${f}`,type:"number",step:"0.01",min:"0.01",max:"1",value:h.value,onChange:p=>{const g=parseFloat(p.target.value);isNaN(g)||x(f,"value",Math.max(.01,Math.min(1,g)))},className:"w-20 h-8 text-xs"})]}),e.jsx(_a,{value:[h.value],onValueChange:p=>x(f,"value",p[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 (ๆญฃๅธธ)"})]})]})]})]},f))}):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 ่กจ็คบๆญฃๅธธๅ‘่จ€"]})]})]})]})]})}),n_=zs.memo(function({config:n,onChange:i}){const c=_=>{if(!_||!_.includes(":"))return{platform:"qq",userId:""};const[H,E]=_.split(":");return{platform:H,userId:E}},{platform:u,userId:x}=c(n.dream_send),[h,f]=m.useState(u),[p,g]=m.useState(x),N=_=>{const[H,E]=_.split("-");return{startTime:H||"09:00",endTime:E||"22:00"}},v=(_,H)=>{const E=H?`${_}:${H}`:"";i({...n,dream_send:E})},y=_=>{f(_),v(_,p)},w=_=>{g(_),v(h,_)},b=()=>{i({...n,dream_time_ranges:[...n.dream_time_ranges,"09:00-22:00"]})},D=_=>{i({...n,dream_time_ranges:n.dream_time_ranges.filter((H,E)=>E!==_)})},A=(_,H,E)=>{const C=[...n.dream_time_ranges],M=N(C[_]);H==="startTime"?M.startTime=E:M.endTime=E,C[_]=`${M.startTime}-${M.endTime}`,i({...n,dream_time_ranges:C})};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"ๅšๆขฆ้…็ฝฎ"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"interval_minutes",children:"ๅšๆขฆๆ—ถ้—ด้—ด้š”๏ผˆๅˆ†้’Ÿ๏ผ‰"}),e.jsx(ne,{id:"interval_minutes",type:"number",min:"1",value:n.interval_minutes,onChange:_=>i({...n,interval_minutes:Number(_.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค30ๅˆ†้’Ÿ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"max_iterations",children:"ๅšๆขฆๆœ€ๅคง่ฝฎๆฌก"}),e.jsx(ne,{id:"max_iterations",type:"number",min:"1",value:n.max_iterations,onChange:_=>i({...n,max_iterations:Number(_.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค20่ฝฎ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"first_delay_seconds",children:"้ฆ–ๆฌกๅšๆขฆๅปถ่ฟŸ๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"first_delay_seconds",type:"number",min:"0",value:n.first_delay_seconds,onChange:_=>i({...n,first_delay_seconds:Number(_.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"็จ‹ๅบๅฏๅŠจๅŽ้ฆ–ๆฌกๅšๆขฆๅ‰็š„ๅปถ่ฟŸๆ—ถ้—ด๏ผŒ้ป˜่ฎค60็ง’"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๅšๆขฆ็ป“ๆžœๆŽจ้€็›ฎๆ ‡"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Be,{value:h,onValueChange:y,children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅนณๅฐ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"}),e.jsx(W,{value:"webui",children:"WebUI"})]})]}),e.jsx(ne,{type:"text",placeholder:"่พ“ๅ…ฅ็”จๆˆทID (ไพ‹ๅฆ‚: 123456)",value:p,onChange:_=>w(_.target.value),className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้€‰ๆ‹ฉๅนณๅฐๅนถ่พ“ๅ…ฅ็”จๆˆทID๏ผŒๅšๆขฆ็ป“ๆŸๅŽๅฐ†ๆขฆๅขƒๅ‘้€็ป™่ฏฅ็”จๆˆทใ€‚็”จๆˆทIDไธบ็ฉบๅˆ™ไธๆŽจ้€"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๅšๆขฆๆ—ถ้—ดๆฎต้…็ฝฎ"}),e.jsx(S,{type:"button",size:"sm",onClick:b,children:"ๆทปๅŠ ๆ—ถ้—ดๆฎต"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฎพ็ฝฎๅ…่ฎธๅšๆขฆ็š„ๆ—ถ้—ดๆฎต๏ผŒๆ”ฏๆŒ่ทจๅคœๅŒบ้—ด๏ผˆๅฆ‚ 23:00 ๅˆฐๆฌกๆ—ฅ 02:00๏ผ‰ใ€‚ๅˆ—่กจไธบ็ฉบๅˆ™ๅ…จๅคฉๅ…่ฎธๅšๆขฆ"}),e.jsxs("div",{className:"space-y-2",children:[n.dream_time_ranges.map((_,H)=>{const{startTime:E,endTime:C}=N(_);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{type:"time",value:E,onChange:M=>A(H,"startTime",M.target.value),className:"w-[140px]"}),e.jsx("span",{className:"text-muted-foreground",children:"่‡ณ"}),e.jsx(ne,{type:"time",value:C,onChange:M=>A(H,"endTime",M.target.value),className:"w-[140px]"}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",onClick:()=>D(H),children:e.jsx(Ca,{className:"h-4 w-4"})})]},H)}),n.dream_time_ranges.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅฝ“ๅ‰้…็ฝฎไธบๅ…จๅคฉๅ…่ฎธๅšๆขฆ"})]})]})]})}),r_=zs.memo(function({config:n,onChange:i}){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(Fe,{checked:n.enable,onCheckedChange:c=>i({...n,enable:c})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ LPMM ็Ÿฅ่ฏ†ๅบ“"})]}),n.enable&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"LPMM ๆจกๅผ"}),e.jsxs(Be,{value:n.lpmm_mode,onValueChange:c=>i({...n,lpmm_mode:c}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ LPMM ๆจกๅผ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"classic",children:"็ปๅ…ธๆจกๅผ"}),e.jsx(W,{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(T,{children:"ๅŒไน‰่ฏๆœ็ดข TopK"}),e.jsx(ne,{type:"number",min:"1",value:n.rag_synonym_search_top_k,onChange:c=>i({...n,rag_synonym_search_top_k:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅŒไน‰่ฏ้˜ˆๅ€ผ"}),e.jsx(ne,{type:"number",step:"0.1",min:"0",max:"1",value:n.rag_synonym_threshold,onChange:c=>i({...n,rag_synonym_threshold:parseFloat(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅฎžไฝ“ๆๅ–็บฟ็จ‹ๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",value:n.info_extraction_workers,onChange:c=>i({...n,info_extraction_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅตŒๅ…ฅๅ‘้‡็ปดๅบฆ"}),e.jsx(ne,{type:"number",min:"1",value:n.embedding_dimension,onChange:c=>i({...n,embedding_dimension:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅตŒๅ…ฅๅนถๅ‘็บฟ็จ‹ๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",value:n.max_embedding_workers,onChange:c=>i({...n,max_embedding_workers:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆฏๆ‰นๅตŒๅ…ฅๆกๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",value:n.embedding_chunk_size,onChange:c=>i({...n,embedding_chunk_size:parseInt(c.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅŒไน‰ๅฎžไฝ“ๆ•ฐไธŠ้™"}),e.jsx(ne,{type:"number",min:"1",value:n.max_synonym_entities,onChange:c=>i({...n,max_synonym_entities:parseInt(c.target.value)})})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{checked:n.enable_ppr,onCheckedChange:c=>i({...n,enable_ppr:c})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ PPR (ไฝŽ้…ๆœบๅ™จๅฏๅ…ณ้—ญ)"})]})]})]})]})}),i_=zs.memo(function({config:n,onChange:i}){const[c,u]=m.useState(""),[x,h]=m.useState("WARNING"),f=()=>{c&&!n.suppress_libraries.includes(c)&&(i({...n,suppress_libraries:[...n.suppress_libraries,c]}),u(""))},p=b=>{i({...n,suppress_libraries:n.suppress_libraries.filter(D=>D!==b)})},g=()=>{c&&!n.library_log_levels[c]&&(i({...n,library_log_levels:{...n.library_log_levels,[c]:x}}),u(""),h("WARNING"))},N=b=>{const D={...n.library_log_levels};delete D[b],i({...n,library_log_levels:D})},v=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],y=["FULL","compact","lite"],w=["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(T,{children:"ๆ—ฅๆœŸๆ ผๅผ"}),e.jsx(ne,{value:n.date_style,onChange:b=>i({...n,date_style:b.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(T,{children:"ๆ—ฅๅฟ—็บงๅˆซๆ ทๅผ"}),e.jsxs(Be,{value:n.log_level_style,onValueChange:b=>i({...n,log_level_style:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:y.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆ—ฅๅฟ—ๆ–‡ๆœฌ้ขœ่‰ฒ"}),e.jsxs(Be,{value:n.color_text,onValueChange:b=>i({...n,color_text:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:w.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๅ…จๅฑ€ๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs(Be,{value:n.log_level,onValueChange:b=>i({...n,log_level:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆŽงๅˆถๅฐๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs(Be,{value:n.console_log_level,onValueChange:b=>i({...n,console_log_level:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆ–‡ไปถๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs(Be,{value:n.file_log_level,onValueChange:b=>i({...n,file_log_level:b}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]})]})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"mb-2 block",children:"ๅฎŒๅ…จๅฑ่”ฝ็š„ๅบ“"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:c,onChange:b=>u(b.target.value),placeholder:"่พ“ๅ…ฅๅบ“ๅ",className:"flex-1",onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),f())}}),e.jsx(S,{onClick:f,size:"sm",className:"flex-shrink-0",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.suppress_libraries.map(b=>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:b}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>p(b),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},b))})]}),e.jsxs("div",{children:[e.jsx(T,{className:"mb-2 block",children:"็‰นๅฎšๅบ“็š„ๆ—ฅๅฟ—็บงๅˆซ"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:c,onChange:b=>u(b.target.value),placeholder:"่พ“ๅ…ฅๅบ“ๅ",className:"flex-1"}),e.jsxs(Be,{value:x,onValueChange:h,children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsx(Ue,{children:v.map(b=>e.jsx(W,{value:b,children:b},b))})]}),e.jsx(S,{onClick:g,size:"sm",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(n.library_log_levels).map(([b,D])=>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:b}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:D}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>N(b),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},b))})]})]})}),c_=zs.memo(function({config:n,onChange:i}){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(T,{children:"ๆ˜พ็คบ Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๅœจๆ—ฅๅฟ—ไธญๆ˜พ็คบๆ็คบ่ฏ"})]}),e.jsx(Fe,{checked:n.show_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบๅ›žๅคๅ™จ Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบๅ›žๅคๅ™จ็š„ๆ็คบ่ฏ"})]}),e.jsx(Fe,{checked:n.show_replyer_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบๅ›žๅคๅ™จๆŽจ็†"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบๅ›žๅคๅ™จ็š„ๆŽจ็†่ฟ‡็จ‹"})]}),e.jsx(Fe,{checked:n.show_replyer_reasoning,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ Jargon Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบๆœฏ่ฏญ็›ธๅ…ณ็š„ๆ็คบ่ฏ"})]}),e.jsx(Fe,{checked:n.show_jargon_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ่ฎฐๅฟ†ๆฃ€็ดข Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบ่ฎฐๅฟ†ๆฃ€็ดข็›ธๅ…ณ็š„ๆ็คบ่ฏ"})]}),e.jsx(Fe,{checked:n.show_memory_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ Planner Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบ Planner ็š„ๆ็คบ่ฏๅ’ŒๅŽŸๅง‹่ฟ”ๅ›ž็ป“ๆžœ"})]}),e.jsx(Fe,{checked:n.show_planner_prompt,onCheckedChange:c=>i({...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(T,{children:"ๆ˜พ็คบ LPMM ็›ธๅ…ณๆ–‡ๆฎต"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๆ˜พ็คบ LPMM ็Ÿฅ่ฏ†ๅบ“ๆ‰พๅˆฐ็š„็›ธๅ…ณๆ–‡ๆฎตๆ—ฅๅฟ—"})]}),e.jsx(Fe,{checked:n.show_lpmm_paragraph,onCheckedChange:c=>i({...n,show_lpmm_paragraph:c})})]})]})]})}),o_=zs.memo(function({config:n,onChange:i}){const[c,u]=m.useState(""),[x,h]=m.useState(""),f=()=>{c&&!n.auth_token.includes(c)&&(i({...n,auth_token:[...n.auth_token,c]}),u(""))},p=v=>{i({...n,auth_token:n.auth_token.filter((y,w)=>w!==v)})},g=()=>{x&&!n.api_server_allowed_api_keys.includes(x)&&(i({...n,api_server_allowed_api_keys:[...n.api_server_allowed_api_keys,x]}),h(""))},N=v=>{i({...n,api_server_allowed_api_keys:n.api_server_allowed_api_keys.filter((y,w)=>w!==v)})};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-2",children:"ๆ—ง็‰ˆ API ่ฎค่ฏไปค็‰Œ"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"็”จไบŽๆ—ง็‰ˆ API ้ชŒ่ฏ๏ผŒไธบ็ฉบๅˆ™ไธๅฏ็”จ้ชŒ่ฏ"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:c,onChange:v=>u(v.target.value),placeholder:"่พ“ๅ…ฅ่ฎค่ฏไปค็‰Œ",onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),f())}}),e.jsx(S,{onClick:f,size:"sm",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.auth_token.map((v,y)=>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:v}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>p(y),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},y))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"ๆ–ฐ็‰ˆ API Server ้…็ฝฎ"}),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(T,{children:"ๅฏ็”จๆ–ฐ็‰ˆ API Server"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ˜ฏๅฆๅฏ็”จ้ขๅค–็š„ๆ–ฐ็‰ˆ API Server๏ผˆ้ขๅค–็›‘ๅฌ็ซฏๅฃ๏ผ‰"})]}),e.jsx(Fe,{checked:n.enable_api_server,onCheckedChange:v=>i({...n,enable_api_server:v})})]}),n.enable_api_server&&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(T,{children:"ไธปๆœบๅœฐๅ€"}),e.jsx(ne,{value:n.api_server_host,onChange:v=>i({...n,api_server_host:v.target.value}),placeholder:"0.0.0.0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"็ซฏๅฃๅท"}),e.jsx(ne,{type:"number",value:n.api_server_port,onChange:v=>i({...n,api_server_port:parseInt(v.target.value)}),placeholder:"8090"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{checked:n.api_server_use_wss,onCheckedChange:v=>i({...n,api_server_use_wss:v})}),e.jsx(T,{children:"ๅฏ็”จ WSS ๅฎ‰ๅ…จ่ฟžๆŽฅ"})]}),n.api_server_use_wss&&e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"SSL ่ฏไนฆๆ–‡ไปถ่ทฏๅพ„"}),e.jsx(ne,{value:n.api_server_cert_file,onChange:v=>i({...n,api_server_cert_file:v.target.value}),placeholder:"cert.pem"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"SSL ๅฏ†้’ฅๆ–‡ไปถ่ทฏๅพ„"}),e.jsx(ne,{value:n.api_server_key_file,onChange:v=>i({...n,api_server_key_file:v.target.value}),placeholder:"key.pem"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"mb-2 block",children:"ๅ…่ฎธ็š„ API Key ๅˆ—่กจ"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"ไธบ็ฉบๅˆ™ๅ…่ฎธๆ‰€ๆœ‰่ฟžๆŽฅ"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(ne,{value:x,onChange:v=>h(v.target.value),placeholder:"่พ“ๅ…ฅ API Key",onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),g())}}),e.jsx(S,{onClick:g,size:"sm",children:e.jsx(Zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:n.api_server_allowed_api_keys.map((v,y)=>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:v}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>N(y),children:e.jsx(ns,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},y))})]})]})]})]})]})}),d_=zs.memo(function({config:n,onChange:i}){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(T,{children:"ๅฏ็”จ็ปŸ่ฎกไฟกๆฏๅ‘้€"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅ‘้€ๅŒฟๅ็ปŸ่ฎกไฟกๆฏ๏ผŒๅธฎๅŠฉๆˆ‘ไปฌไบ†่งฃๅ…จ็ƒๆœ‰ๅคšๅฐ‘ๅช้บฆ้บฆๅœจ่ฟ่กŒ"})]}),e.jsx(Fe,{checked:n.enable,onCheckedChange:c=>i({...n,enable:c})})]})]})}),u_=zs.memo(function({emojiConfig:n,memoryConfig:i,toolConfig:c,voiceConfig:u,onEmojiChange:x,onMemoryChange:h,onToolChange:f,onVoiceChange:p}){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:"space-y-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"enable_tool",checked:c.enable_tool,onCheckedChange:g=>f({...c,enable_tool:g})}),e.jsx(T,{htmlFor:"enable_tool",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 pt-2",children:[e.jsx(Fe,{id:"enable_asr",checked:u.enable_asr,onCheckedChange:g=>p({...u,enable_asr:g})}),e.jsx(T,{htmlFor:"enable_asr",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-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_agent_iterations",children:"่ฎฐๅฟ†ๆ€่€ƒๆทฑๅบฆ"}),e.jsx(ne,{id:"max_agent_iterations",type:"number",min:"1",value:i.max_agent_iterations,onChange:g=>h({...i,max_agent_iterations:parseInt(g.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆœ€ไฝŽไธบ 1๏ผˆไธๆทฑๅ…ฅๆ€่€ƒ๏ผ‰"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"agent_timeout_seconds",children:"ๆœ€้•ฟๅ›žๅฟ†ๆ—ถ้—ด๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"agent_timeout_seconds",type:"number",min:"1",step:"0.1",value:i.agent_timeout_seconds??120,onChange:g=>h({...i,agent_timeout_seconds:parseFloat(g.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(Fe,{id:"enable_jargon_detection",checked:i.enable_jargon_detection??!0,onCheckedChange:g=>h({...i,enable_jargon_detection:g})}),e.jsx(T,{htmlFor:"enable_jargon_detection",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(Fe,{id:"global_memory",checked:i.global_memory??!1,onCheckedChange:g=>h({...i,global_memory:g})}),e.jsx(T,{htmlFor:"global_memory",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-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"emoji_chance",children:"่กจๆƒ…ๅŒ…ๆฟ€ๆดปๆฆ‚็އ"}),e.jsx(ne,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:n.emoji_chance,onChange:g=>x({...n,emoji_chance:parseFloat(g.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่Œƒๅ›ด 0-1๏ผŒ่ถŠๅคง่ถŠๅฎนๆ˜“ๅ‘้€่กจๆƒ…ๅŒ…"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_reg_num",children:"ๆœ€ๅคงๆณจๅ†Œๆ•ฐ้‡"}),e.jsx(ne,{id:"max_reg_num",type:"number",min:"1",value:n.max_reg_num,onChange:g=>x({...n,max_reg_num:parseInt(g.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆๆœ€ๅคšๅฏไปฅๆณจๅ†Œ็š„่กจๆƒ…ๅŒ…ๆ•ฐ้‡"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"check_interval",children:"ๆฃ€ๆŸฅ้—ด้š”๏ผˆๅˆ†้’Ÿ๏ผ‰"}),e.jsx(ne,{id:"check_interval",type:"number",min:"1",value:n.check_interval,onChange:g=>x({...n,check_interval:parseInt(g.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(Fe,{id:"do_replace",checked:n.do_replace,onCheckedChange:g=>x({...n,do_replace:g})}),e.jsx(T,{htmlFor:"do_replace",className:"cursor-pointer",children:"่พพๅˆฐๆœ€ๅคงๆ•ฐ้‡ๆ—ถๆ›ฟๆข่กจๆƒ…ๅŒ…"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:g=>x({...n,steal_emoji:g})}),e.jsx(T,{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(Fe,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:g=>x({...n,content_filtration:g})}),e.jsx(T,{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(T,{htmlFor:"filtration_prompt",children:"่ฟ‡ๆปค่ฆๆฑ‚"}),e.jsx(ne,{id:"filtration_prompt",value:n.filtration_prompt,onChange:g=>x({...n,filtration_prompt:g.target.value}),placeholder:"็ฌฆๅˆๅ…ฌๅบ่‰ฏไฟ—"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅชๆœ‰็ฌฆๅˆๆญค่ฆๆฑ‚็š„่กจๆƒ…ๅŒ…ๆ‰ไผš่ขซไฟๅญ˜"})]})]})]})})]})}),m_=zs.memo(function({member:n,groupIndex:i,memberIndex:c,availableChatIds:u,onUpdate:x,onRemove:h}){const f=u.includes(n)||n==="*",[p,g]=m.useState(!f);return e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 flex gap-2",children:p?e.jsxs(e.Fragment,{children:[e.jsx(ne,{value:n,onChange:N=>x(i,c,N.target.value),placeholder:'่พ“ๅ…ฅ "*" ๆˆ– "qq:123456:group"',className:"flex-1"}),u.length>0&&e.jsx(S,{size:"sm",variant:"outline",onClick:()=>g(!1),title:"ๅˆ‡ๆขๅˆฐไธ‹ๆ‹‰้€‰ๆ‹ฉ",children:"ไธ‹ๆ‹‰"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{value:n,onValueChange:N=>x(i,c,N),children:[e.jsx(Le,{className:"flex-1",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ่Šๅคฉๆต"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"*",children:"* (ๅ…จๅฑ€ๅ…ฑไบซ)"}),u.map((N,v)=>e.jsx(W,{value:N,children:N},v))]})]}),e.jsx(S,{size:"sm",variant:"outline",onClick:()=>g(!0),title:"ๅˆ‡ๆขๅˆฐๆ‰‹ๅŠจ่พ“ๅ…ฅ",children:"่พ“ๅ…ฅ"})]})}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™ค็ป„ๆˆๅ‘˜ "',n||"(็ฉบ)",'" ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>h(i,c),children:"ๅˆ ้™ค"})]})]})]})]})}),x_=zs.memo(function({config:n,onChange:i}){const c=()=>{i({...n,learning_list:[...n.learning_list,["","enable","enable","1.0"]]})},u=y=>{i({...n,learning_list:n.learning_list.filter((w,b)=>b!==y)})},x=(y,w,b)=>{const D=[...n.learning_list];D[y][w]=b,i({...n,learning_list:D})},h=({rule:y})=>{const w=`["${y[0]}", "${y[1]}", "${y[2]}", "${y[3]}"]`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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:w}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ๆ˜ฏไฟๅญ˜ๅˆฐ bot_config.toml ๆ–‡ไปถไธญ็š„ๆ ผๅผ"})]})})]})},f=()=>{i({...n,expression_groups:[...n.expression_groups,[]]})},p=y=>{i({...n,expression_groups:n.expression_groups.filter((w,b)=>b!==y)})},g=y=>{const w=[...n.expression_groups];w[y]=[...w[y],""],i({...n,expression_groups:w})},N=(y,w)=>{const b=[...n.expression_groups];b[y]=b[y].filter((D,A)=>A!==w),i({...n,expression_groups:b})},v=(y,w,b)=>{const D=[...n.expression_groups];D[y][w]=b,i({...n,expression_groups:D})};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(S,{onClick:c,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ่ง„ๅˆ™"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.learning_list.map((y,w)=>{const b=n.learning_list.some((C,M)=>M!==w&&C[0]===""),D=y[0]==="",A=y[0].split(":"),_=A[0]||"qq",H=A[1]||"",E=A[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:["่ง„ๅˆ™ ",w+1," ",D&&"๏ผˆๅ…จๅฑ€้…็ฝฎ๏ผ‰"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{rule:y}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๅญฆไน ่ง„ๅˆ™ ",w+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>u(w),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"้…็ฝฎ็ฑปๅž‹"}),e.jsxs(Be,{value:D?"global":"specific",onValueChange:C=>{C==="global"?x(w,0,""):x(w,0,"qq::group")},disabled:b&&!D,children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"global",children:"ๅ…จๅฑ€้…็ฝฎ"}),e.jsx(W,{value:"specific",disabled:b&&!D,children:"่ฏฆ็ป†้…็ฝฎ"})]})]}),b&&!D&&e.jsx("p",{className:"text-xs text-amber-600",children:"ๅทฒๅญ˜ๅœจๅ…จๅฑ€้…็ฝฎ๏ผŒๆ— ๆณ•ๅˆ›ๅปบๆ–ฐ็š„ๅ…จๅฑ€้…็ฝฎ"})]}),!D&&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(T,{className:"text-xs font-medium",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:_,onValueChange:C=>{x(w,0,`${C}:${H}:${E}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็พค ID"}),e.jsx(ne,{value:H,onChange:C=>{x(w,0,`${_}:${C.target.value}:${E}`)},placeholder:"่พ“ๅ…ฅ็พค ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็ฑปๅž‹"}),e.jsxs(Be,{value:E,onValueChange:C=>{x(w,0,`${_}:${H}:${C}`)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"group",children:"็พค็ป„๏ผˆgroup๏ผ‰"}),e.jsx(W,{value:"private",children:"็ง่Š๏ผˆprivate๏ผ‰"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉๆต ID๏ผš",y[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(T,{className:"text-xs font-medium",children:"ไฝฟ็”จๅญฆๅˆฐ็š„่กจ่พพ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๅ…่ฎธ้บฆ้บฆไฝฟ็”จไปŽ่Šๅคฉไธญๅญฆๅˆฐ็š„่กจ่พพๆ–นๅผ"})]}),e.jsx(Fe,{checked:y[1]==="enable",onCheckedChange:C=>x(w,1,C?"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(T,{className:"text-xs font-medium",children:"ๅญฆไน ่กจ่พพ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๅ…่ฎธ้บฆ้บฆไปŽ่Šๅคฉไธญๅญฆไน ๆ–ฐ็š„่กจ่พพๆ–นๅผ"})]}),e.jsx(Fe,{checked:y[2]==="enable",onCheckedChange:C=>x(w,2,C?"enable":"disable")})]})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-xs font-medium",children:"ๅญฆไน ๅผบๅบฆ"}),e.jsx(ne,{type:"number",step:"0.1",min:"0",max:"5",value:y[3],onChange:C=>{const M=parseFloat(C.target.value);isNaN(M)||x(w,3,Math.max(0,Math.min(5,M)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),e.jsx(_a,{value:[parseFloat(y[3])||1],onValueChange:C=>x(w,3,C[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/ๅญฆไน ๅผบๅบฆ๏ผˆ็ง’๏ผ‰"})]})]})]},w)}),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",{className:"space-y-6",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("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"expression_self_reflect",className:"cursor-pointer font-medium",children:"่‡ชๅŠจ่กจ่พพไผ˜ๅŒ–"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆไผš่‡ชๅŠจๆฃ€ๆŸฅๅนถไผ˜ๅŒ–่กจ่พพๆ–นๅผ๏ผŒๆ— ้œ€็ฎก็†ๅ‘˜ๆ‰‹ๅŠจๅนฒ้ข„"})]}),e.jsx(Fe,{id:"expression_self_reflect",checked:n.expression_self_reflect??!1,onCheckedChange:y=>i({...n,expression_self_reflect:y})})]}),n.expression_self_reflect&&e.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"expression_auto_check_interval",children:"่‡ชๅŠจๆฃ€ๆŸฅ้—ด้š”๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"expression_auto_check_interval",type:"number",min:"60",value:n.expression_auto_check_interval??3600,onChange:y=>i({...n,expression_auto_check_interval:parseInt(y.target.value)||3600})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค 3600 ็ง’๏ผˆ1ๅฐๆ—ถ๏ผ‰ใ€‚่ฎพ็ฝฎ้บฆ้บฆๅคšไน…ๆ‰ง่กŒไธ€ๆฌก่‡ชๅŠจ่กจ่พพๆฃ€ๆŸฅ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"expression_auto_check_count",children:"ๆฏๆฌกๆฃ€ๆŸฅๆ•ฐ้‡"}),e.jsx(ne,{id:"expression_auto_check_count",type:"number",min:"1",max:"100",value:n.expression_auto_check_count??10,onChange:y=>i({...n,expression_auto_check_count:parseInt(y.target.value)||10})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้ป˜่ฎค 10 ๆกใ€‚ๆฏๆฌก่‡ชๅŠจๆฃ€ๆŸฅๆ—ถ้šๆœบ้€‰ๅ–็š„่กจ่พพๆ–นๅผๆ•ฐ้‡"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"่‡ชๅฎšไน‰่ฏ„ไผฐๆ ‡ๅ‡†"}),e.jsxs(S,{onClick:()=>{i({...n,expression_auto_check_custom_criteria:[...n.expression_auto_check_custom_criteria||[],""]})},size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๆ ‡ๅ‡†"]})]}),e.jsxs("div",{className:"space-y-2",children:[(n.expression_auto_check_custom_criteria||[]).map((y,w)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:y,onChange:b=>{const D=[...n.expression_auto_check_custom_criteria||[]];D[w]=b.target.value,i({...n,expression_auto_check_custom_criteria:D})},placeholder:"่พ“ๅ…ฅ่ฏ„ไผฐๆ ‡ๅ‡†๏ผŒไพ‹ๅฆ‚๏ผšๆ˜ฏๅฆ็ฌฆๅˆ่ง’่‰ฒไบบ่ฎพ",className:"flex-1"}),e.jsx(S,{onClick:()=>{i({...n,expression_auto_check_custom_criteria:(n.expression_auto_check_custom_criteria||[]).filter((b,D)=>D!==w)})},size:"icon",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},w)),(!n.expression_auto_check_custom_criteria||n.expression_auto_check_custom_criteria.length===0)&&e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:'ๆš‚ๆ— ่‡ชๅฎšไน‰ๆ ‡ๅ‡†๏ผŒ็‚นๅ‡ป"ๆทปๅŠ ๆ ‡ๅ‡†"ๅผ€ๅง‹้…็ฝฎ'})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ไบ›ๆ ‡ๅ‡†ไผš่ขซๆทปๅŠ ๅˆฐ่ฏ„ไผฐๆ็คบ่ฏไธญ๏ผŒไฝœไธบ้ขๅค–็š„่ฏ„ไผฐ่ฆๆฑ‚"})]})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"expression_checked_only",className:"cursor-pointer font-medium",children:"ไป…ไฝฟ็”จๅทฒๆฃ€ๆŸฅ็š„่กจ่พพๆ–นๅผ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅผ€ๅฏๅŽ๏ผŒๅชๆœ‰ checked=True ไธ” rejected=False ็š„่กจ่พพๆ–นๅผๆ‰ไผš่ขซ้€‰ๆ‹ฉไฝฟ็”จใ€‚ๅ…ณ้—ญๅŽ๏ผŒๅชๆŽ’้™ค rejected=True ็š„่กจ่พพๆ–นๅผ"})]}),e.jsx(Fe,{id:"expression_checked_only",checked:n.expression_checked_only??!1,onCheckedChange:y=>i({...n,expression_checked_only:y})})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{htmlFor:"expression_manual_reflect",className:"cursor-pointer font-medium",children:"ๆ‰‹ๅŠจ่กจ่พพไผ˜ๅŒ–"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆไผšไธปๅŠจๅ‘็ฎก็†ๅ‘˜่ฏข้—ฎ่กจ่พพๆ–นๅผๆ˜ฏๅฆๅˆ้€‚"})]}),e.jsx(Fe,{id:"expression_manual_reflect",checked:n.expression_manual_reflect??!1,onCheckedChange:y=>i({...n,expression_manual_reflect:y})})]}),n.expression_manual_reflect&&e.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-primary/20",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 w=(n.manual_reflect_operator_id||"").split(":"),b=w[0]||"qq",D=w[1]||"",A=w[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(T,{className:"text-xs font-medium",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:b,onValueChange:_=>{i({...n,manual_reflect_operator_id:`${_}:${D}:${A}`})},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็”จๆˆท/็พค ID"}),e.jsx(ne,{value:D,onChange:_=>{i({...n,manual_reflect_operator_id:`${b}:${_.target.value}:${A}`})},placeholder:"่พ“ๅ…ฅ ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"็ฑปๅž‹"}),e.jsxs(Be,{value:A,onValueChange:_=>{i({...n,manual_reflect_operator_id:`${b}:${D}:${_}`})},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"private",children:"็ง่Š๏ผˆprivate๏ผ‰"}),e.jsx(W,{value:"group",children:"็พค็ป„๏ผˆgroup๏ผ‰"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๅฝ“ๅ‰ๆ“ไฝœๅ‘˜ ID๏ผš",n.manual_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(S,{onClick:()=>{i({...n,allow_reflect:[...n.allow_reflect||[],"qq::group"]})},size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ่Šๅคฉๆต"]})]}),e.jsxs("div",{className:"space-y-2",children:[(n.allow_reflect||[]).map((y,w)=>{const b=y.split(":"),D=b[0]||"qq",A=b[1]||"",_=b[2]||"group";return e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50",children:[e.jsxs(Be,{value:D,onValueChange:H=>{const E=[...n.allow_reflect];E[w]=`${H}:${A}:${_}`,i({...n,allow_reflect:E})},children:[e.jsx(Le,{className:"w-24",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"qq",children:"QQ"}),e.jsx(W,{value:"wx",children:"ๅพฎไฟก"})]})]}),e.jsx(ne,{value:A,onChange:H=>{const E=[...n.allow_reflect];E[w]=`${D}:${H.target.value}:${_}`,i({...n,allow_reflect:E})},placeholder:"ID",className:"flex-1 font-mono text-sm"}),e.jsxs(Be,{value:_,onValueChange:H=>{const E=[...n.allow_reflect];E[w]=`${D}:${A}:${H}`,i({...n,allow_reflect:E})},children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"group",children:"็พค็ป„"}),e.jsx(W,{value:"private",children:"็ง่Š"})]})]}),e.jsx(S,{onClick:()=>{i({...n,allow_reflect:n.allow_reflect.filter((H,E)=>E!==w)})},size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},w)}),(!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(S,{onClick:f,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๅ…ฑไบซ็ป„"]})]}),e.jsxs("div",{className:"space-y-4",children:[n.expression_groups.map((y,w)=>{const b=n.learning_list.map(D=>D[0]).filter(D=>D!=="");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:["ๅ…ฑไบซ็ป„ ",w+1,y.length===1&&y[0]==="*"&&"๏ผˆๅ…จๅฑ€ๅ…ฑไบซ๏ผ‰"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{onClick:()=>g(w),size:"sm",variant:"outline",children:e.jsx(Zs,{className:"h-4 w-4"})}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๅ…ฑไบซ็ป„ ",w+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>p(w),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsx("div",{className:"space-y-2",children:y.map((D,A)=>e.jsx(m_,{member:D,groupIndex:w,memberIndex:A,availableChatIds:b,onUpdate:v,onRemove:N},`${w}-${A}`))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'ๆ็คบ๏ผšๅฏไปฅไปŽไธ‹ๆ‹‰ๆก†้€‰ๆ‹ฉๅทฒ้…็ฝฎ็š„่Šๅคฉๆต๏ผŒๆˆ–ๆ‰‹ๅŠจ่พ“ๅ…ฅใ€‚่พ“ๅ…ฅ "*" ๅฏ็”จๅ…จๅฑ€ๅ…ฑไบซ'})]},w)}),n.expression_groups.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-4",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"้ป‘่ฏ่ฎพ็ฝฎ"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"all_global_jargon",checked:n.all_global_jargon??!1,onCheckedChange:y=>i({...n,all_global_jargon:y})}),e.jsx(T,{htmlFor:"all_global_jargon",className:"cursor-pointer",children:"ๅ…จๅฑ€้ป‘่ฏๆจกๅผ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"ๅผ€ๅฏๅŽ๏ผŒๆ–ฐๅขž็š„้ป‘่ฏๅฐ†้ป˜่ฎค่ฎพไธบๅ…จๅฑ€๏ผˆๆ‰€ๆœ‰่Šๅคฉๆตๅ…ฑไบซ๏ผ‰ใ€‚ๅ…ณ้—ญๅŽ๏ผŒๅทฒ่ฎฐๅฝ•็š„ๅ…จๅฑ€้ป‘่ฏไธไผšๆ”นๅ˜๏ผŒ้œ€่ฆๆ‰‹ๅŠจๅˆ ้™คใ€‚"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"enable_jargon_explanation",checked:n.enable_jargon_explanation??!0,onCheckedChange:y=>i({...n,enable_jargon_explanation:y})}),e.jsx(T,{htmlFor:"enable_jargon_explanation",className:"cursor-pointer",children:"ๅฏ็”จ้ป‘่ฏ่งฃ้‡Š"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"ๅœจๅ›žๅคๅ‰ๅฐ่ฏ•ๅฏนไธŠไธ‹ๆ–‡ไธญ็š„้ป‘่ฏ่ฟ›่กŒ่งฃ้‡Šใ€‚ๅ…ณ้—ญๅฏๅ‡ๅฐ‘ไธ€ๆฌกLLM่ฐƒ็”จ๏ผŒไป…ๅฝฑๅ“ๅ›žๅคๅ‰็š„้ป‘่ฏๅŒน้…ไธŽ่งฃ้‡Š๏ผŒไธๅฝฑๅ“้ป‘่ฏๅญฆไน ใ€‚"})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"jargon_mode",children:"้ป‘่ฏ่งฃ้‡Šๆฅๆบๆจกๅผ"}),e.jsxs(Be,{value:n.jargon_mode??"context",onValueChange:y=>i({...n,jargon_mode:y}),children:[e.jsx(Le,{id:"jargon_mode",className:"mt-2",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ้ป‘่ฏ่งฃ้‡Šๆฅๆบ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"context",children:"ไธŠไธ‹ๆ–‡ๆจกๅผ๏ผˆ่‡ชๅŠจๅŒน้…้ป‘่ฏ๏ผ‰"}),e.jsx(W,{value:"planner",children:"Plannerๆจกๅผ๏ผˆไฝฟ็”จunknown_wordsๅˆ—่กจ๏ผ‰"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["ไธŠไธ‹ๆ–‡ๆจกๅผ๏ผšไฝฟ็”จไธŠไธ‹ๆ–‡่‡ชๅŠจๅŒน้…้ป‘่ฏๅนถ่งฃ้‡Š",e.jsx("br",{}),"Plannerๆจกๅผ๏ผšไป…ไฝฟ็”จPlannerๅœจreplyๅŠจไฝœไธญ็ป™ๅ‡บ็š„unknown_wordsๅˆ—่กจ่ฟ›่กŒ้ป‘่ฏๆฃ€็ดข"]})]})]})]})});function h_({regex:l,reaction:n,onRegexChange:i,onReactionChange:c}){const[u,x]=m.useState(!1),[h,f]=m.useState(""),[p,g]=m.useState(null),[N,v]=m.useState(""),[y,w]=m.useState({}),[b,D]=m.useState(""),A=m.useRef(null),[_,H]=m.useState("build"),E=O=>O.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),C=(O,ee=0)=>{const R=A.current;if(!R)return;const me=R.selectionStart||0,ce=R.selectionEnd||0,ve=l.substring(0,me)+O+l.substring(ce);i(ve),setTimeout(()=>{const se=me+O.length+ee;R.setSelectionRange(se,se),R.focus()},0)};m.useEffect(()=>{if(!l||!h){p!==null&&g(null),Object.keys(y).length>0&&w({}),b!==n&&D(n),N!==""&&v("");return}try{const O=E(l),ee=new RegExp(O,"g"),R=h.match(ee);g(R),v("");const ce=new RegExp(O).exec(h);if(ce&&ce.groups){w(ce.groups);let ve=n;Object.entries(ce.groups).forEach(([se,ge])=>{ve=ve.replace(new RegExp(`\\[${se}\\]`,"g"),ge||"")}),D(ve)}else w({}),D(n)}catch(O){v(O.message),g(null),w({}),D(n)}},[l,h,n,p,y,b,N]);const M=()=>{if(!h||!p||p.length===0)return e.jsx("span",{className:"text-muted-foreground",children:h||"่ฏท่พ“ๅ…ฅๆต‹่ฏ•ๆ–‡ๆœฌ"});try{const O=E(l),ee=new RegExp(O,"g");let R=0;const me=[];let ce;for(;(ce=ee.exec(h))!==null;)ce.index>R&&me.push(e.jsx("span",{children:h.substring(R,ce.index)},`text-${R}`)),me.push(e.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:ce[0]},`match-${ce.index}`)),R=ce.index+ce[0].length;return R)",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(Ps,{open:u,onOpenChange:x,children:[e.jsx(Qo,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(Gm,{className:"h-4 w-4 mr-1"}),"ๆญฃๅˆ™็ผ–่พ‘ๅ™จ"]})}),e.jsxs(Us,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ๆญฃๅˆ™่กจ่พพๅผ็ผ–่พ‘ๅ™จ"}),e.jsx(Ys,{className:"text-sm",children:"ไฝฟ็”จๅฏ่ง†ๅŒ–ๅทฅๅ…ทๆž„ๅปบๆญฃๅˆ™่กจ่พพๅผ๏ผŒๅนถๅฎžๆ—ถๆต‹่ฏ•ๆ•ˆๆžœ"})]}),e.jsx(Je,{className:"max-h-[calc(90vh-120px)]",children:e.jsxs(ra,{value:_,onValueChange:O=>H(O),className:"w-full",children:[e.jsxs(ea,{className:"grid w-full grid-cols-2",children:[e.jsx(ts,{value:"build",children:"๐Ÿ”ง ๆž„ๅปบๅ™จ"}),e.jsx(ts,{value:"test",children:"๐Ÿงช ๆต‹่ฏ•ๅ™จ"})]}),e.jsxs(bs,{value:"build",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๆญฃๅˆ™่กจ่พพๅผ"}),e.jsx(ne,{ref:A,value:l,onChange:O=>i(O.target.value),className:"font-mono text-sm",placeholder:"็‚นๅ‡ปไธ‹ๆ–นๆŒ‰้’ฎๆž„ๅปบๆญฃๅˆ™่กจ่พพๅผ..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"Reaction ๅ†…ๅฎน"}),e.jsx(at,{value:n,onChange:O=>c(O.target.value),placeholder:"ไฝฟ็”จ [ๆ•่Žท็ป„ๅ] ๅผ•็”จๆ•่Žท็š„ๅ†…ๅฎน...",rows:3,className:"text-sm"})]}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[G.map(O=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:O.category}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:O.items.map(ee=>e.jsx(S,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>C(ee.pattern,ee.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:ee.label}),e.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ee.pattern})]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ee.desc})]})},ee.label))})]},O.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(S,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>i("^(?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(S,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>i("(?:[^๏ผŒใ€‚.\\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(S,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>i("(?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(bs,{value:"test",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๅฝ“ๅ‰ๆญฃๅˆ™่กจ่พพๅผ"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:l||"(ๆœช่ฎพ็ฝฎ)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"test-text",className:"text-sm font-medium",children:"ๆต‹่ฏ•ๆ–‡ๆœฌ"}),e.jsx(at,{id:"test-text",value:h,onChange:O=>f(O.target.value),placeholder:`ๅœจๆญค่พ“ๅ…ฅ่ฆๆต‹่ฏ•็š„ๆ–‡ๆœฌ... +ไพ‹ๅฆ‚๏ผšๆ‰“ๆธธๆˆๆ˜ฏ่ฟ™ๆ ท็š„`,className:"min-h-[100px] text-sm"})]}),N&&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:N})]}),!N&&h&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:p&&p.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:["ๅŒน้…ๆˆๅŠŸ (",p.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(T,{className:"text-sm font-medium",children:"ๅŒน้…้ซ˜ไบฎ"}),e.jsx(Je,{className:"h-40 rounded-md bg-muted p-3",children:e.jsx("div",{className:"text-sm break-words",children:M()})})]}),Object.keys(y).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"ๅ‘ฝๅๆ•่Žท็ป„"}),e.jsx(Je,{className:"h-32 rounded-md border p-3",children:e.jsx("div",{className:"space-y-2",children:Object.entries(y).map(([O,ee])=>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:["[",O,"]"]}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ee})]},O))})})]}),Object.keys(y).length>0&&n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"Reaction ๆ›ฟๆข้ข„่งˆ"}),e.jsx(Je,{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:b})}),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:"ๅฆ‚้œ€ไฟฎๆ”นๆญฃๅˆ™๏ผŒๅˆ‡ๆขๅ›žๆž„ๅปบๅ™จๆ ‡็ญพ้กต"})]})]})]})]})})]})]})}const f_=zs.memo(function({keywordReactionConfig:n,responsePostProcessConfig:i,chineseTypoConfig:c,responseSplitterConfig:u,onKeywordReactionChange:x,onResponsePostProcessChange:h,onChineseTypoChange:f,onResponseSplitterChange:p}){const g=()=>{x({...n,regex_rules:[...n.regex_rules,{regex:[""],reaction:""}]})},N=C=>{x({...n,regex_rules:n.regex_rules.filter((M,G)=>G!==C)})},v=(C,M,G)=>{const O=[...n.regex_rules];M==="regex"&&typeof G=="string"?O[C]={...O[C],regex:[G]}:M==="reaction"&&typeof G=="string"&&(O[C]={...O[C],reaction:G}),x({...n,regex_rules:O})},y=()=>{x({...n,keyword_rules:[...n.keyword_rules,{keywords:[],reaction:""}]})},w=C=>{x({...n,keyword_rules:n.keyword_rules.filter((M,G)=>G!==C)})},b=(C,M,G)=>{const O=[...n.keyword_rules];typeof G=="string"&&(O[C]={...O[C],reaction:G}),x({...n,keyword_rules:O})},D=C=>{const M=[...n.keyword_rules];M[C]={...M[C],keywords:[...M[C].keywords||[],""]},x({...n,keyword_rules:M})},A=(C,M)=>{const G=[...n.keyword_rules];G[C]={...G[C],keywords:(G[C].keywords||[]).filter((O,ee)=>ee!==M)},x({...n,keyword_rules:G})},_=(C,M,G)=>{const O=[...n.keyword_rules],ee=[...O[C].keywords||[]];ee[M]=G,O[C]={...O[C],keywords:ee},x({...n,keyword_rules:O})},H=({rule:C})=>{const M=`{ regex = [${(C.regex||[]).map(G=>`"${G}"`).join(", ")}], reaction = "${C.reaction}" }`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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(Je,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs break-all",children:M})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฟ™ๆ˜ฏไฟๅญ˜ๅˆฐ bot_config.toml ๆ–‡ไปถไธญ็š„ๆ ผๅผ"})]})})]})},E=({rule:C})=>{const M=`[[keyword_reaction.keyword_rules]] keywords = [${(C.keywords||[]).map(G=>`"${G}"`).join(", ")}] -reaction = "${C.reaction}"`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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(Je,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:M})}),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(S,{onClick:g,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๆญฃๅˆ™่ง„ๅˆ™"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.regex_rules.map((C,M)=>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:["ๆญฃๅˆ™่ง„ๅˆ™ ",M+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h_,{regex:C.regex&&C.regex[0]||"",reaction:C.reaction,onRegexChange:G=>v(M,"regex",G),onReactionChange:G=>v(M,"reaction",G)}),e.jsx(P,{rule:C}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๆญฃๅˆ™่ง„ๅˆ™ ",M+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>N(M),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"ๆญฃๅˆ™่กจ่พพๅผ๏ผˆPython ่ฏญๆณ•๏ผ‰"}),e.jsx(ne,{value:C.regex&&C.regex[0]||"",onChange:G=>v(M,"regex",G.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(T,{className:"text-xs font-medium",children:"ๅๅบ”ๅ†…ๅฎน"}),e.jsx(at,{value:C.reaction,onChange:G=>v(M,"reaction",G.target.value),placeholder:`่งฆๅ‘ๅŽ้บฆ้บฆ็š„ๅๅบ”... -ๅฏไปฅไฝฟ็”จ [ๆ•่Žท็ป„ๅ] ๆฅๅผ•็”จๆญฃๅˆ™่กจ่พพๅผไธญ็š„ๅ†…ๅฎน`,rows:3,className:"text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไฝฟ็”จ [ๆ•่Žท็ป„ๅ] ๅผ•็”จๆญฃๅˆ™่กจ่พพๅผไธญ็š„ๅ‘ฝๅๆ•่Žท็ป„๏ผŒไพ‹ๅฆ‚ [n] ไผš่ขซๆ›ฟๆขไธบๆ•่Žท็š„ๅ†…ๅฎน"})]})]})]},M)),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(S,{onClick:y,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๅ…ณ้”ฎ่ฏ่ง„ๅˆ™"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.keyword_rules.map((C,M)=>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:["ๅ…ณ้”ฎ่ฏ่ง„ๅˆ™ ",M+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{rule:C}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๅ…ณ้”ฎ่ฏ่ง„ๅˆ™ ",M+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>w(M),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(T,{className:"text-xs font-medium",children:"ๅ…ณ้”ฎ่ฏๅˆ—่กจ"}),e.jsxs(S,{onClick:()=>D(M),size:"sm",variant:"ghost",children:[e.jsx(Zs,{className:"h-3 w-3 mr-1"}),"ๆทปๅŠ ๅ…ณ้”ฎ่ฏ"]})]}),e.jsxs("div",{className:"space-y-2",children:[(C.keywords||[]).map((G,O)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{value:G,onChange:ee=>_(M,O,ee.target.value),placeholder:"ๅ…ณ้”ฎ่ฏ",className:"flex-1"}),e.jsx(S,{onClick:()=>A(M,O),size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},O)),(!C.keywords||C.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(T,{className:"text-xs font-medium",children:"ๅๅบ”ๅ†…ๅฎน"}),e.jsx(at,{value:C.reaction,onChange:G=>b(M,"reaction",G.target.value),placeholder:"่งฆๅ‘ๅŽ้บฆ้บฆ็š„ๅๅบ”...",rows:3,className:"text-sm"})]})]})]},M)),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(Ve,{id:"enable_response_post_process",checked:i.enable_response_post_process,onCheckedChange:C=>h({...i,enable_response_post_process:C})}),e.jsx(T,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"ๅฏ็”จๅ›žๅคๅŽๅค„็†"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"ๅŒ…ๆ‹ฌ้”™ๅˆซๅญ—็”Ÿๆˆๅ™จๅ’Œๅ›žๅคๅˆ†ๅ‰ฒๅ™จ"})]}),i.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:C=>f({...c,enable:C})}),e.jsx(T,{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(T,{htmlFor:"error_rate",className:"text-xs font-medium",children:"ๅ•ๅญ—ๆ›ฟๆขๆฆ‚็އ"}),e.jsx(ne,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.error_rate,onChange:C=>f({...c,error_rate:parseFloat(C.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"min_freq",className:"text-xs font-medium",children:"ๆœ€ๅฐๅญ—้ข‘้˜ˆๅ€ผ"}),e.jsx(ne,{id:"min_freq",type:"number",min:"0",value:c.min_freq,onChange:C=>f({...c,min_freq:parseInt(C.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"ๅฃฐ่ฐƒ้”™่ฏฏๆฆ‚็އ"}),e.jsx(ne,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:c.tone_error_rate,onChange:C=>f({...c,tone_error_rate:parseFloat(C.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"ๆ•ด่ฏๆ›ฟๆขๆฆ‚็އ"}),e.jsx(ne,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.word_replace_rate,onChange:C=>f({...c,word_replace_rate:parseFloat(C.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:u.enable,onCheckedChange:C=>p({...u,enable:C})}),e.jsx(T,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"ๅ›žๅคๅˆ†ๅ‰ฒๅ™จ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"ๆŽงๅˆถๅ›žๅค็š„้•ฟๅบฆๅ’Œๅฅๅญๆ•ฐ้‡"}),u.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(T,{htmlFor:"max_length",className:"text-xs font-medium",children:"ๆœ€ๅคง้•ฟๅบฆ"}),e.jsx(ne,{id:"max_length",type:"number",min:"1",value:u.max_length,onChange:C=>p({...u,max_length:parseInt(C.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ›žๅคๅ…่ฎธ็š„ๆœ€ๅคงๅญ—็ฌฆๆ•ฐ"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"ๆœ€ๅคงๅฅๅญๆ•ฐ"}),e.jsx(ne,{id:"max_sentence_num",type:"number",min:"1",value:u.max_sentence_num,onChange:C=>p({...u,max_sentence_num:parseInt(C.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:u.enable_kaomoji_protection,onCheckedChange:C=>p({...u,enable_kaomoji_protection:C})}),e.jsx(T,{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:u.enable_overflow_return_all,onCheckedChange:C=>p({...u,enable_overflow_return_all:C})}),e.jsx(T,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"่ถ…ๅ‡บๆ—ถไธ€ๆฌกๆ€ง่ฟ”ๅ›žๅ…จ้ƒจ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"ๅฝ“ๅฅๅญๆ•ฐ้‡่ถ…ๅ‡บ้™ๅˆถๆ—ถ๏ผŒๅˆๅนถๅŽไธ€ๆฌกๆ€ง่ฟ”ๅ›žๆ‰€ๆœ‰ๅ†…ๅฎน"})]})]})})]})]})]})}),p_=zs.memo(function({config:n,onChange:i}){const[c,u]=m.useState(""),[x,h]=m.useState(""),[f,p]=m.useState(!1),g=n.allowed_ips?n.allowed_ips.split(",").map(_=>_.trim()).filter(_=>_):[],N=n.trusted_proxies?n.trusted_proxies.split(",").map(_=>_.trim()).filter(_=>_):[],v=()=>{if(!c.trim())return;const _=[...g,c.trim()];i({...n,allowed_ips:_.join(",")}),u("")},y=_=>{const P=g.filter((E,C)=>C!==_);i({...n,allowed_ips:P.join(",")})},w=()=>{if(!x.trim())return;const _=[...N,x.trim()];i({...n,trusted_proxies:_.join(",")}),h("")},b=_=>{const P=N.filter((E,C)=>C!==_);i({...n,trusted_proxies:P.join(",")})},D=_=>{!_&&n.enabled?p(!0):i({...n,enabled:_})},A=()=>{i({...n,enabled:!1}),p(!1)};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:"WebUI ๆœๅŠก้…็ฝฎ"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.enabled,onCheckedChange:D}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ WebUI"})]}),n.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"่ฟ่กŒๆจกๅผ"}),e.jsxs(Be,{value:n.mode,onValueChange:_=>i({...n,mode:_}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ่ฟ่กŒๆจกๅผ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"development",children:"ๅผ€ๅ‘ๆจกๅผ"}),e.jsx(W,{value:"production",children:"็”Ÿไบงๆจกๅผ"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆณจๆ„: WebUI ็š„็›‘ๅฌๅœฐๅ€ๅ’Œ็ซฏๅฃ่ฏทๅœจ .env ๆ–‡ไปถไธญ้…็ฝฎ WEBUI_HOST ๅ’Œ WEBUI_PORT"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"้˜ฒ็ˆฌ่™ซๆจกๅผ"}),e.jsxs(Be,{value:n.anti_crawler_mode,onValueChange:_=>i({...n,anti_crawler_mode:_}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ้˜ฒ็ˆฌ่™ซๆจกๅผ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"false",children:"็ฆ็”จ"}),e.jsx(W,{value:"basic",children:"ๅŸบ็ก€๏ผˆๅช่ฎฐๅฝ•ไธ้˜ปๆญข๏ผ‰"}),e.jsx(W,{value:"loose",children:"ๅฎฝๆพ"}),e.jsx(W,{value:"strict",children:"ไธฅๆ ผ"})]})]})]}),e.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[e.jsx(T,{children:"IP ็™ฝๅๅ•"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:c,onChange:_=>u(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),v())},placeholder:"่พ“ๅ…ฅIPๅœฐๅ€ๅŽๆŒ‰ๅ›ž่ฝฆๆˆ–็‚นๅ‡ปๆทปๅŠ "}),e.jsx(S,{type:"button",size:"sm",onClick:v,disabled:!c.trim(),children:e.jsx(Zs,{className:"h-4 w-4"})})]}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:g.map((_,P)=>e.jsxs(ke,{variant:"secondary",className:"flex items-center gap-1",children:[_,e.jsx("button",{type:"button",onClick:()=>y(P),className:"ml-1 hover:bg-destructive/20 rounded-full p-0.5",children:e.jsx(Ca,{className:"h-3 w-3"})})]},P))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ”ฏๆŒ็ฒพ็กฎIPใ€CIDRๆ ผๅผๅ’Œ้€š้…็ฌฆ๏ผˆๅฆ‚๏ผš127.0.0.1ใ€192.168.1.0/24๏ผ‰"})]}),e.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[e.jsx(T,{children:"ไฟกไปป็š„ไปฃ็† IP"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:x,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),w())},placeholder:"่พ“ๅ…ฅไปฃ็†IPๅŽๆŒ‰ๅ›ž่ฝฆๆˆ–็‚นๅ‡ปๆทปๅŠ "}),e.jsx(S,{type:"button",size:"sm",onClick:w,disabled:!x.trim(),children:e.jsx(Zs,{className:"h-4 w-4"})})]}),N.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:N.map((_,P)=>e.jsxs(ke,{variant:"secondary",className:"flex items-center gap-1",children:[_,e.jsx("button",{type:"button",onClick:()=>b(P),className:"ml-1 hover:bg-destructive/20 rounded-full p-0.5",children:e.jsx(Ca,{className:"h-3 w-3"})})]},P))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅชๆœ‰ๆฅ่‡ช่ฟ™ไบ›IP็š„X-Forwarded-Forๅคดๆ‰่ขซไฟกไปป"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.trust_xff,onCheckedChange:_=>i({...n,trust_xff:_})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ X-Forwarded-For ไปฃ็†่งฃๆž"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{checked:n.secure_cookie,onCheckedChange:_=>i({...n,secure_cookie:_})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จๅฎ‰ๅ…จ Cookie๏ผˆไป… HTTPS๏ผ‰"})]})]})]}),e.jsx(js,{open:f,onOpenChange:p,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"่ญฆๅ‘Š๏ผšๅณๅฐ†ๅ…ณ้—ญ WebUI"}),e.jsxs(hs,{children:["ๅ…ณ้—ญ WebUI ๅŽ๏ผŒๅœจๆ‚จไธ‹ๆฌก้‡ๅฏ้บฆ้บฆไน‹ๅ‰๏ผŒWebUI ็•Œ้ขๅฐ†ๆ— ๆณ•่ฎฟ้—ฎใ€‚",e.jsx("br",{}),e.jsx("br",{}),"ๆ‚จ้œ€่ฆ้€š่ฟ‡ไฟฎๆ”น้…็ฝฎๆ–‡ไปถๆˆ–ๅ‘ฝไปค่กŒ้‡ๆ–ฐๅฏ็”จ WebUI ๆ‰่ƒฝๅ†ๆฌก่ฎฟ้—ฎๆญค็•Œ้ขใ€‚",e.jsx("br",{}),e.jsx("br",{}),"็กฎๅฎš่ฆๅ…ณ้—ญ WebUI ๅ—๏ผŸ"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{variant:"destructive",onClick:A,children:"็กฎ่ฎคๅ…ณ้—ญ"})]})]})})]})}),pn="/api/webui/config";async function mg(){const n=await(await we(`${pn}/bot`)).json();if(!n.success)throw new Error("่Žทๅ–้…็ฝฎๆ•ฐๆฎๅคฑ่ดฅ");return n.config}async function cn(){const n=await(await we(`${pn}/model`)).json();if(!n.success)throw new Error("่Žทๅ–ๆจกๅž‹้…็ฝฎๆ•ฐๆฎๅคฑ่ดฅ");return n.config}async function xg(l){const i=await(await we(`${pn}/bot`,{method:"POST",body:JSON.stringify(l)})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function g_(){const n=await(await we(`${pn}/bot/raw`)).json();if(!n.success)throw new Error("่Žทๅ–้…็ฝฎๆบไปฃ็ ๅคฑ่ดฅ");return n.content}async function j_(l){const i=await(await we(`${pn}/bot/raw`,{method:"POST",body:JSON.stringify({raw_content:l})})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function Fi(l){const i=await(await we(`${pn}/model`,{method:"POST",body:JSON.stringify(l)})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function v_(l,n){const c=await(await we(`${pn}/bot/section/${l}`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||`ไฟๅญ˜้…็ฝฎ่Š‚ ${l} ๅคฑ่ดฅ`)}async function Om(l,n){const c=await(await we(`${pn}/model/section/${l}`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||`ไฟๅญ˜้…็ฝฎ่Š‚ ${l} ๅคฑ่ดฅ`)}async function N_(l,n="openai",i="/models"){const c=new URLSearchParams({provider_name:l,parser:n,endpoint:i}),u=await we(`/api/webui/models/list?${c}`);if(!u.ok){const h=await u.json().catch(()=>({}));throw new Error(h.detail||`่Žทๅ–ๆจกๅž‹ๅˆ—่กจๅคฑ่ดฅ (${u.status})`)}const x=await u.json();if(!x.success)throw new Error("่Žทๅ–ๆจกๅž‹ๅˆ—่กจๅคฑ่ดฅ");return x.models}async function b_(l){const n=new URLSearchParams({provider_name:l}),i=await we(`/api/webui/models/test-connection-by-name?${n}`,{method:"POST"});if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c.detail||`ๆต‹่ฏ•่ฟžๆŽฅๅคฑ่ดฅ (${i.status})`)}return await i.json()}const y_=Hr("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"}}),it=m.forwardRef(({className:l,variant:n,...i},c)=>e.jsx("div",{ref:c,role:"alert",className:H(y_({variant:n}),l),...i}));it.displayName="Alert";const Un=m.forwardRef(({className:l,...n},i)=>e.jsx("h5",{ref:i,className:H("mb-1 font-medium leading-none tracking-tight",l),...n}));Un.displayName="AlertTitle";const ct=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:H("text-sm [&_p]:leading-relaxed",l),...n}));ct.displayName="AlertDescription";const w_={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(l,n){let i;if(!n.inString&&(i=l.match(/^('''|"""|'|")/))&&(n.stringType=i[0],n.inString=!0),l.sol()&&!n.inString&&n.inArray===0&&(n.lhs=!0),n.inString){for(;n.inString;)if(l.match(n.stringType))n.inString=!1;else if(l.peek()==="\\")l.next(),l.next();else{if(l.eol())break;l.match(/^.[^\\\"\']*/)}return n.lhs?"property":"string"}else{if(n.inArray&&l.peek()==="]")return l.next(),n.inArray--,"bracket";if(n.lhs&&l.peek()==="["&&l.skipTo("]"))return l.next(),l.peek()==="]"&&l.next(),"atom";if(l.peek()==="#")return l.skipToEnd(),"comment";if(l.eatSpace())return null;if(n.lhs&&l.eatWhile(function(c){return c!="="&&c!=" "}))return"property";if(n.lhs&&l.peek()==="=")return l.next(),n.lhs=!1,null;if(!n.lhs&&l.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!n.lhs&&(l.match("true")||l.match("false")))return"atom";if(!n.lhs&&l.peek()==="[")return n.inArray++,l.next(),"bracket";if(!n.lhs&&l.match(/^\-?\d+(?:\.\d+)?/))return"number";l.eatSpace()||l.next()}return null},languageData:{commentTokens:{line:"#"}}},__={python:[j1()],json:[v1(),N1()],toml:[g1.define(w_)],text:[]};function cv({value:l,onChange:n,language:i="text",readOnly:c=!1,height:u="400px",minHeight:x,maxHeight:h,placeholder:f,theme:p="dark",className:g=""}){const[N,v]=m.useState(!1);if(m.useEffect(()=>{v(!0)},[]),!N)return e.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${g}`,style:{height:u,minHeight:x,maxHeight:h}});const y=[...__[i]||[],tg.lineWrapping];return c&&y.push(tg.editable.of(!1)),e.jsx("div",{className:`rounded-md overflow-hidden border ${g}`,children:e.jsx(b1,{value:l,height:u,minHeight:x,maxHeight:h,theme:p==="dark"?y1:void 0,extensions:y,onChange:n,placeholder:f,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 S_({id:l,index:n,itemType:i,itemFields:c,value:u,onChange:x,onRemove:h,disabled:f,canRemove:p,placeholder:g}){const{attributes:N,listeners:v,setNodeRef:y,transform:w,transition:b,isDragging:D}=Vj({id:l,disabled:f}),A={transform:qj.Transform.toString(w),transition:b};return e.jsxs("div",{ref:y,style:A,className:H("flex items-start gap-2 group",D&&"opacity-50 z-50"),children:[e.jsx("button",{type:"button",className:H("flex-shrink-0 p-2 cursor-grab active:cursor-grabbing","text-muted-foreground hover:text-foreground transition-colors","opacity-0 group-hover:opacity-100 focus:opacity-100",f&&"cursor-not-allowed opacity-30"),...N,...v,children:e.jsx(_j,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex-1 min-w-0",children:i==="object"&&c?e.jsx(k_,{value:u,onChange:x,fields:c,disabled:f}):i==="number"?e.jsx(ne,{type:"number",value:u??"",onChange:_=>x(parseFloat(_.target.value)||0),placeholder:g??`็ฌฌ ${n+1} ้กน`,disabled:f,className:"font-mono"}):e.jsx(ne,{type:"text",value:u??"",onChange:_=>x(_.target.value),placeholder:g??`็ฌฌ ${n+1} ้กน`,disabled:f})}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",onClick:h,disabled:f||!p,className:H("flex-shrink-0 text-muted-foreground hover:text-destructive","opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity"),children:e.jsx(ns,{className:"h-4 w-4"})})]})}function k_({value:l,onChange:n,fields:i,disabled:c}){const u=m.useCallback((h,f)=>{n({...l,[h]:f})},[l,n]),x=(h,f)=>{const p=l?.[h];if(f.type==="boolean"||f.type==="switch")return e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx(Ve,{checked:!!(p??f.default),onCheckedChange:g=>u(h,g),disabled:c})]});if(f.type==="slider"||f.type==="number"&&f.min!=null&&f.max!=null){const g=p??f.default??f.min??0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e.jsx(_a,{value:[g],onValueChange:N=>u(h,N[0]),min:f.min??0,max:f.max??100,step:f.step??1,disabled:c,className:"py-1"})]})}return f.type==="select"&&f.choices?e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsxs(Be,{value:String(p??f.default??""),onValueChange:g=>u(h,g),disabled:c,children:[e.jsx(Le,{className:"h-8 text-sm",children:e.jsx($e,{placeholder:f.placeholder??"่ฏท้€‰ๆ‹ฉ"})}),e.jsx(Ue,{children:f.choices.map(g=>e.jsx(W,{value:String(g),children:String(g)},String(g)))})]})]}):f.type==="number"?e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx(ne,{type:"number",value:p??f.default??"",onChange:g=>u(h,parseFloat(g.target.value)||0),placeholder:f.placeholder,disabled:c,className:"h-8 text-sm"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx(ne,{type:"text",value:p??f.default??"",onChange:g=>u(h,g.target.value),placeholder:f.placeholder,disabled:c,className:"h-8 text-sm"})]})};return e.jsx(Ce,{className:"p-3 space-y-2 bg-muted/30",children:Object.entries(i).map(([h,f])=>e.jsx("div",{children:x(h,f)},h))})}function C_({value:l,onChange:n,itemType:i="string",itemFields:c,minItems:u,maxItems:x,disabled:h,placeholder:f}){const p=m.useMemo(()=>Array.isArray(l)?l:typeof l=="string"&&l.trim()?l.split(",").map(E=>E.trim()):[],[l]),[g]=m.useState(()=>new Map),N=m.useCallback(E=>(g.has(E)||g.set(E,`item-${Date.now()}-${E}-${Math.random().toString(36).slice(2)}`),g.get(E)),[g]),v=m.useMemo(()=>{const E=[];for(let C=0;C{const{active:C,over:M}=E;if(M&&C.id!==M.id){const G=v.indexOf(C.id),O=v.indexOf(M.id),ee=Pj(p,G,O);n(ee)}},[p,v,n]),b=m.useCallback(()=>{if(x!=null&&p.length>=x)return;let E;i==="object"&&c?E=Object.fromEntries(Object.entries(c).map(([C,M])=>[C,M.default??""])):i==="number"?E=0:E="",n([...p,E])},[p,x,i,c,n]),D=m.useCallback((E,C)=>{const M=[...p];M[E]=C,n(M)},[p,n]),A=m.useCallback(E=>{if(u!=null&&p.length<=u)return;const C=p.filter((M,G)=>G!==E);g.delete(E),n(C)},[p,u,g,n]),_=x==null||p.lengthu;return e.jsxs("div",{className:"space-y-2",children:[p.length===0?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-4 justify-center border border-dashed rounded-md",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx("span",{children:"ๆš‚ๆ— ๆ•ฐๆฎ๏ผŒ็‚นๅ‡ปไธ‹ๆ–นๆŒ‰้’ฎๆทปๅŠ "})]}):e.jsx(Hj,{sensors:y,collisionDetection:Fj,onDragEnd:w,children:e.jsx(Gj,{items:v,strategy:w1,children:e.jsx("div",{className:"space-y-2",children:p.map((E,C)=>e.jsx(S_,{id:v[C],index:C,itemType:i,itemFields:c,value:E,onChange:M=>D(C,M),onRemove:()=>A(C),disabled:h,canRemove:P,placeholder:f},v[C]))})})}),e.jsxs(S,{type:"button",variant:"outline",size:"sm",onClick:b,disabled:h||!_,className:"w-full",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ้กน็›ฎ",x!==void 0&&e.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",p.length,"/",x,")"]})]}),(u!=null||x!=null)&&(u!==null||x!==null)&&e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:u!=null&&x!=null?`ๅ…่ฎธ ${u} - ${x} ้กน`:u!=null?`่‡ณๅฐ‘ ${u} ้กน`:`ๆœ€ๅคš ${x} ้กน`})]})}function Km({content:l,className:n=""}){return e.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${n}`,children:e.jsx(E1,{remarkPlugins:[A1,z1],rehypePlugins:[M1],components:{code({inline:i,className:c,children:u,...x}){return i?e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...x,children:u}):e.jsx("code",{className:`${c} block bg-muted p-4 rounded-lg overflow-x-auto`,...x,children:u})},table({children:i,...c}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{className:"border-collapse border border-border",...c,children:i})})},th({children:i,...c}){return e.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...c,children:i})},td({children:i,...c}){return e.jsx("td",{className:"border border-border px-4 py-2",...c,children:i})},a({children:i,...c}){return e.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...c,children:i})},blockquote({children:i,...c}){return e.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...c,children:i})},h1({children:i,...c}){return e.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...c,children:i})},h2({children:i,...c}){return e.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...c,children:i})},h3({children:i,...c}){return e.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...c,children:i})},h4({children:i,...c}){return e.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...c,children:i})},ul({children:i,...c}){return e.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...c,children:i})},ol({children:i,...c}){return e.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...c,children:i})},p({children:i,...c}){return e.jsx("p",{className:"my-2 leading-relaxed",...c,children:i})},hr({...i}){return e.jsx("hr",{className:"my-4 border-border",...i})}},children:l})})}function T_(l,n,i,c={}){const{debounceMs:u=2e3,onSaveSuccess:x,onSaveError:h}=c,f=m.useRef(null),p=m.useCallback(async(y,w)=>{try{n(!0),await v_(y,w),i(!1),x?.()}catch(b){console.error(`่‡ชๅŠจไฟๅญ˜ ${y} ๅคฑ่ดฅ:`,b),i(!0),h?.(b instanceof Error?b:new Error(String(b)))}finally{n(!1)}},[n,i,x,h]),g=m.useCallback((y,w)=>{l||(i(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{p(y,w)},u))},[l,i,p,u]),N=m.useCallback(async(y,w)=>{f.current&&(clearTimeout(f.current),f.current=null),await p(y,w)},[p]),v=m.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]);return m.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),{triggerAutoSave:g,saveNow:N,cancelPendingAutoSave:v}}function It(l,n,i,c){m.useEffect(()=>{l&&!i&&c(n,l)},[l])}const E_=500;function M_(){return e.jsx(Vn,{children:e.jsx(A_,{})})}function A_(){const[l,n]=m.useState(!0),[i,c]=m.useState(!1),[u,x]=m.useState(!1),[h,f]=m.useState(!1),[p,g]=m.useState("visual"),[N,v]=m.useState(""),[y,w]=m.useState(!1),{toast:b}=st(),{triggerRestart:D,isRestarting:A}=fn(),[_,P]=m.useState(null),[E,C]=m.useState(null),[M,G]=m.useState(null),[O,ee]=m.useState(null),[R,me]=m.useState(null),[ce,ve]=m.useState(null),[se,ge]=m.useState(null),[fe,z]=m.useState(null),[Q,$]=m.useState(null),[L,I]=m.useState(null),[_e,je]=m.useState(null),[Se,K]=m.useState(null),[U,V]=m.useState(null),[xe,Ae]=m.useState(null),[X,oe]=m.useState(null),[Fe,Y]=m.useState(null),[te,Oe]=m.useState(null),[De,Me]=m.useState(null),[de,Te]=m.useState(null),rs=m.useRef(!0),Rt=m.useRef({}),sa=m.useCallback(Ee=>{Rt.current=Ee,P(Ee.bot),C(Ee.personality);const vs=Ee.chat;vs.talk_value_rules||(vs.talk_value_rules=[]),G(vs),ee(Ee.expression),me(Ee.emoji),ve(Ee.memory),ge(Ee.tool),z(Ee.voice),$(Ee.dream),I(Ee.lpmm_knowledge),je(Ee.keyword_reaction),K(Ee.response_post_process),V(Ee.chinese_typo),Ae(Ee.response_splitter),oe(Ee.log),Y(Ee.debug),Oe(Ee.maim_message),Me(Ee.telemetry),Te(Ee.webui)},[]),Ga=m.useCallback(()=>({...Rt.current,bot:_,personality:E,chat:M,expression:O,emoji:R,memory:ce,tool:se,voice:fe,dream:Q,lpmm_knowledge:L,keyword_reaction:_e,response_post_process:Se,chinese_typo:U,response_splitter:xe,log:X,debug:Fe,maim_message:te,telemetry:De,webui:de}),[_,E,M,O,R,ce,se,fe,Q,L,_e,Se,U,xe,X,Fe,te,De,de]),Pt=m.useCallback(async()=>{try{const vs=(await g_()).replace(/"([^"]*)"/g,(ls,es)=>`"${es.replace(/\\n/g,` -`).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}"`);v(vs),w(!1)}catch(Ee){b({variant:"destructive",title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Ee instanceof Error?Ee.message:"ๅŠ ่ฝฝๆบไปฃ็ ๅคฑ่ดฅ"})}},[b]),ut=m.useCallback(async()=>{try{n(!0);const Ee=await mg();sa(Ee),f(!1),rs.current=!1,await Pt()}catch(Ee){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",Ee),b({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅŠ ่ฝฝ้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}finally{n(!1)}},[b,Pt,sa]);m.useEffect(()=>{ut()},[ut]);const{triggerAutoSave:q,cancelPendingAutoSave:qe}=T_(rs.current,x,f);It(_,"bot",rs.current,q),It(E,"personality",rs.current,q),It(M,"chat",rs.current,q),It(O,"expression",rs.current,q),It(R,"emoji",rs.current,q),It(ce,"memory",rs.current,q),It(se,"tool",rs.current,q),It(fe,"voice",rs.current,q),It(L,"lpmm_knowledge",rs.current,q),It(_e,"keyword_reaction",rs.current,q),It(Se,"response_post_process",rs.current,q),It(U,"chinese_typo",rs.current,q),It(xe,"response_splitter",rs.current,q),It(X,"log",rs.current,q),It(Fe,"debug",rs.current,q),It(te,"maim_message",rs.current,q),It(De,"telemetry",rs.current,q),It(de,"webui",rs.current,q);const Qe=async()=>{try{c(!0);const Ee=N.replace(/"([^"]*)"/g,(vs,ls)=>`"${ls.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}"`);await j_(Ee),f(!1),w(!1),b({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜"}),await ut()}catch(Ee){w(!0),b({variant:"destructive",title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Ee instanceof Error?Ee.message:"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ"})}finally{c(!1)}},We=async Ee=>{if(h){b({variant:"destructive",title:"ๅˆ‡ๆขๅคฑ่ดฅ",description:"่ฏทๅ…ˆไฟๅญ˜ๅฝ“ๅ‰ๆ›ดๆ”น"});return}if(g(Ee),Ee==="source")await Pt();else try{const vs=await mg();sa(vs),f(!1)}catch(vs){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",vs),b({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅŠ ่ฝฝ้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}},Ds=async()=>{try{c(!0),qe(),await xg(Ga()),f(!1),b({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้บฆ้บฆไธป็จ‹ๅบ้…็ฝฎๅทฒไฟๅญ˜"})}catch(Ee){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",Ee),b({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Ee.message,variant:"destructive"})}finally{c(!1)}},as=async()=>{await D()},ks=async()=>{try{c(!0),qe(),await xg(Ga()),f(!1),b({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜๏ผŒๅณๅฐ†้‡ๅฏ้บฆ้บฆ..."}),await new Promise(Ee=>setTimeout(Ee,E_)),await as()}catch(Ee){console.error("ไฟๅญ˜ๅคฑ่ดฅ:",Ee),b({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Ee.message,variant:"destructive"})}finally{c(!1)}};return l?e.jsx(Je,{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(Je,{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(S,{onClick:p==="visual"?Ds:Qe,disabled:i||u||!h||A,size:"sm",variant:"outline",className:"w-20 sm:w-24",children:[e.jsx(sc,{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:i?"ไฟๅญ˜ไธญ":u?"่‡ชๅŠจ":h?"ไฟๅญ˜":"ๅทฒไฟๅญ˜"})]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{disabled:i||u||A,size:"sm",className:"w-20 sm:w-28",children:[e.jsx(ec,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"ml-1 truncate text-xs sm:text-sm",children:A?"้‡ๅฏไธญ":h?"ไฟๅญ˜้‡ๅฏ":"้‡ๅฏ"})]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๅฏ้บฆ้บฆ๏ผŸ"}),e.jsx(hs,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:h?"ๅฝ“ๅ‰ๆœ‰ๆœชไฟๅญ˜็š„้…็ฝฎๆ›ดๆ”นใ€‚็‚นๅ‡ป็กฎ่ฎคๅฐ†ๅ…ˆไฟๅญ˜้…็ฝฎ,็„ถๅŽ้‡ๅฏ้บฆ้บฆไฝฟๆ–ฐ้…็ฝฎ็”Ÿๆ•ˆใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟใ€‚":"ๅณๅฐ†้‡ๅฏ้บฆ้บฆไธป็จ‹ๅบใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟ,้…็ฝฎๅฐ†ๅœจ้‡ๅฏๅŽ็”Ÿๆ•ˆใ€‚"})})})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:h?ks:as,children:h?"ไฟๅญ˜ๅนถ้‡ๅฏ":"็กฎ่ฎค้‡ๅฏ"})]})]})]})]})]}),e.jsx("div",{className:"flex",children:e.jsx(ra,{value:p,onValueChange:Ee=>We(Ee),className:"w-full",children:e.jsxs(Wt,{className:"h-8 sm:h-9 w-full grid grid-cols-2",children:[e.jsxs(ts,{value:"visual",className:"text-xs sm:text-sm",children:[e.jsx(Sj,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"ๅฏ่ง†ๅŒ–็ผ–่พ‘"]}),e.jsxs(ts,{value:"source",className:"text-xs sm:text-sm",children:[e.jsx(kj,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"ๆบไปฃ็ ็ผ–่พ‘"]})]})})})]}),e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(ct,{children:["้…็ฝฎๆ›ดๆ–ฐๅŽ้œ€่ฆ",e.jsx("strong",{children:"้‡ๅฏ้บฆ้บฆ"}),'ๆ‰่ƒฝ็”Ÿๆ•ˆใ€‚ไฝ ๅฏไปฅ็‚นๅ‡ปๅณไธŠ่ง’็š„"ไฟๅญ˜ๅนถ้‡ๅฏ"ๆŒ‰้’ฎไธ€้”ฎๅฎŒๆˆไฟๅญ˜ๅ’Œ้‡ๅฏใ€‚']})]}),p==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(ct,{children:[e.jsx("strong",{children:"ๆบไปฃ็ ๆจกๅผ๏ผˆ้ซ˜็บงๅŠŸ่ƒฝ๏ผ‰๏ผš"}),"็›ดๆŽฅ็ผ–่พ‘ TOML ้…็ฝฎๆ–‡ไปถใ€‚ๆญคๅŠŸ่ƒฝไป…้€‚็”จไบŽ็†Ÿๆ‚‰ TOML ่ฏญๆณ•็š„้ซ˜็บง็”จๆˆทใ€‚ไฟๅญ˜ๆ—ถไผšๅœจๅŽ็ซฏ้ชŒ่ฏๆ ผๅผ๏ผŒๅชๆœ‰ๆ ผๅผๅฎŒๅ…จๆญฃ็กฎๆ‰่ƒฝไฟๅญ˜ใ€‚",y&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"โš ๏ธ ไธŠๆฌกไฟๅญ˜ๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ TOML ๆ ผๅผ"})]})]}),e.jsx(cv,{value:N,onChange:Ee=>{v(Ee),f(!0),y&&w(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML ้…็ฝฎๅ†…ๅฎน"})]}),p==="visual"&&e.jsx(e.Fragment,{children:e.jsxs(ra,{defaultValue:"bot",className:"w-full",children:[e.jsxs(Wt,{className:"flex flex-wrap h-auto gap-1 p-1 sm:grid sm:grid-cols-5 lg:grid-cols-10",children:[e.jsx(ts,{value:"bot",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅŸบๆœฌไฟกๆฏ"}),e.jsx(ts,{value:"personality",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ไบบๆ ผ"}),e.jsx(ts,{value:"chat",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"่Šๅคฉ"}),e.jsx(ts,{value:"expression",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"่กจ่พพ"}),e.jsx(ts,{value:"features",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅŠŸ่ƒฝ"}),e.jsx(ts,{value:"processing",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅค„็†"}),e.jsx(ts,{value:"dream",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅšๆขฆ"}),e.jsx(ts,{value:"lpmm",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"็Ÿฅ่ฏ†ๅบ“"}),e.jsx(ts,{value:"webui",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"WebUI"}),e.jsx(ts,{value:"other",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅ…ถไป–"})]}),e.jsx(bs,{value:"bot",className:"space-y-4",children:_&&e.jsx(Z2,{config:_,onChange:P})}),e.jsx(bs,{value:"personality",className:"space-y-4",children:E&&e.jsx(W2,{config:E,onChange:C})}),e.jsx(bs,{value:"chat",className:"space-y-4",children:M&&e.jsx(l_,{config:M,onChange:G})}),e.jsx(bs,{value:"expression",className:"space-y-4",children:O&&e.jsx(x_,{config:O,onChange:ee})}),e.jsx(bs,{value:"features",className:"space-y-4",children:R&&ce&&se&&fe&&e.jsx(u_,{emojiConfig:R,memoryConfig:ce,toolConfig:se,voiceConfig:fe,onEmojiChange:me,onMemoryChange:ve,onToolChange:ge,onVoiceChange:z})}),e.jsx(bs,{value:"processing",className:"space-y-4",children:_e&&Se&&U&&xe&&e.jsx(f_,{keywordReactionConfig:_e,responsePostProcessConfig:Se,chineseTypoConfig:U,responseSplitterConfig:xe,onKeywordReactionChange:je,onResponsePostProcessChange:K,onChineseTypoChange:V,onResponseSplitterChange:Ae})}),e.jsx(bs,{value:"dream",className:"space-y-4",children:Q&&e.jsx(n_,{config:Q,onChange:$})}),e.jsx(bs,{value:"lpmm",className:"space-y-4",children:L&&e.jsx(r_,{config:L,onChange:I})}),e.jsx(bs,{value:"webui",className:"space-y-4",children:de&&e.jsx(p_,{config:de,onChange:Te})}),e.jsxs(bs,{value:"other",className:"space-y-4",children:[X&&e.jsx(i_,{config:X,onChange:oe}),Fe&&e.jsx(c_,{config:Fe,onChange:Y}),te&&e.jsx(o_,{config:te,onChange:Oe}),De&&e.jsx(d_,{config:De,onChange:Me})]})]})}),e.jsx(qn,{})]})})}const zl=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:i,className:H("w-full caption-bottom text-sm",l),...n})}));zl.displayName="Table";const Dl=m.forwardRef(({className:l,...n},i)=>e.jsx("thead",{ref:i,className:H("[&_tr]:border-b",l),...n}));Dl.displayName="TableHeader";const Ol=m.forwardRef(({className:l,...n},i)=>e.jsx("tbody",{ref:i,className:H("[&_tr:last-child]:border-0",l),...n}));Ol.displayName="TableBody";const z_=m.forwardRef(({className:l,...n},i)=>e.jsx("tfoot",{ref:i,className:H("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",l),...n}));z_.displayName="TableFooter";const ot=m.forwardRef(({className:l,...n},i)=>e.jsx("tr",{ref:i,className:H("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",l),...n}));ot.displayName="TableRow";const Ze=m.forwardRef(({className:l,...n},i)=>e.jsx("th",{ref:i,className:H("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...n}));Ze.displayName="TableHead";const Ke=m.forwardRef(({className:l,...n},i)=>e.jsx("td",{ref:i,className:H("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...n}));Ke.displayName="TableCell";const D_=m.forwardRef(({className:l,...n},i)=>e.jsx("caption",{ref:i,className:H("mt-4 text-sm text-muted-foreground",l),...n}));D_.displayName="TableCaption";const Qo=m.forwardRef(({className:l,...n},i)=>e.jsx(pa,{ref:i,className:H("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",l),...n}));Qo.displayName=pa.displayName;const Yo=m.forwardRef(({className:l,...n},i)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Ot,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(pa.Input,{ref:i,className:H("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",l),...n})]}));Yo.displayName=pa.Input.displayName;const Jo=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.List,{ref:i,className:H("max-h-[300px] overflow-y-auto overflow-x-hidden",l),...n}));Jo.displayName=pa.List.displayName;const Xo=m.forwardRef((l,n)=>e.jsx(pa.Empty,{ref:n,className:"py-6 text-center text-sm",...l}));Xo.displayName=pa.Empty.displayName;const Yi=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.Group,{ref:i,className:H("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",l),...n}));Yi.displayName=pa.Group.displayName;const O_=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.Separator,{ref:i,className:H("-mx-1 h-px bg-border",l),...n}));O_.displayName=pa.Separator.displayName;const Ji=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.Item,{ref:i,className:H("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",l),...n}));Ji.displayName=pa.Item.displayName;const Ws=m.forwardRef(({className:l,...n},i)=>e.jsx(uj,{ref:i,className:H("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",l),...n,children:e.jsx(Cw,{className:H("grid place-content-center text-current"),children:e.jsx(_t,{className:"h-4 w-4"})})}));Ws.displayName=uj.displayName;const ov=m.createContext(null),dv="maibot-completed-tours";function R_(){try{const l=localStorage.getItem(dv);return l?new Set(JSON.parse(l)):new Set}catch{return new Set}}function hg(l){localStorage.setItem(dv,JSON.stringify([...l]))}function L_({children:l}){const[n,i]=m.useState({activeTourId:null,stepIndex:0,isRunning:!1}),[c]=m.useState(()=>new Map),[u,x]=m.useState(R_),[,h]=m.useState(0),f=m.useCallback((E,C)=>{c.set(E,C),h(M=>M+1)},[c]),p=m.useCallback(E=>{c.delete(E),i(C=>C.activeTourId===E?{...C,activeTourId:null,isRunning:!1,stepIndex:0}:C)},[c]),g=m.useCallback((E,C=0)=>{c.has(E)&&i({activeTourId:E,stepIndex:C,isRunning:!0})},[c]),N=m.useCallback(()=>{i(E=>({...E,isRunning:!1}))},[]),v=m.useCallback(E=>{i(C=>({...C,stepIndex:E}))},[]),y=m.useCallback(()=>{i(E=>({...E,stepIndex:E.stepIndex+1}))},[]),w=m.useCallback(()=>{i(E=>({...E,stepIndex:Math.max(0,E.stepIndex-1)}))},[]),b=m.useCallback(()=>n.activeTourId?c.get(n.activeTourId)||[]:[],[n.activeTourId,c]),D=m.useCallback(E=>{x(C=>{const M=new Set(C);return M.add(E),hg(M),M})},[]),A=m.useCallback(E=>{const{action:C,index:M,status:G,type:O}=E,ee=["finished","skipped"];if(C==="close"){i(R=>({...R,isRunning:!1,stepIndex:0}));return}ee.includes(G)?i(R=>(G==="finished"&&R.activeTourId&&setTimeout(()=>D(R.activeTourId),0),{...R,isRunning:!1,stepIndex:0})):O==="step:after"&&(C==="next"?i(R=>({...R,stepIndex:M+1})):C==="prev"&&i(R=>({...R,stepIndex:M-1})))},[D]),_=m.useCallback(E=>u.has(E),[u]),P=m.useCallback(E=>{x(C=>{const M=new Set(C);return M.delete(E),hg(M),M})},[]);return e.jsx(ov.Provider,{value:{state:n,tours:c,registerTour:f,unregisterTour:p,startTour:g,stopTour:N,goToStep:v,nextStep:y,prevStep:w,getCurrentSteps:b,handleJoyrideCallback:A,isTourCompleted:_,markTourCompleted:D,resetTourCompleted:P},children:l})}function Qm(){const l=m.useContext(ov);if(!l)throw new Error("useTour must be used within a TourProvider");return l}const U_={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)"}},B_={back:"ไธŠไธ€ๆญฅ",close:"ๅ…ณ้—ญ",last:"ๅฎŒๆˆ",next:"ไธ‹ไธ€ๆญฅ",nextLabelWithProgress:"ไธ‹ไธ€ๆญฅ ({step}/{steps})",open:"ๆ‰“ๅผ€ๅฏน่ฏๆก†",skip:"่ทณ่ฟ‡"};function $_(){const{state:l,getCurrentSteps:n,handleJoyrideCallback:i}=Qm(),c=n(),[u,x]=m.useState(!1),h=m.useRef(l.stepIndex),f=m.useRef(null);m.useEffect(()=>{h.current!==l.stepIndex&&(x(!1),h.current=l.stepIndex)},[l.stepIndex]),m.useEffect(()=>{if(!l.isRunning||c.length===0){x(!1);return}const v=c[l.stepIndex];if(!v){x(!1);return}const y=v.target;if(y==="body"){x(!0);return}x(!1);const w=setTimeout(()=>{const b=()=>{const P=document.querySelector(y);if(P){const E=P.getBoundingClientRect();if(E.width>0&&E.height>0)return!0}return!1};if(b()){setTimeout(()=>x(!0),100);return}const D=setInterval(()=>{b()&&(clearInterval(D),setTimeout(()=>x(!0),100))},100),A=setTimeout(()=>{clearInterval(D),x(!0)},5e3),_=()=>{clearInterval(D),clearTimeout(A)};f.current=_},150);return()=>{clearTimeout(w),f.current&&(f.current(),f.current=null)}},[l.isRunning,l.stepIndex,c]);const[p,g]=m.useState(null);if(m.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)),g(v),()=>{}},[]),!l.isRunning||c.length===0||!u)return null;const N=e.jsx(S1,{steps:c,stepIndex:l.stepIndex,run:l.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:i,styles:U_,locale:B_,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${l.stepIndex}`);return p?u0.createPortal(N,p):N}const al="model-assignment-tour",uv=[{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}],mv={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"},$i=[{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 fg(l){return l?l.replace(/\/+$/,"").toLowerCase():""}function I_(l){if(!l)return null;const n=fg(l);return $i.find(i=>i.id!=="custom"&&fg(i.base_url)===n)||null}const yo=l=>({...l,max_retry:l.max_retry??2,timeout:l.timeout??30,retry_interval:l.retry_interval??10}),P_=l=>{const n={};return l?(l.name?.trim()||(n.name="่ฏท่พ“ๅ…ฅๆไพ›ๅ•†ๅ็งฐ"),l.base_url?.trim()||(n.base_url="่ฏท่พ“ๅ…ฅๅŸบ็ก€ URL"),l.api_key?.trim()||(n.api_key="่ฏท่พ“ๅ…ฅ API Key"),{isValid:Object.keys(n).length===0,errors:n}):{isValid:!1,errors:{name:"ๆไพ›ๅ•†ๆ•ฐๆฎไธบ็ฉบ"}}};function H_(){return e.jsx(Vn,{children:e.jsx(F_,{})})}function F_(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(!1),[h,f]=m.useState(!1),[p,g]=m.useState(!1),[N,v]=m.useState(!1),[y,w]=m.useState(null),[b,D]=m.useState(null),[A,_]=m.useState("custom"),[P,E]=m.useState(!1),[C,M]=m.useState(!1),[G,O]=m.useState(null),[ee,R]=m.useState(!1),[me,ce]=m.useState(""),[ve,se]=m.useState(new Set),[ge,fe]=m.useState(!1),[z,Q]=m.useState(1),[$,L]=m.useState(20),[I,_e]=m.useState(""),[je,Se]=m.useState({isOpen:!1,providersToDelete:[],affectedModels:[],pendingProviders:[],context:"auto",oldProviders:[]}),[K,U]=m.useState({}),[V,xe]=m.useState(new Set),[Ae,X]=m.useState(new Map),{toast:oe}=st(),Fe=ia(),{state:Y,goToStep:te,registerTour:Oe}=Qm(),{triggerRestart:De,isRestarting:Me}=fn(),de=m.useRef(null),Te=m.useRef(!0);m.useEffect(()=>{Oe(al,uv)},[Oe]),m.useEffect(()=>{if(Y.activeTourId===al&&Y.isRunning){const Z=mv[Y.stepIndex];Z&&!window.location.pathname.endsWith(Z.replace("/config/",""))&&Fe({to:Z})}},[Y.stepIndex,Y.activeTourId,Y.isRunning,Fe]);const rs=m.useRef(Y.stepIndex);m.useEffect(()=>{if(Y.activeTourId===al&&Y.isRunning){const Z=rs.current,ye=Y.stepIndex;Z>=3&&Z<=9&&ye<3&&v(!1),Z>=10&&ye>=3&&ye<=9&&(U({}),_("custom"),w({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),D(null),R(!1),v(!0)),rs.current=ye}},[Y.stepIndex,Y.activeTourId,Y.isRunning]),m.useEffect(()=>{if(Y.activeTourId!==al||!Y.isRunning)return;const Z=ye=>{const ze=ye.target,Hs=Y.stepIndex;Hs===2&&ze.closest('[data-tour="add-provider-button"]')?setTimeout(()=>te(3),300):Hs===9&&ze.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>te(10),300)};return document.addEventListener("click",Z,!0),()=>document.removeEventListener("click",Z,!0)},[Y,te]),m.useEffect(()=>{Rt()},[]);const Rt=async()=>{try{c(!0);const Z=await cn();n(Z.api_providers||[]),g(!1),Te.current=!1}catch(Z){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",Z)}finally{c(!1)}},sa=async()=>{await De()},Ga=async()=>{try{x(!0),de.current&&clearTimeout(de.current);const Z=l.map(lt=>({...lt,max_retry:lt.max_retry??2,timeout:lt.timeout??30,retry_interval:lt.retry_interval??10})),{shouldProceed:ye}=await Pt(Z,"restart");if(!ye){x(!1);return}const ze=await cn(),Hs=new Set(Z.map(lt=>lt.name)),Jt=(ze.models||[]).filter(lt=>Hs.has(lt.api_provider));ze.api_providers=Z,ze.models=Jt,await Fi(ze),g(!1),oe({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆญฃๅœจ้‡ๅฏ้บฆ้บฆ..."}),await sa()}catch(Z){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",Z),oe({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Z.message,variant:"destructive"}),x(!1)}},Pt=m.useCallback(async(Z,ye="auto")=>{try{const ze=await cn(),Hs=new Set(l.map(mt=>mt.name)),zt=new Set(Z.map(mt=>mt.name)),Jt=Array.from(Hs).filter(mt=>!zt.has(mt));if(Jt.length===0)return{shouldProceed:!0,providers:Z};const Xt=(ze.models||[]).filter(mt=>Jt.includes(mt.api_provider));return Xt.length===0?{shouldProceed:!0,providers:Z}:(Se({isOpen:!0,providersToDelete:Jt,affectedModels:Xt,pendingProviders:Z,context:ye,oldProviders:[...l]}),{shouldProceed:!1,providers:Z})}catch(ze){return console.error("ๆฃ€ๆŸฅๅˆ ้™คๅฝฑๅ“ๅคฑ่ดฅ:",ze),{shouldProceed:!0,providers:Z}}},[l]),ut=async()=>{try{(je.context==="auto"?f:x)(!0),Se(mt=>({...mt,isOpen:!1}));const ye=await cn(),ze=je.pendingProviders.map(yo),Hs=new Set(ze.map(mt=>mt.name)),Jt=(ye.models||[]).filter(mt=>Hs.has(mt.api_provider)),lt=new Set(je.affectedModels.map(mt=>mt.name)),Xt=ye.model_task_config;Xt&&Object.keys(Xt).forEach(mt=>{const re=Xt[mt];re&&Array.isArray(re.model_list)&&(re.model_list=re.model_list.filter(he=>!lt.has(he)))}),ye.api_providers=ze,ye.models=Jt,ye.model_task_config=Xt,await Fi(ye),n(je.pendingProviders),g(!1),oe({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${je.providersToDelete.length} ไธชๆไพ›ๅ•†ๅ’Œ ${je.affectedModels.length} ไธชๅ…ณ่”ๆจกๅž‹`}),Se({isOpen:!1,providersToDelete:[],affectedModels:[],pendingProviders:[],context:"auto",oldProviders:[]}),se(new Set),je.context==="restart"&&await sa()}catch(Z){console.error("ๅˆ ้™คๅคฑ่ดฅ:",Z),oe({title:"ๅˆ ้™คๅคฑ่ดฅ",description:Z.message,variant:"destructive"})}finally{je.context==="auto"?f(!1):x(!1)}},q=()=>{je.oldProviders.length>0&&n(je.oldProviders),Se({isOpen:!1,providersToDelete:[],affectedModels:[],pendingProviders:[],context:"auto",oldProviders:[]}),g(!1)},qe=m.useCallback(async Z=>{if(Te.current)return;const{shouldProceed:ye}=await Pt(Z,"auto");if(!ye){g(!0);return}try{f(!0);const ze=Z.map(yo);await Om("api_providers",ze),g(!1)}catch(ze){console.error("่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ:",ze),oe({title:"่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ",description:ze.message,variant:"destructive"}),g(!0)}finally{f(!1)}},[l,Pt]);m.useEffect(()=>{if(!Te.current)return g(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{qe(l)},2e3),()=>{de.current&&clearTimeout(de.current)}},[l,qe]);const Qe=async()=>{try{x(!0),de.current&&clearTimeout(de.current);const Z=l.map(yo),{shouldProceed:ye}=await Pt(Z,"manual");if(!ye){x(!1);return}const ze=await cn(),Hs=new Set(Z.map(lt=>lt.name)),zt=ze.models||[],Jt=zt.filter(lt=>{const Xt=Hs.has(lt.api_provider);return Xt||console.warn(`ๆจกๅž‹ "${lt.name}" ๅผ•็”จไบ†ๅทฒๅˆ ้™ค็š„ๆไพ›ๅ•† "${lt.api_provider}"๏ผŒๅฐ†่ขซ็งป้™ค`),Xt});if(zt.length!==Jt.length){const lt=zt.length-Jt.length;oe({title:"ๆณจๆ„",description:`ๅทฒ่‡ชๅŠจ็งป้™ค ${lt} ไธชๅผ•็”จๅทฒๅˆ ้™คๆไพ›ๅ•†็š„ๆจกๅž‹`,variant:"default"})}console.log("ๅ‘้€็š„ providers ๆ•ฐๆฎ:",Z),ze.api_providers=Z,ze.models=Jt,console.log("ๅฎŒๆ•ด้…็ฝฎๆ•ฐๆฎ:",ze),await Fi(ze),g(!1),oe({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎๅทฒไฟๅญ˜"})}catch(Z){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",Z),oe({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Z.message,variant:"destructive"})}finally{x(!1)}},We=(Z,ye)=>{if(U({}),Z){const ze=$i.find(Hs=>Hs.base_url===Z.base_url&&Hs.client_type===Z.client_type);_(ze?.id||"custom"),w(Z)}else _("custom"),w({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});D(ye),R(!1),v(!0)},Ds=m.useCallback(Z=>{_(Z),E(!1);const ye=$i.find(ze=>ze.id===Z);ye&&ye.id!=="custom"?w(ze=>({...ze,name:ye.name,base_url:ye.base_url,client_type:ye.client_type})):ye?.id==="custom"&&w(ze=>({...ze,name:"",base_url:"",client_type:"openai"}))},[]),as=m.useMemo(()=>A!=="custom",[A]),ks=m.useCallback(async()=>{if(y?.api_key)try{await navigator.clipboard.writeText(y.api_key),oe({title:"ๅคๅˆถๆˆๅŠŸ",description:"API Key ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"})}catch{oe({title:"ๅคๅˆถๅคฑ่ดฅ",description:"ๆ— ๆณ•่ฎฟ้—ฎๅ‰ช่ดดๆฟ",variant:"destructive"})}},[y?.api_key,oe]),Ee=()=>{if(!y)return;const{isValid:Z,errors:ye}=P_(y);if(!Z){U(ye);return}U({});const ze=yo(y);if(b!==null){const Hs=[...l];Hs[b]=ze,n(Hs)}else n([...l,ze]);v(!1),w(null),D(null)},vs=Z=>{if(!Z&&y){const ye={...y,max_retry:y.max_retry??2,timeout:y.timeout??30,retry_interval:y.retry_interval??10};w(ye)}v(Z)},ls=Z=>{O(Z),M(!0)},es=async()=>{if(G!==null){const Z=l.filter((ze,Hs)=>Hs!==G),{shouldProceed:ye}=await Pt(Z,"manual");ye&&(n(Z),oe({title:"ๅˆ ้™คๆˆๅŠŸ",description:"ๆไพ›ๅ•†ๅทฒไปŽๅˆ—่กจไธญ็งป้™ค"}))}M(!1),O(null)},Ns=Z=>{const ye=new Set(ve);ye.has(Z)?ye.delete(Z):ye.add(Z),se(ye)},pt=()=>{if(ve.size===Es.length)se(new Set);else{const Z=Es.map((ye,ze)=>l.findIndex(Hs=>Hs===Es[ze]));se(new Set(Z))}},Lt=()=>{if(ve.size===0){oe({title:"ๆ็คบ",description:"่ฏทๅ…ˆ้€‰ๆ‹ฉ่ฆๅˆ ้™ค็š„ๆไพ›ๅ•†",variant:"default"});return}fe(!0)},tt=async()=>{const Z=l.filter((ze,Hs)=>!ve.has(Hs)),{shouldProceed:ye}=await Pt(Z,"manual");ye&&(n(Z),se(new Set),oe({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${ve.size} ไธชๆไพ›ๅ•†`})),fe(!1)},Es=m.useMemo(()=>{if(!me)return l;const Z=me.toLowerCase();return l.filter(ye=>ye.name.toLowerCase().includes(Z)||ye.base_url.toLowerCase().includes(Z)||ye.client_type.toLowerCase().includes(Z))},[l,me]),{totalPages:kt,paginatedProviders:Ut}=m.useMemo(()=>{const Z=Math.ceil(Es.length/$),ye=Es.slice((z-1)*$,z*$);return{totalPages:Z,paginatedProviders:ye}},[Es,z,$]),Ea=m.useCallback(()=>{const Z=parseInt(I);Z>=1&&Z<=kt&&(Q(Z),_e(""))},[I,kt]),Za=async Z=>{xe(ye=>new Set(ye).add(Z));try{const ye=await b_(Z);X(ze=>new Map(ze).set(Z,ye)),ye.network_ok?ye.api_key_valid===!0?oe({title:"่ฟžๆŽฅๆญฃๅธธ",description:`${Z} ็ฝ‘็ปœ่ฟžๆŽฅๆญฃๅธธ๏ผŒAPI Key ๆœ‰ๆ•ˆ (${ye.latency_ms}ms)`}):ye.api_key_valid===!1?oe({title:"่ฟžๆŽฅๆญฃๅธธไฝ† Key ๆ— ๆ•ˆ",description:`${Z} ็ฝ‘็ปœ่ฟžๆŽฅๆญฃๅธธ๏ผŒไฝ† API Key ๆ— ๆ•ˆๆˆ–ๅทฒ่ฟ‡ๆœŸ`,variant:"destructive"}):oe({title:"็ฝ‘็ปœ่ฟžๆŽฅๆญฃๅธธ",description:`${Z} ๅฏไปฅ่ฎฟ้—ฎ (${ye.latency_ms}ms)`}):oe({title:"่ฟžๆŽฅๅคฑ่ดฅ",description:ye.error||"ๆ— ๆณ•่ฟžๆŽฅๅˆฐๆไพ›ๅ•†",variant:"destructive"})}catch(ye){oe({title:"ๆต‹่ฏ•ๅคฑ่ดฅ",description:ye.message,variant:"destructive"})}finally{xe(ye=>{const ze=new Set(ye);return ze.delete(Z),ze})}},il=async()=>{for(const Z of l)await Za(Z.name)},Kn=Z=>{const ye=V.has(Z),ze=Ae.get(Z);return ye?e.jsxs(ke,{variant:"secondary",className:"gap-1",children:[e.jsx(Ls,{className:"h-3 w-3 animate-spin"}),"ๆต‹่ฏ•ไธญ"]}):ze?ze.network_ok?ze.api_key_valid===!0?e.jsxs(ke,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[e.jsx(la,{className:"h-3 w-3"}),"ๆญฃๅธธ"]}):ze.api_key_valid===!1?e.jsxs(ke,{variant:"destructive",className:"gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),"Keyๆ— ๆ•ˆ"]}):e.jsxs(ke,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[e.jsx(la,{className:"h-3 w-3"}),"ๅฏ่ฎฟ้—ฎ"]}):e.jsxs(ke,{variant:"destructive",className:"gap-1",children:[e.jsx(Mo,{className:"h-3 w-3"}),"็ฆป็บฟ"]}):null};return i?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:[ve.size>0&&e.jsxs(S,{onClick:Lt,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"ๆ‰น้‡ๅˆ ้™ค (",ve.size,")"]}),e.jsxs(S,{onClick:il,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:l.length===0||V.size>0,children:[e.jsx(El,{className:"mr-2 h-4 w-4"}),V.size>0?`ๆต‹่ฏ•ไธญ (${V.size})`:"ๆต‹่ฏ•ๅ…จ้ƒจ"]}),e.jsxs(S,{onClick:()=>We(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[e.jsx(Zs,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"ๆทปๅŠ ๆไพ›ๅ•†"]}),e.jsxs(S,{onClick:Qe,disabled:u||h||!p||Me,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(sc,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),u?"ไฟๅญ˜ไธญ...":h?"่‡ชๅŠจไฟๅญ˜ไธญ...":p?"ไฟๅญ˜้…็ฝฎ":"ๅทฒไฟๅญ˜"]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{disabled:u||h||Me,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(ec,{className:"mr-2 h-4 w-4"}),Me?"้‡ๅฏไธญ...":p?"ไฟๅญ˜ๅนถ้‡ๅฏ":"้‡ๅฏ้บฆ้บฆ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๅฏ้บฆ้บฆ๏ผŸ"}),e.jsx(hs,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:p?"ๅฝ“ๅ‰ๆœ‰ๆœชไฟๅญ˜็š„้…็ฝฎๆ›ดๆ”นใ€‚็‚นๅ‡ป็กฎ่ฎคๅฐ†ๅ…ˆไฟๅญ˜้…็ฝฎ,็„ถๅŽ้‡ๅฏ้บฆ้บฆไฝฟๆ–ฐ้…็ฝฎ็”Ÿๆ•ˆใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟใ€‚":"ๅณๅฐ†้‡ๅฏ้บฆ้บฆไธป็จ‹ๅบใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟ,้…็ฝฎๅฐ†ๅœจ้‡ๅฏๅŽ็”Ÿๆ•ˆใ€‚"})})})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:p?Ga:sa,children:p?"ไฟๅญ˜ๅนถ้‡ๅฏ":"็กฎ่ฎค้‡ๅฏ"})]})]})]})]})]}),e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(ct,{children:["้…็ฝฎๆ›ดๆ–ฐๅŽ้œ€่ฆ",e.jsx("strong",{children:"้‡ๅฏ้บฆ้บฆ"}),'ๆ‰่ƒฝ็”Ÿๆ•ˆใ€‚ไฝ ๅฏไปฅ็‚นๅ‡ปๅณไธŠ่ง’็š„"ไฟๅญ˜ๅนถ้‡ๅฏ"ๆŒ‰้’ฎไธ€้”ฎๅฎŒๆˆไฟๅญ˜ๅ’Œ้‡ๅฏใ€‚']})]}),e.jsxs(Je,{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(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆไพ›ๅ•†ๅ็งฐใ€URL ๆˆ–็ฑปๅž‹...",value:me,onChange:Z=>ce(Z.target.value),className:"pl-9"})]}),me&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["ๆ‰พๅˆฐ ",Es.length," ไธช็ป“ๆžœ"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:Es.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:me?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆไพ›ๅ•†":'ๆš‚ๆ— ๆไพ›ๅ•†้…็ฝฎ๏ผŒ็‚นๅ‡ป"ๆทปๅŠ ๆไพ›ๅ•†"ๅผ€ๅง‹้…็ฝฎ'}):Ut.map((Z,ye)=>{const ze=l.findIndex(Hs=>Hs===Z);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:Z.name}),Kn(Z.name)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:Z.base_url})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Za(Z.name),disabled:V.has(Z.name),title:"ๆต‹่ฏ•่ฟžๆŽฅ",children:V.has(Z.name)?e.jsx(Ls,{className:"h-4 w-4 animate-spin"}):e.jsx(El,{className:"h-4 w-4"})}),e.jsx(S,{variant:"default",size:"sm",onClick:()=>We(Z,ze),children:e.jsx($n,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),e.jsx(S,{size:"sm",onClick:()=>ls(ze),className:"bg-red-600 hover:bg-red-700 text-white",children:e.jsx(ns,{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:Z.client_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"ๆœ€ๅคง้‡่ฏ•"}),e.jsx("p",{className:"font-medium",children:Z.max_retry})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"่ถ…ๆ—ถ(็ง’)"}),e.jsx("p",{className:"font-medium",children:Z.timeout})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"้‡่ฏ•้—ด้š”(็ง’)"}),e.jsx("p",{className:"font-medium",children:Z.retry_interval})]})]})]},ye)})}),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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:ve.size===Es.length&&Es.length>0,onCheckedChange:pt})}),e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"ๅŸบ็ก€URL"}),e.jsx(Ze,{children:"ๅฎขๆˆท็ซฏ็ฑปๅž‹"}),e.jsx(Ze,{className:"text-right",children:"ๆœ€ๅคง้‡่ฏ•"}),e.jsx(Ze,{className:"text-right",children:"่ถ…ๆ—ถ(็ง’)"}),e.jsx(Ze,{className:"text-right",children:"้‡่ฏ•้—ด้š”(็ง’)"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:Ut.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:9,className:"text-center text-muted-foreground py-8",children:me?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆไพ›ๅ•†":'ๆš‚ๆ— ๆไพ›ๅ•†้…็ฝฎ๏ผŒ็‚นๅ‡ป"ๆทปๅŠ ๆไพ›ๅ•†"ๅผ€ๅง‹้…็ฝฎ'})}):Ut.map((Z,ye)=>{const ze=l.findIndex(Hs=>Hs===Z);return e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:ve.has(ze),onCheckedChange:()=>Ns(ze)})}),e.jsx(Ke,{children:Kn(Z.name)||e.jsx(ke,{variant:"outline",className:"text-muted-foreground",children:"ๆœชๆต‹่ฏ•"})}),e.jsx(Ke,{className:"font-medium",children:Z.name}),e.jsx(Ke,{className:"max-w-xs truncate",title:Z.base_url,children:Z.base_url}),e.jsx(Ke,{children:Z.client_type}),e.jsx(Ke,{className:"text-right",children:Z.max_retry}),e.jsx(Ke,{className:"text-right",children:Z.timeout}),e.jsx(Ke,{className:"text-right",children:Z.retry_interval}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Za(Z.name),disabled:V.has(Z.name),title:"ๆต‹่ฏ•่ฟžๆŽฅ",children:V.has(Z.name)?e.jsx(Ls,{className:"h-4 w-4 animate-spin"}):e.jsx(El,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"default",size:"sm",onClick:()=>We(Z,ze),children:[e.jsx($n,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>ls(ze),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"ๅˆ ้™ค"]})]})})]},ye)})})]})})}),Es.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(T,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:$.toString(),onValueChange:Z=>{L(parseInt(Z)),Q(1),se(new Set)},children:[e.jsx(Le,{id:"page-size-provider",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๆ˜พ็คบ ",(z-1)*$+1," ๅˆฐ"," ",Math.min(z*$,Es.length)," ๆก๏ผŒๅ…ฑ ",Es.length," ๆก"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Q(1),disabled:z===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>Q(Z=>Math.max(1,Z-1)),disabled:z===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:I,onChange:Z=>_e(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&Ea(),placeholder:z.toString(),className:"w-16 h-8 text-center",min:1,max:kt}),e.jsx(S,{variant:"outline",size:"sm",onClick:Ea,disabled:!I,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>Q(Z=>Z+1),disabled:z>=kt,children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Q(kt),disabled:z>=kt,className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]}),e.jsx(Ps,{open:N,onOpenChange:vs,children:e.jsxs(Us,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Y.isRunning,children:[e.jsxs(Bs,{children:[e.jsx($s,{children:b!==null?"็ผ–่พ‘ๆไพ›ๅ•†":"ๆทปๅŠ ๆไพ›ๅ•†"}),e.jsx(Ys,{children:"้…็ฝฎ API ๆไพ›ๅ•†็š„่ฟžๆŽฅไฟกๆฏๅ’Œๅ‚ๆ•ฐ"})]}),e.jsxs("form",{onSubmit:Z=>{Z.preventDefault(),Ee()},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(T,{htmlFor:"template",children:"ๆไพ›ๅ•†ๆจกๆฟ"}),e.jsxs(nl,{open:P,onOpenChange:E,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",role:"combobox","aria-expanded":P,className:"w-full justify-between",children:[A?$i.find(Z=>Z.id===A)?.display_name:"้€‰ๆ‹ฉๆไพ›ๅ•†ๆจกๆฟ...",e.jsx(Gm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ja,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(Qo,{children:[e.jsx(Yo,{placeholder:"ๆœ็ดขๆไพ›ๅ•†ๆจกๆฟ..."}),e.jsx(Je,{className:"h-[300px]",children:e.jsxs(Jo,{className:"max-h-none overflow-visible",children:[e.jsx(Xo,{children:"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๆฟ"}),e.jsx(Yi,{children:$i.map(Z=>e.jsxs(Ji,{value:Z.display_name,onSelect:()=>Ds(Z.id),children:[e.jsx(_t,{className:`mr-2 h-4 w-4 ${A===Z.id?"opacity-100":"opacity-0"}`}),Z.display_name]},Z.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(T,{htmlFor:"name",className:K.name?"text-destructive":"",children:"ๅ็งฐ *"}),e.jsx(ne,{id:"name",value:y?.name||"",onChange:Z=>{w(ye=>ye?{...ye,name:Z.target.value}:null),K.name&&U(ye=>({...ye,name:void 0}))},placeholder:"ไพ‹ๅฆ‚: DeepSeek, SiliconFlow",className:K.name?"border-destructive focus-visible:ring-destructive":""}),K.name&&e.jsx("p",{className:"text-xs text-destructive",children:K.name})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[e.jsx(T,{htmlFor:"base_url",className:K.base_url?"text-destructive":"",children:"ๅŸบ็ก€ URL *"}),e.jsx(ne,{id:"base_url",value:y?.base_url||"",onChange:Z=>{w(ye=>ye?{...ye,base_url:Z.target.value}:null),K.base_url&&U(ye=>({...ye,base_url:void 0}))},placeholder:"https://api.example.com/v1",disabled:as,className:`${as?"bg-muted cursor-not-allowed":""} ${K.base_url?"border-destructive focus-visible:ring-destructive":""}`}),K.base_url&&e.jsx("p",{className:"text-xs text-destructive",children:K.base_url}),as&&!K.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(T,{htmlFor:"api_key",className:K.api_key?"text-destructive":"",children:"API Key *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{id:"api_key",type:ee?"text":"password",value:y?.api_key||"",onChange:Z=>{w(ye=>ye?{...ye,api_key:Z.target.value}:null),K.api_key&&U(ye=>({...ye,api_key:void 0}))},placeholder:"sk-...",className:`flex-1 ${K.api_key?"border-destructive focus-visible:ring-destructive":""}`}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:()=>R(!ee),title:ee?"้š่—ๅฏ†้’ฅ":"ๆ˜พ็คบๅฏ†้’ฅ",children:ee?e.jsx(qi,{className:"h-4 w-4"}):e.jsx(na,{className:"h-4 w-4"})}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:ks,title:"ๅคๅˆถๅฏ†้’ฅ",children:e.jsx(Eo,{className:"h-4 w-4"})})]}),K.api_key&&e.jsx("p",{className:"text-xs text-destructive",children:K.api_key})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"client_type",children:"ๅฎขๆˆท็ซฏ็ฑปๅž‹"}),e.jsxs(Be,{value:y?.client_type||"openai",onValueChange:Z=>w(ye=>ye?{...ye,client_type:Z}:null),disabled:as,children:[e.jsx(Le,{id:"client_type",className:as?"bg-muted cursor-not-allowed":"",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅฎขๆˆท็ซฏ็ฑปๅž‹"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"openai",children:"OpenAI"}),e.jsx(W,{value:"gemini",children:"Gemini"})]})]}),as&&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(T,{htmlFor:"max_retry",children:"ๆœ€ๅคง้‡่ฏ•"}),e.jsx(ne,{id:"max_retry",type:"number",min:"0",value:y?.max_retry??"",onChange:Z=>{const ye=Z.target.value===""?null:parseInt(Z.target.value);w(ze=>ze?{...ze,max_retry:ye}:null)},placeholder:"้ป˜่ฎค: 2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"timeout",children:"่ถ…ๆ—ถ(็ง’)"}),e.jsx(ne,{id:"timeout",type:"number",min:"1",value:y?.timeout??"",onChange:Z=>{const ye=Z.target.value===""?null:parseInt(Z.target.value);w(ze=>ze?{...ze,timeout:ye}:null)},placeholder:"้ป˜่ฎค: 30"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"retry_interval",children:"้‡่ฏ•้—ด้š”(็ง’)"}),e.jsx(ne,{id:"retry_interval",type:"number",min:"1",value:y?.retry_interval??"",onChange:Z=>{const ye=Z.target.value===""?null:parseInt(Z.target.value);w(ze=>ze?{...ze,retry_interval:ye}:null)},placeholder:"้ป˜่ฎค: 10"})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>v(!1),"data-tour":"provider-cancel-button",children:"ๅ–ๆถˆ"}),e.jsx(S,{type:"submit","data-tour":"provider-save-button",children:"ไฟๅญ˜"})]})]})]})}),e.jsx(js,{open:C,onOpenChange:M,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๆไพ›ๅ•† "',G!==null?l[G]?.name:"",'" ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:es,children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:ge,onOpenChange:fe,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",ve.size," ไธชๆไพ›ๅ•†ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:tt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๆ‰น้‡ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:je.isOpen,onOpenChange:Z=>Se(ye=>({...ye,isOpen:Z})),children:e.jsxs(ds,{className:"max-w-2xl",children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™คๆไพ›ๅ•†"}),e.jsx(hs,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["ๆ‚จๅณๅฐ†ๅˆ ้™คไปฅไธ‹ๆไพ›ๅ•†๏ผš",e.jsx("strong",{className:"text-foreground ml-1",children:je.providersToDelete.join(", ")})]}),e.jsxs("p",{className:"text-yellow-600 dark:text-yellow-500 font-medium",children:["โš ๏ธ ๆญคๆ“ไฝœๅฐ†ๅŒๆ—ถๅˆ ้™ค ",je.affectedModels.length," ไธชๅ…ณ่”็š„ๆจกๅž‹๏ผš"]}),e.jsx(Je,{className:"h-32 w-full rounded border p-3",children:e.jsx("div",{className:"space-y-1",children:je.affectedModels.map((Z,ye)=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-mono text-muted-foreground",children:"โ€ข"}),e.jsx("span",{className:"ml-2 font-medium",children:Z.name}),e.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",Z.model_identifier,")"]})]},ye))})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"่ฟ™ไบ›ๆจกๅž‹ๅฐ†ไปŽๆจกๅž‹ๅˆ—่กจๅ’Œๆ‰€ๆœ‰ไปปๅŠกๅˆ†้…ไธญ็งป้™คใ€‚ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"})]})})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:q,children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ut,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎคๅˆ ้™ค"})]})]})}),e.jsx(qn,{})]})}function Gi(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,11)}`}function ym(l){return l===null?"null":Array.isArray(l)?"array":typeof l=="object"?"object":typeof l=="boolean"?"boolean":typeof l=="number"?"number":"string"}function Rm(l){return Object.entries(l).map(([n,i])=>{const c=ym(i),u={id:Gi(),key:n,value:i,type:c,expanded:!0};return c==="object"&&i&&typeof i=="object"?u.children=Rm(i):c==="array"&&Array.isArray(i)&&(u.children=i.map((x,h)=>{const f=ym(x),p={id:Gi(),key:String(h),value:x,type:f,expanded:!0};return f==="object"&&x&&typeof x=="object"?p.children=Rm(x):f==="array"&&Array.isArray(x)&&(p.children=x.map((g,N)=>({id:Gi(),key:String(N),value:g,type:ym(g),expanded:!0}))),p})),u})}function Lm(l){const n={};for(const i of l)i.key.trim()&&(i.type==="object"&&i.children?n[i.key]=Lm(i.children):i.type==="array"&&i.children?n[i.key]=i.children.map(c=>c.type==="object"&&c.children?Lm(c.children):c.type==="array"&&c.children?c.children.map(u=>u.value):c.value):i.type==="null"?n[i.key]=null:n[i.key]=i.value);return n}function pg(l,n){switch(n){case"boolean":return l==="true";case"number":{const i=parseFloat(l);return isNaN(i)?0:i}case"null":return null;default:return l}}function xv({node:l,level:n,onUpdate:i,onRemove:c,onAddChild:u,onToggleExpand:x}){const h=l.type==="object"||l.type==="array",f=l.children&&l.children.length>0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"grid gap-2 items-center",style:{gridTemplateColumns:h?"32px 1fr 90px 64px":"32px 1fr 1fr 90px 32px",paddingLeft:`${n*20}px`},children:[e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>x(l.id),disabled:!h||!f,children:h&&f?l.expanded?e.jsx(Ta,{className:"h-4 w-4"}):e.jsx(ea,{className:"h-4 w-4"}):e.jsx("span",{className:"w-4"})}),e.jsx(ne,{value:l.key,onChange:p=>i(l.id,"key",p.target.value),placeholder:"key",className:"h-8 text-sm"}),!h&&e.jsx(e.Fragment,{children:l.type==="boolean"?e.jsxs("div",{className:"flex items-center h-8 px-3 border rounded-md bg-background",children:[e.jsx(Ve,{checked:l.value===!0,onCheckedChange:p=>i(l.id,"value",p)}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:l.value?"true":"false"})]}):l.type==="null"?e.jsx("div",{className:"flex items-center h-8 px-3 border rounded-md bg-muted text-sm text-muted-foreground",children:"null"}):e.jsx(ne,{type:l.type==="number"?"number":"text",value:l.value,onChange:p=>i(l.id,"value",p.target.value),placeholder:"value",className:"h-8 text-sm",step:l.type==="number"?"any":void 0})}),e.jsxs(Be,{value:l.type,onValueChange:p=>i(l.id,"type",p),children:[e.jsx(Le,{className:"h-8 text-xs",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"string",children:"ๅญ—็ฌฆไธฒ"}),e.jsx(W,{value:"number",children:"ๆ•ฐๅญ—"}),e.jsx(W,{value:"boolean",children:"ๅธƒๅฐ”"}),e.jsx(W,{value:"null",children:"Null"}),e.jsx(W,{value:"object",children:"ๅฏน่ฑก"}),e.jsx(W,{value:"array",children:"ๆ•ฐ็ป„"})]})]}),e.jsxs("div",{className:"flex gap-1 justify-end",children:[h&&e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-primary",onClick:()=>u(l.id),title:"ๆทปๅŠ ๅญ้กน",children:e.jsx(Zs,{className:"h-4 w-4"})}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>c(l.id),title:"ๅˆ ้™ค",children:e.jsx(ns,{className:"h-4 w-4"})})]})]}),h&&l.expanded&&l.children&&l.children.length>0&&e.jsx("div",{className:"space-y-1",children:l.children.map(p=>e.jsx(xv,{node:p,level:n+1,onUpdate:i,onRemove:c,onAddChild:u,onToggleExpand:x},p.id))})]})}function G_({value:l,onChange:n,placeholder:i="ๆทปๅŠ ๅ‚ๆ•ฐ..."}){const[c,u]=m.useState(()=>Rm(l||{})),x=m.useCallback(v=>{u(v),n(Lm(v))},[n]),h=m.useCallback(()=>{const v={id:Gi(),key:"",value:"",type:"string",expanded:!1};x([...c,v])},[c,x]),f=m.useCallback((v,y,w)=>{const b=D=>D.map(A=>{if(A.id===v)if(y==="type"){const _=w;if(_==="object")return{...A,type:_,value:{},children:[]};if(_==="array")return{...A,type:_,value:[],children:[]};if(_==="null")return{...A,type:_,value:null};{const P=pg(String(A.value),_);return{...A,type:_,value:P,children:void 0}}}else if(y==="value"){const _=pg(String(w),A.type);return{...A,value:_}}else return{...A,[y]:String(w)};return A.children?{...A,children:b(A.children)}:A});x(b(c))},[c,x]),p=m.useCallback(v=>{const y=w=>w.filter(b=>b.id!==v).map(b=>b.children?{...b,children:y(b.children)}:b);x(y(c))},[c,x]),g=m.useCallback(v=>{const y=w=>w.map(b=>{if(b.id===v){const D={id:Gi(),key:b.type==="array"?String(b.children?.length||0):"",value:"",type:"string",expanded:!0};return{...b,children:[...b.children||[],D]}}return b.children?{...b,children:y(b.children)}:b});x(y(c))},[c,x]),N=m.useCallback(v=>{const y=w=>w.map(b=>b.id===v?{...b,expanded:!b.expanded}:b.children?{...b,children:y(b.children)}:b);u(y(c))},[c]);return e.jsxs("div",{className:"h-full flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," ไธชๅ‚ๆ•ฐ"]}),e.jsxs(S,{type:"button",size:"sm",variant:"outline",onClick:h,className:"h-7 text-xs",children:[e.jsx(Zs,{className:"h-3 w-3 mr-1"}),"ๆทปๅŠ ๅ‚ๆ•ฐ"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-1",children:c.length===0?e.jsx("div",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded-md",children:i}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"grid gap-2 text-xs text-muted-foreground px-1 sticky top-0 bg-background z-10",style:{gridTemplateColumns:"32px 1fr 1fr 90px 32px"},children:[e.jsx("span",{}),e.jsx("span",{children:"้”ฎๅ"}),e.jsx("span",{children:"ๅ€ผ"}),e.jsx("span",{children:"็ฑปๅž‹"}),e.jsx("span",{})]}),c.map(v=>e.jsx(xv,{node:v,level:0,onUpdate:f,onRemove:p,onAddChild:g,onToggleExpand:N},v.id))]})})]})}function gg(l){if(!l.trim())return{valid:!0,parsed:{}};try{const n=JSON.parse(l);return typeof n!="object"||n===null||Array.isArray(n)?{valid:!1,error:"ๅฟ…้กปๆ˜ฏไธ€ไธช JSON ๅฏน่ฑก {}"}:{valid:!0,parsed:n}}catch{return{valid:!1,error:"JSON ๆ ผๅผ้”™่ฏฏ"}}}function V_({value:l,onChange:n,className:i,placeholder:c="ๆทปๅŠ ้ขๅค–ๅ‚ๆ•ฐ..."}){const[u,x]=m.useState("list"),h=m.useMemo(()=>Object.keys(l||{}).length>0?JSON.stringify(l,null,2):"",[l]),[f,p]=m.useState(h),[g,N]=m.useState(null);m.useEffect(()=>{p(h)},[h]);const v=m.useMemo(()=>{const b=gg(f);return b.valid&&b.parsed?{success:!0,data:b.parsed}:{success:!1,data:{}}},[f]),y=m.useCallback(b=>{const D=b;D==="json"&&u==="list"&&(p(Object.keys(l).length>0?JSON.stringify(l,null,2):""),N(null)),x(D)},[u,l]),w=m.useCallback(b=>{p(b);const D=gg(b);D.valid&&D.parsed?(N(null),n(D.parsed)):N(D.error||"JSON ๆ ผๅผ้”™่ฏฏ")},[n]);return e.jsx("div",{className:H("h-full flex flex-col",i),children:e.jsxs(ra,{value:u,onValueChange:y,className:"w-full flex-1 flex flex-col",children:[e.jsxs(Wt,{className:"h-8 p-0.5 bg-muted/60 w-fit",children:[e.jsx(ts,{value:"list",className:"h-7 px-3 text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"ๅฏ่ง†ๅŒ–็ผ–่พ‘"}),e.jsx(ts,{value:"json",className:"h-7 px-3 text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"JSON ็ผ–่พ‘"})]}),e.jsx(bs,{value:"list",className:"mt-2 flex-1 flex flex-col overflow-hidden data-[state=inactive]:hidden data-[state=inactive]:h-0",children:e.jsx(G_,{value:l,onChange:n,placeholder:c})}),e.jsx(bs,{value:"json",className:"mt-2 flex-1 flex flex-col overflow-hidden data-[state=inactive]:hidden data-[state=inactive]:h-0",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col gap-2 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"็ผ–่พ‘"}),g?e.jsxs("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[e.jsx(St,{className:"h-3 w-3"}),e.jsx("span",{className:"truncate max-w-[150px]",children:g})]}):f.trim()&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[e.jsx(_t,{className:"h-3 w-3"}),e.jsx("span",{children:"ๆœ‰ๆ•ˆ"})]})]}),e.jsx(at,{value:f,onChange:b=>w(b.target.value),placeholder:`{ +reaction = "${C.reaction}"`;return e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"้ข„่งˆ"]})}),e.jsx(Ja,{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(Je,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:M})}),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(S,{onClick:g,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๆญฃๅˆ™่ง„ๅˆ™"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.regex_rules.map((C,M)=>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:["ๆญฃๅˆ™่ง„ๅˆ™ ",M+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h_,{regex:C.regex&&C.regex[0]||"",reaction:C.reaction,onRegexChange:G=>v(M,"regex",G),onReactionChange:G=>v(M,"reaction",G)}),e.jsx(H,{rule:C}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๆญฃๅˆ™่ง„ๅˆ™ ",M+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>N(M),children:"ๅˆ ้™ค"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{className:"text-xs font-medium",children:"ๆญฃๅˆ™่กจ่พพๅผ๏ผˆPython ่ฏญๆณ•๏ผ‰"}),e.jsx(ne,{value:C.regex&&C.regex[0]||"",onChange:G=>v(M,"regex",G.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(T,{className:"text-xs font-medium",children:"ๅๅบ”ๅ†…ๅฎน"}),e.jsx(at,{value:C.reaction,onChange:G=>v(M,"reaction",G.target.value),placeholder:`่งฆๅ‘ๅŽ้บฆ้บฆ็š„ๅๅบ”... +ๅฏไปฅไฝฟ็”จ [ๆ•่Žท็ป„ๅ] ๆฅๅผ•็”จๆญฃๅˆ™่กจ่พพๅผไธญ็š„ๅ†…ๅฎน`,rows:3,className:"text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไฝฟ็”จ [ๆ•่Žท็ป„ๅ] ๅผ•็”จๆญฃๅˆ™่กจ่พพๅผไธญ็š„ๅ‘ฝๅๆ•่Žท็ป„๏ผŒไพ‹ๅฆ‚ [n] ไผš่ขซๆ›ฟๆขไธบๆ•่Žท็š„ๅ†…ๅฎน"})]})]})]},M)),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(S,{onClick:y,size:"sm",variant:"outline",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ๅ…ณ้”ฎ่ฏ่ง„ๅˆ™"]})]}),e.jsxs("div",{className:"space-y-3",children:[n.keyword_rules.map((C,M)=>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:["ๅ…ณ้”ฎ่ฏ่ง„ๅˆ™ ",M+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{rule:C}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™คๅ…ณ้”ฎ่ฏ่ง„ๅˆ™ ",M+1," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>w(M),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(T,{className:"text-xs font-medium",children:"ๅ…ณ้”ฎ่ฏๅˆ—่กจ"}),e.jsxs(S,{onClick:()=>D(M),size:"sm",variant:"ghost",children:[e.jsx(Zs,{className:"h-3 w-3 mr-1"}),"ๆทปๅŠ ๅ…ณ้”ฎ่ฏ"]})]}),e.jsxs("div",{className:"space-y-2",children:[(C.keywords||[]).map((G,O)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{value:G,onChange:ee=>_(M,O,ee.target.value),placeholder:"ๅ…ณ้”ฎ่ฏ",className:"flex-1"}),e.jsx(S,{onClick:()=>A(M,O),size:"sm",variant:"ghost",children:e.jsx(ns,{className:"h-4 w-4"})})]},O)),(!C.keywords||C.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(T,{className:"text-xs font-medium",children:"ๅๅบ”ๅ†…ๅฎน"}),e.jsx(at,{value:C.reaction,onChange:G=>b(M,"reaction",G.target.value),placeholder:"่งฆๅ‘ๅŽ้บฆ้บฆ็š„ๅๅบ”...",rows:3,className:"text-sm"})]})]})]},M)),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(Fe,{id:"enable_response_post_process",checked:i.enable_response_post_process,onCheckedChange:C=>h({...i,enable_response_post_process:C})}),e.jsx(T,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"ๅฏ็”จๅ›žๅคๅŽๅค„็†"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"ๅŒ…ๆ‹ฌ้”™ๅˆซๅญ—็”Ÿๆˆๅ™จๅ’Œๅ›žๅคๅˆ†ๅ‰ฒๅ™จ"})]}),i.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(Fe,{id:"enable_chinese_typo",checked:c.enable,onCheckedChange:C=>f({...c,enable:C})}),e.jsx(T,{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(T,{htmlFor:"error_rate",className:"text-xs font-medium",children:"ๅ•ๅญ—ๆ›ฟๆขๆฆ‚็އ"}),e.jsx(ne,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.error_rate,onChange:C=>f({...c,error_rate:parseFloat(C.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"min_freq",className:"text-xs font-medium",children:"ๆœ€ๅฐๅญ—้ข‘้˜ˆๅ€ผ"}),e.jsx(ne,{id:"min_freq",type:"number",min:"0",value:c.min_freq,onChange:C=>f({...c,min_freq:parseInt(C.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"ๅฃฐ่ฐƒ้”™่ฏฏๆฆ‚็އ"}),e.jsx(ne,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:c.tone_error_rate,onChange:C=>f({...c,tone_error_rate:parseFloat(C.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"ๆ•ด่ฏๆ›ฟๆขๆฆ‚็އ"}),e.jsx(ne,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:c.word_replace_rate,onChange:C=>f({...c,word_replace_rate:parseFloat(C.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(Fe,{id:"enable_response_splitter",checked:u.enable,onCheckedChange:C=>p({...u,enable:C})}),e.jsx(T,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"ๅ›žๅคๅˆ†ๅ‰ฒๅ™จ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"ๆŽงๅˆถๅ›žๅค็š„้•ฟๅบฆๅ’Œๅฅๅญๆ•ฐ้‡"}),u.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(T,{htmlFor:"max_length",className:"text-xs font-medium",children:"ๆœ€ๅคง้•ฟๅบฆ"}),e.jsx(ne,{id:"max_length",type:"number",min:"1",value:u.max_length,onChange:C=>p({...u,max_length:parseInt(C.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅ›žๅคๅ…่ฎธ็š„ๆœ€ๅคงๅญ—็ฌฆๆ•ฐ"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"ๆœ€ๅคงๅฅๅญๆ•ฐ"}),e.jsx(ne,{id:"max_sentence_num",type:"number",min:"1",value:u.max_sentence_num,onChange:C=>p({...u,max_sentence_num:parseInt(C.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(Fe,{id:"enable_kaomoji_protection",checked:u.enable_kaomoji_protection,onCheckedChange:C=>p({...u,enable_kaomoji_protection:C})}),e.jsx(T,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"ๅฏ็”จ้ขœๆ–‡ๅญ—ไฟๆŠค"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"enable_overflow_return_all",checked:u.enable_overflow_return_all,onCheckedChange:C=>p({...u,enable_overflow_return_all:C})}),e.jsx(T,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"่ถ…ๅ‡บๆ—ถไธ€ๆฌกๆ€ง่ฟ”ๅ›žๅ…จ้ƒจ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"ๅฝ“ๅฅๅญๆ•ฐ้‡่ถ…ๅ‡บ้™ๅˆถๆ—ถ๏ผŒๅˆๅนถๅŽไธ€ๆฌกๆ€ง่ฟ”ๅ›žๆ‰€ๆœ‰ๅ†…ๅฎน"})]})]})})]})]})]})}),p_=zs.memo(function({config:n,onChange:i}){const[c,u]=m.useState(""),[x,h]=m.useState(""),[f,p]=m.useState(!1),g=n.allowed_ips?n.allowed_ips.split(",").map(_=>_.trim()).filter(_=>_):[],N=n.trusted_proxies?n.trusted_proxies.split(",").map(_=>_.trim()).filter(_=>_):[],v=()=>{if(!c.trim())return;const _=[...g,c.trim()];i({...n,allowed_ips:_.join(",")}),u("")},y=_=>{const H=g.filter((E,C)=>C!==_);i({...n,allowed_ips:H.join(",")})},w=()=>{if(!x.trim())return;const _=[...N,x.trim()];i({...n,trusted_proxies:_.join(",")}),h("")},b=_=>{const H=N.filter((E,C)=>C!==_);i({...n,trusted_proxies:H.join(",")})},D=_=>{!_&&n.enabled?p(!0):i({...n,enabled:_})},A=()=>{i({...n,enabled:!1}),p(!1)};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:"WebUI ๆœๅŠก้…็ฝฎ"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{checked:n.enabled,onCheckedChange:D}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ WebUI"})]}),n.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"่ฟ่กŒๆจกๅผ"}),e.jsxs(Be,{value:n.mode,onValueChange:_=>i({...n,mode:_}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ่ฟ่กŒๆจกๅผ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"development",children:"ๅผ€ๅ‘ๆจกๅผ"}),e.jsx(W,{value:"production",children:"็”Ÿไบงๆจกๅผ"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆณจๆ„: WebUI ็š„็›‘ๅฌๅœฐๅ€ๅ’Œ็ซฏๅฃ่ฏทๅœจ .env ๆ–‡ไปถไธญ้…็ฝฎ WEBUI_HOST ๅ’Œ WEBUI_PORT"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"้˜ฒ็ˆฌ่™ซๆจกๅผ"}),e.jsxs(Be,{value:n.anti_crawler_mode,onValueChange:_=>i({...n,anti_crawler_mode:_}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉ้˜ฒ็ˆฌ่™ซๆจกๅผ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"false",children:"็ฆ็”จ"}),e.jsx(W,{value:"basic",children:"ๅŸบ็ก€๏ผˆๅช่ฎฐๅฝ•ไธ้˜ปๆญข๏ผ‰"}),e.jsx(W,{value:"loose",children:"ๅฎฝๆพ"}),e.jsx(W,{value:"strict",children:"ไธฅๆ ผ"})]})]})]}),e.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[e.jsx(T,{children:"IP ็™ฝๅๅ•"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:c,onChange:_=>u(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),v())},placeholder:"่พ“ๅ…ฅIPๅœฐๅ€ๅŽๆŒ‰ๅ›ž่ฝฆๆˆ–็‚นๅ‡ปๆทปๅŠ "}),e.jsx(S,{type:"button",size:"sm",onClick:v,disabled:!c.trim(),children:e.jsx(Zs,{className:"h-4 w-4"})})]}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:g.map((_,H)=>e.jsxs(ke,{variant:"secondary",className:"flex items-center gap-1",children:[_,e.jsx("button",{type:"button",onClick:()=>y(H),className:"ml-1 hover:bg-destructive/20 rounded-full p-0.5",children:e.jsx(Ca,{className:"h-3 w-3"})})]},H))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ”ฏๆŒ็ฒพ็กฎIPใ€CIDRๆ ผๅผๅ’Œ้€š้…็ฌฆ๏ผˆๅฆ‚๏ผš127.0.0.1ใ€192.168.1.0/24๏ผ‰"})]}),e.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[e.jsx(T,{children:"ไฟกไปป็š„ไปฃ็† IP"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{value:x,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),w())},placeholder:"่พ“ๅ…ฅไปฃ็†IPๅŽๆŒ‰ๅ›ž่ฝฆๆˆ–็‚นๅ‡ปๆทปๅŠ "}),e.jsx(S,{type:"button",size:"sm",onClick:w,disabled:!x.trim(),children:e.jsx(Zs,{className:"h-4 w-4"})})]}),N.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:N.map((_,H)=>e.jsxs(ke,{variant:"secondary",className:"flex items-center gap-1",children:[_,e.jsx("button",{type:"button",onClick:()=>b(H),className:"ml-1 hover:bg-destructive/20 rounded-full p-0.5",children:e.jsx(Ca,{className:"h-3 w-3"})})]},H))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅชๆœ‰ๆฅ่‡ช่ฟ™ไบ›IP็š„X-Forwarded-Forๅคดๆ‰่ขซไฟกไปป"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{checked:n.trust_xff,onCheckedChange:_=>i({...n,trust_xff:_})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จ X-Forwarded-For ไปฃ็†่งฃๆž"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{checked:n.secure_cookie,onCheckedChange:_=>i({...n,secure_cookie:_})}),e.jsx(T,{className:"cursor-pointer",children:"ๅฏ็”จๅฎ‰ๅ…จ Cookie๏ผˆไป… HTTPS๏ผ‰"})]})]})]}),e.jsx(js,{open:f,onOpenChange:p,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"่ญฆๅ‘Š๏ผšๅณๅฐ†ๅ…ณ้—ญ WebUI"}),e.jsxs(hs,{children:["ๅ…ณ้—ญ WebUI ๅŽ๏ผŒๅœจๆ‚จไธ‹ๆฌก้‡ๅฏ้บฆ้บฆไน‹ๅ‰๏ผŒWebUI ็•Œ้ขๅฐ†ๆ— ๆณ•่ฎฟ้—ฎใ€‚",e.jsx("br",{}),e.jsx("br",{}),"ๆ‚จ้œ€่ฆ้€š่ฟ‡ไฟฎๆ”น้…็ฝฎๆ–‡ไปถๆˆ–ๅ‘ฝไปค่กŒ้‡ๆ–ฐๅฏ็”จ WebUI ๆ‰่ƒฝๅ†ๆฌก่ฎฟ้—ฎๆญค็•Œ้ขใ€‚",e.jsx("br",{}),e.jsx("br",{}),"็กฎๅฎš่ฆๅ…ณ้—ญ WebUI ๅ—๏ผŸ"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{variant:"destructive",onClick:A,children:"็กฎ่ฎคๅ…ณ้—ญ"})]})]})})]})}),pn="/api/webui/config";async function xg(){const n=await(await we(`${pn}/bot`)).json();if(!n.success)throw new Error("่Žทๅ–้…็ฝฎๆ•ฐๆฎๅคฑ่ดฅ");return n.config}async function cn(){const n=await(await we(`${pn}/model`)).json();if(!n.success)throw new Error("่Žทๅ–ๆจกๅž‹้…็ฝฎๆ•ฐๆฎๅคฑ่ดฅ");return n.config}async function hg(l){const i=await(await we(`${pn}/bot`,{method:"POST",body:JSON.stringify(l)})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function g_(){const n=await(await we(`${pn}/bot/raw`)).json();if(!n.success)throw new Error("่Žทๅ–้…็ฝฎๆบไปฃ็ ๅคฑ่ดฅ");return n.content}async function j_(l){const i=await(await we(`${pn}/bot/raw`,{method:"POST",body:JSON.stringify({raw_content:l})})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function Fi(l){const i=await(await we(`${pn}/model`,{method:"POST",body:JSON.stringify(l)})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function v_(l,n){const c=await(await we(`${pn}/bot/section/${l}`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||`ไฟๅญ˜้…็ฝฎ่Š‚ ${l} ๅคฑ่ดฅ`)}async function Rm(l,n){const c=await(await we(`${pn}/model/section/${l}`,{method:"POST",body:JSON.stringify(n)})).json();if(!c.success)throw new Error(c.message||`ไฟๅญ˜้…็ฝฎ่Š‚ ${l} ๅคฑ่ดฅ`)}async function N_(l,n="openai",i="/models"){const c=new URLSearchParams({provider_name:l,parser:n,endpoint:i}),u=await we(`/api/webui/models/list?${c}`);if(!u.ok){const h=await u.json().catch(()=>({}));throw new Error(h.detail||`่Žทๅ–ๆจกๅž‹ๅˆ—่กจๅคฑ่ดฅ (${u.status})`)}const x=await u.json();if(!x.success)throw new Error("่Žทๅ–ๆจกๅž‹ๅˆ—่กจๅคฑ่ดฅ");return x.models}async function b_(l){const n=new URLSearchParams({provider_name:l}),i=await we(`/api/webui/models/test-connection-by-name?${n}`,{method:"POST"});if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c.detail||`ๆต‹่ฏ•่ฟžๆŽฅๅคฑ่ดฅ (${i.status})`)}return await i.json()}const y_=Hr("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"}}),lt=m.forwardRef(({className:l,variant:n,...i},c)=>e.jsx("div",{ref:c,role:"alert",className:P(y_({variant:n}),l),...i}));lt.displayName="Alert";const Un=m.forwardRef(({className:l,...n},i)=>e.jsx("h5",{ref:i,className:P("mb-1 font-medium leading-none tracking-tight",l),...n}));Un.displayName="AlertTitle";const nt=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{ref:i,className:P("text-sm [&_p]:leading-relaxed",l),...n}));nt.displayName="AlertDescription";const w_={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(l,n){let i;if(!n.inString&&(i=l.match(/^('''|"""|'|")/))&&(n.stringType=i[0],n.inString=!0),l.sol()&&!n.inString&&n.inArray===0&&(n.lhs=!0),n.inString){for(;n.inString;)if(l.match(n.stringType))n.inString=!1;else if(l.peek()==="\\")l.next(),l.next();else{if(l.eol())break;l.match(/^.[^\\\"\']*/)}return n.lhs?"property":"string"}else{if(n.inArray&&l.peek()==="]")return l.next(),n.inArray--,"bracket";if(n.lhs&&l.peek()==="["&&l.skipTo("]"))return l.next(),l.peek()==="]"&&l.next(),"atom";if(l.peek()==="#")return l.skipToEnd(),"comment";if(l.eatSpace())return null;if(n.lhs&&l.eatWhile(function(c){return c!="="&&c!=" "}))return"property";if(n.lhs&&l.peek()==="=")return l.next(),n.lhs=!1,null;if(!n.lhs&&l.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!n.lhs&&(l.match("true")||l.match("false")))return"atom";if(!n.lhs&&l.peek()==="[")return n.inArray++,l.next(),"bracket";if(!n.lhs&&l.match(/^\-?\d+(?:\.\d+)?/))return"number";l.eatSpace()||l.next()}return null},languageData:{commentTokens:{line:"#"}}},__={python:[j1()],json:[v1(),N1()],toml:[g1.define(w_)],text:[]};function cv({value:l,onChange:n,language:i="text",readOnly:c=!1,height:u="400px",minHeight:x,maxHeight:h,placeholder:f,theme:p="dark",className:g=""}){const[N,v]=m.useState(!1);if(m.useEffect(()=>{v(!0)},[]),!N)return e.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${g}`,style:{height:u,minHeight:x,maxHeight:h}});const y=[...__[i]||[],ag.lineWrapping];return c&&y.push(ag.editable.of(!1)),e.jsx("div",{className:`rounded-md overflow-hidden border ${g}`,children:e.jsx(b1,{value:l,height:u,minHeight:x,maxHeight:h,theme:p==="dark"?y1:void 0,extensions:y,onChange:n,placeholder:f,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 S_({id:l,index:n,itemType:i,itemFields:c,value:u,onChange:x,onRemove:h,disabled:f,canRemove:p,placeholder:g}){const{attributes:N,listeners:v,setNodeRef:y,transform:w,transition:b,isDragging:D}=Vj({id:l,disabled:f}),A={transform:qj.Transform.toString(w),transition:b};return e.jsxs("div",{ref:y,style:A,className:P("flex items-start gap-2 group",D&&"opacity-50 z-50"),children:[e.jsx("button",{type:"button",className:P("flex-shrink-0 p-2 cursor-grab active:cursor-grabbing","text-muted-foreground hover:text-foreground transition-colors","opacity-0 group-hover:opacity-100 focus:opacity-100",f&&"cursor-not-allowed opacity-30"),...N,...v,children:e.jsx(Sj,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex-1 min-w-0",children:i==="object"&&c?e.jsx(k_,{value:u,onChange:x,fields:c,disabled:f}):i==="number"?e.jsx(ne,{type:"number",value:u??"",onChange:_=>x(parseFloat(_.target.value)||0),placeholder:g??`็ฌฌ ${n+1} ้กน`,disabled:f,className:"font-mono"}):e.jsx(ne,{type:"text",value:u??"",onChange:_=>x(_.target.value),placeholder:g??`็ฌฌ ${n+1} ้กน`,disabled:f})}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",onClick:h,disabled:f||!p,className:P("flex-shrink-0 text-muted-foreground hover:text-destructive","opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity"),children:e.jsx(ns,{className:"h-4 w-4"})})]})}function k_({value:l,onChange:n,fields:i,disabled:c}){const u=m.useCallback((h,f)=>{n({...l,[h]:f})},[l,n]),x=(h,f)=>{const p=l?.[h];if(f.type==="boolean"||f.type==="switch")return e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx(Fe,{checked:!!(p??f.default),onCheckedChange:g=>u(h,g),disabled:c})]});if(f.type==="slider"||f.type==="number"&&f.min!=null&&f.max!=null){const g=p??f.default??f.min??0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e.jsx(_a,{value:[g],onValueChange:N=>u(h,N[0]),min:f.min??0,max:f.max??100,step:f.step??1,disabled:c,className:"py-1"})]})}return f.type==="select"&&f.choices?e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsxs(Be,{value:String(p??f.default??""),onValueChange:g=>u(h,g),disabled:c,children:[e.jsx(Le,{className:"h-8 text-sm",children:e.jsx($e,{placeholder:f.placeholder??"่ฏท้€‰ๆ‹ฉ"})}),e.jsx(Ue,{children:f.choices.map(g=>e.jsx(W,{value:String(g),children:String(g)},String(g)))})]})]}):f.type==="number"?e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx(ne,{type:"number",value:p??f.default??"",onChange:g=>u(h,parseFloat(g.target.value)||0),placeholder:f.placeholder,disabled:c,className:"h-8 text-sm"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:f.label??h}),e.jsx(ne,{type:"text",value:p??f.default??"",onChange:g=>u(h,g.target.value),placeholder:f.placeholder,disabled:c,className:"h-8 text-sm"})]})};return e.jsx(Ce,{className:"p-3 space-y-2 bg-muted/30",children:Object.entries(i).map(([h,f])=>e.jsx("div",{children:x(h,f)},h))})}function C_({value:l,onChange:n,itemType:i="string",itemFields:c,minItems:u,maxItems:x,disabled:h,placeholder:f}){const p=m.useMemo(()=>Array.isArray(l)?l:typeof l=="string"&&l.trim()?l.split(",").map(E=>E.trim()):[],[l]),[g]=m.useState(()=>new Map),N=m.useCallback(E=>(g.has(E)||g.set(E,`item-${Date.now()}-${E}-${Math.random().toString(36).slice(2)}`),g.get(E)),[g]),v=m.useMemo(()=>{const E=[];for(let C=0;C{const{active:C,over:M}=E;if(M&&C.id!==M.id){const G=v.indexOf(C.id),O=v.indexOf(M.id),ee=Pj(p,G,O);n(ee)}},[p,v,n]),b=m.useCallback(()=>{if(x!=null&&p.length>=x)return;let E;i==="object"&&c?E=Object.fromEntries(Object.entries(c).map(([C,M])=>[C,M.default??""])):i==="number"?E=0:E="",n([...p,E])},[p,x,i,c,n]),D=m.useCallback((E,C)=>{const M=[...p];M[E]=C,n(M)},[p,n]),A=m.useCallback(E=>{if(u!=null&&p.length<=u)return;const C=p.filter((M,G)=>G!==E);g.delete(E),n(C)},[p,u,g,n]),_=x==null||p.lengthu;return e.jsxs("div",{className:"space-y-2",children:[p.length===0?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-4 justify-center border border-dashed rounded-md",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx("span",{children:"ๆš‚ๆ— ๆ•ฐๆฎ๏ผŒ็‚นๅ‡ปไธ‹ๆ–นๆŒ‰้’ฎๆทปๅŠ "})]}):e.jsx(Hj,{sensors:y,collisionDetection:Fj,onDragEnd:w,children:e.jsx(Gj,{items:v,strategy:w1,children:e.jsx("div",{className:"space-y-2",children:p.map((E,C)=>e.jsx(S_,{id:v[C],index:C,itemType:i,itemFields:c,value:E,onChange:M=>D(C,M),onRemove:()=>A(C),disabled:h,canRemove:H,placeholder:f},v[C]))})})}),e.jsxs(S,{type:"button",variant:"outline",size:"sm",onClick:b,disabled:h||!_,className:"w-full",children:[e.jsx(Zs,{className:"h-4 w-4 mr-1"}),"ๆทปๅŠ ้กน็›ฎ",x!==void 0&&e.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",p.length,"/",x,")"]})]}),(u!=null||x!=null)&&(u!==null||x!==null)&&e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:u!=null&&x!=null?`ๅ…่ฎธ ${u} - ${x} ้กน`:u!=null?`่‡ณๅฐ‘ ${u} ้กน`:`ๆœ€ๅคš ${x} ้กน`})]})}function Qm({content:l,className:n=""}){return e.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${n}`,children:e.jsx(E1,{remarkPlugins:[A1,z1],rehypePlugins:[M1],components:{code({inline:i,className:c,children:u,...x}){return i?e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...x,children:u}):e.jsx("code",{className:`${c} block bg-muted p-4 rounded-lg overflow-x-auto`,...x,children:u})},table({children:i,...c}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{className:"border-collapse border border-border",...c,children:i})})},th({children:i,...c}){return e.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...c,children:i})},td({children:i,...c}){return e.jsx("td",{className:"border border-border px-4 py-2",...c,children:i})},a({children:i,...c}){return e.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...c,children:i})},blockquote({children:i,...c}){return e.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...c,children:i})},h1({children:i,...c}){return e.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...c,children:i})},h2({children:i,...c}){return e.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...c,children:i})},h3({children:i,...c}){return e.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...c,children:i})},h4({children:i,...c}){return e.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...c,children:i})},ul({children:i,...c}){return e.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...c,children:i})},ol({children:i,...c}){return e.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...c,children:i})},p({children:i,...c}){return e.jsx("p",{className:"my-2 leading-relaxed",...c,children:i})},hr({...i}){return e.jsx("hr",{className:"my-4 border-border",...i})}},children:l})})}function T_(l,n,i,c={}){const{debounceMs:u=2e3,onSaveSuccess:x,onSaveError:h}=c,f=m.useRef(null),p=m.useCallback(async(y,w)=>{try{n(!0),await v_(y,w),i(!1),x?.()}catch(b){console.error(`่‡ชๅŠจไฟๅญ˜ ${y} ๅคฑ่ดฅ:`,b),i(!0),h?.(b instanceof Error?b:new Error(String(b)))}finally{n(!1)}},[n,i,x,h]),g=m.useCallback((y,w)=>{l||(i(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{p(y,w)},u))},[l,i,p,u]),N=m.useCallback(async(y,w)=>{f.current&&(clearTimeout(f.current),f.current=null),await p(y,w)},[p]),v=m.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]);return m.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),{triggerAutoSave:g,saveNow:N,cancelPendingAutoSave:v}}function It(l,n,i,c){m.useEffect(()=>{l&&!i&&c(n,l)},[l])}const E_=500;function M_(){return e.jsx(Vn,{children:e.jsx(A_,{})})}function A_(){const[l,n]=m.useState(!0),[i,c]=m.useState(!1),[u,x]=m.useState(!1),[h,f]=m.useState(!1),[p,g]=m.useState("visual"),[N,v]=m.useState(""),[y,w]=m.useState(!1),{toast:b}=st(),{triggerRestart:D,isRestarting:A}=fn(),[_,H]=m.useState(null),[E,C]=m.useState(null),[M,G]=m.useState(null),[O,ee]=m.useState(null),[R,me]=m.useState(null),[ce,ve]=m.useState(null),[se,ge]=m.useState(null),[fe,z]=m.useState(null),[Q,I]=m.useState(null),[L,$]=m.useState(null),[_e,je]=m.useState(null),[Se,K]=m.useState(null),[U,V]=m.useState(null),[xe,Ae]=m.useState(null),[X,oe]=m.useState(null),[Ge,Y]=m.useState(null),[te,Oe]=m.useState(null),[De,Me]=m.useState(null),[de,Te]=m.useState(null),rs=m.useRef(!0),Rt=m.useRef({}),ta=m.useCallback(Ee=>{Rt.current=Ee,H(Ee.bot),C(Ee.personality);const vs=Ee.chat;vs.talk_value_rules||(vs.talk_value_rules=[]),G(vs),ee(Ee.expression),me(Ee.emoji),ve(Ee.memory),ge(Ee.tool),z(Ee.voice),I(Ee.dream),$(Ee.lpmm_knowledge),je(Ee.keyword_reaction),K(Ee.response_post_process),V(Ee.chinese_typo),Ae(Ee.response_splitter),oe(Ee.log),Y(Ee.debug),Oe(Ee.maim_message),Me(Ee.telemetry),Te(Ee.webui)},[]),Ga=m.useCallback(()=>({...Rt.current,bot:_,personality:E,chat:M,expression:O,emoji:R,memory:ce,tool:se,voice:fe,dream:Q,lpmm_knowledge:L,keyword_reaction:_e,response_post_process:Se,chinese_typo:U,response_splitter:xe,log:X,debug:Ge,maim_message:te,telemetry:De,webui:de}),[_,E,M,O,R,ce,se,fe,Q,L,_e,Se,U,xe,X,Ge,te,De,de]),Ht=m.useCallback(async()=>{try{const vs=(await g_()).replace(/"([^"]*)"/g,(ls,es)=>`"${es.replace(/\\n/g,` +`).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}"`);v(vs),w(!1)}catch(Ee){b({variant:"destructive",title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Ee instanceof Error?Ee.message:"ๅŠ ่ฝฝๆบไปฃ็ ๅคฑ่ดฅ"})}},[b]),ut=m.useCallback(async()=>{try{n(!0);const Ee=await xg();ta(Ee),f(!1),rs.current=!1,await Ht()}catch(Ee){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",Ee),b({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅŠ ่ฝฝ้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}finally{n(!1)}},[b,Ht,ta]);m.useEffect(()=>{ut()},[ut]);const{triggerAutoSave:q,cancelPendingAutoSave:qe}=T_(rs.current,x,f);It(_,"bot",rs.current,q),It(E,"personality",rs.current,q),It(M,"chat",rs.current,q),It(O,"expression",rs.current,q),It(R,"emoji",rs.current,q),It(ce,"memory",rs.current,q),It(se,"tool",rs.current,q),It(fe,"voice",rs.current,q),It(L,"lpmm_knowledge",rs.current,q),It(_e,"keyword_reaction",rs.current,q),It(Se,"response_post_process",rs.current,q),It(U,"chinese_typo",rs.current,q),It(xe,"response_splitter",rs.current,q),It(X,"log",rs.current,q),It(Ge,"debug",rs.current,q),It(te,"maim_message",rs.current,q),It(De,"telemetry",rs.current,q),It(de,"webui",rs.current,q);const Qe=async()=>{try{c(!0);const Ee=N.replace(/"([^"]*)"/g,(vs,ls)=>`"${ls.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}"`);await j_(Ee),f(!1),w(!1),b({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜"}),await ut()}catch(Ee){w(!0),b({variant:"destructive",title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Ee instanceof Error?Ee.message:"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ"})}finally{c(!1)}},We=async Ee=>{if(h){b({variant:"destructive",title:"ๅˆ‡ๆขๅคฑ่ดฅ",description:"่ฏทๅ…ˆไฟๅญ˜ๅฝ“ๅ‰ๆ›ดๆ”น"});return}if(g(Ee),Ee==="source")await Ht();else try{const vs=await xg();ta(vs),f(!1)}catch(vs){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",vs),b({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅŠ ่ฝฝ้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}},Ds=async()=>{try{c(!0),qe(),await hg(Ga()),f(!1),b({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้บฆ้บฆไธป็จ‹ๅบ้…็ฝฎๅทฒไฟๅญ˜"})}catch(Ee){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",Ee),b({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Ee.message,variant:"destructive"})}finally{c(!1)}},as=async()=>{await D()},ks=async()=>{try{c(!0),qe(),await hg(Ga()),f(!1),b({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜๏ผŒๅณๅฐ†้‡ๅฏ้บฆ้บฆ..."}),await new Promise(Ee=>setTimeout(Ee,E_)),await as()}catch(Ee){console.error("ไฟๅญ˜ๅคฑ่ดฅ:",Ee),b({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Ee.message,variant:"destructive"})}finally{c(!1)}};return l?e.jsx(Je,{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(Je,{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(S,{onClick:p==="visual"?Ds:Qe,disabled:i||u||!h||A,size:"sm",variant:"outline",className:"w-20 sm:w-24",children:[e.jsx(tc,{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:i?"ไฟๅญ˜ไธญ":u?"่‡ชๅŠจ":h?"ไฟๅญ˜":"ๅทฒไฟๅญ˜"})]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{disabled:i||u||A,size:"sm",className:"w-20 sm:w-28",children:[e.jsx(sc,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"ml-1 truncate text-xs sm:text-sm",children:A?"้‡ๅฏไธญ":h?"ไฟๅญ˜้‡ๅฏ":"้‡ๅฏ"})]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๅฏ้บฆ้บฆ๏ผŸ"}),e.jsx(hs,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:h?"ๅฝ“ๅ‰ๆœ‰ๆœชไฟๅญ˜็š„้…็ฝฎๆ›ดๆ”นใ€‚็‚นๅ‡ป็กฎ่ฎคๅฐ†ๅ…ˆไฟๅญ˜้…็ฝฎ,็„ถๅŽ้‡ๅฏ้บฆ้บฆไฝฟๆ–ฐ้…็ฝฎ็”Ÿๆ•ˆใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟใ€‚":"ๅณๅฐ†้‡ๅฏ้บฆ้บฆไธป็จ‹ๅบใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟ,้…็ฝฎๅฐ†ๅœจ้‡ๅฏๅŽ็”Ÿๆ•ˆใ€‚"})})})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:h?ks:as,children:h?"ไฟๅญ˜ๅนถ้‡ๅฏ":"็กฎ่ฎค้‡ๅฏ"})]})]})]})]})]}),e.jsx("div",{className:"flex",children:e.jsx(ra,{value:p,onValueChange:Ee=>We(Ee),className:"w-full",children:e.jsxs(ea,{className:"h-8 sm:h-9 w-full grid grid-cols-2",children:[e.jsxs(ts,{value:"visual",className:"text-xs sm:text-sm",children:[e.jsx(kj,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"ๅฏ่ง†ๅŒ–็ผ–่พ‘"]}),e.jsxs(ts,{value:"source",className:"text-xs sm:text-sm",children:[e.jsx(Cj,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"ๆบไปฃ็ ็ผ–่พ‘"]})]})})})]}),e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsxs(nt,{children:["้…็ฝฎๆ›ดๆ–ฐๅŽ้œ€่ฆ",e.jsx("strong",{children:"้‡ๅฏ้บฆ้บฆ"}),'ๆ‰่ƒฝ็”Ÿๆ•ˆใ€‚ไฝ ๅฏไปฅ็‚นๅ‡ปๅณไธŠ่ง’็š„"ไฟๅญ˜ๅนถ้‡ๅฏ"ๆŒ‰้’ฎไธ€้”ฎๅฎŒๆˆไฟๅญ˜ๅ’Œ้‡ๅฏใ€‚']})]}),p==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsxs(nt,{children:[e.jsx("strong",{children:"ๆบไปฃ็ ๆจกๅผ๏ผˆ้ซ˜็บงๅŠŸ่ƒฝ๏ผ‰๏ผš"}),"็›ดๆŽฅ็ผ–่พ‘ TOML ้…็ฝฎๆ–‡ไปถใ€‚ๆญคๅŠŸ่ƒฝไป…้€‚็”จไบŽ็†Ÿๆ‚‰ TOML ่ฏญๆณ•็š„้ซ˜็บง็”จๆˆทใ€‚ไฟๅญ˜ๆ—ถไผšๅœจๅŽ็ซฏ้ชŒ่ฏๆ ผๅผ๏ผŒๅชๆœ‰ๆ ผๅผๅฎŒๅ…จๆญฃ็กฎๆ‰่ƒฝไฟๅญ˜ใ€‚",y&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"โš ๏ธ ไธŠๆฌกไฟๅญ˜ๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ TOML ๆ ผๅผ"})]})]}),e.jsx(cv,{value:N,onChange:Ee=>{v(Ee),f(!0),y&&w(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML ้…็ฝฎๅ†…ๅฎน"})]}),p==="visual"&&e.jsx(e.Fragment,{children:e.jsxs(ra,{defaultValue:"bot",className:"w-full",children:[e.jsxs(ea,{className:"flex flex-wrap h-auto gap-1 p-1 sm:grid sm:grid-cols-5 lg:grid-cols-10",children:[e.jsx(ts,{value:"bot",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅŸบๆœฌไฟกๆฏ"}),e.jsx(ts,{value:"personality",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ไบบๆ ผ"}),e.jsx(ts,{value:"chat",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"่Šๅคฉ"}),e.jsx(ts,{value:"expression",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"่กจ่พพ"}),e.jsx(ts,{value:"features",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅŠŸ่ƒฝ"}),e.jsx(ts,{value:"processing",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅค„็†"}),e.jsx(ts,{value:"dream",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅšๆขฆ"}),e.jsx(ts,{value:"lpmm",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"็Ÿฅ่ฏ†ๅบ“"}),e.jsx(ts,{value:"webui",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"WebUI"}),e.jsx(ts,{value:"other",className:"text-xs px-2 py-1.5 sm:px-3 sm:py-2 data-[state=active]:shadow-sm",children:"ๅ…ถไป–"})]}),e.jsx(bs,{value:"bot",className:"space-y-4",children:_&&e.jsx(Z2,{config:_,onChange:H})}),e.jsx(bs,{value:"personality",className:"space-y-4",children:E&&e.jsx(W2,{config:E,onChange:C})}),e.jsx(bs,{value:"chat",className:"space-y-4",children:M&&e.jsx(l_,{config:M,onChange:G})}),e.jsx(bs,{value:"expression",className:"space-y-4",children:O&&e.jsx(x_,{config:O,onChange:ee})}),e.jsx(bs,{value:"features",className:"space-y-4",children:R&&ce&&se&&fe&&e.jsx(u_,{emojiConfig:R,memoryConfig:ce,toolConfig:se,voiceConfig:fe,onEmojiChange:me,onMemoryChange:ve,onToolChange:ge,onVoiceChange:z})}),e.jsx(bs,{value:"processing",className:"space-y-4",children:_e&&Se&&U&&xe&&e.jsx(f_,{keywordReactionConfig:_e,responsePostProcessConfig:Se,chineseTypoConfig:U,responseSplitterConfig:xe,onKeywordReactionChange:je,onResponsePostProcessChange:K,onChineseTypoChange:V,onResponseSplitterChange:Ae})}),e.jsx(bs,{value:"dream",className:"space-y-4",children:Q&&e.jsx(n_,{config:Q,onChange:I})}),e.jsx(bs,{value:"lpmm",className:"space-y-4",children:L&&e.jsx(r_,{config:L,onChange:$})}),e.jsx(bs,{value:"webui",className:"space-y-4",children:de&&e.jsx(p_,{config:de,onChange:Te})}),e.jsxs(bs,{value:"other",className:"space-y-4",children:[X&&e.jsx(i_,{config:X,onChange:oe}),Ge&&e.jsx(c_,{config:Ge,onChange:Y}),te&&e.jsx(o_,{config:te,onChange:Oe}),De&&e.jsx(d_,{config:De,onChange:Me})]})]})}),e.jsx(qn,{})]})})}const zl=m.forwardRef(({className:l,...n},i)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:i,className:P("w-full caption-bottom text-sm",l),...n})}));zl.displayName="Table";const Dl=m.forwardRef(({className:l,...n},i)=>e.jsx("thead",{ref:i,className:P("[&_tr]:border-b",l),...n}));Dl.displayName="TableHeader";const Ol=m.forwardRef(({className:l,...n},i)=>e.jsx("tbody",{ref:i,className:P("[&_tr:last-child]:border-0",l),...n}));Ol.displayName="TableBody";const z_=m.forwardRef(({className:l,...n},i)=>e.jsx("tfoot",{ref:i,className:P("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",l),...n}));z_.displayName="TableFooter";const ot=m.forwardRef(({className:l,...n},i)=>e.jsx("tr",{ref:i,className:P("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",l),...n}));ot.displayName="TableRow";const Ze=m.forwardRef(({className:l,...n},i)=>e.jsx("th",{ref:i,className:P("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...n}));Ze.displayName="TableHead";const Ke=m.forwardRef(({className:l,...n},i)=>e.jsx("td",{ref:i,className:P("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...n}));Ke.displayName="TableCell";const D_=m.forwardRef(({className:l,...n},i)=>e.jsx("caption",{ref:i,className:P("mt-4 text-sm text-muted-foreground",l),...n}));D_.displayName="TableCaption";const Yo=m.forwardRef(({className:l,...n},i)=>e.jsx(pa,{ref:i,className:P("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",l),...n}));Yo.displayName=pa.displayName;const Jo=m.forwardRef(({className:l,...n},i)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Ot,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(pa.Input,{ref:i,className:P("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",l),...n})]}));Jo.displayName=pa.Input.displayName;const Xo=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.List,{ref:i,className:P("max-h-[300px] overflow-y-auto overflow-x-hidden",l),...n}));Xo.displayName=pa.List.displayName;const Zo=m.forwardRef((l,n)=>e.jsx(pa.Empty,{ref:n,className:"py-6 text-center text-sm",...l}));Zo.displayName=pa.Empty.displayName;const Ji=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.Group,{ref:i,className:P("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",l),...n}));Ji.displayName=pa.Group.displayName;const O_=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.Separator,{ref:i,className:P("-mx-1 h-px bg-border",l),...n}));O_.displayName=pa.Separator.displayName;const Xi=m.forwardRef(({className:l,...n},i)=>e.jsx(pa.Item,{ref:i,className:P("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",l),...n}));Xi.displayName=pa.Item.displayName;const Ws=m.forwardRef(({className:l,...n},i)=>e.jsx(mj,{ref:i,className:P("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",l),...n,children:e.jsx(Cw,{className:P("grid place-content-center text-current"),children:e.jsx(_t,{className:"h-4 w-4"})})}));Ws.displayName=mj.displayName;const ov=m.createContext(null),dv="maibot-completed-tours";function R_(){try{const l=localStorage.getItem(dv);return l?new Set(JSON.parse(l)):new Set}catch{return new Set}}function fg(l){localStorage.setItem(dv,JSON.stringify([...l]))}function L_({children:l}){const[n,i]=m.useState({activeTourId:null,stepIndex:0,isRunning:!1}),[c]=m.useState(()=>new Map),[u,x]=m.useState(R_),[,h]=m.useState(0),f=m.useCallback((E,C)=>{c.set(E,C),h(M=>M+1)},[c]),p=m.useCallback(E=>{c.delete(E),i(C=>C.activeTourId===E?{...C,activeTourId:null,isRunning:!1,stepIndex:0}:C)},[c]),g=m.useCallback((E,C=0)=>{c.has(E)&&i({activeTourId:E,stepIndex:C,isRunning:!0})},[c]),N=m.useCallback(()=>{i(E=>({...E,isRunning:!1}))},[]),v=m.useCallback(E=>{i(C=>({...C,stepIndex:E}))},[]),y=m.useCallback(()=>{i(E=>({...E,stepIndex:E.stepIndex+1}))},[]),w=m.useCallback(()=>{i(E=>({...E,stepIndex:Math.max(0,E.stepIndex-1)}))},[]),b=m.useCallback(()=>n.activeTourId?c.get(n.activeTourId)||[]:[],[n.activeTourId,c]),D=m.useCallback(E=>{x(C=>{const M=new Set(C);return M.add(E),fg(M),M})},[]),A=m.useCallback(E=>{const{action:C,index:M,status:G,type:O}=E,ee=["finished","skipped"];if(C==="close"){i(R=>({...R,isRunning:!1,stepIndex:0}));return}ee.includes(G)?i(R=>(G==="finished"&&R.activeTourId&&setTimeout(()=>D(R.activeTourId),0),{...R,isRunning:!1,stepIndex:0})):O==="step:after"&&(C==="next"?i(R=>({...R,stepIndex:M+1})):C==="prev"&&i(R=>({...R,stepIndex:M-1})))},[D]),_=m.useCallback(E=>u.has(E),[u]),H=m.useCallback(E=>{x(C=>{const M=new Set(C);return M.delete(E),fg(M),M})},[]);return e.jsx(ov.Provider,{value:{state:n,tours:c,registerTour:f,unregisterTour:p,startTour:g,stopTour:N,goToStep:v,nextStep:y,prevStep:w,getCurrentSteps:b,handleJoyrideCallback:A,isTourCompleted:_,markTourCompleted:D,resetTourCompleted:H},children:l})}function Ym(){const l=m.useContext(ov);if(!l)throw new Error("useTour must be used within a TourProvider");return l}const U_={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)"}},B_={back:"ไธŠไธ€ๆญฅ",close:"ๅ…ณ้—ญ",last:"ๅฎŒๆˆ",next:"ไธ‹ไธ€ๆญฅ",nextLabelWithProgress:"ไธ‹ไธ€ๆญฅ ({step}/{steps})",open:"ๆ‰“ๅผ€ๅฏน่ฏๆก†",skip:"่ทณ่ฟ‡"};function $_(){const{state:l,getCurrentSteps:n,handleJoyrideCallback:i}=Ym(),c=n(),[u,x]=m.useState(!1),h=m.useRef(l.stepIndex),f=m.useRef(null);m.useEffect(()=>{h.current!==l.stepIndex&&(x(!1),h.current=l.stepIndex)},[l.stepIndex]),m.useEffect(()=>{if(!l.isRunning||c.length===0){x(!1);return}const v=c[l.stepIndex];if(!v){x(!1);return}const y=v.target;if(y==="body"){x(!0);return}x(!1);const w=setTimeout(()=>{const b=()=>{const H=document.querySelector(y);if(H){const E=H.getBoundingClientRect();if(E.width>0&&E.height>0)return!0}return!1};if(b()){setTimeout(()=>x(!0),100);return}const D=setInterval(()=>{b()&&(clearInterval(D),setTimeout(()=>x(!0),100))},100),A=setTimeout(()=>{clearInterval(D),x(!0)},5e3),_=()=>{clearInterval(D),clearTimeout(A)};f.current=_},150);return()=>{clearTimeout(w),f.current&&(f.current(),f.current=null)}},[l.isRunning,l.stepIndex,c]);const[p,g]=m.useState(null);if(m.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)),g(v),()=>{}},[]),!l.isRunning||c.length===0||!u)return null;const N=e.jsx(S1,{steps:c,stepIndex:l.stepIndex,run:l.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:i,styles:U_,locale:B_,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${l.stepIndex}`);return p?u0.createPortal(N,p):N}const al="model-assignment-tour",uv=[{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}],mv={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"},$i=[{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 pg(l){return l?l.replace(/\/+$/,"").toLowerCase():""}function I_(l){if(!l)return null;const n=pg(l);return $i.find(i=>i.id!=="custom"&&pg(i.base_url)===n)||null}const wo=l=>({...l,max_retry:l.max_retry??2,timeout:l.timeout??30,retry_interval:l.retry_interval??10}),P_=l=>{const n={};return l?(l.name?.trim()||(n.name="่ฏท่พ“ๅ…ฅๆไพ›ๅ•†ๅ็งฐ"),l.base_url?.trim()||(n.base_url="่ฏท่พ“ๅ…ฅๅŸบ็ก€ URL"),l.api_key?.trim()||(n.api_key="่ฏท่พ“ๅ…ฅ API Key"),{isValid:Object.keys(n).length===0,errors:n}):{isValid:!1,errors:{name:"ๆไพ›ๅ•†ๆ•ฐๆฎไธบ็ฉบ"}}};function H_(){return e.jsx(Vn,{children:e.jsx(F_,{})})}function F_(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(!1),[h,f]=m.useState(!1),[p,g]=m.useState(!1),[N,v]=m.useState(!1),[y,w]=m.useState(null),[b,D]=m.useState(null),[A,_]=m.useState("custom"),[H,E]=m.useState(!1),[C,M]=m.useState(!1),[G,O]=m.useState(null),[ee,R]=m.useState(!1),[me,ce]=m.useState(""),[ve,se]=m.useState(new Set),[ge,fe]=m.useState(!1),[z,Q]=m.useState(1),[I,L]=m.useState(20),[$,_e]=m.useState(""),[je,Se]=m.useState({isOpen:!1,providersToDelete:[],affectedModels:[],pendingProviders:[],context:"auto",oldProviders:[]}),[K,U]=m.useState({}),[V,xe]=m.useState(new Set),[Ae,X]=m.useState(new Map),{toast:oe}=st(),Ge=ia(),{state:Y,goToStep:te,registerTour:Oe}=Ym(),{triggerRestart:De,isRestarting:Me}=fn(),de=m.useRef(null),Te=m.useRef(!0);m.useEffect(()=>{Oe(al,uv)},[Oe]),m.useEffect(()=>{if(Y.activeTourId===al&&Y.isRunning){const Z=mv[Y.stepIndex];Z&&!window.location.pathname.endsWith(Z.replace("/config/",""))&&Ge({to:Z})}},[Y.stepIndex,Y.activeTourId,Y.isRunning,Ge]);const rs=m.useRef(Y.stepIndex);m.useEffect(()=>{if(Y.activeTourId===al&&Y.isRunning){const Z=rs.current,ye=Y.stepIndex;Z>=3&&Z<=9&&ye<3&&v(!1),Z>=10&&ye>=3&&ye<=9&&(U({}),_("custom"),w({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),D(null),R(!1),v(!0)),rs.current=ye}},[Y.stepIndex,Y.activeTourId,Y.isRunning]),m.useEffect(()=>{if(Y.activeTourId!==al||!Y.isRunning)return;const Z=ye=>{const ze=ye.target,Hs=Y.stepIndex;Hs===2&&ze.closest('[data-tour="add-provider-button"]')?setTimeout(()=>te(3),300):Hs===9&&ze.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>te(10),300)};return document.addEventListener("click",Z,!0),()=>document.removeEventListener("click",Z,!0)},[Y,te]),m.useEffect(()=>{Rt()},[]);const Rt=async()=>{try{c(!0);const Z=await cn();n(Z.api_providers||[]),g(!1),Te.current=!1}catch(Z){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",Z)}finally{c(!1)}},ta=async()=>{await De()},Ga=async()=>{try{x(!0),de.current&&clearTimeout(de.current);const Z=l.map(rt=>({...rt,max_retry:rt.max_retry??2,timeout:rt.timeout??30,retry_interval:rt.retry_interval??10})),{shouldProceed:ye}=await Ht(Z,"restart");if(!ye){x(!1);return}const ze=await cn(),Hs=new Set(Z.map(rt=>rt.name)),Jt=(ze.models||[]).filter(rt=>Hs.has(rt.api_provider));ze.api_providers=Z,ze.models=Jt,await Fi(ze),g(!1),oe({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆญฃๅœจ้‡ๅฏ้บฆ้บฆ..."}),await ta()}catch(Z){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",Z),oe({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Z.message,variant:"destructive"}),x(!1)}},Ht=m.useCallback(async(Z,ye="auto")=>{try{const ze=await cn(),Hs=new Set(l.map(mt=>mt.name)),zt=new Set(Z.map(mt=>mt.name)),Jt=Array.from(Hs).filter(mt=>!zt.has(mt));if(Jt.length===0)return{shouldProceed:!0,providers:Z};const Xt=(ze.models||[]).filter(mt=>Jt.includes(mt.api_provider));return Xt.length===0?{shouldProceed:!0,providers:Z}:(Se({isOpen:!0,providersToDelete:Jt,affectedModels:Xt,pendingProviders:Z,context:ye,oldProviders:[...l]}),{shouldProceed:!1,providers:Z})}catch(ze){return console.error("ๆฃ€ๆŸฅๅˆ ้™คๅฝฑๅ“ๅคฑ่ดฅ:",ze),{shouldProceed:!0,providers:Z}}},[l]),ut=async()=>{try{(je.context==="auto"?f:x)(!0),Se(mt=>({...mt,isOpen:!1}));const ye=await cn(),ze=je.pendingProviders.map(wo),Hs=new Set(ze.map(mt=>mt.name)),Jt=(ye.models||[]).filter(mt=>Hs.has(mt.api_provider)),rt=new Set(je.affectedModels.map(mt=>mt.name)),Xt=ye.model_task_config;Xt&&Object.keys(Xt).forEach(mt=>{const re=Xt[mt];re&&Array.isArray(re.model_list)&&(re.model_list=re.model_list.filter(he=>!rt.has(he)))}),ye.api_providers=ze,ye.models=Jt,ye.model_task_config=Xt,await Fi(ye),n(je.pendingProviders),g(!1),oe({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${je.providersToDelete.length} ไธชๆไพ›ๅ•†ๅ’Œ ${je.affectedModels.length} ไธชๅ…ณ่”ๆจกๅž‹`}),Se({isOpen:!1,providersToDelete:[],affectedModels:[],pendingProviders:[],context:"auto",oldProviders:[]}),se(new Set),je.context==="restart"&&await ta()}catch(Z){console.error("ๅˆ ้™คๅคฑ่ดฅ:",Z),oe({title:"ๅˆ ้™คๅคฑ่ดฅ",description:Z.message,variant:"destructive"})}finally{je.context==="auto"?f(!1):x(!1)}},q=()=>{je.oldProviders.length>0&&n(je.oldProviders),Se({isOpen:!1,providersToDelete:[],affectedModels:[],pendingProviders:[],context:"auto",oldProviders:[]}),g(!1)},qe=m.useCallback(async Z=>{if(Te.current)return;const{shouldProceed:ye}=await Ht(Z,"auto");if(!ye){g(!0);return}try{f(!0);const ze=Z.map(wo);await Rm("api_providers",ze),g(!1)}catch(ze){console.error("่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ:",ze),oe({title:"่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ",description:ze.message,variant:"destructive"}),g(!0)}finally{f(!1)}},[l,Ht]);m.useEffect(()=>{if(!Te.current)return g(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{qe(l)},2e3),()=>{de.current&&clearTimeout(de.current)}},[l,qe]);const Qe=async()=>{try{x(!0),de.current&&clearTimeout(de.current);const Z=l.map(wo),{shouldProceed:ye}=await Ht(Z,"manual");if(!ye){x(!1);return}const ze=await cn(),Hs=new Set(Z.map(rt=>rt.name)),zt=ze.models||[],Jt=zt.filter(rt=>{const Xt=Hs.has(rt.api_provider);return Xt||console.warn(`ๆจกๅž‹ "${rt.name}" ๅผ•็”จไบ†ๅทฒๅˆ ้™ค็š„ๆไพ›ๅ•† "${rt.api_provider}"๏ผŒๅฐ†่ขซ็งป้™ค`),Xt});if(zt.length!==Jt.length){const rt=zt.length-Jt.length;oe({title:"ๆณจๆ„",description:`ๅทฒ่‡ชๅŠจ็งป้™ค ${rt} ไธชๅผ•็”จๅทฒๅˆ ้™คๆไพ›ๅ•†็š„ๆจกๅž‹`,variant:"default"})}console.log("ๅ‘้€็š„ providers ๆ•ฐๆฎ:",Z),ze.api_providers=Z,ze.models=Jt,console.log("ๅฎŒๆ•ด้…็ฝฎๆ•ฐๆฎ:",ze),await Fi(ze),g(!1),oe({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎๅทฒไฟๅญ˜"})}catch(Z){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",Z),oe({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:Z.message,variant:"destructive"})}finally{x(!1)}},We=(Z,ye)=>{if(U({}),Z){const ze=$i.find(Hs=>Hs.base_url===Z.base_url&&Hs.client_type===Z.client_type);_(ze?.id||"custom"),w(Z)}else _("custom"),w({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});D(ye),R(!1),v(!0)},Ds=m.useCallback(Z=>{_(Z),E(!1);const ye=$i.find(ze=>ze.id===Z);ye&&ye.id!=="custom"?w(ze=>({...ze,name:ye.name,base_url:ye.base_url,client_type:ye.client_type})):ye?.id==="custom"&&w(ze=>({...ze,name:"",base_url:"",client_type:"openai"}))},[]),as=m.useMemo(()=>A!=="custom",[A]),ks=m.useCallback(async()=>{if(y?.api_key)try{await navigator.clipboard.writeText(y.api_key),oe({title:"ๅคๅˆถๆˆๅŠŸ",description:"API Key ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"})}catch{oe({title:"ๅคๅˆถๅคฑ่ดฅ",description:"ๆ— ๆณ•่ฎฟ้—ฎๅ‰ช่ดดๆฟ",variant:"destructive"})}},[y?.api_key,oe]),Ee=()=>{if(!y)return;const{isValid:Z,errors:ye}=P_(y);if(!Z){U(ye);return}U({});const ze=wo(y);if(b!==null){const Hs=[...l];Hs[b]=ze,n(Hs)}else n([...l,ze]);v(!1),w(null),D(null)},vs=Z=>{if(!Z&&y){const ye={...y,max_retry:y.max_retry??2,timeout:y.timeout??30,retry_interval:y.retry_interval??10};w(ye)}v(Z)},ls=Z=>{O(Z),M(!0)},es=async()=>{if(G!==null){const Z=l.filter((ze,Hs)=>Hs!==G),{shouldProceed:ye}=await Ht(Z,"manual");ye&&(n(Z),oe({title:"ๅˆ ้™คๆˆๅŠŸ",description:"ๆไพ›ๅ•†ๅทฒไปŽๅˆ—่กจไธญ็งป้™ค"}))}M(!1),O(null)},Ns=Z=>{const ye=new Set(ve);ye.has(Z)?ye.delete(Z):ye.add(Z),se(ye)},pt=()=>{if(ve.size===Es.length)se(new Set);else{const Z=Es.map((ye,ze)=>l.findIndex(Hs=>Hs===Es[ze]));se(new Set(Z))}},Lt=()=>{if(ve.size===0){oe({title:"ๆ็คบ",description:"่ฏทๅ…ˆ้€‰ๆ‹ฉ่ฆๅˆ ้™ค็š„ๆไพ›ๅ•†",variant:"default"});return}fe(!0)},tt=async()=>{const Z=l.filter((ze,Hs)=>!ve.has(Hs)),{shouldProceed:ye}=await Ht(Z,"manual");ye&&(n(Z),se(new Set),oe({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${ve.size} ไธชๆไพ›ๅ•†`})),fe(!1)},Es=m.useMemo(()=>{if(!me)return l;const Z=me.toLowerCase();return l.filter(ye=>ye.name.toLowerCase().includes(Z)||ye.base_url.toLowerCase().includes(Z)||ye.client_type.toLowerCase().includes(Z))},[l,me]),{totalPages:kt,paginatedProviders:Ut}=m.useMemo(()=>{const Z=Math.ceil(Es.length/I),ye=Es.slice((z-1)*I,z*I);return{totalPages:Z,paginatedProviders:ye}},[Es,z,I]),Ea=m.useCallback(()=>{const Z=parseInt($);Z>=1&&Z<=kt&&(Q(Z),_e(""))},[$,kt]),Za=async Z=>{xe(ye=>new Set(ye).add(Z));try{const ye=await b_(Z);X(ze=>new Map(ze).set(Z,ye)),ye.network_ok?ye.api_key_valid===!0?oe({title:"่ฟžๆŽฅๆญฃๅธธ",description:`${Z} ็ฝ‘็ปœ่ฟžๆŽฅๆญฃๅธธ๏ผŒAPI Key ๆœ‰ๆ•ˆ (${ye.latency_ms}ms)`}):ye.api_key_valid===!1?oe({title:"่ฟžๆŽฅๆญฃๅธธไฝ† Key ๆ— ๆ•ˆ",description:`${Z} ็ฝ‘็ปœ่ฟžๆŽฅๆญฃๅธธ๏ผŒไฝ† API Key ๆ— ๆ•ˆๆˆ–ๅทฒ่ฟ‡ๆœŸ`,variant:"destructive"}):oe({title:"็ฝ‘็ปœ่ฟžๆŽฅๆญฃๅธธ",description:`${Z} ๅฏไปฅ่ฎฟ้—ฎ (${ye.latency_ms}ms)`}):oe({title:"่ฟžๆŽฅๅคฑ่ดฅ",description:ye.error||"ๆ— ๆณ•่ฟžๆŽฅๅˆฐๆไพ›ๅ•†",variant:"destructive"})}catch(ye){oe({title:"ๆต‹่ฏ•ๅคฑ่ดฅ",description:ye.message,variant:"destructive"})}finally{xe(ye=>{const ze=new Set(ye);return ze.delete(Z),ze})}},il=async()=>{for(const Z of l)await Za(Z.name)},Kn=Z=>{const ye=V.has(Z),ze=Ae.get(Z);return ye?e.jsxs(ke,{variant:"secondary",className:"gap-1",children:[e.jsx(Ls,{className:"h-3 w-3 animate-spin"}),"ๆต‹่ฏ•ไธญ"]}):ze?ze.network_ok?ze.api_key_valid===!0?e.jsxs(ke,{className:"gap-1 bg-green-600 hover:bg-green-700",children:[e.jsx(Wt,{className:"h-3 w-3"}),"ๆญฃๅธธ"]}):ze.api_key_valid===!1?e.jsxs(ke,{variant:"destructive",className:"gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),"Keyๆ— ๆ•ˆ"]}):e.jsxs(ke,{className:"gap-1 bg-blue-600 hover:bg-blue-700",children:[e.jsx(Wt,{className:"h-3 w-3"}),"ๅฏ่ฎฟ้—ฎ"]}):e.jsxs(ke,{variant:"destructive",className:"gap-1",children:[e.jsx(Ki,{className:"h-3 w-3"}),"็ฆป็บฟ"]}):null};return i?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:[ve.size>0&&e.jsxs(S,{onClick:Lt,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"ๆ‰น้‡ๅˆ ้™ค (",ve.size,")"]}),e.jsxs(S,{onClick:il,size:"sm",variant:"outline",className:"w-full sm:w-auto",disabled:l.length===0||V.size>0,children:[e.jsx(El,{className:"mr-2 h-4 w-4"}),V.size>0?`ๆต‹่ฏ•ไธญ (${V.size})`:"ๆต‹่ฏ•ๅ…จ้ƒจ"]}),e.jsxs(S,{onClick:()=>We(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[e.jsx(Zs,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"ๆทปๅŠ ๆไพ›ๅ•†"]}),e.jsxs(S,{onClick:Qe,disabled:u||h||!p||Me,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(tc,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),u?"ไฟๅญ˜ไธญ...":h?"่‡ชๅŠจไฟๅญ˜ไธญ...":p?"ไฟๅญ˜้…็ฝฎ":"ๅทฒไฟๅญ˜"]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{disabled:u||h||Me,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[e.jsx(sc,{className:"mr-2 h-4 w-4"}),Me?"้‡ๅฏไธญ...":p?"ไฟๅญ˜ๅนถ้‡ๅฏ":"้‡ๅฏ้บฆ้บฆ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๅฏ้บฆ้บฆ๏ผŸ"}),e.jsx(hs,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:p?"ๅฝ“ๅ‰ๆœ‰ๆœชไฟๅญ˜็š„้…็ฝฎๆ›ดๆ”นใ€‚็‚นๅ‡ป็กฎ่ฎคๅฐ†ๅ…ˆไฟๅญ˜้…็ฝฎ,็„ถๅŽ้‡ๅฏ้บฆ้บฆไฝฟๆ–ฐ้…็ฝฎ็”Ÿๆ•ˆใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟใ€‚":"ๅณๅฐ†้‡ๅฏ้บฆ้บฆไธป็จ‹ๅบใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟ,้…็ฝฎๅฐ†ๅœจ้‡ๅฏๅŽ็”Ÿๆ•ˆใ€‚"})})})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:p?Ga:ta,children:p?"ไฟๅญ˜ๅนถ้‡ๅฏ":"็กฎ่ฎค้‡ๅฏ"})]})]})]})]})]}),e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsxs(nt,{children:["้…็ฝฎๆ›ดๆ–ฐๅŽ้œ€่ฆ",e.jsx("strong",{children:"้‡ๅฏ้บฆ้บฆ"}),'ๆ‰่ƒฝ็”Ÿๆ•ˆใ€‚ไฝ ๅฏไปฅ็‚นๅ‡ปๅณไธŠ่ง’็š„"ไฟๅญ˜ๅนถ้‡ๅฏ"ๆŒ‰้’ฎไธ€้”ฎๅฎŒๆˆไฟๅญ˜ๅ’Œ้‡ๅฏใ€‚']})]}),e.jsxs(Je,{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(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆไพ›ๅ•†ๅ็งฐใ€URL ๆˆ–็ฑปๅž‹...",value:me,onChange:Z=>ce(Z.target.value),className:"pl-9"})]}),me&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["ๆ‰พๅˆฐ ",Es.length," ไธช็ป“ๆžœ"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:Es.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:me?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆไพ›ๅ•†":'ๆš‚ๆ— ๆไพ›ๅ•†้…็ฝฎ๏ผŒ็‚นๅ‡ป"ๆทปๅŠ ๆไพ›ๅ•†"ๅผ€ๅง‹้…็ฝฎ'}):Ut.map((Z,ye)=>{const ze=l.findIndex(Hs=>Hs===Z);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:Z.name}),Kn(Z.name)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:Z.base_url})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Za(Z.name),disabled:V.has(Z.name),title:"ๆต‹่ฏ•่ฟžๆŽฅ",children:V.has(Z.name)?e.jsx(Ls,{className:"h-4 w-4 animate-spin"}):e.jsx(El,{className:"h-4 w-4"})}),e.jsx(S,{variant:"default",size:"sm",onClick:()=>We(Z,ze),children:e.jsx($n,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),e.jsx(S,{size:"sm",onClick:()=>ls(ze),className:"bg-red-600 hover:bg-red-700 text-white",children:e.jsx(ns,{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:Z.client_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"ๆœ€ๅคง้‡่ฏ•"}),e.jsx("p",{className:"font-medium",children:Z.max_retry})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"่ถ…ๆ—ถ(็ง’)"}),e.jsx("p",{className:"font-medium",children:Z.timeout})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"้‡่ฏ•้—ด้š”(็ง’)"}),e.jsx("p",{className:"font-medium",children:Z.retry_interval})]})]})]},ye)})}),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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:ve.size===Es.length&&Es.length>0,onCheckedChange:pt})}),e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"ๅŸบ็ก€URL"}),e.jsx(Ze,{children:"ๅฎขๆˆท็ซฏ็ฑปๅž‹"}),e.jsx(Ze,{className:"text-right",children:"ๆœ€ๅคง้‡่ฏ•"}),e.jsx(Ze,{className:"text-right",children:"่ถ…ๆ—ถ(็ง’)"}),e.jsx(Ze,{className:"text-right",children:"้‡่ฏ•้—ด้š”(็ง’)"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:Ut.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:9,className:"text-center text-muted-foreground py-8",children:me?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆไพ›ๅ•†":'ๆš‚ๆ— ๆไพ›ๅ•†้…็ฝฎ๏ผŒ็‚นๅ‡ป"ๆทปๅŠ ๆไพ›ๅ•†"ๅผ€ๅง‹้…็ฝฎ'})}):Ut.map((Z,ye)=>{const ze=l.findIndex(Hs=>Hs===Z);return e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:ve.has(ze),onCheckedChange:()=>Ns(ze)})}),e.jsx(Ke,{children:Kn(Z.name)||e.jsx(ke,{variant:"outline",className:"text-muted-foreground",children:"ๆœชๆต‹่ฏ•"})}),e.jsx(Ke,{className:"font-medium",children:Z.name}),e.jsx(Ke,{className:"max-w-xs truncate",title:Z.base_url,children:Z.base_url}),e.jsx(Ke,{children:Z.client_type}),e.jsx(Ke,{className:"text-right",children:Z.max_retry}),e.jsx(Ke,{className:"text-right",children:Z.timeout}),e.jsx(Ke,{className:"text-right",children:Z.retry_interval}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Za(Z.name),disabled:V.has(Z.name),title:"ๆต‹่ฏ•่ฟžๆŽฅ",children:V.has(Z.name)?e.jsx(Ls,{className:"h-4 w-4 animate-spin"}):e.jsx(El,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"default",size:"sm",onClick:()=>We(Z,ze),children:[e.jsx($n,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>ls(ze),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"ๅˆ ้™ค"]})]})})]},ye)})})]})})}),Es.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(T,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:I.toString(),onValueChange:Z=>{L(parseInt(Z)),Q(1),se(new Set)},children:[e.jsx(Le,{id:"page-size-provider",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๆ˜พ็คบ ",(z-1)*I+1," ๅˆฐ"," ",Math.min(z*I,Es.length)," ๆก๏ผŒๅ…ฑ ",Es.length," ๆก"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Q(1),disabled:z===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>Q(Z=>Math.max(1,Z-1)),disabled:z===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:$,onChange:Z=>_e(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&Ea(),placeholder:z.toString(),className:"w-16 h-8 text-center",min:1,max:kt}),e.jsx(S,{variant:"outline",size:"sm",onClick:Ea,disabled:!$,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>Q(Z=>Z+1),disabled:z>=kt,children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Q(kt),disabled:z>=kt,className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]}),e.jsx(Ps,{open:N,onOpenChange:vs,children:e.jsxs(Us,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:Y.isRunning,children:[e.jsxs(Bs,{children:[e.jsx($s,{children:b!==null?"็ผ–่พ‘ๆไพ›ๅ•†":"ๆทปๅŠ ๆไพ›ๅ•†"}),e.jsx(Ys,{children:"้…็ฝฎ API ๆไพ›ๅ•†็š„่ฟžๆŽฅไฟกๆฏๅ’Œๅ‚ๆ•ฐ"})]}),e.jsxs("form",{onSubmit:Z=>{Z.preventDefault(),Ee()},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(T,{htmlFor:"template",children:"ๆไพ›ๅ•†ๆจกๆฟ"}),e.jsxs(nl,{open:H,onOpenChange:E,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",role:"combobox","aria-expanded":H,className:"w-full justify-between",children:[A?$i.find(Z=>Z.id===A)?.display_name:"้€‰ๆ‹ฉๆไพ›ๅ•†ๆจกๆฟ...",e.jsx(Vm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ja,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(Yo,{children:[e.jsx(Jo,{placeholder:"ๆœ็ดขๆไพ›ๅ•†ๆจกๆฟ..."}),e.jsx(Je,{className:"h-[300px]",children:e.jsxs(Xo,{className:"max-h-none overflow-visible",children:[e.jsx(Zo,{children:"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๆฟ"}),e.jsx(Ji,{children:$i.map(Z=>e.jsxs(Xi,{value:Z.display_name,onSelect:()=>Ds(Z.id),children:[e.jsx(_t,{className:`mr-2 h-4 w-4 ${A===Z.id?"opacity-100":"opacity-0"}`}),Z.display_name]},Z.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(T,{htmlFor:"name",className:K.name?"text-destructive":"",children:"ๅ็งฐ *"}),e.jsx(ne,{id:"name",value:y?.name||"",onChange:Z=>{w(ye=>ye?{...ye,name:Z.target.value}:null),K.name&&U(ye=>({...ye,name:void 0}))},placeholder:"ไพ‹ๅฆ‚: DeepSeek, SiliconFlow",className:K.name?"border-destructive focus-visible:ring-destructive":""}),K.name&&e.jsx("p",{className:"text-xs text-destructive",children:K.name})]}),e.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[e.jsx(T,{htmlFor:"base_url",className:K.base_url?"text-destructive":"",children:"ๅŸบ็ก€ URL *"}),e.jsx(ne,{id:"base_url",value:y?.base_url||"",onChange:Z=>{w(ye=>ye?{...ye,base_url:Z.target.value}:null),K.base_url&&U(ye=>({...ye,base_url:void 0}))},placeholder:"https://api.example.com/v1",disabled:as,className:`${as?"bg-muted cursor-not-allowed":""} ${K.base_url?"border-destructive focus-visible:ring-destructive":""}`}),K.base_url&&e.jsx("p",{className:"text-xs text-destructive",children:K.base_url}),as&&!K.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(T,{htmlFor:"api_key",className:K.api_key?"text-destructive":"",children:"API Key *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{id:"api_key",type:ee?"text":"password",value:y?.api_key||"",onChange:Z=>{w(ye=>ye?{...ye,api_key:Z.target.value}:null),K.api_key&&U(ye=>({...ye,api_key:void 0}))},placeholder:"sk-...",className:`flex-1 ${K.api_key?"border-destructive focus-visible:ring-destructive":""}`}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:()=>R(!ee),title:ee?"้š่—ๅฏ†้’ฅ":"ๆ˜พ็คบๅฏ†้’ฅ",children:ee?e.jsx(qi,{className:"h-4 w-4"}):e.jsx(na,{className:"h-4 w-4"})}),e.jsx(S,{type:"button",variant:"outline",size:"icon",onClick:ks,title:"ๅคๅˆถๅฏ†้’ฅ",children:e.jsx(Mo,{className:"h-4 w-4"})})]}),K.api_key&&e.jsx("p",{className:"text-xs text-destructive",children:K.api_key})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"client_type",children:"ๅฎขๆˆท็ซฏ็ฑปๅž‹"}),e.jsxs(Be,{value:y?.client_type||"openai",onValueChange:Z=>w(ye=>ye?{...ye,client_type:Z}:null),disabled:as,children:[e.jsx(Le,{id:"client_type",className:as?"bg-muted cursor-not-allowed":"",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅฎขๆˆท็ซฏ็ฑปๅž‹"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"openai",children:"OpenAI"}),e.jsx(W,{value:"gemini",children:"Gemini"})]})]}),as&&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(T,{htmlFor:"max_retry",children:"ๆœ€ๅคง้‡่ฏ•"}),e.jsx(ne,{id:"max_retry",type:"number",min:"0",value:y?.max_retry??"",onChange:Z=>{const ye=Z.target.value===""?null:parseInt(Z.target.value);w(ze=>ze?{...ze,max_retry:ye}:null)},placeholder:"้ป˜่ฎค: 2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"timeout",children:"่ถ…ๆ—ถ(็ง’)"}),e.jsx(ne,{id:"timeout",type:"number",min:"1",value:y?.timeout??"",onChange:Z=>{const ye=Z.target.value===""?null:parseInt(Z.target.value);w(ze=>ze?{...ze,timeout:ye}:null)},placeholder:"้ป˜่ฎค: 30"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"retry_interval",children:"้‡่ฏ•้—ด้š”(็ง’)"}),e.jsx(ne,{id:"retry_interval",type:"number",min:"1",value:y?.retry_interval??"",onChange:Z=>{const ye=Z.target.value===""?null:parseInt(Z.target.value);w(ze=>ze?{...ze,retry_interval:ye}:null)},placeholder:"้ป˜่ฎค: 10"})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>v(!1),"data-tour":"provider-cancel-button",children:"ๅ–ๆถˆ"}),e.jsx(S,{type:"submit","data-tour":"provider-save-button",children:"ไฟๅญ˜"})]})]})]})}),e.jsx(js,{open:C,onOpenChange:M,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๆไพ›ๅ•† "',G!==null?l[G]?.name:"",'" ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:es,children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:ge,onOpenChange:fe,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",ve.size," ไธชๆไพ›ๅ•†ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:tt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๆ‰น้‡ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:je.isOpen,onOpenChange:Z=>Se(ye=>({...ye,isOpen:Z})),children:e.jsxs(ds,{className:"max-w-2xl",children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™คๆไพ›ๅ•†"}),e.jsx(hs,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["ๆ‚จๅณๅฐ†ๅˆ ้™คไปฅไธ‹ๆไพ›ๅ•†๏ผš",e.jsx("strong",{className:"text-foreground ml-1",children:je.providersToDelete.join(", ")})]}),e.jsxs("p",{className:"text-yellow-600 dark:text-yellow-500 font-medium",children:["โš ๏ธ ๆญคๆ“ไฝœๅฐ†ๅŒๆ—ถๅˆ ้™ค ",je.affectedModels.length," ไธชๅ…ณ่”็š„ๆจกๅž‹๏ผš"]}),e.jsx(Je,{className:"h-32 w-full rounded border p-3",children:e.jsx("div",{className:"space-y-1",children:je.affectedModels.map((Z,ye)=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-mono text-muted-foreground",children:"โ€ข"}),e.jsx("span",{className:"ml-2 font-medium",children:Z.name}),e.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",Z.model_identifier,")"]})]},ye))})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"่ฟ™ไบ›ๆจกๅž‹ๅฐ†ไปŽๆจกๅž‹ๅˆ—่กจๅ’Œๆ‰€ๆœ‰ไปปๅŠกๅˆ†้…ไธญ็งป้™คใ€‚ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"})]})})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:q,children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ut,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎคๅˆ ้™ค"})]})]})}),e.jsx(qn,{})]})}function Gi(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,11)}`}function wm(l){return l===null?"null":Array.isArray(l)?"array":typeof l=="object"?"object":typeof l=="boolean"?"boolean":typeof l=="number"?"number":"string"}function Lm(l){return Object.entries(l).map(([n,i])=>{const c=wm(i),u={id:Gi(),key:n,value:i,type:c,expanded:!0};return c==="object"&&i&&typeof i=="object"?u.children=Lm(i):c==="array"&&Array.isArray(i)&&(u.children=i.map((x,h)=>{const f=wm(x),p={id:Gi(),key:String(h),value:x,type:f,expanded:!0};return f==="object"&&x&&typeof x=="object"?p.children=Lm(x):f==="array"&&Array.isArray(x)&&(p.children=x.map((g,N)=>({id:Gi(),key:String(N),value:g,type:wm(g),expanded:!0}))),p})),u})}function Um(l){const n={};for(const i of l)i.key.trim()&&(i.type==="object"&&i.children?n[i.key]=Um(i.children):i.type==="array"&&i.children?n[i.key]=i.children.map(c=>c.type==="object"&&c.children?Um(c.children):c.type==="array"&&c.children?c.children.map(u=>u.value):c.value):i.type==="null"?n[i.key]=null:n[i.key]=i.value);return n}function gg(l,n){switch(n){case"boolean":return l==="true";case"number":{const i=parseFloat(l);return isNaN(i)?0:i}case"null":return null;default:return l}}function xv({node:l,level:n,onUpdate:i,onRemove:c,onAddChild:u,onToggleExpand:x}){const h=l.type==="object"||l.type==="array",f=l.children&&l.children.length>0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"grid gap-2 items-center",style:{gridTemplateColumns:h?"32px 1fr 90px 64px":"32px 1fr 1fr 90px 32px",paddingLeft:`${n*20}px`},children:[e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>x(l.id),disabled:!h||!f,children:h&&f?l.expanded?e.jsx(Ta,{className:"h-4 w-4"}):e.jsx(sa,{className:"h-4 w-4"}):e.jsx("span",{className:"w-4"})}),e.jsx(ne,{value:l.key,onChange:p=>i(l.id,"key",p.target.value),placeholder:"key",className:"h-8 text-sm"}),!h&&e.jsx(e.Fragment,{children:l.type==="boolean"?e.jsxs("div",{className:"flex items-center h-8 px-3 border rounded-md bg-background",children:[e.jsx(Fe,{checked:l.value===!0,onCheckedChange:p=>i(l.id,"value",p)}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:l.value?"true":"false"})]}):l.type==="null"?e.jsx("div",{className:"flex items-center h-8 px-3 border rounded-md bg-muted text-sm text-muted-foreground",children:"null"}):e.jsx(ne,{type:l.type==="number"?"number":"text",value:l.value,onChange:p=>i(l.id,"value",p.target.value),placeholder:"value",className:"h-8 text-sm",step:l.type==="number"?"any":void 0})}),e.jsxs(Be,{value:l.type,onValueChange:p=>i(l.id,"type",p),children:[e.jsx(Le,{className:"h-8 text-xs",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"string",children:"ๅญ—็ฌฆไธฒ"}),e.jsx(W,{value:"number",children:"ๆ•ฐๅญ—"}),e.jsx(W,{value:"boolean",children:"ๅธƒๅฐ”"}),e.jsx(W,{value:"null",children:"Null"}),e.jsx(W,{value:"object",children:"ๅฏน่ฑก"}),e.jsx(W,{value:"array",children:"ๆ•ฐ็ป„"})]})]}),e.jsxs("div",{className:"flex gap-1 justify-end",children:[h&&e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-primary",onClick:()=>u(l.id),title:"ๆทปๅŠ ๅญ้กน",children:e.jsx(Zs,{className:"h-4 w-4"})}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>c(l.id),title:"ๅˆ ้™ค",children:e.jsx(ns,{className:"h-4 w-4"})})]})]}),h&&l.expanded&&l.children&&l.children.length>0&&e.jsx("div",{className:"space-y-1",children:l.children.map(p=>e.jsx(xv,{node:p,level:n+1,onUpdate:i,onRemove:c,onAddChild:u,onToggleExpand:x},p.id))})]})}function G_({value:l,onChange:n,placeholder:i="ๆทปๅŠ ๅ‚ๆ•ฐ..."}){const[c,u]=m.useState(()=>Lm(l||{})),x=m.useCallback(v=>{u(v),n(Um(v))},[n]),h=m.useCallback(()=>{const v={id:Gi(),key:"",value:"",type:"string",expanded:!1};x([...c,v])},[c,x]),f=m.useCallback((v,y,w)=>{const b=D=>D.map(A=>{if(A.id===v)if(y==="type"){const _=w;if(_==="object")return{...A,type:_,value:{},children:[]};if(_==="array")return{...A,type:_,value:[],children:[]};if(_==="null")return{...A,type:_,value:null};{const H=gg(String(A.value),_);return{...A,type:_,value:H,children:void 0}}}else if(y==="value"){const _=gg(String(w),A.type);return{...A,value:_}}else return{...A,[y]:String(w)};return A.children?{...A,children:b(A.children)}:A});x(b(c))},[c,x]),p=m.useCallback(v=>{const y=w=>w.filter(b=>b.id!==v).map(b=>b.children?{...b,children:y(b.children)}:b);x(y(c))},[c,x]),g=m.useCallback(v=>{const y=w=>w.map(b=>{if(b.id===v){const D={id:Gi(),key:b.type==="array"?String(b.children?.length||0):"",value:"",type:"string",expanded:!0};return{...b,children:[...b.children||[],D]}}return b.children?{...b,children:y(b.children)}:b});x(y(c))},[c,x]),N=m.useCallback(v=>{const y=w=>w.map(b=>b.id===v?{...b,expanded:!b.expanded}:b.children?{...b,children:y(b.children)}:b);u(y(c))},[c]);return e.jsxs("div",{className:"h-full flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," ไธชๅ‚ๆ•ฐ"]}),e.jsxs(S,{type:"button",size:"sm",variant:"outline",onClick:h,className:"h-7 text-xs",children:[e.jsx(Zs,{className:"h-3 w-3 mr-1"}),"ๆทปๅŠ ๅ‚ๆ•ฐ"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-1",children:c.length===0?e.jsx("div",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded-md",children:i}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"grid gap-2 text-xs text-muted-foreground px-1 sticky top-0 bg-background z-10",style:{gridTemplateColumns:"32px 1fr 1fr 90px 32px"},children:[e.jsx("span",{}),e.jsx("span",{children:"้”ฎๅ"}),e.jsx("span",{children:"ๅ€ผ"}),e.jsx("span",{children:"็ฑปๅž‹"}),e.jsx("span",{})]}),c.map(v=>e.jsx(xv,{node:v,level:0,onUpdate:f,onRemove:p,onAddChild:g,onToggleExpand:N},v.id))]})})]})}function jg(l){if(!l.trim())return{valid:!0,parsed:{}};try{const n=JSON.parse(l);return typeof n!="object"||n===null||Array.isArray(n)?{valid:!1,error:"ๅฟ…้กปๆ˜ฏไธ€ไธช JSON ๅฏน่ฑก {}"}:{valid:!0,parsed:n}}catch{return{valid:!1,error:"JSON ๆ ผๅผ้”™่ฏฏ"}}}function V_({value:l,onChange:n,className:i,placeholder:c="ๆทปๅŠ ้ขๅค–ๅ‚ๆ•ฐ..."}){const[u,x]=m.useState("list"),h=m.useMemo(()=>Object.keys(l||{}).length>0?JSON.stringify(l,null,2):"",[l]),[f,p]=m.useState(h),[g,N]=m.useState(null);m.useEffect(()=>{p(h)},[h]);const v=m.useMemo(()=>{const b=jg(f);return b.valid&&b.parsed?{success:!0,data:b.parsed}:{success:!1,data:{}}},[f]),y=m.useCallback(b=>{const D=b;D==="json"&&u==="list"&&(p(Object.keys(l).length>0?JSON.stringify(l,null,2):""),N(null)),x(D)},[u,l]),w=m.useCallback(b=>{p(b);const D=jg(b);D.valid&&D.parsed?(N(null),n(D.parsed)):N(D.error||"JSON ๆ ผๅผ้”™่ฏฏ")},[n]);return e.jsx("div",{className:P("h-full flex flex-col",i),children:e.jsxs(ra,{value:u,onValueChange:y,className:"w-full flex-1 flex flex-col",children:[e.jsxs(ea,{className:"h-8 p-0.5 bg-muted/60 w-fit",children:[e.jsx(ts,{value:"list",className:"h-7 px-3 text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"ๅฏ่ง†ๅŒ–็ผ–่พ‘"}),e.jsx(ts,{value:"json",className:"h-7 px-3 text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"JSON ็ผ–่พ‘"})]}),e.jsx(bs,{value:"list",className:"mt-2 flex-1 flex flex-col overflow-hidden data-[state=inactive]:hidden data-[state=inactive]:h-0",children:e.jsx(G_,{value:l,onChange:n,placeholder:c})}),e.jsx(bs,{value:"json",className:"mt-2 flex-1 flex flex-col overflow-hidden data-[state=inactive]:hidden data-[state=inactive]:h-0",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col gap-2 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"็ผ–่พ‘"}),g?e.jsxs("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[e.jsx(St,{className:"h-3 w-3"}),e.jsx("span",{className:"truncate max-w-[150px]",children:g})]}):f.trim()&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 dark:text-green-400",children:[e.jsx(_t,{className:"h-3 w-3"}),e.jsx("span",{children:"ๆœ‰ๆ•ˆ"})]})]}),e.jsx(at,{value:f,onChange:b=>w(b.target.value),placeholder:`{ "key": "value" -}`,className:H("font-mono text-sm flex-1 resize-none",g&&"border-destructive focus-visible:ring-destructive")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ”ฏๆŒไปปๆ„ JSON ็ฑปๅž‹๏ผˆๅŒ…ๆ‹ฌๅตŒๅฅ—ๅฏน่ฑกๅ’Œๆ•ฐ็ป„๏ผ‰"})]}),e.jsxs("div",{className:"flex flex-col gap-2 overflow-hidden",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"้ข„่งˆ"}),e.jsx("div",{className:"flex-1 rounded-md border bg-muted/30 p-3 overflow-auto",children:v.success&&Object.keys(v.data).length>0?e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-words",children:JSON.stringify(v.data,null,2)}):v.success?e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"ๆš‚ๆ— ๅ‚ๆ•ฐ"}):e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive",children:"JSON ๆ ผๅผ้”™่ฏฏ"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฎžๆ—ถ้ข„่งˆ่งฃๆž็ป“ๆžœ"})]})]})})]})})}function q_({open:l,onOpenChange:n,value:i,onChange:c}){const[u,x]=m.useState(i),h=g=>{g&&x(i),n(g)},f=()=>{c(u),n(!1)},p=()=>{x(i),n(!1)};return e.jsx(Ps,{open:l,onOpenChange:h,children:e.jsxs(Us,{className:"max-w-3xl h-[70vh] flex flex-col",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘้ขๅค–ๅ‚ๆ•ฐ"}),e.jsx(Ys,{children:"้…็ฝฎๆจกๅž‹่ฐƒ็”จๆ—ถ็š„้ขๅค–ๅ‚ๆ•ฐ๏ผŒๆ”ฏๆŒๅตŒๅฅ—ๅฏน่ฑกๅ’Œๆ•ฐ็ป„"})]}),e.jsx("div",{className:"flex-1 overflow-hidden min-h-0",children:e.jsx(V_,{value:u,onChange:x,placeholder:"ๆทปๅŠ ้ขๅค–ๅ‚ๆ•ฐ๏ผˆๅฆ‚ thinkingใ€top_p ็ญ‰๏ผ‰..."})}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:p,children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:f,children:"ไฟๅญ˜"})]})]})})}const Fr="https://maibot-plugin-stats.maibot-webui.workers.dev";async function K_(l){const n=new URLSearchParams;l?.status&&n.set("status",l.status),l?.page&&n.set("page",l.page.toString()),l?.page_size&&n.set("page_size",l.page_size.toString()),l?.search&&n.set("search",l.search),l?.sort_by&&n.set("sort_by",l.sort_by),l?.sort_order&&n.set("sort_order",l.sort_order);const i=await fetch(`${Fr}/pack?${n.toString()}`);if(!i.ok)throw new Error(`่Žทๅ– Pack ๅˆ—่กจๅคฑ่ดฅ: ${i.status}`);return i.json()}async function Q_(l){const n=await fetch(`${Fr}/pack/${l}`);if(!n.ok)throw new Error(`่Žทๅ– Pack ๅคฑ่ดฅ: ${n.status}`);const i=await n.json();if(!i.success)throw new Error(i.error||"่Žทๅ– Pack ๅคฑ่ดฅ");return i.pack}async function Y_(l){const i=await(await fetch(`${Fr}/pack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).json();if(!i.success)throw new Error(i.error||"ๅˆ›ๅปบ Pack ๅคฑ่ดฅ");return i}async function J_(l,n){await fetch(`${Fr}/pack/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pack_id:l,user_id:n})})}async function hv(l,n){const c=await(await fetch(`${Fr}/pack/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pack_id:l,user_id:n})})).json();if(!c.success)throw new Error(c.error||"็‚น่ตžๅคฑ่ดฅ");return{likes:c.likes,liked:c.liked}}async function fv(l,n){return(await(await fetch(`${Fr}/pack/like/check?pack_id=${l}&user_id=${n}`)).json()).liked||!1}async function X_(l){const n=await we("/api/webui/config/model");if(!n.ok)throw new Error("่Žทๅ–ๅฝ“ๅ‰ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const i=await n.json(),c=i.config||i;console.log("=== Pack Conflict Detection ==="),console.log("Pack providers:",l.providers),console.log("Local providers:",c.api_providers);const u={existing_providers:[],new_providers:[],conflicting_models:[]},x=c.api_providers||[];for(const f of l.providers){console.log(` -Checking pack provider: ${f.name}`),console.log(` Pack URL: ${f.base_url}`),console.log(` Normalized: ${wm(f.base_url)}`);const p=x.filter(g=>{const N=wm(g.base_url),v=wm(f.base_url);return console.log(` Comparing with local "${g.name}": ${g.base_url}`),console.log(` Local normalized: ${N}`),console.log(` Match: ${N===v}`),N===v});p.length>0?(console.log(` โœ“ Matched with ${p.length} local provider(s):`,p.map(g=>g.name).join(", ")),u.existing_providers.push({pack_provider:f,local_providers:p.map(g=>({name:g.name,base_url:g.base_url}))})):(console.log(" โœ— No match found - will need API key"),u.new_providers.push(f))}const h=c.models||[];console.log(` +}`,className:P("font-mono text-sm flex-1 resize-none",g&&"border-destructive focus-visible:ring-destructive")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ”ฏๆŒไปปๆ„ JSON ็ฑปๅž‹๏ผˆๅŒ…ๆ‹ฌๅตŒๅฅ—ๅฏน่ฑกๅ’Œๆ•ฐ็ป„๏ผ‰"})]}),e.jsxs("div",{className:"flex flex-col gap-2 overflow-hidden",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"้ข„่งˆ"}),e.jsx("div",{className:"flex-1 rounded-md border bg-muted/30 p-3 overflow-auto",children:v.success&&Object.keys(v.data).length>0?e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-words",children:JSON.stringify(v.data,null,2)}):v.success?e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"ๆš‚ๆ— ๅ‚ๆ•ฐ"}):e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive",children:"JSON ๆ ผๅผ้”™่ฏฏ"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฎžๆ—ถ้ข„่งˆ่งฃๆž็ป“ๆžœ"})]})]})})]})})}function q_({open:l,onOpenChange:n,value:i,onChange:c}){const[u,x]=m.useState(i),h=g=>{g&&x(i),n(g)},f=()=>{c(u),n(!1)},p=()=>{x(i),n(!1)};return e.jsx(Ps,{open:l,onOpenChange:h,children:e.jsxs(Us,{className:"max-w-3xl h-[70vh] flex flex-col",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘้ขๅค–ๅ‚ๆ•ฐ"}),e.jsx(Ys,{children:"้…็ฝฎๆจกๅž‹่ฐƒ็”จๆ—ถ็š„้ขๅค–ๅ‚ๆ•ฐ๏ผŒๆ”ฏๆŒๅตŒๅฅ—ๅฏน่ฑกๅ’Œๆ•ฐ็ป„"})]}),e.jsx("div",{className:"flex-1 overflow-hidden min-h-0",children:e.jsx(V_,{value:u,onChange:x,placeholder:"ๆทปๅŠ ้ขๅค–ๅ‚ๆ•ฐ๏ผˆๅฆ‚ thinkingใ€top_p ็ญ‰๏ผ‰..."})}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:p,children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:f,children:"ไฟๅญ˜"})]})]})})}const Fr="https://maibot-plugin-stats.maibot-webui.workers.dev";async function K_(l){const n=new URLSearchParams;l?.status&&n.set("status",l.status),l?.page&&n.set("page",l.page.toString()),l?.page_size&&n.set("page_size",l.page_size.toString()),l?.search&&n.set("search",l.search),l?.sort_by&&n.set("sort_by",l.sort_by),l?.sort_order&&n.set("sort_order",l.sort_order);const i=await fetch(`${Fr}/pack?${n.toString()}`);if(!i.ok)throw new Error(`่Žทๅ– Pack ๅˆ—่กจๅคฑ่ดฅ: ${i.status}`);return i.json()}async function Q_(l){const n=await fetch(`${Fr}/pack/${l}`);if(!n.ok)throw new Error(`่Žทๅ– Pack ๅคฑ่ดฅ: ${n.status}`);const i=await n.json();if(!i.success)throw new Error(i.error||"่Žทๅ– Pack ๅคฑ่ดฅ");return i.pack}async function Y_(l){const i=await(await fetch(`${Fr}/pack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).json();if(!i.success)throw new Error(i.error||"ๅˆ›ๅปบ Pack ๅคฑ่ดฅ");return i}async function J_(l,n){await fetch(`${Fr}/pack/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pack_id:l,user_id:n})})}async function hv(l,n){const c=await(await fetch(`${Fr}/pack/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pack_id:l,user_id:n})})).json();if(!c.success)throw new Error(c.error||"็‚น่ตžๅคฑ่ดฅ");return{likes:c.likes,liked:c.liked}}async function fv(l,n){return(await(await fetch(`${Fr}/pack/like/check?pack_id=${l}&user_id=${n}`)).json()).liked||!1}async function X_(l){const n=await we("/api/webui/config/model");if(!n.ok)throw new Error("่Žทๅ–ๅฝ“ๅ‰ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const i=await n.json(),c=i.config||i;console.log("=== Pack Conflict Detection ==="),console.log("Pack providers:",l.providers),console.log("Local providers:",c.api_providers);const u={existing_providers:[],new_providers:[],conflicting_models:[]},x=c.api_providers||[];for(const f of l.providers){console.log(` +Checking pack provider: ${f.name}`),console.log(` Pack URL: ${f.base_url}`),console.log(` Normalized: ${_m(f.base_url)}`);const p=x.filter(g=>{const N=_m(g.base_url),v=_m(f.base_url);return console.log(` Comparing with local "${g.name}": ${g.base_url}`),console.log(` Local normalized: ${N}`),console.log(` Match: ${N===v}`),N===v});p.length>0?(console.log(` โœ“ Matched with ${p.length} local provider(s):`,p.map(g=>g.name).join(", ")),u.existing_providers.push({pack_provider:f,local_providers:p.map(g=>({name:g.name,base_url:g.base_url}))})):(console.log(" โœ— No match found - will need API key"),u.new_providers.push(f))}const h=c.models||[];console.log(` === Model Conflict Detection ===`);for(const f of l.models){const p=h.find(g=>g.name===f.name);p&&(console.log(`Model conflict: ${f.name}`),u.conflicting_models.push({pack_model:f.name,local_model:p.name}))}return console.log(` === Detection Summary ===`),console.log(`Existing providers: ${u.existing_providers.length}`),console.log(`New providers: ${u.new_providers.length}`),console.log(`Conflicting models: ${u.conflicting_models.length}`),console.log(`=========================== -`),u}async function Z_(l,n,i,c){const u=await we("/api/webui/config/model");if(!u.ok)throw new Error("่Žทๅ–ๅฝ“ๅ‰ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const x=await u.json(),h=x.config||x;if(n.apply_providers){const p=n.selected_providers?l.providers.filter(g=>n.selected_providers.includes(g.name)):l.providers;for(const g of p){if(i[g.name])continue;const N=c[g.name];if(!N)throw new Error(`ๆไพ›ๅ•† "${g.name}" ็ผบๅฐ‘ API Key`);const v={...g,api_key:N},y=h.api_providers.findIndex(w=>w.name===g.name);y>=0?h.api_providers[y]=v:h.api_providers.push(v)}}if(n.apply_models){const p=n.selected_models?l.models.filter(g=>n.selected_models.includes(g.name)):l.models;for(const g of p){const N=i[g.api_provider]||g.api_provider,v={...g,api_provider:N},y=h.models.findIndex(w=>w.name===g.name);y>=0?h.models[y]=v:h.models.push(v)}}if(n.apply_task_config){const p=n.selected_tasks||Object.keys(l.task_config);for(const g of p){const N=l.task_config[g];if(!N)continue;const v=new Set(n.selected_models||l.models.map(b=>b.name)),y=N.model_list.filter(b=>v.has(b));if(y.length===0)continue;const w={...N,model_list:y};if(n.task_mode==="replace")h.model_task_config[g]=w;else{const b=h.model_task_config[g];if(b){const D=[...new Set([...b.model_list,...y])];h.model_task_config[g]={...b,model_list:D}}else h.model_task_config[g]=w}}}if(!(await we("/api/webui/config/model",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)})).ok)throw new Error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function W_(l){const n=await we("/api/webui/config/model");if(!n.ok)throw new Error("่Žทๅ–ๅฝ“ๅ‰ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const i=await n.json();if(!i.success||!i.config)throw new Error("่Žทๅ–้…็ฝฎๅคฑ่ดฅ");const c=i.config;let u=(c.api_providers||[]).map(g=>({name:g.name,base_url:g.base_url,client_type:g.client_type,max_retry:g.max_retry,timeout:g.timeout,retry_interval:g.retry_interval}));l.selectedProviders&&(u=u.filter(g=>l.selectedProviders.includes(g.name)));let x=c.models||[];l.selectedModels&&(x=x.filter(g=>l.selectedModels.includes(g.name)));const h={},f=c.model_task_config||{},p=l.selectedTasks||Object.keys(f);for(const g of p)f[g]&&(h[g]=f[g]);return{providers:u,models:x,task_config:h}}function wm(l){try{const n=new URL(l);return`${n.protocol}//${n.host}${n.pathname}`.replace(/\/$/,"").toLowerCase()}catch{return l.toLowerCase().replace(/\/$/,"")}}function pv(){const l="maibot_pack_user_id";let n=localStorage.getItem(l);return n||(n="pack_user_"+Math.random().toString(36).substring(2,15),localStorage.setItem(l,n)),n}const eS={utils:"้€š็”จๅทฅๅ…ท",utils_small:"่ฝป้‡ๅทฅๅ…ท",tool_use:"ๅทฅๅ…ท่ฐƒ็”จ",replyer:"ๅ›žๅค็”Ÿๆˆ",planner:"่ง„ๅˆ’ๆŽจ็†",vlm:"่ง†่ง‰ๆจกๅž‹",voice:"่ฏญ้Ÿณๅค„็†",embedding:"ๅ‘้‡ๅตŒๅ…ฅ",lpmm_entity_extract:"ๅฎžไฝ“ๆๅ–",lpmm_rdf_build:"RDFๆž„ๅปบ",lpmm_qa:"้—ฎ็ญ”ๆจกๅž‹"},sS=["ๅฎ˜ๆ–นๆŽจ่","ๆ€งไปทๆฏ”","้ซ˜ๆ€ง่ƒฝ","ๅ…่ดนๆจกๅž‹","ๅ›ฝๅ†…ๅฏ็”จ","ๆตทๅค–ๆจกๅž‹","OpenAI","Claude","Gemini","ๅ›ฝไบงๆจกๅž‹","ๅคšๆจกๆ€","่ฝป้‡็บง"];function tS({trigger:l}){const[n,i]=m.useState(!1),[c,u]=m.useState(1),[x,h]=m.useState(!1),[f,p]=m.useState(!1),[g,N]=m.useState([]),[v,y]=m.useState([]),[w,b]=m.useState({}),[D,A]=m.useState(new Set),[_,P]=m.useState(new Set),[E,C]=m.useState(new Set),[M,G]=m.useState(""),[O,ee]=m.useState(""),[R,me]=m.useState(""),[ce,ve]=m.useState([]);m.useEffect(()=>{n&&c===1&&se()},[n,c]);const se=async()=>{h(!0);try{const K=await W_({name:"",description:"",author:""});N(K.providers),y(K.models),b(K.task_config),A(new Set(K.providers.map(U=>U.name))),P(new Set(K.models.map(U=>U.name))),C(new Set(Object.keys(K.task_config)))}catch(K){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",K),qt({title:"ๅŠ ่ฝฝๅฝ“ๅ‰้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{h(!1)}},ge=K=>{const U=new Set(D),V=new Set(_),xe=new Set(E);U.has(K)?(U.delete(K),v.filter(X=>X.api_provider===K).forEach(X=>V.delete(X.name)),Object.entries(w).forEach(([X,oe])=>{oe.model_list&&(oe.model_list.some(Y=>V.has(Y))||xe.delete(X))})):(U.add(K),v.filter(X=>X.api_provider===K).forEach(X=>V.add(X.name)),Object.entries(w).forEach(([X,oe])=>{oe.model_list&&oe.model_list.some(Y=>{const te=v.find(Oe=>Oe.name===Y);return te&&te.api_provider===K})&&xe.add(X)})),A(U),P(V),C(xe)},fe=K=>{const U=new Set(_),V=new Set(E);U.has(K)?(U.delete(K),Object.entries(w).forEach(([xe,Ae])=>{Ae.model_list&&(Ae.model_list.some(oe=>U.has(oe))||V.delete(xe))})):(U.add(K),Object.entries(w).forEach(([xe,Ae])=>{Ae.model_list&&Ae.model_list.includes(K)&&V.add(xe)})),P(U),C(V)},z=K=>{const U=new Set(E);U.has(K)?U.delete(K):U.add(K),C(U)},Q=K=>{ce.includes(K)?ve(ce.filter(U=>U!==K)):ce.length<5?ve([...ce,K]):qt({title:"ๆœ€ๅคš้€‰ๆ‹ฉ 5 ไธชๆ ‡็ญพ",variant:"destructive"})},$=()=>{D.size===g.length?A(new Set):A(new Set(g.map(K=>K.name)))},L=()=>{_.size===v.length?P(new Set):P(new Set(v.map(K=>K.name)))},I=()=>{const K=Object.keys(w);E.size===K.length?C(new Set):C(new Set(K))},_e=async()=>{if(!M.trim()){qt({title:"่ฏท่พ“ๅ…ฅๆจกๆฟๅ็งฐ",variant:"destructive"});return}if(!O.trim()){qt({title:"่ฏท่พ“ๅ…ฅๆจกๆฟๆ่ฟฐ",variant:"destructive"});return}if(!R.trim()){qt({title:"่ฏท่พ“ๅ…ฅไฝœ่€…ๅ็งฐ",variant:"destructive"});return}if(D.size===0&&_.size===0&&E.size===0){qt({title:"่ฏท่‡ณๅฐ‘้€‰ๆ‹ฉไธ€้กน้…็ฝฎ",variant:"destructive"});return}p(!0);try{const K=g.filter(xe=>D.has(xe.name)),U=v.filter(xe=>_.has(xe.name)),V={};for(const[xe,Ae]of Object.entries(w))E.has(xe)&&(V[xe]=Ae);await Y_({name:M.trim(),description:O.trim(),author:R.trim(),tags:ce,providers:K,models:U,task_config:V}),qt({title:"ๆจกๆฟๅทฒๆไบคๅฎกๆ ธ๏ผŒๅฎกๆ ธ้€š่ฟ‡ๅŽๅฐ†ๆ˜พ็คบๅœจๅธ‚ๅœบไธญ"}),i(!1),je()}catch(K){console.error("ๆไบคๅคฑ่ดฅ:",K),qt({title:K instanceof Error?K.message:"ๆไบคๅคฑ่ดฅ",variant:"destructive"})}finally{p(!1)}},je=()=>{u(1),G(""),ee(""),me(""),ve([]),A(new Set),P(new Set),C(new Set)},Se=2;return e.jsxs(Ps,{open:n,onOpenChange:i,children:[e.jsx(Ko,{asChild:!0,children:l||e.jsxs(S,{variant:"outline",children:[e.jsx(Cj,{className:"w-4 h-4 mr-2"}),"ๅˆ†ไบซ้…็ฝฎ"]})}),e.jsxs(Us,{className:"max-w-2xl max-h-[85vh] flex flex-col",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(aa,{className:"w-5 h-5"}),"ๅˆ†ไบซ้…็ฝฎๆจกๆฟ"]}),e.jsxs(Ys,{children:["ๆญฅ้ชค ",c," / ",Se,"๏ผš",c===1&&"้€‰ๆ‹ฉ่ฆๅˆ†ไบซ็š„้…็ฝฎ",c===2&&"ๅกซๅ†™ๆจกๆฟไฟกๆฏ"]})]}),e.jsx(Je,{className:"h-[calc(85vh-220px)] pr-4",children:x?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx(Ls,{className:"w-8 h-8 mx-auto animate-spin text-primary"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"ๆญฃๅœจๅŠ ่ฝฝๅฝ“ๅ‰้…็ฝฎ..."})]}):e.jsxs(e.Fragment,{children:[c===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๅฎ‰ๅ…จๆ็คบ"}),e.jsxs(ct,{children:["ๅˆ†ไบซ็š„้…็ฝฎๅฐ†",e.jsx("strong",{children:"ไธๅŒ…ๅซ"})," API Key๏ผŒๅ…ถไป–็”จๆˆท้œ€่ฆ่‡ช่กŒ้…็ฝฎใ€‚"]})]}),e.jsxs(ra,{defaultValue:"providers",className:"w-full",children:[e.jsxs(Wt,{className:"grid w-full grid-cols-3",children:[e.jsxs(ts,{value:"providers",children:[e.jsx(Al,{className:"w-4 h-4 mr-2"}),"API ๆไพ›ๅ•†",e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[D.size,"/",g.length]})]}),e.jsxs(ts,{value:"models",children:[e.jsx(In,{className:"w-4 h-4 mr-2"}),"ๆจกๅž‹้…็ฝฎ",e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[_.size,"/",v.length]})]}),e.jsxs(ts,{value:"tasks",children:[e.jsx(Pn,{className:"w-4 h-4 mr-2"}),"ไปปๅŠก้…็ฝฎ",e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[E.size,"/",Object.keys(w).length]})]})]}),e.jsx(bs,{value:"providers",className:"space-y-2 mt-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(S,{variant:"ghost",size:"sm",onClick:$,children:D.size===g.length?"ๅ–ๆถˆๅ…จ้€‰":"ๅ…จ้€‰"})}),g.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"ๆš‚ๆ— ๆไพ›ๅ•†้…็ฝฎ"}):g.map(K=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 rounded hover:bg-muted",children:[e.jsx(Ws,{id:`provider-${K.name}`,checked:D.has(K.name),onCheckedChange:()=>ge(K.name)}),e.jsxs(T,{htmlFor:`provider-${K.name}`,className:"flex-1 cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:K.name}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:K.base_url})]}),e.jsx(ke,{variant:"outline",className:"text-xs",children:K.client_type})]},K.name))]})}),e.jsx(bs,{value:"models",className:"space-y-2 mt-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(S,{variant:"ghost",size:"sm",onClick:L,children:_.size===v.length?"ๅ–ๆถˆๅ…จ้€‰":"ๅ…จ้€‰"})}),v.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"ๆš‚ๆ— ๆจกๅž‹้…็ฝฎ"}):v.map(K=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 rounded hover:bg-muted",children:[e.jsx(Ws,{id:`model-${K.name}`,checked:_.has(K.name),onCheckedChange:()=>fe(K.name)}),e.jsxs(T,{htmlFor:`model-${K.name}`,className:"flex-1 cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:K.name}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:K.model_identifier})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:K.api_provider})]},K.name))]})}),e.jsx(bs,{value:"tasks",className:"space-y-2 mt-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(S,{variant:"ghost",size:"sm",onClick:I,children:E.size===Object.keys(w).length?"ๅ–ๆถˆๅ…จ้€‰":"ๅ…จ้€‰"})}),Object.keys(w).length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"ๆš‚ๆ— ไปปๅŠก้…็ฝฎ"}):Object.entries(w).map(([K,U])=>e.jsxs("div",{className:"space-y-2 p-2 rounded hover:bg-muted",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:`task-${K}`,checked:E.has(K),onCheckedChange:()=>z(K)}),e.jsx(T,{htmlFor:`task-${K}`,className:"flex-1 cursor-pointer",children:e.jsx("span",{className:"font-medium",children:eS[K]||K})}),e.jsxs(ke,{variant:"outline",className:"text-xs",children:[U.model_list.length," ไธชๆจกๅž‹"]})]}),U.model_list&&U.model_list.length>0&&e.jsx("div",{className:"ml-6 flex flex-wrap gap-1",children:U.model_list.map(V=>{const xe=v.find(X=>X.name===V),Ae=_.has(V);return e.jsxs(ke,{variant:Ae?"default":"outline",className:"text-xs cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>fe(V),children:[V,xe&&e.jsxs("span",{className:"ml-1 opacity-70",children:["(",xe.api_provider,")"]})]},V)})})]},K))]})})]})]}),c===2&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4 text-sm p-3 bg-muted rounded-lg",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Al,{className:"w-4 h-4"}),D.size," ไธชๆไพ›ๅ•†"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(In,{className:"w-4 h-4"}),_.size," ไธชๆจกๅž‹"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pn,{className:"w-4 h-4"}),E.size," ไธชไปปๅŠก"]})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"pack-name",children:"ๆจกๆฟๅ็งฐ *"}),e.jsx(ne,{id:"pack-name",placeholder:"ไพ‹ๅฆ‚๏ผš้ซ˜ๆ€งไปทๆฏ”ๅ›ฝไบงๆจกๅž‹้…็ฝฎ",value:M,onChange:K=>G(K.target.value),maxLength:50}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[M.length,"/50"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"pack-description",children:"ๆจกๆฟๆ่ฟฐ *"}),e.jsx(at,{id:"pack-description",placeholder:"่ฏฆ็ป†ๆ่ฟฐ่ฟ™ไธช้…็ฝฎๆจกๆฟ็š„็‰น็‚นใ€้€‚็”จๅœบๆ™ฏ็ญ‰...",value:O,onChange:K=>ee(K.target.value),rows:4,maxLength:500}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[O.length,"/500"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"pack-author",children:"ไฝœ่€…ๅ็งฐ *"}),e.jsx(ne,{id:"pack-author",placeholder:"ไฝ ็š„ๆ˜ต็งฐๆˆ– ID",value:R,onChange:K=>me(K.target.value),maxLength:30})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๆ ‡็ญพ๏ผˆๅฏ้€‰๏ผŒๆœ€ๅคš 5 ไธช๏ผ‰"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:sS.map(K=>e.jsxs(ke,{variant:ce.includes(K)?"default":"outline",className:"cursor-pointer transition-colors",onClick:()=>Q(K),children:[ce.includes(K)&&e.jsx(_t,{className:"w-3 h-3 mr-1"}),e.jsx(Go,{className:"w-3 h-3 mr-1"}),K]},K))})]})]}),e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๅฎกๆ ธ่ฏดๆ˜Ž"}),e.jsx(ct,{children:"ๆไบคๅŽ้œ€่ฆ็ป่ฟ‡ๅฎกๆ ธๆ‰่ƒฝๅœจๅธ‚ๅœบไธญๅฑ•็คบใ€‚ๅฎกๆ ธ้€šๅธธๅœจ 1-3 ไธชๅทฅไฝœๆ—ฅๅ†…ๅฎŒๆˆใ€‚"})]})]})]})}),e.jsxs(et,{className:"flex justify-between pt-4 border-t",children:[e.jsx("div",{children:c>1&&e.jsx(S,{variant:"outline",onClick:()=>u(c-1),disabled:f,children:"ไธŠไธ€ๆญฅ"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>{i(!1),je()},disabled:f,children:"ๅ–ๆถˆ"}),cu(c+1),disabled:x||D.size===0&&_.size===0&&E.size===0,children:"ไธ‹ไธ€ๆญฅ"}):e.jsxs(S,{onClick:_e,disabled:f,children:[f&&e.jsx(Ls,{className:"w-4 h-4 mr-2 animate-spin"}),"ๆไบคๅฎกๆ ธ"]})]})]})]})]})}function aS({value:l,label:n,onRemove:i}){const{attributes:c,listeners:u,setNodeRef:x,transform:h,transition:f,isDragging:p}=Vj({id:l}),g={transform:qj.Transform.toString(h),transition:f,opacity:p?.5:1},N=y=>{y.preventDefault(),y.stopPropagation(),i(l)},v=y=>{y.stopPropagation()};return e.jsx("div",{ref:x,style:g,className:H("inline-flex items-center gap-1",p&&"shadow-lg"),children:e.jsxs(ke,{variant:"secondary",className:"cursor-move hover:bg-secondary/80 flex items-center gap-1",children:[e.jsx("div",{...c,...u,className:"cursor-grab active:cursor-grabbing flex items-center",children:e.jsx(_j,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("span",{children:n}),e.jsx("span",{role:"button",tabIndex:0,className:"ml-1 rounded-sm hover:bg-destructive/20 focus:outline-none focus:ring-1 focus:ring-destructive cursor-pointer",onClick:N,onPointerDown:v,onMouseDown:y=>y.stopPropagation(),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),N(y))},children:e.jsx(Ca,{className:"h-3 w-3 hover:text-destructive",strokeWidth:2,fill:"none"})})]})})}function lS({options:l,selected:n,onChange:i,placeholder:c="้€‰ๆ‹ฉ้€‰้กน...",emptyText:u="ๆœชๆ‰พๅˆฐ้€‰้กน",className:x}){const[h,f]=m.useState(!1),p=Uj(Do(Ij,{activationConstraint:{distance:8}}),Do($j,{coordinateGetter:Bj})),g=y=>{n.includes(y)?i(n.filter(w=>w!==y)):i([...n,y])},N=y=>{i(n.filter(w=>w!==y))},v=y=>{const{active:w,over:b}=y;if(b&&w.id!==b.id){const D=n.indexOf(w.id),A=n.indexOf(b.id);i(Pj(n,D,A))}};return e.jsxs(nl,{open:h,onOpenChange:f,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",role:"combobox","aria-expanded":h,className:H("w-full justify-between min-h-10 h-auto",x),children:[e.jsx(Hj,{sensors:p,collisionDetection:Fj,onDragEnd:v,children:e.jsx(Gj,{items:n,strategy:_1,children:e.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:n.length===0?e.jsx("span",{className:"text-muted-foreground",children:c}):n.map(y=>{const w=l.find(b=>b.value===y);return e.jsx(aS,{value:y,label:w?.label||y,onRemove:N},y)})})})}),e.jsx(Gm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),e.jsx(Ja,{className:"w-full p-0",align:"start",children:e.jsxs(Qo,{children:[e.jsx(Yo,{placeholder:"ๆœ็ดข...",className:"h-9"}),e.jsxs(Jo,{children:[e.jsx(Xo,{children:u}),e.jsx(Yi,{children:l.map(y=>{const w=n.includes(y.value);return e.jsxs(Ji,{value:y.value,onSelect:()=>g(y.value),children:[e.jsx("div",{className:H("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",w?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(_t,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),e.jsx("span",{children:y.label})]},y.value)})})]})]})})]})}const kl=zs.memo(function({title:n,description:i,taskConfig:c,modelNames:u,onChange:x,hideTemperature:h=!1,hideMaxTokens:f=!1,dataTour:p}){const g=N=>{x("model_list",N)};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:i})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":p,children:[e.jsx(T,{children:"ๆจกๅž‹ๅˆ—่กจ"}),e.jsx(lS,{options:u.map(N=>({label:N,value:N})),selected:c.model_list||[],onChange:g,placeholder:"้€‰ๆ‹ฉๆจกๅž‹...",emptyText:"ๆš‚ๆ— ๅฏ็”จๆจกๅž‹"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!h&&e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๆธฉๅบฆ"}),e.jsx(ne,{type:"number",step:"0.1",min:"0",max:"1",value:c.temperature??.3,onChange:N=>{const v=parseFloat(N.target.value);!isNaN(v)&&v>=0&&v<=1&&x("temperature",v)},className:"w-20 h-8 text-sm"})]}),e.jsx(_a,{value:[c.temperature??.3],onValueChange:N=>x("temperature",N[0]),min:0,max:1,step:.1,className:"w-full"})]}),!f&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆœ€ๅคง Token"}),e.jsx(ne,{type:"number",step:"1",min:"1",value:c.max_tokens??1024,onChange:N=>x("max_tokens",parseInt(N.target.value))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๆ…ข่ฏทๆฑ‚้˜ˆๅ€ผ (็ง’)"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"่ถ…ๆ—ถ่ญฆๅ‘Š"})]}),e.jsx(ne,{type:"number",step:"1",min:"1",value:c.slow_threshold??15,onChange:N=>{const v=parseInt(N.target.value);!isNaN(v)&&v>=1&&x("slow_threshold",v)},placeholder:"15"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆจกๅž‹ๅ“ๅบ”ๆ—ถ้—ด่ถ…่ฟ‡ๆญค้˜ˆๅ€ผๅฐ†่พ“ๅ‡บ่ญฆๅ‘Šๆ—ฅๅฟ—"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆจกๅž‹้€‰ๆ‹ฉ็ญ–็•ฅ"}),e.jsxs(Be,{value:c.selection_strategy??"balance",onValueChange:N=>x("selection_strategy",N),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๆจกๅž‹้€‰ๆ‹ฉ็ญ–็•ฅ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"balance",children:"่ดŸ่ฝฝๅ‡่กก๏ผˆbalance๏ผ‰"}),e.jsx(W,{value:"random",children:"้šๆœบ้€‰ๆ‹ฉ๏ผˆrandom๏ผ‰"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ดŸ่ฝฝๅ‡่กก๏ผšไผ˜ๅ…ˆ้€‰ๆ‹ฉไฝฟ็”จๆฌกๆ•ฐๅฐ‘็š„ๆจกๅž‹ใ€‚้šๆœบ้€‰ๆ‹ฉ๏ผšๅฎŒๅ…จ้šๆœบไปŽๆจกๅž‹ๅˆ—่กจไธญ้€‰ๆ‹ฉ"})]})]})]})}),nS=zs.memo(function({paginatedModels:n,allModels:i,onEdit:c,onDelete:u,isModelUsed:x,searchQuery:h}){return n.length===0?e.jsx("div",{className:"md:hidden text-center text-muted-foreground py-8 rounded-lg border bg-card",children:h?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๅž‹":"ๆš‚ๆ— ๆจกๅž‹้…็ฝฎ"}):e.jsx("div",{className:"md:hidden space-y-3",children:n.map((f,p)=>{const g=i.findIndex(v=>v===f),N=x(f.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:f.name}),e.jsx(ke,{variant:N?"default":"secondary",className:N?"bg-green-600 hover:bg-green-700":"",children:N?"ๅทฒไฝฟ็”จ":"ๆœชไฝฟ็”จ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",title:f.model_identifier,children:f.model_identifier})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>c(f,g),children:[e.jsx($n,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>u(g),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{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:f.api_provider})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"ๆจกๅž‹ๆธฉๅบฆ"}),e.jsx("p",{className:"font-medium",children:f.temperature!=null?f.temperature:e.jsx("span",{className:"text-muted-foreground",children:"้ป˜่ฎค"})})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"่พ“ๅ…ฅไปทๆ ผ"}),e.jsxs("p",{className:"font-medium",children:["ยฅ",f.price_in,"/M"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"่พ“ๅ‡บไปทๆ ผ"}),e.jsxs("p",{className:"font-medium",children:["ยฅ",f.price_out,"/M"]})]})]})]},p)})})}),rS=zs.memo(function({paginatedModels:n,allModels:i,filteredModels:c,selectedModels:u,onEdit:x,onDelete:h,onToggleSelection:f,onToggleSelectAll:p,isModelUsed:g,searchQuery:N}){return 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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:u.size===c.length&&c.length>0,onCheckedChange:p})}),e.jsx(Ze,{className:"w-24",children:"ไฝฟ็”จ็Šถๆ€"}),e.jsx(Ze,{children:"ๆจกๅž‹ๅ็งฐ"}),e.jsx(Ze,{children:"ๆจกๅž‹ๆ ‡่ฏ†็ฌฆ"}),e.jsx(Ze,{children:"ๆไพ›ๅ•†"}),e.jsx(Ze,{className:"text-center",children:"ๆธฉๅบฆ"}),e.jsx(Ze,{className:"text-right",children:"่พ“ๅ…ฅไปทๆ ผ"}),e.jsx(Ze,{className:"text-right",children:"่พ“ๅ‡บไปทๆ ผ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:n.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:9,className:"text-center text-muted-foreground py-8",children:N?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๅž‹":"ๆš‚ๆ— ๆจกๅž‹้…็ฝฎ"})}):n.map((v,y)=>{const w=i.findIndex(D=>D===v),b=g(v.name);return e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:u.has(w),onCheckedChange:()=>f(w)})}),e.jsx(Ke,{children:e.jsx(ke,{variant:b?"default":"secondary",className:b?"bg-green-600 hover:bg-green-700":"",children:b?"ๅทฒไฝฟ็”จ":"ๆœชไฝฟ็”จ"})}),e.jsx(Ke,{className:"font-medium",children:v.name}),e.jsx(Ke,{className:"max-w-xs truncate",title:v.model_identifier,children:v.model_identifier}),e.jsx(Ke,{children:v.api_provider}),e.jsx(Ke,{className:"text-center",children:v.temperature!=null?v.temperature:e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsxs(Ke,{className:"text-right",children:["ยฅ",v.price_in,"/M"]}),e.jsxs(Ke,{className:"text-right",children:["ยฅ",v.price_out,"/M"]}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>x(v,w),children:[e.jsx($n,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>h(w),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"ๅˆ ้™ค"]})]})})]},y)})})]})})})}),iS=300*1e3,jg=new Map,cS=[10,20,50,100],oS=zs.memo(function({page:n,pageSize:i,totalItems:c,jumpToPage:u,onPageChange:x,onPageSizeChange:h,onJumpToPageChange:f,onJumpToPage:p,onSelectionClear:g}){const N=Math.ceil(c/i),v=w=>{h(parseInt(w)),x(1),g?.()},y=w=>{w.key==="Enter"&&p()};return c===0?null: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(T,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:i.toString(),onValueChange:v,children:[e.jsx(Le,{id:"page-size-model",className:"w-20",children:e.jsx($e,{})}),e.jsx(Ue,{children:cS.map(w=>e.jsx(W,{value:w.toString(),children:w},w))})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๆ˜พ็คบ ",(n-1)*i+1," ๅˆฐ"," ",Math.min(n*i,c)," ๆก๏ผŒๅ…ฑ ",c," ๆก"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>x(1),disabled:n===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>x(Math.max(1,n-1)),disabled:n===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:u,onChange:w=>f(w.target.value),onKeyDown:y,placeholder:n.toString(),className:"w-16 h-8 text-center",min:1,max:N}),e.jsx(S,{variant:"outline",size:"sm",onClick:p,disabled:!u,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>x(n+1),disabled:n>=N,children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>x(N),disabled:n>=N,className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})});function dS(l){const{models:n,taskConfig:i,debounceMs:c=2e3,onSavingChange:u,onUnsavedChange:x}=l,h=m.useRef(null),f=m.useRef(null),p=m.useRef(!0),g=m.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),N=m.useCallback(w=>{const b={model_identifier:w.model_identifier,name:w.name,api_provider:w.api_provider,price_in:w.price_in??0,price_out:w.price_out??0,force_stream_mode:w.force_stream_mode??!1,extra_params:w.extra_params??{}};return w.temperature!=null&&(b.temperature=w.temperature),w.max_tokens!=null&&(b.max_tokens=w.max_tokens),b},[]),v=m.useCallback(async w=>{try{u?.(!0);const b=w.map(N);await Om("models",b),x?.(!1)}catch(b){console.error("่‡ชๅŠจไฟๅญ˜ๆจกๅž‹ๅˆ—่กจๅคฑ่ดฅ:",b),x?.(!0)}finally{u?.(!1)}},[u,x,N]),y=m.useCallback(async w=>{try{u?.(!0),await Om("model_task_config",w),x?.(!1)}catch(b){console.error("่‡ชๅŠจไฟๅญ˜ไปปๅŠก้…็ฝฎๅคฑ่ดฅ:",b),x?.(!0)}finally{u?.(!1)}},[u,x]);return m.useEffect(()=>{if(!p.current)return x?.(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{v(n)},c),()=>{h.current&&clearTimeout(h.current)}},[n,v,c,x]),m.useEffect(()=>{if(!(p.current||!i))return x?.(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{y(i)},c),()=>{f.current&&clearTimeout(f.current)}},[i,y,c,x]),m.useEffect(()=>()=>{g()},[g]),{clearTimers:g,initialLoadRef:p}}function uS(l={}){const{onCloseEditDialog:n}=l,i=ia(),{registerTour:c,startTour:u,state:x,goToStep:h}=Qm(),f=m.useRef(x.stepIndex);return m.useEffect(()=>{c(al,uv)},[c]),m.useEffect(()=>{if(x.activeTourId===al&&x.isRunning){const g=mv[x.stepIndex];g&&!window.location.pathname.endsWith(g.replace("/config/",""))&&i({to:g})}},[x.stepIndex,x.activeTourId,x.isRunning,i]),m.useEffect(()=>{if(x.activeTourId===al&&x.isRunning){const g=f.current,N=x.stepIndex;g>=12&&g<=17&&N<12&&n?.(),f.current=N}},[x.stepIndex,x.activeTourId,x.isRunning,n]),m.useEffect(()=>{if(x.activeTourId!==al||!x.isRunning)return;const g=N=>{const v=N.target,y=x.stepIndex;y===2&&v.closest('[data-tour="add-provider-button"]')?setTimeout(()=>h(3),300):y===9&&v.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>h(10),300):y===11&&v.closest('[data-tour="add-model-button"]')?setTimeout(()=>h(12),300):y===17&&v.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>h(18),300):y===18&&v.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>h(19),300)};return document.addEventListener("click",g,!0),()=>document.removeEventListener("click",g,!0)},[x,h]),{startTour:m.useCallback(()=>{u(al)},[u]),isRunning:x.isRunning&&x.activeTourId===al,stepIndex:x.stepIndex}}function mS(l){const{getProviderConfig:n}=l,[i,c]=m.useState([]),[u,x]=m.useState(!1),[h,f]=m.useState(null),[p,g]=m.useState(null),N=m.useCallback(()=>{c([]),f(null),g(null)},[]),v=m.useCallback(async(y,w=!1)=>{const b=n(y);if(!b?.base_url){c([]),g(null),f('ๆไพ›ๅ•†้…็ฝฎไธๅฎŒๆ•ด๏ผŒ่ฏทๅ…ˆๅœจ"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ"ไธญ้…็ฝฎ');return}if(!b.api_key){c([]),g(null),f('่ฏฅๆไพ›ๅ•†ๆœช้…็ฝฎ API Key๏ผŒ่ฏทๅ…ˆๅœจ"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ"ไธญๅกซๅ†™');return}const D=I_(b.base_url);if(g(D),!D?.modelFetcher){c([]),f(null);return}const A=`${y}:${b.base_url}`,_=jg.get(A);if(!w&&_&&Date.now()-_.timestampE(!1)}),{clearTimers:Pt,initialLoadRef:ut}=dS({models:l,taskConfig:p,onSavingChange:D,onUnsavedChange:_}),q=m.useCallback((re,he)=>{if(!re)return;const ss=new Set(he.map(Va=>Va.name)),gs=[],cs=[],Ct=[{key:"utils",label:"ๅทฅๅ…ทๆจกๅž‹"},{key:"tool_use",label:"ๅทฅๅ…ท่ฐƒ็”จๆจกๅž‹"},{key:"replyer",label:"ๅ›žๅคๆจกๅž‹"},{key:"planner",label:"่ง„ๅˆ’ๅ™จๆจกๅž‹"},{key:"vlm",label:"่ง†่ง‰ๆจกๅž‹"},{key:"voice",label:"่ฏญ้Ÿณๆจกๅž‹"},{key:"embedding",label:"ๅตŒๅ…ฅๆจกๅž‹"},{key:"lpmm_entity_extract",label:"LPMMๅฎžไฝ“ๆŠฝๅ–"},{key:"lpmm_rdf_build",label:"LPMMๅ…ณ็ณปๆž„ๅปบ"}];for(const{key:Va,label:Ll}of Ct){const Qn=re[Va];if(!Qn)continue;if(!Qn.model_list||Qn.model_list.length===0){cs.push(Ll);continue}const Vr=Qn.model_list.filter(jn=>!ss.has(jn));Vr.length>0&&gs.push({taskName:Ll,invalidModels:Vr})}te(gs),De(cs)},[]),qe=m.useCallback(async()=>{try{v(!0);const re=await cn(),he=re.models||[];n(he),f(he.map(Ct=>Ct.name));const ss=re.api_providers||[];c(ss.map(Ct=>Ct.name)),x(ss);const gs=re.model_task_config||null;g(gs),q(gs,he);const cs=gs?.embedding?.model_list||[];oe.current=[...cs],_(!1),ut.current=!1}catch(re){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",re)}finally{v(!1)}},[ut,q]);m.useEffect(()=>{qe()},[qe]);const Qe=m.useCallback(re=>u.find(he=>he.name===re),[u]),{availableModels:We,fetchingModels:Ds,modelFetchError:as,matchedTemplate:ks,fetchModelsForProvider:Ee,clearModels:vs}=mS({getProviderConfig:Qe});m.useEffect(()=>{P&&C?.api_provider&&Ee(C.api_provider)},[P,C?.api_provider,Ee]);const ls=async()=>{await rs()},es=m.useCallback(()=>{if(!p)return;const re=new Set(l.map(gs=>gs.name)),he={...p},ss=Object.keys(he);for(const gs of ss){const cs=he[gs];cs&&cs.model_list&&(cs.model_list=cs.model_list.filter(Ct=>re.has(Ct)))}g(he),te([]),Te({title:"ๆธ…็†ๅฎŒๆˆ",description:"ๅทฒๅˆ ้™คๆ‰€ๆœ‰ๆ— ๆ•ˆ็š„ๆจกๅž‹ๅผ•็”จ"})},[p,l,Te]),Ns=re=>{const he={model_identifier:re.model_identifier,name:re.name,api_provider:re.api_provider,price_in:re.price_in??0,price_out:re.price_out??0,force_stream_mode:re.force_stream_mode??!1,extra_params:re.extra_params??{}};return re.temperature!=null&&(he.temperature=re.temperature),re.max_tokens!=null&&(he.max_tokens=re.max_tokens),he},pt=async()=>{try{w(!0),Pt();const re=await cn();re.models=l.map(Ns),re.model_task_config=p,await Fi(re),_(!1),Te({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆญฃๅœจ้‡ๅฏ้บฆ้บฆ..."}),await ls()}catch(re){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",re),Te({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:re.message,variant:"destructive"}),w(!1)}},Lt=async()=>{try{w(!0),Pt();const re=await cn();re.models=l.map(Ns),re.model_task_config=p,await Fi(re),_(!1),Te({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆจกๅž‹้…็ฝฎๅทฒไฟๅญ˜"}),await qe()}catch(re){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",re),Te({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:re.message,variant:"destructive"})}finally{w(!1)}},tt=(re,he)=>{de({}),M(re||{model_identifier:"",name:"",api_provider:i[0]||"",price_in:0,price_out:0,temperature:null,max_tokens:null,force_stream_mode:!1,extra_params:{}}),O(he),E(!0)},Es=()=>{if(!C)return;const re={};if(C.name?.trim()||(re.name="่ฏท่พ“ๅ…ฅๆจกๅž‹ๅ็งฐ"),C.api_provider?.trim()||(re.api_provider="่ฏท้€‰ๆ‹ฉ API ๆไพ›ๅ•†"),C.model_identifier?.trim()||(re.model_identifier="่ฏท่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ"),Object.keys(re).length>0){de(re);return}de({});const he={model_identifier:C.model_identifier,name:C.name,api_provider:C.api_provider,price_in:C.price_in??0,price_out:C.price_out??0,force_stream_mode:C.force_stream_mode??!1,extra_params:C.extra_params??{}};C.temperature!=null&&(he.temperature=C.temperature),C.max_tokens!=null&&(he.max_tokens=C.max_tokens);let ss,gs=null;if(G!==null?(gs=l[G].name,ss=[...l],ss[G]=he):ss=[...l,he],n(ss),f(ss.map(cs=>cs.name)),gs&&gs!==he.name&&p){const cs=Ct=>Ct.map(Va=>Va===gs?he.name:Va);g({...p,utils:{...p.utils,model_list:cs(p.utils?.model_list||[])},tool_use:{...p.tool_use,model_list:cs(p.tool_use?.model_list||[])},replyer:{...p.replyer,model_list:cs(p.replyer?.model_list||[])},planner:{...p.planner,model_list:cs(p.planner?.model_list||[])},vlm:{...p.vlm,model_list:cs(p.vlm?.model_list||[])},voice:{...p.voice,model_list:cs(p.voice?.model_list||[])},embedding:{...p.embedding,model_list:cs(p.embedding?.model_list||[])},lpmm_entity_extract:{...p.lpmm_entity_extract,model_list:cs(p.lpmm_entity_extract?.model_list||[])},lpmm_rdf_build:{...p.lpmm_rdf_build,model_list:cs(p.lpmm_rdf_build?.model_list||[])}})}E(!1),M(null),O(null),Te({title:G!==null?"ๆจกๅž‹ๅทฒๆ›ดๆ–ฐ":"ๆจกๅž‹ๅทฒๆทปๅŠ ",description:'้…็ฝฎๅฐ†ๅœจ 2 ็ง’ๅŽ่‡ชๅŠจไฟๅญ˜๏ผŒๆˆ–็‚นๅ‡ปๅณไธŠ่ง’"ไฟๅญ˜้…็ฝฎ"ๆŒ‰้’ฎ็ซ‹ๅณไฟๅญ˜'})},kt=re=>{if(!re&&C){const he={...C,price_in:C.price_in??0,price_out:C.price_out??0};M(he)}E(re)},Ut=re=>{se(re),ce(!0)},Ea=()=>{if(ve!==null){const re=l.filter((he,ss)=>ss!==ve);n(re),f(re.map(he=>he.name)),q(p,re),Te({title:"ๅˆ ้™คๆˆๅŠŸ",description:'้…็ฝฎๅฐ†ๅœจ 2 ็ง’ๅŽ่‡ชๅŠจไฟๅญ˜๏ผŒๆˆ–็‚นๅ‡ปๅณไธŠ่ง’"ไฟๅญ˜้…็ฝฎ"ๆŒ‰้’ฎ็ซ‹ๅณไฟๅญ˜'})}ce(!1),se(null)},Za=re=>{const he=new Set(z);he.has(re)?he.delete(re):he.add(re),Q(he)},il=()=>{if(z.size===zt.length)Q(new Set);else{const re=zt.map((he,ss)=>l.findIndex(gs=>gs===zt[ss]));Q(new Set(re))}},Kn=()=>{if(z.size===0){Te({title:"ๆ็คบ",description:"่ฏทๅ…ˆ้€‰ๆ‹ฉ่ฆๅˆ ้™ค็š„ๆจกๅž‹",variant:"default"});return}L(!0)},Z=()=>{const re=z.size,he=l.filter((ss,gs)=>!z.has(gs));n(he),f(he.map(ss=>ss.name)),q(p,he),Q(new Set),L(!1),Te({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${re} ไธชๆจกๅž‹๏ผŒ้…็ฝฎๅฐ†ๅœจ 2 ็ง’ๅŽ่‡ชๅŠจไฟๅญ˜`})},ye=(re,he,ss)=>{if(!p)return;if(re==="embedding"&&he==="model_list"&&Array.isArray(ss)){const cs=oe.current,Ct=ss;if((cs.length!==Ct.length||cs.some(Ll=>!Ct.includes(Ll))||Ct.some(Ll=>!cs.includes(Ll)))&&cs.length>0){Fe.current={field:he,value:ss},X(!0);return}}const gs={...p,[re]:{...p[re],[he]:ss}};g(gs),q(gs,l),re==="embedding"&&he==="model_list"&&Array.isArray(ss)&&(oe.current=[...ss])},ze=()=>{if(!p||!Fe.current)return;const{field:re,value:he}=Fe.current,ss={...p,embedding:{...p.embedding,[re]:he}};g(ss),q(ss,l),re==="model_list"&&Array.isArray(he)&&(oe.current=[...he]),Fe.current=null,X(!1),Te({title:"ๅตŒๅ…ฅๆจกๅž‹ๅทฒๆ›ดๆ–ฐ",description:"ๅปบ่ฎฎ้‡ๆ–ฐ็”Ÿๆˆ็Ÿฅ่ฏ†ๅบ“ๅ‘้‡ไปฅ็กฎไฟๆœ€ไฝณๅŒน้…็ฒพๅบฆ"})},Hs=()=>{Fe.current=null,X(!1)},zt=l.filter(re=>{if(!ge)return!0;const he=ge.toLowerCase();return re.name.toLowerCase().includes(he)||re.model_identifier.toLowerCase().includes(he)||re.api_provider.toLowerCase().includes(he)}),Jt=Math.ceil(zt.length/je),lt=zt.slice((I-1)*je,I*je),Xt=()=>{const re=parseInt(K);re>=1&&re<=Jt&&(_e(re),U(""))},mt=re=>p?[p.utils?.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||[]].some(ss=>ss.includes(re)):!1;return N?e.jsx(Je,{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(Je,{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.jsx(tS,{trigger:e.jsxs(S,{variant:"outline",size:"sm",className:"flex-1 sm:flex-none",children:[e.jsx(Cj,{className:"mr-2 h-4 w-4"}),"ๅˆ†ไบซ้…็ฝฎ"]})}),e.jsxs(S,{onClick:Lt,disabled:y||b||!A||Rt,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(sc,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),y?"ไฟๅญ˜ไธญ...":b?"่‡ชๅŠจไฟๅญ˜ไธญ...":A?"ไฟๅญ˜้…็ฝฎ":"ๅทฒไฟๅญ˜"]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{disabled:y||b||Rt,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(ec,{className:"mr-2 h-4 w-4"}),Rt?"้‡ๅฏไธญ...":A?"ไฟๅญ˜ๅนถ้‡ๅฏ":"้‡ๅฏ้บฆ้บฆ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๅฏ้บฆ้บฆ๏ผŸ"}),e.jsx(hs,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:A?"ๅฝ“ๅ‰ๆœ‰ๆœชไฟๅญ˜็š„้…็ฝฎๆ›ดๆ”นใ€‚็‚นๅ‡ป็กฎ่ฎคๅฐ†ๅ…ˆไฟๅญ˜้…็ฝฎ,็„ถๅŽ้‡ๅฏ้บฆ้บฆไฝฟๆ–ฐ้…็ฝฎ็”Ÿๆ•ˆใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟใ€‚":"ๅณๅฐ†้‡ๅฏ้บฆ้บฆไธป็จ‹ๅบใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟ,้…็ฝฎๅฐ†ๅœจ้‡ๅฏๅŽ็”Ÿๆ•ˆใ€‚"})})})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:A?pt:ls,children:A?"ไฟๅญ˜ๅนถ้‡ๅฏ":"็กฎ่ฎค้‡ๅฏ"})]})]})]})]})]}),e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(ct,{children:["้…็ฝฎๆ›ดๆ–ฐๅŽ้œ€่ฆ",e.jsx("strong",{children:"้‡ๅฏ้บฆ้บฆ"}),'ๆ‰่ƒฝ็”Ÿๆ•ˆใ€‚ไฝ ๅฏไปฅ็‚นๅ‡ปๅณไธŠ่ง’็š„"ไฟๅญ˜ๅนถ้‡ๅฏ"ๆŒ‰้’ฎไธ€้”ฎๅฎŒๆˆไฟๅญ˜ๅ’Œ้‡ๅฏใ€‚']})]}),Y.length>0&&e.jsxs(it,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsxs(ct,{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("strong",{children:"ๆฃ€ๆต‹ๅˆฐๆ— ๆ•ˆ็š„ๆจกๅž‹ๅผ•็”จ"}),e.jsx("div",{className:"mt-2 space-y-1",children:Y.map(({taskName:re,invalidModels:he})=>e.jsxs("div",{className:"text-sm",children:[e.jsx("strong",{children:re})," ๅผ•็”จไบ†ไธๅญ˜ๅœจ็š„ๆจกๅž‹: ",he.join(", ")]},re))})]}),e.jsx(S,{variant:"outline",size:"sm",className:"shrink-0 bg-background hover:bg-accent",onClick:es,children:"ไธ€้”ฎๆธ…็†"})]})]}),Oe.length>0&&e.jsxs(it,{variant:"default",className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Qt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(ct,{children:[e.jsx("strong",{className:"text-yellow-600",children:"ไปฅไธ‹ไปปๅŠกๆœช้…็ฝฎๆจกๅž‹"}),e.jsxs("div",{className:"mt-2 text-sm",children:[Oe.join("ใ€")," ่ฟ˜ๆœชๅˆ†้…ๆจกๅž‹๏ผŒ่ฟ™ไบ›ๅŠŸ่ƒฝๅฐ†ๆ— ๆณ•ๆญฃๅธธๅทฅไฝœใ€‚"]})]})]}),e.jsxs(it,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:sa,children:[e.jsx(Kw,{className:"h-4 w-4 text-primary"}),e.jsxs(ct,{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-primary",children:"ๆ–ฐๆ‰‹ๅผ•ๅฏผ๏ผš"}),"ไธ็Ÿฅ้“ๅฆ‚ไฝ•้…็ฝฎๆจกๅž‹๏ผŸ็‚นๅ‡ป่ฟ™้‡Œๅผ€ๅง‹ๅญฆไน ๅฆ‚ไฝ•ไธบ้บฆ้บฆ็š„็ป„ไปถๅˆ†้…ๆจกๅž‹ใ€‚"]}),e.jsx(S,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"ๅผ€ๅง‹ๅผ•ๅฏผ"})]})]}),e.jsxs(ra,{defaultValue:"models",className:"w-full",children:[e.jsxs(Wt,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[e.jsx(ts,{value:"models",children:"ๆทปๅŠ ๆจกๅž‹"}),e.jsx(ts,{value:"tasks","data-tour":"tasks-tab-trigger",children:"ไธบๆจกๅž‹ๅˆ†้…ๅŠŸ่ƒฝ"})]}),e.jsxs(bs,{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:[z.size>0&&e.jsxs(S,{onClick:Kn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"ๆ‰น้‡ๅˆ ้™ค (",z.size,")"]}),e.jsxs(S,{onClick:()=>tt(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[e.jsx(Zs,{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(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆจกๅž‹ๅ็งฐใ€ๆ ‡่ฏ†็ฌฆๆˆ–ๆไพ›ๅ•†...",value:ge,onChange:re=>fe(re.target.value),className:"pl-9"})]}),ge&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["ๆ‰พๅˆฐ ",zt.length," ไธช็ป“ๆžœ"]})]}),e.jsx(nS,{paginatedModels:lt,allModels:l,onEdit:tt,onDelete:Ut,isModelUsed:mt,searchQuery:ge}),e.jsx(rS,{paginatedModels:lt,allModels:l,filteredModels:zt,selectedModels:z,onEdit:tt,onDelete:Ut,onToggleSelection:Za,onToggleSelectAll:il,isModelUsed:mt,searchQuery:ge}),e.jsx(oS,{page:I,pageSize:je,totalItems:zt.length,jumpToPage:K,onPageChange:_e,onPageSizeChange:Se,onJumpToPageChange:U,onJumpToPage:Xt,onSelectionClear:()=>Q(new Set)})]}),e.jsxs(bs,{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(kl,{title:"็ป„ไปถๆจกๅž‹ (utils)",description:"็”จไบŽ่กจๆƒ…ๅŒ…ใ€ๅ–ๅใ€ๅ…ณ็ณปใ€ๆƒ…็ปชๅ˜ๅŒ–็ญ‰็ป„ไปถ",taskConfig:p.utils,modelNames:h,onChange:(re,he)=>ye("utils",re,he),dataTour:"task-model-select"}),e.jsx(kl,{title:"ๅทฅๅ…ท่ฐƒ็”จๆจกๅž‹ (tool_use)",description:"้œ€่ฆไฝฟ็”จๆ”ฏๆŒๅทฅๅ…ท่ฐƒ็”จ็š„ๆจกๅž‹",taskConfig:p.tool_use,modelNames:h,onChange:(re,he)=>ye("tool_use",re,he)}),e.jsx(kl,{title:"้ฆ–่ฆๅ›žๅคๆจกๅž‹ (replyer)",description:"็”จไบŽ่กจ่พพๅ™จๅ’Œ่กจ่พพๆ–นๅผๅญฆไน ",taskConfig:p.replyer,modelNames:h,onChange:(re,he)=>ye("replyer",re,he)}),e.jsx(kl,{title:"ๅ†ณ็ญ–ๆจกๅž‹ (planner)",description:"่ดŸ่ดฃๅ†ณๅฎš้บฆ้บฆ่ฏฅไป€ไนˆๆ—ถๅ€™ๅ›žๅค",taskConfig:p.planner,modelNames:h,onChange:(re,he)=>ye("planner",re,he)}),e.jsx(kl,{title:"ๅ›พๅƒ่ฏ†ๅˆซๆจกๅž‹ (vlm)",description:"่ง†่ง‰่ฏญ่จ€ๆจกๅž‹",taskConfig:p.vlm,modelNames:h,onChange:(re,he)=>ye("vlm",re,he),hideTemperature:!0}),e.jsx(kl,{title:"่ฏญ้Ÿณ่ฏ†ๅˆซๆจกๅž‹ (voice)",description:"่ฏญ้Ÿณ่ฝฌๆ–‡ๅญ—",taskConfig:p.voice,modelNames:h,onChange:(re,he)=>ye("voice",re,he),hideTemperature:!0,hideMaxTokens:!0}),e.jsx(kl,{title:"ๅตŒๅ…ฅๆจกๅž‹ (embedding)",description:"็”จไบŽๅ‘้‡ๅŒ–",taskConfig:p.embedding,modelNames:h,onChange:(re,he)=>ye("embedding",re,he),hideTemperature:!0,hideMaxTokens:!0}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM ็Ÿฅ่ฏ†ๅบ“ๆจกๅž‹"}),e.jsx(kl,{title:"ๅฎžไฝ“ๆๅ–ๆจกๅž‹ (lpmm_entity_extract)",description:"ไปŽๆ–‡ๆœฌไธญๆๅ–ๅฎžไฝ“",taskConfig:p.lpmm_entity_extract,modelNames:h,onChange:(re,he)=>ye("lpmm_entity_extract",re,he)}),e.jsx(kl,{title:"RDF ๆž„ๅปบๆจกๅž‹ (lpmm_rdf_build)",description:"ๆž„ๅปบ็Ÿฅ่ฏ†ๅ›พ่ฐฑ",taskConfig:p.lpmm_rdf_build,modelNames:h,onChange:(re,he)=>ye("lpmm_rdf_build",re,he)})]})]})]})]}),e.jsx(Ps,{open:P,onOpenChange:kt,children:e.jsxs(Us,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:Ga,children:[e.jsxs(Bs,{children:[e.jsx($s,{children:G!==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(T,{htmlFor:"model_name",className:Me.name?"text-destructive":"",children:"ๆจกๅž‹ๅ็งฐ *"}),e.jsx(ne,{id:"model_name",value:C?.name||"",onChange:re=>{M(he=>he?{...he,name:re.target.value}:null),Me.name&&de(he=>({...he,name:void 0}))},placeholder:"ไพ‹ๅฆ‚: qwen3-30b",className:Me.name?"border-destructive focus-visible:ring-destructive":""}),Me.name?e.jsx("p",{className:"text-xs text-destructive",children:Me.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(T,{htmlFor:"api_provider",className:Me.api_provider?"text-destructive":"",children:"API ๆไพ›ๅ•† *"}),e.jsxs(Be,{value:C?.api_provider||"",onValueChange:re=>{M(he=>he?{...he,api_provider:re}:null),vs(),Me.api_provider&&de(he=>({...he,api_provider:void 0}))},children:[e.jsx(Le,{id:"api_provider",className:Me.api_provider?"border-destructive focus-visible:ring-destructive":"",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๆไพ›ๅ•†"})}),e.jsx(Ue,{children:i.map(re=>e.jsx(W,{value:re,children:re},re))})]}),Me.api_provider&&e.jsx("p",{className:"text-xs text-destructive",children:Me.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(T,{htmlFor:"model_identifier",className:Me.model_identifier?"text-destructive":"",children:"ๆจกๅž‹ๆ ‡่ฏ†็ฌฆ *"}),ks?.modelFetcher&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{variant:"secondary",className:"text-xs",children:ks.display_name}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>C?.api_provider&&Ee(C.api_provider,!0),disabled:Ds,children:Ds?e.jsx(Ls,{className:"h-3 w-3 animate-spin"}):e.jsx(ft,{className:"h-3 w-3"})})]})]}),ks?.modelFetcher?e.jsxs(nl,{open:V,onOpenChange:xe,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",role:"combobox","aria-expanded":V,className:"w-full justify-between font-normal",disabled:Ds||!!as,children:[Ds?e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Ls,{className:"h-4 w-4 animate-spin"}),"ๆญฃๅœจ่Žทๅ–ๆจกๅž‹ๅˆ—่กจ..."]}):as?e.jsx("span",{className:"text-muted-foreground text-sm",children:"็‚นๅ‡ปไธ‹ๆ–น่พ“ๅ…ฅๆก†ๆ‰‹ๅŠจๅกซๅ†™"}):C?.model_identifier?e.jsx("span",{className:"truncate",children:C.model_identifier}):e.jsx("span",{className:"text-muted-foreground",children:"ๆœ็ดขๆˆ–้€‰ๆ‹ฉๆจกๅž‹..."}),e.jsx(Gm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ja,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(Qo,{children:[e.jsx(Yo,{placeholder:"ๆœ็ดขๆจกๅž‹..."}),e.jsx(Je,{className:"h-[300px]",children:e.jsxs(Jo,{className:"max-h-none overflow-visible",children:[e.jsx(Xo,{children:as?e.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[e.jsx("p",{className:"text-sm text-destructive",children:as}),!as.includes("API Key")&&e.jsx(S,{variant:"link",size:"sm",onClick:()=>C?.api_provider&&Ee(C.api_provider,!0),children:"้‡่ฏ•"})]}):"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๅž‹"}),e.jsx(Yi,{heading:"ๅฏ็”จๆจกๅž‹",children:We.map(re=>e.jsxs(Ji,{value:re.id,onSelect:()=>{M(he=>he?{...he,model_identifier:re.id}:null),xe(!1)},children:[e.jsx(_t,{className:`mr-2 h-4 w-4 ${C?.model_identifier===re.id?"opacity-100":"opacity-0"}`}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:re.id}),re.name!==re.id&&e.jsx("span",{className:"text-xs text-muted-foreground",children:re.name})]})]},re.id))}),e.jsx(Yi,{heading:"ๆ‰‹ๅŠจ่พ“ๅ…ฅ",children:e.jsxs(Ji,{value:"__manual_input__",onSelect:()=>{xe(!1)},children:[e.jsx($n,{className:"mr-2 h-4 w-4"}),"ๆ‰‹ๅŠจ่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ..."]})})]})})]})})]}):e.jsx(ne,{id:"model_identifier",value:C?.model_identifier||"",onChange:re=>{M(he=>he?{...he,model_identifier:re.target.value}:null),Me.model_identifier&&de(he=>({...he,model_identifier:void 0}))},placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507",className:Me.model_identifier?"border-destructive focus-visible:ring-destructive":""}),Me.model_identifier&&e.jsx("p",{className:"text-xs text-destructive",children:Me.model_identifier}),as&&ks?.modelFetcher&&!Me.model_identifier&&e.jsxs(it,{variant:"destructive",className:"mt-2 py-2",children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(ct,{className:"text-xs",children:as})]}),ks?.modelFetcher&&e.jsx(ne,{value:C?.model_identifier||"",onChange:re=>{M(he=>he?{...he,model_identifier:re.target.value}:null),Me.model_identifier&&de(he=>({...he,model_identifier:void 0}))},placeholder:"ๆˆ–ๆ‰‹ๅŠจ่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ",className:`mt-2 ${Me.model_identifier?"border-destructive focus-visible:ring-destructive":""}`}),!Me.model_identifier&&e.jsx("p",{className:"text-xs text-muted-foreground",children:as?'่ฏทๆ‰‹ๅŠจ่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ๏ผŒๆˆ–ๅ‰ๅพ€"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ"ๆฃ€ๆŸฅ API Key':ks?.modelFetcher?`ๅทฒ่ฏ†ๅˆซไธบ ${ks.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(T,{htmlFor:"price_in",children:"่พ“ๅ…ฅไปทๆ ผ (ยฅ/M token)"}),e.jsx(ne,{id:"price_in",type:"number",step:"0.1",min:"0",value:C?.price_in??"",onChange:re=>{const he=re.target.value===""?null:parseFloat(re.target.value);M(ss=>ss?{...ss,price_in:he}:null)},placeholder:"้ป˜่ฎค: 0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"price_out",children:"่พ“ๅ‡บไปทๆ ผ (ยฅ/M token)"}),e.jsx(ne,{id:"price_out",type:"number",step:"0.1",min:"0",value:C?.price_out??"",onChange:re=>{const he=re.target.value===""?null:parseFloat(re.target.value);M(ss=>ss?{...ss,price_out:he}:null)},placeholder:"้ป˜่ฎค: 0"})]})]}),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("div",{className:"space-y-0.5",children:[e.jsx(T,{htmlFor:"enable_model_temperature",className:"cursor-pointer",children:"่‡ชๅฎšไน‰ๆจกๅž‹ๆธฉๅบฆ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฏ็”จๅŽๅฐ†่ฆ†็›–ใ€Œไธบๆจกๅž‹ๅˆ†้…ๅŠŸ่ƒฝใ€ไธญ็š„ไปปๅŠกๆธฉๅบฆ้…็ฝฎ"})]}),e.jsx(Ve,{id:"enable_model_temperature",checked:C?.temperature!=null,onCheckedChange:re=>{M(re?he=>he?{...he,temperature:.5}:null:he=>he?{...he,temperature:null}:null)}})]}),C?.temperature!=null&&e.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm",children:"ๆธฉๅบฆๅ€ผ"}),e.jsx("span",{className:"text-sm font-medium tabular-nums",children:C.temperature.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"0"}),e.jsx(_a,{value:[C.temperature],onValueChange:re=>M(he=>he?{...he,temperature:re[0]}:null),min:0,max:1,step:.1,className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่พƒไฝŽ็š„ๆธฉๅบฆ๏ผˆ0.1-0.3๏ผ‰ไบง็”Ÿๆ›ด็กฎๅฎš็š„่พ“ๅ‡บ๏ผŒ่พƒ้ซ˜็š„ๆธฉๅบฆ๏ผˆ0.7-1.0๏ผ‰ไบง็”Ÿๆ›ดๅคšๆ ทๅŒ–็š„่พ“ๅ‡บ"})]})]}),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("div",{className:"space-y-0.5",children:[e.jsx(T,{htmlFor:"enable_model_max_tokens",className:"cursor-pointer",children:"่‡ชๅฎšไน‰ๆœ€ๅคง Token"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฏ็”จๅŽๅฐ†่ฆ†็›–ใ€Œไธบๆจกๅž‹ๅˆ†้…ๅŠŸ่ƒฝใ€ไธญ็š„ไปปๅŠกๆœ€ๅคง Token ้…็ฝฎ"})]}),e.jsx(Ve,{id:"enable_model_max_tokens",checked:C?.max_tokens!=null,onCheckedChange:re=>{M(re?he=>he?{...he,max_tokens:2048}:null:he=>he?{...he,max_tokens:null}:null)}})]}),C?.max_tokens!=null&&e.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm",children:"ๆœ€ๅคง Token ๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",max:"128000",value:C.max_tokens,onChange:re=>{const he=parseInt(re.target.value);!isNaN(he)&&he>=1&&M(ss=>ss?{...ss,max_tokens:he}:null)},className:"w-28 h-8 text-sm"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้™ๅˆถๆจกๅž‹ๅ•ๆฌก่พ“ๅ‡บ็š„ๆœ€ๅคง token ๆ•ฐ้‡๏ผŒไธๅŒๆจกๅž‹ๆ”ฏๆŒ็š„ไธŠ้™ไธๅŒ"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"force_stream_mode",checked:C?.force_stream_mode||!1,onCheckedChange:re=>M(he=>he?{...he,force_stream_mode:re}:null)}),e.jsx(T,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"ๅผบๅˆถๆตๅผ่พ“ๅ‡บๆจกๅผ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"้ขๅค–ๅ‚ๆ•ฐ"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(S,{type:"button",variant:"outline",size:"sm",className:"flex-1 justify-start h-9",onClick:()=>R(!0),children:[e.jsx(mn,{className:"h-4 w-4 mr-2"}),Object.keys(C?.extra_params||{}).length>0?e.jsxs("span",{children:["ๅทฒ้…็ฝฎ ",Object.keys(C?.extra_params||{}).length," ไธชๅ‚ๆ•ฐ"]}):e.jsx("span",{className:"text-muted-foreground",children:"ๆœช้…็ฝฎ้ขๅค–ๅ‚ๆ•ฐ"})]})}),Object.keys(C?.extra_params||{}).length>0&&e.jsxs("div",{className:"text-xs text-muted-foreground px-1",children:[Object.keys(C?.extra_params||{}).slice(0,3).map(re=>e.jsx("span",{className:"inline-block mr-2",children:e.jsx("code",{className:"px-1.5 py-0.5 bg-muted rounded",children:re})},re)),Object.keys(C?.extra_params||{}).length>3&&e.jsx("span",{children:"..."})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>E(!1),"data-tour":"model-cancel-button",children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:Es,"data-tour":"model-save-button",children:"ไฟๅญ˜"})]})]})}),e.jsx(js,{open:me,onOpenChange:ce,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๆจกๅž‹ "',ve!==null?l[ve]?.name:"",'" ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Ea,children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:$,onOpenChange:L,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",z.size," ไธชๆจกๅž‹ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๆ‰น้‡ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:Ae,onOpenChange:X,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsxs(xs,{className:"flex items-center gap-2",children:[e.jsx(Qt,{className:"h-5 w-5 text-amber-500"}),"ๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹่ญฆๅ‘Š"]}),e.jsx(hs,{asChild:!0,children:e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-foreground",children:"ๆณจๆ„๏ผš"}),"ๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹ๅฏ่ƒฝไผšๅฝฑๅ“็Ÿฅ่ฏ†ๅบ“็š„ๅŒน้…็ฒพๅบฆ๏ผ"]}),e.jsxs("ul",{className:"space-y-2 ml-4 list-disc text-muted-foreground",children:[e.jsx("li",{children:"ไธๅŒ็š„ๅตŒๅ…ฅๆจกๅž‹ไผšไบง็”ŸไธๅŒ็š„ๅ‘้‡่กจ็คบ"}),e.jsx("li",{children:"่ฟ™ๅฏ่ƒฝๅฏผ่‡ด็Žฐๆœ‰็Ÿฅ่ฏ†ๅบ“็š„ๆฃ€็ดข็ป“ๆžœไธๅ‡†็กฎ"}),e.jsx("li",{children:"ๅปบ่ฎฎๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹ๅŽ้‡ๆ–ฐ็”Ÿๆˆๆ‰€ๆœ‰็Ÿฅ่ฏ†ๅบ“็š„ๅ‘้‡"})]}),e.jsx("p",{className:"text-foreground font-medium",children:"็กฎๅฎš่ฆๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹ๅ—๏ผŸ"})]})})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:Hs,children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ze,className:"bg-amber-600 hover:bg-amber-700",children:"็กฎ่ฎคๆ›ดๆข"})]})]})}),e.jsx(q_,{open:ee,onOpenChange:R,value:C?.extra_params||{},onChange:re=>M(he=>he?{...he,extra_params:re}:null)}),e.jsx(qn,{})]})})}const Xi=qg,Zi=I0,Wi=P0,Zo="/api/webui/config";async function fS(){const n=await(await we(`${Zo}/adapter-config/path`)).json();return!n.success||!n.path?null:{path:n.path,lastModified:n.lastModified}}async function vg(l){const i=await(await we(`${Zo}/adapter-config/path`,{method:"POST",headers:Fs(),body:JSON.stringify({path:l})})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜่ทฏๅพ„ๅคฑ่ดฅ")}async function Ng(l){const i=await(await we(`${Zo}/adapter-config?path=${encodeURIComponent(l)}`)).json();if(!i.success)throw new Error("่ฏปๅ–้…็ฝฎๆ–‡ไปถๅคฑ่ดฅ");return i.content}async function bg(l,n){const c=await(await we(`${Zo}/adapter-config`,{method:"POST",headers:Fs(),body:JSON.stringify({path:l,content:n})})).json();if(!c.success)throw new Error(c.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}const vt={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"}},_m={oneclick:{name:"ไธ€้”ฎๅŒ…",description:"ไฝฟ็”จไธ€้”ฎๅŒ…้ƒจ็ฝฒ็š„้€‚้…ๅ™จ้…็ฝฎ",path:"../MaiBot-Napcat-Adapter/config.toml",icon:aa},docker:{name:"Docker",description:"Docker Compose ้ƒจ็ฝฒ็š„้€‚้…ๅ™จ้…็ฝฎ",path:"/MaiMBot/adapters-config/config.toml",icon:Qw}};function pS(l,n){let i=l.slice(0,n).split(/\r\n|\n|\r/g);return[i.length,i.pop().length+1]}function gS(l,n,i){let c=l.split(/\r\n|\n|\r/g),u="",x=(Math.log10(n+1)|0)+1;for(let h=n-1;h<=n+1;h++){let f=c[h-1];f&&(u+=h.toString().padEnd(x," "),u+=": ",u+=f,u+=` +`),u}async function Z_(l,n,i,c){const u=await we("/api/webui/config/model");if(!u.ok)throw new Error("่Žทๅ–ๅฝ“ๅ‰ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const x=await u.json(),h=x.config||x;if(n.apply_providers){const p=n.selected_providers?l.providers.filter(g=>n.selected_providers.includes(g.name)):l.providers;for(const g of p){if(i[g.name])continue;const N=c[g.name];if(!N)throw new Error(`ๆไพ›ๅ•† "${g.name}" ็ผบๅฐ‘ API Key`);const v={...g,api_key:N},y=h.api_providers.findIndex(w=>w.name===g.name);y>=0?h.api_providers[y]=v:h.api_providers.push(v)}}if(n.apply_models){const p=n.selected_models?l.models.filter(g=>n.selected_models.includes(g.name)):l.models;for(const g of p){const N=i[g.api_provider]||g.api_provider,v={...g,api_provider:N},y=h.models.findIndex(w=>w.name===g.name);y>=0?h.models[y]=v:h.models.push(v)}}if(n.apply_task_config){const p=n.selected_tasks||Object.keys(l.task_config);for(const g of p){const N=l.task_config[g];if(!N)continue;const v=new Set(n.selected_models||l.models.map(b=>b.name)),y=N.model_list.filter(b=>v.has(b));if(y.length===0)continue;const w={...N,model_list:y};if(n.task_mode==="replace")h.model_task_config[g]=w;else{const b=h.model_task_config[g];if(b){const D=[...new Set([...b.model_list,...y])];h.model_task_config[g]={...b,model_list:D}}else h.model_task_config[g]=w}}}if(!(await we("/api/webui/config/model",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)})).ok)throw new Error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}async function W_(l){const n=await we("/api/webui/config/model");if(!n.ok)throw new Error("่Žทๅ–ๅฝ“ๅ‰ๆจกๅž‹้…็ฝฎๅคฑ่ดฅ");const i=await n.json();if(!i.success||!i.config)throw new Error("่Žทๅ–้…็ฝฎๅคฑ่ดฅ");const c=i.config;let u=(c.api_providers||[]).map(g=>({name:g.name,base_url:g.base_url,client_type:g.client_type,max_retry:g.max_retry,timeout:g.timeout,retry_interval:g.retry_interval}));l.selectedProviders&&(u=u.filter(g=>l.selectedProviders.includes(g.name)));let x=c.models||[];l.selectedModels&&(x=x.filter(g=>l.selectedModels.includes(g.name)));const h={},f=c.model_task_config||{},p=l.selectedTasks||Object.keys(f);for(const g of p)f[g]&&(h[g]=f[g]);return{providers:u,models:x,task_config:h}}function _m(l){try{const n=new URL(l);return`${n.protocol}//${n.host}${n.pathname}`.replace(/\/$/,"").toLowerCase()}catch{return l.toLowerCase().replace(/\/$/,"")}}function pv(){const l="maibot_pack_user_id";let n=localStorage.getItem(l);return n||(n="pack_user_"+Math.random().toString(36).substring(2,15),localStorage.setItem(l,n)),n}const eS={utils:"้€š็”จๅทฅๅ…ท",utils_small:"่ฝป้‡ๅทฅๅ…ท",tool_use:"ๅทฅๅ…ท่ฐƒ็”จ",replyer:"ๅ›žๅค็”Ÿๆˆ",planner:"่ง„ๅˆ’ๆŽจ็†",vlm:"่ง†่ง‰ๆจกๅž‹",voice:"่ฏญ้Ÿณๅค„็†",embedding:"ๅ‘้‡ๅตŒๅ…ฅ",lpmm_entity_extract:"ๅฎžไฝ“ๆๅ–",lpmm_rdf_build:"RDFๆž„ๅปบ",lpmm_qa:"้—ฎ็ญ”ๆจกๅž‹"},sS=["ๅฎ˜ๆ–นๆŽจ่","ๆ€งไปทๆฏ”","้ซ˜ๆ€ง่ƒฝ","ๅ…่ดนๆจกๅž‹","ๅ›ฝๅ†…ๅฏ็”จ","ๆตทๅค–ๆจกๅž‹","OpenAI","Claude","Gemini","ๅ›ฝไบงๆจกๅž‹","ๅคšๆจกๆ€","่ฝป้‡็บง"];function tS({trigger:l}){const[n,i]=m.useState(!1),[c,u]=m.useState(1),[x,h]=m.useState(!1),[f,p]=m.useState(!1),[g,N]=m.useState([]),[v,y]=m.useState([]),[w,b]=m.useState({}),[D,A]=m.useState(new Set),[_,H]=m.useState(new Set),[E,C]=m.useState(new Set),[M,G]=m.useState(""),[O,ee]=m.useState(""),[R,me]=m.useState(""),[ce,ve]=m.useState([]);m.useEffect(()=>{n&&c===1&&se()},[n,c]);const se=async()=>{h(!0);try{const K=await W_({name:"",description:"",author:""});N(K.providers),y(K.models),b(K.task_config),A(new Set(K.providers.map(U=>U.name))),H(new Set(K.models.map(U=>U.name))),C(new Set(Object.keys(K.task_config)))}catch(K){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",K),Kt({title:"ๅŠ ่ฝฝๅฝ“ๅ‰้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{h(!1)}},ge=K=>{const U=new Set(D),V=new Set(_),xe=new Set(E);U.has(K)?(U.delete(K),v.filter(X=>X.api_provider===K).forEach(X=>V.delete(X.name)),Object.entries(w).forEach(([X,oe])=>{oe.model_list&&(oe.model_list.some(Y=>V.has(Y))||xe.delete(X))})):(U.add(K),v.filter(X=>X.api_provider===K).forEach(X=>V.add(X.name)),Object.entries(w).forEach(([X,oe])=>{oe.model_list&&oe.model_list.some(Y=>{const te=v.find(Oe=>Oe.name===Y);return te&&te.api_provider===K})&&xe.add(X)})),A(U),H(V),C(xe)},fe=K=>{const U=new Set(_),V=new Set(E);U.has(K)?(U.delete(K),Object.entries(w).forEach(([xe,Ae])=>{Ae.model_list&&(Ae.model_list.some(oe=>U.has(oe))||V.delete(xe))})):(U.add(K),Object.entries(w).forEach(([xe,Ae])=>{Ae.model_list&&Ae.model_list.includes(K)&&V.add(xe)})),H(U),C(V)},z=K=>{const U=new Set(E);U.has(K)?U.delete(K):U.add(K),C(U)},Q=K=>{ce.includes(K)?ve(ce.filter(U=>U!==K)):ce.length<5?ve([...ce,K]):Kt({title:"ๆœ€ๅคš้€‰ๆ‹ฉ 5 ไธชๆ ‡็ญพ",variant:"destructive"})},I=()=>{D.size===g.length?A(new Set):A(new Set(g.map(K=>K.name)))},L=()=>{_.size===v.length?H(new Set):H(new Set(v.map(K=>K.name)))},$=()=>{const K=Object.keys(w);E.size===K.length?C(new Set):C(new Set(K))},_e=async()=>{if(!M.trim()){Kt({title:"่ฏท่พ“ๅ…ฅๆจกๆฟๅ็งฐ",variant:"destructive"});return}if(!O.trim()){Kt({title:"่ฏท่พ“ๅ…ฅๆจกๆฟๆ่ฟฐ",variant:"destructive"});return}if(!R.trim()){Kt({title:"่ฏท่พ“ๅ…ฅไฝœ่€…ๅ็งฐ",variant:"destructive"});return}if(D.size===0&&_.size===0&&E.size===0){Kt({title:"่ฏท่‡ณๅฐ‘้€‰ๆ‹ฉไธ€้กน้…็ฝฎ",variant:"destructive"});return}p(!0);try{const K=g.filter(xe=>D.has(xe.name)),U=v.filter(xe=>_.has(xe.name)),V={};for(const[xe,Ae]of Object.entries(w))E.has(xe)&&(V[xe]=Ae);await Y_({name:M.trim(),description:O.trim(),author:R.trim(),tags:ce,providers:K,models:U,task_config:V}),Kt({title:"ๆจกๆฟๅทฒๆไบคๅฎกๆ ธ๏ผŒๅฎกๆ ธ้€š่ฟ‡ๅŽๅฐ†ๆ˜พ็คบๅœจๅธ‚ๅœบไธญ"}),i(!1),je()}catch(K){console.error("ๆไบคๅคฑ่ดฅ:",K),Kt({title:K instanceof Error?K.message:"ๆไบคๅคฑ่ดฅ",variant:"destructive"})}finally{p(!1)}},je=()=>{u(1),G(""),ee(""),me(""),ve([]),A(new Set),H(new Set),C(new Set)},Se=2;return e.jsxs(Ps,{open:n,onOpenChange:i,children:[e.jsx(Qo,{asChild:!0,children:l||e.jsxs(S,{variant:"outline",children:[e.jsx(Tj,{className:"w-4 h-4 mr-2"}),"ๅˆ†ไบซ้…็ฝฎ"]})}),e.jsxs(Us,{className:"max-w-2xl max-h-[85vh] flex flex-col",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(la,{className:"w-5 h-5"}),"ๅˆ†ไบซ้…็ฝฎๆจกๆฟ"]}),e.jsxs(Ys,{children:["ๆญฅ้ชค ",c," / ",Se,"๏ผš",c===1&&"้€‰ๆ‹ฉ่ฆๅˆ†ไบซ็š„้…็ฝฎ",c===2&&"ๅกซๅ†™ๆจกๆฟไฟกๆฏ"]})]}),e.jsx(Je,{className:"h-[calc(85vh-220px)] pr-4",children:x?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx(Ls,{className:"w-8 h-8 mx-auto animate-spin text-primary"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"ๆญฃๅœจๅŠ ่ฝฝๅฝ“ๅ‰้…็ฝฎ..."})]}):e.jsxs(e.Fragment,{children:[c===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๅฎ‰ๅ…จๆ็คบ"}),e.jsxs(nt,{children:["ๅˆ†ไบซ็š„้…็ฝฎๅฐ†",e.jsx("strong",{children:"ไธๅŒ…ๅซ"})," API Key๏ผŒๅ…ถไป–็”จๆˆท้œ€่ฆ่‡ช่กŒ้…็ฝฎใ€‚"]})]}),e.jsxs(ra,{defaultValue:"providers",className:"w-full",children:[e.jsxs(ea,{className:"grid w-full grid-cols-3",children:[e.jsxs(ts,{value:"providers",children:[e.jsx(Al,{className:"w-4 h-4 mr-2"}),"API ๆไพ›ๅ•†",e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[D.size,"/",g.length]})]}),e.jsxs(ts,{value:"models",children:[e.jsx(In,{className:"w-4 h-4 mr-2"}),"ๆจกๅž‹้…็ฝฎ",e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[_.size,"/",v.length]})]}),e.jsxs(ts,{value:"tasks",children:[e.jsx(Pn,{className:"w-4 h-4 mr-2"}),"ไปปๅŠก้…็ฝฎ",e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[E.size,"/",Object.keys(w).length]})]})]}),e.jsx(bs,{value:"providers",className:"space-y-2 mt-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(S,{variant:"ghost",size:"sm",onClick:I,children:D.size===g.length?"ๅ–ๆถˆๅ…จ้€‰":"ๅ…จ้€‰"})}),g.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"ๆš‚ๆ— ๆไพ›ๅ•†้…็ฝฎ"}):g.map(K=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 rounded hover:bg-muted",children:[e.jsx(Ws,{id:`provider-${K.name}`,checked:D.has(K.name),onCheckedChange:()=>ge(K.name)}),e.jsxs(T,{htmlFor:`provider-${K.name}`,className:"flex-1 cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:K.name}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:K.base_url})]}),e.jsx(ke,{variant:"outline",className:"text-xs",children:K.client_type})]},K.name))]})}),e.jsx(bs,{value:"models",className:"space-y-2 mt-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(S,{variant:"ghost",size:"sm",onClick:L,children:_.size===v.length?"ๅ–ๆถˆๅ…จ้€‰":"ๅ…จ้€‰"})}),v.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"ๆš‚ๆ— ๆจกๅž‹้…็ฝฎ"}):v.map(K=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 rounded hover:bg-muted",children:[e.jsx(Ws,{id:`model-${K.name}`,checked:_.has(K.name),onCheckedChange:()=>fe(K.name)}),e.jsxs(T,{htmlFor:`model-${K.name}`,className:"flex-1 cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:K.name}),e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:K.model_identifier})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:K.api_provider})]},K.name))]})}),e.jsx(bs,{value:"tasks",className:"space-y-2 mt-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(S,{variant:"ghost",size:"sm",onClick:$,children:E.size===Object.keys(w).length?"ๅ–ๆถˆๅ…จ้€‰":"ๅ…จ้€‰"})}),Object.keys(w).length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"ๆš‚ๆ— ไปปๅŠก้…็ฝฎ"}):Object.entries(w).map(([K,U])=>e.jsxs("div",{className:"space-y-2 p-2 rounded hover:bg-muted",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:`task-${K}`,checked:E.has(K),onCheckedChange:()=>z(K)}),e.jsx(T,{htmlFor:`task-${K}`,className:"flex-1 cursor-pointer",children:e.jsx("span",{className:"font-medium",children:eS[K]||K})}),e.jsxs(ke,{variant:"outline",className:"text-xs",children:[U.model_list.length," ไธชๆจกๅž‹"]})]}),U.model_list&&U.model_list.length>0&&e.jsx("div",{className:"ml-6 flex flex-wrap gap-1",children:U.model_list.map(V=>{const xe=v.find(X=>X.name===V),Ae=_.has(V);return e.jsxs(ke,{variant:Ae?"default":"outline",className:"text-xs cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>fe(V),children:[V,xe&&e.jsxs("span",{className:"ml-1 opacity-70",children:["(",xe.api_provider,")"]})]},V)})})]},K))]})})]})]}),c===2&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4 text-sm p-3 bg-muted rounded-lg",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Al,{className:"w-4 h-4"}),D.size," ไธชๆไพ›ๅ•†"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(In,{className:"w-4 h-4"}),_.size," ไธชๆจกๅž‹"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pn,{className:"w-4 h-4"}),E.size," ไธชไปปๅŠก"]})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"pack-name",children:"ๆจกๆฟๅ็งฐ *"}),e.jsx(ne,{id:"pack-name",placeholder:"ไพ‹ๅฆ‚๏ผš้ซ˜ๆ€งไปทๆฏ”ๅ›ฝไบงๆจกๅž‹้…็ฝฎ",value:M,onChange:K=>G(K.target.value),maxLength:50}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[M.length,"/50"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"pack-description",children:"ๆจกๆฟๆ่ฟฐ *"}),e.jsx(at,{id:"pack-description",placeholder:"่ฏฆ็ป†ๆ่ฟฐ่ฟ™ไธช้…็ฝฎๆจกๆฟ็š„็‰น็‚นใ€้€‚็”จๅœบๆ™ฏ็ญ‰...",value:O,onChange:K=>ee(K.target.value),rows:4,maxLength:500}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[O.length,"/500"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"pack-author",children:"ไฝœ่€…ๅ็งฐ *"}),e.jsx(ne,{id:"pack-author",placeholder:"ไฝ ็š„ๆ˜ต็งฐๆˆ– ID",value:R,onChange:K=>me(K.target.value),maxLength:30})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๆ ‡็ญพ๏ผˆๅฏ้€‰๏ผŒๆœ€ๅคš 5 ไธช๏ผ‰"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:sS.map(K=>e.jsxs(ke,{variant:ce.includes(K)?"default":"outline",className:"cursor-pointer transition-colors",onClick:()=>Q(K),children:[ce.includes(K)&&e.jsx(_t,{className:"w-3 h-3 mr-1"}),e.jsx(Vo,{className:"w-3 h-3 mr-1"}),K]},K))})]})]}),e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๅฎกๆ ธ่ฏดๆ˜Ž"}),e.jsx(nt,{children:"ๆไบคๅŽ้œ€่ฆ็ป่ฟ‡ๅฎกๆ ธๆ‰่ƒฝๅœจๅธ‚ๅœบไธญๅฑ•็คบใ€‚ๅฎกๆ ธ้€šๅธธๅœจ 1-3 ไธชๅทฅไฝœๆ—ฅๅ†…ๅฎŒๆˆใ€‚"})]})]})]})}),e.jsxs(et,{className:"flex justify-between pt-4 border-t",children:[e.jsx("div",{children:c>1&&e.jsx(S,{variant:"outline",onClick:()=>u(c-1),disabled:f,children:"ไธŠไธ€ๆญฅ"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>{i(!1),je()},disabled:f,children:"ๅ–ๆถˆ"}),cu(c+1),disabled:x||D.size===0&&_.size===0&&E.size===0,children:"ไธ‹ไธ€ๆญฅ"}):e.jsxs(S,{onClick:_e,disabled:f,children:[f&&e.jsx(Ls,{className:"w-4 h-4 mr-2 animate-spin"}),"ๆไบคๅฎกๆ ธ"]})]})]})]})]})}function aS({value:l,label:n,onRemove:i}){const{attributes:c,listeners:u,setNodeRef:x,transform:h,transition:f,isDragging:p}=Vj({id:l}),g={transform:qj.Transform.toString(h),transition:f,opacity:p?.5:1},N=y=>{y.preventDefault(),y.stopPropagation(),i(l)},v=y=>{y.stopPropagation()};return e.jsx("div",{ref:x,style:g,className:P("inline-flex items-center gap-1",p&&"shadow-lg"),children:e.jsxs(ke,{variant:"secondary",className:"cursor-move hover:bg-secondary/80 flex items-center gap-1",children:[e.jsx("div",{...c,...u,className:"cursor-grab active:cursor-grabbing flex items-center",children:e.jsx(Sj,{className:"h-3 w-3 text-muted-foreground"})}),e.jsx("span",{children:n}),e.jsx("span",{role:"button",tabIndex:0,className:"ml-1 rounded-sm hover:bg-destructive/20 focus:outline-none focus:ring-1 focus:ring-destructive cursor-pointer",onClick:N,onPointerDown:v,onMouseDown:y=>y.stopPropagation(),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),N(y))},children:e.jsx(Ca,{className:"h-3 w-3 hover:text-destructive",strokeWidth:2,fill:"none"})})]})})}function lS({options:l,selected:n,onChange:i,placeholder:c="้€‰ๆ‹ฉ้€‰้กน...",emptyText:u="ๆœชๆ‰พๅˆฐ้€‰้กน",className:x}){const[h,f]=m.useState(!1),p=Uj(Oo(Ij,{activationConstraint:{distance:8}}),Oo($j,{coordinateGetter:Bj})),g=y=>{n.includes(y)?i(n.filter(w=>w!==y)):i([...n,y])},N=y=>{i(n.filter(w=>w!==y))},v=y=>{const{active:w,over:b}=y;if(b&&w.id!==b.id){const D=n.indexOf(w.id),A=n.indexOf(b.id);i(Pj(n,D,A))}};return e.jsxs(nl,{open:h,onOpenChange:f,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",role:"combobox","aria-expanded":h,className:P("w-full justify-between min-h-10 h-auto",x),children:[e.jsx(Hj,{sensors:p,collisionDetection:Fj,onDragEnd:v,children:e.jsx(Gj,{items:n,strategy:_1,children:e.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:n.length===0?e.jsx("span",{className:"text-muted-foreground",children:c}):n.map(y=>{const w=l.find(b=>b.value===y);return e.jsx(aS,{value:y,label:w?.label||y,onRemove:N},y)})})})}),e.jsx(Vm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),e.jsx(Ja,{className:"w-full p-0",align:"start",children:e.jsxs(Yo,{children:[e.jsx(Jo,{placeholder:"ๆœ็ดข...",className:"h-9"}),e.jsxs(Xo,{children:[e.jsx(Zo,{children:u}),e.jsx(Ji,{children:l.map(y=>{const w=n.includes(y.value);return e.jsxs(Xi,{value:y.value,onSelect:()=>g(y.value),children:[e.jsx("div",{className:P("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",w?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(_t,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),e.jsx("span",{children:y.label})]},y.value)})})]})]})})]})}const kl=zs.memo(function({title:n,description:i,taskConfig:c,modelNames:u,onChange:x,hideTemperature:h=!1,hideMaxTokens:f=!1,dataTour:p}){const g=N=>{x("model_list",N)};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:i})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2","data-tour":p,children:[e.jsx(T,{children:"ๆจกๅž‹ๅˆ—่กจ"}),e.jsx(lS,{options:u.map(N=>({label:N,value:N})),selected:c.model_list||[],onChange:g,placeholder:"้€‰ๆ‹ฉๆจกๅž‹...",emptyText:"ๆš‚ๆ— ๅฏ็”จๆจกๅž‹"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!h&&e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๆธฉๅบฆ"}),e.jsx(ne,{type:"number",step:"0.1",min:"0",max:"1",value:c.temperature??.3,onChange:N=>{const v=parseFloat(N.target.value);!isNaN(v)&&v>=0&&v<=1&&x("temperature",v)},className:"w-20 h-8 text-sm"})]}),e.jsx(_a,{value:[c.temperature??.3],onValueChange:N=>x("temperature",N[0]),min:0,max:1,step:.1,className:"w-full"})]}),!f&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆœ€ๅคง Token"}),e.jsx(ne,{type:"number",step:"1",min:"1",value:c.max_tokens??1024,onChange:N=>x("max_tokens",parseInt(N.target.value))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:"ๆ…ข่ฏทๆฑ‚้˜ˆๅ€ผ (็ง’)"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"่ถ…ๆ—ถ่ญฆๅ‘Š"})]}),e.jsx(ne,{type:"number",step:"1",min:"1",value:c.slow_threshold??15,onChange:N=>{const v=parseInt(N.target.value);!isNaN(v)&&v>=1&&x("slow_threshold",v)},placeholder:"15"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆจกๅž‹ๅ“ๅบ”ๆ—ถ้—ด่ถ…่ฟ‡ๆญค้˜ˆๅ€ผๅฐ†่พ“ๅ‡บ่ญฆๅ‘Šๆ—ฅๅฟ—"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{children:"ๆจกๅž‹้€‰ๆ‹ฉ็ญ–็•ฅ"}),e.jsxs(Be,{value:c.selection_strategy??"balance",onValueChange:N=>x("selection_strategy",N),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๆจกๅž‹้€‰ๆ‹ฉ็ญ–็•ฅ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"balance",children:"่ดŸ่ฝฝๅ‡่กก๏ผˆbalance๏ผ‰"}),e.jsx(W,{value:"random",children:"้šๆœบ้€‰ๆ‹ฉ๏ผˆrandom๏ผ‰"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ดŸ่ฝฝๅ‡่กก๏ผšไผ˜ๅ…ˆ้€‰ๆ‹ฉไฝฟ็”จๆฌกๆ•ฐๅฐ‘็š„ๆจกๅž‹ใ€‚้šๆœบ้€‰ๆ‹ฉ๏ผšๅฎŒๅ…จ้šๆœบไปŽๆจกๅž‹ๅˆ—่กจไธญ้€‰ๆ‹ฉ"})]})]})]})}),nS=zs.memo(function({paginatedModels:n,allModels:i,onEdit:c,onDelete:u,isModelUsed:x,searchQuery:h}){return n.length===0?e.jsx("div",{className:"md:hidden text-center text-muted-foreground py-8 rounded-lg border bg-card",children:h?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๅž‹":"ๆš‚ๆ— ๆจกๅž‹้…็ฝฎ"}):e.jsx("div",{className:"md:hidden space-y-3",children:n.map((f,p)=>{const g=i.findIndex(v=>v===f),N=x(f.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:f.name}),e.jsx(ke,{variant:N?"default":"secondary",className:N?"bg-green-600 hover:bg-green-700":"",children:N?"ๅทฒไฝฟ็”จ":"ๆœชไฝฟ็”จ"})]}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",title:f.model_identifier,children:f.model_identifier})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>c(f,g),children:[e.jsx($n,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>u(g),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{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:f.api_provider})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"ๆจกๅž‹ๆธฉๅบฆ"}),e.jsx("p",{className:"font-medium",children:f.temperature!=null?f.temperature:e.jsx("span",{className:"text-muted-foreground",children:"้ป˜่ฎค"})})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"่พ“ๅ…ฅไปทๆ ผ"}),e.jsxs("p",{className:"font-medium",children:["ยฅ",f.price_in,"/M"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"่พ“ๅ‡บไปทๆ ผ"}),e.jsxs("p",{className:"font-medium",children:["ยฅ",f.price_out,"/M"]})]})]})]},p)})})}),rS=zs.memo(function({paginatedModels:n,allModels:i,filteredModels:c,selectedModels:u,onEdit:x,onDelete:h,onToggleSelection:f,onToggleSelectAll:p,isModelUsed:g,searchQuery:N}){return 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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:u.size===c.length&&c.length>0,onCheckedChange:p})}),e.jsx(Ze,{className:"w-24",children:"ไฝฟ็”จ็Šถๆ€"}),e.jsx(Ze,{children:"ๆจกๅž‹ๅ็งฐ"}),e.jsx(Ze,{children:"ๆจกๅž‹ๆ ‡่ฏ†็ฌฆ"}),e.jsx(Ze,{children:"ๆไพ›ๅ•†"}),e.jsx(Ze,{className:"text-center",children:"ๆธฉๅบฆ"}),e.jsx(Ze,{className:"text-right",children:"่พ“ๅ…ฅไปทๆ ผ"}),e.jsx(Ze,{className:"text-right",children:"่พ“ๅ‡บไปทๆ ผ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:n.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:9,className:"text-center text-muted-foreground py-8",children:N?"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๅž‹":"ๆš‚ๆ— ๆจกๅž‹้…็ฝฎ"})}):n.map((v,y)=>{const w=i.findIndex(D=>D===v),b=g(v.name);return e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:u.has(w),onCheckedChange:()=>f(w)})}),e.jsx(Ke,{children:e.jsx(ke,{variant:b?"default":"secondary",className:b?"bg-green-600 hover:bg-green-700":"",children:b?"ๅทฒไฝฟ็”จ":"ๆœชไฝฟ็”จ"})}),e.jsx(Ke,{className:"font-medium",children:v.name}),e.jsx(Ke,{className:"max-w-xs truncate",title:v.model_identifier,children:v.model_identifier}),e.jsx(Ke,{children:v.api_provider}),e.jsx(Ke,{className:"text-center",children:v.temperature!=null?v.temperature:e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsxs(Ke,{className:"text-right",children:["ยฅ",v.price_in,"/M"]}),e.jsxs(Ke,{className:"text-right",children:["ยฅ",v.price_out,"/M"]}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>x(v,w),children:[e.jsx($n,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>h(w),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"ๅˆ ้™ค"]})]})})]},y)})})]})})})}),iS=300*1e3,vg=new Map,cS=[10,20,50,100],oS=zs.memo(function({page:n,pageSize:i,totalItems:c,jumpToPage:u,onPageChange:x,onPageSizeChange:h,onJumpToPageChange:f,onJumpToPage:p,onSelectionClear:g}){const N=Math.ceil(c/i),v=w=>{h(parseInt(w)),x(1),g?.()},y=w=>{w.key==="Enter"&&p()};return c===0?null: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(T,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:i.toString(),onValueChange:v,children:[e.jsx(Le,{id:"page-size-model",className:"w-20",children:e.jsx($e,{})}),e.jsx(Ue,{children:cS.map(w=>e.jsx(W,{value:w.toString(),children:w},w))})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๆ˜พ็คบ ",(n-1)*i+1," ๅˆฐ"," ",Math.min(n*i,c)," ๆก๏ผŒๅ…ฑ ",c," ๆก"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>x(1),disabled:n===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>x(Math.max(1,n-1)),disabled:n===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:u,onChange:w=>f(w.target.value),onKeyDown:y,placeholder:n.toString(),className:"w-16 h-8 text-center",min:1,max:N}),e.jsx(S,{variant:"outline",size:"sm",onClick:p,disabled:!u,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>x(n+1),disabled:n>=N,children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>x(N),disabled:n>=N,className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})});function dS(l){const{models:n,taskConfig:i,debounceMs:c=2e3,onSavingChange:u,onUnsavedChange:x}=l,h=m.useRef(null),f=m.useRef(null),p=m.useRef(!0),g=m.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),N=m.useCallback(w=>{const b={model_identifier:w.model_identifier,name:w.name,api_provider:w.api_provider,price_in:w.price_in??0,price_out:w.price_out??0,force_stream_mode:w.force_stream_mode??!1,extra_params:w.extra_params??{}};return w.temperature!=null&&(b.temperature=w.temperature),w.max_tokens!=null&&(b.max_tokens=w.max_tokens),b},[]),v=m.useCallback(async w=>{try{u?.(!0);const b=w.map(N);await Rm("models",b),x?.(!1)}catch(b){console.error("่‡ชๅŠจไฟๅญ˜ๆจกๅž‹ๅˆ—่กจๅคฑ่ดฅ:",b),x?.(!0)}finally{u?.(!1)}},[u,x,N]),y=m.useCallback(async w=>{try{u?.(!0),await Rm("model_task_config",w),x?.(!1)}catch(b){console.error("่‡ชๅŠจไฟๅญ˜ไปปๅŠก้…็ฝฎๅคฑ่ดฅ:",b),x?.(!0)}finally{u?.(!1)}},[u,x]);return m.useEffect(()=>{if(!p.current)return x?.(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{v(n)},c),()=>{h.current&&clearTimeout(h.current)}},[n,v,c,x]),m.useEffect(()=>{if(!(p.current||!i))return x?.(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{y(i)},c),()=>{f.current&&clearTimeout(f.current)}},[i,y,c,x]),m.useEffect(()=>()=>{g()},[g]),{clearTimers:g,initialLoadRef:p}}function uS(l={}){const{onCloseEditDialog:n}=l,i=ia(),{registerTour:c,startTour:u,state:x,goToStep:h}=Ym(),f=m.useRef(x.stepIndex);return m.useEffect(()=>{c(al,uv)},[c]),m.useEffect(()=>{if(x.activeTourId===al&&x.isRunning){const g=mv[x.stepIndex];g&&!window.location.pathname.endsWith(g.replace("/config/",""))&&i({to:g})}},[x.stepIndex,x.activeTourId,x.isRunning,i]),m.useEffect(()=>{if(x.activeTourId===al&&x.isRunning){const g=f.current,N=x.stepIndex;g>=12&&g<=17&&N<12&&n?.(),f.current=N}},[x.stepIndex,x.activeTourId,x.isRunning,n]),m.useEffect(()=>{if(x.activeTourId!==al||!x.isRunning)return;const g=N=>{const v=N.target,y=x.stepIndex;y===2&&v.closest('[data-tour="add-provider-button"]')?setTimeout(()=>h(3),300):y===9&&v.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>h(10),300):y===11&&v.closest('[data-tour="add-model-button"]')?setTimeout(()=>h(12),300):y===17&&v.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>h(18),300):y===18&&v.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>h(19),300)};return document.addEventListener("click",g,!0),()=>document.removeEventListener("click",g,!0)},[x,h]),{startTour:m.useCallback(()=>{u(al)},[u]),isRunning:x.isRunning&&x.activeTourId===al,stepIndex:x.stepIndex}}function mS(l){const{getProviderConfig:n}=l,[i,c]=m.useState([]),[u,x]=m.useState(!1),[h,f]=m.useState(null),[p,g]=m.useState(null),N=m.useCallback(()=>{c([]),f(null),g(null)},[]),v=m.useCallback(async(y,w=!1)=>{const b=n(y);if(!b?.base_url){c([]),g(null),f('ๆไพ›ๅ•†้…็ฝฎไธๅฎŒๆ•ด๏ผŒ่ฏทๅ…ˆๅœจ"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ"ไธญ้…็ฝฎ');return}if(!b.api_key){c([]),g(null),f('่ฏฅๆไพ›ๅ•†ๆœช้…็ฝฎ API Key๏ผŒ่ฏทๅ…ˆๅœจ"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ"ไธญๅกซๅ†™');return}const D=I_(b.base_url);if(g(D),!D?.modelFetcher){c([]),f(null);return}const A=`${y}:${b.base_url}`,_=vg.get(A);if(!w&&_&&Date.now()-_.timestampE(!1)}),{clearTimers:Ht,initialLoadRef:ut}=dS({models:l,taskConfig:p,onSavingChange:D,onUnsavedChange:_}),q=m.useCallback((re,he)=>{if(!re)return;const ss=new Set(he.map(Va=>Va.name)),gs=[],cs=[],Ct=[{key:"utils",label:"ๅทฅๅ…ทๆจกๅž‹"},{key:"tool_use",label:"ๅทฅๅ…ท่ฐƒ็”จๆจกๅž‹"},{key:"replyer",label:"ๅ›žๅคๆจกๅž‹"},{key:"planner",label:"่ง„ๅˆ’ๅ™จๆจกๅž‹"},{key:"vlm",label:"่ง†่ง‰ๆจกๅž‹"},{key:"voice",label:"่ฏญ้Ÿณๆจกๅž‹"},{key:"embedding",label:"ๅตŒๅ…ฅๆจกๅž‹"},{key:"lpmm_entity_extract",label:"LPMMๅฎžไฝ“ๆŠฝๅ–"},{key:"lpmm_rdf_build",label:"LPMMๅ…ณ็ณปๆž„ๅปบ"}];for(const{key:Va,label:Ll}of Ct){const Qn=re[Va];if(!Qn)continue;if(!Qn.model_list||Qn.model_list.length===0){cs.push(Ll);continue}const Vr=Qn.model_list.filter(jn=>!ss.has(jn));Vr.length>0&&gs.push({taskName:Ll,invalidModels:Vr})}te(gs),De(cs)},[]),qe=m.useCallback(async()=>{try{v(!0);const re=await cn(),he=re.models||[];n(he),f(he.map(Ct=>Ct.name));const ss=re.api_providers||[];c(ss.map(Ct=>Ct.name)),x(ss);const gs=re.model_task_config||null;g(gs),q(gs,he);const cs=gs?.embedding?.model_list||[];oe.current=[...cs],_(!1),ut.current=!1}catch(re){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",re)}finally{v(!1)}},[ut,q]);m.useEffect(()=>{qe()},[qe]);const Qe=m.useCallback(re=>u.find(he=>he.name===re),[u]),{availableModels:We,fetchingModels:Ds,modelFetchError:as,matchedTemplate:ks,fetchModelsForProvider:Ee,clearModels:vs}=mS({getProviderConfig:Qe});m.useEffect(()=>{H&&C?.api_provider&&Ee(C.api_provider)},[H,C?.api_provider,Ee]);const ls=async()=>{await rs()},es=m.useCallback(()=>{if(!p)return;const re=new Set(l.map(gs=>gs.name)),he={...p},ss=Object.keys(he);for(const gs of ss){const cs=he[gs];cs&&cs.model_list&&(cs.model_list=cs.model_list.filter(Ct=>re.has(Ct)))}g(he),te([]),Te({title:"ๆธ…็†ๅฎŒๆˆ",description:"ๅทฒๅˆ ้™คๆ‰€ๆœ‰ๆ— ๆ•ˆ็š„ๆจกๅž‹ๅผ•็”จ"})},[p,l,Te]),Ns=re=>{const he={model_identifier:re.model_identifier,name:re.name,api_provider:re.api_provider,price_in:re.price_in??0,price_out:re.price_out??0,force_stream_mode:re.force_stream_mode??!1,extra_params:re.extra_params??{}};return re.temperature!=null&&(he.temperature=re.temperature),re.max_tokens!=null&&(he.max_tokens=re.max_tokens),he},pt=async()=>{try{w(!0),Ht();const re=await cn();re.models=l.map(Ns),re.model_task_config=p,await Fi(re),_(!1),Te({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆญฃๅœจ้‡ๅฏ้บฆ้บฆ..."}),await ls()}catch(re){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",re),Te({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:re.message,variant:"destructive"}),w(!1)}},Lt=async()=>{try{w(!0),Ht();const re=await cn();re.models=l.map(Ns),re.model_task_config=p,await Fi(re),_(!1),Te({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ๆจกๅž‹้…็ฝฎๅทฒไฟๅญ˜"}),await qe()}catch(re){console.error("ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ:",re),Te({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:re.message,variant:"destructive"})}finally{w(!1)}},tt=(re,he)=>{de({}),M(re||{model_identifier:"",name:"",api_provider:i[0]||"",price_in:0,price_out:0,temperature:null,max_tokens:null,force_stream_mode:!1,extra_params:{}}),O(he),E(!0)},Es=()=>{if(!C)return;const re={};if(C.name?.trim()||(re.name="่ฏท่พ“ๅ…ฅๆจกๅž‹ๅ็งฐ"),C.api_provider?.trim()||(re.api_provider="่ฏท้€‰ๆ‹ฉ API ๆไพ›ๅ•†"),C.model_identifier?.trim()||(re.model_identifier="่ฏท่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ"),Object.keys(re).length>0){de(re);return}de({});const he={model_identifier:C.model_identifier,name:C.name,api_provider:C.api_provider,price_in:C.price_in??0,price_out:C.price_out??0,force_stream_mode:C.force_stream_mode??!1,extra_params:C.extra_params??{}};C.temperature!=null&&(he.temperature=C.temperature),C.max_tokens!=null&&(he.max_tokens=C.max_tokens);let ss,gs=null;if(G!==null?(gs=l[G].name,ss=[...l],ss[G]=he):ss=[...l,he],n(ss),f(ss.map(cs=>cs.name)),gs&&gs!==he.name&&p){const cs=Ct=>Ct.map(Va=>Va===gs?he.name:Va);g({...p,utils:{...p.utils,model_list:cs(p.utils?.model_list||[])},tool_use:{...p.tool_use,model_list:cs(p.tool_use?.model_list||[])},replyer:{...p.replyer,model_list:cs(p.replyer?.model_list||[])},planner:{...p.planner,model_list:cs(p.planner?.model_list||[])},vlm:{...p.vlm,model_list:cs(p.vlm?.model_list||[])},voice:{...p.voice,model_list:cs(p.voice?.model_list||[])},embedding:{...p.embedding,model_list:cs(p.embedding?.model_list||[])},lpmm_entity_extract:{...p.lpmm_entity_extract,model_list:cs(p.lpmm_entity_extract?.model_list||[])},lpmm_rdf_build:{...p.lpmm_rdf_build,model_list:cs(p.lpmm_rdf_build?.model_list||[])}})}E(!1),M(null),O(null),Te({title:G!==null?"ๆจกๅž‹ๅทฒๆ›ดๆ–ฐ":"ๆจกๅž‹ๅทฒๆทปๅŠ ",description:'้…็ฝฎๅฐ†ๅœจ 2 ็ง’ๅŽ่‡ชๅŠจไฟๅญ˜๏ผŒๆˆ–็‚นๅ‡ปๅณไธŠ่ง’"ไฟๅญ˜้…็ฝฎ"ๆŒ‰้’ฎ็ซ‹ๅณไฟๅญ˜'})},kt=re=>{if(!re&&C){const he={...C,price_in:C.price_in??0,price_out:C.price_out??0};M(he)}E(re)},Ut=re=>{se(re),ce(!0)},Ea=()=>{if(ve!==null){const re=l.filter((he,ss)=>ss!==ve);n(re),f(re.map(he=>he.name)),q(p,re),Te({title:"ๅˆ ้™คๆˆๅŠŸ",description:'้…็ฝฎๅฐ†ๅœจ 2 ็ง’ๅŽ่‡ชๅŠจไฟๅญ˜๏ผŒๆˆ–็‚นๅ‡ปๅณไธŠ่ง’"ไฟๅญ˜้…็ฝฎ"ๆŒ‰้’ฎ็ซ‹ๅณไฟๅญ˜'})}ce(!1),se(null)},Za=re=>{const he=new Set(z);he.has(re)?he.delete(re):he.add(re),Q(he)},il=()=>{if(z.size===zt.length)Q(new Set);else{const re=zt.map((he,ss)=>l.findIndex(gs=>gs===zt[ss]));Q(new Set(re))}},Kn=()=>{if(z.size===0){Te({title:"ๆ็คบ",description:"่ฏทๅ…ˆ้€‰ๆ‹ฉ่ฆๅˆ ้™ค็š„ๆจกๅž‹",variant:"default"});return}L(!0)},Z=()=>{const re=z.size,he=l.filter((ss,gs)=>!z.has(gs));n(he),f(he.map(ss=>ss.name)),q(p,he),Q(new Set),L(!1),Te({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${re} ไธชๆจกๅž‹๏ผŒ้…็ฝฎๅฐ†ๅœจ 2 ็ง’ๅŽ่‡ชๅŠจไฟๅญ˜`})},ye=(re,he,ss)=>{if(!p)return;if(re==="embedding"&&he==="model_list"&&Array.isArray(ss)){const cs=oe.current,Ct=ss;if((cs.length!==Ct.length||cs.some(Ll=>!Ct.includes(Ll))||Ct.some(Ll=>!cs.includes(Ll)))&&cs.length>0){Ge.current={field:he,value:ss},X(!0);return}}const gs={...p,[re]:{...p[re],[he]:ss}};g(gs),q(gs,l),re==="embedding"&&he==="model_list"&&Array.isArray(ss)&&(oe.current=[...ss])},ze=()=>{if(!p||!Ge.current)return;const{field:re,value:he}=Ge.current,ss={...p,embedding:{...p.embedding,[re]:he}};g(ss),q(ss,l),re==="model_list"&&Array.isArray(he)&&(oe.current=[...he]),Ge.current=null,X(!1),Te({title:"ๅตŒๅ…ฅๆจกๅž‹ๅทฒๆ›ดๆ–ฐ",description:"ๅปบ่ฎฎ้‡ๆ–ฐ็”Ÿๆˆ็Ÿฅ่ฏ†ๅบ“ๅ‘้‡ไปฅ็กฎไฟๆœ€ไฝณๅŒน้…็ฒพๅบฆ"})},Hs=()=>{Ge.current=null,X(!1)},zt=l.filter(re=>{if(!ge)return!0;const he=ge.toLowerCase();return re.name.toLowerCase().includes(he)||re.model_identifier.toLowerCase().includes(he)||re.api_provider.toLowerCase().includes(he)}),Jt=Math.ceil(zt.length/je),rt=zt.slice(($-1)*je,$*je),Xt=()=>{const re=parseInt(K);re>=1&&re<=Jt&&(_e(re),U(""))},mt=re=>p?[p.utils?.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||[]].some(ss=>ss.includes(re)):!1;return N?e.jsx(Je,{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(Je,{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.jsx(tS,{trigger:e.jsxs(S,{variant:"outline",size:"sm",className:"flex-1 sm:flex-none",children:[e.jsx(Tj,{className:"mr-2 h-4 w-4"}),"ๅˆ†ไบซ้…็ฝฎ"]})}),e.jsxs(S,{onClick:Lt,disabled:y||b||!A||Rt,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(tc,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),y?"ไฟๅญ˜ไธญ...":b?"่‡ชๅŠจไฟๅญ˜ไธญ...":A?"ไฟๅญ˜้…็ฝฎ":"ๅทฒไฟๅญ˜"]}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsxs(S,{disabled:y||b||Rt,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[e.jsx(sc,{className:"mr-2 h-4 w-4"}),Rt?"้‡ๅฏไธญ...":A?"ไฟๅญ˜ๅนถ้‡ๅฏ":"้‡ๅฏ้บฆ้บฆ"]})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎค้‡ๅฏ้บฆ้บฆ๏ผŸ"}),e.jsx(hs,{asChild:!0,children:e.jsx("div",{children:e.jsx("p",{children:A?"ๅฝ“ๅ‰ๆœ‰ๆœชไฟๅญ˜็š„้…็ฝฎๆ›ดๆ”นใ€‚็‚นๅ‡ป็กฎ่ฎคๅฐ†ๅ…ˆไฟๅญ˜้…็ฝฎ,็„ถๅŽ้‡ๅฏ้บฆ้บฆไฝฟๆ–ฐ้…็ฝฎ็”Ÿๆ•ˆใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟใ€‚":"ๅณๅฐ†้‡ๅฏ้บฆ้บฆไธป็จ‹ๅบใ€‚้‡ๅฏ่ฟ‡็จ‹ไธญ้บฆ้บฆๅฐ†ๆš‚ๆ—ถ็ฆป็บฟ,้…็ฝฎๅฐ†ๅœจ้‡ๅฏๅŽ็”Ÿๆ•ˆใ€‚"})})})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:A?pt:ls,children:A?"ไฟๅญ˜ๅนถ้‡ๅฏ":"็กฎ่ฎค้‡ๅฏ"})]})]})]})]})]}),e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsxs(nt,{children:["้…็ฝฎๆ›ดๆ–ฐๅŽ้œ€่ฆ",e.jsx("strong",{children:"้‡ๅฏ้บฆ้บฆ"}),'ๆ‰่ƒฝ็”Ÿๆ•ˆใ€‚ไฝ ๅฏไปฅ็‚นๅ‡ปๅณไธŠ่ง’็š„"ไฟๅญ˜ๅนถ้‡ๅฏ"ๆŒ‰้’ฎไธ€้”ฎๅฎŒๆˆไฟๅญ˜ๅ’Œ้‡ๅฏใ€‚']})]}),Y.length>0&&e.jsxs(lt,{variant:"destructive",children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(nt,{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("strong",{children:"ๆฃ€ๆต‹ๅˆฐๆ— ๆ•ˆ็š„ๆจกๅž‹ๅผ•็”จ"}),e.jsx("div",{className:"mt-2 space-y-1",children:Y.map(({taskName:re,invalidModels:he})=>e.jsxs("div",{className:"text-sm",children:[e.jsx("strong",{children:re})," ๅผ•็”จไบ†ไธๅญ˜ๅœจ็š„ๆจกๅž‹: ",he.join(", ")]},re))})]}),e.jsx(S,{variant:"outline",size:"sm",className:"shrink-0 bg-background hover:bg-accent",onClick:es,children:"ไธ€้”ฎๆธ…็†"})]})]}),Oe.length>0&&e.jsxs(lt,{variant:"default",className:"border-yellow-500/50 bg-yellow-500/10",children:[e.jsx(Yt,{className:"h-4 w-4 text-yellow-600"}),e.jsxs(nt,{children:[e.jsx("strong",{className:"text-yellow-600",children:"ไปฅไธ‹ไปปๅŠกๆœช้…็ฝฎๆจกๅž‹"}),e.jsxs("div",{className:"mt-2 text-sm",children:[Oe.join("ใ€")," ่ฟ˜ๆœชๅˆ†้…ๆจกๅž‹๏ผŒ่ฟ™ไบ›ๅŠŸ่ƒฝๅฐ†ๆ— ๆณ•ๆญฃๅธธๅทฅไฝœใ€‚"]})]})]}),e.jsxs(lt,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:ta,children:[e.jsx(Kw,{className:"h-4 w-4 text-primary"}),e.jsxs(nt,{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"text-primary",children:"ๆ–ฐๆ‰‹ๅผ•ๅฏผ๏ผš"}),"ไธ็Ÿฅ้“ๅฆ‚ไฝ•้…็ฝฎๆจกๅž‹๏ผŸ็‚นๅ‡ป่ฟ™้‡Œๅผ€ๅง‹ๅญฆไน ๅฆ‚ไฝ•ไธบ้บฆ้บฆ็š„็ป„ไปถๅˆ†้…ๆจกๅž‹ใ€‚"]}),e.jsx(S,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"ๅผ€ๅง‹ๅผ•ๅฏผ"})]})]}),e.jsxs(ra,{defaultValue:"models",className:"w-full",children:[e.jsxs(ea,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[e.jsx(ts,{value:"models",children:"ๆทปๅŠ ๆจกๅž‹"}),e.jsx(ts,{value:"tasks","data-tour":"tasks-tab-trigger",children:"ไธบๆจกๅž‹ๅˆ†้…ๅŠŸ่ƒฝ"})]}),e.jsxs(bs,{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:[z.size>0&&e.jsxs(S,{onClick:Kn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"ๆ‰น้‡ๅˆ ้™ค (",z.size,")"]}),e.jsxs(S,{onClick:()=>tt(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[e.jsx(Zs,{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(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆจกๅž‹ๅ็งฐใ€ๆ ‡่ฏ†็ฌฆๆˆ–ๆไพ›ๅ•†...",value:ge,onChange:re=>fe(re.target.value),className:"pl-9"})]}),ge&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["ๆ‰พๅˆฐ ",zt.length," ไธช็ป“ๆžœ"]})]}),e.jsx(nS,{paginatedModels:rt,allModels:l,onEdit:tt,onDelete:Ut,isModelUsed:mt,searchQuery:ge}),e.jsx(rS,{paginatedModels:rt,allModels:l,filteredModels:zt,selectedModels:z,onEdit:tt,onDelete:Ut,onToggleSelection:Za,onToggleSelectAll:il,isModelUsed:mt,searchQuery:ge}),e.jsx(oS,{page:$,pageSize:je,totalItems:zt.length,jumpToPage:K,onPageChange:_e,onPageSizeChange:Se,onJumpToPageChange:U,onJumpToPage:Xt,onSelectionClear:()=>Q(new Set)})]}),e.jsxs(bs,{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(kl,{title:"็ป„ไปถๆจกๅž‹ (utils)",description:"็”จไบŽ่กจๆƒ…ๅŒ…ใ€ๅ–ๅใ€ๅ…ณ็ณปใ€ๆƒ…็ปชๅ˜ๅŒ–็ญ‰็ป„ไปถ",taskConfig:p.utils,modelNames:h,onChange:(re,he)=>ye("utils",re,he),dataTour:"task-model-select"}),e.jsx(kl,{title:"ๅทฅๅ…ท่ฐƒ็”จๆจกๅž‹ (tool_use)",description:"้œ€่ฆไฝฟ็”จๆ”ฏๆŒๅทฅๅ…ท่ฐƒ็”จ็š„ๆจกๅž‹",taskConfig:p.tool_use,modelNames:h,onChange:(re,he)=>ye("tool_use",re,he)}),e.jsx(kl,{title:"้ฆ–่ฆๅ›žๅคๆจกๅž‹ (replyer)",description:"็”จไบŽ่กจ่พพๅ™จๅ’Œ่กจ่พพๆ–นๅผๅญฆไน ",taskConfig:p.replyer,modelNames:h,onChange:(re,he)=>ye("replyer",re,he)}),e.jsx(kl,{title:"ๅ†ณ็ญ–ๆจกๅž‹ (planner)",description:"่ดŸ่ดฃๅ†ณๅฎš้บฆ้บฆ่ฏฅไป€ไนˆๆ—ถๅ€™ๅ›žๅค",taskConfig:p.planner,modelNames:h,onChange:(re,he)=>ye("planner",re,he)}),e.jsx(kl,{title:"ๅ›พๅƒ่ฏ†ๅˆซๆจกๅž‹ (vlm)",description:"่ง†่ง‰่ฏญ่จ€ๆจกๅž‹",taskConfig:p.vlm,modelNames:h,onChange:(re,he)=>ye("vlm",re,he),hideTemperature:!0}),e.jsx(kl,{title:"่ฏญ้Ÿณ่ฏ†ๅˆซๆจกๅž‹ (voice)",description:"่ฏญ้Ÿณ่ฝฌๆ–‡ๅญ—",taskConfig:p.voice,modelNames:h,onChange:(re,he)=>ye("voice",re,he),hideTemperature:!0,hideMaxTokens:!0}),e.jsx(kl,{title:"ๅตŒๅ…ฅๆจกๅž‹ (embedding)",description:"็”จไบŽๅ‘้‡ๅŒ–",taskConfig:p.embedding,modelNames:h,onChange:(re,he)=>ye("embedding",re,he),hideTemperature:!0,hideMaxTokens:!0}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM ็Ÿฅ่ฏ†ๅบ“ๆจกๅž‹"}),e.jsx(kl,{title:"ๅฎžไฝ“ๆๅ–ๆจกๅž‹ (lpmm_entity_extract)",description:"ไปŽๆ–‡ๆœฌไธญๆๅ–ๅฎžไฝ“",taskConfig:p.lpmm_entity_extract,modelNames:h,onChange:(re,he)=>ye("lpmm_entity_extract",re,he)}),e.jsx(kl,{title:"RDF ๆž„ๅปบๆจกๅž‹ (lpmm_rdf_build)",description:"ๆž„ๅปบ็Ÿฅ่ฏ†ๅ›พ่ฐฑ",taskConfig:p.lpmm_rdf_build,modelNames:h,onChange:(re,he)=>ye("lpmm_rdf_build",re,he)})]})]})]})]}),e.jsx(Ps,{open:H,onOpenChange:kt,children:e.jsxs(Us,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:Ga,children:[e.jsxs(Bs,{children:[e.jsx($s,{children:G!==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(T,{htmlFor:"model_name",className:Me.name?"text-destructive":"",children:"ๆจกๅž‹ๅ็งฐ *"}),e.jsx(ne,{id:"model_name",value:C?.name||"",onChange:re=>{M(he=>he?{...he,name:re.target.value}:null),Me.name&&de(he=>({...he,name:void 0}))},placeholder:"ไพ‹ๅฆ‚: qwen3-30b",className:Me.name?"border-destructive focus-visible:ring-destructive":""}),Me.name?e.jsx("p",{className:"text-xs text-destructive",children:Me.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(T,{htmlFor:"api_provider",className:Me.api_provider?"text-destructive":"",children:"API ๆไพ›ๅ•† *"}),e.jsxs(Be,{value:C?.api_provider||"",onValueChange:re=>{M(he=>he?{...he,api_provider:re}:null),vs(),Me.api_provider&&de(he=>({...he,api_provider:void 0}))},children:[e.jsx(Le,{id:"api_provider",className:Me.api_provider?"border-destructive focus-visible:ring-destructive":"",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๆไพ›ๅ•†"})}),e.jsx(Ue,{children:i.map(re=>e.jsx(W,{value:re,children:re},re))})]}),Me.api_provider&&e.jsx("p",{className:"text-xs text-destructive",children:Me.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(T,{htmlFor:"model_identifier",className:Me.model_identifier?"text-destructive":"",children:"ๆจกๅž‹ๆ ‡่ฏ†็ฌฆ *"}),ks?.modelFetcher&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{variant:"secondary",className:"text-xs",children:ks.display_name}),e.jsx(S,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>C?.api_provider&&Ee(C.api_provider,!0),disabled:Ds,children:Ds?e.jsx(Ls,{className:"h-3 w-3 animate-spin"}):e.jsx(ft,{className:"h-3 w-3"})})]})]}),ks?.modelFetcher?e.jsxs(nl,{open:V,onOpenChange:xe,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",role:"combobox","aria-expanded":V,className:"w-full justify-between font-normal",disabled:Ds||!!as,children:[Ds?e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Ls,{className:"h-4 w-4 animate-spin"}),"ๆญฃๅœจ่Žทๅ–ๆจกๅž‹ๅˆ—่กจ..."]}):as?e.jsx("span",{className:"text-muted-foreground text-sm",children:"็‚นๅ‡ปไธ‹ๆ–น่พ“ๅ…ฅๆก†ๆ‰‹ๅŠจๅกซๅ†™"}):C?.model_identifier?e.jsx("span",{className:"truncate",children:C.model_identifier}):e.jsx("span",{className:"text-muted-foreground",children:"ๆœ็ดขๆˆ–้€‰ๆ‹ฉๆจกๅž‹..."}),e.jsx(Vm,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ja,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:e.jsxs(Yo,{children:[e.jsx(Jo,{placeholder:"ๆœ็ดขๆจกๅž‹..."}),e.jsx(Je,{className:"h-[300px]",children:e.jsxs(Xo,{className:"max-h-none overflow-visible",children:[e.jsx(Zo,{children:as?e.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[e.jsx("p",{className:"text-sm text-destructive",children:as}),!as.includes("API Key")&&e.jsx(S,{variant:"link",size:"sm",onClick:()=>C?.api_provider&&Ee(C.api_provider,!0),children:"้‡่ฏ•"})]}):"ๆœชๆ‰พๅˆฐๅŒน้…็š„ๆจกๅž‹"}),e.jsx(Ji,{heading:"ๅฏ็”จๆจกๅž‹",children:We.map(re=>e.jsxs(Xi,{value:re.id,onSelect:()=>{M(he=>he?{...he,model_identifier:re.id}:null),xe(!1)},children:[e.jsx(_t,{className:`mr-2 h-4 w-4 ${C?.model_identifier===re.id?"opacity-100":"opacity-0"}`}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:re.id}),re.name!==re.id&&e.jsx("span",{className:"text-xs text-muted-foreground",children:re.name})]})]},re.id))}),e.jsx(Ji,{heading:"ๆ‰‹ๅŠจ่พ“ๅ…ฅ",children:e.jsxs(Xi,{value:"__manual_input__",onSelect:()=>{xe(!1)},children:[e.jsx($n,{className:"mr-2 h-4 w-4"}),"ๆ‰‹ๅŠจ่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ..."]})})]})})]})})]}):e.jsx(ne,{id:"model_identifier",value:C?.model_identifier||"",onChange:re=>{M(he=>he?{...he,model_identifier:re.target.value}:null),Me.model_identifier&&de(he=>({...he,model_identifier:void 0}))},placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507",className:Me.model_identifier?"border-destructive focus-visible:ring-destructive":""}),Me.model_identifier&&e.jsx("p",{className:"text-xs text-destructive",children:Me.model_identifier}),as&&ks?.modelFetcher&&!Me.model_identifier&&e.jsxs(lt,{variant:"destructive",className:"mt-2 py-2",children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(nt,{className:"text-xs",children:as})]}),ks?.modelFetcher&&e.jsx(ne,{value:C?.model_identifier||"",onChange:re=>{M(he=>he?{...he,model_identifier:re.target.value}:null),Me.model_identifier&&de(he=>({...he,model_identifier:void 0}))},placeholder:"ๆˆ–ๆ‰‹ๅŠจ่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ",className:`mt-2 ${Me.model_identifier?"border-destructive focus-visible:ring-destructive":""}`}),!Me.model_identifier&&e.jsx("p",{className:"text-xs text-muted-foreground",children:as?'่ฏทๆ‰‹ๅŠจ่พ“ๅ…ฅๆจกๅž‹ๆ ‡่ฏ†็ฌฆ๏ผŒๆˆ–ๅ‰ๅพ€"ๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ"ๆฃ€ๆŸฅ API Key':ks?.modelFetcher?`ๅทฒ่ฏ†ๅˆซไธบ ${ks.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(T,{htmlFor:"price_in",children:"่พ“ๅ…ฅไปทๆ ผ (ยฅ/M token)"}),e.jsx(ne,{id:"price_in",type:"number",step:"0.1",min:"0",value:C?.price_in??"",onChange:re=>{const he=re.target.value===""?null:parseFloat(re.target.value);M(ss=>ss?{...ss,price_in:he}:null)},placeholder:"้ป˜่ฎค: 0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(T,{htmlFor:"price_out",children:"่พ“ๅ‡บไปทๆ ผ (ยฅ/M token)"}),e.jsx(ne,{id:"price_out",type:"number",step:"0.1",min:"0",value:C?.price_out??"",onChange:re=>{const he=re.target.value===""?null:parseFloat(re.target.value);M(ss=>ss?{...ss,price_out:he}:null)},placeholder:"้ป˜่ฎค: 0"})]})]}),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("div",{className:"space-y-0.5",children:[e.jsx(T,{htmlFor:"enable_model_temperature",className:"cursor-pointer",children:"่‡ชๅฎšไน‰ๆจกๅž‹ๆธฉๅบฆ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฏ็”จๅŽๅฐ†่ฆ†็›–ใ€Œไธบๆจกๅž‹ๅˆ†้…ๅŠŸ่ƒฝใ€ไธญ็š„ไปปๅŠกๆธฉๅบฆ้…็ฝฎ"})]}),e.jsx(Fe,{id:"enable_model_temperature",checked:C?.temperature!=null,onCheckedChange:re=>{M(re?he=>he?{...he,temperature:.5}:null:he=>he?{...he,temperature:null}:null)}})]}),C?.temperature!=null&&e.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm",children:"ๆธฉๅบฆๅ€ผ"}),e.jsx("span",{className:"text-sm font-medium tabular-nums",children:C.temperature.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"0"}),e.jsx(_a,{value:[C.temperature],onValueChange:re=>M(he=>he?{...he,temperature:re[0]}:null),min:0,max:1,step:.1,className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่พƒไฝŽ็š„ๆธฉๅบฆ๏ผˆ0.1-0.3๏ผ‰ไบง็”Ÿๆ›ด็กฎๅฎš็š„่พ“ๅ‡บ๏ผŒ่พƒ้ซ˜็š„ๆธฉๅบฆ๏ผˆ0.7-1.0๏ผ‰ไบง็”Ÿๆ›ดๅคšๆ ทๅŒ–็š„่พ“ๅ‡บ"})]})]}),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("div",{className:"space-y-0.5",children:[e.jsx(T,{htmlFor:"enable_model_max_tokens",className:"cursor-pointer",children:"่‡ชๅฎšไน‰ๆœ€ๅคง Token"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๅฏ็”จๅŽๅฐ†่ฆ†็›–ใ€Œไธบๆจกๅž‹ๅˆ†้…ๅŠŸ่ƒฝใ€ไธญ็š„ไปปๅŠกๆœ€ๅคง Token ้…็ฝฎ"})]}),e.jsx(Fe,{id:"enable_model_max_tokens",checked:C?.max_tokens!=null,onCheckedChange:re=>{M(re?he=>he?{...he,max_tokens:2048}:null:he=>he?{...he,max_tokens:null}:null)}})]}),C?.max_tokens!=null&&e.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{className:"text-sm",children:"ๆœ€ๅคง Token ๆ•ฐ"}),e.jsx(ne,{type:"number",min:"1",max:"128000",value:C.max_tokens,onChange:re=>{const he=parseInt(re.target.value);!isNaN(he)&&he>=1&&M(ss=>ss?{...ss,max_tokens:he}:null)},className:"w-28 h-8 text-sm"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้™ๅˆถๆจกๅž‹ๅ•ๆฌก่พ“ๅ‡บ็š„ๆœ€ๅคง token ๆ•ฐ้‡๏ผŒไธๅŒๆจกๅž‹ๆ”ฏๆŒ็š„ไธŠ้™ไธๅŒ"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"force_stream_mode",checked:C?.force_stream_mode||!1,onCheckedChange:re=>M(he=>he?{...he,force_stream_mode:re}:null)}),e.jsx(T,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"ๅผบๅˆถๆตๅผ่พ“ๅ‡บๆจกๅผ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"้ขๅค–ๅ‚ๆ•ฐ"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(S,{type:"button",variant:"outline",size:"sm",className:"flex-1 justify-start h-9",onClick:()=>R(!0),children:[e.jsx(mn,{className:"h-4 w-4 mr-2"}),Object.keys(C?.extra_params||{}).length>0?e.jsxs("span",{children:["ๅทฒ้…็ฝฎ ",Object.keys(C?.extra_params||{}).length," ไธชๅ‚ๆ•ฐ"]}):e.jsx("span",{className:"text-muted-foreground",children:"ๆœช้…็ฝฎ้ขๅค–ๅ‚ๆ•ฐ"})]})}),Object.keys(C?.extra_params||{}).length>0&&e.jsxs("div",{className:"text-xs text-muted-foreground px-1",children:[Object.keys(C?.extra_params||{}).slice(0,3).map(re=>e.jsx("span",{className:"inline-block mr-2",children:e.jsx("code",{className:"px-1.5 py-0.5 bg-muted rounded",children:re})},re)),Object.keys(C?.extra_params||{}).length>3&&e.jsx("span",{children:"..."})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>E(!1),"data-tour":"model-cancel-button",children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:Es,"data-tour":"model-save-button",children:"ไฟๅญ˜"})]})]})}),e.jsx(js,{open:me,onOpenChange:ce,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คๆจกๅž‹ "',ve!==null?l[ve]?.name:"",'" ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Ea,children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:I,onOpenChange:L,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",z.size," ไธชๆจกๅž‹ๅ—๏ผŸ ๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๆ‰น้‡ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:Ae,onOpenChange:X,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsxs(xs,{className:"flex items-center gap-2",children:[e.jsx(Yt,{className:"h-5 w-5 text-amber-500"}),"ๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹่ญฆๅ‘Š"]}),e.jsx(hs,{asChild:!0,children:e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-foreground",children:"ๆณจๆ„๏ผš"}),"ๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹ๅฏ่ƒฝไผšๅฝฑๅ“็Ÿฅ่ฏ†ๅบ“็š„ๅŒน้…็ฒพๅบฆ๏ผ"]}),e.jsxs("ul",{className:"space-y-2 ml-4 list-disc text-muted-foreground",children:[e.jsx("li",{children:"ไธๅŒ็š„ๅตŒๅ…ฅๆจกๅž‹ไผšไบง็”ŸไธๅŒ็š„ๅ‘้‡่กจ็คบ"}),e.jsx("li",{children:"่ฟ™ๅฏ่ƒฝๅฏผ่‡ด็Žฐๆœ‰็Ÿฅ่ฏ†ๅบ“็š„ๆฃ€็ดข็ป“ๆžœไธๅ‡†็กฎ"}),e.jsx("li",{children:"ๅปบ่ฎฎๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹ๅŽ้‡ๆ–ฐ็”Ÿๆˆๆ‰€ๆœ‰็Ÿฅ่ฏ†ๅบ“็š„ๅ‘้‡"})]}),e.jsx("p",{className:"text-foreground font-medium",children:"็กฎๅฎš่ฆๆ›ดๆขๅตŒๅ…ฅๆจกๅž‹ๅ—๏ผŸ"})]})})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:Hs,children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:ze,className:"bg-amber-600 hover:bg-amber-700",children:"็กฎ่ฎคๆ›ดๆข"})]})]})}),e.jsx(q_,{open:ee,onOpenChange:R,value:C?.extra_params||{},onChange:re=>M(he=>he?{...he,extra_params:re}:null)}),e.jsx(qn,{})]})})}const Zi=Kg,Wi=I0,ec=P0,Wo="/api/webui/config";async function fS(){const n=await(await we(`${Wo}/adapter-config/path`)).json();return!n.success||!n.path?null:{path:n.path,lastModified:n.lastModified}}async function Ng(l){const i=await(await we(`${Wo}/adapter-config/path`,{method:"POST",headers:Fs(),body:JSON.stringify({path:l})})).json();if(!i.success)throw new Error(i.message||"ไฟๅญ˜่ทฏๅพ„ๅคฑ่ดฅ")}async function bg(l){const i=await(await we(`${Wo}/adapter-config?path=${encodeURIComponent(l)}`)).json();if(!i.success)throw new Error("่ฏปๅ–้…็ฝฎๆ–‡ไปถๅคฑ่ดฅ");return i.content}async function yg(l,n){const c=await(await we(`${Wo}/adapter-config`,{method:"POST",headers:Fs(),body:JSON.stringify({path:l,content:n})})).json();if(!c.success)throw new Error(c.message||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}const vt={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"}},Sm={oneclick:{name:"ไธ€้”ฎๅŒ…",description:"ไฝฟ็”จไธ€้”ฎๅŒ…้ƒจ็ฝฒ็š„้€‚้…ๅ™จ้…็ฝฎ",path:"../MaiBot-Napcat-Adapter/config.toml",icon:la},docker:{name:"Docker",description:"Docker Compose ้ƒจ็ฝฒ็š„้€‚้…ๅ™จ้…็ฝฎ",path:"/MaiMBot/adapters-config/config.toml",icon:Qw}};function pS(l,n){let i=l.slice(0,n).split(/\r\n|\n|\r/g);return[i.length,i.pop().length+1]}function gS(l,n,i){let c=l.split(/\r\n|\n|\r/g),u="",x=(Math.log10(n+1)|0)+1;for(let h=n-1;h<=n+1;h++){let f=c[h-1];f&&(u+=h.toString().padEnd(x," "),u+=": ",u+=f,u+=` `,h===n&&(u+=" ".repeat(x+i+2),u+=`^ `))}return u}class Ss extends Error{line;column;codeblock;constructor(n,i){const[c,u]=pS(i.toml,i.ptr),x=gS(i.toml,c,u);super(`Invalid TOML document: ${n} -${x}`,i),this.line=c,this.column=u,this.codeblock=x}}function jS(l,n){let i=0;for(;l[n-++i]==="\\";);return--i&&i%2}function Lo(l,n=0,i=l.length){let c=l.indexOf(` -`,n);return l[c-1]==="\r"&&c--,c<=i?c:-1}function Ym(l,n){for(let i=n;i-1&&i!=="'"&&jS(l,n));return n>-1&&(n+=c.length,c.length>1&&(l[n]===i&&n++,l[n]===i&&n++)),n}let vS=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;class Ur extends Date{#s=!1;#t=!1;#e=null;constructor(n){let i=!0,c=!0,u="Z";if(typeof n=="string"){let x=n.match(vS);x?(x[1]||(i=!1,n=`0000-01-01T${n}`),c=!!x[2],c&&n[10]===" "&&(n=n.replace(" ","T")),x[2]&&+x[2]>23?n="":(u=x[3]||null,n=n.toUpperCase(),!u&&c&&(n+="Z"))):n=""}super(n),isNaN(this.getTime())||(this.#s=i,this.#t=c,this.#e=u)}isDateTime(){return this.#s&&this.#t}isLocal(){return!this.#s||!this.#t||!this.#e}isDate(){return this.#s&&!this.#t}isTime(){return this.#t&&!this.#s}isValid(){return this.#s||this.#t}toISOString(){let n=super.toISOString();if(this.isDate())return n.slice(0,10);if(this.isTime())return n.slice(11,23);if(this.#e===null)return n.slice(0,-1);if(this.#e==="Z")return n;let i=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return i=this.#e[0]==="-"?i:-i,new Date(this.getTime()-i*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(n,i="Z"){let c=new Ur(n);return c.#e=i,c}static wrapAsLocalDateTime(n){let i=new Ur(n);return i.#e=null,i}static wrapAsLocalDate(n){let i=new Ur(n);return i.#t=!1,i.#e=null,i}static wrapAsLocalTime(n){let i=new Ur(n);return i.#s=!1,i.#e=null,i}}let NS=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,bS=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,yS=/^[+-]?0[0-9_]/,wS=/^[0-9a-f]{4,8}$/i,wg={b:"\b",t:" ",n:` +`))return x}}throw new Ss("cannot find end of structure",{toml:l,ptr:n})}function gv(l,n){let i=l[n],c=i===l[n+1]&&l[n+1]===l[n+2]?l.slice(n,n+3):i;n+=c.length-1;do n=l.indexOf(c,++n);while(n>-1&&i!=="'"&&jS(l,n));return n>-1&&(n+=c.length,c.length>1&&(l[n]===i&&n++,l[n]===i&&n++)),n}let vS=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;class Ur extends Date{#s=!1;#t=!1;#e=null;constructor(n){let i=!0,c=!0,u="Z";if(typeof n=="string"){let x=n.match(vS);x?(x[1]||(i=!1,n=`0000-01-01T${n}`),c=!!x[2],c&&n[10]===" "&&(n=n.replace(" ","T")),x[2]&&+x[2]>23?n="":(u=x[3]||null,n=n.toUpperCase(),!u&&c&&(n+="Z"))):n=""}super(n),isNaN(this.getTime())||(this.#s=i,this.#t=c,this.#e=u)}isDateTime(){return this.#s&&this.#t}isLocal(){return!this.#s||!this.#t||!this.#e}isDate(){return this.#s&&!this.#t}isTime(){return this.#t&&!this.#s}isValid(){return this.#s||this.#t}toISOString(){let n=super.toISOString();if(this.isDate())return n.slice(0,10);if(this.isTime())return n.slice(11,23);if(this.#e===null)return n.slice(0,-1);if(this.#e==="Z")return n;let i=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return i=this.#e[0]==="-"?i:-i,new Date(this.getTime()-i*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(n,i="Z"){let c=new Ur(n);return c.#e=i,c}static wrapAsLocalDateTime(n){let i=new Ur(n);return i.#e=null,i}static wrapAsLocalDate(n){let i=new Ur(n);return i.#t=!1,i.#e=null,i}static wrapAsLocalTime(n){let i=new Ur(n);return i.#s=!1,i.#e=null,i}}let NS=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,bS=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,yS=/^[+-]?0[0-9_]/,wS=/^[0-9a-f]{4,8}$/i,_g={b:"\b",t:" ",n:` `,f:"\f",r:"\r",'"':'"',"\\":"\\"};function jv(l,n=0,i=l.length){let c=l[n]==="'",u=l[n++]===l[n]&&l[n]===l[n+1];u&&(i-=2,l[n+=2]==="\r"&&n++,l[n]===` `&&n++);let x=0,h,f="",p=n;for(;n-1&&(Ym(l,x),u=u.slice(0,x));let h=u.trimEnd();if(!c){let f=u.indexOf(` -`,h.length);if(f>-1)throw new Ss("newlines are not allowed in inline tables",{toml:l,ptr:n+f})}return[h,x]}function Jm(l,n,i,c,u){if(c===0)throw new Ss("document contains excessively nested structures. aborting.",{toml:l,ptr:n});let x=l[n];if(x==="["||x==="{"){let[p,g]=x==="["?TS(l,n,c,u):CS(l,n,c,u),N=i?yg(l,g,",",i):g;if(g-N&&i==="}"){let v=Lo(l,g,N);if(v>-1)throw new Ss("newlines are not allowed in inline tables",{toml:l,ptr:v})}return[p,N]}let h;if(x==='"'||x==="'"){h=gv(l,n);let p=jv(l,n,h);if(i){if(h=Ml(l,h,i!=="]"),l[h]&&l[h]!==","&&l[h]!==i&&l[h]!==` -`&&l[h]!=="\r")throw new Ss("unexpected character encountered",{toml:l,ptr:h});h+=+(l[h]===",")}return[p,h]}h=yg(l,n,",",i);let f=SS(l,n,h-+(l[h-1]===","),i==="]");if(!f[0])throw new Ss("incomplete key-value declaration: no value specified",{toml:l,ptr:n});return i&&f[1]>-1&&(h=Ml(l,n+f[1]),h+=+(l[h]===",")),[_S(f[0],l,n,u),h]}let kS=/^[a-zA-Z0-9-_]+[ \t]*$/;function Um(l,n,i="="){let c=n-1,u=[],x=l.indexOf(i,n);if(x<0)throw new Ss("incomplete key-value: cannot find end of key",{toml:l,ptr:n});do{let h=l[n=++c];if(h!==" "&&h!==" ")if(h==='"'||h==="'"){if(h===l[n+1]&&h===l[n+2])throw new Ss("multiline strings are not allowed in keys",{toml:l,ptr:n});let f=gv(l,n);if(f<0)throw new Ss("unfinished string encountered",{toml:l,ptr:n});c=l.indexOf(".",f);let p=l.slice(f,c<0||c>x?x:c),g=Lo(p);if(g>-1)throw new Ss("newlines are not allowed in keys",{toml:l,ptr:n+c+g});if(p.trimStart())throw new Ss("found extra tokens after the string part",{toml:l,ptr:f});if(xx?x:c);if(!kS.test(f))throw new Ss("only letter, numbers, dashes and underscores are allowed in keys",{toml:l,ptr:n});u.push(f.trimEnd())}}while(c+1&&c-1&&(Jm(l,x),u=u.slice(0,x));let h=u.trimEnd();if(!c){let f=u.indexOf(` +`,h.length);if(f>-1)throw new Ss("newlines are not allowed in inline tables",{toml:l,ptr:n+f})}return[h,x]}function Xm(l,n,i,c,u){if(c===0)throw new Ss("document contains excessively nested structures. aborting.",{toml:l,ptr:n});let x=l[n];if(x==="["||x==="{"){let[p,g]=x==="["?TS(l,n,c,u):CS(l,n,c,u),N=i?wg(l,g,",",i):g;if(g-N&&i==="}"){let v=Uo(l,g,N);if(v>-1)throw new Ss("newlines are not allowed in inline tables",{toml:l,ptr:v})}return[p,N]}let h;if(x==='"'||x==="'"){h=gv(l,n);let p=jv(l,n,h);if(i){if(h=Ml(l,h,i!=="]"),l[h]&&l[h]!==","&&l[h]!==i&&l[h]!==` +`&&l[h]!=="\r")throw new Ss("unexpected character encountered",{toml:l,ptr:h});h+=+(l[h]===",")}return[p,h]}h=wg(l,n,",",i);let f=SS(l,n,h-+(l[h-1]===","),i==="]");if(!f[0])throw new Ss("incomplete key-value declaration: no value specified",{toml:l,ptr:n});return i&&f[1]>-1&&(h=Ml(l,n+f[1]),h+=+(l[h]===",")),[_S(f[0],l,n,u),h]}let kS=/^[a-zA-Z0-9-_]+[ \t]*$/;function Bm(l,n,i="="){let c=n-1,u=[],x=l.indexOf(i,n);if(x<0)throw new Ss("incomplete key-value: cannot find end of key",{toml:l,ptr:n});do{let h=l[n=++c];if(h!==" "&&h!==" ")if(h==='"'||h==="'"){if(h===l[n+1]&&h===l[n+2])throw new Ss("multiline strings are not allowed in keys",{toml:l,ptr:n});let f=gv(l,n);if(f<0)throw new Ss("unfinished string encountered",{toml:l,ptr:n});c=l.indexOf(".",f);let p=l.slice(f,c<0||c>x?x:c),g=Uo(p);if(g>-1)throw new Ss("newlines are not allowed in keys",{toml:l,ptr:n+c+g});if(p.trimStart())throw new Ss("found extra tokens after the string part",{toml:l,ptr:f});if(xx?x:c);if(!kS.test(f))throw new Ss("only letter, numbers, dashes and underscores are allowed in keys",{toml:l,ptr:n});u.push(f.trimEnd())}}while(c+1&&cu===""||u===null||u===void 0?x:u,i={inner:{version:n(l.inner.version,vt.inner.version)},nickname:{nickname:n(l.nickname.nickname,vt.nickname.nickname)},napcat_server:{host:n(l.napcat_server.host,vt.napcat_server.host),port:n(l.napcat_server.port||0,vt.napcat_server.port),token:n(l.napcat_server.token,vt.napcat_server.token),heartbeat_interval:n(l.napcat_server.heartbeat_interval||0,vt.napcat_server.heartbeat_interval)},maibot_server:{host:n(l.maibot_server.host,vt.maibot_server.host),port:n(l.maibot_server.port||0,vt.maibot_server.port)},chat:{group_list_type:n(l.chat.group_list_type,vt.chat.group_list_type),group_list:l.chat.group_list||[],private_list_type:n(l.chat.private_list_type,vt.chat.private_list_type),private_list:l.chat.private_list||[],ban_user_id:l.chat.ban_user_id||[],ban_qq_bot:l.chat.ban_qq_bot??vt.chat.ban_qq_bot,enable_poke:l.chat.enable_poke??vt.chat.enable_poke},voice:{use_tts:l.voice.use_tts??vt.voice.use_tts},debug:{level:n(l.debug.level,vt.debug.level)}};let c=DS(i);return c=OS(c),c}catch(n){throw console.error("TOML ็”Ÿๆˆๅคฑ่ดฅ:",n),new Error(`ๆ— ๆณ•็”Ÿๆˆ TOML ๆ–‡ไปถ: ${n instanceof Error?n.message:"ๆœช็Ÿฅ้”™่ฏฏ"}`)}}function OS(l){const n=l.split(` +`:c}function km(l){try{const n=vv(l);return{inner:{...vt.inner,...n.inner},nickname:{...vt.nickname,...n.nickname},napcat_server:{...vt.napcat_server,...n.napcat_server},maibot_server:{...vt.maibot_server,...n.maibot_server},chat:{...vt.chat,...n.chat},voice:{...vt.voice,...n.voice},debug:{...vt.debug,...n.debug}}}catch(n){throw console.error("TOML ่งฃๆžๅคฑ่ดฅ:",n),new Error(`ๆ— ๆณ•่งฃๆž TOML ๆ–‡ไปถ: ${n instanceof Error?n.message:"ๆœช็Ÿฅ้”™่ฏฏ"}`)}}function Cm(l){try{const n=(u,x)=>u===""||u===null||u===void 0?x:u,i={inner:{version:n(l.inner.version,vt.inner.version)},nickname:{nickname:n(l.nickname.nickname,vt.nickname.nickname)},napcat_server:{host:n(l.napcat_server.host,vt.napcat_server.host),port:n(l.napcat_server.port||0,vt.napcat_server.port),token:n(l.napcat_server.token,vt.napcat_server.token),heartbeat_interval:n(l.napcat_server.heartbeat_interval||0,vt.napcat_server.heartbeat_interval)},maibot_server:{host:n(l.maibot_server.host,vt.maibot_server.host),port:n(l.maibot_server.port||0,vt.maibot_server.port)},chat:{group_list_type:n(l.chat.group_list_type,vt.chat.group_list_type),group_list:l.chat.group_list||[],private_list_type:n(l.chat.private_list_type,vt.chat.private_list_type),private_list:l.chat.private_list||[],ban_user_id:l.chat.ban_user_id||[],ban_qq_bot:l.chat.ban_qq_bot??vt.chat.ban_qq_bot,enable_poke:l.chat.enable_poke??vt.chat.enable_poke},voice:{use_tts:l.voice.use_tts??vt.voice.use_tts},debug:{level:n(l.debug.level,vt.debug.level)}};let c=DS(i);return c=OS(c),c}catch(n){throw console.error("TOML ็”Ÿๆˆๅคฑ่ดฅ:",n),new Error(`ๆ— ๆณ•็”Ÿๆˆ TOML ๆ–‡ไปถ: ${n instanceof Error?n.message:"ๆœช็Ÿฅ้”™่ฏฏ"}`)}}function OS(l){const n=l.split(` `),i=[];for(let c=0;c"|?*\x00-\x1F]/.test(l)?{valid:!1,error:"่ทฏๅพ„ๅŒ…ๅซ้žๆณ•ๅญ—็ฌฆ"}:{valid:!0,error:""}}function RS(){const[l,n]=m.useState("upload"),[i,c]=m.useState(null),[u,x]=m.useState(""),[h,f]=m.useState(""),[p,g]=m.useState("oneclick"),[N,v]=m.useState(""),[y,w]=m.useState(!1),[b,D]=m.useState(!1),[A,_]=m.useState(!1),[P,E]=m.useState(!1),[C,M]=m.useState(null),[G,O]=m.useState(!1),ee=m.useRef(null),{toast:R}=st(),me=m.useRef(null),ce=V=>{if(f(V),V.trim()){const xe=Cm(V);v(xe.error)}else v("")},ve=m.useCallback(async V=>{const xe=_m[V];D(!0);try{const Ae=await Ng(xe.path),X=Sm(Ae);c(X),g(V),f(xe.path),await vg(xe.path),R({title:"ๅŠ ่ฝฝๆˆๅŠŸ",description:`ๅทฒไปŽ${xe.name}้ข„่ฎพๅŠ ่ฝฝ้…็ฝฎ`})}catch(Ae){console.error("ๅŠ ่ฝฝ้ข„่ฎพ้…็ฝฎๅคฑ่ดฅ:",Ae),R({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Ae instanceof Error?Ae.message:"ๆ— ๆณ•่ฏปๅ–้ข„่ฎพ้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}finally{D(!1)}},[R]),se=m.useCallback(async V=>{const xe=Cm(V);if(!xe.valid){v(xe.error),R({title:"่ทฏๅพ„ๆ— ๆ•ˆ",description:xe.error,variant:"destructive"});return}v(""),D(!0);try{const Ae=await Ng(V),X=Sm(Ae);c(X),f(V),await vg(V),R({title:"ๅŠ ่ฝฝๆˆๅŠŸ",description:"ๅทฒไปŽ้…็ฝฎๆ–‡ไปถๅŠ ่ฝฝ"})}catch(Ae){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",Ae),R({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Ae instanceof Error?Ae.message:"ๆ— ๆณ•่ฏปๅ–้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}finally{D(!1)}},[R]);m.useEffect(()=>{(async()=>{try{const xe=await fS();if(xe&&xe.path){f(xe.path);const Ae=Object.entries(_m).find(([,X])=>X.path===xe.path);Ae?(n("preset"),g(Ae[0]),await ve(Ae[0])):(n("path"),await se(xe.path))}}catch(xe){console.error("ๅŠ ่ฝฝไฟๅญ˜็š„่ทฏๅพ„ๅคฑ่ดฅ:",xe)}})()},[se,ve]);const ge=m.useCallback(V=>{l!=="path"&&l!=="preset"||!h||(me.current&&clearTimeout(me.current),me.current=setTimeout(async()=>{w(!0);try{const xe=km(V);await bg(h,xe),R({title:"่‡ชๅŠจไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜ๅˆฐๆ–‡ไปถ"})}catch(xe){console.error("่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ:",xe),R({title:"่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ",description:xe instanceof Error?xe.message:"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{w(!1)}},1e3))},[l,h,R]),fe=async()=>{if(!i||!h)return;const V=Cm(h);if(!V.valid){R({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:V.error,variant:"destructive"});return}w(!0);try{const xe=km(i);await bg(h,xe),R({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜ๅˆฐๆ–‡ไปถ"})}catch(xe){console.error("ไฟๅญ˜ๅคฑ่ดฅ:",xe),R({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:xe instanceof Error?xe.message:"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{w(!1)}},z=async()=>{h&&await se(h)},Q=V=>{if(V!==l){if(i){M(V),_(!0);return}$(V)}},$=V=>{c(null),x(""),v(""),n(V),V==="preset"&&ve("oneclick"),R({title:"ๅทฒๅˆ‡ๆขๆจกๅผ",description:{upload:"็ŽฐๅœจๅฏไปฅไธŠไผ ้…็ฝฎๆ–‡ไปถ",path:"็ŽฐๅœจๅฏไปฅๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„",preset:"็Žฐๅœจๅฏไปฅไฝฟ็”จ้ข„่ฎพ้…็ฝฎ"}[V]})},L=()=>{C&&($(C),M(null)),_(!1)},I=()=>{if(i){E(!0);return}_e()},_e=()=>{f(""),c(null),v(""),R({title:"ๅทฒๆธ…็ฉบ",description:"่ทฏๅพ„ๅ’Œ้…็ฝฎๅทฒๆธ…็ฉบ"})},je=()=>{_e(),E(!1)},Se=V=>{const xe=V.target.files?.[0];if(!xe)return;const Ae=new FileReader;Ae.onload=X=>{try{const oe=X.target?.result,Fe=Sm(oe);c(Fe),x(xe.name),R({title:"ไธŠไผ ๆˆๅŠŸ",description:`ๅทฒๅŠ ่ฝฝ้…็ฝฎๆ–‡ไปถ๏ผš${xe.name}`})}catch(oe){console.error("่งฃๆž้…็ฝฎๆ–‡ไปถๅคฑ่ดฅ:",oe),R({title:"่งฃๆžๅคฑ่ดฅ",description:"้…็ฝฎๆ–‡ไปถๆ ผๅผ้”™่ฏฏ๏ผŒ่ฏทๆฃ€ๆŸฅๆ–‡ไปถๅ†…ๅฎน",variant:"destructive"})}},Ae.readAsText(xe)},K=()=>{if(!i)return;const V=km(i),xe=new Blob([V],{type:"text/plain;charset=utf-8"}),Ae=URL.createObjectURL(xe),X=document.createElement("a");X.href=Ae,X.download=u||"config.toml",document.body.appendChild(X),X.click(),document.body.removeChild(X),URL.revokeObjectURL(Ae),R({title:"ไธ‹่ฝฝๆˆๅŠŸ",description:"้…็ฝฎๆ–‡ไปถๅทฒไธ‹่ฝฝ๏ผŒ่ฏทๆ‰‹ๅŠจ่ฆ†็›–ๅนถ้‡ๅฏ้€‚้…ๅ™จ"})},U=()=>{c(JSON.parse(JSON.stringify(vt))),x("config.toml"),R({title:"ๅทฒๅŠ ่ฝฝ้ป˜่ฎค้…็ฝฎ",description:"ๅฏไปฅๅผ€ๅง‹็ผ–่พ‘้…็ฝฎ"})};return e.jsx(Je,{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(St,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm",children:"้€‚้…ๅ™จ้…็ฝฎไฟๅญ˜ไน‹ๅŽไฝฟ็”จ WebUI ็š„้‡ๅฏๅŠŸ่ƒฝ้€‚้…ๅ™จๅนถไธไผš้‡ๅฏ๏ผŒ้œ€่ฆๆ‰‹ๅŠจ้‡ๅฏ้€‚้…ๅ™จใ€‚"})]}),e.jsx(Xi,{open:G,onOpenChange:O,children:e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(He,{children:"ๅทฅไฝœๆจกๅผ"}),e.jsx(As,{children:"้€‰ๆ‹ฉ้…็ฝฎๆ–‡ไปถ็š„็ฎก็†ๆ–นๅผ"})]}),e.jsx(Zi,{asChild:!0,children:e.jsxs(S,{variant:"ghost",size:"sm",className:"w-9 p-0",children:[e.jsx(Ta,{className:`h-4 w-4 transition-transform duration-200 ${G?"transform rotate-180":""}`}),e.jsx("span",{className:"sr-only",children:"ๅˆ‡ๆข"})]})})]})}),e.jsx(Wi,{children:e.jsxs(Re,{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 ${l==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Q("preset"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(aa,{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 ${l==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Q("upload"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(Ki,{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 ${l==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Q("path"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(Yw,{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:"ๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„๏ผŒ่‡ชๅŠจๅŠ ่ฝฝๅ’Œไฟๅญ˜"})]})]})})]}),l==="preset"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsx(T,{className:"text-sm md:text-base",children:"้€‰ๆ‹ฉ้ƒจ็ฝฒๆ–นๅผ"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(_m).map(([V,xe])=>{const Ae=xe.icon,X=p===V;return e.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${X?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{g(V),ve(V)},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ae,{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:xe.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:xe.description}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:xe.path})]})]})},V)})})]}),l==="path"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{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(ne,{id:"config-path",value:h,onChange:V=>ce(V.target.value),placeholder:"ไพ‹: C:\\Adapter\\config.toml",className:`text-sm ${N?"border-destructive":""}`}),N&&e.jsx("p",{className:"text-xs text-destructive",children:N})]}),e.jsx(S,{onClick:()=>se(h),disabled:b||!h||!!N,className:"w-full sm:w-auto",children:b?e.jsxs(e.Fragment,{children:[e.jsx(ft,{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(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(ct,{children:l==="preset"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"้ข„่ฎพๆจกๅผ๏ผš"}),"้€‰ๆ‹ฉ้ข„่ฎพ็š„้ƒจ็ฝฒๆ–นๅผ๏ผŒ้…็ฝฎไผš่‡ชๅŠจๅŠ ่ฝฝ๏ผŒไฟฎๆ”นๅŽ 1 ็ง’่‡ชๅŠจไฟๅญ˜",y&&" (ๆญฃๅœจไฟๅญ˜...)"]}):l==="upload"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"ไธŠไผ ๆ–‡ไปถๆจกๅผ๏ผš"}),"ไธŠไผ ้…็ฝฎๆ–‡ไปถ โ†’ ๅœจ็บฟ็ผ–่พ‘ โ†’ ไธ‹่ฝฝๆ–‡ไปถ โ†’ ๆ‰‹ๅŠจ่ฆ†็›–ๅนถ้‡ๅฏ้€‚้…ๅ™จ"]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"ๆŒ‡ๅฎš่ทฏๅพ„ๆจกๅผ๏ผš"}),"ๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„ๅŽ๏ผŒ้…็ฝฎไผš่‡ชๅŠจๅŠ ่ฝฝ๏ผŒไฟฎๆ”นๅŽ 1 ็ง’่‡ชๅŠจไฟๅญ˜",y&&" (ๆญฃๅœจไฟๅญ˜...)"]})})]}),l==="upload"&&!i&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsx("input",{ref:ee,type:"file",accept:".toml",className:"hidden",onChange:Se}),e.jsxs(S,{onClick:()=>ee.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Ki,{className:"mr-2 h-4 w-4"}),"ไธŠไผ ้…็ฝฎ"]}),e.jsxs(S,{onClick:U,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-2 h-4 w-4"}),"ไฝฟ็”จ้ป˜่ฎค้…็ฝฎ"]})]}),l==="upload"&&i&&e.jsx("div",{className:"flex gap-2",children:e.jsxs(S,{onClick:K,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Zt,{className:"mr-2 h-4 w-4"}),"ไธ‹่ฝฝ้…็ฝฎ"]})}),(l==="preset"||l==="path")&&i&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs(S,{onClick:fe,size:"sm",disabled:y||!!N,className:"w-full sm:w-auto",children:[e.jsx(sc,{className:"mr-2 h-4 w-4"}),y?"ไฟๅญ˜ไธญ...":"็ซ‹ๅณไฟๅญ˜"]}),e.jsxs(S,{onClick:z,size:"sm",variant:"outline",disabled:b,className:"w-full sm:w-auto",children:[e.jsx(ft,{className:`mr-2 h-4 w-4 ${b?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]}),l==="path"&&e.jsxs(S,{onClick:I,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4"}),"ๆธ…็ฉบ่ทฏๅพ„"]})]}),i?e.jsxs(ra,{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(Wt,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[e.jsxs(ts,{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(ts,{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(ts,{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(ts,{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(ts,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"่ฐƒ่ฏ•"})]})}),e.jsx(bs,{value:"napcat",className:"space-y-4",children:e.jsx(LS,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"maibot",className:"space-y-4",children:e.jsx(US,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"chat",className:"space-y-4",children:e.jsx(BS,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"voice",className:"space-y-4",children:e.jsx($S,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"debug",className:"space-y-4",children:e.jsx(IS,{config:i,onChange:V=>{c(V),ge(V)}})})]}):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(Sa,{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:l==="preset"?"่ฏท้€‰ๆ‹ฉ้ข„่ฎพ็š„้ƒจ็ฝฒๆ–นๅผ":l==="upload"?"่ฏทไธŠไผ ็Žฐๆœ‰้…็ฝฎๆ–‡ไปถ๏ผŒๆˆ–ไฝฟ็”จ้ป˜่ฎค้…็ฝฎๅผ€ๅง‹็ผ–่พ‘":"่ฏทๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„ๅนถ็‚นๅ‡ปๅŠ ่ฝฝๆŒ‰้’ฎ"})]})]})}),e.jsx(js,{open:A,onOpenChange:_,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ‡ๆขๆจกๅผ"}),e.jsxs(hs,{children:["ๅˆ‡ๆขๆจกๅผๅฐ†ๆธ…็ฉบๅฝ“ๅ‰้…็ฝฎ๏ผŒ็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ",e.jsx("br",{}),e.jsx("span",{className:"text-destructive font-medium",children:"่ฏท็กฎไฟๅทฒไฟๅญ˜้‡่ฆ้…็ฝฎ"})]})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:()=>{_(!1),M(null)},children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:L,children:"็กฎ่ฎคๅˆ‡ๆข"})]})]})}),e.jsx(js,{open:P,onOpenChange:E,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆธ…็ฉบ่ทฏๅพ„"}),e.jsxs(hs,{children:["ๆธ…็ฉบ่ทฏๅพ„ๅฐ†ๆธ…้™คๅฝ“ๅ‰้…็ฝฎ๏ผŒ็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ",e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"ๆญคๆ“ไฝœไธไผšๅˆ ้™ค้…็ฝฎๆ–‡ไปถ๏ผŒๅชๆ˜ฏๆธ…้™ค็•Œ้ขไธญ็š„้…็ฝฎ"})]})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:()=>E(!1),children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:je,className:"bg-destructive hover:bg-destructive/90",children:"็กฎ่ฎคๆธ…็ฉบ"})]})]})})]})})}function LS({config:l,onChange:n}){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(T,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"ไธปๆœบๅœฐๅ€"}),e.jsx(ne,{id:"napcat-host",value:l.napcat_server.host,onChange:i=>n({...l,napcat_server:{...l.napcat_server,host:i.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(T,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"็ซฏๅฃ"}),e.jsx(ne,{id:"napcat-port",type:"number",value:l.napcat_server.port||"",onChange:i=>n({...l,napcat_server:{...l.napcat_server,port:i.target.value?parseInt(i.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(T,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"่ฎฟ้—ฎไปค็‰Œ๏ผˆToken๏ผ‰"}),e.jsx(ne,{id:"napcat-token",type:"password",value:l.napcat_server.token,onChange:i=>n({...l,napcat_server:{...l.napcat_server,token:i.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(T,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"ๅฟƒ่ทณ้—ด้š”๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"napcat-heartbeat",type:"number",value:l.napcat_server.heartbeat_interval||"",onChange:i=>n({...l,napcat_server:{...l.napcat_server,heartbeat_interval:i.target.value?parseInt(i.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไธŽ Napcat ่ฎพ็ฝฎ็š„ๅฟƒ่ทณ้—ด้š”ไฟๆŒไธ€่‡ด๏ผˆ็•™็ฉบไฝฟ็”จ้ป˜่ฎคๅ€ผ 30๏ผ‰"})]})]})]})})}function US({config:l,onChange:n}){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(T,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"ไธปๆœบๅœฐๅ€"}),e.jsx(ne,{id:"maibot-host",value:l.maibot_server.host,onChange:i=>n({...l,maibot_server:{...l.maibot_server,host:i.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(T,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"็ซฏๅฃ"}),e.jsx(ne,{id:"maibot-port",type:"number",value:l.maibot_server.port||"",onChange:i=>n({...l,maibot_server:{...l.maibot_server,port:i.target.value?parseInt(i.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 BS({config:l,onChange:n}){const i=x=>{const h={...l};x==="group"?h.chat.group_list=[...h.chat.group_list,0]:x==="private"?h.chat.private_list=[...h.chat.private_list,0]:h.chat.ban_user_id=[...h.chat.ban_user_id,0],n(h)},c=(x,h)=>{const f={...l};x==="group"?f.chat.group_list=f.chat.group_list.filter((p,g)=>g!==h):x==="private"?f.chat.private_list=f.chat.private_list.filter((p,g)=>g!==h):f.chat.ban_user_id=f.chat.ban_user_id.filter((p,g)=>g!==h),n(f)},u=(x,h,f)=>{const p={...l};x==="group"?p.chat.group_list[h]=f:x==="private"?p.chat.private_list[h]=f:p.chat.ban_user_id[h]=f,n(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(T,{className:"text-sm md:text-base",children:"็พค็ป„ๅๅ•็ฑปๅž‹"}),e.jsxs(Be,{value:l.chat.group_list_type,onValueChange:x=>n({...l,chat:{...l.chat,group_list_type:x}}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"whitelist",children:"็™ฝๅๅ•๏ผˆไป…ๅๅ•ๅ†…ๅฏ่Šๅคฉ๏ผ‰"}),e.jsx(W,{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(T,{className:"text-sm md:text-base",children:"็พค็ป„ๅˆ—่กจ"}),e.jsxs(S,{onClick:()=>i("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-1 h-4 w-4"}),"ๆทปๅŠ ็พคๅท"]})]}),l.chat.group_list.map((x,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{type:"number",value:x,onChange:f=>u("group",h,parseInt(f.target.value)||0),placeholder:"่พ“ๅ…ฅ็พคๅท",className:"text-sm md:text-base"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค็พคๅท ",x," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>c("group",h),children:"ๅˆ ้™ค"})]})]})]})]},h)),l.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(T,{className:"text-sm md:text-base",children:"็ง่Šๅๅ•็ฑปๅž‹"}),e.jsxs(Be,{value:l.chat.private_list_type,onValueChange:x=>n({...l,chat:{...l.chat,private_list_type:x}}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"whitelist",children:"็™ฝๅๅ•๏ผˆไป…ๅๅ•ๅ†…ๅฏ่Šๅคฉ๏ผ‰"}),e.jsx(W,{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(T,{className:"text-sm md:text-base",children:"็ง่Šๅˆ—่กจ"}),e.jsxs(S,{onClick:()=>i("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-1 h-4 w-4"}),"ๆทปๅŠ ็”จๆˆท"]})]}),l.chat.private_list.map((x,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{type:"number",value:x,onChange:f=>u("private",h,parseInt(f.target.value)||0),placeholder:"่พ“ๅ…ฅQQๅท",className:"text-sm md:text-base"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค็”จๆˆท ",x," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>c("private",h),children:"ๅˆ ้™ค"})]})]})]})]},h)),l.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(T,{className:"text-sm md:text-base",children:"ๅ…จๅฑ€็ฆๆญขๅๅ•"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๅๅ•ไธญ็š„็”จๆˆทๆ— ๆณ•่ฟ›่กŒไปปไฝ•่Šๅคฉ"})]}),e.jsxs(S,{onClick:()=>i("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-1 h-4 w-4"}),"ๆทปๅŠ ็”จๆˆท"]})]}),l.chat.ban_user_id.map((x,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{type:"number",value:x,onChange:f=>u("ban",h,parseInt(f.target.value)||0),placeholder:"่พ“ๅ…ฅQQๅท",className:"text-sm md:text-base"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆไปŽๅ…จๅฑ€็ฆๆญขๅๅ•ไธญๅˆ ้™ค็”จๆˆท ",x," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>c("ban",h),children:"ๅˆ ้™ค"})]})]})]})]},h)),l.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(T,{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:l.chat.ban_qq_bot,onCheckedChange:x=>n({...l,chat:{...l.chat,ban_qq_bot:x}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-sm md:text-base",children:"ๅฏ็”จๆˆณไธ€ๆˆณๅŠŸ่ƒฝ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆ˜ฏๅฆๅ“ๅบ”ๆˆณไธ€ๆˆณๆถˆๆฏ"})]}),e.jsx(Ve,{checked:l.chat.enable_poke,onCheckedChange:x=>n({...l,chat:{...l.chat,enable_poke:x}})})]})]})]})})}function $S({config:l,onChange:n}){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(T,{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:l.voice.use_tts,onCheckedChange:i=>n({...l,voice:{use_tts:i}})})]})]})})}function IS({config:l,onChange:n}){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(T,{className:"text-sm md:text-base",children:"ๆ—ฅๅฟ—็ญ‰็บง"}),e.jsxs(Be,{value:l.debug.level,onValueChange:i=>n({...l,debug:{level:i}}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"DEBUG",children:"DEBUG๏ผˆ่ฐƒ่ฏ•๏ผ‰"}),e.jsx(W,{value:"INFO",children:"INFO๏ผˆไฟกๆฏ๏ผ‰"}),e.jsx(W,{value:"WARNING",children:"WARNING๏ผˆ่ญฆๅ‘Š๏ผ‰"}),e.jsx(W,{value:"ERROR",children:"ERROR๏ผˆ้”™่ฏฏ๏ผ‰"}),e.jsx(W,{value:"CRITICAL",children:"CRITICAL๏ผˆไธฅ้‡๏ผ‰"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฎพ็ฝฎ้€‚้…ๅ™จ็š„ๆ—ฅๅฟ—่พ“ๅ‡บ็ญ‰็บง"})]})})]})})}const PS=["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"],HS=/^(aria-|data-)/,bv=l=>Object.fromEntries(Object.entries(l).filter(([n])=>HS.test(n)||PS.includes(n)));function FS(l,n){const i=bv(l);return Object.keys(l).some(c=>!Object.hasOwn(i,c)&&l[c]!==n[c])}class GS extends m.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(n){if(n.uppy!==this.props.uppy)this.uninstallPlugin(n),this.installPlugin();else if(FS(this.props,n)){const{uppy:i,...c}={...this.props,target:this.container};this.plugin.setOptions(c)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:n,...i}={id:"Dashboard",...this.props,inline:!0,target:this.container};n.use(C1,i),this.plugin=n.getPlugin(i.id)}uninstallPlugin(n=this.props){const{uppy:i}=n;i.removePlugin(this.plugin)}render(){return m.createElement("div",{className:"uppy-Container",ref:n=>{this.container=n},...bv(this.props)})}}function VS({src:l,alt:n="่กจๆƒ…ๅŒ…",className:i,maxRetries:c=5,retryInterval:u=1500}){const[x,h]=m.useState("loading"),[f,p]=m.useState(0),[g,N]=m.useState(null),[v,y]=m.useState(l);l!==v&&(h("loading"),p(0),N(null),y(l));const w=m.useCallback(async()=>{try{const b=await fetch(l,{credentials:"include"});if(b.status===202){h("generating"),f{p(_=>_+1)},u):h("error");return}if(!b.ok){h("error");return}const D=await b.blob(),A=URL.createObjectURL(D);N(A),h("loaded")}catch(b){console.error("ๅŠ ่ฝฝ็ผฉ็•ฅๅ›พๅคฑ่ดฅ:",b),h("error")}},[l,f,c,u]);return m.useEffect(()=>{w()},[w]),m.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]),x==="loading"||x==="generating"?e.jsx(_s,{className:H("w-full h-full",i)}):x==="error"||!g?e.jsx("div",{className:H("w-full h-full flex items-center justify-center bg-muted",i),children:e.jsx(Tj,{className:"h-8 w-8 text-muted-foreground"})}):e.jsx("img",{src:g,alt:n,className:H("w-full h-full object-contain",i)})}function qS({children:l,className:n}){return e.jsx(Km,{content:l,className:n})}const Ha="/api/webui/emoji";async function KS(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.is_registered!==void 0&&n.append("is_registered",l.is_registered.toString()),l.is_banned!==void 0&&n.append("is_banned",l.is_banned.toString()),l.format&&n.append("format",l.format),l.sort_by&&n.append("sort_by",l.sort_by),l.sort_order&&n.append("sort_order",l.sort_order);const i=await we(`${Ha}/list?${n}`,{});if(!i.ok)throw new Error(`่Žทๅ–่กจๆƒ…ๅŒ…ๅˆ—่กจๅคฑ่ดฅ: ${i.statusText}`);return i.json()}async function QS(l){const n=await we(`${Ha}/${l}`,{});if(!n.ok)throw new Error(`่Žทๅ–่กจๆƒ…ๅŒ…่ฏฆๆƒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}async function YS(l,n){const i=await we(`${Ha}/${l}`,{method:"PATCH",body:JSON.stringify(n)});if(!i.ok)throw new Error(`ๆ›ดๆ–ฐ่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${i.statusText}`);return i.json()}async function JS(l){const n=await we(`${Ha}/${l}`,{method:"DELETE"});if(!n.ok)throw new Error(`ๅˆ ้™ค่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}async function XS(){const l=await we(`${Ha}/stats/summary`,{});if(!l.ok)throw new Error(`่Žทๅ–็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ: ${l.statusText}`);return l.json()}async function ZS(l){const n=await we(`${Ha}/${l}/register`,{method:"POST"});if(!n.ok)throw new Error(`ๆณจๅ†Œ่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}async function WS(l){const n=await we(`${Ha}/${l}/ban`,{method:"POST"});if(!n.ok)throw new Error(`ๅฐ็ฆ่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}function e4(l,n=!1){return n?`${Ha}/${l}/thumbnail?original=true`:`${Ha}/${l}/thumbnail`}function s4(l){return`${Ha}/${l}/thumbnail?original=true`}async function t4(l){const n=await we(`${Ha}/batch/delete`,{method:"POST",body:JSON.stringify({emoji_ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ")}return n.json()}function a4(){return`${Ha}/upload`}function l4(){const[l,n]=m.useState([]),[i,c]=m.useState(null),[u,x]=m.useState(!1),[h,f]=m.useState(1),[p,g]=m.useState(0),[N,v]=m.useState(20),[y,w]=m.useState("all"),[b,D]=m.useState("all"),[A,_]=m.useState("all"),[P,E]=m.useState("usage_count"),[C,M]=m.useState("desc"),[G,O]=m.useState(null),[ee,R]=m.useState(!1),[me,ce]=m.useState(!1),[ve,se]=m.useState(!1),[ge,fe]=m.useState(new Set),[z,Q]=m.useState(!1),[$,L]=m.useState(""),[I,_e]=m.useState("medium"),[je,Se]=m.useState(!1),{toast:K}=st(),U=m.useCallback(async()=>{try{x(!0);const de=await KS({page:h,page_size:N,is_registered:y==="all"?void 0:y==="registered",is_banned:b==="all"?void 0:b==="banned",format:A==="all"?void 0:A,sort_by:P,sort_order:C});n(de.data),g(de.total)}catch(de){const Te=de instanceof Error?de.message:"ๅŠ ่ฝฝ่กจๆƒ…ๅŒ…ๅˆ—่กจๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:Te,variant:"destructive"})}finally{x(!1)}},[h,N,y,b,A,P,C,K]),V=async()=>{try{const de=await XS();c(de.data)}catch(de){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",de)}};m.useEffect(()=>{U()},[U]),m.useEffect(()=>{V()},[]);const xe=async de=>{try{const Te=await QS(de.id);O(Te.data),R(!0)}catch(Te){const rs=Te instanceof Error?Te.message:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:rs,variant:"destructive"})}},Ae=de=>{O(de),ce(!0)},X=de=>{O(de),se(!0)},oe=async()=>{if(G)try{await JS(G.id),K({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ๅทฒๅˆ ้™ค"}),se(!1),O(null),U(),V()}catch(de){const Te=de instanceof Error?de.message:"ๅˆ ้™คๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:Te,variant:"destructive"})}},Fe=async de=>{try{await ZS(de.id),K({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ๅทฒๆณจๅ†Œ"}),U(),V()}catch(Te){const rs=Te instanceof Error?Te.message:"ๆณจๅ†Œๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:rs,variant:"destructive"})}},Y=async de=>{try{await WS(de.id),K({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ๅทฒๅฐ็ฆ"}),U(),V()}catch(Te){const rs=Te instanceof Error?Te.message:"ๅฐ็ฆๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:rs,variant:"destructive"})}},te=de=>{const Te=new Set(ge);Te.has(de)?Te.delete(de):Te.add(de),fe(Te)},Oe=async()=>{try{const de=await t4(Array.from(ge));K({title:"ๆ‰น้‡ๅˆ ้™คๅฎŒๆˆ",description:de.message}),fe(new Set),Q(!1),U(),V()}catch(de){K({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:de instanceof Error?de.message:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",variant:"destructive"})}},De=()=>{const de=parseInt($),Te=Math.ceil(p/N);de>=1&&de<=Te?(f(de),L("")):K({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${Te}ไน‹้—ด็š„้กต็ `,variant:"destructive"})},Me=i?.formats?Object.keys(i.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(S,{onClick:()=>Se(!0),className:"gap-2",children:[e.jsx(Ki,{className:"h-4 w-4"}),"ไธŠไผ ่กจๆƒ…ๅŒ…"]})]}),e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[i&&e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๆ€ปๆ•ฐ"}),e.jsx(He,{className:"text-2xl",children:i.total})]})}),e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๅทฒๆณจๅ†Œ"}),e.jsx(He,{className:"text-2xl text-green-600",children:i.registered})]})}),e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๅทฒๅฐ็ฆ"}),e.jsx(He,{className:"text-2xl text-red-600",children:i.banned})]})}),e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๆœชๆณจๅ†Œ"}),e.jsx(He,{className:"text-2xl text-gray-600",children:i.unregistered})]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsxs(He,{className:"flex items-center gap-2",children:[e.jsx(So,{className:"h-5 w-5"}),"็ญ›้€‰ๅ’ŒๆŽ’ๅบ"]})}),e.jsxs(Re,{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(T,{children:"ๆŽ’ๅบๆ–นๅผ"}),e.jsxs(Be,{value:`${P}-${C}`,onValueChange:de=>{const[Te,rs]=de.split("-");E(Te),M(rs),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"usage_count-desc",children:"ไฝฟ็”จๆฌกๆ•ฐ (ๅคšโ†’ๅฐ‘)"}),e.jsx(W,{value:"usage_count-asc",children:"ไฝฟ็”จๆฌกๆ•ฐ (ๅฐ‘โ†’ๅคš)"}),e.jsx(W,{value:"register_time-desc",children:"ๆณจๅ†Œๆ—ถ้—ด (ๆ–ฐโ†’ๆ—ง)"}),e.jsx(W,{value:"register_time-asc",children:"ๆณจๅ†Œๆ—ถ้—ด (ๆ—งโ†’ๆ–ฐ)"}),e.jsx(W,{value:"record_time-desc",children:"่ฎฐๅฝ•ๆ—ถ้—ด (ๆ–ฐโ†’ๆ—ง)"}),e.jsx(W,{value:"record_time-asc",children:"่ฎฐๅฝ•ๆ—ถ้—ด (ๆ—งโ†’ๆ–ฐ)"}),e.jsx(W,{value:"last_used_time-desc",children:"ๆœ€ๅŽไฝฟ็”จ (ๆ–ฐโ†’ๆ—ง)"}),e.jsx(W,{value:"last_used_time-asc",children:"ๆœ€ๅŽไฝฟ็”จ (ๆ—งโ†’ๆ–ฐ)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๆณจๅ†Œ็Šถๆ€"}),e.jsxs(Be,{value:y,onValueChange:de=>{w(de),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),e.jsx(W,{value:"registered",children:"ๅทฒๆณจๅ†Œ"}),e.jsx(W,{value:"unregistered",children:"ๆœชๆณจๅ†Œ"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๅฐ็ฆ็Šถๆ€"}),e.jsxs(Be,{value:b,onValueChange:de=>{D(de),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),e.jsx(W,{value:"banned",children:"ๅทฒๅฐ็ฆ"}),e.jsx(W,{value:"unbanned",children:"ๆœชๅฐ็ฆ"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๆ ผๅผ"}),e.jsxs(Be,{value:A,onValueChange:de=>{_(de),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),Me.map(de=>e.jsxs(W,{value:de,children:[de.toUpperCase()," (",i?.formats[de],")"]},de))]})]})]})]}),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:[ge.size>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๅทฒ้€‰ๆ‹ฉ ",ge.size," ไธช่กจๆƒ…ๅŒ…"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"text-sm whitespace-nowrap",children:"ๅก็‰‡ๅคงๅฐ"}),e.jsxs(Be,{value:I,onValueChange:de=>_e(de),children:[e.jsx(Le,{className:"w-24",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"small",children:"ๅฐ"}),e.jsx(W,{value:"medium",children:"ไธญ"}),e.jsx(W,{value:"large",children:"ๅคง"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:N.toString(),onValueChange:de=>{v(parseInt(de)),f(1),fe(new Set)},children:[e.jsx(Le,{id:"emoji-page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"40",children:"40"}),e.jsx(W,{value:"60",children:"60"}),e.jsx(W,{value:"100",children:"100"})]})]}),ge.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>fe(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:()=>Q(!0),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๆ‰น้‡ๅˆ ้™ค"]})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t",children:e.jsxs(S,{variant:"outline",size:"sm",onClick:U,disabled:u,children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]})})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่กจๆƒ…ๅŒ…ๅˆ—่กจ"}),e.jsxs(As,{children:["ๅ…ฑ ",p," ไธช่กจๆƒ…ๅŒ…๏ผŒๅฝ“ๅ‰็ฌฌ ",h," ้กต"]})]}),e.jsxs(Re,{children:[l.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):e.jsx("div",{className:`grid gap-3 ${I==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":I==="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:l.map(de=>e.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${ge.has(de.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>te(de.id),children:[e.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${ge.has(de.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 ${ge.has(de.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:ge.has(de.id)&&e.jsx(la,{className:"h-3 w-3"})})}),e.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[de.is_registered&&e.jsx(ke,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"ๅทฒๆณจๅ†Œ"}),de.is_banned&&e.jsx(ke,{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 ${I==="small"?"p-1":I==="medium"?"p-2":"p-3"}`,children:e.jsx(VS,{src:e4(de.id),alt:"่กจๆƒ…ๅŒ…"})}),e.jsxs("div",{className:`border-t bg-card ${I==="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(ke,{variant:"outline",className:"text-[10px] px-1 py-0",children:de.format.toUpperCase()}),e.jsxs("span",{className:"font-mono",children:[de.usage_count,"ๆฌก"]})]}),e.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${I==="small"?"flex-wrap":""}`,children:[e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Te=>{Te.stopPropagation(),Ae(de)},title:"็ผ–่พ‘",children:e.jsx(Hn,{className:"h-3 w-3"})}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Te=>{Te.stopPropagation(),xe(de)},title:"่ฏฆๆƒ…",children:e.jsx(Yt,{className:"h-3 w-3"})}),!de.is_registered&&e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:Te=>{Te.stopPropagation(),Fe(de)},title:"ๆณจๅ†Œ",children:e.jsx(la,{className:"h-3 w-3"})}),!de.is_banned&&e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:Te=>{Te.stopPropagation(),Y(de)},title:"ๅฐ็ฆ",children:e.jsx(Jw,{className:"h-3 w-3"})}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:Te=>{Te.stopPropagation(),X(de)},title:"ๅˆ ้™ค",children:e.jsx(ns,{className:"h-3 w-3"})})]})]})]},de.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:["ๆ˜พ็คบ ",(h-1)*N+1," ๅˆฐ"," ",Math.min(h*N,p)," ๆก๏ผŒๅ…ฑ ",p," ๆก"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(de=>Math.max(1,de-1)),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:$,onChange:de=>L(de.target.value),onKeyDown:de=>de.key==="Enter"&&De(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(p/N)}),e.jsx(S,{variant:"outline",size:"sm",onClick:De,disabled:!$,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(de=>de+1),disabled:h>=Math.ceil(p/N),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(p/N)),disabled:h>=Math.ceil(p/N),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(n4,{emoji:G,open:ee,onOpenChange:R}),e.jsx(r4,{emoji:G,open:me,onOpenChange:ce,onSuccess:()=>{U(),V()}}),e.jsx(i4,{open:je,onOpenChange:Se,onSuccess:()=>{U(),V()}})]})}),e.jsx(js,{open:z,onOpenChange:Q,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["ไฝ ็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",ge.size," ไธช่กจๆƒ…ๅŒ…ๅ—๏ผŸๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Oe,children:"็กฎ่ฎคๅˆ ้™ค"})]})]})}),e.jsx(Ps,{open:ve,onOpenChange:se,children:e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsx(Ys,{children:"็กฎๅฎš่ฆๅˆ ้™ค่ฟ™ไธช่กจๆƒ…ๅŒ…ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>se(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{variant:"destructive",onClick:oe,children:"ๅˆ ้™ค"})]})]})})]})}function n4({emoji:l,open:n,onOpenChange:i}){if(!l)return null;const c=u=>u?new Date(u*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(Bs,{children:e.jsx($s,{children:"่กจๆƒ…ๅŒ…่ฏฆๆƒ…"})}),e.jsx(Je,{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:s4(l.id),alt:l.description||"่กจๆƒ…ๅŒ…",className:"w-full h-full object-cover",onError:u=>{const x=u.target;x.style.display="none";const h=x.parentElement;h&&(h.innerHTML='')}})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ID"}),e.jsx("div",{className:"mt-1 font-mono",children:l.id})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆ ผๅผ"}),e.jsx("div",{className:"mt-1",children:e.jsx(ke,{variant:"outline",children:l.format.toUpperCase()})})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆ–‡ไปถ่ทฏๅพ„"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:l.full_path})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๅ“ˆๅธŒๅ€ผ"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:l.emoji_hash})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆ่ฟฐ"}),l.description?e.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:e.jsx(qS,{className:"prose-sm",children:l.description})}):e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆƒ…็ปช"}),e.jsx("div",{className:"mt-1",children:l.emotion?e.jsx("span",{className:"text-sm",children:l.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(T,{className:"text-muted-foreground",children:"็Šถๆ€"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[l.is_registered&&e.jsx(ke,{variant:"default",className:"bg-green-600",children:"ๅทฒๆณจๅ†Œ"}),l.is_banned&&e.jsx(ke,{variant:"destructive",children:"ๅทฒๅฐ็ฆ"}),!l.is_registered&&!l.is_banned&&e.jsx(ke,{variant:"outline",children:"ๆœชๆณจๅ†Œ"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ไฝฟ็”จๆฌกๆ•ฐ"}),e.jsx("div",{className:"mt-1 font-mono text-lg",children:l.usage_count})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"่ฎฐๅฝ•ๆ—ถ้—ด"}),e.jsx("div",{className:"mt-1 text-sm",children:c(l.record_time)})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆณจๅ†Œๆ—ถ้—ด"}),e.jsx("div",{className:"mt-1 text-sm",children:c(l.register_time)})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆœ€ๅŽไฝฟ็”จ"}),e.jsx("div",{className:"mt-1 text-sm",children:c(l.last_used_time)})]})]})})]})})}function r4({emoji:l,open:n,onOpenChange:i,onSuccess:c}){const[u,x]=m.useState(""),[h,f]=m.useState(!1),[p,g]=m.useState(!1),[N,v]=m.useState(!1),{toast:y}=st();m.useEffect(()=>{l&&(x(l.emotion||""),f(l.is_registered),g(l.is_banned))},[l]);const w=async()=>{if(l)try{v(!0);const b=u.split(/[,,]/).map(D=>D.trim()).filter(Boolean).join(",");await YS(l.id,{emotion:b||void 0,is_registered:h,is_banned:p}),y({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ไฟกๆฏๅทฒๆ›ดๆ–ฐ"}),i(!1),c()}catch(b){const D=b instanceof Error?b.message:"ไฟๅญ˜ๅคฑ่ดฅ";y({title:"้”™่ฏฏ",description:D,variant:"destructive"})}finally{v(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘่กจๆƒ…ๅŒ…"}),e.jsx(Ys,{children:"ไฟฎๆ”น่กจๆƒ…ๅŒ…็š„ๆƒ…็ปชๅ’Œ็Šถๆ€ไฟกๆฏ"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(T,{children:"ๆƒ…็ปช"}),e.jsx(at,{value:u,onChange:b=>x(b.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(Ws,{id:"is_registered",checked:h,onCheckedChange:b=>{b===!0?(f(!0),g(!1)):f(!1)}}),e.jsx(T,{htmlFor:"is_registered",className:"cursor-pointer",children:"ๅทฒๆณจๅ†Œ"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"is_banned",checked:p,onCheckedChange:b=>{b===!0?(g(!0),f(!1)):g(!1)}}),e.jsx(T,{htmlFor:"is_banned",className:"cursor-pointer",children:"ๅทฒๅฐ็ฆ"})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:w,disabled:N,children:N?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}function i4({open:l,onOpenChange:n,onSuccess:i}){const[c,u]=m.useState("select"),[x,h]=m.useState([]),[f,p]=m.useState(null),[g,N]=m.useState(!1),{toast:v}=st(),y=m.useMemo(()=>new T1({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}"}}}),[]);m.useEffect(()=>{const G=()=>{const O=y.getFiles();if(O.length===0)return;const ee=O.map(R=>({id:R.id,name:R.name,previewUrl:R.preview||URL.createObjectURL(R.data),emotion:"",description:"",isRegistered:!0,file:R.data}));h(ee),O.length===1?(p(ee[0].id),u("edit-single")):u("edit-multiple")};return y.on("upload",G),()=>{y.off("upload",G)}},[y]),m.useEffect(()=>{l||(y.cancelAll(),u("select"),h([]),p(null),N(!1))},[l,y]);const w=m.useCallback((G,O)=>{h(ee=>ee.map(R=>R.id===G?{...R,...O}:R))},[]),b=m.useCallback(G=>G.emotion.trim().length>0,[]),D=m.useMemo(()=>x.length>0&&x.every(b),[x,b]),A=m.useMemo(()=>x.find(G=>G.id===f)||null,[x,f]),_=m.useCallback(()=>{(c==="edit-single"||c==="edit-multiple")&&(u("select"),h([]),p(null))},[c]),P=m.useCallback(async()=>{if(!D){v({title:"่ฏทๅกซๅ†™ๅฟ…ๅกซ้กน",description:"ๆฏไธช่กจๆƒ…ๅŒ…็š„ๆƒ…ๆ„Ÿๆ ‡็ญพ้ƒฝๆ˜ฏๅฟ…ๅกซ็š„",variant:"destructive"});return}N(!0);let G=0,O=0;try{for(const ee of x){const R=new FormData;R.append("file",ee.file),R.append("emotion",ee.emotion),R.append("description",ee.description),R.append("is_registered",ee.isRegistered.toString());try{(await we(a4(),{method:"POST",body:R})).ok?G++:O++}catch{O++}}O===0?(v({title:"ไธŠไผ ๆˆๅŠŸ",description:`ๆˆๅŠŸไธŠไผ  ${G} ไธช่กจๆƒ…ๅŒ…`}),n(!1),i()):(v({title:"้ƒจๅˆ†ไธŠไผ ๅคฑ่ดฅ",description:`ๆˆๅŠŸ ${G} ไธช๏ผŒๅคฑ่ดฅ ${O} ไธช`,variant:"destructive"}),i())}finally{N(!1)}},[D,x,v,n,i]),E=()=>e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"border rounded-lg overflow-hidden w-full",children:e.jsx(GS,{uppy:y,proudlyDisplayPoweredByUppy:!1,hideProgressDetails:!0,height:350,width:"100%",theme:"auto",note:"ๆ”ฏๆŒ JPGใ€PNGใ€GIFใ€WebP ๆ ผๅผ๏ผŒๆœ€ๅคš 20 ไธชๆ–‡ไปถ"})})}),C=()=>{const G=x[0];return G?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(S,{variant:"ghost",size:"sm",onClick:_,children:[e.jsx(ka,{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:G.previewUrl,alt:G.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:G.name})]}),e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"single-emotion",children:["ๆƒ…ๆ„Ÿๆ ‡็ญพ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"single-emotion",value:G.emotion,onChange:O=>w(G.id,{emotion:O.target.value}),placeholder:"ๅคšไธชๆ ‡็ญพ็”จ้€—ๅทๅˆ†้š”๏ผŒๅฆ‚๏ผšๅผ€ๅฟƒ,้ซ˜ๅ…ด",className:G.emotion.trim()?"":"border-destructive"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"็”จไบŽๆƒ…ๆ„ŸๅŒน้…๏ผŒๅคšไธชๆ ‡็ญพ็”จ้€—ๅทๅˆ†้š”"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"single-description",children:"ๆ่ฟฐ"}),e.jsx(ne,{id:"single-description",value:G.description,onChange:O=>w(G.id,{description:O.target.value}),placeholder:"่พ“ๅ…ฅ่กจๆƒ…ๅŒ…ๆ่ฟฐ..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"single-is-registered",checked:G.isRegistered,onCheckedChange:O=>w(G.id,{isRegistered:O===!0})}),e.jsx(T,{htmlFor:"single-is-registered",className:"cursor-pointer",children:"ไธŠไผ ๅŽ็ซ‹ๅณๆณจๅ†Œ๏ผˆๅฏ่ขซ้บฆ้บฆไฝฟ็”จ๏ผ‰"})]})]})]}),e.jsx(et,{children:e.jsx(S,{onClick:P,disabled:!D||g,children:g?"ไธŠไผ ไธญ...":"ไธŠไผ "})})]}):null},M=()=>{const G=x.filter(b).length,O=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(S,{variant:"ghost",size:"sm",onClick:_,children:[e.jsx(ka,{className:"h-4 w-4 mr-1"}),"่ฟ”ๅ›ž"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["็ผ–่พ‘่กจๆƒ…ๅŒ…ไฟกๆฏ๏ผˆ",G,"/",O," ๅทฒๅฎŒๆˆ๏ผ‰"]})]}),e.jsx(ke,{variant:D?"default":"secondary",children:D?e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"h-3 w-3 mr-1"}),"ๅ…จ้ƒจๅฎŒๆˆ"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ca,{className:"h-3 w-3 mr-1"}),"ๆœชๅฎŒๆˆ"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Je,{className:"h-[350px] pr-2",children:e.jsx("div",{className:"space-y-2",children:x.map(ee=>{const R=b(ee),me=f===ee.id;return e.jsxs("div",{onClick:()=>p(ee.id),className:` +`)}function Tm(l){if(!l.trim())return{valid:!1,error:"่ทฏๅพ„ไธ่ƒฝไธบ็ฉบ"};if(!l.toLowerCase().endsWith(".toml"))return{valid:!1,error:"ๆ–‡ไปถๅฟ…้กปๆ˜ฏ .toml ๆ ผๅผ"};const n=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,i=/^(\/|~\/).+\.toml$/i,c=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,u=n.test(l),x=i.test(l),h=c.test(l);return!u&&!x&&!h?{valid:!1,error:"่ทฏๅพ„ๆ ผๅผ้”™่ฏฏ"}:/[<>"|?*\x00-\x1F]/.test(l)?{valid:!1,error:"่ทฏๅพ„ๅŒ…ๅซ้žๆณ•ๅญ—็ฌฆ"}:{valid:!0,error:""}}function RS(){const[l,n]=m.useState("upload"),[i,c]=m.useState(null),[u,x]=m.useState(""),[h,f]=m.useState(""),[p,g]=m.useState("oneclick"),[N,v]=m.useState(""),[y,w]=m.useState(!1),[b,D]=m.useState(!1),[A,_]=m.useState(!1),[H,E]=m.useState(!1),[C,M]=m.useState(null),[G,O]=m.useState(!1),ee=m.useRef(null),{toast:R}=st(),me=m.useRef(null),ce=V=>{if(f(V),V.trim()){const xe=Tm(V);v(xe.error)}else v("")},ve=m.useCallback(async V=>{const xe=Sm[V];D(!0);try{const Ae=await bg(xe.path),X=km(Ae);c(X),g(V),f(xe.path),await Ng(xe.path),R({title:"ๅŠ ่ฝฝๆˆๅŠŸ",description:`ๅทฒไปŽ${xe.name}้ข„่ฎพๅŠ ่ฝฝ้…็ฝฎ`})}catch(Ae){console.error("ๅŠ ่ฝฝ้ข„่ฎพ้…็ฝฎๅคฑ่ดฅ:",Ae),R({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Ae instanceof Error?Ae.message:"ๆ— ๆณ•่ฏปๅ–้ข„่ฎพ้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}finally{D(!1)}},[R]),se=m.useCallback(async V=>{const xe=Tm(V);if(!xe.valid){v(xe.error),R({title:"่ทฏๅพ„ๆ— ๆ•ˆ",description:xe.error,variant:"destructive"});return}v(""),D(!0);try{const Ae=await bg(V),X=km(Ae);c(X),f(V),await Ng(V),R({title:"ๅŠ ่ฝฝๆˆๅŠŸ",description:"ๅทฒไปŽ้…็ฝฎๆ–‡ไปถๅŠ ่ฝฝ"})}catch(Ae){console.error("ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ:",Ae),R({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Ae instanceof Error?Ae.message:"ๆ— ๆณ•่ฏปๅ–้…็ฝฎๆ–‡ไปถ",variant:"destructive"})}finally{D(!1)}},[R]);m.useEffect(()=>{(async()=>{try{const xe=await fS();if(xe&&xe.path){f(xe.path);const Ae=Object.entries(Sm).find(([,X])=>X.path===xe.path);Ae?(n("preset"),g(Ae[0]),await ve(Ae[0])):(n("path"),await se(xe.path))}}catch(xe){console.error("ๅŠ ่ฝฝไฟๅญ˜็š„่ทฏๅพ„ๅคฑ่ดฅ:",xe)}})()},[se,ve]);const ge=m.useCallback(V=>{l!=="path"&&l!=="preset"||!h||(me.current&&clearTimeout(me.current),me.current=setTimeout(async()=>{w(!0);try{const xe=Cm(V);await yg(h,xe),R({title:"่‡ชๅŠจไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜ๅˆฐๆ–‡ไปถ"})}catch(xe){console.error("่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ:",xe),R({title:"่‡ชๅŠจไฟๅญ˜ๅคฑ่ดฅ",description:xe instanceof Error?xe.message:"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{w(!1)}},1e3))},[l,h,R]),fe=async()=>{if(!i||!h)return;const V=Tm(h);if(!V.valid){R({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:V.error,variant:"destructive"});return}w(!0);try{const xe=Cm(i);await yg(h,xe),R({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้…็ฝฎๅทฒไฟๅญ˜ๅˆฐๆ–‡ไปถ"})}catch(xe){console.error("ไฟๅญ˜ๅคฑ่ดฅ:",xe),R({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:xe instanceof Error?xe.message:"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{w(!1)}},z=async()=>{h&&await se(h)},Q=V=>{if(V!==l){if(i){M(V),_(!0);return}I(V)}},I=V=>{c(null),x(""),v(""),n(V),V==="preset"&&ve("oneclick"),R({title:"ๅทฒๅˆ‡ๆขๆจกๅผ",description:{upload:"็ŽฐๅœจๅฏไปฅไธŠไผ ้…็ฝฎๆ–‡ไปถ",path:"็ŽฐๅœจๅฏไปฅๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„",preset:"็Žฐๅœจๅฏไปฅไฝฟ็”จ้ข„่ฎพ้…็ฝฎ"}[V]})},L=()=>{C&&(I(C),M(null)),_(!1)},$=()=>{if(i){E(!0);return}_e()},_e=()=>{f(""),c(null),v(""),R({title:"ๅทฒๆธ…็ฉบ",description:"่ทฏๅพ„ๅ’Œ้…็ฝฎๅทฒๆธ…็ฉบ"})},je=()=>{_e(),E(!1)},Se=V=>{const xe=V.target.files?.[0];if(!xe)return;const Ae=new FileReader;Ae.onload=X=>{try{const oe=X.target?.result,Ge=km(oe);c(Ge),x(xe.name),R({title:"ไธŠไผ ๆˆๅŠŸ",description:`ๅทฒๅŠ ่ฝฝ้…็ฝฎๆ–‡ไปถ๏ผš${xe.name}`})}catch(oe){console.error("่งฃๆž้…็ฝฎๆ–‡ไปถๅคฑ่ดฅ:",oe),R({title:"่งฃๆžๅคฑ่ดฅ",description:"้…็ฝฎๆ–‡ไปถๆ ผๅผ้”™่ฏฏ๏ผŒ่ฏทๆฃ€ๆŸฅๆ–‡ไปถๅ†…ๅฎน",variant:"destructive"})}},Ae.readAsText(xe)},K=()=>{if(!i)return;const V=Cm(i),xe=new Blob([V],{type:"text/plain;charset=utf-8"}),Ae=URL.createObjectURL(xe),X=document.createElement("a");X.href=Ae,X.download=u||"config.toml",document.body.appendChild(X),X.click(),document.body.removeChild(X),URL.revokeObjectURL(Ae),R({title:"ไธ‹่ฝฝๆˆๅŠŸ",description:"้…็ฝฎๆ–‡ไปถๅทฒไธ‹่ฝฝ๏ผŒ่ฏทๆ‰‹ๅŠจ่ฆ†็›–ๅนถ้‡ๅฏ้€‚้…ๅ™จ"})},U=()=>{c(JSON.parse(JSON.stringify(vt))),x("config.toml"),R({title:"ๅทฒๅŠ ่ฝฝ้ป˜่ฎค้…็ฝฎ",description:"ๅฏไปฅๅผ€ๅง‹็ผ–่พ‘้…็ฝฎ"})};return e.jsx(Je,{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(St,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm",children:"้€‚้…ๅ™จ้…็ฝฎไฟๅญ˜ไน‹ๅŽไฝฟ็”จ WebUI ็š„้‡ๅฏๅŠŸ่ƒฝ้€‚้…ๅ™จๅนถไธไผš้‡ๅฏ๏ผŒ้œ€่ฆๆ‰‹ๅŠจ้‡ๅฏ้€‚้…ๅ™จใ€‚"})]}),e.jsx(Zi,{open:G,onOpenChange:O,children:e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(He,{children:"ๅทฅไฝœๆจกๅผ"}),e.jsx(As,{children:"้€‰ๆ‹ฉ้…็ฝฎๆ–‡ไปถ็š„็ฎก็†ๆ–นๅผ"})]}),e.jsx(Wi,{asChild:!0,children:e.jsxs(S,{variant:"ghost",size:"sm",className:"w-9 p-0",children:[e.jsx(Ta,{className:`h-4 w-4 transition-transform duration-200 ${G?"transform rotate-180":""}`}),e.jsx("span",{className:"sr-only",children:"ๅˆ‡ๆข"})]})})]})}),e.jsx(ec,{children:e.jsxs(Re,{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 ${l==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Q("preset"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(la,{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 ${l==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Q("upload"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(Qi,{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 ${l==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Q("path"),children:e.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[e.jsx(Yw,{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:"ๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„๏ผŒ่‡ชๅŠจๅŠ ่ฝฝๅ’Œไฟๅญ˜"})]})]})})]}),l==="preset"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsx(T,{className:"text-sm md:text-base",children:"้€‰ๆ‹ฉ้ƒจ็ฝฒๆ–นๅผ"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(Sm).map(([V,xe])=>{const Ae=xe.icon,X=p===V;return e.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${X?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{g(V),ve(V)},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ae,{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:xe.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:xe.description}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:xe.path})]})]})},V)})})]}),l==="path"&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{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(ne,{id:"config-path",value:h,onChange:V=>ce(V.target.value),placeholder:"ไพ‹: C:\\Adapter\\config.toml",className:`text-sm ${N?"border-destructive":""}`}),N&&e.jsx("p",{className:"text-xs text-destructive",children:N})]}),e.jsx(S,{onClick:()=>se(h),disabled:b||!h||!!N,className:"w-full sm:w-auto",children:b?e.jsxs(e.Fragment,{children:[e.jsx(ft,{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(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(nt,{children:l==="preset"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"้ข„่ฎพๆจกๅผ๏ผš"}),"้€‰ๆ‹ฉ้ข„่ฎพ็š„้ƒจ็ฝฒๆ–นๅผ๏ผŒ้…็ฝฎไผš่‡ชๅŠจๅŠ ่ฝฝ๏ผŒไฟฎๆ”นๅŽ 1 ็ง’่‡ชๅŠจไฟๅญ˜",y&&" (ๆญฃๅœจไฟๅญ˜...)"]}):l==="upload"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"ไธŠไผ ๆ–‡ไปถๆจกๅผ๏ผš"}),"ไธŠไผ ้…็ฝฎๆ–‡ไปถ โ†’ ๅœจ็บฟ็ผ–่พ‘ โ†’ ไธ‹่ฝฝๆ–‡ไปถ โ†’ ๆ‰‹ๅŠจ่ฆ†็›–ๅนถ้‡ๅฏ้€‚้…ๅ™จ"]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"ๆŒ‡ๅฎš่ทฏๅพ„ๆจกๅผ๏ผš"}),"ๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„ๅŽ๏ผŒ้…็ฝฎไผš่‡ชๅŠจๅŠ ่ฝฝ๏ผŒไฟฎๆ”นๅŽ 1 ็ง’่‡ชๅŠจไฟๅญ˜",y&&" (ๆญฃๅœจไฟๅญ˜...)"]})})]}),l==="upload"&&!i&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[e.jsx("input",{ref:ee,type:"file",accept:".toml",className:"hidden",onChange:Se}),e.jsxs(S,{onClick:()=>ee.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Qi,{className:"mr-2 h-4 w-4"}),"ไธŠไผ ้…็ฝฎ"]}),e.jsxs(S,{onClick:U,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-2 h-4 w-4"}),"ไฝฟ็”จ้ป˜่ฎค้…็ฝฎ"]})]}),l==="upload"&&i&&e.jsx("div",{className:"flex gap-2",children:e.jsxs(S,{onClick:K,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(Zt,{className:"mr-2 h-4 w-4"}),"ไธ‹่ฝฝ้…็ฝฎ"]})}),(l==="preset"||l==="path")&&i&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs(S,{onClick:fe,size:"sm",disabled:y||!!N,className:"w-full sm:w-auto",children:[e.jsx(tc,{className:"mr-2 h-4 w-4"}),y?"ไฟๅญ˜ไธญ...":"็ซ‹ๅณไฟๅญ˜"]}),e.jsxs(S,{onClick:z,size:"sm",variant:"outline",disabled:b,className:"w-full sm:w-auto",children:[e.jsx(ft,{className:`mr-2 h-4 w-4 ${b?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]}),l==="path"&&e.jsxs(S,{onClick:$,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ns,{className:"mr-2 h-4 w-4"}),"ๆธ…็ฉบ่ทฏๅพ„"]})]}),i?e.jsxs(ra,{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(ea,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[e.jsxs(ts,{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(ts,{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(ts,{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(ts,{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(ts,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"่ฐƒ่ฏ•"})]})}),e.jsx(bs,{value:"napcat",className:"space-y-4",children:e.jsx(LS,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"maibot",className:"space-y-4",children:e.jsx(US,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"chat",className:"space-y-4",children:e.jsx(BS,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"voice",className:"space-y-4",children:e.jsx($S,{config:i,onChange:V=>{c(V),ge(V)}})}),e.jsx(bs,{value:"debug",className:"space-y-4",children:e.jsx(IS,{config:i,onChange:V=>{c(V),ge(V)}})})]}):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(Sa,{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:l==="preset"?"่ฏท้€‰ๆ‹ฉ้ข„่ฎพ็š„้ƒจ็ฝฒๆ–นๅผ":l==="upload"?"่ฏทไธŠไผ ็Žฐๆœ‰้…็ฝฎๆ–‡ไปถ๏ผŒๆˆ–ไฝฟ็”จ้ป˜่ฎค้…็ฝฎๅผ€ๅง‹็ผ–่พ‘":"่ฏทๆŒ‡ๅฎš้…็ฝฎๆ–‡ไปถ่ทฏๅพ„ๅนถ็‚นๅ‡ปๅŠ ่ฝฝๆŒ‰้’ฎ"})]})]})}),e.jsx(js,{open:A,onOpenChange:_,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ‡ๆขๆจกๅผ"}),e.jsxs(hs,{children:["ๅˆ‡ๆขๆจกๅผๅฐ†ๆธ…็ฉบๅฝ“ๅ‰้…็ฝฎ๏ผŒ็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ",e.jsx("br",{}),e.jsx("span",{className:"text-destructive font-medium",children:"่ฏท็กฎไฟๅทฒไฟๅญ˜้‡่ฆ้…็ฝฎ"})]})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:()=>{_(!1),M(null)},children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:L,children:"็กฎ่ฎคๅˆ‡ๆข"})]})]})}),e.jsx(js,{open:H,onOpenChange:E,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆธ…็ฉบ่ทฏๅพ„"}),e.jsxs(hs,{children:["ๆธ…็ฉบ่ทฏๅพ„ๅฐ†ๆธ…้™คๅฝ“ๅ‰้…็ฝฎ๏ผŒ็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ",e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"ๆญคๆ“ไฝœไธไผšๅˆ ้™ค้…็ฝฎๆ–‡ไปถ๏ผŒๅชๆ˜ฏๆธ…้™ค็•Œ้ขไธญ็š„้…็ฝฎ"})]})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:()=>E(!1),children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:je,className:"bg-destructive hover:bg-destructive/90",children:"็กฎ่ฎคๆธ…็ฉบ"})]})]})})]})})}function LS({config:l,onChange:n}){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(T,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"ไธปๆœบๅœฐๅ€"}),e.jsx(ne,{id:"napcat-host",value:l.napcat_server.host,onChange:i=>n({...l,napcat_server:{...l.napcat_server,host:i.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(T,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"็ซฏๅฃ"}),e.jsx(ne,{id:"napcat-port",type:"number",value:l.napcat_server.port||"",onChange:i=>n({...l,napcat_server:{...l.napcat_server,port:i.target.value?parseInt(i.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(T,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"่ฎฟ้—ฎไปค็‰Œ๏ผˆToken๏ผ‰"}),e.jsx(ne,{id:"napcat-token",type:"password",value:l.napcat_server.token,onChange:i=>n({...l,napcat_server:{...l.napcat_server,token:i.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(T,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"ๅฟƒ่ทณ้—ด้š”๏ผˆ็ง’๏ผ‰"}),e.jsx(ne,{id:"napcat-heartbeat",type:"number",value:l.napcat_server.heartbeat_interval||"",onChange:i=>n({...l,napcat_server:{...l.napcat_server,heartbeat_interval:i.target.value?parseInt(i.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ไธŽ Napcat ่ฎพ็ฝฎ็š„ๅฟƒ่ทณ้—ด้š”ไฟๆŒไธ€่‡ด๏ผˆ็•™็ฉบไฝฟ็”จ้ป˜่ฎคๅ€ผ 30๏ผ‰"})]})]})]})})}function US({config:l,onChange:n}){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(T,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"ไธปๆœบๅœฐๅ€"}),e.jsx(ne,{id:"maibot-host",value:l.maibot_server.host,onChange:i=>n({...l,maibot_server:{...l.maibot_server,host:i.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(T,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"็ซฏๅฃ"}),e.jsx(ne,{id:"maibot-port",type:"number",value:l.maibot_server.port||"",onChange:i=>n({...l,maibot_server:{...l.maibot_server,port:i.target.value?parseInt(i.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 BS({config:l,onChange:n}){const i=x=>{const h={...l};x==="group"?h.chat.group_list=[...h.chat.group_list,0]:x==="private"?h.chat.private_list=[...h.chat.private_list,0]:h.chat.ban_user_id=[...h.chat.ban_user_id,0],n(h)},c=(x,h)=>{const f={...l};x==="group"?f.chat.group_list=f.chat.group_list.filter((p,g)=>g!==h):x==="private"?f.chat.private_list=f.chat.private_list.filter((p,g)=>g!==h):f.chat.ban_user_id=f.chat.ban_user_id.filter((p,g)=>g!==h),n(f)},u=(x,h,f)=>{const p={...l};x==="group"?p.chat.group_list[h]=f:x==="private"?p.chat.private_list[h]=f:p.chat.ban_user_id[h]=f,n(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(T,{className:"text-sm md:text-base",children:"็พค็ป„ๅๅ•็ฑปๅž‹"}),e.jsxs(Be,{value:l.chat.group_list_type,onValueChange:x=>n({...l,chat:{...l.chat,group_list_type:x}}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"whitelist",children:"็™ฝๅๅ•๏ผˆไป…ๅๅ•ๅ†…ๅฏ่Šๅคฉ๏ผ‰"}),e.jsx(W,{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(T,{className:"text-sm md:text-base",children:"็พค็ป„ๅˆ—่กจ"}),e.jsxs(S,{onClick:()=>i("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-1 h-4 w-4"}),"ๆทปๅŠ ็พคๅท"]})]}),l.chat.group_list.map((x,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{type:"number",value:x,onChange:f=>u("group",h,parseInt(f.target.value)||0),placeholder:"่พ“ๅ…ฅ็พคๅท",className:"text-sm md:text-base"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค็พคๅท ",x," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>c("group",h),children:"ๅˆ ้™ค"})]})]})]})]},h)),l.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(T,{className:"text-sm md:text-base",children:"็ง่Šๅๅ•็ฑปๅž‹"}),e.jsxs(Be,{value:l.chat.private_list_type,onValueChange:x=>n({...l,chat:{...l.chat,private_list_type:x}}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"whitelist",children:"็™ฝๅๅ•๏ผˆไป…ๅๅ•ๅ†…ๅฏ่Šๅคฉ๏ผ‰"}),e.jsx(W,{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(T,{className:"text-sm md:text-base",children:"็ง่Šๅˆ—่กจ"}),e.jsxs(S,{onClick:()=>i("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-1 h-4 w-4"}),"ๆทปๅŠ ็”จๆˆท"]})]}),l.chat.private_list.map((x,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{type:"number",value:x,onChange:f=>u("private",h,parseInt(f.target.value)||0),placeholder:"่พ“ๅ…ฅQQๅท",className:"text-sm md:text-base"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค็”จๆˆท ",x," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>c("private",h),children:"ๅˆ ้™ค"})]})]})]})]},h)),l.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(T,{className:"text-sm md:text-base",children:"ๅ…จๅฑ€็ฆๆญขๅๅ•"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๅๅ•ไธญ็š„็”จๆˆทๆ— ๆณ•่ฟ›่กŒไปปไฝ•่Šๅคฉ"})]}),e.jsxs(S,{onClick:()=>i("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(Sa,{className:"mr-1 h-4 w-4"}),"ๆทปๅŠ ็”จๆˆท"]})]}),l.chat.ban_user_id.map((x,h)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ne,{type:"number",value:x,onChange:f=>u("ban",h,parseInt(f.target.value)||0),placeholder:"่พ“ๅ…ฅQQๅท",className:"text-sm md:text-base"}),e.jsxs(js,{children:[e.jsx(bt,{asChild:!0,children:e.jsx(S,{size:"icon",variant:"outline",children:e.jsx(ns,{className:"h-4 w-4"})})}),e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆไปŽๅ…จๅฑ€็ฆๆญขๅๅ•ไธญๅˆ ้™ค็”จๆˆท ",x," ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>c("ban",h),children:"ๅˆ ้™ค"})]})]})]})]},h)),l.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(T,{className:"text-sm md:text-base",children:"ๅฑ่”ฝQQๅฎ˜ๆ–นๆœบๅ™จไบบ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆ˜ฏๅฆๅฑ่”ฝๆฅ่‡ชQQๅฎ˜ๆ–นๆœบๅ™จไบบ็š„ๆถˆๆฏ"})]}),e.jsx(Fe,{checked:l.chat.ban_qq_bot,onCheckedChange:x=>n({...l,chat:{...l.chat,ban_qq_bot:x}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-sm md:text-base",children:"ๅฏ็”จๆˆณไธ€ๆˆณๅŠŸ่ƒฝ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆ˜ฏๅฆๅ“ๅบ”ๆˆณไธ€ๆˆณๆถˆๆฏ"})]}),e.jsx(Fe,{checked:l.chat.enable_poke,onCheckedChange:x=>n({...l,chat:{...l.chat,enable_poke:x}})})]})]})]})})}function $S({config:l,onChange:n}){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(T,{className:"text-sm md:text-base",children:"ไฝฟ็”จ TTS ่ฏญ้Ÿณ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"่ฏท็กฎไฟๅทฒ้…็ฝฎ TTS ๅนถๆœ‰ๅฏนๅบ”็š„้€‚้…ๅ™จ"})]}),e.jsx(Fe,{checked:l.voice.use_tts,onCheckedChange:i=>n({...l,voice:{use_tts:i}})})]})]})})}function IS({config:l,onChange:n}){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(T,{className:"text-sm md:text-base",children:"ๆ—ฅๅฟ—็ญ‰็บง"}),e.jsxs(Be,{value:l.debug.level,onValueChange:i=>n({...l,debug:{level:i}}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"DEBUG",children:"DEBUG๏ผˆ่ฐƒ่ฏ•๏ผ‰"}),e.jsx(W,{value:"INFO",children:"INFO๏ผˆไฟกๆฏ๏ผ‰"}),e.jsx(W,{value:"WARNING",children:"WARNING๏ผˆ่ญฆๅ‘Š๏ผ‰"}),e.jsx(W,{value:"ERROR",children:"ERROR๏ผˆ้”™่ฏฏ๏ผ‰"}),e.jsx(W,{value:"CRITICAL",children:"CRITICAL๏ผˆไธฅ้‡๏ผ‰"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่ฎพ็ฝฎ้€‚้…ๅ™จ็š„ๆ—ฅๅฟ—่พ“ๅ‡บ็ญ‰็บง"})]})})]})})}const PS=["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"],HS=/^(aria-|data-)/,bv=l=>Object.fromEntries(Object.entries(l).filter(([n])=>HS.test(n)||PS.includes(n)));function FS(l,n){const i=bv(l);return Object.keys(l).some(c=>!Object.hasOwn(i,c)&&l[c]!==n[c])}class GS extends m.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(n){if(n.uppy!==this.props.uppy)this.uninstallPlugin(n),this.installPlugin();else if(FS(this.props,n)){const{uppy:i,...c}={...this.props,target:this.container};this.plugin.setOptions(c)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:n,...i}={id:"Dashboard",...this.props,inline:!0,target:this.container};n.use(C1,i),this.plugin=n.getPlugin(i.id)}uninstallPlugin(n=this.props){const{uppy:i}=n;i.removePlugin(this.plugin)}render(){return m.createElement("div",{className:"uppy-Container",ref:n=>{this.container=n},...bv(this.props)})}}function VS({src:l,alt:n="่กจๆƒ…ๅŒ…",className:i,maxRetries:c=5,retryInterval:u=1500}){const[x,h]=m.useState("loading"),[f,p]=m.useState(0),[g,N]=m.useState(null),[v,y]=m.useState(l);l!==v&&(h("loading"),p(0),N(null),y(l));const w=m.useCallback(async()=>{try{const b=await fetch(l,{credentials:"include"});if(b.status===202){h("generating"),f{p(_=>_+1)},u):h("error");return}if(!b.ok){h("error");return}const D=await b.blob(),A=URL.createObjectURL(D);N(A),h("loaded")}catch(b){console.error("ๅŠ ่ฝฝ็ผฉ็•ฅๅ›พๅคฑ่ดฅ:",b),h("error")}},[l,f,c,u]);return m.useEffect(()=>{w()},[w]),m.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]),x==="loading"||x==="generating"?e.jsx(_s,{className:P("w-full h-full",i)}):x==="error"||!g?e.jsx("div",{className:P("w-full h-full flex items-center justify-center bg-muted",i),children:e.jsx(Ej,{className:"h-8 w-8 text-muted-foreground"})}):e.jsx("img",{src:g,alt:n,className:P("w-full h-full object-contain",i)})}function qS({children:l,className:n}){return e.jsx(Qm,{content:l,className:n})}const Ha="/api/webui/emoji";async function KS(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.is_registered!==void 0&&n.append("is_registered",l.is_registered.toString()),l.is_banned!==void 0&&n.append("is_banned",l.is_banned.toString()),l.format&&n.append("format",l.format),l.sort_by&&n.append("sort_by",l.sort_by),l.sort_order&&n.append("sort_order",l.sort_order);const i=await we(`${Ha}/list?${n}`,{});if(!i.ok)throw new Error(`่Žทๅ–่กจๆƒ…ๅŒ…ๅˆ—่กจๅคฑ่ดฅ: ${i.statusText}`);return i.json()}async function QS(l){const n=await we(`${Ha}/${l}`,{});if(!n.ok)throw new Error(`่Žทๅ–่กจๆƒ…ๅŒ…่ฏฆๆƒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}async function YS(l,n){const i=await we(`${Ha}/${l}`,{method:"PATCH",body:JSON.stringify(n)});if(!i.ok)throw new Error(`ๆ›ดๆ–ฐ่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${i.statusText}`);return i.json()}async function JS(l){const n=await we(`${Ha}/${l}`,{method:"DELETE"});if(!n.ok)throw new Error(`ๅˆ ้™ค่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}async function XS(){const l=await we(`${Ha}/stats/summary`,{});if(!l.ok)throw new Error(`่Žทๅ–็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ: ${l.statusText}`);return l.json()}async function ZS(l){const n=await we(`${Ha}/${l}/register`,{method:"POST"});if(!n.ok)throw new Error(`ๆณจๅ†Œ่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}async function WS(l){const n=await we(`${Ha}/${l}/ban`,{method:"POST"});if(!n.ok)throw new Error(`ๅฐ็ฆ่กจๆƒ…ๅŒ…ๅคฑ่ดฅ: ${n.statusText}`);return n.json()}function e4(l,n=!1){return n?`${Ha}/${l}/thumbnail?original=true`:`${Ha}/${l}/thumbnail`}function s4(l){return`${Ha}/${l}/thumbnail?original=true`}async function t4(l){const n=await we(`${Ha}/batch/delete`,{method:"POST",body:JSON.stringify({emoji_ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ")}return n.json()}function a4(){return`${Ha}/upload`}function l4(){const[l,n]=m.useState([]),[i,c]=m.useState(null),[u,x]=m.useState(!1),[h,f]=m.useState(1),[p,g]=m.useState(0),[N,v]=m.useState(20),[y,w]=m.useState("all"),[b,D]=m.useState("all"),[A,_]=m.useState("all"),[H,E]=m.useState("usage_count"),[C,M]=m.useState("desc"),[G,O]=m.useState(null),[ee,R]=m.useState(!1),[me,ce]=m.useState(!1),[ve,se]=m.useState(!1),[ge,fe]=m.useState(new Set),[z,Q]=m.useState(!1),[I,L]=m.useState(""),[$,_e]=m.useState("medium"),[je,Se]=m.useState(!1),{toast:K}=st(),U=m.useCallback(async()=>{try{x(!0);const de=await KS({page:h,page_size:N,is_registered:y==="all"?void 0:y==="registered",is_banned:b==="all"?void 0:b==="banned",format:A==="all"?void 0:A,sort_by:H,sort_order:C});n(de.data),g(de.total)}catch(de){const Te=de instanceof Error?de.message:"ๅŠ ่ฝฝ่กจๆƒ…ๅŒ…ๅˆ—่กจๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:Te,variant:"destructive"})}finally{x(!1)}},[h,N,y,b,A,H,C,K]),V=async()=>{try{const de=await XS();c(de.data)}catch(de){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",de)}};m.useEffect(()=>{U()},[U]),m.useEffect(()=>{V()},[]);const xe=async de=>{try{const Te=await QS(de.id);O(Te.data),R(!0)}catch(Te){const rs=Te instanceof Error?Te.message:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:rs,variant:"destructive"})}},Ae=de=>{O(de),ce(!0)},X=de=>{O(de),se(!0)},oe=async()=>{if(G)try{await JS(G.id),K({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ๅทฒๅˆ ้™ค"}),se(!1),O(null),U(),V()}catch(de){const Te=de instanceof Error?de.message:"ๅˆ ้™คๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:Te,variant:"destructive"})}},Ge=async de=>{try{await ZS(de.id),K({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ๅทฒๆณจๅ†Œ"}),U(),V()}catch(Te){const rs=Te instanceof Error?Te.message:"ๆณจๅ†Œๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:rs,variant:"destructive"})}},Y=async de=>{try{await WS(de.id),K({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ๅทฒๅฐ็ฆ"}),U(),V()}catch(Te){const rs=Te instanceof Error?Te.message:"ๅฐ็ฆๅคฑ่ดฅ";K({title:"้”™่ฏฏ",description:rs,variant:"destructive"})}},te=de=>{const Te=new Set(ge);Te.has(de)?Te.delete(de):Te.add(de),fe(Te)},Oe=async()=>{try{const de=await t4(Array.from(ge));K({title:"ๆ‰น้‡ๅˆ ้™คๅฎŒๆˆ",description:de.message}),fe(new Set),Q(!1),U(),V()}catch(de){K({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:de instanceof Error?de.message:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",variant:"destructive"})}},De=()=>{const de=parseInt(I),Te=Math.ceil(p/N);de>=1&&de<=Te?(f(de),L("")):K({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${Te}ไน‹้—ด็š„้กต็ `,variant:"destructive"})},Me=i?.formats?Object.keys(i.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(S,{onClick:()=>Se(!0),className:"gap-2",children:[e.jsx(Qi,{className:"h-4 w-4"}),"ไธŠไผ ่กจๆƒ…ๅŒ…"]})]}),e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[i&&e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๆ€ปๆ•ฐ"}),e.jsx(He,{className:"text-2xl",children:i.total})]})}),e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๅทฒๆณจๅ†Œ"}),e.jsx(He,{className:"text-2xl text-green-600",children:i.registered})]})}),e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๅทฒๅฐ็ฆ"}),e.jsx(He,{className:"text-2xl text-red-600",children:i.banned})]})}),e.jsx(Ce,{children:e.jsxs(Pe,{className:"pb-2",children:[e.jsx(As,{children:"ๆœชๆณจๅ†Œ"}),e.jsx(He,{className:"text-2xl text-gray-600",children:i.unregistered})]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsxs(He,{className:"flex items-center gap-2",children:[e.jsx(ko,{className:"h-5 w-5"}),"็ญ›้€‰ๅ’ŒๆŽ’ๅบ"]})}),e.jsxs(Re,{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(T,{children:"ๆŽ’ๅบๆ–นๅผ"}),e.jsxs(Be,{value:`${H}-${C}`,onValueChange:de=>{const[Te,rs]=de.split("-");E(Te),M(rs),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"usage_count-desc",children:"ไฝฟ็”จๆฌกๆ•ฐ (ๅคšโ†’ๅฐ‘)"}),e.jsx(W,{value:"usage_count-asc",children:"ไฝฟ็”จๆฌกๆ•ฐ (ๅฐ‘โ†’ๅคš)"}),e.jsx(W,{value:"register_time-desc",children:"ๆณจๅ†Œๆ—ถ้—ด (ๆ–ฐโ†’ๆ—ง)"}),e.jsx(W,{value:"register_time-asc",children:"ๆณจๅ†Œๆ—ถ้—ด (ๆ—งโ†’ๆ–ฐ)"}),e.jsx(W,{value:"record_time-desc",children:"่ฎฐๅฝ•ๆ—ถ้—ด (ๆ–ฐโ†’ๆ—ง)"}),e.jsx(W,{value:"record_time-asc",children:"่ฎฐๅฝ•ๆ—ถ้—ด (ๆ—งโ†’ๆ–ฐ)"}),e.jsx(W,{value:"last_used_time-desc",children:"ๆœ€ๅŽไฝฟ็”จ (ๆ–ฐโ†’ๆ—ง)"}),e.jsx(W,{value:"last_used_time-asc",children:"ๆœ€ๅŽไฝฟ็”จ (ๆ—งโ†’ๆ–ฐ)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๆณจๅ†Œ็Šถๆ€"}),e.jsxs(Be,{value:y,onValueChange:de=>{w(de),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),e.jsx(W,{value:"registered",children:"ๅทฒๆณจๅ†Œ"}),e.jsx(W,{value:"unregistered",children:"ๆœชๆณจๅ†Œ"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๅฐ็ฆ็Šถๆ€"}),e.jsxs(Be,{value:b,onValueChange:de=>{D(de),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),e.jsx(W,{value:"banned",children:"ๅทฒๅฐ็ฆ"}),e.jsx(W,{value:"unbanned",children:"ๆœชๅฐ็ฆ"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"ๆ ผๅผ"}),e.jsxs(Be,{value:A,onValueChange:de=>{_(de),f(1)},children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),Me.map(de=>e.jsxs(W,{value:de,children:[de.toUpperCase()," (",i?.formats[de],")"]},de))]})]})]})]}),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:[ge.size>0&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๅทฒ้€‰ๆ‹ฉ ",ge.size," ไธช่กจๆƒ…ๅŒ…"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"text-sm whitespace-nowrap",children:"ๅก็‰‡ๅคงๅฐ"}),e.jsxs(Be,{value:$,onValueChange:de=>_e(de),children:[e.jsx(Le,{className:"w-24",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"small",children:"ๅฐ"}),e.jsx(W,{value:"medium",children:"ไธญ"}),e.jsx(W,{value:"large",children:"ๅคง"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:N.toString(),onValueChange:de=>{v(parseInt(de)),f(1),fe(new Set)},children:[e.jsx(Le,{id:"emoji-page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"40",children:"40"}),e.jsx(W,{value:"60",children:"60"}),e.jsx(W,{value:"100",children:"100"})]})]}),ge.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>fe(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:()=>Q(!0),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๆ‰น้‡ๅˆ ้™ค"]})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t",children:e.jsxs(S,{variant:"outline",size:"sm",onClick:U,disabled:u,children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]})})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่กจๆƒ…ๅŒ…ๅˆ—่กจ"}),e.jsxs(As,{children:["ๅ…ฑ ",p," ไธช่กจๆƒ…ๅŒ…๏ผŒๅฝ“ๅ‰็ฌฌ ",h," ้กต"]})]}),e.jsxs(Re,{children:[l.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:l.map(de=>e.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${ge.has(de.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>te(de.id),children:[e.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${ge.has(de.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 ${ge.has(de.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:ge.has(de.id)&&e.jsx(Wt,{className:"h-3 w-3"})})}),e.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[de.is_registered&&e.jsx(ke,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"ๅทฒๆณจๅ†Œ"}),de.is_banned&&e.jsx(ke,{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(VS,{src:e4(de.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(ke,{variant:"outline",className:"text-[10px] px-1 py-0",children:de.format.toUpperCase()}),e.jsxs("span",{className:"font-mono",children:[de.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(S,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Te=>{Te.stopPropagation(),Ae(de)},title:"็ผ–่พ‘",children:e.jsx(Hn,{className:"h-3 w-3"})}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Te=>{Te.stopPropagation(),xe(de)},title:"่ฏฆๆƒ…",children:e.jsx(Pt,{className:"h-3 w-3"})}),!de.is_registered&&e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:Te=>{Te.stopPropagation(),Ge(de)},title:"ๆณจๅ†Œ",children:e.jsx(Wt,{className:"h-3 w-3"})}),!de.is_banned&&e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:Te=>{Te.stopPropagation(),Y(de)},title:"ๅฐ็ฆ",children:e.jsx(Jw,{className:"h-3 w-3"})}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:Te=>{Te.stopPropagation(),X(de)},title:"ๅˆ ้™ค",children:e.jsx(ns,{className:"h-3 w-3"})})]})]})]},de.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:["ๆ˜พ็คบ ",(h-1)*N+1," ๅˆฐ"," ",Math.min(h*N,p)," ๆก๏ผŒๅ…ฑ ",p," ๆก"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(de=>Math.max(1,de-1)),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:I,onChange:de=>L(de.target.value),onKeyDown:de=>de.key==="Enter"&&De(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(p/N)}),e.jsx(S,{variant:"outline",size:"sm",onClick:De,disabled:!I,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(de=>de+1),disabled:h>=Math.ceil(p/N),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(p/N)),disabled:h>=Math.ceil(p/N),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(n4,{emoji:G,open:ee,onOpenChange:R}),e.jsx(r4,{emoji:G,open:me,onOpenChange:ce,onSuccess:()=>{U(),V()}}),e.jsx(i4,{open:je,onOpenChange:Se,onSuccess:()=>{U(),V()}})]})}),e.jsx(js,{open:z,onOpenChange:Q,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["ไฝ ็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",ge.size," ไธช่กจๆƒ…ๅŒ…ๅ—๏ผŸๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Oe,children:"็กฎ่ฎคๅˆ ้™ค"})]})]})}),e.jsx(Ps,{open:ve,onOpenChange:se,children:e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsx(Ys,{children:"็กฎๅฎš่ฆๅˆ ้™ค่ฟ™ไธช่กจๆƒ…ๅŒ…ๅ—๏ผŸๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚"})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>se(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{variant:"destructive",onClick:oe,children:"ๅˆ ้™ค"})]})]})})]})}function n4({emoji:l,open:n,onOpenChange:i}){if(!l)return null;const c=u=>u?new Date(u*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(Bs,{children:e.jsx($s,{children:"่กจๆƒ…ๅŒ…่ฏฆๆƒ…"})}),e.jsx(Je,{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:s4(l.id),alt:l.description||"่กจๆƒ…ๅŒ…",className:"w-full h-full object-cover",onError:u=>{const x=u.target;x.style.display="none";const h=x.parentElement;h&&(h.innerHTML='')}})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ID"}),e.jsx("div",{className:"mt-1 font-mono",children:l.id})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆ ผๅผ"}),e.jsx("div",{className:"mt-1",children:e.jsx(ke,{variant:"outline",children:l.format.toUpperCase()})})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆ–‡ไปถ่ทฏๅพ„"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:l.full_path})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๅ“ˆๅธŒๅ€ผ"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:l.emoji_hash})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆ่ฟฐ"}),l.description?e.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:e.jsx(qS,{className:"prose-sm",children:l.description})}):e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆƒ…็ปช"}),e.jsx("div",{className:"mt-1",children:l.emotion?e.jsx("span",{className:"text-sm",children:l.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(T,{className:"text-muted-foreground",children:"็Šถๆ€"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[l.is_registered&&e.jsx(ke,{variant:"default",className:"bg-green-600",children:"ๅทฒๆณจๅ†Œ"}),l.is_banned&&e.jsx(ke,{variant:"destructive",children:"ๅทฒๅฐ็ฆ"}),!l.is_registered&&!l.is_banned&&e.jsx(ke,{variant:"outline",children:"ๆœชๆณจๅ†Œ"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ไฝฟ็”จๆฌกๆ•ฐ"}),e.jsx("div",{className:"mt-1 font-mono text-lg",children:l.usage_count})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"่ฎฐๅฝ•ๆ—ถ้—ด"}),e.jsx("div",{className:"mt-1 text-sm",children:c(l.record_time)})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆณจๅ†Œๆ—ถ้—ด"}),e.jsx("div",{className:"mt-1 text-sm",children:c(l.register_time)})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-muted-foreground",children:"ๆœ€ๅŽไฝฟ็”จ"}),e.jsx("div",{className:"mt-1 text-sm",children:c(l.last_used_time)})]})]})})]})})}function r4({emoji:l,open:n,onOpenChange:i,onSuccess:c}){const[u,x]=m.useState(""),[h,f]=m.useState(!1),[p,g]=m.useState(!1),[N,v]=m.useState(!1),{toast:y}=st();m.useEffect(()=>{l&&(x(l.emotion||""),f(l.is_registered),g(l.is_banned))},[l]);const w=async()=>{if(l)try{v(!0);const b=u.split(/[,,]/).map(D=>D.trim()).filter(Boolean).join(",");await YS(l.id,{emotion:b||void 0,is_registered:h,is_banned:p}),y({title:"ๆˆๅŠŸ",description:"่กจๆƒ…ๅŒ…ไฟกๆฏๅทฒๆ›ดๆ–ฐ"}),i(!1),c()}catch(b){const D=b instanceof Error?b.message:"ไฟๅญ˜ๅคฑ่ดฅ";y({title:"้”™่ฏฏ",description:D,variant:"destructive"})}finally{v(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘่กจๆƒ…ๅŒ…"}),e.jsx(Ys,{children:"ไฟฎๆ”น่กจๆƒ…ๅŒ…็š„ๆƒ…็ปชๅ’Œ็Šถๆ€ไฟกๆฏ"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(T,{children:"ๆƒ…็ปช"}),e.jsx(at,{value:u,onChange:b=>x(b.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(Ws,{id:"is_registered",checked:h,onCheckedChange:b=>{b===!0?(f(!0),g(!1)):f(!1)}}),e.jsx(T,{htmlFor:"is_registered",className:"cursor-pointer",children:"ๅทฒๆณจๅ†Œ"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"is_banned",checked:p,onCheckedChange:b=>{b===!0?(g(!0),f(!1)):g(!1)}}),e.jsx(T,{htmlFor:"is_banned",className:"cursor-pointer",children:"ๅทฒๅฐ็ฆ"})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:w,disabled:N,children:N?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}function i4({open:l,onOpenChange:n,onSuccess:i}){const[c,u]=m.useState("select"),[x,h]=m.useState([]),[f,p]=m.useState(null),[g,N]=m.useState(!1),{toast:v}=st(),y=m.useMemo(()=>new T1({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}"}}}),[]);m.useEffect(()=>{const G=()=>{const O=y.getFiles();if(O.length===0)return;const ee=O.map(R=>({id:R.id,name:R.name,previewUrl:R.preview||URL.createObjectURL(R.data),emotion:"",description:"",isRegistered:!0,file:R.data}));h(ee),O.length===1?(p(ee[0].id),u("edit-single")):u("edit-multiple")};return y.on("upload",G),()=>{y.off("upload",G)}},[y]),m.useEffect(()=>{l||(y.cancelAll(),u("select"),h([]),p(null),N(!1))},[l,y]);const w=m.useCallback((G,O)=>{h(ee=>ee.map(R=>R.id===G?{...R,...O}:R))},[]),b=m.useCallback(G=>G.emotion.trim().length>0,[]),D=m.useMemo(()=>x.length>0&&x.every(b),[x,b]),A=m.useMemo(()=>x.find(G=>G.id===f)||null,[x,f]),_=m.useCallback(()=>{(c==="edit-single"||c==="edit-multiple")&&(u("select"),h([]),p(null))},[c]),H=m.useCallback(async()=>{if(!D){v({title:"่ฏทๅกซๅ†™ๅฟ…ๅกซ้กน",description:"ๆฏไธช่กจๆƒ…ๅŒ…็š„ๆƒ…ๆ„Ÿๆ ‡็ญพ้ƒฝๆ˜ฏๅฟ…ๅกซ็š„",variant:"destructive"});return}N(!0);let G=0,O=0;try{for(const ee of x){const R=new FormData;R.append("file",ee.file),R.append("emotion",ee.emotion),R.append("description",ee.description),R.append("is_registered",ee.isRegistered.toString());try{(await we(a4(),{method:"POST",body:R})).ok?G++:O++}catch{O++}}O===0?(v({title:"ไธŠไผ ๆˆๅŠŸ",description:`ๆˆๅŠŸไธŠไผ  ${G} ไธช่กจๆƒ…ๅŒ…`}),n(!1),i()):(v({title:"้ƒจๅˆ†ไธŠไผ ๅคฑ่ดฅ",description:`ๆˆๅŠŸ ${G} ไธช๏ผŒๅคฑ่ดฅ ${O} ไธช`,variant:"destructive"}),i())}finally{N(!1)}},[D,x,v,n,i]),E=()=>e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"border rounded-lg overflow-hidden w-full",children:e.jsx(GS,{uppy:y,proudlyDisplayPoweredByUppy:!1,hideProgressDetails:!0,height:350,width:"100%",theme:"auto",note:"ๆ”ฏๆŒ JPGใ€PNGใ€GIFใ€WebP ๆ ผๅผ๏ผŒๆœ€ๅคš 20 ไธชๆ–‡ไปถ"})})}),C=()=>{const G=x[0];return G?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(S,{variant:"ghost",size:"sm",onClick:_,children:[e.jsx(ka,{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:G.previewUrl,alt:G.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:G.name})]}),e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"single-emotion",children:["ๆƒ…ๆ„Ÿๆ ‡็ญพ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"single-emotion",value:G.emotion,onChange:O=>w(G.id,{emotion:O.target.value}),placeholder:"ๅคšไธชๆ ‡็ญพ็”จ้€—ๅทๅˆ†้š”๏ผŒๅฆ‚๏ผšๅผ€ๅฟƒ,้ซ˜ๅ…ด",className:G.emotion.trim()?"":"border-destructive"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"็”จไบŽๆƒ…ๆ„ŸๅŒน้…๏ผŒๅคšไธชๆ ‡็ญพ็”จ้€—ๅทๅˆ†้š”"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"single-description",children:"ๆ่ฟฐ"}),e.jsx(ne,{id:"single-description",value:G.description,onChange:O=>w(G.id,{description:O.target.value}),placeholder:"่พ“ๅ…ฅ่กจๆƒ…ๅŒ…ๆ่ฟฐ..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"single-is-registered",checked:G.isRegistered,onCheckedChange:O=>w(G.id,{isRegistered:O===!0})}),e.jsx(T,{htmlFor:"single-is-registered",className:"cursor-pointer",children:"ไธŠไผ ๅŽ็ซ‹ๅณๆณจๅ†Œ๏ผˆๅฏ่ขซ้บฆ้บฆไฝฟ็”จ๏ผ‰"})]})]})]}),e.jsx(et,{children:e.jsx(S,{onClick:H,disabled:!D||g,children:g?"ไธŠไผ ไธญ...":"ไธŠไผ "})})]}):null},M=()=>{const G=x.filter(b).length,O=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(S,{variant:"ghost",size:"sm",onClick:_,children:[e.jsx(ka,{className:"h-4 w-4 mr-1"}),"่ฟ”ๅ›ž"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["็ผ–่พ‘่กจๆƒ…ๅŒ…ไฟกๆฏ๏ผˆ",G,"/",O," ๅทฒๅฎŒๆˆ๏ผ‰"]})]}),e.jsx(ke,{variant:D?"default":"secondary",children:D?e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"h-3 w-3 mr-1"}),"ๅ…จ้ƒจๅฎŒๆˆ"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ca,{className:"h-3 w-3 mr-1"}),"ๆœชๅฎŒๆˆ"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Je,{className:"h-[350px] pr-2",children:e.jsx("div",{className:"space-y-2",children:x.map(ee=>{const R=b(ee),me=f===ee.id;return e.jsxs("div",{onClick:()=>p(ee.id),className:` flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-all ${me?"ring-2 ring-primary":""} ${R?"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:ee.previewUrl,alt:ee.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:ee.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee.emotion||"ๆœชๅกซๅ†™ๆƒ…ๆ„Ÿๆ ‡็ญพ"})]}),R?e.jsx(la,{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"})]},ee.id)})})}),e.jsx("div",{className:"border rounded-lg p-4",children:A?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:A.previewUrl,alt:A.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:A.name}),b(A)&&e.jsxs(ke,{variant:"outline",className:"text-green-600 border-green-600",children:[e.jsx(_t,{className:"h-3 w-3 mr-1"}),"ๅทฒๅฎŒๆˆ"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"multi-emotion",children:["ๆƒ…ๆ„Ÿๆ ‡็ญพ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"multi-emotion",value:A.emotion,onChange:ee=>w(A.id,{emotion:ee.target.value}),placeholder:"ๅคšไธชๆ ‡็ญพ็”จ้€—ๅทๅˆ†้š”๏ผŒๅฆ‚๏ผšๅผ€ๅฟƒ,้ซ˜ๅ…ด",className:A.emotion.trim()?"":"border-destructive"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"multi-description",children:"ๆ่ฟฐ"}),e.jsx(ne,{id:"multi-description",value:A.description,onChange:ee=>w(A.id,{description:ee.target.value}),placeholder:"่พ“ๅ…ฅ่กจๆƒ…ๅŒ…ๆ่ฟฐ..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"multi-is-registered",checked:A.isRegistered,onCheckedChange:ee=>w(A.id,{isRegistered:ee===!0})}),e.jsx(T,{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(Tj,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"็‚นๅ‡ปๅทฆไพงๅก็‰‡็ผ–่พ‘"})]})})})]}),e.jsx(et,{children:e.jsx(S,{onClick:P,disabled:!D||g,children:g?"ไธŠไผ ไธญ...":`ไธŠไผ ๅ…จ้ƒจ (${O})`})})]})};return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-3xl max-h-[90vh] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Ki,{className:"h-5 w-5"}),c==="select"&&"ไธŠไผ ่กจๆƒ…ๅŒ… - ้€‰ๆ‹ฉๆ–‡ไปถ",c==="edit-single"&&"ไธŠไผ ่กจๆƒ…ๅŒ… - ๅกซๅ†™ไฟกๆฏ",c==="edit-multiple"&&"ไธŠไผ ่กจๆƒ…ๅŒ… - ๆ‰น้‡็ผ–่พ‘"]}),e.jsxs(Ys,{children:[c==="select"&&"ๆ”ฏๆŒ JPGใ€PNGใ€GIFใ€WebP ๆ ผๅผ๏ผŒๅ•ไธชๆ–‡ไปถๆœ€ๅคง 10MB๏ผŒๅฏๅŒๆ—ถไธŠไผ ๅคšไธชๆ–‡ไปถ",c==="edit-single"&&"่ฏทๅกซๅ†™่กจๆƒ…ๅŒ…็š„ๆƒ…ๆ„Ÿๆ ‡็ญพ๏ผˆๅฟ…ๅกซ๏ผ‰ๅ’Œๆ่ฟฐ",c==="edit-multiple"&&"็‚นๅ‡ปๅทฆไพงๅก็‰‡็ผ–่พ‘ๆฏไธช่กจๆƒ…ๅŒ…็š„ไฟกๆฏ๏ผŒๆƒ…ๆ„Ÿๆ ‡็ญพไธบๅฟ…ๅกซ้กน"]})]}),e.jsxs("div",{className:"overflow-y-auto pr-1",children:[c==="select"&&E(),c==="edit-single"&&C(),c==="edit-multiple"&&M()]})]})})}const gn="/api/webui/expression";async function yv(){const l=await we(`${gn}/chats`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–่Šๅคฉๅˆ—่กจๅคฑ่ดฅ")}return l.json()}async function c4(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.chat_id&&n.append("chat_id",l.chat_id);const i=await we(`${gn}/list?${n}`,{});if(!i.ok){const c=await i.json();throw new Error(c.detail||"่Žทๅ–่กจ่พพๆ–นๅผๅˆ—่กจๅคฑ่ดฅ")}return i.json()}async function o4(l){const n=await we(`${gn}/${l}`,{});if(!n.ok){const i=await n.json();throw new Error(i.detail||"่Žทๅ–่กจ่พพๆ–นๅผ่ฏฆๆƒ…ๅคฑ่ดฅ")}return n.json()}async function d4(l){const n=await we(`${gn}/`,{method:"POST",body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ›ๅปบ่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return n.json()}async function u4(l,n){const i=await we(`${gn}/${l}`,{method:"PATCH",body:JSON.stringify(n)});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ๆ›ดๆ–ฐ่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return i.json()}async function m4(l){const n=await we(`${gn}/${l}`,{method:"DELETE"});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ ้™ค่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return n.json()}async function x4(l){const n=await we(`${gn}/batch/delete`,{method:"POST",body:JSON.stringify({ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™ค่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return n.json()}async function h4(){const l=await we(`${gn}/stats/summary`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ")}return l.json()}function f4(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(0),[h,f]=m.useState(1),[p,g]=m.useState(20),[N,v]=m.useState(""),[y,w]=m.useState(null),[b,D]=m.useState(!1),[A,_]=m.useState(!1),[P,E]=m.useState(!1),[C,M]=m.useState(null),[G,O]=m.useState(new Set),[ee,R]=m.useState(!1),[me,ce]=m.useState(""),[ve,se]=m.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[ge,fe]=m.useState([]),[z,Q]=m.useState(new Map),{toast:$}=st(),L=async()=>{try{c(!0);const oe=await c4({page:h,page_size:p,search:N||void 0});n(oe.data),x(oe.total)}catch(oe){$({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๅŠ ่ฝฝ่กจ่พพๆ–นๅผ",variant:"destructive"})}finally{c(!1)}},I=async()=>{try{const oe=await h4();oe?.data&&se(oe.data)}catch(oe){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",oe)}},_e=async()=>{try{const oe=await yv();if(oe?.data){fe(oe.data);const Fe=new Map;oe.data.forEach(Y=>{Fe.set(Y.chat_id,Y.chat_name)}),Q(Fe)}}catch(oe){console.error("ๅŠ ่ฝฝ่Šๅคฉๅˆ—่กจๅคฑ่ดฅ:",oe)}},je=oe=>z.get(oe)||oe;m.useEffect(()=>{L(),I(),_e()},[h,p,N]);const Se=async oe=>{try{const Fe=await o4(oe.id);w(Fe.data),D(!0)}catch(Fe){$({title:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ",description:Fe instanceof Error?Fe.message:"ๆ— ๆณ•ๅŠ ่ฝฝ่กจ่พพๆ–นๅผ่ฏฆๆƒ…",variant:"destructive"})}},K=oe=>{w(oe),_(!0)},U=async oe=>{try{await m4(oe.id),$({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค่กจ่พพๆ–นๅผ: ${oe.situation}`}),M(null),L(),I()}catch(Fe){$({title:"ๅˆ ้™คๅคฑ่ดฅ",description:Fe instanceof Error?Fe.message:"ๆ— ๆณ•ๅˆ ้™ค่กจ่พพๆ–นๅผ",variant:"destructive"})}},V=oe=>{const Fe=new Set(G);Fe.has(oe)?Fe.delete(oe):Fe.add(oe),O(Fe)},xe=()=>{G.size===l.length&&l.length>0?O(new Set):O(new Set(l.map(oe=>oe.id)))},Ae=async()=>{try{await x4(Array.from(G)),$({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${G.size} ไธช่กจ่พพๆ–นๅผ`}),O(new Set),R(!1),L(),I()}catch(oe){$({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๆ‰น้‡ๅˆ ้™ค่กจ่พพๆ–นๅผ",variant:"destructive"})}},X=()=>{const oe=parseInt(me),Fe=Math.ceil(u/p);oe>=1&&oe<=Fe?(f(oe),ce("")):$({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${Fe}ไน‹้—ด็š„้กต็ `,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(Pa,{className:"h-8 w-8",strokeWidth:2}),"่กจ่พพๆ–นๅผ็ฎก็†"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"็ฎก็†้บฆ้บฆ็š„่กจ่พพๆ–นๅผๅ’Œ่ฏๆœฏๆจกๆฟ"})]}),e.jsxs(S,{onClick:()=>E(!0),className:"gap-2",children:[e.jsx(Zs,{className:"h-4 w-4"}),"ๆ–ฐๅขž่กจ่พพๆ–นๅผ"]})]})}),e.jsx(Je,{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:ve.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:ve.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:ve.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx(T,{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(Ot,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{id:"search",placeholder:"ๆœ็ดขๆƒ…ๅขƒใ€้ฃŽๆ ผๆˆ–ไธŠไธ‹ๆ–‡...",value:N,onChange:oe=>v(oe.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:G.size>0&&e.jsxs("span",{children:["ๅทฒ้€‰ๆ‹ฉ ",G.size," ไธช่กจ่พพๆ–นๅผ"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:p.toString(),onValueChange:oe=>{g(parseInt(oe)),f(1),O(new Set)},children:[e.jsx(Le,{id:"page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]}),G.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>O(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:()=>R(!0),children:[e.jsx(ns,{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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:G.size===l.length&&l.length>0,onCheckedChange:xe})}),e.jsx(Ze,{children:"ๆƒ…ๅขƒ"}),e.jsx(Ze,{children:"้ฃŽๆ ผ"}),e.jsx(Ze,{children:"่Šๅคฉ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i?e.jsx(ot,{children:e.jsx(Ke,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."})}):l.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"})}):l.map(oe=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:G.has(oe.id),onCheckedChange:()=>V(oe.id)})}),e.jsx(Ke,{className:"font-medium max-w-xs truncate",children:oe.situation}),e.jsx(Ke,{className:"max-w-xs truncate",children:oe.style}),e.jsx(Ke,{className:"max-w-[200px] truncate",title:je(oe.chat_id),style:{wordBreak:"keep-all"},children:e.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:je(oe.chat_id)})}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>K(oe),children:[e.jsx(Hn,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>Se(oe),title:"ๆŸฅ็œ‹่ฏฆๆƒ…",children:e.jsx(na,{className:"h-4 w-4"})}),e.jsxs(S,{size:"sm",onClick:()=>M(oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅˆ ้™ค"]})]})})]},oe.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:i?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."}):l.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):l.map(oe=>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(Ws,{checked:G.has(oe.id),onCheckedChange:()=>V(oe.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:oe.situation,children:oe.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:oe.style,children:oe.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:je(oe.chat_id),style:{wordBreak:"keep-all"},children:je(oe.chat_id)})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>K(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Hn,{className:"h-3 w-3 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Se(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:e.jsx(na,{className:"h-3 w-3"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>M(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"ๅˆ ้™ค"]})]})]},oe.id))}),u>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:["ๅ…ฑ ",u," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",h," / ",Math.ceil(u/p)," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h-1),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:me,onChange:oe=>ce(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&X(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/p)}),e.jsx(S,{variant:"outline",size:"sm",onClick:X,disabled:!me,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h+1),disabled:h>=Math.ceil(u/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(u/p)),disabled:h>=Math.ceil(u/p),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(p4,{expression:y,open:b,onOpenChange:D,chatNameMap:z}),e.jsx(g4,{open:P,onOpenChange:E,chatList:ge,onSuccess:()=>{L(),I(),E(!1)}}),e.jsx(j4,{expression:y,open:A,onOpenChange:_,chatList:ge,onSuccess:()=>{L(),I(),_(!1)}}),e.jsx(js,{open:!!C,onOpenChange:()=>M(null),children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™ค่กจ่พพๆ–นๅผ "',C?.situation,'" ๅ—๏ผŸ ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>C&&U(C),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๅˆ ้™ค"})]})]})}),e.jsx(v4,{open:ee,onOpenChange:R,onConfirm:Ae,count:G.size})]})}function p4({expression:l,open:n,onOpenChange:i,chatNameMap:c}){if(!l)return null;const u=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-",x=h=>c.get(h)||h;return e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(Ui,{label:"ๆƒ…ๅขƒ",value:l.situation}),e.jsx(Ui,{label:"้ฃŽๆ ผ",value:l.style}),e.jsx(Ui,{label:"่Šๅคฉ",value:x(l.chat_id)}),e.jsx(Ui,{icon:Ir,label:"่ฎฐๅฝ•ID",value:l.id.toString(),mono:!0})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsx(Ui,{icon:Ya,label:"ๅˆ›ๅปบๆ—ถ้—ด",value:u(l.create_date)})})]}),e.jsx(et,{children:e.jsx(S,{onClick:()=>i(!1),children:"ๅ…ณ้—ญ"})})]})})}function Ui({icon:l,label:n,value:i,mono:c=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l&&e.jsx(l,{className:"h-3 w-3"}),n]}),e.jsx("div",{className:H("text-sm",c&&"font-mono",!i&&"text-muted-foreground"),children:i||"-"})]})}function g4({open:l,onOpenChange:n,chatList:i,onSuccess:c}){const[u,x]=m.useState({situation:"",style:"",chat_id:""}),[h,f]=m.useState(!1),{toast:p}=st(),g=async()=>{if(!u.situation||!u.style||!u.chat_id){p({title:"้ชŒ่ฏๅคฑ่ดฅ",description:"่ฏทๅกซๅ†™ๅฟ…ๅกซๅญ—ๆฎต๏ผšๆƒ…ๅขƒใ€้ฃŽๆ ผๅ’Œ่Šๅคฉ",variant:"destructive"});return}try{f(!0),await d4(u),p({title:"ๅˆ›ๅปบๆˆๅŠŸ",description:"่กจ่พพๆ–นๅผๅทฒๅˆ›ๅปบ"}),x({situation:"",style:"",chat_id:""}),c()}catch(N){p({title:"ๅˆ›ๅปบๅคฑ่ดฅ",description:N instanceof Error?N.message:"ๆ— ๆณ•ๅˆ›ๅปบ่กจ่พพๆ–นๅผ",variant:"destructive"})}finally{f(!1)}};return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{htmlFor:"situation",children:["ๆƒ…ๅขƒ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"situation",value:u.situation,onChange:N=>x({...u,situation:N.target.value}),placeholder:"ๆ่ฟฐไฝฟ็”จๅœบๆ™ฏ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"style",children:["้ฃŽๆ ผ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"style",value:u.style,onChange:N=>x({...u,style:N.target.value}),placeholder:"ๆ่ฟฐ่กจ่พพ้ฃŽๆ ผ"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"chat_id",children:["่Šๅคฉ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Be,{value:u.chat_id,onValueChange:N=>x({...u,chat_id:N}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:i.map(N=>e.jsx(W,{value:N.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[N.chat_name,N.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(็พค่Š)"})]})},N.chat_id))})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:g,disabled:h,children:h?"ๅˆ›ๅปบไธญ...":"ๅˆ›ๅปบ"})]})]})})}function j4({expression:l,open:n,onOpenChange:i,chatList:c,onSuccess:u}){const[x,h]=m.useState({}),[f,p]=m.useState(!1),{toast:g}=st();m.useEffect(()=>{l&&h({situation:l.situation,style:l.style,chat_id:l.chat_id})},[l]);const N=async()=>{if(l)try{p(!0),await u4(l.id,x),g({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"่กจ่พพๆ–นๅผๅทฒๆ›ดๆ–ฐ"}),u()}catch(v){g({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:v instanceof Error?v.message:"ๆ— ๆณ•ๆ›ดๆ–ฐ่กจ่พพๆ–นๅผ",variant:"destructive"})}finally{p(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{htmlFor:"edit_situation",children:"ๆƒ…ๅขƒ"}),e.jsx(ne,{id:"edit_situation",value:x.situation||"",onChange:v=>h({...x,situation:v.target.value}),placeholder:"ๆ่ฟฐไฝฟ็”จๅœบๆ™ฏ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_style",children:"้ฃŽๆ ผ"}),e.jsx(ne,{id:"edit_style",value:x.style||"",onChange:v=>h({...x,style:v.target.value}),placeholder:"ๆ่ฟฐ่กจ่พพ้ฃŽๆ ผ"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_chat_id",children:"่Šๅคฉ"}),e.jsxs(Be,{value:x.chat_id||"",onValueChange:v=>h({...x,chat_id:v}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:c.map(v=>e.jsx(W,{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(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:N,disabled:f,children:f?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}function v4({open:l,onOpenChange:n,onConfirm:i,count:c}){return e.jsx(js,{open:l,onOpenChange:n,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["ๆ‚จๅณๅฐ†ๅˆ ้™ค ",c," ไธช่กจ่พพๆ–นๅผ๏ผŒๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎคๅˆ ้™ค"})]})]})})}const Rl="/api/webui/jargon";async function N4(){const l=await we(`${Rl}/chats`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–่Šๅคฉๅˆ—่กจๅคฑ่ดฅ")}return l.json()}async function b4(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.chat_id&&n.append("chat_id",l.chat_id),l.is_jargon!==void 0&&l.is_jargon!==null&&n.append("is_jargon",l.is_jargon.toString()),l.is_global!==void 0&&n.append("is_global",l.is_global.toString());const i=await we(`${Rl}/list?${n}`,{});if(!i.ok){const c=await i.json();throw new Error(c.detail||"่Žทๅ–้ป‘่ฏๅˆ—่กจๅคฑ่ดฅ")}return i.json()}async function y4(l){const n=await we(`${Rl}/${l}`,{});if(!n.ok){const i=await n.json();throw new Error(i.detail||"่Žทๅ–้ป‘่ฏ่ฏฆๆƒ…ๅคฑ่ดฅ")}return n.json()}async function w4(l){const n=await we(`${Rl}/`,{method:"POST",body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ›ๅปบ้ป‘่ฏๅคฑ่ดฅ")}return n.json()}async function _4(l,n){const i=await we(`${Rl}/${l}`,{method:"PATCH",body:JSON.stringify(n)});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ๆ›ดๆ–ฐ้ป‘่ฏๅคฑ่ดฅ")}return i.json()}async function S4(l){const n=await we(`${Rl}/${l}`,{method:"DELETE"});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ ้™ค้ป‘่ฏๅคฑ่ดฅ")}return n.json()}async function k4(l){const n=await we(`${Rl}/batch/delete`,{method:"POST",body:JSON.stringify({ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™ค้ป‘่ฏๅคฑ่ดฅ")}return n.json()}async function C4(){const l=await we(`${Rl}/stats/summary`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–้ป‘่ฏ็ปŸ่ฎกๅคฑ่ดฅ")}return l.json()}async function T4(l,n){const i=new URLSearchParams;l.forEach(u=>i.append("ids",u.toString())),i.append("is_jargon",n.toString());const c=await we(`${Rl}/batch/set-jargon?${i}`,{method:"POST"});if(!c.ok){const u=await c.json();throw new Error(u.detail||"ๆ‰น้‡่ฎพ็ฝฎ้ป‘่ฏ็Šถๆ€ๅคฑ่ดฅ")}return c.json()}function E4(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(0),[h,f]=m.useState(1),[p,g]=m.useState(20),[N,v]=m.useState(""),[y,w]=m.useState("all"),[b,D]=m.useState("all"),[A,_]=m.useState(null),[P,E]=m.useState(!1),[C,M]=m.useState(!1),[G,O]=m.useState(!1),[ee,R]=m.useState(null),[me,ce]=m.useState(new Set),[ve,se]=m.useState(!1),[ge,fe]=m.useState(""),[z,Q]=m.useState({total:0,confirmed_jargon:0,confirmed_not_jargon:0,pending:0,global_count:0,complete_count:0,chat_count:0,top_chats:{}}),[$,L]=m.useState([]),{toast:I}=st(),_e=async()=>{try{c(!0);const te=await b4({page:h,page_size:p,search:N||void 0,chat_id:y==="all"?void 0:y,is_jargon:b==="all"?void 0:b==="true"?!0:b==="false"?!1:void 0});n(te.data),x(te.total)}catch(te){I({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆ— ๆณ•ๅŠ ่ฝฝ้ป‘่ฏๅˆ—่กจ",variant:"destructive"})}finally{c(!1)}},je=async()=>{try{const te=await C4();te?.data&&Q(te.data)}catch(te){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",te)}},Se=async()=>{try{const te=await N4();te?.data&&L(te.data)}catch(te){console.error("ๅŠ ่ฝฝ่Šๅคฉๅˆ—่กจๅคฑ่ดฅ:",te)}};m.useEffect(()=>{_e(),je(),Se()},[h,p,N,y,b]);const K=async te=>{try{const Oe=await y4(te.id);_(Oe.data),E(!0)}catch(Oe){I({title:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ",description:Oe instanceof Error?Oe.message:"ๆ— ๆณ•ๅŠ ่ฝฝ้ป‘่ฏ่ฏฆๆƒ…",variant:"destructive"})}},U=te=>{_(te),M(!0)},V=async te=>{try{await S4(te.id),I({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค้ป‘่ฏ: ${te.content}`}),R(null),_e(),je()}catch(Oe){I({title:"ๅˆ ้™คๅคฑ่ดฅ",description:Oe instanceof Error?Oe.message:"ๆ— ๆณ•ๅˆ ้™ค้ป‘่ฏ",variant:"destructive"})}},xe=te=>{const Oe=new Set(me);Oe.has(te)?Oe.delete(te):Oe.add(te),ce(Oe)},Ae=()=>{me.size===l.length&&l.length>0?ce(new Set):ce(new Set(l.map(te=>te.id)))},X=async()=>{try{await k4(Array.from(me)),I({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${me.size} ไธช้ป‘่ฏ`}),ce(new Set),se(!1),_e(),je()}catch(te){I({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆ— ๆณ•ๆ‰น้‡ๅˆ ้™ค้ป‘่ฏ",variant:"destructive"})}},oe=async te=>{try{await T4(Array.from(me),te),I({title:"ๆ“ไฝœๆˆๅŠŸ",description:`ๅทฒๅฐ† ${me.size} ไธช่ฏๆก่ฎพไธบ${te?"้ป‘่ฏ":"้ž้ป‘่ฏ"}`}),ce(new Set),_e(),je()}catch(Oe){I({title:"ๆ“ไฝœๅคฑ่ดฅ",description:Oe instanceof Error?Oe.message:"ๆ‰น้‡่ฎพ็ฝฎๅคฑ่ดฅ",variant:"destructive"})}},Fe=()=>{const te=parseInt(ge),Oe=Math.ceil(u/p);te>=1&&te<=Oe?(f(te),fe("")):I({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${Oe}ไน‹้—ด็š„้กต็ `,variant:"destructive"})},Y=te=>te===!0?e.jsxs(ke,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:[e.jsx(_t,{className:"h-3 w-3 mr-1"}),"ๆ˜ฏ้ป‘่ฏ"]}):te===!1?e.jsxs(ke,{variant:"secondary",children:[e.jsx(Ca,{className:"h-3 w-3 mr-1"}),"้ž้ป‘่ฏ"]}):e.jsxs(ke,{variant:"outline",children:[e.jsx(wj,{className:"h-3 w-3 mr-1"}),"ๆœชๅˆคๅฎš"]});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(Xw,{className:"h-8 w-8",strokeWidth:2}),"้ป‘่ฏ็ฎก็†"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"็ฎก็†้บฆ้บฆๅญฆไน ๅˆฐ็š„้ป‘่ฏๅ’Œไฟš่ฏญ"})]}),e.jsxs(S,{onClick:()=>O(!0),className:"gap-2",children:[e.jsx(Zs,{className:"h-4 w-4"}),"ๆ–ฐๅขž้ป‘่ฏ"]})]})}),e.jsx(Je,{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-2 sm:grid-cols-4 lg:grid-cols-7 gap-3",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๆ€ปๆ•ฐ้‡"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1",children:z.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅทฒ็กฎ่ฎค้ป‘่ฏ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-green-600",children:z.confirmed_jargon})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"็กฎ่ฎค้ž้ป‘่ฏ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-gray-500",children:z.confirmed_not_jargon})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅพ…ๅˆคๅฎš"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-yellow-600",children:z.pending})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅ…จๅฑ€้ป‘่ฏ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-blue-600",children:z.global_count})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๆŽจๆ–ญๅฎŒๆˆ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-purple-600",children:z.complete_count})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅ…ณ่”่Šๅคฉๆ•ฐ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1",children:z.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{htmlFor:"search",children:"ๆœ็ดข"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{id:"search",placeholder:"ๆœ็ดขๅ†…ๅฎนใ€ๅซไน‰...",value:N,onChange:te=>v(te.target.value),className:"pl-9"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{children:"่Šๅคฉ็ญ›้€‰"}),e.jsxs(Be,{value:y,onValueChange:w,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"ๅ…จ้ƒจ่Šๅคฉ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ่Šๅคฉ"}),$.map(te=>e.jsx(W,{value:te.chat_id,children:te.chat_name},te.chat_id))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{children:"็Šถๆ€็ญ›้€‰"}),e.jsxs(Be,{value:b,onValueChange:D,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"ๅ…จ้ƒจ็Šถๆ€"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ็Šถๆ€"}),e.jsx(W,{value:"true",children:"ๆ˜ฏ้ป‘่ฏ"}),e.jsx(W,{value:"false",children:"้ž้ป‘่ฏ"})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{htmlFor:"page-size",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:p.toString(),onValueChange:te=>{g(parseInt(te)),f(1),ce(new Set)},children:[e.jsx(Le,{id:"page-size",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]})]})]}),me.size>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-4 pt-4 border-t",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๅทฒ้€‰ๆ‹ฉ ",me.size," ไธช"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>oe(!0),children:[e.jsx(_t,{className:"h-4 w-4 mr-1"}),"ๆ ‡่ฎฐไธบ้ป‘่ฏ"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>oe(!1),children:[e.jsx(Ca,{className:"h-4 w-4 mr-1"}),"ๆ ‡่ฎฐไธบ้ž้ป‘่ฏ"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>ce(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:()=>se(!0),children:[e.jsx(ns,{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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:me.size===l.length&&l.length>0,onCheckedChange:Ae})}),e.jsx(Ze,{children:"ๅ†…ๅฎน"}),e.jsx(Ze,{children:"ๅซไน‰"}),e.jsx(Ze,{children:"่Šๅคฉ"}),e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{className:"text-center",children:"ๆฌกๆ•ฐ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i?e.jsx(ot,{children:e.jsx(Ke,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."})}):l.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"})}):l.map(te=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:me.has(te.id),onCheckedChange:()=>xe(te.id)})}),e.jsx(Ke,{className:"font-medium max-w-[200px]",children:e.jsxs("div",{className:"flex items-center gap-2",children:[te.is_global&&e.jsx("span",{title:"ๅ…จๅฑ€้ป‘่ฏ",children:e.jsx(Ao,{className:"h-4 w-4 text-blue-500 flex-shrink-0"})}),e.jsx("span",{className:"truncate",title:te.content,children:te.content})]})}),e.jsx(Ke,{className:"max-w-[200px] truncate",title:te.meaning||"",children:te.meaning||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Ke,{className:"max-w-[150px] truncate",title:te.chat_name||te.chat_id,children:te.chat_name||te.chat_id}),e.jsx(Ke,{children:Y(te.is_jargon)}),e.jsx(Ke,{className:"text-center",children:te.count}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>U(te),children:[e.jsx(Hn,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>K(te),title:"ๆŸฅ็œ‹่ฏฆๆƒ…",children:e.jsx(na,{className:"h-4 w-4"})}),e.jsxs(S,{size:"sm",onClick:()=>R(te),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅˆ ้™ค"]})]})})]},te.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:i?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."}):l.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):l.map(te=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ws,{checked:me.has(te.id),onCheckedChange:()=>xe(te.id),className:"mt-1"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[te.is_global&&e.jsx(Ao,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),e.jsx("h3",{className:"font-semibold text-sm break-all",children:te.content})]}),te.meaning&&e.jsx("p",{className:"text-sm text-muted-foreground break-all",children:te.meaning}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[Y(te.is_jargon),e.jsxs("span",{className:"text-muted-foreground",children:["ๆฌกๆ•ฐ: ",te.count]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:["่Šๅคฉ: ",te.chat_name||te.chat_id]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>U(te),className:"text-xs px-2 py-1 h-auto",children:[e.jsx(Hn,{className:"h-3 w-3 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>K(te),className:"text-xs px-2 py-1 h-auto",children:e.jsx(na,{className:"h-3 w-3"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>R(te),className:"text-xs px-2 py-1 h-auto text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"ๅˆ ้™ค"]})]})]},te.id))}),u>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:["ๅ…ฑ ",u," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",h," / ",Math.ceil(u/p)," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h-1),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:ge,onChange:te=>fe(te.target.value),onKeyDown:te=>te.key==="Enter"&&Fe(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/p)}),e.jsx(S,{variant:"outline",size:"sm",onClick:Fe,disabled:!ge,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h+1),disabled:h>=Math.ceil(u/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(u/p)),disabled:h>=Math.ceil(u/p),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(M4,{jargon:A,open:P,onOpenChange:E}),e.jsx(A4,{open:G,onOpenChange:O,chatList:$,onSuccess:()=>{_e(),je(),O(!1)}}),e.jsx(z4,{jargon:A,open:C,onOpenChange:M,chatList:$,onSuccess:()=>{_e(),je(),M(!1)}}),e.jsx(js,{open:!!ee,onOpenChange:()=>R(null),children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™ค้ป‘่ฏ "',ee?.content,'" ๅ—๏ผŸๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>ee&&V(ee),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:ve,onOpenChange:se,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["ๆ‚จๅณๅฐ†ๅˆ ้™ค ",me.size," ไธช้ป‘่ฏ๏ผŒๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎคๅˆ ้™ค"})]})]})})]})}function M4({jargon:l,open:n,onOpenChange:i}){return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] grid grid-rows-[auto_1fr_auto] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"้ป‘่ฏ่ฏฆๆƒ…"}),e.jsx(Ys,{children:"ๆŸฅ็œ‹้ป‘่ฏ็š„ๅฎŒๆ•ดไฟกๆฏ"})]}),e.jsx(Je,{className:"h-full pr-4",children:e.jsxs("div",{className:"space-y-4 pb-2",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Tm,{icon:Ir,label:"่ฎฐๅฝ•ID",value:l.id.toString(),mono:!0}),e.jsx(Tm,{label:"ไฝฟ็”จๆฌกๆ•ฐ",value:l.count.toString()})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅ†…ๅฎน"}),e.jsx("div",{className:"text-sm p-2 bg-muted rounded break-all whitespace-pre-wrap",children:l.content})]}),l.raw_content&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅŽŸๅง‹ๅ†…ๅฎน"}),e.jsx("div",{className:"text-sm p-2 bg-muted rounded break-all",children:(()=>{try{const c=JSON.parse(l.raw_content);return Array.isArray(c)?c.map((u,x)=>e.jsxs("div",{children:[x>0&&e.jsx("hr",{className:"my-3 border-border"}),e.jsx("div",{className:"whitespace-pre-wrap",children:u})]},x)):e.jsx("div",{className:"whitespace-pre-wrap",children:l.raw_content})}catch{return e.jsx("div",{className:"whitespace-pre-wrap",children:l.raw_content})}})()})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅซไน‰"}),e.jsx("div",{className:"text-sm p-2 bg-muted rounded break-all",children:l.meaning?e.jsx(Km,{content:l.meaning}):"-"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Tm,{label:"่Šๅคฉ",value:l.chat_name||l.chat_id}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"็Šถๆ€"}),e.jsxs("div",{className:"flex items-center gap-2",children:[l.is_jargon===!0&&e.jsx(ke,{variant:"default",className:"bg-green-600",children:"ๆ˜ฏ้ป‘่ฏ"}),l.is_jargon===!1&&e.jsx(ke,{variant:"secondary",children:"้ž้ป‘่ฏ"}),l.is_jargon===null&&e.jsx(ke,{variant:"outline",children:"ๆœชๅˆคๅฎš"}),l.is_global&&e.jsx(ke,{variant:"outline",className:"border-blue-500 text-blue-500",children:"ๅ…จๅฑ€"}),l.is_complete&&e.jsx(ke,{variant:"outline",className:"border-purple-500 text-purple-500",children:"ๆŽจๆ–ญๅฎŒๆˆ"})]})]})]}),l.inference_with_context&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ไธŠไธ‹ๆ–‡ๆŽจๆ–ญ็ป“ๆžœ"}),e.jsx("div",{className:"p-2 bg-muted rounded break-all whitespace-pre-wrap font-mono text-xs max-h-[200px] overflow-y-auto",children:l.inference_with_context})]}),l.inference_content_only&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"็บฏ่ฏๆกๆŽจๆ–ญ็ป“ๆžœ"}),e.jsx("div",{className:"p-2 bg-muted rounded break-all whitespace-pre-wrap font-mono text-xs max-h-[200px] overflow-y-auto",children:l.inference_content_only})]})]})}),e.jsx(et,{className:"flex-shrink-0",children:e.jsx(S,{onClick:()=>i(!1),children:"ๅ…ณ้—ญ"})})]})}):null}function Tm({icon:l,label:n,value:i,mono:c=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l&&e.jsx(l,{className:"h-3 w-3"}),n]}),e.jsx("div",{className:H("text-sm",c&&"font-mono",!i&&"text-muted-foreground"),children:i||"-"})]})}function A4({open:l,onOpenChange:n,chatList:i,onSuccess:c}){const[u,x]=m.useState({content:"",meaning:"",chat_id:"",is_global:!1}),[h,f]=m.useState(!1),{toast:p}=st(),g=async()=>{if(!u.content||!u.chat_id){p({title:"้ชŒ่ฏๅคฑ่ดฅ",description:"่ฏทๅกซๅ†™ๅฟ…ๅกซๅญ—ๆฎต๏ผšๅ†…ๅฎนๅ’Œ่Šๅคฉ",variant:"destructive"});return}try{f(!0),await w4(u),p({title:"ๅˆ›ๅปบๆˆๅŠŸ",description:"้ป‘่ฏๅทฒๅˆ›ๅปบ"}),x({content:"",meaning:"",chat_id:"",is_global:!1}),c()}catch(N){p({title:"ๅˆ›ๅปบๅคฑ่ดฅ",description:N instanceof Error?N.message:"ๆ— ๆณ•ๅˆ›ๅปบ้ป‘่ฏ",variant:"destructive"})}finally{f(!1)}};return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ๆ–ฐๅขž้ป‘่ฏ"}),e.jsx(Ys,{children:"ๅˆ›ๅปบๆ–ฐ็š„้ป‘่ฏ่ฎฐๅฝ•"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"content",children:["ๅ†…ๅฎน ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"content",value:u.content,onChange:N=>x({...u,content:N.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅ†…ๅฎน"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"meaning",children:"ๅซไน‰"}),e.jsx(at,{id:"meaning",value:u.meaning||"",onChange:N=>x({...u,meaning:N.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅซไน‰๏ผˆๅฏ้€‰๏ผ‰",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"chat_id",children:["่Šๅคฉ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Be,{value:u.chat_id,onValueChange:N=>x({...u,chat_id:N}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:i.map(N=>e.jsx(W,{value:N.chat_id,children:N.chat_name},N.chat_id))})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"is_global",checked:u.is_global,onCheckedChange:N=>x({...u,is_global:N})}),e.jsx(T,{htmlFor:"is_global",children:"่ฎพไธบๅ…จๅฑ€้ป‘่ฏ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:g,disabled:h,children:h?"ๅˆ›ๅปบไธญ...":"ๅˆ›ๅปบ"})]})]})})}function z4({jargon:l,open:n,onOpenChange:i,chatList:c,onSuccess:u}){const[x,h]=m.useState({}),[f,p]=m.useState(!1),{toast:g}=st();m.useEffect(()=>{l&&h({content:l.content,meaning:l.meaning||"",chat_id:l.stream_id||l.chat_id,is_global:l.is_global,is_jargon:l.is_jargon})},[l]);const N=async()=>{if(l)try{p(!0),await _4(l.id,x),g({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้ป‘่ฏๅทฒๆ›ดๆ–ฐ"}),u()}catch(v){g({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:v instanceof Error?v.message:"ๆ— ๆณ•ๆ›ดๆ–ฐ้ป‘่ฏ",variant:"destructive"})}finally{p(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘้ป‘่ฏ"}),e.jsx(Ys,{children:"ไฟฎๆ”น้ป‘่ฏ็š„ไฟกๆฏ"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_content",children:"ๅ†…ๅฎน"}),e.jsx(ne,{id:"edit_content",value:x.content||"",onChange:v=>h({...x,content:v.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅ†…ๅฎน"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_meaning",children:"ๅซไน‰"}),e.jsx(at,{id:"edit_meaning",value:x.meaning||"",onChange:v=>h({...x,meaning:v.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅซไน‰",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_chat_id",children:"่Šๅคฉ"}),e.jsxs(Be,{value:x.chat_id||"",onValueChange:v=>h({...x,chat_id:v}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:c.map(v=>e.jsx(W,{value:v.chat_id,children:v.chat_name},v.chat_id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"้ป‘่ฏ็Šถๆ€"}),e.jsxs(Be,{value:x.is_jargon===null?"null":x.is_jargon?.toString()||"null",onValueChange:v=>h({...x,is_jargon:v==="null"?null:v==="true"}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"null",children:"ๆœชๅˆคๅฎš"}),e.jsx(W,{value:"true",children:"ๆ˜ฏ้ป‘่ฏ"}),e.jsx(W,{value:"false",children:"้ž้ป‘่ฏ"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ve,{id:"edit_is_global",checked:x.is_global,onCheckedChange:v=>h({...x,is_global:v})}),e.jsx(T,{htmlFor:"edit_is_global",children:"ๅ…จๅฑ€้ป‘่ฏ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:N,disabled:f,children:f?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}const Gr="/api/webui/person";async function D4(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.is_known!==void 0&&n.append("is_known",l.is_known.toString()),l.platform&&n.append("platform",l.platform);const i=await we(`${Gr}/list?${n}`,{headers:Fs()});if(!i.ok){const c=await i.json();throw new Error(c.detail||"่Žทๅ–ไบบ็‰ฉๅˆ—่กจๅคฑ่ดฅ")}return i.json()}async function O4(l){const n=await we(`${Gr}/${l}`,{headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"่Žทๅ–ไบบ็‰ฉ่ฏฆๆƒ…ๅคฑ่ดฅ")}return n.json()}async function R4(l,n){const i=await we(`${Gr}/${l}`,{method:"PATCH",headers:Fs(),body:JSON.stringify(n)});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ๆ›ดๆ–ฐไบบ็‰ฉไฟกๆฏๅคฑ่ดฅ")}return i.json()}async function L4(l){const n=await we(`${Gr}/${l}`,{method:"DELETE",headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ ้™คไบบ็‰ฉไฟกๆฏๅคฑ่ดฅ")}return n.json()}async function U4(){const l=await we(`${Gr}/stats/summary`,{headers:Fs()});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ")}return l.json()}async function B4(l){const n=await we(`${Gr}/batch/delete`,{method:"POST",headers:Fs(),body:JSON.stringify({person_ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ")}return n.json()}function $4(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(0),[h,f]=m.useState(1),[p,g]=m.useState(20),[N,v]=m.useState(""),[y,w]=m.useState(void 0),[b,D]=m.useState(void 0),[A,_]=m.useState(null),[P,E]=m.useState(!1),[C,M]=m.useState(!1),[G,O]=m.useState(null),[ee,R]=m.useState({total:0,known:0,unknown:0,platforms:{}}),[me,ce]=m.useState(new Set),[ve,se]=m.useState(!1),[ge,fe]=m.useState(""),{toast:z}=st(),Q=async()=>{try{c(!0);const X=await D4({page:h,page_size:p,search:N||void 0,is_known:y,platform:b});n(X.data),x(X.total)}catch(X){z({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:X instanceof Error?X.message:"ๆ— ๆณ•ๅŠ ่ฝฝไบบ็‰ฉไฟกๆฏ",variant:"destructive"})}finally{c(!1)}},$=async()=>{try{const X=await U4();X?.data&&R(X.data)}catch(X){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",X)}};m.useEffect(()=>{Q(),$()},[h,p,N,y,b]);const L=async X=>{try{const oe=await O4(X.person_id);_(oe.data),E(!0)}catch(oe){z({title:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๅŠ ่ฝฝไบบ็‰ฉ่ฏฆๆƒ…",variant:"destructive"})}},I=X=>{_(X),M(!0)},_e=async X=>{try{await L4(X.person_id),z({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™คไบบ็‰ฉไฟกๆฏ: ${X.person_name||X.nickname||X.user_id}`}),O(null),Q(),$()}catch(oe){z({title:"ๅˆ ้™คๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๅˆ ้™คไบบ็‰ฉไฟกๆฏ",variant:"destructive"})}},je=m.useMemo(()=>Object.keys(ee.platforms),[ee.platforms]),Se=X=>{const oe=new Set(me);oe.has(X)?oe.delete(X):oe.add(X),ce(oe)},K=()=>{me.size===l.length&&l.length>0?ce(new Set):ce(new Set(l.map(X=>X.person_id)))},U=()=>{if(me.size===0){z({title:"ๆœช้€‰ๆ‹ฉไปปไฝ•ไบบ็‰ฉ",description:"่ฏทๅ…ˆ้€‰ๆ‹ฉ่ฆๅˆ ้™ค็š„ไบบ็‰ฉ",variant:"destructive"});return}se(!0)},V=async()=>{try{const X=await B4(Array.from(me));z({title:"ๆ‰น้‡ๅˆ ้™คๅฎŒๆˆ",description:X.message}),ce(new Set),se(!1),Q(),$()}catch(X){z({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:X instanceof Error?X.message:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",variant:"destructive"})}},xe=()=>{const X=parseInt(ge),oe=Math.ceil(u/p);X>=1&&X<=oe?(f(X),fe("")):z({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${oe}ไน‹้—ด็š„้กต็ `,variant:"destructive"})},Ae=X=>X?new Date(X*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(Am,{className:"h-8 w-8",strokeWidth:2}),"ไบบ็‰ฉไฟกๆฏ็ฎก็†"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"็ฎก็†้บฆ้บฆ่ฎค่ฏ†็š„ๆ‰€ๆœ‰ไบบ็‰ฉไฟกๆฏ"})]})})}),e.jsx(Je,{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:ee.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:ee.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:ee.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(T,{htmlFor:"search",children:"ๆœ็ดข"}),e.jsxs("div",{className:"relative mt-1.5",children:[e.jsx(Ot,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{id:"search",placeholder:"ๆœ็ดขๅ็งฐใ€ๆ˜ต็งฐๆˆ–็”จๆˆทID...",value:N,onChange:X=>v(X.target.value),className:"pl-9"})]})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"filter-known",children:"่ฎค่ฏ†็Šถๆ€"}),e.jsxs(Be,{value:y===void 0?"all":y.toString(),onValueChange:X=>{w(X==="all"?void 0:X==="true"),f(1)},children:[e.jsx(Le,{id:"filter-known",className:"mt-1.5",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),e.jsx(W,{value:"true",children:"ๅทฒ่ฎค่ฏ†"}),e.jsx(W,{value:"false",children:"ๆœช่ฎค่ฏ†"})]})]})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"filter-platform",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:b||"all",onValueChange:X=>{D(X==="all"?void 0:X),f(1)},children:[e.jsx(Le,{id:"filter-platform",className:"mt-1.5",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจๅนณๅฐ"}),je.map(X=>e.jsxs(W,{value:X,children:[X," (",ee.platforms[X],")"]},X))]})]})]})]}),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:me.size>0&&e.jsxs("span",{children:["ๅทฒ้€‰ๆ‹ฉ ",me.size," ไธชไบบ็‰ฉ"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:p.toString(),onValueChange:X=>{g(parseInt(X)),f(1),ce(new Set)},children:[e.jsx(Le,{id:"page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]}),me.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>ce(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:U,children:[e.jsx(ns,{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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:l.length>0&&me.size===l.length,onCheckedChange:K,"aria-label":"ๅ…จ้€‰"})}),e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"ๆ˜ต็งฐ"}),e.jsx(Ze,{children:"ๅนณๅฐ"}),e.jsx(Ze,{children:"็”จๆˆทID"}),e.jsx(Ze,{children:"ๆœ€ๅŽๆ›ดๆ–ฐ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i?e.jsx(ot,{children:e.jsx(Ke,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."})}):l.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"})}):l.map(X=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:me.has(X.person_id),onCheckedChange:()=>Se(X.person_id),"aria-label":`้€‰ๆ‹ฉ ${X.person_name||X.nickname||X.user_id}`})}),e.jsx(Ke,{children:e.jsx("div",{className:H("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",X.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:X.is_known?"ๅทฒ่ฎค่ฏ†":"ๆœช่ฎค่ฏ†"})}),e.jsx(Ke,{className:"font-medium",children:X.person_name||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Ke,{children:X.nickname||"-"}),e.jsx(Ke,{children:X.platform}),e.jsx(Ke,{className:"font-mono text-sm",children:X.user_id}),e.jsx(Ke,{className:"text-sm text-muted-foreground",children:Ae(X.last_know)}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>L(X),children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"่ฏฆๆƒ…"]}),e.jsxs(S,{variant:"default",size:"sm",onClick:()=>I(X),children:[e.jsx(Hn,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>O(X),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅˆ ้™ค"]})]})})]},X.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:i?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."}):l.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):l.map(X=>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(Ws,{checked:me.has(X.person_id),onCheckedChange:()=>Se(X.person_id),className:"mt-1"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:H("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",X.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:X.is_known?"ๅทฒ่ฎค่ฏ†":"ๆœช่ฎค่ฏ†"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:X.person_name||e.jsx("span",{className:"text-muted-foreground",children:"ๆœชๅ‘ฝๅ"})}),X.nickname&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["ๆ˜ต็งฐ: ",X.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:X.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:X.user_id,children:X.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:Ae(X.last_know)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>L(X),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(na,{className:"h-3 w-3 mr-1"}),"ๆŸฅ็œ‹"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>I(X),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Hn,{className:"h-3 w-3 mr-1"}),"็ผ–่พ‘"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>O(X),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"ๅˆ ้™ค"]})]})]},X.id))}),u>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:["ๅ…ฑ ",u," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",h," / ",Math.ceil(u/p)," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h-1),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:ge,onChange:X=>fe(X.target.value),onKeyDown:X=>X.key==="Enter"&&xe(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/p)}),e.jsx(S,{variant:"outline",size:"sm",onClick:xe,disabled:!ge,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h+1),disabled:h>=Math.ceil(u/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(u/p)),disabled:h>=Math.ceil(u/p),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(I4,{person:A,open:P,onOpenChange:E}),e.jsx(P4,{person:A,open:C,onOpenChange:M,onSuccess:()=>{Q(),$(),M(!1)}}),e.jsx(js,{open:!!G,onOpenChange:()=>O(null),children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คไบบ็‰ฉไฟกๆฏ "',G?.person_name||G?.nickname||G?.user_id,'" ๅ—๏ผŸ ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>G&&_e(G),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:ve,onOpenChange:se,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",me.size," ไธชไบบ็‰ฉไฟกๆฏๅ—๏ผŸ ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:V,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๆ‰น้‡ๅˆ ้™ค"})]})]})})]})}function I4({person:l,open:n,onOpenChange:i}){if(!l)return null;const c=u=>u?new Date(u*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ไบบ็‰ฉ่ฏฆๆƒ…"}),e.jsxs(Ys,{children:["ๆŸฅ็œ‹ ",l.person_name||l.nickname||l.user_id," ็š„ๅฎŒๆ•ดไฟกๆฏ"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Cl,{icon:Bn,label:"ไบบ็‰ฉๅ็งฐ",value:l.person_name}),e.jsx(Cl,{icon:Pa,label:"ๆ˜ต็งฐ",value:l.nickname}),e.jsx(Cl,{icon:Ir,label:"็”จๆˆทID",value:l.user_id,mono:!0}),e.jsx(Cl,{icon:Ir,label:"ไบบ็‰ฉID",value:l.person_id,mono:!0}),e.jsx(Cl,{label:"ๅนณๅฐ",value:l.platform}),e.jsx(Cl,{label:"็Šถๆ€",value:l.is_known?"ๅทฒ่ฎค่ฏ†":"ๆœช่ฎค่ฏ†"})]}),l.name_reason&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅ็งฐ่ฎพๅฎšๅŽŸๅ› "}),e.jsx("p",{className:"mt-1 text-sm",children:l.name_reason})]}),l.memory_points&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ไธชไบบๅฐ่ฑก"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:l.memory_points})]}),l.group_nick_name&&l.group_nick_name.length>0&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"็พคๆ˜ต็งฐ"}),e.jsx("div",{className:"mt-2 space-y-1",children:l.group_nick_name.map((u,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:u.group_id}),e.jsx("span",{children:"โ†’"}),e.jsx("span",{children:u.group_nick_name})]},x))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Cl,{icon:Ya,label:"่ฎค่ฏ†ๆ—ถ้—ด",value:c(l.know_times)}),e.jsx(Cl,{icon:Ya,label:"้ฆ–ๆฌก่ฎฐๅฝ•",value:c(l.know_since)}),e.jsx(Cl,{icon:Ya,label:"ๆœ€ๅŽๆ›ดๆ–ฐ",value:c(l.last_know)})]})]}),e.jsx(et,{children:e.jsx(S,{onClick:()=>i(!1),children:"ๅ…ณ้—ญ"})})]})})}function Cl({icon:l,label:n,value:i,mono:c=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l&&e.jsx(l,{className:"h-3 w-3"}),n]}),e.jsx("div",{className:H("text-sm",c&&"font-mono",!i&&"text-muted-foreground"),children:i||"-"})]})}function P4({person:l,open:n,onOpenChange:i,onSuccess:c}){const[u,x]=m.useState({}),[h,f]=m.useState(!1),{toast:p}=st();m.useEffect(()=>{l&&x({person_name:l.person_name||"",name_reason:l.name_reason||"",nickname:l.nickname||"",is_known:l.is_known})},[l]);const g=async()=>{if(l)try{f(!0),await R4(l.person_id,u),p({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ไบบ็‰ฉไฟกๆฏๅทฒๆ›ดๆ–ฐ"}),c()}catch(N){p({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:N instanceof Error?N.message:"ๆ— ๆณ•ๆ›ดๆ–ฐไบบ็‰ฉไฟกๆฏ",variant:"destructive"})}finally{f(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘ไบบ็‰ฉไฟกๆฏ"}),e.jsxs(Ys,{children:["ไฟฎๆ”น ",l.person_name||l.nickname||l.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(T,{htmlFor:"person_name",children:"ไบบ็‰ฉๅ็งฐ"}),e.jsx(ne,{id:"person_name",value:u.person_name||"",onChange:N=>x({...u,person_name:N.target.value}),placeholder:"ไธบ่ฟ™ไธชไบบ่ฎพ็ฝฎไธ€ไธชๅ็งฐ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"nickname",children:"ๆ˜ต็งฐ"}),e.jsx(ne,{id:"nickname",value:u.nickname||"",onChange:N=>x({...u,nickname:N.target.value}),placeholder:"ๆ˜ต็งฐ"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name_reason",children:"ๅ็งฐ่ฎพๅฎšๅŽŸๅ› "}),e.jsx(at,{id:"name_reason",value:u.name_reason||"",onChange:N=>x({...u,name_reason:N.target.value}),placeholder:"ไธบไป€ไนˆ่ฟ™ๆ ท็งฐๅ‘ผ่ฟ™ไธชไบบ๏ผŸ",rows:2})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx(T,{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:u.is_known,onCheckedChange:N=>x({...u,is_known:N})})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:g,disabled:h,children:h?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}var H4=D1();const Sg=b0(H4),ex="/api/webui";async function F4(l=100,n="all"){const i=`${ex}/knowledge/graph?limit=${l}&node_type=${n}`,c=await fetch(i);if(!c.ok)throw new Error(`่Žทๅ–็Ÿฅ่ฏ†ๅ›พ่ฐฑๅคฑ่ดฅ: ${c.status}`);return c.json()}async function G4(){const l=await fetch(`${ex}/knowledge/stats`);if(!l.ok)throw new Error("่Žทๅ–็Ÿฅ่ฏ†ๅ›พ่ฐฑ็ปŸ่ฎกไฟกๆฏๅคฑ่ดฅ");return l.json()}async function V4(l){const n=await fetch(`${ex}/knowledge/search?query=${encodeURIComponent(l)}`);if(!n.ok)throw new Error("ๆœ็ดข็Ÿฅ่ฏ†่Š‚็‚นๅคฑ่ดฅ");return n.json()}const wv=m.memo(({data:l})=>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(Oo,{type:"target",position:Ro.Top}),e.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:l.content,children:l.label}),e.jsx(Oo,{type:"source",position:Ro.Bottom})]}));wv.displayName="EntityNode";const _v=m.memo(({data:l})=>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(Oo,{type:"target",position:Ro.Top}),e.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:l.content,children:l.label}),e.jsx(Oo,{type:"source",position:Ro.Bottom})]}));_v.displayName="ParagraphNode";const q4={entity:wv,paragraph:_v};function K4(l,n){const i=new Sg.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const c=[],u=[];return l.forEach(x=>{i.setNode(x.id,{width:150,height:50})}),n.forEach(x=>{i.setEdge(x.source,x.target)}),Sg.layout(i),l.forEach(x=>{const h=i.node(x.id);c.push({id:x.id,type:x.type,position:{x:h.x-75,y:h.y-25},data:{label:x.content.slice(0,20)+(x.content.length>20?"...":""),content:x.content}})}),n.forEach((x,h)=>{const f={id:`edge-${h}`,source:x.source,target:x.target,animated:l.length<=200&&x.weight>5,style:{strokeWidth:Math.min(x.weight/2,5),opacity:.6}};x.weight>10&&l.length<100&&(f.label=`${x.weight.toFixed(0)}`),u.push(f)}),{nodes:c,edges:u}}function Q4(){const l=ia(),[n,i]=m.useState(!1),[c,u]=m.useState(null),[x,h]=m.useState(""),[f,p]=m.useState("all"),[g,N]=m.useState(50),[v,y]=m.useState("50"),[w,b]=m.useState(!1),[D,A]=m.useState(!0),[_,P]=m.useState(!1),[E,C]=m.useState(!1),[M,G,O]=O1([]),[ee,R,me]=R1([]),[ce,ve]=m.useState(0),[se,ge]=m.useState(null),[fe,z]=m.useState(null),{toast:Q}=st(),$=m.useCallback(V=>V.type==="entity"?"#6366f1":V.type==="paragraph"?"#10b981":"#6b7280",[]),L=m.useCallback(async(V=!1)=>{try{if(!V&&g>200){C(!0);return}i(!0);const[xe,Ae]=await Promise.all([F4(g,f),G4()]);if(u(Ae),xe.nodes.length===0){Q({title:"ๆ็คบ",description:"็Ÿฅ่ฏ†ๅบ“ไธบ็ฉบ๏ผŒ่ฏทๅ…ˆๅฏผๅ…ฅ็Ÿฅ่ฏ†ๆ•ฐๆฎ"}),G([]),R([]);return}const{nodes:X,edges:oe}=K4(xe.nodes,xe.edges);G(X),R(oe),ve(X.length),Ae&&Ae.total_nodes>g&&Q({title:"ๆ็คบ",description:`็Ÿฅ่ฏ†ๅ›พ่ฐฑๅŒ…ๅซ ${Ae.total_nodes} ไธช่Š‚็‚น๏ผŒๅฝ“ๅ‰ๆ˜พ็คบ ${X.length} ไธช`}),Q({title:"ๅŠ ่ฝฝๆˆๅŠŸ",description:`ๅทฒๅŠ ่ฝฝ ${X.length} ไธช่Š‚็‚น๏ผŒ${oe.length} ๆก่พน`})}catch(xe){console.error("ๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑๅคฑ่ดฅ:",xe),Q({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:xe instanceof Error?xe.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{i(!1)}},[g,f,Q]),I=m.useCallback(async()=>{if(!x.trim()){Q({title:"ๆ็คบ",description:"่ฏท่พ“ๅ…ฅๆœ็ดขๅ…ณ้”ฎ่ฏ"});return}try{const V=await V4(x);if(V.length===0){Q({title:"ๆœชๆ‰พๅˆฐ",description:"ๆฒกๆœ‰ๆ‰พๅˆฐๅŒน้…็š„่Š‚็‚น"});return}const xe=new Set(V.map(Ae=>Ae.id));G(Ae=>Ae.map(X=>({...X,style:{...X.style,opacity:xe.has(X.id)?1:.3,filter:xe.has(X.id)?"brightness(1.2)":"brightness(0.8)"}}))),Q({title:"ๆœ็ดขๅฎŒๆˆ",description:`ๆ‰พๅˆฐ ${V.length} ไธชๅŒน้…่Š‚็‚น`})}catch(V){console.error("ๆœ็ดขๅคฑ่ดฅ:",V),Q({title:"ๆœ็ดขๅคฑ่ดฅ",description:V instanceof Error?V.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},[x,Q]),_e=m.useCallback(()=>{G(V=>V.map(xe=>({...xe,style:{...xe.style,opacity:1,filter:"brightness(1)"}})))},[]),je=m.useCallback(()=>{A(!1),P(!0),L()},[L]),Se=m.useCallback(()=>{C(!1),setTimeout(()=>{L(!0)},0)},[L]),K=m.useCallback((V,xe)=>{M.find(X=>X.id===xe.id)&&ge({id:xe.id,type:xe.type,content:xe.data.content})},[M]);m.useEffect(()=>{D||_&&L()},[g,f,D,_]);const U=m.useCallback((V,xe)=>{const Ae=M.find(Fe=>Fe.id===xe.source),X=M.find(Fe=>Fe.id===xe.target),oe=ee.find(Fe=>Fe.id===xe.id);Ae&&X&&oe&&z({source:{id:Ae.id,type:Ae.type,content:Ae.data.content},target:{id:X.id,type:X.type,content:X.data.content},edge:{source:xe.source,target:xe.target,weight:parseFloat(xe.label||"0")}})},[M,ee]);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:"ๅฏ่ง†ๅŒ–็Ÿฅ่ฏ†ๅฎžไฝ“ไธŽๅ…ณ็ณป็ฝ‘็ปœ"})]}),c&&e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Br,{className:"h-3 w-3"}),"่Š‚็‚น: ",c.total_nodes]}),e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Ej,{className:"h-3 w-3"}),"่พน: ",c.total_edges]}),e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Yt,{className:"h-3 w-3"}),"ๅฎžไฝ“: ",c.entity_nodes]}),e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Sa,{className:"h-3 w-3"}),"ๆฎต่ฝ: ",c.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(ne,{placeholder:"ๆœ็ดข่Š‚็‚นๅ†…ๅฎน...",value:x,onChange:V=>h(V.target.value),onKeyDown:V=>V.key==="Enter"&&I(),className:"flex-1"}),e.jsx(S,{onClick:I,size:"sm",children:e.jsx(Ot,{className:"h-4 w-4"})}),e.jsx(S,{onClick:_e,variant:"outline",size:"sm",children:"้‡็ฝฎ"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Be,{value:f,onValueChange:V=>p(V),children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ่Š‚็‚น"}),e.jsx(W,{value:"entity",children:"ไป…ๅฎžไฝ“"}),e.jsx(W,{value:"paragraph",children:"ไป…ๆฎต่ฝ"})]})]}),e.jsxs(Be,{value:g===1e4?"all":w?"custom":g.toString(),onValueChange:V=>{V==="custom"?(b(!0),y(g.toString())):V==="all"?(b(!1),N(1e4)):(b(!1),N(Number(V)))},children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"50",children:"50 ่Š‚็‚น"}),e.jsx(W,{value:"100",children:"100 ่Š‚็‚น"}),e.jsx(W,{value:"200",children:"200 ่Š‚็‚น"}),e.jsx(W,{value:"500",children:"500 ่Š‚็‚น"}),e.jsx(W,{value:"1000",children:"1000 ่Š‚็‚น"}),e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ (ๆœ€ๅคš10000)"}),e.jsx(W,{value:"custom",children:"่‡ชๅฎšไน‰..."})]})]}),w&&e.jsx(ne,{type:"number",min:"50",value:v,onChange:V=>y(V.target.value),onBlur:()=>{const V=parseInt(v);!isNaN(V)&&V>=50?N(V):(y("50"),N(50))},onKeyDown:V=>{if(V.key==="Enter"){const xe=parseInt(v);!isNaN(xe)&&xe>=50?N(xe):(y("50"),N(50))}},placeholder:"ๆœ€ๅฐ‘50ไธช",className:"w-[120px]"}),e.jsx(S,{onClick:()=>L(),variant:"outline",size:"sm",disabled:n,children:e.jsx(ft,{className:H("h-4 w-4",n&&"animate-spin")})})]})]})]}),e.jsx("div",{className:"flex-1 relative",children:n?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ft,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"ๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑไธญ..."})]})}):M.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Br,{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(L1,{nodes:M,edges:ee,onNodesChange:O,onEdgesChange:me,onNodeClick:K,onEdgeClick:U,nodeTypes:q4,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:ce<=500,nodesDraggable:ce<=1e3,attributionPosition:"bottom-left",children:[e.jsx(U1,{variant:B1.Dots,gap:12,size:1}),e.jsx($1,{}),ce<=500&&e.jsx(I1,{nodeColor:$,nodeBorderRadius:8,pannable:!0,zoomable:!0}),e.jsxs(P1,{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:"ๆฎต่ฝ่Š‚็‚น"})]}),ce>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:"ๅทฒ็ฆ็”จๅŠจ็”ป"}),ce>500&&e.jsx("div",{children:"ๅทฒ็ฆ็”จ็ผฉ็•ฅๅ›พ"})]})]})]})]})}),e.jsx(Ps,{open:!!se,onOpenChange:V=>!V&&ge(null),children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(Bs,{children:e.jsx($s,{children:"่Š‚็‚น่ฏฆๆƒ…"})}),se&&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(ke,{variant:se.type==="entity"?"default":"secondary",children:se.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:se.id})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ๅ†…ๅฎน"}),e.jsx(Je,{className:"mt-1 h-40 p-3 bg-muted rounded",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:se.content})})]})]})]})}),e.jsx(Ps,{open:!!fe,onOpenChange:V=>!V&&z(null),children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[e.jsx(Bs,{children:e.jsx($s,{children:"่พน่ฏฆๆƒ…"})}),fe&&e.jsx(Je,{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:fe.source.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[fe.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:fe.target.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[fe.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(ke,{variant:"outline",className:"text-base font-mono",children:fe.edge.weight.toFixed(4)})})]})]})})]})}),e.jsx(js,{open:D,onOpenChange:A,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"ๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑ"}),e.jsxs(hs,{children:["็Ÿฅ่ฏ†ๅ›พ่ฐฑ็š„ๅŠจๆ€ๅฑ•็คบไผšๆถˆ่€—่พƒๅคš็ณป็ปŸ่ต„ๆบใ€‚",e.jsx("br",{}),"็กฎๅฎš่ฆๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑๅ—?"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:()=>l({to:"/"}),children:"ๅ–ๆถˆ (่ฟ”ๅ›ž้ฆ–้กต)"}),e.jsx(fs,{onClick:je,children:"็กฎ่ฎคๅŠ ่ฝฝ"})]})]})}),e.jsx(js,{open:E,onOpenChange:C,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"โš ๏ธ ่Š‚็‚นๆ•ฐ้‡่พƒๅคš"}),e.jsx(hs,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["ๆ‚จๆญฃๅœจๅฐ่ฏ•ๅŠ ่ฝฝ ",e.jsx("strong",{className:"text-orange-600",children:g>=1e4?"ๅ…จ้ƒจ (ๆœ€ๅคš10000ไธช)":g})," ไธช่Š‚็‚นใ€‚"]}),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(ms,{children:[e.jsx(ps,{onClick:()=>{C(!1),g>200&&(N(50),b(!1))},children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Se,className:"bg-orange-600 hover:bg-orange-700",children:"ๆˆ‘ไบ†่งฃ้ฃŽ้™ฉ๏ผŒ็ปง็ปญๅŠ ่ฝฝ"})]})]})})]})}function Y4(){return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-none border-b bg-card/50 px-6 py-4",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"้บฆ้บฆ็Ÿฅ่ฏ†ๅบ“็ฎก็†"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"็ฎก็†ๅ’Œ็ป„็ป‡้บฆ้บฆ็š„็Ÿฅ่ฏ†ๅบ“ๅ†…ๅฎน"})]})})}),e.jsx("div",{className:"flex-1 overflow-auto p-6",children:e.jsx("div",{className:"mx-auto max-w-4xl",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:e.jsx(Br,{className:"h-10 w-10 text-primary"})}),e.jsx(He,{className:"text-2xl",children:"้บฆ้บฆ็Ÿฅ่ฏ†ๅบ“็ฎก็†"}),e.jsx(As,{className:"text-base",children:"ๅŠŸ่ƒฝๅผ€ๅ‘ไธญ๏ผŒๆ•ฌ่ฏทๆœŸๅพ…"})]}),e.jsx(Re,{className:"text-center text-sm text-muted-foreground",children:e.jsx("p",{children:"ๆญคๅŠŸ่ƒฝๅฐ†ๆไพ›็Ÿฅ่ฏ†ๅบ“็š„ๅˆ›ๅปบใ€็ผ–่พ‘ใ€ๅฏผๅ…ฅๅ’Œ็ฎก็†่ƒฝๅŠ›"})})]})})})]})}function kg({className:l,classNames:n,showOutsideDays:i=!0,captionLayout:c="label",buttonVariant:u="ghost",formatters:x,components:h,...f}){const p=Kj();return e.jsx(k1,{showOutsideDays:i,className:H("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`,l),captionLayout:c,formatters:{formatMonthDropdown:g=>g.toLocaleString("default",{month:"short"}),...x},classNames:{root:H("w-fit",p.root),months:H("relative flex flex-col gap-4 md:flex-row",p.months),month:H("flex w-full flex-col gap-4",p.month),nav:H("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",p.nav),button_previous:H(Pr({variant:u}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_previous),button_next:H(Pr({variant:u}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_next),month_caption:H("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",p.month_caption),dropdowns:H("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",p.dropdowns),dropdown_root:H("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:H("bg-popover absolute inset-0 opacity-0",p.dropdown),caption_label:H("select-none font-medium",c==="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:H("flex",p.weekdays),weekday:H("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",p.weekday),week:H("mt-2 flex w-full",p.week),week_number_header:H("w-[--cell-size] select-none",p.week_number_header),week_number:H("text-muted-foreground select-none text-[0.8rem]",p.week_number),day:H("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:H("bg-accent rounded-l-md",p.range_start),range_middle:H("rounded-none",p.range_middle),range_end:H("bg-accent rounded-r-md",p.range_end),today:H("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:H("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:H("text-muted-foreground opacity-50",p.disabled),hidden:H("invisible",p.hidden),...n},components:{Root:({className:g,rootRef:N,...v})=>e.jsx("div",{"data-slot":"calendar",ref:N,className:H(g),...v}),Chevron:({className:g,orientation:N,...v})=>N==="left"?e.jsx(Fa,{className:H("size-4",g),...v}):N==="right"?e.jsx(ea,{className:H("size-4",g),...v}):e.jsx(Ta,{className:H("size-4",g),...v}),DayButton:J4,WeekNumber:({children:g,...N})=>e.jsx("td",{...N,children:e.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:g})}),...h},...f})}function J4({className:l,day:n,modifiers:i,...c}){const u=Kj(),x=m.useRef(null);return m.useEffect(()=>{i.focused&&x.current?.focus()},[i.focused]),e.jsx(S,{ref:x,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:H("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",u.day,l),...c})}const wo={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 X4(){const[l,n]=m.useState([]),[i,c]=m.useState(""),[u,x]=m.useState("all"),[h,f]=m.useState("all"),[p,g]=m.useState(void 0),[N,v]=m.useState(void 0),[y,w]=m.useState(!0),[b,D]=m.useState(!1),[A,_]=m.useState("xs"),[P,E]=m.useState(4),[C,M]=m.useState(!1),G=m.useRef(null);m.useEffect(()=>{const I=Ln.getAllLogs();n(I);const _e=Ln.onLog(()=>{n(Ln.getAllLogs())}),je=Ln.onConnectionChange(Se=>{D(Se)});return()=>{_e(),je()}},[]);const O=m.useMemo(()=>{const I=new Set(l.map(_e=>_e.module).filter(_e=>_e&&_e.trim()!==""));return Array.from(I).sort()},[l]),ee=I=>{switch(I){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"}},R=I=>{switch(I){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"}},me=()=>{window.location.reload()},ce=()=>{Ln.clearLogs(),n([])},ve=()=>{const I=fe.map(K=>`${K.timestamp} [${K.level.padEnd(8)}] [${K.module}] ${K.message}`).join(` -`),_e=new Blob([I],{type:"text/plain;charset=utf-8"}),je=URL.createObjectURL(_e),Se=document.createElement("a");Se.href=je,Se.download=`logs-${mm(new Date,"yyyy-MM-dd-HHmmss")}.txt`,Se.click(),URL.revokeObjectURL(je)},se=()=>{w(!y)},ge=()=>{g(void 0),v(void 0)},fe=m.useMemo(()=>l.filter(I=>{const _e=i===""||I.message.toLowerCase().includes(i.toLowerCase())||I.module.toLowerCase().includes(i.toLowerCase()),je=u==="all"||I.level===u,Se=h==="all"||I.module===h;let K=!0;if(p||N){const U=new Date(I.timestamp);if(p){const V=new Date(p);V.setHours(0,0,0,0),K=K&&U>=V}if(N){const V=new Date(N);V.setHours(23,59,59,999),K=K&&U<=V}}return _e&&je&&Se&&K}),[l,i,u,h,p,N]),z=wo[A].rowHeight+P,Q=m0({count:fe.length,getScrollElement:()=>G.current,estimateSize:()=>z,overscan:50}),$=m.useRef(!1),L=m.useRef(fe.length);return m.useEffect(()=>{const I=G.current;if(!I)return;const _e=()=>{if($.current)return;const{scrollTop:je,scrollHeight:Se,clientHeight:K}=I,U=Se-je-K;U>100&&y?w(!1):U<50&&!y&&w(!0)};return I.addEventListener("scroll",_e,{passive:!0}),()=>I.removeEventListener("scroll",_e)},[y]),m.useEffect(()=>{const I=fe.length>L.current;L.current=fe.length,y&&fe.length>0&&I&&($.current=!0,Q.scrollToIndex(fe.length-1,{align:"end",behavior:"auto"}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{$.current=!1})}))},[fe.length,y,Q]),e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 space-y-2 sm:space-y-3 p-2 sm:p-3 lg:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg sm:text-xl lg:text-2xl font-bold",children:"ๆ—ฅๅฟ—ๆŸฅ็œ‹ๅ™จ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 hidden sm:block",children:"ๅฎžๆ—ถๆŸฅ็œ‹ๅ’Œๅˆ†ๆž้บฆ้บฆ่ฟ่กŒๆ—ฅๅฟ—"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:H("h-2 w-2 sm:h-2.5 sm:w-2.5 rounded-full",b?"bg-green-500 animate-pulse":"bg-red-500")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:b?"ๅทฒ่ฟžๆŽฅ":"ๆœช่ฟžๆŽฅ"})]})]}),e.jsx(Ce,{className:"p-2 sm:p-3",children:e.jsx(Xi,{open:C,onOpenChange:M,children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 relative min-w-0",children:[e.jsx(Ot,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆ—ฅๅฟ—...",value:i,onChange:I=>c(I.target.value),className:"pl-8 h-8 text-xs sm:text-sm"})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(S,{variant:y?"default":"outline",size:"sm",onClick:se,className:"h-8 px-2",title:y?"่‡ชๅŠจๆปšๅŠจ":"ๅทฒๆš‚ๅœ",children:[y?e.jsx(Zw,{className:"h-3.5 w-3.5"}):e.jsx(Ww,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1 text-xs hidden sm:inline",children:y?"ๆปšๅŠจ":"ๆš‚ๅœ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:ce,className:"h-8 px-2",title:"ๆธ…็ฉบๆ—ฅๅฟ—",children:[e.jsx(ns,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1 text-xs hidden md:inline",children:"ๆธ…็ฉบ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:ve,className:"h-8 px-2 hidden sm:flex",title:"ๅฏผๅ‡บๆ—ฅๅฟ—",children:[e.jsx(Zt,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1 text-xs hidden lg:inline",children:"ๅฏผๅ‡บ"})]}),e.jsx(Zi,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"h-8 px-2",title:C?"ๆ”ถ่ตท็ญ›้€‰":"ๅฑ•ๅผ€็ญ›้€‰",children:[e.jsx(So,{className:"h-3.5 w-3.5"}),C?e.jsx($r,{className:"h-3.5 w-3.5 ml-1"}):e.jsx(Ta,{className:"h-3.5 w-3.5 ml-1"})]})})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground text-center sm:text-right -mt-1",children:[e.jsxs("span",{className:"font-mono",children:[fe.length," / ",l.length]}),e.jsx("span",{className:"ml-1",children:"ๆกๆ—ฅๅฟ—"})]}),e.jsxs(Wi,{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-2",children:[e.jsxs(Be,{value:u,onValueChange:x,children:[e.jsxs(Le,{className:"w-full sm:flex-1 h-8 text-xs",children:[e.jsx(So,{className:"h-3.5 w-3.5 mr-1.5"}),e.jsx($e,{placeholder:"็บงๅˆซ"})]}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ็บงๅˆซ"}),e.jsx(W,{value:"DEBUG",children:"DEBUG"}),e.jsx(W,{value:"INFO",children:"INFO"}),e.jsx(W,{value:"WARNING",children:"WARNING"}),e.jsx(W,{value:"ERROR",children:"ERROR"}),e.jsx(W,{value:"CRITICAL",children:"CRITICAL"})]})]}),e.jsxs(Be,{value:h,onValueChange:f,children:[e.jsxs(Le,{className:"w-full sm:flex-1 h-8 text-xs",children:[e.jsx(So,{className:"h-3.5 w-3.5 mr-1.5"}),e.jsx($e,{placeholder:"ๆจกๅ—"})]}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจๆจกๅ—"}),O.map(I=>e.jsx(W,{value:I,children:I},I))]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-2",children:[e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:H("w-full sm:flex-1 justify-start text-left font-normal h-8",!p&&"text-muted-foreground"),children:[e.jsx(Zp,{className:"mr-1.5 h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:p?mm(p,"PP",{locale:bo}):"ๅผ€ๅง‹ๆ—ฅๆœŸ"})]})}),e.jsx(Ja,{className:"w-auto p-0",align:"start",children:e.jsx(kg,{mode:"single",selected:p,onSelect:g,initialFocus:!0,locale:bo})})]}),e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:H("w-full sm:flex-1 justify-start text-left font-normal h-8",!N&&"text-muted-foreground"),children:[e.jsx(Zp,{className:"mr-1.5 h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:N?mm(N,"PP",{locale:bo}):"็ป“ๆŸๆ—ฅๆœŸ"})]})}),e.jsx(Ja,{className:"w-auto p-0",align:"start",children:e.jsx(kg,{mode:"single",selected:N,onSelect:v,initialFocus:!0,locale:bo})})]}),(p||N)&&e.jsxs(S,{variant:"outline",size:"sm",onClick:ge,className:"w-full sm:w-auto h-8",children:[e.jsx(Ca,{className:"h-3.5 w-3.5 sm:mr-1"}),e.jsx("span",{className:"text-xs",children:"ๆธ…้™ค"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(e1,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:"ๅญ—ๅท"})]}),e.jsx("div",{className:"flex gap-1",children:Object.keys(wo).map(I=>e.jsx(S,{variant:A===I?"default":"outline",size:"sm",onClick:()=>_(I),className:"h-6 px-2 text-xs",children:wo[I].label},I))})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 max-w-[200px]",children:[e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"่กŒ่ท"}),e.jsx(_a,{value:[P],onValueChange:([I])=>E(I),min:0,max:12,step:2,className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground w-7",children:[P,"px"]})]}),e.jsxs("div",{className:"flex gap-2 sm:hidden",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:me,className:"flex-1 h-8",children:[e.jsx(ft,{className:"h-3.5 w-3.5 mr-1"}),e.jsx("span",{className:"text-xs",children:"ๅˆทๆ–ฐ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:ve,className:"flex-1 h-8",children:[e.jsx(Zt,{className:"h-3.5 w-3.5 mr-1"}),e.jsx("span",{className:"text-xs",children:"ๅฏผๅ‡บ"})]})]})]})]})]})})})]}),e.jsx("div",{className:"flex-1 min-h-0 px-2 sm:px-3 lg:px-4 pb-2 sm:pb-3 lg:pb-4",children:e.jsx(Ce,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full overflow-hidden",children:e.jsx("div",{ref:G,className:H("h-full overflow-auto","[&::-webkit-scrollbar]:w-2.5","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full","[&::-webkit-scrollbar-thumb:hover]:bg-border/80"),children:e.jsx("div",{className:H("p-2 sm:p-3 font-mono relative",wo[A].class),style:{height:`${Q.getTotalSize()}px`},children:fe.length===0?e.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-xs sm:text-sm",children:"ๆš‚ๆ— ๆ—ฅๅฟ—ๆ•ฐๆฎ"}):Q.getVirtualItems().map(I=>{const _e=fe[I.index];return e.jsxs("div",{"data-index":I.index,ref:Q.measureElement,className:H("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors",R(_e.level)),style:{transform:`translateY(${I.start}px)`,paddingTop:`${P/2}px`,paddingBottom:`${P/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 text-[10px]",children:_e.timestamp}),e.jsxs("span",{className:H("font-semibold text-[10px]",ee(_e.level)),children:["[",_e.level,"]"]})]}),e.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate text-[10px]",children:_e.module}),e.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words text-[10px]",children:_e.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:_e.timestamp}),e.jsxs("span",{className:H("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",ee(_e.level)),children:["[",_e.level,"]"]}),e.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:_e.module}),e.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:_e.message})]})]},I.key)})})})})})]})}async function Z4(){return(await we("/api/planner/overview")).json()}async function W4(l,n=1,i=20,c){const u=new URLSearchParams({page:n.toString(),page_size:i.toString()});return c&&u.append("search",c),(await we(`/api/planner/chat/${l}/logs?${u}`)).json()}async function ek(l,n){return(await we(`/api/planner/log/${l}/${n}`)).json()}async function sk(){return(await we("/api/replier/overview")).json()}async function tk(l,n=1,i=20,c){const u=new URLSearchParams({page:n.toString(),page_size:i.toString()});return c&&u.append("search",c),(await we(`/api/replier/chat/${l}/logs?${u}`)).json()}async function ak(l,n){return(await we(`/api/replier/log/${l}/${n}`)).json()}function Sv(){const[l,n]=m.useState(new Map),[i,c]=m.useState(!0),u=m.useCallback(async()=>{try{c(!0);const h=await yv();if(h?.data){const f=new Map;h.data.forEach(p=>{f.set(p.chat_id,p.chat_name)}),n(f)}}catch(h){console.error("ๅŠ ่ฝฝ่Šๅคฉๅˆ—่กจๅคฑ่ดฅ:",h)}finally{c(!1)}},[]);m.useEffect(()=>{u()},[u]);const x=m.useCallback(h=>l.get(h)||h,[l]);return{chatNameMap:l,getChatName:x,loading:i,reload:u}}function Uo(l){return new Date(l*1e3).toLocaleString("zh-CN")}function kv(l){const i=Date.now()/1e3-l;return i<60?"ๅˆšๅˆš":i<3600?`${Math.floor(i/60)} ๅˆ†้’Ÿๅ‰`:i<86400?`${Math.floor(i/3600)} ๅฐๆ—ถๅ‰`:`${Math.floor(i/86400)} ๅคฉๅ‰`}function Cv(l,n,i=1e4){m.useEffect(()=>{if(!l)return;const c=setInterval(n,i);return()=>clearInterval(c)},[l,n,i])}function lk({autoRefresh:l,refreshKey:n}){const[i,c]=m.useState("overview"),[u,x]=m.useState(null),{getChatName:h}=Sv(),[f,p]=m.useState(null),[g,N]=m.useState(!0),[v,y]=m.useState(null),[w,b]=m.useState(!1),[D,A]=m.useState(1),[_,P]=m.useState(20),[E,C]=m.useState(""),[M,G]=m.useState(""),[O,ee]=m.useState(""),[R,me]=m.useState(null),[ce,ve]=m.useState(!1),[se,ge]=m.useState(!1),fe=m.useCallback(async()=>{try{N(!0);const U=await Z4();p(U)}catch(U){console.error("ๅŠ ่ฝฝ่ง„ๅˆ’ๅ™จๆ€ป่งˆๅคฑ่ดฅ:",U)}finally{N(!1)}},[]),z=m.useCallback(async()=>{if(u)try{b(!0);const U=await W4(u.chat_id,D,_,M||void 0);y(U)}catch(U){console.error("ๅŠ ่ฝฝ่Šๅคฉๆ—ฅๅฟ—ๅคฑ่ดฅ:",U)}finally{b(!1)}},[u,D,_,M]);m.useEffect(()=>{fe()},[fe]),m.useEffect(()=>{n>0&&(i==="overview"?fe():z())},[n,i,fe,z]),m.useEffect(()=>{i==="chat-logs"&&u&&z()},[i,u,z]),Cv(l,m.useCallback(()=>{i==="overview"?fe():z()},[i,fe,z]));const Q=U=>{x(U),A(1),G(""),ee(""),c("chat-logs")},$=()=>{c("overview"),x(null),y(null),G(""),ee("")},L=()=>{G(O),A(1)},I=()=>{ee(""),G(""),A(1)},_e=async(U,V)=>{try{ge(!0),ve(!0);const xe=await ek(U,V);me(xe)}catch(xe){console.error("ๅŠ ่ฝฝ่ฎกๅˆ’่ฏฆๆƒ…ๅคฑ่ดฅ:",xe)}finally{ge(!1)}},je=U=>{P(Number(U)),A(1)},Se=()=>{const U=parseInt(E),V=v?Math.ceil(v.total/v.page_size):0;!isNaN(U)&&U>=1&&U<=V&&(A(U),C(""))},K=v?Math.ceil(v.total/v.page_size):0;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-4",children:i==="overview"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"่Šๅคฉๆ•ฐ้‡"}),e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_chats||0})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"่ฎกๅˆ’ๆ€ปๆ•ฐ"}),e.jsx(Im,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_plans||0})})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่Šๅคฉๅˆ—่กจ"}),e.jsx(As,{children:"็‚นๅ‡ปๆŸฅ็œ‹่ฏฅ่Šๅคฉ็š„ๆ‰€ๆœ‰่ฎกๅˆ’่ฎฐๅฝ•"})]}),e.jsx(Re,{children:g?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):f?.chats&&f.chats.length>0?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:f.chats.map(U=>e.jsxs("div",{className:"border rounded-lg p-4 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>Q(U),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm truncate max-w-[180px]",title:h(U.chat_id),children:h(U.chat_id)})]}),e.jsx(ke,{variant:"secondary",children:U.plan_count})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ๆœ€ๅŽๆดปๅŠจ: ",kv(U.latest_timestamp)]})]},U.chat_id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ่Šๅคฉ่ฎฐๅฝ•"})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:$,children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"่ฟ”ๅ›ž่Šๅคฉๅˆ—่กจ"]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉ: ",e.jsx("span",{className:"font-medium",children:u?h(u.chat_id):""}),e.jsx("span",{className:"mx-2",children:"โ€ข"}),"ๅ…ฑ ",v?.total||0," ๆก่ฎกๅˆ’่ฎฐๅฝ•"]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(He,{children:"่ฎกๅˆ’ๆ‰ง่กŒ่ฎฐๅฝ•"}),e.jsx(As,{children:u?h(u.chat_id):""})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ne,{placeholder:"ๆœ็ดขๆ็คบ่ฏๅ†…ๅฎน...",value:O,onChange:U=>ee(U.target.value),onKeyDown:U=>U.key==="Enter"&&L(),className:"w-48"}),e.jsx(S,{variant:"outline",size:"icon",onClick:L,children:e.jsx(Ot,{className:"h-4 w-4"})}),M&&e.jsx(S,{variant:"ghost",size:"sm",onClick:I,children:"ๆธ…้™ค"})]}),e.jsxs(Be,{value:_.toString(),onValueChange:je,children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10ๆก/้กต"}),e.jsx(W,{value:"20",children:"20ๆก/้กต"}),e.jsx(W,{value:"50",children:"50ๆก/้กต"}),e.jsx(W,{value:"100",children:"100ๆก/้กต"})]})]})]})]}),M&&e.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:["ๆœ็ดขๅ…ณ้”ฎ่ฏ: ",e.jsxs("span",{className:"font-medium",children:['"',M,'"']})]})]}),e.jsx(Re,{children:w?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-20 w-full"},V))}):v?.data&&v.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-2",children:v.data.map(U=>e.jsxs("div",{className:"border rounded-lg p-3 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>_e(U.chat_id,U.filename),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:Uo(U.timestamp)}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs(ke,{variant:"secondary",className:"text-xs",children:[U.action_count," ไธชๅŠจไฝœ"]}),e.jsxs(ke,{variant:"outline",className:"text-xs",children:[U.total_plan_ms.toFixed(0),"ms"]})]})]}),U.action_types&&U.action_types.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:U.action_types.map((V,xe)=>e.jsx(ke,{variant:"outline",className:"text-xs bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-800",children:V},xe))}),e.jsx("p",{className:"text-sm line-clamp-2",children:U.reasoning_preview||"ๆ— ๆŽจ็†ๅ†…ๅฎน"})]},U.filename))}),e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅ…ฑ ",v.total," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",D," / ",K," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(1),disabled:D===1,children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.max(1,U-1)),disabled:D===1,children:e.jsx(Fa,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{type:"number",min:1,max:K,value:E,onChange:U=>C(U.target.value),onKeyDown:U=>U.key==="Enter"&&Se(),placeholder:"่ทณ่ฝฌ",className:"w-20 h-8"}),e.jsx(S,{size:"sm",variant:"outline",onClick:Se,children:"่ทณ่ฝฌ"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.min(K,U+1)),disabled:D===K,children:e.jsx(ea,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(K),disabled:D===K,children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ่ฎกๅˆ’่ฎฐๅฝ•"})})]})]})}),e.jsx(Ps,{open:ce,onOpenChange:ve,children:e.jsxs(Us,{className:"max-w-4xl max-h-[80vh] grid grid-rows-[auto_1fr_auto] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"h-5 w-5"}),"่ฎกๅˆ’ๆ‰ง่กŒ่ฏฆๆƒ…"]}),e.jsx(Ys,{children:"ๆŸฅ็œ‹้บฆ้บฆ็š„่ฏฆ็ป†่ฎกๅˆ’ๆŽจ็†่ฟ‡็จ‹ๅ’Œๆ‰ง่กŒๅŠจไฝœ"})]}),e.jsx(Je,{className:"h-full pr-4",children:e.jsx("div",{className:"space-y-6 pb-4",children:se?e.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):R?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ya,{className:"h-4 w-4"}),"ๅŸบๆœฌไฟกๆฏ"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-muted/50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"่Šๅคฉ"}),e.jsx("div",{className:"text-sm",title:R.chat_id,children:h(R.chat_id)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๆ—ถ้—ดๆˆณ"}),e.jsx("div",{className:"text-sm",children:Uo(R.timestamp)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"็ฑปๅž‹"}),e.jsx(ke,{variant:"outline",children:R.type})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๅŠจไฝœๆ•ฐ้‡"}),e.jsxs(ke,{children:[R.actions.length," ไธชๅŠจไฝœ"]})]})]})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(El,{className:"h-4 w-4"}),"ๆ€ง่ƒฝ็ปŸ่ฎก"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ็คบ่ฏๆž„ๅปบ"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.prompt_build_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"LLM ๆŽจ็†"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.llm_duration_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ€ป่ฎกๅˆ’ๆ—ถ้—ด"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.total_plan_ms?.toFixed(2)||0,"ms"]})})]})]})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Mj,{className:"h-4 w-4"}),"ๆŽจ็†่ฟ‡็จ‹"]}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:R.reasoning||"ๆ— ๆŽจ็†ๅ†…ๅฎน"})})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(s1,{className:"h-4 w-4"}),"ๆ‰ง่กŒๅŠจไฝœ (",R.actions.length,")"]}),e.jsx("div",{className:"space-y-3",children:R.actions.map((U,V)=>e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-3",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ke,{variant:"default",children:["ๅŠจไฝœ ",V+1]}),e.jsx(ke,{variant:"outline",children:U.action_type})]})})}),e.jsxs(Re,{className:"p-4 pt-0 space-y-3",children:[U.reasoning&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๆŽจ็†ไพๆฎ"}),e.jsx("p",{className:"text-sm bg-muted/30 p-2 rounded",children:typeof U.reasoning=="string"?U.reasoning:JSON.stringify(U.reasoning)})]}),U.action_message&&e.jsxs("div",{className:"overflow-hidden",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๅŠจไฝœๆถˆๆฏ"}),typeof U.action_message=="string"?e.jsx("p",{className:"text-sm bg-muted/30 p-2 rounded break-all whitespace-pre-wrap",children:U.action_message}):e.jsx("pre",{className:"text-xs bg-muted/30 p-2 rounded overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify(U.action_message,null,2)})]}),U.action_data&&Object.keys(U.action_data).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๅŠจไฝœๆ•ฐๆฎ"}),e.jsx("pre",{className:"text-xs bg-muted/30 p-2 rounded overflow-x-auto",children:JSON.stringify(U.action_data,null,2)})]}),U.action_reasoning&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๅŠจไฝœๆŽจ็†"}),e.jsx("p",{className:"text-sm bg-muted/30 p-2 rounded",children:typeof U.action_reasoning=="string"?U.action_reasoning:JSON.stringify(U.action_reasoning)})]})]})]},V))})]}),e.jsx(Kt,{}),R.raw_output&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅŽŸๅง‹่พ“ๅ‡บ"}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"็‚นๅ‡ปๅฑ•ๅผ€ๆŸฅ็œ‹ๅฎŒๆ•ดๅŽŸๅง‹่พ“ๅ‡บ"}),e.jsx("div",{className:"mt-2 p-4 bg-muted/50 rounded-lg",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:R.raw_output})})]})]}),R.prompt&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"็‚นๅ‡ปๅฑ•ๅผ€ๆŸฅ็œ‹ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsx("div",{className:"mt-2 p-4 bg-muted/50 rounded-lg",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:R.prompt})})]})]})]}):e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"ๆ— ๆ•ฐๆฎ"})})})}),e.jsx(et,{className:"flex-shrink-0",children:e.jsx(S,{onClick:()=>ve(!1),children:"ๅ…ณ้—ญ"})})]})})]})}function nk({autoRefresh:l,refreshKey:n}){const[i,c]=m.useState("overview"),[u,x]=m.useState(null),{getChatName:h}=Sv(),[f,p]=m.useState(null),[g,N]=m.useState(!0),[v,y]=m.useState(null),[w,b]=m.useState(!1),[D,A]=m.useState(1),[_,P]=m.useState(20),[E,C]=m.useState(""),[M,G]=m.useState(""),[O,ee]=m.useState(""),[R,me]=m.useState(null),[ce,ve]=m.useState(!1),[se,ge]=m.useState(!1),fe=m.useCallback(async()=>{try{N(!0);const U=await sk();p(U)}catch(U){console.error("ๅŠ ่ฝฝๅ›žๅคๅ™จๆ€ป่งˆๅคฑ่ดฅ:",U)}finally{N(!1)}},[]),z=m.useCallback(async()=>{if(u)try{b(!0);const U=await tk(u.chat_id,D,_,M||void 0);y(U)}catch(U){console.error("ๅŠ ่ฝฝ่Šๅคฉๆ—ฅๅฟ—ๅคฑ่ดฅ:",U)}finally{b(!1)}},[u,D,_,M]);m.useEffect(()=>{fe()},[fe]),m.useEffect(()=>{n>0&&(i==="overview"?fe():z())},[n,i,fe,z]),m.useEffect(()=>{i==="chat-logs"&&u&&z()},[i,u,z]),Cv(l,m.useCallback(()=>{i==="overview"?fe():z()},[i,fe,z]));const Q=U=>{x(U),A(1),G(""),ee(""),c("chat-logs")},$=()=>{c("overview"),x(null),y(null),G(""),ee("")},L=()=>{G(O),A(1)},I=()=>{ee(""),G(""),A(1)},_e=async(U,V)=>{try{ge(!0),ve(!0);const xe=await ak(U,V);me(xe)}catch(xe){console.error("ๅŠ ่ฝฝๅ›žๅค่ฏฆๆƒ…ๅคฑ่ดฅ:",xe)}finally{ge(!1)}},je=U=>{P(Number(U)),A(1)},Se=()=>{const U=parseInt(E),V=v?Math.ceil(v.total/v.page_size):0;!isNaN(U)&&U>=1&&U<=V&&(A(U),C(""))},K=v?Math.ceil(v.total/v.page_size):0;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-4",children:i==="overview"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"่Šๅคฉๆ•ฐ้‡"}),e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_chats||0})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅ›žๅคๆ€ปๆ•ฐ"}),e.jsx(Im,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_replies||0})})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่Šๅคฉๅˆ—่กจ"}),e.jsx(As,{children:"็‚นๅ‡ปๆŸฅ็œ‹่ฏฅ่Šๅคฉ็š„ๆ‰€ๆœ‰ๅ›žๅค่ฎฐๅฝ•"})]}),e.jsx(Re,{children:g?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):f?.chats&&f.chats.length>0?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:f.chats.map(U=>e.jsxs("div",{className:"border rounded-lg p-4 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>Q(U),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm truncate max-w-[180px]",title:h(U.chat_id),children:h(U.chat_id)})]}),e.jsx(ke,{variant:"secondary",children:U.reply_count})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ๆœ€ๅŽๆดปๅŠจ: ",kv(U.latest_timestamp)]})]},U.chat_id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ่Šๅคฉ่ฎฐๅฝ•"})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:$,children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"่ฟ”ๅ›ž่Šๅคฉๅˆ—่กจ"]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉ: ",e.jsx("span",{className:"font-medium",children:u?h(u.chat_id):""}),e.jsx("span",{className:"mx-2",children:"โ€ข"}),"ๅ…ฑ ",v?.total||0," ๆกๅ›žๅค่ฎฐๅฝ•"]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(He,{children:"ๅ›žๅค็”Ÿๆˆ่ฎฐๅฝ•"}),e.jsx(As,{children:u?h(u.chat_id):""})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ne,{placeholder:"ๆœ็ดขๆ็คบ่ฏๅ†…ๅฎน...",value:O,onChange:U=>ee(U.target.value),onKeyDown:U=>U.key==="Enter"&&L(),className:"w-48"}),e.jsx(S,{variant:"outline",size:"icon",onClick:L,children:e.jsx(Ot,{className:"h-4 w-4"})}),M&&e.jsx(S,{variant:"ghost",size:"sm",onClick:I,children:"ๆธ…้™ค"})]}),e.jsxs(Be,{value:_.toString(),onValueChange:je,children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10ๆก/้กต"}),e.jsx(W,{value:"20",children:"20ๆก/้กต"}),e.jsx(W,{value:"50",children:"50ๆก/้กต"}),e.jsx(W,{value:"100",children:"100ๆก/้กต"})]})]})]})]}),M&&e.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:["ๆœ็ดขๅ…ณ้”ฎ่ฏ: ",e.jsxs("span",{className:"font-medium",children:['"',M,'"']})]})]}),e.jsx(Re,{children:w?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-20 w-full"},V))}):v?.data&&v.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-2",children:v.data.map(U=>e.jsxs("div",{className:"border rounded-lg p-3 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>_e(U.chat_id,U.filename),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:Uo(U.timestamp)}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[U.success?e.jsxs(ke,{variant:"default",className:"text-xs bg-green-600",children:[e.jsx(Wp,{className:"h-3 w-3 mr-1"}),"ๆˆๅŠŸ"]}):e.jsxs(ke,{variant:"destructive",className:"text-xs",children:[e.jsx(Mo,{className:"h-3 w-3 mr-1"}),"ๅคฑ่ดฅ"]}),e.jsx(ke,{variant:"outline",className:"text-xs",children:U.model}),e.jsxs(ke,{variant:"secondary",className:"text-xs",children:[U.overall_ms.toFixed(0),"ms"]})]})]}),e.jsx("p",{className:"text-sm line-clamp-2",children:U.output_preview||"ๆ— ่พ“ๅ‡บๅ†…ๅฎน"})]},U.filename))}),e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅ…ฑ ",v.total," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",D," / ",K," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(1),disabled:D===1,children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.max(1,U-1)),disabled:D===1,children:e.jsx(Fa,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{type:"number",min:1,max:K,value:E,onChange:U=>C(U.target.value),onKeyDown:U=>U.key==="Enter"&&Se(),placeholder:"่ทณ่ฝฌ",className:"w-20 h-8"}),e.jsx(S,{size:"sm",variant:"outline",onClick:Se,children:"่ทณ่ฝฌ"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.min(K,U+1)),disabled:D===K,children:e.jsx(ea,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(K),disabled:D===K,children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๅ›žๅค่ฎฐๅฝ•"})})]})]})}),e.jsx(Ps,{open:ce,onOpenChange:ve,children:e.jsxs(Us,{className:"max-w-4xl max-h-[80vh] grid grid-rows-[auto_1fr_auto] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"h-5 w-5"}),"ๅ›žๅค็”Ÿๆˆ่ฏฆๆƒ…"]}),e.jsx(Ys,{children:"ๆŸฅ็œ‹้บฆ้บฆ็š„่ฏฆ็ป†ๅ›žๅค็”Ÿๆˆ่ฟ‡็จ‹"})]}),e.jsx(Je,{className:"h-full pr-4",children:e.jsx("div",{className:"space-y-6 pb-4",children:se?e.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):R?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ya,{className:"h-4 w-4"}),"ๅŸบๆœฌไฟกๆฏ"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-muted/50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"่Šๅคฉ"}),e.jsx("div",{className:"text-sm",title:R.chat_id,children:h(R.chat_id)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๆ—ถ้—ดๆˆณ"}),e.jsx("div",{className:"text-sm",children:Uo(R.timestamp)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"็Šถๆ€"}),R.success?e.jsxs(ke,{variant:"default",className:"bg-green-600",children:[e.jsx(Wp,{className:"h-3 w-3 mr-1"}),"ๆˆๅŠŸ"]}):e.jsxs(ke,{variant:"destructive",children:[e.jsx(Mo,{className:"h-3 w-3 mr-1"}),"ๅคฑ่ดฅ"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๆ€่€ƒๆทฑๅบฆ"}),e.jsxs(ke,{variant:"outline",children:["Level ",R.think_level]})]})]})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(t1,{className:"h-4 w-4"}),"ๆจกๅž‹ไฟกๆฏ"]}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx(ke,{variant:"secondary",className:"text-sm",children:R.model})})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(El,{className:"h-4 w-4"}),"ๆ€ง่ƒฝ็ปŸ่ฎก"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ็คบ่ฏๆž„ๅปบ"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.prompt_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"LLM ๆŽจ็†"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.llm_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ€ป่€—ๆ—ถ"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.overall_ms?.toFixed(2)||0,"ms"]})})]})]}),R.timing.timing_logs&&R.timing.timing_logs.length>0&&e.jsxs("div",{className:"mt-3 p-3 bg-muted/30 rounded-lg",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"่€—ๆ—ถ่ฏฆๆƒ…"}),e.jsx("div",{className:"space-y-1",children:R.timing.timing_logs.map((U,V)=>e.jsx("div",{className:"text-xs text-muted-foreground",children:U},V))})]}),R.timing.almost_zero&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"่ฟ‘ไนŽ้›ถ่€—ๆ—ถ: "}),R.timing.almost_zero]})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Mj,{className:"h-4 w-4"}),"ๅ›žๅค่พ“ๅ‡บ"]}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:R.output||"ๆ— ่พ“ๅ‡บๅ†…ๅฎน"})})]}),R.processed_output&&R.processed_output.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅค„็†ๅŽ็š„่พ“ๅ‡บ"}),e.jsx("div",{className:"space-y-2",children:R.processed_output.map((U,V)=>e.jsx("div",{className:"p-3 bg-muted/30 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:U})},V))})]})]}),R.reasoning&&e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๆŽจ็†่ฟ‡็จ‹"}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:R.reasoning})})]})]}),R.error&&e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-destructive",children:"้”™่ฏฏไฟกๆฏ"}),e.jsx("div",{className:"p-4 bg-destructive/10 rounded-lg border border-destructive/20",children:e.jsx("p",{className:"text-sm text-destructive whitespace-pre-wrap",children:R.error})})]})]}),R.prompt&&e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"็‚นๅ‡ปๅฑ•ๅผ€ๆŸฅ็œ‹ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsx("div",{className:"mt-2 p-4 bg-muted/50 rounded-lg",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:R.prompt})})]})]})]})]}):e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"ๆ— ๆ•ฐๆฎ"})})})}),e.jsx(et,{className:"flex-shrink-0",children:e.jsx(S,{onClick:()=>ve(!1),children:"ๅ…ณ้—ญ"})})]})})]})}function rk(){const[l,n]=m.useState("planner"),[i,c]=m.useState(!1),[u,x]=m.useState(0),h=m.useCallback(()=>{x(f=>f+1)},[]);return 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 items-center gap-2",children:[e.jsxs(S,{variant:i?"default":"outline",size:"sm",onClick:()=>c(!i),children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),i?"่‡ชๅŠจๅˆทๆ–ฐไธญ":"่‡ชๅŠจๅˆทๆ–ฐ"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:h,children:e.jsx(ft,{className:"h-4 w-4"})})]})]}),e.jsxs(ra,{value:l,onValueChange:f=>n(f),className:"w-full",children:[e.jsxs(Wt,{className:"grid w-full grid-cols-2 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(ts,{value:"planner",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx($m,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"่ฎกๅˆ’ๅ™จ็›‘ๆŽง"})]}),e.jsxs(ts,{value:"replier",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(a1,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅ›žๅคๅ™จ็›‘ๆŽง"})]})]}),e.jsxs(Je,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(bs,{value:"planner",className:"mt-0",children:e.jsx(lk,{autoRefresh:i,refreshKey:u})}),e.jsx(bs,{value:"replier",className:"mt-0",children:e.jsx(nk,{autoRefresh:i,refreshKey:u})})]})]})]})}const ik="Mai-with-u",ck="plugin-repo",ok="main",dk="plugin_details.json";async function uk(){try{const l=await we("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:ik,repo:ck,branch:ok,file_path:dk})});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const n=await l.json();if(!n.success||!n.data)throw new Error(n.error||"่Žทๅ–ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");return JSON.parse(n.data).filter(u=>!u?.id||!u?.manifest?(console.warn("่ทณ่ฟ‡ๆ— ๆ•ˆๆ’ไปถๆ•ฐๆฎ:",u),!1):!u.manifest.name||!u.manifest.version?(console.warn("่ทณ่ฟ‡็ผบๅฐ‘ๅฟ…้œ€ๅญ—ๆฎต็š„ๆ’ไปถ:",u.id),!1):!0).map(u=>({id:u.id,manifest:{manifest_version:u.manifest.manifest_version||1,name:u.manifest.name,version:u.manifest.version,description:u.manifest.description||"",author:u.manifest.author||{name:"Unknown"},license:u.manifest.license||"Unknown",host_application:u.manifest.host_application||{min_version:"0.0.0"},homepage_url:u.manifest.homepage_url,repository_url:u.manifest.repository_url,keywords:u.manifest.keywords||[],categories:u.manifest.categories||[],default_locale:u.manifest.default_locale||"zh-CN",locales_path:u.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(l){throw console.error("Failed to fetch plugin list:",l),l}}async function Tv(){try{const l=await we("/api/webui/plugins/git-status");if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return await l.json()}catch(l){return console.error("Failed to check Git status:",l),{installed:!1,error:"ๆ— ๆณ•ๆฃ€ๆต‹ Git ๅฎ‰่ฃ…็Šถๆ€"}}}async function Ev(){try{const l=await we("/api/webui/plugins/version");if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return await l.json()}catch(l){return console.error("Failed to get Maimai version:",l),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function Mv(l,n,i){const c=l.split(".").map(f=>parseInt(f)||0),u=c[0]||0,x=c[1]||0,h=c[2]||0;if(i.version_majorparseInt(v)||0),p=f[0]||0,g=f[1]||0,N=f[2]||0;if(i.version_major>p||i.version_major===p&&i.version_minor>g||i.version_major===p&&i.version_minor===g&&i.version_patch>N)return!1}return!0}async function mk(){try{const l=await we("/api/webui/ws-token");if(!l.ok)return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",l.status),null;const n=await l.json();return n.success&&n.token?n.token:null}catch(l){return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",l),null}}async function xk(l,n){const i=await mk();if(!i)return console.warn("ๆ— ๆณ•่Žทๅ– WebSocket token๏ผŒๅฏ่ƒฝๆœช็™ปๅฝ•"),null;const c=window.location.protocol==="https:"?"wss:":"ws:",u=window.location.host,x=`${c}//${u}/api/webui/ws/plugin-progress?token=${encodeURIComponent(i)}`;try{const h=new WebSocket(x);return h.onopen=()=>{console.log("Plugin progress WebSocket connected");const f=setInterval(()=>{h.readyState===WebSocket.OPEN?h.send("ping"):clearInterval(f)},3e4)},h.onmessage=f=>{try{if(f.data==="pong")return;const p=JSON.parse(f.data);l(p)}catch(p){console.error("Failed to parse progress data:",p)}},h.onerror=f=>{console.error("Plugin progress WebSocket error:",f),n?.(f)},h.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},h}catch(h){return console.error("ๅˆ›ๅปบ WebSocket ่ฟžๆŽฅๅคฑ่ดฅ:",h),null}}async function Tl(){try{const l=await we("/api/webui/plugins/installed",{headers:Fs()});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const n=await l.json();if(!n.success)throw new Error(n.message||"่Žทๅ–ๅทฒๅฎ‰่ฃ…ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");return n.plugins||[]}catch(l){return console.error("Failed to get installed plugins:",l),[]}}function on(l,n){return n.some(i=>i.id===l)}function dn(l,n){const i=n.find(c=>c.id===l);if(i)return i.manifest?.version||i.version}async function Av(l,n,i="main"){const c=await we("/api/webui/plugins/install",{method:"POST",body:JSON.stringify({plugin_id:l,repository_url:n,branch:i})});if(!c.ok){const u=await c.json();throw new Error(u.detail||"ๅฎ‰่ฃ…ๅคฑ่ดฅ")}return await c.json()}async function zv(l){const n=await we("/api/webui/plugins/uninstall",{method:"POST",body:JSON.stringify({plugin_id:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅธ่ฝฝๅคฑ่ดฅ")}return await n.json()}async function Dv(l,n,i="main"){const c=await we("/api/webui/plugins/update",{method:"POST",body:JSON.stringify({plugin_id:l,repository_url:n,branch:i})});if(!c.ok){const u=await c.json();throw new Error(u.detail||"ๆ›ดๆ–ฐๅคฑ่ดฅ")}return await c.json()}async function hk(l){const n=await we(`/api/webui/plugins/config/${l}/schema`,{headers:Fs()});if(!n.ok){const c=await n.text();try{const u=JSON.parse(c);throw new Error(u.detail||"่Žทๅ–้…็ฝฎ Schema ๅคฑ่ดฅ")}catch{throw new Error(`่Žทๅ–้…็ฝฎ Schema ๅคฑ่ดฅ (${n.status})`)}}const i=await n.json();if(!i.success)throw new Error(i.message||"่Žทๅ–้…็ฝฎ Schema ๅคฑ่ดฅ");return i.schema}async function fk(l){const n=await we(`/api/webui/plugins/config/${l}`,{headers:Fs()});if(!n.ok){const c=await n.text();try{const u=JSON.parse(c);throw new Error(u.detail||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ")}catch{throw new Error(`่Žทๅ–้…็ฝฎๅคฑ่ดฅ (${n.status})`)}}const i=await n.json();if(!i.success)throw new Error(i.message||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ");return i.config}async function pk(l){const n=await we(`/api/webui/plugins/config/${l}/raw`,{headers:Fs()});if(!n.ok){const c=await n.text();try{const u=JSON.parse(c);throw new Error(u.detail||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ")}catch{throw new Error(`่Žทๅ–้…็ฝฎๅคฑ่ดฅ (${n.status})`)}}const i=await n.json();if(!i.success)throw new Error(i.message||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ");return i.config}async function gk(l,n){const i=await we(`/api/webui/plugins/config/${l}`,{method:"PUT",headers:Fs(),body:JSON.stringify({config:n})});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}return await i.json()}async function jk(l,n){const i=await we(`/api/webui/plugins/config/${l}/raw`,{method:"PUT",headers:Fs(),body:JSON.stringify({config:n})});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}return await i.json()}async function vk(l){const n=await we(`/api/webui/plugins/config/${l}/reset`,{method:"POST",headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"้‡็ฝฎ้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function Nk(l){const n=await we(`/api/webui/plugins/config/${l}/toggle`,{method:"POST",headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ‡ๆข็Šถๆ€ๅคฑ่ดฅ")}return await n.json()}const ac="https://maibot-plugin-stats.maibot-webui.workers.dev";async function Ov(l){try{const n=await fetch(`${ac}/stats/${l}`);return n.ok?await n.json():(console.error("Failed to fetch plugin stats:",n.statusText),null)}catch(n){return console.error("Error fetching plugin stats:",n),null}}async function bk(l,n){try{const i=n||sx(),c=await fetch(`${ac}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l,user_id:i})}),u=await c.json();return c.status===429?{success:!1,error:"ๆ“ไฝœ่ฟ‡ไบŽ้ข‘็น๏ผŒ่ฏท็จๅŽๅ†่ฏ•"}:c.ok?{success:!0,...u}:{success:!1,error:u.error||"็‚น่ตžๅคฑ่ดฅ"}}catch(i){return console.error("Error liking plugin:",i),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function yk(l,n){try{const i=n||sx(),c=await fetch(`${ac}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l,user_id:i})}),u=await c.json();return c.status===429?{success:!1,error:"ๆ“ไฝœ่ฟ‡ไบŽ้ข‘็น๏ผŒ่ฏท็จๅŽๅ†่ฏ•"}:c.ok?{success:!0,...u}:{success:!1,error:u.error||"็‚น่ธฉๅคฑ่ดฅ"}}catch(i){return console.error("Error disliking plugin:",i),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function wk(l,n,i,c){if(n<1||n>5)return{success:!1,error:"่ฏ„ๅˆ†ๅฟ…้กปๅœจ 1-5 ไน‹้—ด"};try{const u=c||sx(),x=await fetch(`${ac}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l,rating:n,comment:i,user_id:u})}),h=await x.json();return x.status===429?{success:!1,error:"ๆฏๅคฉๆœ€ๅคš่ฏ„ๅˆ† 3 ๆฌก"}:x.ok?{success:!0,...h}:{success:!1,error:h.error||"่ฏ„ๅˆ†ๅคฑ่ดฅ"}}catch(u){return console.error("Error rating plugin:",u),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function Rv(l){try{const n=await fetch(`${ac}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l})}),i=await n.json();return n.status===429?(console.warn("Download recording rate limited"),{success:!0}):n.ok?{success:!0,...i}:(console.error("Failed to record download:",i.error),{success:!1,error:i.error})}catch(n){return console.error("Error recording download:",n),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}function _k(){const l=navigator,n=[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,l.deviceMemory||0].join("|");let i=0;for(let c=0;c{const te=Y.map(async Me=>{try{const de=await Ov(Me.id);return{id:Me.id,stats:de}}catch(de){return console.warn(`Failed to load stats for ${Me.id}:`,de),{id:Me.id,stats:null}}}),Oe=await Promise.all(te),De={};Oe.forEach(({id:Me,stats:de})=>{de&&(De[Me]=de)}),R(De)};m.useEffect(()=>{let Y=null,te=!1;return(async()=>{if(Y=await xk(De=>{te||(C(De),De.stage==="success"?setTimeout(()=>{te||C(null)},2e3):De.stage==="error"&&(b(!1),A(De.error||"ๅŠ ่ฝฝๅคฑ่ดฅ")))},De=>{console.error("WebSocket error:",De),te||je({title:"WebSocket ่ฟžๆŽฅๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅฎžๆ—ถๆ˜พ็คบๅŠ ่ฝฝ่ฟ›ๅบฆ",variant:"destructive"})}),await new Promise(De=>{if(!Y){De();return}const Me=()=>{Y&&Y.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),De()):Y&&Y.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),De()):setTimeout(Me,100)};Me()}),!te){const De=await Tv();P(De),De.installed||je({title:"Git ๆœชๅฎ‰่ฃ…",description:De.error||"่ฏทๅ…ˆๅฎ‰่ฃ… Git ๆ‰่ƒฝไฝฟ็”จๆ’ไปถๅฎ‰่ฃ…ๅŠŸ่ƒฝ",variant:"destructive"})}if(!te){const De=await Ev();G(De)}if(!te)try{b(!0),A(null);const De=await uk();if(!te){const Me=await Tl();O(Me);const de=De.map(Te=>{const rs=on(Te.id,Me),Rt=dn(Te.id,Me);return{...Te,installed:rs,installed_version:Rt}});for(const Te of Me)!de.some(Rt=>Rt.id===Te.id)&&Te.manifest&&de.push({id:Te.id,manifest:{manifest_version:Te.manifest.manifest_version||1,name:Te.manifest.name,version:Te.manifest.version,description:Te.manifest.description||"",author:Te.manifest.author,license:Te.manifest.license||"Unknown",host_application:Te.manifest.host_application,homepage_url:Te.manifest.homepage_url,repository_url:Te.manifest.repository_url,keywords:Te.manifest.keywords||[],categories:Te.manifest.categories||[],default_locale:Te.manifest.default_locale||"zh-CN",locales_path:Te.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:Te.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});y(de),Se(de)}}catch(De){if(!te){const Me=De instanceof Error?De.message:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจๅคฑ่ดฅ";A(Me),je({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Me,variant:"destructive"})}}finally{te||b(!1)}})(),()=>{te=!0,Y&&Y.close()}},[je]);const K=Y=>{if(!Y.installed&&M&&!U(Y))return e.jsxs(ke,{variant:"destructive",className:"gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),"ไธๅ…ผๅฎน"]});if(Y.installed){const te=Y.installed_version?.trim(),Oe=Y.manifest.version?.trim();if(te!==Oe){const De=te?.split(".").map(Number)||[0,0,0],Me=Oe?.split(".").map(Number)||[0,0,0];for(let de=0;de<3;de++){if((Me[de]||0)>(De[de]||0))return e.jsxs(ke,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[e.jsx(St,{className:"h-3 w-3"}),"ๅฏๆ›ดๆ–ฐ"]});if((Me[de]||0)<(De[de]||0))break}}return e.jsxs(ke,{variant:"default",className:"gap-1",children:[e.jsx(la,{className:"h-3 w-3"}),"ๅทฒๅฎ‰่ฃ…"]})}return null},U=Y=>!M||!Y.manifest?.host_application?!0:Mv(Y.manifest.host_application.min_version,Y.manifest.host_application.max_version,M),V=Y=>{if(!Y.installed||!Y.installed_version||!Y.manifest?.version)return!1;const te=Y.installed_version.trim(),Oe=Y.manifest.version.trim();if(te===Oe)return!1;const De=te.split(".").map(Number),Me=Oe.split(".").map(Number);for(let de=0;de<3;de++){if((Me[de]||0)>(De[de]||0))return!0;if((Me[de]||0)<(De[de]||0))return!1}return!1},xe=v.filter(Y=>{if(!Y.manifest)return console.warn("[่ฟ‡ๆปค] ่ทณ่ฟ‡ๆ—  manifest ็š„ๆ’ไปถ:",Y.id),!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(de=>de.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x);let De=!0;f==="installed"?De=Y.installed===!0:f==="updates"&&(De=Y.installed===!0&&V(Y));const Me=!g||!M||U(Y);return te&&Oe&&De&&Me}),Ae=Y=>{if(!_?.installed){je({title:"ๆ— ๆณ•ๅฎ‰่ฃ…",description:"Git ๆœชๅฎ‰่ฃ…",variant:"destructive"});return}if(M&&!U(Y)){je({title:"ๆ— ๆณ•ๅฎ‰่ฃ…",description:"ๆ’ไปถไธŽๅฝ“ๅ‰้บฆ้บฆ็‰ˆๆœฌไธๅ…ผๅฎน",variant:"destructive"});return}se(Y),fe("main"),Q(""),L("preset"),_e(!1),ce(!0)},X=async()=>{if(!ve)return;const Y=$==="custom"?z:ge;if(!Y||Y.trim()===""){je({title:"ๅˆ†ๆ”ฏๅ็งฐไธ่ƒฝไธบ็ฉบ",variant:"destructive"});return}try{ce(!1),await Av(ve.id,ve.manifest.repository_url||"",Y),Rv(ve.id).catch(Oe=>{console.warn("Failed to record download:",Oe)}),je({title:"ๅฎ‰่ฃ…ๆˆๅŠŸ",description:`${ve.manifest.name} ๅทฒๆˆๅŠŸๅฎ‰่ฃ…`});const te=await Tl();O(te),y(Oe=>Oe.map(De=>{if(De.id===ve.id){const Me=on(De.id,te),de=dn(De.id,te);return{...De,installed:Me,installed_version:de}}return De}))}catch(te){je({title:"ๅฎ‰่ฃ…ๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{se(null)}},oe=async Y=>{try{await zv(Y.id),je({title:"ๅธ่ฝฝๆˆๅŠŸ",description:`${Y.manifest.name} ๅทฒๆˆๅŠŸๅธ่ฝฝ`});const te=await Tl();O(te),y(Oe=>Oe.map(De=>{if(De.id===Y.id){const Me=on(De.id,te),de=dn(De.id,te);return{...De,installed:Me,installed_version:de}}return De}))}catch(te){je({title:"ๅธ่ฝฝๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},Fe=async Y=>{if(!_?.installed){je({title:"ๆ— ๆณ•ๆ›ดๆ–ฐ",description:"Git ๆœชๅฎ‰่ฃ…",variant:"destructive"});return}try{const te=await Dv(Y.id,Y.manifest.repository_url||"","main");je({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:`${Y.manifest.name} ๅทฒไปŽ ${te.old_version} ๆ›ดๆ–ฐๅˆฐ ${te.new_version}`});const Oe=await Tl();O(Oe),y(De=>De.map(Me=>{if(Me.id===Y.id){const de=on(Me.id,Oe),Te=dn(Me.id,Oe);return{...Me,installed:de,installed_version:Te}}return Me}))}catch(te){je({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}};return e.jsx(Je,{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("div",{className:"flex gap-2",children:[e.jsxs(S,{variant:"outline",onClick:()=>n(),disabled:i,children:[e.jsx(Aj,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"้‡ๅฏ้บฆ้บฆ"]}),e.jsxs(S,{onClick:()=>l({to:"/plugin-mirrors"}),children:[e.jsx(l1,{className:"h-4 w-4 mr-2"}),"้…็ฝฎ้•œๅƒๆบ"]})]})]}),e.jsx(Ce,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:e.jsx(Re,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Yt,{className:"h-4 w-4 text-blue-600 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["ๅฎ‰่ฃ…ใ€ๅธ่ฝฝๆˆ–ๆ›ดๆ–ฐๆ’ไปถๅŽ๏ผŒ้œ€่ฆ",e.jsx("span",{className:"font-semibold",children:"้‡ๅฏ้บฆ้บฆ"}),"ๆ‰่ƒฝไฝฟๆ›ดๆ”น็”Ÿๆ•ˆ"]})]})})}),_&&!_.installed&&e.jsxs(Ce,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[e.jsx(Pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Qt,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(He,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git ๆœชๅฎ‰่ฃ…"}),e.jsx(As,{className:"text-orange-800 dark:text-orange-200",children:_.error||"่ฏทๅ…ˆๅฎ‰่ฃ… Git ๆ‰่ƒฝไฝฟ็”จๆ’ไปถๅฎ‰่ฃ…ๅŠŸ่ƒฝ"})]})]})}),e.jsx(Re,{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(Ce,{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(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆ’ไปถ...",value:c,onChange:Y=>u(Y.target.value),className:"pl-9"})]}),e.jsxs(Be,{value:x,onValueChange:h,children:[e.jsx(Le,{className:"w-full sm:w-[200px]",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅˆ†็ฑป"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจๅˆ†็ฑป"}),e.jsx(W,{value:"Group Management",children:"็พค็ป„็ฎก็†"}),e.jsx(W,{value:"Entertainment & Interaction",children:"ๅจฑไนไบ’ๅŠจ"}),e.jsx(W,{value:"Utility Tools",children:"ๅฎž็”จๅทฅๅ…ท"}),e.jsx(W,{value:"Content Generation",children:"ๅ†…ๅฎน็”Ÿๆˆ"}),e.jsx(W,{value:"Multimedia",children:"ๅคšๅช’ไฝ“"}),e.jsx(W,{value:"External Integration",children:"ๅค–้ƒจ้›†ๆˆ"}),e.jsx(W,{value:"Data Analysis & Insights",children:"ๆ•ฐๆฎๅˆ†ๆžไธŽๆดžๅฏŸ"}),e.jsx(W,{value:"Other",children:"ๅ…ถไป–"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"compatible-only",checked:g,onCheckedChange:Y=>N(Y===!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(ra,{value:f,onValueChange:p,className:"w-full",children:e.jsxs(Wt,{className:"grid w-full grid-cols-3",children:[e.jsxs(ts,{value:"all",children:["ๅ…จ้ƒจๆ’ไปถ (",v.filter(Y=>{if(!Y.manifest)return!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(Me=>Me.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x),De=!g||!M||U(Y);return te&&Oe&&De}).length,")"]}),e.jsxs(ts,{value:"installed",children:["ๅทฒๅฎ‰่ฃ… (",v.filter(Y=>{if(!Y.manifest)return!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(Me=>Me.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x),De=!g||!M||U(Y);return Y.installed&&te&&Oe&&De}).length,")"]}),e.jsxs(ts,{value:"updates",children:["ๅฏๆ›ดๆ–ฐ (",v.filter(Y=>{if(!Y.manifest)return!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(Me=>Me.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x),De=!g||!M||U(Y);return Y.installed&&V(Y)&&te&&Oe&&De}).length,")"]})]})}),E&&E.stage==="loading"&&E.operation==="fetch"&&e.jsx(Ce,{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(Ls,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{className:"text-sm font-medium",children:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจ"})]}),e.jsxs("span",{className:"text-sm font-medium",children:[E.progress,"%"]})]}),e.jsx(Fn,{value:E.progress,className:"h-2"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:E.message}),E.total_plugins>0&&e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["ๅทฒๅŠ ่ฝฝ ",E.loaded_plugins," / ",E.total_plugins," ไธชๆ’ไปถ"]})]})}),E&&E.stage==="error"&&E.error&&e.jsx(Ce,{className:"border-destructive bg-destructive/10",children:e.jsx(Pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Qt,{className:"h-5 w-5 text-destructive"}),e.jsxs("div",{children:[e.jsx(He,{className:"text-lg text-destructive",children:"ๅŠ ่ฝฝๅคฑ่ดฅ"}),e.jsx(As,{className:"text-destructive/80",children:E.error})]})]})})}),w?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจไธญ..."})]}):D?e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Qt,{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:D}),e.jsx(S,{onClick:()=>window.location.reload(),children:"้‡ๆ–ฐๅŠ ่ฝฝ"})]})}):xe.length===0?e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Ot,{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:c||x!=="all"?"ๅฐ่ฏ•่ฐƒๆ•ดๆœ็ดขๆกไปถๆˆ–็ญ›้€‰ๅ™จ":"ๆš‚ๆ— ๅฏ็”จๆ’ไปถ"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:xe.map(Y=>e.jsxs(Ce,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[e.jsxs(Pe,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(He,{className:"text-xl",children:Y.manifest?.name||Y.id}),e.jsxs("div",{className:"flex flex-col gap-1",children:[Y.manifest?.categories&&Y.manifest.categories[0]&&e.jsx(ke,{variant:"secondary",className:"text-xs whitespace-nowrap",children:Sk[Y.manifest.categories[0]]||Y.manifest.categories[0]}),K(Y)]})]}),e.jsx(As,{className:"line-clamp-2",children:Y.manifest?.description||"ๆ— ๆ่ฟฐ"})]}),e.jsx(Re,{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(Zt,{className:"h-4 w-4"}),e.jsx("span",{children:(ee[Y.id]?.downloads??Y.downloads??0).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(rn,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:(ee[Y.id]?.rating??Y.rating??0).toFixed(1)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Y.manifest?.keywords&&Y.manifest.keywords.slice(0,3).map(te=>e.jsx(ke,{variant:"outline",className:"text-xs",children:te},te)),Y.manifest?.keywords&&Y.manifest.keywords.length>3&&e.jsxs(ke,{variant:"outline",className:"text-xs",children:["+",Y.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",Y.manifest?.version||"unknown"," ยท ",Y.manifest?.author?.name||"Unknown"]}),Y.manifest?.host_application&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"ๆ”ฏๆŒ:"}),e.jsxs("span",{className:"font-medium",children:[Y.manifest.host_application.min_version,Y.manifest.host_application.max_version?` - ${Y.manifest.host_application.max_version}`:" - ๆœ€ๆ–ฐ็‰ˆๆœฌ"]})]})]})]})}),e.jsx(Vo,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>l({to:"/plugin-detail",search:{pluginId:Y.id}}),children:"ๆŸฅ็œ‹่ฏฆๆƒ…"}),Y.installed?V(Y)?e.jsxs(S,{size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",onClick:()=>Fe(Y),children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"ๆ›ดๆ–ฐ"]}):e.jsxs(S,{variant:"destructive",size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",onClick:()=>oe(Y),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅธ่ฝฝ"]}):e.jsxs(S,{size:"sm",disabled:!_?.installed||E?.operation==="install"||M!==null&&!U(Y),title:_?.installed?M!==null&&!U(Y)?`ไธๅ…ผๅฎนๅฝ“ๅ‰็‰ˆๆœฌ (้œ€่ฆ ${Y.manifest?.host_application?.min_version||"ๆœช็Ÿฅ"}${Y.manifest?.host_application?.max_version?` - ${Y.manifest.host_application.max_version}`:"+"}๏ผŒๅฝ“ๅ‰ ${M?.version})`:void 0:"Git ๆœชๅฎ‰่ฃ…",onClick:()=>Ae(Y),children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),E?.operation==="install"&&E?.plugin_id===Y.id?"ๅฎ‰่ฃ…ไธญ...":"ๅฎ‰่ฃ…"]})]})}),E&&(E.stage==="loading"||E.stage==="success"||E.stage==="error")&&E.operation!=="fetch"&&E.plugin_id===Y.id&&e.jsx("div",{className:"px-6 pb-4 -mt-2",children:e.jsxs("div",{className:`space-y-2 p-3 rounded-lg border ${E.stage==="success"?"bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-900":E.stage==="error"?"bg-red-50 dark:bg-red-950/20 border-red-200 dark:border-red-900":"bg-muted/50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[E.stage==="loading"?e.jsx(Ls,{className:"h-3 w-3 animate-spin"}):E.stage==="success"?e.jsx(la,{className:"h-3 w-3 text-green-600"}):e.jsx(St,{className:"h-3 w-3 text-red-600"}),e.jsx("span",{className:`text-xs font-medium ${E.stage==="success"?"text-green-700 dark:text-green-300":E.stage==="error"?"text-red-700 dark:text-red-300":""}`,children:E.stage==="loading"?e.jsxs(e.Fragment,{children:[E.operation==="install"&&"ๆญฃๅœจๅฎ‰่ฃ…",E.operation==="uninstall"&&"ๆญฃๅœจๅธ่ฝฝ",E.operation==="update"&&"ๆญฃๅœจๆ›ดๆ–ฐ"]}):E.stage==="success"?e.jsxs(e.Fragment,{children:[E.operation==="install"&&"ๅฎ‰่ฃ…ๅฎŒๆˆ",E.operation==="uninstall"&&"ๅธ่ฝฝๅฎŒๆˆ",E.operation==="update"&&"ๆ›ดๆ–ฐๅฎŒๆˆ"]}):e.jsxs(e.Fragment,{children:[E.operation==="install"&&"ๅฎ‰่ฃ…ๅคฑ่ดฅ",E.operation==="uninstall"&&"ๅธ่ฝฝๅคฑ่ดฅ",E.operation==="update"&&"ๆ›ดๆ–ฐๅคฑ่ดฅ"]})})]}),E.stage!=="error"&&e.jsxs("span",{className:`text-xs font-medium ${E.stage==="success"?"text-green-700 dark:text-green-300":""}`,children:[E.progress,"%"]})]}),E.stage!=="error"&&e.jsx(Fn,{value:E.progress,className:`h-1.5 ${E.stage==="success"?"[&>div]:bg-green-500":""}`}),e.jsx("div",{className:`text-xs ${E.stage==="success"?"text-green-600 dark:text-green-400 truncate":E.stage==="error"?"text-red-600 dark:text-red-400":"text-muted-foreground truncate"}`,children:E.stage==="error"?E.error||E.message||"ๆ“ไฝœๅคฑ่ดฅ":E.message})]})})]},Y.id))}),e.jsx(Ps,{open:me,onOpenChange:ce,children:e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ๅฎ‰่ฃ…ๆ’ไปถ"}),e.jsxs(Ys,{children:["ๅฎ‰่ฃ… ",ve?.manifest.name]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["็‰ˆๆœฌ: ",ve?.manifest.version]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["ไฝœ่€…: ",typeof ve?.manifest.author=="string"?ve.manifest.author:ve?.manifest.author?.name]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"advanced-options",checked:I,onCheckedChange:Y=>_e(Y)}),e.jsx("label",{htmlFor:"advanced-options",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"้ซ˜็บง้€‰้กน"})]}),I&&e.jsx("div",{className:"space-y-4 p-4 border rounded-lg",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"ๅˆ†ๆ”ฏ้€‰ๆ‹ฉ"}),e.jsxs(ra,{value:$,onValueChange:Y=>L(Y),children:[e.jsxs(Wt,{className:"grid w-full grid-cols-2",children:[e.jsx(ts,{value:"preset",className:"text-xs",children:"้ข„่ฎพๅˆ†ๆ”ฏ"}),e.jsx(ts,{value:"custom",className:"text-xs",children:"่‡ชๅฎšไน‰ๅˆ†ๆ”ฏ"})]}),$==="preset"&&e.jsx("div",{className:"mt-3",children:e.jsxs(Be,{value:ge,onValueChange:fe,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅˆ†ๆ”ฏ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"main",children:"main (้ป˜่ฎค)"}),e.jsx(W,{value:"master",children:"master"}),e.jsx(W,{value:"dev",children:"dev (ๅผ€ๅ‘็‰ˆ)"}),e.jsx(W,{value:"develop",children:"develop"}),e.jsx(W,{value:"beta",children:"beta (ๆต‹่ฏ•็‰ˆ)"}),e.jsx(W,{value:"stable",children:"stable (็จณๅฎš็‰ˆ)"})]})]})}),$==="custom"&&e.jsxs("div",{className:"space-y-2 mt-3",children:[e.jsx("input",{type:"text",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"่พ“ๅ…ฅๅˆ†ๆ”ฏๅ็งฐ๏ผŒไพ‹ๅฆ‚: feature/new-feature",value:z,onChange:Y=>Q(Y.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่พ“ๅ…ฅ Git ๅˆ†ๆ”ฏๅ็งฐใ€ๆ ‡็ญพๆˆ–ๆไบคๅ“ˆๅธŒ"})]})]})]})}),!I&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅฐ†ไปŽ้ป˜่ฎคๅˆ†ๆ”ฏ (main) ๅฎ‰่ฃ…ๆ’ไปถ"})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>ce(!1),children:"ๅ–ๆถˆ"}),e.jsxs(S,{onClick:X,children:[e.jsx(Zt,{className:"h-4 w-4 mr-2"}),"ๅฎ‰่ฃ…"]})]})]})}),e.jsx(qn,{})]})})}function Tk(){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(zj,{className:"h-8 w-8",strokeWidth:2}),"ๆจกๅž‹ๅˆ†้…้ข„่ฎพๅธ‚ๅœบ"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆต่งˆๅ’Œไธ‹่ฝฝ็คพๅŒบๅ…ฑไบซ็š„ๆจกๅž‹ๅˆ†้…้ข„่ฎพ้…็ฝฎ"})]})})}),e.jsx(Je,{className:"flex-1",children:e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-12rem)]",children:e.jsxs(Ce,{className:"max-w-2xl w-full border-dashed",children:[e.jsxs(Pe,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(aa,{className:"h-16 w-16 text-muted-foreground"})}),e.jsx(He,{className:"text-2xl",children:"ๅŠŸ่ƒฝๅผ€ๅ‘ไธญ"}),e.jsx(As,{className:"text-base",children:"ๆจกๅž‹ๅˆ†้…้ข„่ฎพๅธ‚ๅœบๅŠŸ่ƒฝๆญฃๅœจๅผ€ๅ‘ไธญ๏ผŒๆ•ฌ่ฏทๆœŸๅพ…๏ผ"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-medium text-foreground",children:"๐Ÿ“ฆ ๅณๅฐ†ๆŽจๅ‡บ็š„ๅŠŸ่ƒฝ๏ผš"}),e.jsxs("ul",{className:"space-y-2 ml-6",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ๆต่งˆ็คพๅŒบๅ…ฑไบซ็š„ๆจกๅž‹ๅˆ†้…้ข„่ฎพ้…็ฝฎ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ไธ€้”ฎไธ‹่ฝฝๅ’Œๅบ”็”จ้ข„่ฎพ้…็ฝฎ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ๅˆ†ไบซ่‡ชๅทฑ็š„ๆจกๅž‹ๅˆ†้…ๆ–นๆกˆ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"้ข„่ฎพ้…็ฝฎ่ฏ„ๅˆ†ๅ’Œ่ฏ„่ฎบ็ณป็ปŸ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ๆ นๆฎไฝฟ็”จๅœบๆ™ฏๆ™บ่ƒฝๆŽจ่้…็ฝฎ"})]})]})]})})]})})})]})}function Ek({field:l,value:n,onChange:i}){const[c,u]=m.useState(!1);switch(l.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(T,{children:l.label}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]}),e.jsx(Ve,{checked:!!n,onCheckedChange:i,disabled:l.disabled})]});case"number":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(ne,{type:"number",value:n??l.default,onChange:x=>i(parseFloat(x.target.value)||0),min:l.min,max:l.max,step:l.step??1,placeholder:l.placeholder,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"slider":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:l.label}),e.jsx("span",{className:"text-sm text-muted-foreground",children:n??l.default})]}),e.jsx(_a,{value:[n??l.default],onValueChange:x=>i(x[0]),min:l.min??0,max:l.max??100,step:l.step??1,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"select":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsxs(Be,{value:String(n??l.default),onValueChange:i,disabled:l.disabled,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:l.placeholder??"่ฏท้€‰ๆ‹ฉ"})}),e.jsx(Ue,{children:l.choices?.map(x=>e.jsx(W,{value:String(x),children:String(x)},String(x)))})]}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"textarea":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(at,{value:n??l.default,onChange:x=>i(x.target.value),placeholder:l.placeholder,rows:l.rows??3,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"password":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{type:c?"text":"password",value:n??"",onChange:x=>i(x.target.value),placeholder:l.placeholder,disabled:l.disabled,className:"pr-10"}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>u(!c),children:c?e.jsx(qi,{className:"h-4 w-4"}):e.jsx(na,{className:"h-4 w-4"})})]}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"list":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(C_,{value:Array.isArray(n)?n:[],onChange:x=>i(x),itemType:l.item_type??"string",itemFields:l.item_fields,minItems:l.min_items,maxItems:l.max_items,disabled:l.disabled,placeholder:l.placeholder}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"text":default:return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(ne,{type:"text",value:n??l.default??"",onChange:x=>i(x.target.value),placeholder:l.placeholder,maxLength:l.max_length,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]})}}function Cg({section:l,config:n,onChange:i}){const[c,u]=m.useState(!l.collapsed),x=Object.entries(l.fields).filter(([,h])=>!h.hidden).sort(([,h],[,f])=>h.order-f.order);return e.jsx(Xi,{open:c,onOpenChange:u,children:e.jsxs(Ce,{children:[e.jsx(Zi,{asChild:!0,children:e.jsxs(Pe,{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:[c?e.jsx(Ta,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(ea,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(He,{className:"text-lg",children:l.title})]}),e.jsxs(ke,{variant:"secondary",className:"text-xs",children:[x.length," ้กน"]})]}),l.description&&e.jsx(As,{className:"ml-6",children:l.description})]})}),e.jsx(Wi,{children:e.jsx(Re,{className:"space-y-4 pt-0",children:x.map(([h,f])=>e.jsx(Ek,{field:f,value:n[l.name]?.[h],onChange:p=>i(l.name,h,p),sectionName:l.name},h))})})]})})}function Mk({plugin:l,onBack:n}){const{toast:i}=st(),{triggerRestart:c,isRestarting:u}=fn(),[x,h]=m.useState("visual"),[f,p]=m.useState(null),[g,N]=m.useState({}),[v,y]=m.useState({}),[w,b]=m.useState(""),[D,A]=m.useState(""),[_,P]=m.useState(!0),[E,C]=m.useState(!1),[M,G]=m.useState(!1),[O,ee]=m.useState(!1),[R,me]=m.useState(!1),ce=m.useCallback(async()=>{P(!0);try{const[$,L,I]=await Promise.all([hk(l.id),fk(l.id),pk(l.id)]);p($),N(L),y(JSON.parse(JSON.stringify(L))),b(I),A(I)}catch($){i({title:"ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ",description:$ instanceof Error?$.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{P(!1)}},[l.id,i]);m.useEffect(()=>{ce()},[ce]),m.useEffect(()=>{G(x==="visual"?JSON.stringify(g)!==JSON.stringify(v):w!==D)},[g,v,w,D,x]);const ve=($,L,I)=>{N(_e=>({..._e,[$]:{..._e[$]||{},[L]:I}}))},se=async()=>{C(!0);try{if(x==="source"){try{vv(w)}catch($){ee(!0),i({title:"TOML ๆ ผๅผ้”™่ฏฏ",description:$ instanceof Error?$.message:"ๆ— ๆณ•่งฃๆž TOML ้…็ฝฎ๏ผŒ่ฏทๆฃ€ๆŸฅ่ฏญๆณ•",variant:"destructive"}),C(!1);return}await jk(l.id,w),A(w),ee(!1)}else await gk(l.id,g),y(JSON.parse(JSON.stringify(g)));i({title:"้…็ฝฎๅทฒไฟๅญ˜",description:"ๆ›ดๆ”นๅฐ†ๅœจๆ’ไปถ้‡ๆ–ฐๅŠ ่ฝฝๅŽ็”Ÿๆ•ˆ"})}catch($){i({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:$ instanceof Error?$.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{C(!1)}},ge=async()=>{try{await vk(l.id),i({title:"้…็ฝฎๅทฒ้‡็ฝฎ",description:"ไธ‹ๆฌกๅŠ ่ฝฝๆ’ไปถๆ—ถๅฐ†ไฝฟ็”จ้ป˜่ฎค้…็ฝฎ"}),me(!1),ce()}catch($){i({title:"้‡็ฝฎๅคฑ่ดฅ",description:$ instanceof Error?$.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},fe=async()=>{try{const $=await Nk(l.id);i({title:$.message,description:$.note}),ce()}catch($){i({title:"ๅˆ‡ๆข็Šถๆ€ๅคฑ่ดฅ",description:$ instanceof Error?$.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}};if(_)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!f)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[e.jsx(St,{className:"h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"ๆ— ๆณ•ๅŠ ่ฝฝ้…็ฝฎ"}),e.jsxs(S,{onClick:n,variant:"outline",children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"่ฟ”ๅ›ž"]})]});const z=Object.values(f.sections).sort(($,L)=>$.order-L.order),Q=g.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(S,{variant:"ghost",size:"icon",onClick:n,children:e.jsx(ka,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:f.plugin_info.name||l.manifest.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(ke,{variant:Q?"default":"secondary",children:Q?"ๅทฒๅฏ็”จ":"ๅทฒ็ฆ็”จ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",f.plugin_info.version||l.manifest.version]})]})]})]}),e.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>h(x==="visual"?"source":"visual"),children:x==="visual"?e.jsxs(e.Fragment,{children:[e.jsx(kj,{className:"h-4 w-4 mr-2"}),"ๆบไปฃ็ "]}):e.jsxs(e.Fragment,{children:[e.jsx(Sj,{className:"h-4 w-4 mr-2"}),"ๅฏ่ง†ๅŒ–"]})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>c(),disabled:u,children:[e.jsx(Aj,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"้‡ๅฏ้บฆ้บฆ"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:fe,children:[e.jsx(ec,{className:"h-4 w-4 mr-2"}),Q?"็ฆ็”จ":"ๅฏ็”จ"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>me(!0),children:[e.jsx(Vi,{className:"h-4 w-4 mr-2"}),"้‡็ฝฎ"]}),e.jsxs(S,{size:"sm",onClick:se,disabled:!M||E,children:[E?e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(sc,{className:"h-4 w-4 mr-2"}),"ไฟๅญ˜"]})]})]}),M&&e.jsx(Ce,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:e.jsx(Re,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Yt,{className:"h-4 w-4 text-orange-600"}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"ๆœ‰ๆœชไฟๅญ˜็š„ๆ›ดๆ”น"})]})})}),x==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(it,{children:[e.jsx(St,{className:"h-4 w-4"}),e.jsxs(ct,{children:[e.jsx("strong",{children:"ๆบไปฃ็ ๆจกๅผ๏ผˆ้ซ˜็บงๅŠŸ่ƒฝ๏ผ‰๏ผš"}),"็›ดๆŽฅ็ผ–่พ‘ TOML ้…็ฝฎๆ–‡ไปถใ€‚ไฟๅญ˜ๆ—ถไผš้ชŒ่ฏๆ ผๅผ๏ผŒๅชๆœ‰ๆ ผๅผๆญฃ็กฎๆ‰่ƒฝไฟๅญ˜ใ€‚",O&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"โš ๏ธ ไธŠๆฌกไฟๅญ˜ๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ TOML ๆ ผๅผ"})]})]}),e.jsx(cv,{value:w,onChange:$=>{b($),O&&ee(!1)},language:"toml",theme:"dark",height:"calc(100vh - 350px)",minHeight:"500px",placeholder:"TOML ้…็ฝฎๅ†…ๅฎน"})]}),x==="visual"&&e.jsxs(e.Fragment,{children:[e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(ct,{children:[e.jsx("strong",{children:"ๆ็คบ๏ผš"}),"ๅฆ‚ๆžœๆ’ไปถๅฝ“ๅ‰ๆœชๅŠ ่ฝฝๆˆ–ๆœชๅฏ็”จ๏ผŒWebUI ้€‚้…ๅ™จ็š„้ซ˜็บงๆ’ไปถๅฏ่ง†ๅŒ–็ผ–่พ‘ๅŠŸ่ƒฝๅฏ่ƒฝไผšไธๅฏ็”จใ€‚ ่ฏท็กฎไฟๆ’ไปถๅทฒๅฏ็”จๅนถๆˆๅŠŸๅŠ ่ฝฝๅŽ๏ผŒๅ†่ฟ›่กŒ้…็ฝฎ็ผ–่พ‘ใ€‚"]})]}),f.layout.type==="tabs"&&f.layout.tabs.length>0?e.jsxs(ra,{defaultValue:f.layout.tabs[0]?.id,children:[e.jsx(Wt,{children:f.layout.tabs.map($=>e.jsxs(ts,{value:$.id,children:[$.title,$.badge&&e.jsx(ke,{variant:"secondary",className:"ml-2 text-xs",children:$.badge})]},$.id))}),f.layout.tabs.map($=>e.jsx(bs,{value:$.id,className:"space-y-4 mt-4",children:$.sections.map(L=>{const I=f.sections[L];return I?e.jsx(Cg,{section:I,config:g,onChange:ve},L):null})},$.id))]}):e.jsx("div",{className:"space-y-4",children:z.map($=>e.jsx(Cg,{section:$,config:g,onChange:ve},$.name))})]}),e.jsx(Ps,{open:R,onOpenChange:me,children:e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็กฎ่ฎค้‡็ฝฎ้…็ฝฎ"}),e.jsx(Ys,{children:"่ฟ™ๅฐ†ๅˆ ้™คๅฝ“ๅ‰้…็ฝฎๆ–‡ไปถ๏ผŒไธ‹ๆฌกๅŠ ่ฝฝๆ’ไปถๆ—ถๅฐ†ไฝฟ็”จ้ป˜่ฎค้…็ฝฎใ€‚ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚"})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>me(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{variant:"destructive",onClick:ge,children:"็กฎ่ฎค้‡็ฝฎ"})]})]})})]})}function Ak(){return e.jsx(Vn,{children:e.jsx(zk,{})})}function zk(){const{toast:l}=st(),[n,i]=m.useState([]),[c,u]=m.useState(!0),[x,h]=m.useState(""),[f,p]=m.useState(null),g=async()=>{u(!0);try{const b=await Tl();i(b)}catch(b){l({title:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจๅคฑ่ดฅ",description:b instanceof Error?b.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{u(!1)}};m.useEffect(()=>{g()},[]);const v=n.filter(b=>{const D=x.toLowerCase();return b.id.toLowerCase().includes(D)||b.manifest.name.toLowerCase().includes(D)||b.manifest.description?.toLowerCase().includes(D)}).filter((b,D,A)=>D===A.findIndex(_=>_.id===b.id)),y=n.length,w=0;return f?e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"h-full",children:e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx(Mk,{plugin:f,onBack:()=>p(null)})})}),e.jsx(qn,{})]}):e.jsx(Je,{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(S,{variant:"outline",size:"sm",onClick:g,children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${c?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅทฒๅฎ‰่ฃ…ๆ’ไปถ"}),e.jsx(aa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-2xl font-bold",children:n.length}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:c?"ๆญฃๅœจๅŠ ่ฝฝ...":"ไธชๆ’ไปถ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅทฒๅฏ็”จ"}),e.jsx(la,{className:"h-4 w-4 text-green-600"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"่ฟ่กŒไธญ็š„ๆ’ไปถ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅทฒ็ฆ็”จ"}),e.jsx(St,{className:"h-4 w-4 text-orange-600"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-2xl font-bold",children:w}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆœชๆฟ€ๆดป็š„ๆ’ไปถ"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆ’ไปถ...",value:x,onChange:b=>h(b.target.value),className:"pl-9"})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๅทฒๅฎ‰่ฃ…็š„ๆ’ไปถ"}),e.jsx(As,{children:"็‚นๅ‡ปๆ’ไปถๆŸฅ็œ‹ๅ’Œ็ผ–่พ‘้…็ฝฎ"})]}),e.jsx(Re,{children:c?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Ls,{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(aa,{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(b=>e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>p(b),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(aa,{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:b.manifest.name}),e.jsxs(ke,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",b.manifest.version]})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.manifest.description||"ๆš‚ๆ— ๆ่ฟฐ"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(S,{variant:"ghost",size:"sm",children:e.jsx(mn,{className:"h-4 w-4"})}),e.jsx(ea,{className:"h-4 w-4 text-muted-foreground"})]})]},b.id))})})]})]})})}function Dk(){const l=ia(),{toast:n}=st(),[i,c]=m.useState([]),[u,x]=m.useState(!0),[h,f]=m.useState(null),[p,g]=m.useState(null),[N,v]=m.useState(!1),[y,w]=m.useState(!1),[b,D]=m.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),A=m.useCallback(async()=>{try{x(!0),f(null);const O=await we("/api/webui/plugins/mirrors");if(!O.ok)throw new Error("่Žทๅ–้•œๅƒๆบๅˆ—่กจๅคฑ่ดฅ");const ee=await O.json();c(ee.mirrors||[])}catch(O){const ee=O instanceof Error?O.message:"ๅŠ ่ฝฝ้•œๅƒๆบๅคฑ่ดฅ";f(ee),n({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:ee,variant:"destructive"})}finally{x(!1)}},[n]);m.useEffect(()=>{A()},[A]);const _=async()=>{try{const O=await we("/api/webui/plugins/mirrors",{method:"POST",body:JSON.stringify(b)});if(!O.ok){const ee=await O.json();throw new Error(ee.detail||"ๆทปๅŠ ้•œๅƒๆบๅคฑ่ดฅ")}n({title:"ๆทปๅŠ ๆˆๅŠŸ",description:"้•œๅƒๆบๅทฒๆทปๅŠ "}),v(!1),D({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),A()}catch(O){n({title:"ๆทปๅŠ ๅคฑ่ดฅ",description:O instanceof Error?O.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},P=async()=>{if(p)try{if(!(await we(`/api/webui/plugins/mirrors/${p.id}`,{method:"PUT",body:JSON.stringify({name:b.name,raw_prefix:b.raw_prefix,clone_prefix:b.clone_prefix,enabled:b.enabled,priority:b.priority})})).ok)throw new Error("ๆ›ดๆ–ฐ้•œๅƒๆบๅคฑ่ดฅ");n({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:"้•œๅƒๆบๅทฒๆ›ดๆ–ฐ"}),w(!1),g(null),A()}catch(O){n({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:O instanceof Error?O.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},E=async O=>{if(confirm("็กฎๅฎš่ฆๅˆ ้™ค่ฟ™ไธช้•œๅƒๆบๅ—๏ผŸ"))try{if(!(await we(`/api/webui/plugins/mirrors/${O}`,{method:"DELETE"})).ok)throw new Error("ๅˆ ้™ค้•œๅƒๆบๅคฑ่ดฅ");n({title:"ๅˆ ้™คๆˆๅŠŸ",description:"้•œๅƒๆบๅทฒๅˆ ้™ค"}),A()}catch(ee){n({title:"ๅˆ ้™คๅคฑ่ดฅ",description:ee instanceof Error?ee.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},C=async O=>{try{if(!(await we(`/api/webui/plugins/mirrors/${O.id}`,{method:"PUT",body:JSON.stringify({enabled:!O.enabled})})).ok)throw new Error("ๆ›ดๆ–ฐ็Šถๆ€ๅคฑ่ดฅ");A()}catch(ee){n({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:ee instanceof Error?ee.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},M=O=>{g(O),D({id:O.id,name:O.name,raw_prefix:O.raw_prefix,clone_prefix:O.clone_prefix,enabled:O.enabled,priority:O.priority}),w(!0)},G=async(O,ee)=>{const R=ee==="up"?O.priority-1:O.priority+1;if(!(R<1))try{if(!(await we(`/api/webui/plugins/mirrors/${O.id}`,{method:"PUT",body:JSON.stringify({priority:R})})).ok)throw new Error("ๆ›ดๆ–ฐไผ˜ๅ…ˆ็บงๅคฑ่ดฅ");A()}catch(me){n({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:me instanceof Error?me.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}};return e.jsx(Je,{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(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),children:e.jsx(ka,{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(S,{onClick:()=>v(!0),children:[e.jsx(Zs,{className:"h-4 w-4 mr-2"}),"ๆทปๅŠ ้•œๅƒๆบ"]})]}),u?e.jsx(Ce,{className:"p-6",children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-primary"})})}):h?e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Qt,{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:h}),e.jsx(S,{onClick:A,children:"้‡ๆ–ฐๅŠ ่ฝฝ"})]})}):e.jsxs(Ce,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"ID"}),e.jsx(Ze,{children:"ไผ˜ๅ…ˆ็บง"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i.map(O=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ve,{checked:O.enabled,onCheckedChange:()=>C(O)})}),e.jsx(Ke,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:O.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",O.raw_prefix]})]})}),e.jsx(Ke,{children:e.jsx(ke,{variant:"outline",children:O.id})}),e.jsx(Ke,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:O.priority}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(S,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>G(O,"up"),disabled:O.priority===1,children:e.jsx($r,{className:"h-3 w-3"})}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>G(O,"down"),children:e.jsx(Ta,{className:"h-3 w-3"})})]})]})}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>M(O),children:e.jsx($n,{className:"h-4 w-4"})}),e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>E(O.id),children:e.jsx(ns,{className:"h-4 w-4 text-destructive"})})]})})]},O.id))})]})}),e.jsx("div",{className:"md:hidden p-4 space-y-4",children:i.map(O=>e.jsx(Ce,{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:O.name}),O.enabled&&e.jsx(ke,{variant:"default",className:"text-xs",children:"ๅฏ็”จ"})]}),e.jsx(ke,{variant:"outline",className:"mt-1 text-xs",children:O.id})]}),e.jsx(Ve,{checked:O.enabled,onCheckedChange:()=>C(O)})]}),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:O.raw_prefix})]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"ไผ˜ๅ…ˆ็บง: "}),e.jsx("span",{className:"font-mono",children:O.priority})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[e.jsxs(S,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>M(O),children:[e.jsx($n,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>G(O,"up"),disabled:O.priority===1,children:e.jsx($r,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>G(O,"down"),children:e.jsx(Ta,{className:"h-4 w-4"})}),e.jsx(S,{variant:"destructive",size:"sm",onClick:()=>E(O.id),children:e.jsx(ns,{className:"h-4 w-4"})})]})]})},O.id))})]}),e.jsx(Ps,{open:N,onOpenChange:v,children:e.jsxs(Us,{className:"max-w-lg",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{htmlFor:"add-id",children:"้•œๅƒๆบ ID *"}),e.jsx(ne,{id:"add-id",placeholder:"ไพ‹ๅฆ‚: my-mirror",value:b.id,onChange:O=>D({...b,id:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-name",children:"ๅ็งฐ *"}),e.jsx(ne,{id:"add-name",placeholder:"ไพ‹ๅฆ‚: ๆˆ‘็š„้•œๅƒๆบ",value:b.name,onChange:O=>D({...b,name:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-raw",children:"Raw ๆ–‡ไปถๅ‰็ผ€ *"}),e.jsx(ne,{id:"add-raw",placeholder:"https://example.com/raw",value:b.raw_prefix,onChange:O=>D({...b,raw_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-clone",children:"ๅ…‹้š†ๅ‰็ผ€ *"}),e.jsx(ne,{id:"add-clone",placeholder:"https://example.com/clone",value:b.clone_prefix,onChange:O=>D({...b,clone_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-priority",children:"ไผ˜ๅ…ˆ็บง"}),e.jsx(ne,{id:"add-priority",type:"number",min:"1",value:b.priority,onChange:O=>D({...b,priority:parseInt(O.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:b.enabled,onCheckedChange:O=>D({...b,enabled:O})}),e.jsx(T,{htmlFor:"add-enabled",children:"ๅฏ็”จๆญค้•œๅƒๆบ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>v(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:_,children:"ๆทปๅŠ "})]})]})}),e.jsx(Ps,{open:y,onOpenChange:w,children:e.jsxs(Us,{className:"max-w-lg",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{children:"้•œๅƒๆบ ID"}),e.jsx(ne,{value:b.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-name",children:"ๅ็งฐ *"}),e.jsx(ne,{id:"edit-name",value:b.name,onChange:O=>D({...b,name:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-raw",children:"Raw ๆ–‡ไปถๅ‰็ผ€ *"}),e.jsx(ne,{id:"edit-raw",value:b.raw_prefix,onChange:O=>D({...b,raw_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-clone",children:"ๅ…‹้š†ๅ‰็ผ€ *"}),e.jsx(ne,{id:"edit-clone",value:b.clone_prefix,onChange:O=>D({...b,clone_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-priority",children:"ไผ˜ๅ…ˆ็บง"}),e.jsx(ne,{id:"edit-priority",type:"number",min:"1",value:b.priority,onChange:O=>D({...b,priority:parseInt(O.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:b.enabled,onCheckedChange:O=>D({...b,enabled:O})}),e.jsx(T,{htmlFor:"edit-enabled",children:"ๅฏ็”จๆญค้•œๅƒๆบ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>w(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:P,children:"ไฟๅญ˜"})]})]})})]})})}function Ok({pluginId:l,compact:n=!1}){const[i,c]=m.useState(null),[u,x]=m.useState(!0),[h,f]=m.useState(0),[p,g]=m.useState(""),[N,v]=m.useState(!1),{toast:y}=st(),w=async()=>{x(!0);const _=await Ov(l);_&&c(_),x(!1)};m.useEffect(()=>{w()},[l]);const b=async()=>{const _=await bk(l);_.success?(y({title:"ๅทฒ็‚น่ตž",description:"ๆ„Ÿ่ฐขไฝ ็š„ๆ”ฏๆŒ๏ผ"}),w()):y({title:"็‚น่ตžๅคฑ่ดฅ",description:_.error||"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})},D=async()=>{const _=await yk(l);_.success?(y({title:"ๅทฒๅ้ฆˆ",description:"ๆ„Ÿ่ฐขไฝ ็š„ๅ้ฆˆ๏ผ"}),w()):y({title:"ๆ“ไฝœๅคฑ่ดฅ",description:_.error||"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})},A=async()=>{if(h===0){y({title:"่ฏท้€‰ๆ‹ฉ่ฏ„ๅˆ†",description:"่‡ณๅฐ‘้€‰ๆ‹ฉ 1 ้ข—ๆ˜Ÿ",variant:"destructive"});return}const _=await wk(l,h,p||void 0);_.success?(y({title:"่ฏ„ๅˆ†ๆˆๅŠŸ",description:"ๆ„Ÿ่ฐขไฝ ็š„่ฏ„ไปท๏ผ"}),v(!1),f(0),g(""),w()):y({title:"่ฏ„ๅˆ†ๅคฑ่ดฅ",description:_.error||"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})};return u?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(Zt,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(rn,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]})]}):i?n?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:`ไธ‹่ฝฝ้‡: ${i.downloads.toLocaleString()}`,children:[e.jsx(Zt,{className:"h-4 w-4"}),e.jsx("span",{children:i.downloads.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`่ฏ„ๅˆ†: ${i.rating.toFixed(1)} (${i.rating_count} ๆก่ฏ„ไปท)`,children:[e.jsx(rn,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:i.rating.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`็‚น่ตžๆ•ฐ: ${i.likes}`,children:[e.jsx(hm,{className:"h-4 w-4"}),e.jsx("span",{children:i.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(Zt,{className:"h-5 w-5 text-muted-foreground mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:i.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(rn,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),e.jsx("span",{className:"text-2xl font-bold",children:i.rating.toFixed(1)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[i.rating_count," ๆก่ฏ„ไปท"]})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(hm,{className:"h-5 w-5 text-green-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:i.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(eg,{className:"h-5 w-5 text-red-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:i.dislikes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"็‚น่ธฉ"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:b,children:[e.jsx(hm,{className:"h-4 w-4 mr-1"}),"็‚น่ตž"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:D,children:[e.jsx(eg,{className:"h-4 w-4 mr-1"}),"็‚น่ธฉ"]}),e.jsxs(Ps,{open:N,onOpenChange:v,children:[e.jsx(Ko,{asChild:!0,children:e.jsxs(S,{variant:"default",size:"sm",children:[e.jsx(rn,{className:"h-4 w-4 mr-1"}),"่ฏ„ๅˆ†"]})}),e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{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(_=>e.jsx("button",{onClick:()=>f(_),className:"focus:outline-none",children:e.jsx(rn,{className:`h-8 w-8 transition-colors ${_<=h?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},_))}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[h===0&&"็‚นๅ‡ปๆ˜Ÿๆ˜Ÿ่ฟ›่กŒ่ฏ„ๅˆ†",h===1&&"ๅพˆๅทฎ",h===2&&"ไธ€่ˆฌ",h===3&&"่ฟ˜่กŒ",h===4&&"ไธ้”™",h===5&&"้žๅธธๅฅฝ"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"่ฏ„่ฎบ๏ผˆๅฏ้€‰๏ผ‰"}),e.jsx(at,{value:p,onChange:_=>g(_.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(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>v(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:A,disabled:h===0,children:"ๆไบค่ฏ„ๅˆ†"})]})]})]})]}),i.recent_ratings&&i.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:i.recent_ratings.map((_,P)=>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(E=>e.jsx(rn,{className:`h-3 w-3 ${E<=_.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},E))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(_.created_at).toLocaleDateString()})]}),_.comment&&e.jsx("p",{className:"text-sm text-muted-foreground",children:_.comment})]},P))})]})]}):null}const Rk={"Group Management":"็พค็ป„็ฎก็†","Entertainment & Interaction":"ๅจฑไนไบ’ๅŠจ","Utility Tools":"ๅฎž็”จๅทฅๅ…ท","Content Generation":"ๅ†…ๅฎน็”Ÿๆˆ",Multimedia:"ๅคšๅช’ไฝ“","External Integration":"ๅค–้ƒจ้›†ๆˆ","Data Analysis & Insights":"ๆ•ฐๆฎๅˆ†ๆžไธŽๆดžๅฏŸ",Other:"ๅ…ถไป–"};function Lk(){const l=ia(),n=x0({strict:!1}),{toast:i}=st(),[c,u]=m.useState(null),[x,h]=m.useState(""),[f,p]=m.useState(!0),[g,N]=m.useState(!0),[v,y]=m.useState(null),[w,b]=m.useState(null),[D,A]=m.useState(null),[_,P]=m.useState(!1),[E,C]=m.useState(),[M,G]=m.useState(!1);m.useEffect(()=>{(async()=>{if(!n.pluginId){y("็ผบๅฐ‘ๆ’ไปถ ID"),p(!1);return}try{p(!0),y(null);const ge=await we("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:"Mai-with-u",repo:"plugin-repo",branch:"main",file_path:"plugin_details.json"})});if(!ge.ok)throw new Error("่Žทๅ–ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");const fe=await ge.json();if(!fe.success||!fe.data)throw new Error(fe.error||"่Žทๅ–ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");const Q=JSON.parse(fe.data).find(je=>je.id===n.pluginId);if(!Q)throw new Error("ๆœชๆ‰พๅˆฐ่ฏฅๆ’ไปถ");const $={id:Q.id,manifest:Q.manifest,downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()};u($);const[L,I,_e]=await Promise.all([Tv(),Ev(),Tl()]);b(L),A(I),P(on(n.pluginId,_e)),C(dn(n.pluginId,_e))}catch(ge){y(ge instanceof Error?ge.message:"ๅŠ ่ฝฝๅคฑ่ดฅ")}finally{p(!1)}})()},[n.pluginId]),m.useEffect(()=>{(async()=>{if(!c?.manifest?.repository_url){N(!1);return}try{N(!0);const ge=c.manifest.repository_url.match(/github\.com\/([^/]+)\/([^/\s]+)/);if(!ge){h("ๆ— ๆณ•่งฃๆžไป“ๅบ“ๅœฐๅ€");return}const[,fe,z]=ge,Q=z.replace(/\.git$/,""),$=await we("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:fe,repo:Q,branch:"main",file_path:"README.md"})});if(!$.ok)throw new Error("่Žทๅ– README ๅคฑ่ดฅ");const L=await $.json();L.success&&L.data?h(L.data):h("่ฏฅๆ’ไปถๆš‚ๆ—  README ๆ–‡ๆกฃ")}catch(ge){console.error("ๅŠ ่ฝฝ README ๅคฑ่ดฅ:",ge),h("ๅŠ ่ฝฝ README ๅคฑ่ดฅ")}finally{N(!1)}})()},[c]);const O=()=>!c||!_||!E?!1:E!==c.manifest.version,ee=()=>!c||!D?!0:Mv(c.manifest.host_application.min_version,c.manifest.host_application.max_version,D),R=async()=>{if(!(!c||!w?.installed))try{G(!0),await Av(c.id,c.manifest.repository_url||"","main"),Rv(c.id).catch(ge=>{console.warn("Failed to record download:",ge)}),i({title:"ๅฎ‰่ฃ…ๆˆๅŠŸ",description:`${c.manifest.name} ๅทฒๆˆๅŠŸๅฎ‰่ฃ…`});const se=await Tl();P(on(c.id,se)),C(dn(c.id,se))}catch(se){i({title:"ๅฎ‰่ฃ…ๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{G(!1)}},me=async()=>{if(c)try{G(!0),await zv(c.id),i({title:"ๅธ่ฝฝๆˆๅŠŸ",description:`${c.manifest.name} ๅทฒๆˆๅŠŸๅธ่ฝฝ`});const se=await Tl();P(on(c.id,se)),C(dn(c.id,se))}catch(se){i({title:"ๅธ่ฝฝๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{G(!1)}},ce=async()=>{if(!(!c||!w?.installed))try{G(!0);const se=await Dv(c.id,c.manifest.repository_url||"","main");i({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:`${c.manifest.name} ๅทฒไปŽ ${se.old_version} ๆ›ดๆ–ฐๅˆฐ ${se.new_version}`});const ge=await Tl();P(on(c.id,ge)),C(dn(c.id,ge))}catch(se){i({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{G(!1)}};if(f)return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),children:e.jsx(ka,{className:"h-5 w-5"})}),e.jsx("div",{children:e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"ๆ’ไปถ่ฏฆๆƒ…"})})]}),e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"ๅŠ ่ฝฝๆ’ไปถไฟกๆฏไธญ..."})]})]});if(v||!c)return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),children:e.jsx(ka,{className:"h-5 w-5"})}),e.jsx("div",{children:e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"ๆ’ไปถ่ฏฆๆƒ…"})})]}),e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(St,{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:v}),e.jsx(S,{onClick:()=>l({to:"/plugins"}),children:"่ฟ”ๅ›žๆ’ไปถๅˆ—่กจ"})]})})]});const ve=ee();return 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",{className:"flex items-center gap-3",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),className:"shrink-0",children:e.jsx(ka,{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-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:c.manifest.name})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:_?e.jsxs(e.Fragment,{children:[O()?e.jsx(S,{disabled:!w?.installed||M,onClick:ce,title:w?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๆ›ดๆ–ฐไธญ..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"h-4 w-4 mr-2"}),"ๆ›ดๆ–ฐ"]})}):null,e.jsx(S,{variant:"destructive",disabled:!w?.installed||M,onClick:me,title:w?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๅธ่ฝฝไธญ..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ns,{className:"h-4 w-4 mr-2"}),"ๅธ่ฝฝ"]})})]}):e.jsx(S,{disabled:!w?.installed||!ve||M,onClick:R,title:w?.installed?ve?void 0:`ไธๅ…ผๅฎนๅฝ“ๅ‰็‰ˆๆœฌ (้œ€่ฆ ${c.manifest.host_application.min_version}${c.manifest.host_application.max_version?` - ${c.manifest.host_application.max_version}`:"+"}๏ผŒๅฝ“ๅ‰ ${D?.version})`:"Git ๆœชๅฎ‰่ฃ…",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๅฎ‰่ฃ…ไธญ..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Zt,{className:"h-4 w-4 mr-2"}),"ๅฎ‰่ฃ…"]})})})]}),e.jsx(Je,{className:"h-[calc(100vh-200px)] sm:h-[calc(100vh-220px)]",children:e.jsxs("div",{className:"space-y-6 pr-4",children:[e.jsx(Ce,{children:e.jsx(Pe,{children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx(He,{className:"text-2xl",children:c.manifest.name}),e.jsxs(ke,{variant:"secondary",className:"text-sm",children:["v",c.manifest.version]}),_&&e.jsxs(ke,{variant:"default",className:"text-sm",children:[e.jsx(la,{className:"h-3 w-3 mr-1"}),"ๅทฒๅฎ‰่ฃ… ",E&&`(v${E})`]}),O()&&e.jsxs(ke,{variant:"outline",className:"text-sm border-orange-500 text-orange-500",children:[e.jsx(ft,{className:"h-3 w-3 mr-1"}),"ๅฏๆ›ดๆ–ฐ"]}),!ve&&e.jsxs(ke,{variant:"destructive",className:"text-sm",children:[e.jsx(St,{className:"h-3 w-3 mr-1"}),"ไธๅ…ผๅฎน"]})]}),e.jsx(As,{className:"text-base",children:c.manifest.description})]})})})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"็ปŸ่ฎกไฟกๆฏ"})}),e.jsx(Re,{children:e.jsx(Ok,{pluginId:c.id})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"ๅŸบๆœฌไฟกๆฏ"})}),e.jsx(Re,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Bn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ไฝœ่€…:"}),e.jsx("span",{className:"font-medium",children:c.manifest.author?.name||"Unknown"}),c.manifest.author?.url&&e.jsx("a",{href:c.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.jsx(_o,{className:"h-3 w-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(aa,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"็‰ˆๆœฌ:"}),e.jsxs("span",{className:"font-medium",children:["v",c.manifest.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Nj,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"่ฎธๅฏ่ฏ:"}),e.jsx("span",{className:"font-medium",children:c.manifest.license})]}),c.manifest.homepage_url&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Ao,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ไธป้กต:"}),e.jsxs("a",{href:c.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["่ฎฟ้—ฎ",e.jsx(_o,{className:"h-3 w-3"})]})]}),c.manifest.repository_url&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(n1,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ไป“ๅบ“:"}),e.jsxs("a",{href:c.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["GitHub",e.jsx(_o,{className:"h-3 w-3"})]})]}),e.jsxs("div",{className:"pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm mb-2",children:[e.jsx(Yt,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ๆ”ฏๆŒ็‰ˆๆœฌ:"})]}),e.jsxs("div",{className:"text-sm pl-6 font-medium",children:[c.manifest.host_application.min_version,c.manifest.host_application.max_version?` - ${c.manifest.host_application.max_version}`:" - ๆœ€ๆ–ฐ็‰ˆๆœฌ"]})]})]})})]}),(c.manifest.categories||c.manifest.keywords)&&e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"ๅˆ†็ฑปไธŽๆ ‡็ญพ"})}),e.jsxs(Re,{className:"space-y-4",children:[c.manifest.categories&&c.manifest.categories.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"ๅˆ†็ฑป"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:c.manifest.categories.map(se=>e.jsx(ke,{variant:"secondary",children:Rk[se]||se},se))})]}),c.manifest.keywords&&c.manifest.keywords.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"ๆ ‡็ญพ"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:c.manifest.keywords.map(se=>e.jsxs(ke,{variant:"outline",className:"text-xs",children:[e.jsx(Go,{className:"h-3 w-3 mr-1"}),se]},se))})]})]})]})]}),e.jsxs(Ce,{className:"lg:col-span-2",children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"ๆ’ไปถ่ฏดๆ˜Ž"})}),e.jsx(Re,{children:e.jsx(Je,{className:"h-[600px] pr-4",children:g?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Ls,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-sm text-muted-foreground",children:"ๅŠ ่ฝฝ่ฏดๆ˜Žๆ–‡ๆกฃไธญ..."})]}):x?e.jsx(Km,{content:x}):e.jsx("div",{className:"text-center text-muted-foreground py-12",children:"ๆš‚ๆ— ่ฏดๆ˜Žๆ–‡ๆกฃ"})})})]})]})]})})]})}const Ii=m.forwardRef(({className:l,...n},i)=>e.jsx(Kg,{ref:i,className:H("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",l),...n}));Ii.displayName=Kg.displayName;const Uk=m.forwardRef(({className:l,...n},i)=>e.jsx(Qg,{ref:i,className:H("aspect-square h-full w-full",l),...n}));Uk.displayName=Qg.displayName;const Pi=m.forwardRef(({className:l,...n},i)=>e.jsx(Yg,{ref:i,className:H("flex h-full w-full items-center justify-center rounded-full bg-muted",l),...n}));Pi.displayName=Yg.displayName;function Bk(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function $k(){const l="maibot_webui_user_id";let n=localStorage.getItem(l);return n||(n=Bk(),localStorage.setItem(l,n)),n}function Ik(){return localStorage.getItem("maibot_webui_user_name")||"WebUI็”จๆˆท"}function Pk(l){localStorage.setItem("maibot_webui_user_name",l)}const Lv="maibot_webui_virtual_tabs";function Hk(){try{const l=localStorage.getItem(Lv);if(l)return JSON.parse(l)}catch(l){console.error("[Chat] ๅŠ ่ฝฝ่™šๆ‹Ÿๆ ‡็ญพ้กตๅคฑ่ดฅ:",l)}return[]}function Tg(l){try{localStorage.setItem(Lv,JSON.stringify(l))}catch(n){console.error("[Chat] ไฟๅญ˜่™šๆ‹Ÿๆ ‡็ญพ้กตๅคฑ่ดฅ:",n)}}function Fk({segment:l}){switch(l.type){case"text":return e.jsx("span",{className:"whitespace-pre-wrap",children:String(l.data)});case"image":case"emoji":return e.jsx("img",{src:String(l.data),alt:l.type==="emoji"?"่กจๆƒ…ๅŒ…":"ๅ›พ็‰‡",className:H("rounded-lg max-w-full",l.type==="emoji"?"max-h-32":"max-h-64"),loading:"lazy",onError:n=>{const i=n.target;i.style.display="none",i.parentElement?.insertAdjacentHTML("beforeend",`[${l.type==="emoji"?"่กจๆƒ…ๅŒ…":"ๅ›พ็‰‡"}ๅŠ ่ฝฝๅคฑ่ดฅ]`)}});case"voice":return e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("audio",{controls:!0,src:String(l.data),className:"max-w-[200px] h-8",children:"ๆ‚จ็š„ๆต่งˆๅ™จไธๆ”ฏๆŒ้Ÿณ้ข‘ๆ’ญๆ”พ"})});case"video":return e.jsx("video",{controls:!0,src:String(l.data),className:"rounded-lg max-w-full max-h-64",children:"ๆ‚จ็š„ๆต่งˆๅ™จไธๆ”ฏๆŒ่ง†้ข‘ๆ’ญๆ”พ"});case"face":return e.jsxs("span",{className:"text-muted-foreground",children:["[่กจๆƒ…:",String(l.data),"]"]});case"music":return e.jsx("span",{className:"text-muted-foreground",children:"[้Ÿณไนๅˆ†ไบซ]"});case"file":return e.jsxs("span",{className:"text-muted-foreground",children:["[ๆ–‡ไปถ: ",String(l.data),"]"]});case"reply":return e.jsx("span",{className:"text-muted-foreground text-xs",children:"[ๅ›žๅคๆถˆๆฏ]"});case"forward":return e.jsx("span",{className:"text-muted-foreground",children:"[่ฝฌๅ‘ๆถˆๆฏ]"});case"unknown":default:return e.jsxs("span",{className:"text-muted-foreground",children:["[",l.original_type||"ๆœช็Ÿฅๆถˆๆฏ","]"]})}}function Gk({message:l,isBot:n}){return l.message_type==="rich"&&l.segments&&l.segments.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:l.segments.map((i,c)=>e.jsx(Fk,{segment:i},c))}):e.jsx("span",{className:"whitespace-pre-wrap",children:l.content})}function Vk(){const l={id:"webui-default",type:"webui",label:"WebUI",messages:[],isConnected:!1,isTyping:!1,sessionInfo:{}},n=()=>{const qe=Hk().map(Qe=>{const We=Qe.virtualConfig;return!We.groupId&&We.platform&&We.userId&&(We.groupId=`webui_virtual_group_${We.platform}_${We.userId}`),{id:Qe.id,type:"virtual",label:Qe.label,virtualConfig:We,messages:[],isConnected:!1,isTyping:!1,sessionInfo:{}}});return[l,...qe]},[i,c]=m.useState(n),[u,x]=m.useState("webui-default"),h=i.find(q=>q.id===u)||i[0],[f,p]=m.useState(""),[g,N]=m.useState(!1),[v,y]=m.useState(!0),[w,b]=m.useState(Ik()),[D,A]=m.useState(!1),[_,P]=m.useState(""),[E,C]=m.useState(!1),[M,G]=m.useState([]),[O,ee]=m.useState([]),[R,me]=m.useState(!1),[ce,ve]=m.useState(!1),[se,ge]=m.useState(""),[fe,z]=m.useState({platform:"",personId:"",userId:"",userName:"",groupName:"",groupId:""}),Q=m.useRef($k()),$=m.useRef(new Map),L=m.useRef(null),I=m.useRef(new Map),_e=m.useRef(0),je=m.useRef(new Map),{toast:Se}=st(),K=q=>(_e.current+=1,`${q}-${Date.now()}-${_e.current}-${Math.random().toString(36).substr(2,9)}`),U=m.useCallback((q,qe)=>{c(Qe=>Qe.map(We=>We.id===q?{...We,...qe}:We))},[]),V=m.useCallback((q,qe)=>{c(Qe=>Qe.map(We=>We.id===q?{...We,messages:[...We.messages,qe]}:We))},[]),xe=m.useCallback(()=>{L.current?.scrollIntoView({behavior:"smooth"})},[]);m.useEffect(()=>{xe()},[h?.messages,xe]);const Ae=m.useCallback(async()=>{me(!0);try{const q=await we("/api/chat/platforms");if(console.log("[Chat] ๅนณๅฐๅˆ—่กจๅ“ๅบ”:",q.status,q.headers.get("content-type")),q.ok){const qe=q.headers.get("content-type");if(qe&&qe.includes("application/json")){const Qe=await q.json();console.log("[Chat] ๅนณๅฐๅˆ—่กจๆ•ฐๆฎ:",Qe),G(Qe.platforms||[])}else{const Qe=await q.text();console.error("[Chat] ่Žทๅ–ๅนณๅฐๅˆ—่กจๅคฑ่ดฅ: ้ž JSON ๅ“ๅบ”:",Qe.substring(0,200)),Se({title:"่ฟžๆŽฅๅคฑ่ดฅ",description:"ๆ— ๆณ•่ฟžๆŽฅๅˆฐๅŽ็ซฏๆœๅŠก๏ผŒ่ฏท็กฎไฟ MaiBot ๅทฒๅฏๅŠจ",variant:"destructive"})}}else console.error("[Chat] ่Žทๅ–ๅนณๅฐๅˆ—่กจๅคฑ่ดฅ: HTTP",q.status),Se({title:"่Žทๅ–ๅนณๅฐๅคฑ่ดฅ",description:`ๆœๅŠกๅ™จ่ฟ”ๅ›ž้”™่ฏฏ: ${q.status}`,variant:"destructive"})}catch(q){console.error("[Chat] ่Žทๅ–ๅนณๅฐๅˆ—่กจๅคฑ่ดฅ:",q),Se({title:"็ฝ‘็ปœ้”™่ฏฏ",description:"ๆ— ๆณ•่ฟžๆŽฅๅˆฐๅŽ็ซฏๆœๅŠก",variant:"destructive"})}finally{me(!1)}},[Se]),X=m.useCallback(async(q,qe)=>{ve(!0);try{const Qe=new URLSearchParams;q&&Qe.append("platform",q),qe&&Qe.append("search",qe),Qe.append("limit","50");const We=await we(`/api/chat/persons?${Qe.toString()}`);if(We.ok){const Ds=We.headers.get("content-type");if(Ds&&Ds.includes("application/json")){const as=await We.json();ee(as.persons||[])}else console.error("[Chat] ่Žทๅ–็”จๆˆทๅˆ—่กจๅคฑ่ดฅ: ๅŽ็ซฏ่ฟ”ๅ›ž้ž JSON ๅ“ๅบ”")}}catch(Qe){console.error("[Chat] ่Žทๅ–็”จๆˆทๅˆ—่กจๅคฑ่ดฅ:",Qe)}finally{ve(!1)}},[]);m.useEffect(()=>{fe.platform&&X(fe.platform,se)},[fe.platform,se,X]);const oe=m.useCallback(async(q,qe)=>{y(!0);try{const Qe=new URLSearchParams;Qe.append("user_id",Q.current),Qe.append("limit","50"),qe&&Qe.append("group_id",qe);const We=`/api/chat/history?${Qe.toString()}`;console.log("[Chat] ๆญฃๅœจๅŠ ่ฝฝๅކๅฒๆถˆๆฏ:",We);const Ds=await we(We);if(Ds.ok){const as=await Ds.text();try{const ks=JSON.parse(as);if(ks.messages&&ks.messages.length>0){const Ee=ks.messages.map(ls=>({id:ls.id,type:ls.type,content:ls.content,timestamp:ls.timestamp,sender:{name:ls.sender_name||(ls.is_bot?"้บฆ้บฆ":"WebUI็”จๆˆท"),user_id:ls.user_id,is_bot:ls.is_bot}}));U(q,{messages:Ee});const vs=je.current.get(q)||new Set;Ee.forEach(ls=>{if(ls.type==="bot"){const es=`bot-${ls.content}-${Math.floor(ls.timestamp*1e3)}`;vs.add(es)}}),je.current.set(q,vs)}}catch(ks){console.error("[Chat] JSON ่งฃๆžๅคฑ่ดฅ:",ks)}}}catch(Qe){console.error("[Chat] ๅŠ ่ฝฝๅކๅฒๆถˆๆฏๅคฑ่ดฅ:",Qe)}finally{y(!1)}},[U]),Fe=m.useCallback(async(q,qe,Qe)=>{const We=$.current.get(q);if(We?.readyState===WebSocket.OPEN||We?.readyState===WebSocket.CONNECTING){console.log(`[Tab ${q}] WebSocket ๅทฒๅญ˜ๅœจ๏ผŒ่ทณ่ฟ‡่ฟžๆŽฅ`);return}N(!0);let Ds=null;try{const vs=await we("/api/webui/ws-token");if(vs.ok){const ls=await vs.json();if(ls.success&&ls.token)Ds=ls.token;else{console.warn(`[Tab ${q}] ่Žทๅ– WebSocket token ๅคฑ่ดฅ: ${ls.message||"ๆœช็™ปๅฝ•"}`),N(!1);return}}}catch(vs){console.error(`[Tab ${q}] ่Žทๅ– WebSocket token ๅคฑ่ดฅ:`,vs),N(!1);return}if(!Ds){N(!1);return}const as=window.location.protocol==="https:"?"wss:":"ws:",ks=new URLSearchParams;ks.append("token",Ds),qe==="virtual"&&Qe?(ks.append("user_id",Qe.userId),ks.append("user_name",Qe.userName),ks.append("platform",Qe.platform),ks.append("person_id",Qe.personId),ks.append("group_name",Qe.groupName||"WebUI่™šๆ‹Ÿ็พค่Š"),Qe.groupId&&ks.append("group_id",Qe.groupId)):(ks.append("user_id",Q.current),ks.append("user_name",w));const Ee=`${as}//${window.location.host}/api/chat/ws?${ks.toString()}`;console.log(`[Tab ${q}] ๆญฃๅœจ่ฟžๆŽฅ WebSocket:`,Ee);try{const vs=new WebSocket(Ee);$.current.set(q,vs),vs.onopen=()=>{U(q,{isConnected:!0}),N(!1),console.log(`[Tab ${q}] WebSocket ๅทฒ่ฟžๆŽฅ`)},vs.onmessage=ls=>{try{const es=JSON.parse(ls.data);switch(es.type){case"session_info":U(q,{sessionInfo:{session_id:es.session_id,user_id:es.user_id,user_name:es.user_name,bot_name:es.bot_name}});break;case"system":V(q,{id:K("sys"),type:"system",content:es.content||"",timestamp:es.timestamp||Date.now()/1e3});break;case"user_message":{const Ns=es.sender?.user_id,pt=qe==="virtual"&&Qe?Qe.userId:Q.current;console.log(`[Tab ${q}] ๆ”ถๅˆฐ user_message, sender: ${Ns}, current: ${pt}`);const Lt=Ns?Ns.replace(/^webui_user_/,""):"",tt=pt?pt.replace(/^webui_user_/,""):"";if(Lt&&tt&&Lt===tt){console.log(`[Tab ${q}] ่ทณ่ฟ‡่‡ชๅทฑ็š„ๆถˆๆฏ๏ผˆuser_id ๅŒน้…๏ผ‰`);break}const Es=je.current.get(q)||new Set,kt=`user-${es.content}-${Math.floor((es.timestamp||0)*1e3)}`;if(Es.has(kt)){console.log(`[Tab ${q}] ่ทณ่ฟ‡่‡ชๅทฑ็š„ๆถˆๆฏ๏ผˆๅ†…ๅฎนๅŽป้‡๏ผ‰`);break}if(Es.add(kt),je.current.set(q,Es),Es.size>100){const Ut=Es.values().next().value;Ut&&Es.delete(Ut)}V(q,{id:es.message_id||K("user"),type:"user",content:es.content||"",timestamp:es.timestamp||Date.now()/1e3,sender:es.sender});break}case"bot_message":{U(q,{isTyping:!1});const Ns=je.current.get(q)||new Set,pt=`bot-${es.content}-${Math.floor((es.timestamp||0)*1e3)}`;if(Ns.has(pt))break;if(Ns.add(pt),je.current.set(q,Ns),Ns.size>100){const Lt=Ns.values().next().value;Lt&&Ns.delete(Lt)}c(Lt=>Lt.map(tt=>{if(tt.id!==q)return tt;const Es=tt.messages.filter(Ut=>Ut.type!=="thinking"),kt={id:K("bot"),type:"bot",content:es.content||"",message_type:es.message_type==="rich"?"rich":"text",segments:es.segments,timestamp:es.timestamp||Date.now()/1e3,sender:es.sender};return{...tt,messages:[...Es,kt]}}));break}case"typing":U(q,{isTyping:es.is_typing||!1});break;case"error":c(Ns=>Ns.map(pt=>{if(pt.id!==q)return pt;const Lt=pt.messages.filter(tt=>tt.type!=="thinking");return{...pt,messages:[...Lt,{id:K("error"),type:"error",content:es.content||"ๅ‘็”Ÿ้”™่ฏฏ",timestamp:es.timestamp||Date.now()/1e3}]}})),Se({title:"้”™่ฏฏ",description:es.content,variant:"destructive"});break;case"pong":break;case"history":{const Ns=es.messages||[];if(Ns.length>0){const pt=je.current.get(q)||new Set,Lt=Ns.map(tt=>{const Es=tt.is_bot||!1,kt=tt.id||K(Es?"bot":"user"),Ut=`${Es?"bot":"user"}-${tt.content}-${Math.floor(tt.timestamp*1e3)}`;return pt.add(Ut),{id:kt,type:Es?"bot":"user",content:tt.content,timestamp:tt.timestamp,sender:{name:tt.sender_name||(Es?"้บฆ้บฆ":"็”จๆˆท"),user_id:tt.sender_id,is_bot:Es}}});je.current.set(q,pt),U(q,{messages:Lt}),console.log(`[Tab ${q}] ๅทฒๅŠ ่ฝฝ ${Lt.length} ๆกๅކๅฒๆถˆๆฏ`)}break}default:console.log("ๆœช็Ÿฅๆถˆๆฏ็ฑปๅž‹:",es.type)}}catch(es){console.error("่งฃๆžๆถˆๆฏๅคฑ่ดฅ:",es)}},vs.onclose=()=>{U(q,{isConnected:!1}),N(!1),$.current.delete(q),console.log(`[Tab ${q}] WebSocket ๅทฒๆ–ญๅผ€`);const ls=I.current.get(q);ls&&clearTimeout(ls);const es=window.setTimeout(()=>{if(!Y.current){const Ns=i.find(pt=>pt.id===q);Ns&&Fe(q,Ns.type,Ns.virtualConfig)}},5e3);I.current.set(q,es)},vs.onerror=ls=>{console.error(`[Tab ${q}] WebSocket ้”™่ฏฏ:`,ls),N(!1)}}catch(vs){console.error(`[Tab ${q}] ๅˆ›ๅปบ WebSocket ๅคฑ่ดฅ:`,vs),N(!1)}},[w,U,V,Se,i]),Y=m.useRef(!1);m.useEffect(()=>{Y.current=!1;const q=$.current,qe=I.current,Qe=je.current;oe("webui-default");const We=setTimeout(()=>{Y.current||(Fe("webui-default","webui"),i.forEach(as=>{as.type==="virtual"&&as.virtualConfig&&(Qe.set(as.id,new Set),setTimeout(()=>{Y.current||Fe(as.id,"virtual",as.virtualConfig)},200))}))},100),Ds=setInterval(()=>{q.forEach(as=>{as.readyState===WebSocket.OPEN&&as.send(JSON.stringify({type:"ping"}))})},3e4);return()=>{Y.current=!0,clearTimeout(We),clearInterval(Ds),qe.forEach(as=>{clearTimeout(as)}),qe.clear(),q.forEach(as=>{as.close()}),q.clear()}},[]);const te=m.useCallback(()=>{const q=$.current.get(u);if(!f.trim()||!q||q.readyState!==WebSocket.OPEN)return;const qe=h?.type==="virtual"&&h.virtualConfig?.userName||w,Qe=f.trim(),We=Date.now()/1e3;q.send(JSON.stringify({type:"message",content:Qe,user_name:qe}));const Ds=je.current.get(u)||new Set,as=`user-${Qe}-${Math.floor(We*1e3)}`;if(Ds.add(as),je.current.set(u,Ds),Ds.size>100){const vs=Ds.values().next().value;vs&&Ds.delete(vs)}const ks={id:K("user"),type:"user",content:Qe,timestamp:We,sender:{name:qe,is_bot:!1}};V(u,ks);const Ee={id:K("thinking"),type:"thinking",content:"",timestamp:We+.001,sender:{name:h?.sessionInfo.bot_name||"้บฆ้บฆ",is_bot:!0}};V(u,Ee),p("")},[f,w,u,h,V]),Oe=q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),te())},De=()=>{P(w),A(!0)},Me=()=>{const q=_.trim()||"WebUI็”จๆˆท";b(q),Pk(q),A(!1);const qe=$.current.get(u);qe?.readyState===WebSocket.OPEN&&qe.send(JSON.stringify({type:"update_nickname",user_name:q}))},de=()=>{P(""),A(!1)},Te=q=>new Date(q*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),rs=()=>{const q=$.current.get(u);q&&(q.close(),$.current.delete(u)),Fe(u,h?.type||"webui",h?.virtualConfig)},Rt=()=>{z({platform:"",personId:"",userId:"",userName:"",groupName:"",groupId:""}),ge(""),Ae(),C(!0)},sa=()=>{if(!fe.platform||!fe.personId){Se({title:"้…็ฝฎไธๅฎŒๆ•ด",description:"่ฏท้€‰ๆ‹ฉๅนณๅฐๅ’Œ็”จๆˆท",variant:"destructive"});return}const q=`webui_virtual_group_${fe.platform}_${fe.userId}`,qe=`virtual-${fe.platform}-${fe.userId}-${Date.now()}`,Qe=fe.userName||fe.userId,We={id:qe,type:"virtual",label:Qe,virtualConfig:{...fe,groupId:q},messages:[],isConnected:!1,isTyping:!1,sessionInfo:{}};c(Ds=>{const as=[...Ds,We],ks=as.filter(Ee=>Ee.type==="virtual"&&Ee.virtualConfig).map(Ee=>({id:Ee.id,label:Ee.label,virtualConfig:Ee.virtualConfig,createdAt:Date.now()}));return Tg(ks),as}),x(qe),C(!1),je.current.set(qe,new Set),setTimeout(()=>{Fe(qe,"virtual",fe)},100),Se({title:"่™šๆ‹Ÿ่บซไปฝๆ ‡็ญพ้กต",description:`ๅทฒๅˆ›ๅปบ ${Qe} ็š„ๅฏน่ฏ`})},Ga=(q,qe)=>{if(qe?.stopPropagation(),q==="webui-default")return;const Qe=$.current.get(q);Qe&&(Qe.close(),$.current.delete(q));const We=I.current.get(q);We&&(clearTimeout(We),I.current.delete(q)),je.current.delete(q),c(Ds=>{const as=Ds.filter(Ee=>Ee.id!==q),ks=as.filter(Ee=>Ee.type==="virtual"&&Ee.virtualConfig).map(Ee=>({id:Ee.id,label:Ee.label,virtualConfig:Ee.virtualConfig,createdAt:Date.now()}));return Tg(ks),as}),u===q&&x("webui-default")},Pt=q=>{x(q)},ut=q=>{z(qe=>({...qe,personId:q.person_id,userId:q.user_id,userName:q.nickname||q.person_name}))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx(Ps,{open:E,onOpenChange:C,children:e.jsxs(Us,{className:"sm:max-w-[500px] max-h-[85vh] overflow-hidden flex flex-col",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(fm,{className:"h-5 w-5"}),"ๆ–ฐๅปบ่™šๆ‹Ÿ่บซไปฝๅฏน่ฏ"]}),e.jsx(Ys,{children:"้€‰ๆ‹ฉไธ€ไธช้บฆ้บฆๅทฒ่ฎค่ฏ†็š„็”จๆˆท๏ผŒไปฅ่ฏฅ็”จๆˆท็š„่บซไปฝไธŽ้บฆ้บฆๅฏน่ฏใ€‚้บฆ้บฆๅฐ†ไฝฟ็”จๅฅนๅฏน่ฏฅ็”จๆˆท็š„่ฎฐๅฟ†ๅ’Œ่ฎค็Ÿฅๆฅๅ›žๅบ”ใ€‚"})]}),e.jsxs("div",{className:"space-y-4 flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(Ao,{className:"h-4 w-4"}),"้€‰ๆ‹ฉๅนณๅฐ"]}),e.jsxs(Be,{value:fe.platform,onValueChange:q=>{z(qe=>({...qe,platform:q,personId:"",userId:"",userName:""})),ee([])},children:[e.jsx(Le,{disabled:R,children:e.jsx($e,{placeholder:R?"ๅŠ ่ฝฝไธญ...":"้€‰ๆ‹ฉๅนณๅฐ"})}),e.jsx(Ue,{children:M.map(q=>e.jsxs(W,{value:q.platform,children:[q.platform," (",q.count," ไบบ)"]},q.platform))})]})]}),fe.platform&&e.jsxs("div",{className:"space-y-2 flex-1 overflow-hidden flex flex-col",children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(Am,{className:"h-4 w-4"}),"้€‰ๆ‹ฉ็”จๆˆท"]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดข็”จๆˆทๅ...",value:se,onChange:q=>ge(q.target.value),className:"pl-9"})]}),e.jsx(Je,{className:"h-[250px] border rounded-md",children:e.jsx("div",{className:"p-2",children:ce?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Ls,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):O.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[e.jsx(Am,{className:"h-8 w-8 mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"ๆฒกๆœ‰ๆ‰พๅˆฐ็”จๆˆท"})]}):e.jsx("div",{className:"space-y-1",children:O.map(q=>e.jsxs("button",{onClick:()=>ut(q),className:H("w-full flex items-center gap-3 p-2 rounded-md text-left transition-colors",fe.personId===q.person_id?"bg-primary text-primary-foreground":"hover:bg-muted"),children:[e.jsx(Ii,{className:"h-8 w-8 shrink-0",children:e.jsx(Pi,{className:H("text-xs",fe.personId===q.person_id?"bg-primary-foreground/20":"bg-muted"),children:(q.nickname||q.person_name||"?").charAt(0)})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium truncate",children:q.nickname||q.person_name}),e.jsxs("div",{className:H("text-xs truncate",fe.personId===q.person_id?"text-primary-foreground/70":"text-muted-foreground"),children:["ID: ",q.user_id,q.is_known&&" ยท ๅทฒ่ฎค่ฏ†"]})]})]},q.person_id))})})})]}),fe.personId&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"่™šๆ‹Ÿ็พคๅ๏ผˆๅฏ้€‰๏ผ‰"}),e.jsx(ne,{placeholder:"WebUI่™šๆ‹Ÿ็พค่Š",value:fe.groupName,onChange:q=>z(qe=>({...qe,groupName:q.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆไผš่ฎคไธบ่ฟ™ๆ˜ฏไธ€ไธชๅไธบๆญคๅ็งฐ็š„็พค่Š"})]})]}),e.jsxs(et,{className:"gap-2 sm:gap-0",children:[e.jsx(S,{variant:"outline",onClick:()=>C(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:sa,disabled:!fe.platform||!fe.personId,children:"ๅˆ›ๅปบๅฏน่ฏ"})]})]})}),e.jsx("div",{className:"shrink-0 border-b bg-muted/30",children:e.jsx("div",{className:"max-w-4xl mx-auto px-2 sm:px-4",children:e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto py-1.5 scrollbar-thin",children:[i.map(q=>e.jsxs("div",{className:H("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm whitespace-nowrap transition-colors cursor-pointer","hover:bg-muted",u===q.id?"bg-background shadow-sm border":"text-muted-foreground"),onClick:()=>Pt(q.id),children:[q.type==="webui"?e.jsx(Pa,{className:"h-3.5 w-3.5"}):e.jsx(fm,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"max-w-[100px] truncate",children:q.label}),e.jsx("span",{className:H("w-1.5 h-1.5 rounded-full",q.isConnected?"bg-green-500":"bg-muted-foreground/50")}),q.id!=="webui-default"&&e.jsx("span",{onClick:qe=>Ga(q.id,qe),className:"ml-0.5 p-0.5 rounded hover:bg-muted-foreground/20 cursor-pointer",role:"button",tabIndex:0,onKeyDown:qe=>{(qe.key==="Enter"||qe.key===" ")&&(qe.preventDefault(),Ga(q.id,qe))},children:e.jsx(Ca,{className:"h-3 w-3"})})]},q.id)),e.jsx("button",{onClick:Rt,className:"flex items-center gap-1 px-2 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"ๆ–ฐๅปบ่™šๆ‹Ÿ่บซไปฝๅฏน่ฏ",children:e.jsx(Zs,{className:"h-3.5 w-3.5"})})]})})}),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(Ii,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:e.jsx(Pi,{className:"bg-primary/10 text-primary",children:e.jsx(Bi,{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:h?.sessionInfo.bot_name||"้บฆ้บฆ"}),e.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:h?.isConnected?e.jsxs(e.Fragment,{children:[e.jsx(r1,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"ๅทฒ่ฟžๆŽฅ"})]}):g?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"่ฟžๆŽฅไธญ..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(i1,{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(Ls,{className:"h-4 w-4 animate-spin text-muted-foreground"}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:rs,disabled:g,title:"้‡ๆ–ฐ่ฟžๆŽฅ",children:e.jsx(ft,{className:H("h-4 w-4",g&&"animate-spin")})})]})]}),e.jsx("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:h?.type==="virtual"&&h.virtualConfig?e.jsxs(e.Fragment,{children:[e.jsx(fm,{className:"h-3 w-3 text-primary"}),e.jsx("span",{children:"่™šๆ‹Ÿ่บซไปฝ๏ผš"}),e.jsx("span",{className:"font-medium text-primary",children:h.virtualConfig.userName}),e.jsxs("span",{className:"text-xs",children:["(",h.virtualConfig.platform,")"]}),h.virtualConfig.groupName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1",children:"ยท"}),e.jsxs("span",{className:"text-xs",children:["็พค๏ผš",h.virtualConfig.groupName]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Bn,{className:"h-3 w-3"}),e.jsx("span",{children:"ๅฝ“ๅ‰่บซไปฝ๏ผš"}),D?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{value:_,onChange:q=>P(q.target.value),onKeyDown:q=>{q.key==="Enter"&&Me(),q.key==="Escape"&&de()},className:"h-7 w-32",placeholder:"่พ“ๅ…ฅๆ˜ต็งฐ",autoFocus:!0}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:Me,children:"ไฟๅญ˜"}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:de,children:"ๅ–ๆถˆ"})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium text-foreground",children:w}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:De,title:"ไฟฎๆ”นๆ˜ต็งฐ",children:e.jsx(c1,{className:"h-3 w-3"})})]})]})})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Je,{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:[h?.messages.length===0&&!v&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(Bi,{className:"h-12 w-12 mb-4 opacity-50"}),e.jsxs("p",{className:"text-sm",children:["ๅผ€ๅง‹ไธŽ ",h?.sessionInfo.bot_name||"้บฆ้บฆ"," ๅฏน่ฏๅง๏ผ"]})]}),h?.messages.map(q=>e.jsxs("div",{className:H("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==="thinking"&&e.jsxs(e.Fragment,{children:[e.jsx(Ii,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pi,{className:"bg-primary/10 text-primary",children:e.jsx(Bi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:"flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",children:[e.jsx("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||h?.sessionInfo.bot_name})}),e.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"w-2 h-2 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-2 h-2 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-2 h-2 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),e.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"ๆ€่€ƒไธญ..."})]})})]})]}),(q.type==="user"||q.type==="bot")&&e.jsxs(e.Fragment,{children:[e.jsx(Ii,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pi,{className:H("text-xs",q.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:q.type==="bot"?e.jsx(Bi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):e.jsx(Bn,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:H("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"?h?.sessionInfo.bot_name:w)}),e.jsx("span",{children:Te(q.timestamp)})]}),e.jsx("div",{className:H("rounded-2xl px-3 py-2 text-sm break-words",q.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:e.jsx(Gk,{message:q,isBot:q.type==="bot"})})]})]})]},q.id)),e.jsx("div",{ref:L})]})})}),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(ne,{value:f,onChange:q=>p(q.target.value),onKeyDown:Oe,placeholder:h?.isConnected?"่พ“ๅ…ฅๆถˆๆฏ...":"็ญ‰ๅพ…่ฟžๆŽฅ...",disabled:!h?.isConnected,className:"flex-1 h-10 sm:h-10"}),e.jsx(S,{onClick:te,disabled:!h?.isConnected||!f.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:e.jsx(o1,{className:"h-4 w-4"})})]})})})]})}var tx="Radio",[qk,Uv]=Po(tx),[Kk,Qk]=qk(tx),Bv=m.forwardRef((l,n)=>{const{__scopeRadio:i,name:c,checked:u=!1,required:x,disabled:h,value:f="on",onCheck:p,form:g,...N}=l,[v,y]=m.useState(null),w=Ho(n,A=>y(A)),b=m.useRef(!1),D=v?g||!!v.closest("form"):!0;return e.jsxs(Kk,{scope:i,checked:u,disabled:h,children:[e.jsx(Gn.button,{type:"button",role:"radio","aria-checked":u,"data-state":Hv(u),"data-disabled":h?"":void 0,disabled:h,value:f,...N,ref:w,onClick:un(l.onClick,A=>{u||p?.(),D&&(b.current=A.isPropagationStopped(),b.current||A.stopPropagation())})}),D&&e.jsx(Pv,{control:v,bubbles:!b.current,name:c,value:f,checked:u,required:x,disabled:h,form:g,style:{transform:"translateX(-100%)"}})]})});Bv.displayName=tx;var $v="RadioIndicator",Iv=m.forwardRef((l,n)=>{const{__scopeRadio:i,forceMount:c,...u}=l,x=Qk($v,i);return e.jsx(Tw,{present:c||x.checked,children:e.jsx(Gn.span,{"data-state":Hv(x.checked),"data-disabled":x.disabled?"":void 0,...u,ref:n})})});Iv.displayName=$v;var Yk="RadioBubbleInput",Pv=m.forwardRef(({__scopeRadio:l,control:n,checked:i,bubbles:c=!0,...u},x)=>{const h=m.useRef(null),f=Ho(h,x),p=Ew(i),g=Mw(n);return m.useEffect(()=>{const N=h.current;if(!N)return;const v=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==i&&w){const b=new Event("click",{bubbles:c});w.call(N,i),N.dispatchEvent(b)}},[p,i,c]),e.jsx(Gn.input,{type:"radio","aria-hidden":!0,defaultChecked:i,...u,tabIndex:-1,ref:f,style:{...u.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Pv.displayName=Yk;function Hv(l){return l?"checked":"unchecked"}var Jk=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Wo="RadioGroup",[Xk]=Po(Wo,[Jg,Uv]),Fv=Jg(),Gv=Uv(),[Zk,Wk]=Xk(Wo),Vv=m.forwardRef((l,n)=>{const{__scopeRadioGroup:i,name:c,defaultValue:u,value:x,required:h=!1,disabled:f=!1,orientation:p,dir:g,loop:N=!0,onValueChange:v,...y}=l,w=Fv(i),b=mj(g),[D,A]=Io({prop:x,defaultProp:u??null,onChange:v,caller:Wo});return e.jsx(Zk,{scope:i,name:c,required:h,disabled:f,value:D,onValueChange:A,children:e.jsx(H0,{asChild:!0,...w,orientation:p,dir:b,loop:N,children:e.jsx(Gn.div,{role:"radiogroup","aria-required":h,"aria-orientation":p,"data-disabled":f?"":void 0,dir:b,...y,ref:n})})})});Vv.displayName=Wo;var qv="RadioGroupItem",Kv=m.forwardRef((l,n)=>{const{__scopeRadioGroup:i,disabled:c,...u}=l,x=Wk(qv,i),h=x.disabled||c,f=Fv(i),p=Gv(i),g=m.useRef(null),N=Ho(n,g),v=x.value===u.value,y=m.useRef(!1);return m.useEffect(()=>{const w=D=>{Jk.includes(D.key)&&(y.current=!0)},b=()=>y.current=!1;return document.addEventListener("keydown",w),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",b)}},[]),e.jsx(F0,{asChild:!0,...f,focusable:!h,active:v,children:e.jsx(Bv,{disabled:h,required:x.required,checked:v,...p,...u,name:x.name,ref:N,onCheck:()=>x.onValueChange(u.value),onKeyDown:un(w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:un(u.onFocus,()=>{y.current&&g.current?.click()})})})});Kv.displayName=qv;var eC="RadioGroupIndicator",Qv=m.forwardRef((l,n)=>{const{__scopeRadioGroup:i,...c}=l,u=Gv(i);return e.jsx(Iv,{...u,...c,ref:n})});Qv.displayName=eC;var Yv=Vv,Jv=Kv,sC=Qv;const ax=m.forwardRef(({className:l,...n},i)=>e.jsx(Yv,{className:H("grid gap-2",l),...n,ref:i}));ax.displayName=Yv.displayName;const Bo=m.forwardRef(({className:l,...n},i)=>e.jsx(Jv,{ref:i,className:H("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",l),...n,children:e.jsx(sC,{className:"flex items-center justify-center",children:e.jsx(Dj,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Bo.displayName=Jv.displayName;function tC({question:l,value:n,onChange:i,error:c,disabled:u=!1}){const[x,h]=m.useState(null),f=u||l.readOnly,p=()=>{switch(l.type){case"single":return e.jsx(ax,{value:n||"",onValueChange:i,disabled:f,className:"space-y-2",children:l.options?.map(g=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Bo,{value:g.value,id:`${l.id}-${g.id}`}),e.jsx(T,{htmlFor:`${l.id}-${g.id}`,className:"cursor-pointer font-normal",children:g.label})]},g.id))});case"multiple":{const g=n||[];return e.jsxs("div",{className:"space-y-2",children:[l.options?.map(N=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:`${l.id}-${N.id}`,checked:g.includes(N.value),disabled:f||l.maxSelections!==void 0&&g.length>=l.maxSelections&&!g.includes(N.value),onCheckedChange:v=>{i(v?[...g,N.value]:g.filter(y=>y!==N.value))}}),e.jsx(T,{htmlFor:`${l.id}-${N.id}`,className:"cursor-pointer font-normal",children:N.label})]},N.id)),l.maxSelections&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๆœ€ๅคš้€‰ๆ‹ฉ ",l.maxSelections," ้กน"]})]})}case"text":return e.jsx(ne,{value:n||"",onChange:g=>i(g.target.value),placeholder:l.placeholder||"่ฏท่พ“ๅ…ฅ...",disabled:f,readOnly:l.readOnly,maxLength:l.maxLength,className:H(l.readOnly&&"bg-muted cursor-not-allowed")});case"textarea":return e.jsxs("div",{className:"space-y-1",children:[e.jsx(at,{value:n||"",onChange:g=>i(g.target.value),placeholder:l.placeholder||"่ฏท่พ“ๅ…ฅ...",disabled:f,readOnly:l.readOnly,maxLength:l.maxLength,rows:4,className:H(l.readOnly&&"bg-muted cursor-not-allowed")}),l.maxLength&&e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[(n||"").length," / ",l.maxLength]})]});case"rating":{const g=n||0,N=x!==null?x:g;return e.jsxs("div",{className:"flex items-center gap-1",children:[[1,2,3,4,5].map(v=>e.jsx("button",{type:"button",disabled:f,className:H("p-1 transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded",f&&"cursor-not-allowed opacity-50"),onMouseEnter:()=>!f&&h(v),onMouseLeave:()=>h(null),onClick:()=>!f&&i(v),children:e.jsx(rn,{className:H("h-6 w-6 transition-colors",v<=N?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})},v)),g>0&&e.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[g," / 5"]})]})}case"scale":{const g=l.min??1,N=l.max??10,v=l.step??1,y=n??g;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(_a,{value:[y],onValueChange:([w])=>i(w),min:g,max:N,step:v,disabled:f}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:l.minLabel||g}),e.jsx("span",{className:"font-medium text-foreground",children:y}),e.jsx("span",{children:l.maxLabel||N})]})]})}case"dropdown":return e.jsxs(Be,{value:n||"",onValueChange:i,disabled:f,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:l.placeholder||"่ฏท้€‰ๆ‹ฉ..."})}),e.jsx(Ue,{children:l.options?.map(g=>e.jsx(W,{value:g.value,children:g.label},g.id))})]});default:return e.jsx("div",{className:"text-muted-foreground",children:"ไธๆ”ฏๆŒ็š„้—ฎ้ข˜็ฑปๅž‹"})}};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-base font-medium",children:[l.title,l.required&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:l.description})]}),p(),c&&e.jsx("p",{className:"text-sm text-destructive",children:c})]})}const Xv="https://maibot-plugin-stats.maibot-webui.workers.dev";function Zv(){const l="maibot_user_id";let n=localStorage.getItem(l);if(!n){const i=Math.random().toString(36).substring(2,10),c=Date.now().toString(36),u=Math.random().toString(36).substring(2,10);n=`fp_${i}_${c}_${u}`,localStorage.setItem(l,n)}return n}async function aC(l,n,i,c){try{const u=c?.userId||Zv(),x={surveyId:l,surveyVersion:n,userId:u,answers:i,submittedAt:new Date().toISOString(),allowMultiple:c?.allowMultiple,metadata:{userAgent:navigator.userAgent,language:navigator.language}},h=await fetch(`${Xv}/survey/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)}),f=await h.json();return h.status===429?{success:!1,error:"ๆไบค่ฟ‡ไบŽ้ข‘็น๏ผŒ่ฏท็จๅŽๅ†่ฏ•"}:h.status===409?{success:!1,error:f.error||"ไฝ ๅทฒ็ปๆไบค่ฟ‡่ฟ™ไปฝ้—ฎๅทไบ†"}:h.ok?{success:!0,submissionId:f.submissionId,message:f.message}:{success:!1,error:f.error||"ๆไบคๅคฑ่ดฅ"}}catch(u){return console.error("Error submitting survey:",u),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function lC(l,n){try{const i=n||Zv(),c=new URLSearchParams({user_id:i,survey_id:l}),u=await fetch(`${Xv}/survey/check?${c}`);return u.ok?{success:!0,hasSubmitted:(await u.json()).hasSubmitted}:{success:!1,error:(await u.json()).error||"ๆฃ€ๆŸฅๅคฑ่ดฅ"}}catch(i){return console.error("Error checking submission:",i),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}function Wv({config:l,initialAnswers:n,onSubmitSuccess:i,onSubmitError:c,showProgress:u=!0,paginateQuestions:x=!1,className:h}){const f=m.useCallback(()=>!n||n.length===0?{}:n.reduce(($,L)=>($[L.questionId]=L.value,$),{}),[n]),[p,g]=m.useState(()=>f()),[N,v]=m.useState({}),[y,w]=m.useState(0),[b,D]=m.useState(!1),[A,_]=m.useState(!1),[P,E]=m.useState(null),[C,M]=m.useState(null),[G,O]=m.useState(!1),[ee,R]=m.useState(!0);m.useEffect(()=>{n&&n.length>0&&g($=>({...$,...f()}))},[n,f]),m.useEffect(()=>{(async()=>{if(!l.settings?.allowMultiple){const L=await lC(l.id);L.success&&L.hasSubmitted&&O(!0)}R(!1)})()},[l.id,l.settings?.allowMultiple]);const me=m.useCallback(()=>{const $=new Date;return!(l.settings?.startTime&&new Date(l.settings.startTime)>$||l.settings?.endTime&&new Date(l.settings.endTime)<$)},[l.settings?.startTime,l.settings?.endTime]),ce=l.questions.filter($=>{const L=p[$.id];return L==null?!1:Array.isArray(L)?L.length>0:typeof L=="string"?L.trim()!=="":!0}).length,ve=ce/l.questions.length*100,se=m.useCallback(($,L)=>{g(I=>({...I,[$]:L})),v(I=>{const _e={...I};return delete _e[$],_e})},[]),ge=m.useCallback(()=>{const $={};for(const L of l.questions){if(L.required){const I=p[L.id];if(I==null){$[L.id]="ๆญค้ข˜ไธบๅฟ…ๅกซ้กน";continue}if(Array.isArray(I)&&I.length===0){$[L.id]="่ฏท่‡ณๅฐ‘้€‰ๆ‹ฉไธ€้กน";continue}if(typeof I=="string"&&I.trim()===""){$[L.id]="ๆญค้ข˜ไธบๅฟ…ๅกซ้กน";continue}}L.minLength&&typeof p[L.id]=="string"&&p[L.id].length{if(!ge()){if(x){const $=l.questions.findIndex(L=>N[L.id]);$>=0&&w($)}return}D(!0),E(null);try{const $=l.questions.filter(I=>p[I.id]!==void 0).map(I=>({questionId:I.id,value:p[I.id]})),L=await aC(l.id,l.version,$,{allowMultiple:l.settings?.allowMultiple});if(L.success&&L.submissionId)_(!0),M(L.submissionId),i?.(L.submissionId);else{const I=L.error||"ๆไบคๅคฑ่ดฅ";E(I),c?.(I)}}catch($){const L=$ instanceof Error?$.message:"ๆไบคๅคฑ่ดฅ";E(L),c?.(L)}finally{D(!1)}},[ge,x,l,p,N,i,c]),z=m.useCallback($=>{$>=0&&$e.jsxs("div",{className:H("p-4 rounded-lg border bg-card",N[$.id]?"border-destructive bg-destructive/5":"border-border"),children:[x&&e.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:["้—ฎ้ข˜ ",y+1," / ",l.questions.length]}),!x&&e.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:[L+1,"."]}),e.jsx(tC,{question:$,value:p[$.id],onChange:I=>se($.id,I),error:N[$.id],disabled:b})]},$.id)),P&&e.jsxs(it,{variant:"destructive",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(ct,{children:P})]}),e.jsx("div",{className:"flex justify-between items-center py-4",children:x?e.jsxs(e.Fragment,{children:[e.jsxs(S,{variant:"outline",onClick:()=>z(y-1),disabled:y===0||b,children:[e.jsx(Fa,{className:"h-4 w-4 mr-1"}),"ไธŠไธ€้ข˜"]}),y===l.questions.length-1?e.jsxs(S,{onClick:fe,disabled:b,children:[b&&e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๆไบค้—ฎๅท"]}):e.jsxs(S,{onClick:()=>z(y+1),disabled:b,children:["ไธ‹ไธ€้ข˜",e.jsx(ea,{className:"h-4 w-4 ml-1"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:Object.keys(N).length>0&&e.jsxs("span",{className:"text-destructive",children:["่ฟ˜ๆœ‰ ",Object.keys(N).length," ไธชๅฟ…ๅกซ้กนๆœชๅฎŒๆˆ"]})}),e.jsxs(S,{onClick:fe,disabled:b,size:"lg",children:[b&&e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๆไบค้—ฎๅท"]})]})})]})})]})}const nC={id:"webui-feedback-v1",version:"1.0.0",title:"้บฆ้บฆ WebUI ไฝฟ็”จๅ้ฆˆ้—ฎๅท",description:"ๆ„Ÿ่ฐขๆ‚จไฝฟ็”จ้บฆ้บฆ WebUI๏ผๆ‚จ็š„ๅ้ฆˆๅฐ†ๅธฎๅŠฉๆˆ‘ไปฌไธๆ–ญๆ”น่ฟ›ไบงๅ“ไฝ“้ชŒใ€‚",questions:[{id:"webui_version",type:"text",title:"ไฝ ๆญฃๅœจไฝฟ็”จ็š„ WebUI ็‰ˆๆœฌ",description:"ๆญค้กน็”ฑ็ณป็ปŸ่‡ชๅŠจๅกซๅ†™",required:!0,readOnly:!0,placeholder:"่‡ชๅŠจๆฃ€ๆต‹ไธญ..."},{id:"ui_design_satisfaction",type:"single",title:"ไฝ ่ง‰ๅพ—ๅฝ“ๅ‰็š„ WebUI ็•Œ้ข่ฎพ่ฎกๅฆ‚ไฝ•๏ผŸ",required:!0,options:[{id:"very_satisfied",label:"้žๅธธๆปกๆ„",value:"very_satisfied"},{id:"satisfied",label:"ๆปกๆ„",value:"satisfied"},{id:"neutral",label:"ไธ€่ˆฌ",value:"neutral"},{id:"dissatisfied",label:"ไธๆปกๆ„",value:"dissatisfied"},{id:"very_dissatisfied",label:"้žๅธธไธๆปกๆ„",value:"very_dissatisfied"}]},{id:"problems_encountered",type:"multiple",title:"ไฝ ๅœจไฝฟ็”จ WebUI ๆ—ถ้‡ๅˆฐ่ฟ‡ๅ“ชไบ›้—ฎ้ข˜๏ผŸ",description:"ๅฏๅคš้€‰",required:!0,options:[{id:"lag",label:"็•Œ้ขๅก้กฟ",value:"lag"},{id:"incomplete",label:"ๅŠŸ่ƒฝไธๅฎŒๆ•ด",value:"incomplete"},{id:"complex",label:"ๆ“ไฝœๅคๆ‚",value:"complex"},{id:"bugs",label:"ๅญ˜ๅœจ Bug",value:"bugs"},{id:"none",label:"ๆฒกๆœ‰้‡ๅˆฐ้—ฎ้ข˜",value:"none"},{id:"other",label:"ๅ…ถไป–",value:"other"}]},{id:"problems_other",type:"text",title:'ๅฆ‚้€‰ๆ‹ฉ"ๅ…ถไป–"๏ผŒ่ฏท่ฏดๆ˜Ž้‡ๅˆฐ็š„้—ฎ้ข˜',required:!1,placeholder:"่ฏทๆ่ฟฐไฝ ้‡ๅˆฐ็š„ๅ…ถไป–้—ฎ้ข˜...",maxLength:500},{id:"useful_features",type:"textarea",title:"ไฝ ่ง‰ๅพ—ๅ“ชไบ›ๅŠŸ่ƒฝๆ˜ฏๆœ€ๆœ‰็”จ็š„๏ผŸ",required:!0,placeholder:"่ฏทๅˆ†ไบซไฝ ่ฎคไธบๆœ€ๆœ‰ไปทๅ€ผ็š„ๅŠŸ่ƒฝ...",maxLength:1e3},{id:"feature_requests",type:"textarea",title:"ไฝ ๅธŒๆœ›ๅœจๆœชๆฅ็š„็‰ˆๆœฌไธญๅขžๅŠ ๅ“ชไบ›ๅŠŸ่ƒฝ๏ผŸ",required:!0,placeholder:"่ฏทๅ‘Š่ฏ‰ๆˆ‘ไปฌไฝ ๆœŸๆœ›็š„ๆ–ฐๅŠŸ่ƒฝ...",maxLength:1e3},{id:"overall_satisfaction",type:"single",title:"ไฝ ๅฏน้บฆ้บฆ WebUI ็š„ๆ•ดไฝ“ๆปกๆ„ๅบฆๅฆ‚ไฝ•๏ผŸ",required:!0,options:[{id:"very_satisfied",label:"้žๅธธๆปกๆ„",value:"very_satisfied"},{id:"satisfied",label:"ๆปกๆ„",value:"satisfied"},{id:"neutral",label:"ไธ€่ˆฌ",value:"neutral"},{id:"dissatisfied",label:"ไธๆปกๆ„",value:"dissatisfied"},{id:"very_dissatisfied",label:"้žๅธธไธๆปกๆ„",value:"very_dissatisfied"}]},{id:"would_recommend",type:"single",title:"ไฝ ๆ„ฟๆ„ๆŽจ่้บฆ้บฆ WebUI ็ป™ๅ…ถไป–ไบบไฝฟ็”จๅ—๏ผŸ",required:!0,options:[{id:"yes",label:"ๆ˜ฏ",value:"yes"},{id:"no",label:"ๅฆ",value:"no"}]},{id:"other_suggestions",type:"textarea",title:"ๅ…ถไป–ๅปบ่ฎฎๆˆ–ๆ„่ง",description:"ๆญค้กนไธบ้€‰ๅกซ",required:!1,placeholder:"ๅฆ‚ๆžœไฝ ๆœ‰ไปปไฝ•ๅ…ถไป–ๆƒณๆณ•ๆˆ–ๅปบ่ฎฎ๏ผŒ่ฏทๅœจๆญคๅˆ†ไบซ...",maxLength:2e3}],settings:{allowMultiple:!1,thankYouMessage:"ๆ„Ÿ่ฐขไฝ ็š„ๅ้ฆˆ๏ผไฝ ็š„ๆ„่งๅฏนๆˆ‘ไปฌ้žๅธธ้‡่ฆ๏ผŒๆˆ‘ไปฌไผš่ฎค็œŸ่€ƒ่™‘ๆฏไธ€ๆกๅปบ่ฎฎใ€‚"}},rC={id:"maibot-feedback-v1",version:"1.0.0",title:"้บฆ้บฆไฝฟ็”จไฝ“้ชŒๅ้ฆˆ้—ฎๅท",description:"ๆ„Ÿ่ฐขๆ‚จไฝฟ็”จ้บฆ้บฆ๏ผๆ‚จ็š„ๅ้ฆˆๅฐ†ๅธฎๅŠฉๆˆ‘ไปฌๆ‰“้€ ๆ›ดๅฅฝ็š„ AI ไผ™ไผดใ€‚",questions:[{id:"maibot_version",type:"text",title:"ไฝ ๆญฃๅœจไฝฟ็”จ็š„้บฆ้บฆ็‰ˆๆœฌ",description:"ๆญค้กน็”ฑ็ณป็ปŸ่‡ชๅŠจๅกซๅ†™",required:!0,readOnly:!0,placeholder:"่‡ชๅŠจๆฃ€ๆต‹ไธญ..."},{id:"improvement_areas",type:"textarea",title:"ไฝ ่ฎคไธบ้บฆ้บฆ่ฟ˜ๆœ‰ๅ“ชไบ›้ƒจๅˆ†ๅฏไปฅๆ”น่ฟ›๏ผŸ",required:!0,placeholder:"่ฏทๅˆ†ไบซไฝ ่ฎคไธบๅฏไปฅๆ”น่ฟ›็š„ๆ–น้ข...",maxLength:1e3},{id:"problems_encountered",type:"multiple",title:"ไฝ ๅœจไฝฟ็”จ้บฆ้บฆๆ—ถ้‡ๅˆฐ่ฟ‡ๅ“ชไบ›้—ฎ้ข˜๏ผŸ",description:"ๅฏๅคš้€‰",required:!0,options:[{id:"incomplete",label:"ๅŠŸ่ƒฝไธๅฎŒๆ•ด",value:"incomplete"},{id:"slow_response",label:"ๅ“ๅบ”้€Ÿๅบฆๆ…ข",value:"slow_response"},{id:"complex",label:"ๆ“ไฝœๅคๆ‚",value:"complex"},{id:"unstable",label:"่ฟ่กŒไธ็จณๅฎš",value:"unstable"},{id:"config_difficult",label:"้…็ฝฎๅ›ฐ้šพ",value:"config_difficult"},{id:"none",label:"ๆฒกๆœ‰้‡ๅˆฐ้—ฎ้ข˜",value:"none"},{id:"other",label:"ๅ…ถไป–",value:"other"}]},{id:"problems_other",type:"text",title:'ๅฆ‚้€‰ๆ‹ฉ"ๅ…ถไป–"๏ผŒ่ฏท่ฏดๆ˜Ž้‡ๅˆฐ็š„้—ฎ้ข˜',required:!1,placeholder:"่ฏทๆ่ฟฐไฝ ้‡ๅˆฐ็š„ๅ…ถไป–้—ฎ้ข˜...",maxLength:500},{id:"helpful_features",type:"textarea",title:"ไฝ ่ง‰ๅพ—้บฆ้บฆ็š„ๅ“ชไบ›ๅŠŸ่ƒฝๅฏนไฝ ๆœ€ๆœ‰ๅธฎๅŠฉ๏ผŸ",required:!0,placeholder:"่ฏทๅˆ†ไบซๅฏนไฝ ๆœ€ๆœ‰ๅธฎๅŠฉ็š„ๅŠŸ่ƒฝ...",maxLength:1e3},{id:"feature_requests",type:"textarea",title:"ไฝ ๅธŒๆœ›ๅœจๆœชๆฅ็š„็‰ˆๆœฌไธญๅขžๅŠ ๅ“ชไบ›ๅŠŸ่ƒฝ๏ผŸ",required:!0,placeholder:"่ฏทๅ‘Š่ฏ‰ๆˆ‘ไปฌไฝ ๆœŸๆœ›็š„ๆ–ฐๅŠŸ่ƒฝ...",maxLength:1e3},{id:"overall_satisfaction",type:"single",title:"ไฝ ๅฏน้บฆ้บฆ็š„ๆ•ดไฝ“ๆปกๆ„ๅบฆๅฆ‚ไฝ•๏ผŸ",required:!0,options:[{id:"very_satisfied",label:"้žๅธธๆปกๆ„",value:"very_satisfied"},{id:"satisfied",label:"ๆปกๆ„",value:"satisfied"},{id:"neutral",label:"ไธ€่ˆฌ",value:"neutral"},{id:"dissatisfied",label:"ไธๆปกๆ„",value:"dissatisfied"},{id:"very_dissatisfied",label:"้žๅธธไธๆปกๆ„",value:"very_dissatisfied"}]},{id:"would_recommend",type:"single",title:"ไฝ ๆ„ฟๆ„ๆŽจ่้บฆ้บฆ็ป™ๅ…ถไป–ไบบไฝฟ็”จๅ—๏ผŸ",required:!0,options:[{id:"yes",label:"ๆ˜ฏ",value:"yes"},{id:"no",label:"ๅฆ",value:"no"}]},{id:"other_suggestions",type:"textarea",title:"ๅ…ถไป–ๅปบ่ฎฎๆˆ–ๆ„่ง",description:"ๆญค้กนไธบ้€‰ๅกซ",required:!1,placeholder:"ๅฆ‚ๆžœไฝ ๆœ‰ไปปไฝ•ๅ…ถไป–ๆƒณๆณ•ๆˆ–ๅปบ่ฎฎ๏ผŒ่ฏทๅœจๆญคๅˆ†ไบซ...",maxLength:2e3}],settings:{allowMultiple:!1,thankYouMessage:"ๆ„Ÿ่ฐขไฝ ็š„ๅ้ฆˆ๏ผไฝ ็š„ๆ„่งๅฏน้บฆ้บฆ็š„ๆˆ้•ฟ้žๅธธ้‡่ฆ๏ผŒๆˆ‘ไปฌไผš่ฎค็œŸ่€ƒ่™‘ๆฏไธ€ๆกๅปบ่ฎฎใ€‚"}};function iC(){const[l,n]=m.useState(!0),i=m.useMemo(()=>JSON.parse(JSON.stringify(nC)),[]);m.useEffect(()=>{n(!1)},[]);const c=m.useMemo(()=>[{questionId:"webui_version",value:`v${qo}`}],[]),u=m.useCallback(h=>{console.log("WebUI Survey submitted:",h)},[]),x=m.useCallback(h=>{console.error("WebUI Survey submission error:",h)},[]);return l?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i?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 shrink-0",children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(Oj,{className:"h-8 w-8",strokeWidth:2}),"WebUI ไฝฟ็”จๅ้ฆˆ้—ฎๅท"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆ„Ÿ่ฐขๆ‚จ็š„ๅ้ฆˆ๏ผŒๅธฎๅŠฉๆˆ‘ไปฌๆŒ็ปญๆ”น่ฟ›ไบงๅ“ไฝ“้ชŒ"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Wv,{config:i,initialAnswers:c,showProgress:!0,paginateQuestions:!1,onSubmitSuccess:u,onSubmitError:x})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[e.jsxs(it,{variant:"destructive",className:"max-w-md",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(ct,{children:"ๆ— ๆณ•ๅŠ ่ฝฝ้—ฎๅท้…็ฝฎ"})]}),e.jsx(S,{variant:"outline",onClick:()=>window.location.reload(),children:"้‡่ฏ•"})]})}function cC(){const[l,n]=m.useState(null),[i,c]=m.useState(!0),[u,x]=m.useState("ๆœช็Ÿฅ็‰ˆๆœฌ");m.useEffect(()=>{(async()=>{try{const v=await W1();x(v.version||"ๆœช็Ÿฅ็‰ˆๆœฌ")}catch(v){console.error("Failed to get MaiBot version:",v),x("่Žทๅ–ๅคฑ่ดฅ")}const N=JSON.parse(JSON.stringify(rC));n(N),c(!1)})()},[]);const h=m.useMemo(()=>[{questionId:"maibot_version",value:u}],[u]),f=m.useCallback(g=>{console.log("MaiBot Survey submitted:",g)},[]),p=m.useCallback(g=>{console.error("MaiBot Survey submission error:",g)},[]);return i?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):l?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 shrink-0",children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(Oj,{className:"h-8 w-8",strokeWidth:2}),"้บฆ้บฆไฝฟ็”จไฝ“้ชŒๅ้ฆˆ้—ฎๅท"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆ„Ÿ่ฐขๆ‚จ็š„ๅ้ฆˆ๏ผŒๅธฎๅŠฉๆˆ‘ไปฌๆ‰“้€ ๆ›ดๅฅฝ็š„ AI ไผ™ไผด"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Wv,{config:l,initialAnswers:h,showProgress:!0,paginateQuestions:!1,onSubmitSuccess:f,onSubmitError:p})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[e.jsxs(it,{variant:"destructive",className:"max-w-md",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(ct,{children:"ๆ— ๆณ•ๅŠ ่ฝฝ้—ฎๅท้…็ฝฎ"})]}),e.jsx(S,{variant:"outline",onClick:()=>window.location.reload(),children:"้‡่ฏ•"})]})}var ed="DropdownMenu",[oC]=Po(ed,[Xg]),ca=Xg(),[dC,eN]=oC(ed),sN=l=>{const{__scopeDropdownMenu:n,children:i,dir:c,open:u,defaultOpen:x,onOpenChange:h,modal:f=!0}=l,p=ca(n),g=m.useRef(null),[N,v]=Io({prop:u,defaultProp:x??!1,onChange:h,caller:ed});return e.jsx(dC,{scope:n,triggerId:Mm(),triggerRef:g,contentId:Mm(),open:N,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(y=>!y),[v]),modal:f,children:e.jsx(ew,{...p,open:N,onOpenChange:v,dir:c,modal:f,children:i})})};sN.displayName=ed;var tN="DropdownMenuTrigger",aN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,disabled:c=!1,...u}=l,x=eN(tN,i),h=ca(i);return e.jsx(sw,{asChild:!0,...h,children:e.jsx(Gn.button,{type:"button",id:x.triggerId,"aria-haspopup":"menu","aria-expanded":x.open,"aria-controls":x.open?x.contentId:void 0,"data-state":x.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:Aw(n,x.triggerRef),onPointerDown:un(l.onPointerDown,f=>{!c&&f.button===0&&f.ctrlKey===!1&&(x.onOpenToggle(),x.open||f.preventDefault())}),onKeyDown:un(l.onKeyDown,f=>{c||(["Enter"," "].includes(f.key)&&x.onOpenToggle(),f.key==="ArrowDown"&&x.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});aN.displayName=tN;var uC="DropdownMenuPortal",lN=l=>{const{__scopeDropdownMenu:n,...i}=l,c=ca(n);return e.jsx(q0,{...c,...i})};lN.displayName=uC;var nN="DropdownMenuContent",rN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=eN(nN,i),x=ca(i),h=m.useRef(!1);return e.jsx(K0,{id:u.contentId,"aria-labelledby":u.triggerId,...x,...c,ref:n,onCloseAutoFocus:un(l.onCloseAutoFocus,f=>{h.current||u.triggerRef.current?.focus(),h.current=!1,f.preventDefault()}),onInteractOutside:un(l.onInteractOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0,N=p.button===2||g;(!u.modal||N)&&(h.current=!0)}),style:{...l.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rN.displayName=nN;var mC="DropdownMenuGroup",xC=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(tw,{...u,...c,ref:n})});xC.displayName=mC;var hC="DropdownMenuLabel",iN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(Z0,{...u,...c,ref:n})});iN.displayName=hC;var fC="DropdownMenuItem",cN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(Q0,{...u,...c,ref:n})});cN.displayName=fC;var pC="DropdownMenuCheckboxItem",oN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(Y0,{...u,...c,ref:n})});oN.displayName=pC;var gC="DropdownMenuRadioGroup",jC=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(aw,{...u,...c,ref:n})});jC.displayName=gC;var vC="DropdownMenuRadioItem",dN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(X0,{...u,...c,ref:n})});dN.displayName=vC;var NC="DropdownMenuItemIndicator",uN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(J0,{...u,...c,ref:n})});uN.displayName=NC;var bC="DropdownMenuSeparator",mN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(W0,{...u,...c,ref:n})});mN.displayName=bC;var yC="DropdownMenuArrow",wC=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(lw,{...u,...c,ref:n})});wC.displayName=yC;var _C="DropdownMenuSubTrigger",xN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(G0,{...u,...c,ref:n})});xN.displayName=_C;var SC="DropdownMenuSubContent",hN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(V0,{...u,...c,ref:n,style:{...l.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hN.displayName=SC;var kC=sN,CC=aN,TC=lN,fN=rN,pN=iN,gN=cN,jN=oN,vN=dN,NN=uN,bN=mN,yN=xN,wN=hN;const EC=kC,MC=CC,AC=m.forwardRef(({className:l,inset:n,children:i,...c},u)=>e.jsxs(yN,{ref:u,className:H("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",l),...c,children:[i,e.jsx(ea,{className:"ml-auto h-4 w-4"})]}));AC.displayName=yN.displayName;const zC=m.forwardRef(({className:l,...n},i)=>e.jsx(wN,{ref:i,className:H("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",l),...n}));zC.displayName=wN.displayName;const _N=m.forwardRef(({className:l,sideOffset:n=4,...i},c)=>e.jsx(TC,{children:e.jsx(fN,{ref:c,sideOffset:n,className:H("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",l),...i})}));_N.displayName=fN.displayName;const SN=m.forwardRef(({className:l,inset:n,...i},c)=>e.jsx(gN,{ref:c,className:H("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",l),...i}));SN.displayName=gN.displayName;const DC=m.forwardRef(({className:l,children:n,checked:i,...c},u)=>e.jsxs(jN,{ref:u,className:H("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l),checked:i,...c,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(NN,{children:e.jsx(_t,{className:"h-4 w-4"})})}),n]}));DC.displayName=jN.displayName;const OC=m.forwardRef(({className:l,children:n,...i},c)=>e.jsxs(vN,{ref:c,className:H("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l),...i,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(NN,{children:e.jsx(Dj,{className:"h-2 w-2 fill-current"})})}),n]}));OC.displayName=vN.displayName;const RC=m.forwardRef(({className:l,inset:n,...i},c)=>e.jsx(pN,{ref:c,className:H("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",l),...i}));RC.displayName=pN.displayName;const LC=m.forwardRef(({className:l,...n},i)=>e.jsx(bN,{ref:i,className:H("-mx-1 my-1 h-px bg-muted",l),...n}));LC.displayName=bN.displayName;const kN=({className:l,...n})=>e.jsx("nav",{role:"navigation","aria-label":"pagination",className:H("mx-auto flex w-full justify-center",l),...n});kN.displayName="Pagination";const CN=m.forwardRef(({className:l,...n},i)=>e.jsx("ul",{ref:i,className:H("flex flex-row items-center gap-1",l),...n}));CN.displayName="PaginationContent";const To=m.forwardRef(({className:l,...n},i)=>e.jsx("li",{ref:i,className:H("",l),...n}));To.displayName="PaginationItem";const sd=({className:l,isActive:n,size:i="icon",...c})=>e.jsx("a",{"aria-current":n?"page":void 0,className:H(Pr({variant:n?"outline":"ghost",size:i}),l),...c});sd.displayName="PaginationLink";const TN=({className:l,...n})=>e.jsxs(sd,{"aria-label":"Go to previous page",size:"default",className:H("gap-1 pl-2.5",l),...n,children:[e.jsx(Fa,{className:"h-4 w-4"}),e.jsx("span",{children:"ไธŠไธ€้กต"})]});TN.displayName="PaginationPrevious";const EN=({className:l,...n})=>e.jsxs(sd,{"aria-label":"Go to next page",size:"default",className:H("gap-1 pr-2.5",l),...n,children:[e.jsx("span",{children:"ไธ‹ไธ€้กต"}),e.jsx(ea,{className:"h-4 w-4"})]});EN.displayName="PaginationNext";const Em=[{value:"created_at",label:"ๆœ€ๆ–ฐๅ‘ๅธƒ",icon:Ya},{value:"downloads",label:"ไธ‹่ฝฝๆœ€ๅคš",icon:Zt},{value:"likes",label:"ๆœ€ๅ—ๆฌข่ฟŽ",icon:zo}];function UC(){const l=ia(),[n,i]=m.useState([]),[c,u]=m.useState(!0),[x,h]=m.useState(""),[f,p]=m.useState("downloads"),[g,N]=m.useState(1),[v,y]=m.useState(1),[w,b]=m.useState(0),[D,A]=m.useState(new Set),[_,P]=m.useState(new Set),E=pv(),C=m.useCallback(async()=>{u(!0);try{const R=await K_({status:"approved",page:g,page_size:12,search:x||void 0,sort_by:f,sort_order:"desc"});i(R.packs),y(R.total_pages),b(R.total);const me=new Set;for(const ce of R.packs)await fv(ce.id,E)&&me.add(ce.id);A(me)}catch(R){console.error("ๅŠ ่ฝฝ Pack ๅˆ—่กจๅคฑ่ดฅ:",R),qt({title:"ๅŠ ่ฝฝ Pack ๅˆ—่กจๅคฑ่ดฅ",variant:"destructive"})}finally{u(!1)}},[g,x,f,E]);m.useEffect(()=>{C()},[C]);const M=R=>{R.preventDefault(),N(1),C()},G=async R=>{if(!_.has(R)){P(me=>new Set(me).add(R));try{const me=await hv(R,E);A(ce=>{const ve=new Set(ce);return me.liked?ve.add(R):ve.delete(R),ve}),i(ce=>ce.map(ve=>ve.id===R?{...ve,likes:me.likes}:ve))}catch(me){console.error("็‚น่ตžๅคฑ่ดฅ:",me),qt({title:"็‚น่ตžๅคฑ่ดฅ",variant:"destructive"})}finally{P(me=>{const ce=new Set(me);return ce.delete(R),ce})}}},O=R=>{l({to:"/config/pack-market/$packId",params:{packId:R}})},ee=Em.find(R=>R.value===f)||Em[0];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(aa,{className:"h-8 w-8",strokeWidth:2}),"้…็ฝฎๆจกๆฟๅธ‚ๅœบ"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆต่งˆๅ’Œๅบ”็”จ็คพๅŒบๅˆ†ไบซ็š„ๆจกๅž‹้…็ฝฎๆจกๆฟ๏ผŒๅฟซ้€Ÿ้…็ฝฎไฝ ็š„ MaiBot"})]}),e.jsxs(S,{variant:"outline",onClick:C,disabled:c,className:"gap-2",children:[e.jsx(ft,{className:`h-4 w-4 ${c?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]})]})}),e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4 flex-wrap",children:[e.jsx("form",{onSubmit:M,className:"flex-1 min-w-[200px] max-w-md",children:e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆจกๆฟๅ็งฐใ€ๆ่ฟฐ...",value:x,onChange:R=>h(R.target.value),className:"pl-10"})]})}),e.jsxs(EC,{children:[e.jsx(MC,{asChild:!0,children:e.jsxs(S,{variant:"outline",className:"min-w-[140px] gap-2",children:[e.jsx(d1,{className:"w-4 h-4"}),ee.label,e.jsx(Ta,{className:"w-4 h-4 ml-auto"})]})}),e.jsx(_N,{align:"end",children:Em.map(R=>e.jsxs(SN,{onClick:()=>{p(R.value),N(1)},children:[e.jsx(R.icon,{className:"w-4 h-4 mr-2"}),R.label]},R.value))})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅ…ฑๆ‰พๅˆฐ ",e.jsx("span",{className:"font-medium text-foreground",children:w})," ไธชๆจกๆฟ"]}),c?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((R,me)=>e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(_s,{className:"h-6 w-3/4"}),e.jsx(_s,{className:"h-4 w-full mt-2"})]}),e.jsx(Re,{children:e.jsx(_s,{className:"h-20 w-full"})}),e.jsx(Vo,{children:e.jsx(_s,{className:"h-9 w-full"})})]},me))}):n.length===0?e.jsx(Ce,{className:"py-12",children:e.jsxs(Re,{className:"text-center text-muted-foreground",children:[e.jsx(aa,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{className:"text-lg font-medium",children:"ๆš‚ๆ— ๆจกๆฟ"}),e.jsx("p",{className:"mt-1",children:"่ฟ˜ๆฒกๆœ‰ไบบๅˆ†ไบซ้…็ฝฎๆจกๆฟ๏ผŒๅฟซๆฅๅˆ†ไบซ็ฌฌไธ€ไธชๅง๏ผ"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(R=>e.jsx(BC,{pack:R,liked:D.has(R.id),liking:_.has(R.id),onLike:()=>G(R.id),onView:()=>O(R.id)},R.id))}),v>1&&e.jsx(kN,{children:e.jsxs(CN,{children:[e.jsx(To,{children:e.jsx(TN,{onClick:()=>N(R=>Math.max(1,R-1)),className:g===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:v},(R,me)=>me+1).filter(R=>R===1||R===v||Math.abs(R-g)<=1).map((R,me,ce)=>{const ve=me>0&&R-ce[me-1]>1;return e.jsxs(To,{children:[ve&&e.jsx("span",{className:"px-2",children:"..."}),e.jsx(sd,{onClick:()=>N(R),isActive:R===g,className:"cursor-pointer",children:R})]},R)}),e.jsx(To,{children:e.jsx(EN,{onClick:()=>N(R=>Math.min(v,R+1)),className:g===v?"pointer-events-none opacity-50":"cursor-pointer"})})]})})]})})]})}function BC({pack:l,liked:n,liking:i,onLike:c,onView:u}){const x=h=>new Date(h).toLocaleDateString("zh-CN",{year:"numeric",month:"short",day:"numeric"});return e.jsxs(Ce,{className:"flex flex-col hover:shadow-md transition-shadow",children:[e.jsxs(Pe,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(He,{className:"text-lg line-clamp-1",children:l.name}),e.jsxs(ke,{variant:"secondary",className:"text-xs",children:["v",l.version]})]}),e.jsx(As,{className:"line-clamp-2 min-h-[40px]",children:l.description})]}),e.jsxs(Re,{className:"flex-1 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Bn,{className:"w-3.5 h-3.5"}),l.author]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ya,{className:"w-3.5 h-3.5"}),x(l.created_at)]})]}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:"ๆไพ›ๅ•†ๆ•ฐ้‡",children:[e.jsx(Al,{className:"w-3.5 h-3.5"}),l.provider_count]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:"ๆจกๅž‹ๆ•ฐ้‡",children:[e.jsx(In,{className:"w-3.5 h-3.5"}),l.model_count]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:"ไปปๅŠก้…็ฝฎๆ•ฐ",children:[e.jsx(Pn,{className:"w-3.5 h-3.5"}),l.task_count]})]}),l.tags&&l.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[l.tags.slice(0,3).map(h=>e.jsxs(ke,{variant:"outline",className:"text-xs",children:[e.jsx(Go,{className:"w-2.5 h-2.5 mr-1"}),h]},h)),l.tags.length>3&&e.jsxs(ke,{variant:"outline",className:"text-xs",children:["+",l.tags.length-3]})]})]}),e.jsx(Vo,{className:"pt-3 border-t",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{className:"w-4 h-4"}),l.downloads]}),e.jsxs("button",{onClick:h=>{h.stopPropagation(),c()},disabled:i,className:`flex items-center gap-1 transition-colors ${n?"text-red-500":"hover:text-red-500"} ${i?"opacity-50":""}`,children:[e.jsx(zo,{className:`w-4 h-4 ${n?"fill-current":""}`}),l.likes]})]}),e.jsx(S,{size:"sm",onClick:u,children:"ๆŸฅ็œ‹่ฏฆๆƒ…"})]})})]})}var Xa="Accordion",$C=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[lx,IC,PC]=zw(Xa),[td]=Po(Xa,[PC,Zg]),nx=Zg(),MN=zs.forwardRef((l,n)=>{const{type:i,...c}=l,u=c,x=c;return e.jsx(lx.Provider,{scope:l.__scopeAccordion,children:i==="multiple"?e.jsx(VC,{...x,ref:n}):e.jsx(GC,{...u,ref:n})})});MN.displayName=Xa;var[AN,HC]=td(Xa),[zN,FC]=td(Xa,{collapsible:!1}),GC=zs.forwardRef((l,n)=>{const{value:i,defaultValue:c,onValueChange:u=()=>{},collapsible:x=!1,...h}=l,[f,p]=Io({prop:i,defaultProp:c??"",onChange:u,caller:Xa});return e.jsx(AN,{scope:l.__scopeAccordion,value:zs.useMemo(()=>f?[f]:[],[f]),onItemOpen:p,onItemClose:zs.useCallback(()=>x&&p(""),[x,p]),children:e.jsx(zN,{scope:l.__scopeAccordion,collapsible:x,children:e.jsx(DN,{...h,ref:n})})})}),VC=zs.forwardRef((l,n)=>{const{value:i,defaultValue:c,onValueChange:u=()=>{},...x}=l,[h,f]=Io({prop:i,defaultProp:c??[],onChange:u,caller:Xa}),p=zs.useCallback(N=>f((v=[])=>[...v,N]),[f]),g=zs.useCallback(N=>f((v=[])=>v.filter(y=>y!==N)),[f]);return e.jsx(AN,{scope:l.__scopeAccordion,value:h,onItemOpen:p,onItemClose:g,children:e.jsx(zN,{scope:l.__scopeAccordion,collapsible:!0,children:e.jsx(DN,{...x,ref:n})})})}),[qC,ad]=td(Xa),DN=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,disabled:c,dir:u,orientation:x="vertical",...h}=l,f=zs.useRef(null),p=Ho(f,n),g=IC(i),v=mj(u)==="ltr",y=un(l.onKeyDown,w=>{if(!$C.includes(w.key))return;const b=w.target,D=g().filter(ee=>!ee.ref.current?.disabled),A=D.findIndex(ee=>ee.ref.current===b),_=D.length;if(A===-1)return;w.preventDefault();let P=A;const E=0,C=_-1,M=()=>{P=A+1,P>C&&(P=E)},G=()=>{P=A-1,P{const{__scopeAccordion:i,value:c,...u}=l,x=ad($o,i),h=HC($o,i),f=nx(i),p=Mm(),g=c&&h.value.includes(c)||!1,N=x.disabled||l.disabled;return e.jsx(KC,{scope:i,open:g,disabled:N,triggerId:p,children:e.jsx(qg,{"data-orientation":x.orientation,"data-state":IN(g),...f,...u,ref:n,disabled:N,open:g,onOpenChange:v=>{v?h.onItemOpen(c):h.onItemClose(c)}})})});ON.displayName=$o;var RN="AccordionHeader",LN=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,...c}=l,u=ad(Xa,i),x=rx(RN,i);return e.jsx(Gn.h3,{"data-orientation":u.orientation,"data-state":IN(x.open),"data-disabled":x.disabled?"":void 0,...c,ref:n})});LN.displayName=RN;var Bm="AccordionTrigger",UN=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,...c}=l,u=ad(Xa,i),x=rx(Bm,i),h=FC(Bm,i),f=nx(i);return e.jsx(lx.ItemSlot,{scope:i,children:e.jsx(nw,{"aria-disabled":x.open&&!h.collapsible||void 0,"data-orientation":u.orientation,id:x.triggerId,...f,...c,ref:n})})});UN.displayName=Bm;var BN="AccordionContent",$N=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,...c}=l,u=ad(Xa,i),x=rx(BN,i),h=nx(i);return e.jsx(rw,{role:"region","aria-labelledby":x.triggerId,"data-orientation":u.orientation,...h,...c,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...l.style}})});$N.displayName=BN;function IN(l){return l?"open":"closed"}var QC=MN,YC=ON,JC=LN,PN=UN,HN=$N;const XC=QC,FN=m.forwardRef(({className:l,...n},i)=>e.jsx(YC,{ref:i,className:H("border-b",l),...n}));FN.displayName="AccordionItem";const GN=m.forwardRef(({className:l,children:n,...i},c)=>e.jsx(JC,{className:"flex",children:e.jsxs(PN,{ref:c,className:H("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",l),...i,children:[n,e.jsx(Ta,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));GN.displayName=PN.displayName;const VN=m.forwardRef(({className:l,children:n,...i},c)=>e.jsx(HN,{ref:c,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...i,children:e.jsx("div",{className:H("pb-4 pt-0",l),children:n})}));VN.displayName=HN.displayName;const ZC={utils:"้€š็”จๅทฅๅ…ท",utils_small:"่ฝป้‡ๅทฅๅ…ท",tool_use:"ๅทฅๅ…ท่ฐƒ็”จ",replyer:"ๅ›žๅค็”Ÿๆˆ",planner:"่ง„ๅˆ’ๆŽจ็†",vlm:"่ง†่ง‰ๆจกๅž‹",voice:"่ฏญ้Ÿณๅค„็†",embedding:"ๅ‘้‡ๅตŒๅ…ฅ",lpmm_entity_extract:"ๅฎžไฝ“ๆๅ–",lpmm_rdf_build:"RDFๆž„ๅปบ",lpmm_qa:"้—ฎ็ญ”ๆจกๅž‹"};function WC(){const{packId:l}=JN.useParams(),n=ia(),[i,c]=m.useState(null),[u,x]=m.useState(!0),[h,f]=m.useState(!1),[p,g]=m.useState(!1),[N,v]=m.useState(!1),[y,w]=m.useState(1),[b,D]=m.useState(null),[A,_]=m.useState(!1),[P,E]=m.useState(!1),[C,M]=m.useState({apply_providers:!0,apply_models:!0,apply_task_config:!0,task_mode:"append",selected_providers:void 0,selected_models:void 0,selected_tasks:void 0}),[G,O]=m.useState({}),[ee,R]=m.useState({}),me=pv(),ce=m.useCallback(async()=>{if(l){x(!0);try{const z=await Q_(l);c(z);const Q=await fv(l,me);f(Q)}catch(z){console.error("ๅŠ ่ฝฝ Pack ๅคฑ่ดฅ:",z),qt({title:"ๅŠ ่ฝฝๆจกๆฟๅคฑ่ดฅ",variant:"destructive"})}finally{x(!1)}}},[l,me]);m.useEffect(()=>{ce()},[ce]);const ve=async()=>{if(!(!l||p)){g(!0);try{const z=await hv(l,me);f(z.liked),i&&c({...i,likes:z.likes})}catch(z){console.error("็‚น่ตžๅคฑ่ดฅ:",z),qt({title:"็‚น่ตžๅคฑ่ดฅ",variant:"destructive"})}finally{g(!1)}}},se=async()=>{if(i){v(!0),w(1),_(!0);try{const z=await X_(i);D(z);const Q={};for(const L of z.existing_providers)Q[L.pack_provider.name]=L.local_providers[0].name;O(Q);const $={};for(const L of z.new_providers)$[L.name]="";R($)}catch(z){console.error("ๆฃ€ๆต‹ๅ†ฒ็ชๅคฑ่ดฅ:",z),qt({title:"ๆฃ€ๆต‹้…็ฝฎๅ†ฒ็ชๅคฑ่ดฅ",variant:"destructive"}),v(!1)}finally{_(!1)}}},ge=async()=>{if(i){if(C.apply_providers&&b){for(const z of b.new_providers)if(!ee[z.name]){qt({title:`่ฏทๅกซๅ†™ๆไพ›ๅ•† "${z.name}" ็š„ API Key`,variant:"destructive"});return}}E(!0);try{await Z_(i,C,G,ee),await J_(i.id,me),c({...i,downloads:i.downloads+1}),qt({title:"้…็ฝฎๆจกๆฟๅบ”็”จๆˆๅŠŸ๏ผ"}),v(!1)}catch(z){console.error("ๅบ”็”จ Pack ๅคฑ่ดฅ:",z),qt({title:z instanceof Error?z.message:"ๅบ”็”จ้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{E(!1)}}},fe=z=>new Date(z).toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric"});return u?e.jsx(s3,{}):i?e.jsx("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>n({to:"/config/pack-market"}),className:"gap-2",children:[e.jsx(ka,{className:"w-4 h-4"}),"่ฟ”ๅ›žๅธ‚ๅœบ"]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(aa,{className:"w-10 h-10 text-primary mt-1"}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[i.name,e.jsxs(ke,{variant:"secondary",children:["v",i.version]})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:i.description})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Bn,{className:"w-4 h-4"}),i.author]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ya,{className:"w-4 h-4"}),fe(i.created_at)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{className:"w-4 h-4"}),i.downloads," ๆฌกไธ‹่ฝฝ"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(zo,{className:`w-4 h-4 ${h?"fill-red-500 text-red-500":""}`}),i.likes," ่ตž"]})]}),i.tags&&i.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:i.tags.map(z=>e.jsxs(ke,{variant:"outline",children:[e.jsx(Go,{className:"w-3 h-3 mr-1"}),z]},z))})]}),e.jsxs("div",{className:"flex flex-col gap-2 min-w-[160px]",children:[e.jsxs(S,{size:"lg",onClick:se,children:[e.jsx(Zt,{className:"w-4 h-4 mr-2"}),"ๅบ”็”จๆจกๆฟ"]}),e.jsxs(S,{variant:"outline",onClick:ve,disabled:p,className:h?"text-red-500 border-red-200":"",children:[e.jsx(zo,{className:`w-4 h-4 mr-2 ${h?"fill-current":""}`}),h?"ๅทฒ็‚น่ตž":"็‚น่ตž"]})]})]}),e.jsx(Kt,{}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Ce,{children:e.jsxs(Re,{className:"flex items-center gap-3 py-4",children:[e.jsx(Al,{className:"w-8 h-8 text-blue-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:i.providers.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"API ๆไพ›ๅ•†"})]})]})}),e.jsx(Ce,{children:e.jsxs(Re,{className:"flex items-center gap-3 py-4",children:[e.jsx(In,{className:"w-8 h-8 text-green-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:i.models.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆจกๅž‹้…็ฝฎ"})]})]})}),e.jsx(Ce,{children:e.jsxs(Re,{className:"flex items-center gap-3 py-4",children:[e.jsx(Pn,{className:"w-8 h-8 text-purple-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:Object.keys(i.task_config).length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ไปปๅŠก้…็ฝฎ"})]})]})})]}),e.jsxs(ra,{defaultValue:"providers",className:"space-y-4",children:[e.jsxs(Wt,{children:[e.jsxs(ts,{value:"providers",children:[e.jsx(Al,{className:"w-4 h-4 mr-2"}),"ๆไพ›ๅ•† (",i.providers.length,")"]}),e.jsxs(ts,{value:"models",children:[e.jsx(In,{className:"w-4 h-4 mr-2"}),"ๆจกๅž‹ (",i.models.length,")"]}),e.jsxs(ts,{value:"tasks",children:[e.jsx(Pn,{className:"w-4 h-4 mr-2"}),"ไปปๅŠก้…็ฝฎ (",Object.keys(i.task_config).length,")"]})]}),e.jsx(bs,{value:"providers",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"API ๆไพ›ๅ•†"}),e.jsx(As,{children:"ๆจกๆฟไธญๅŒ…ๅซ็š„ API ๆไพ›ๅ•†้…็ฝฎ๏ผˆไธๅซ API Key๏ผ‰"})]}),e.jsx(Re,{children:e.jsxs(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"Base URL"}),e.jsx(Ze,{children:"็ฑปๅž‹"})]})}),e.jsx(Ol,{children:i.providers.map(z=>e.jsxs(ot,{children:[e.jsx(Ke,{className:"font-medium",children:z.name}),e.jsx(Ke,{className:"text-muted-foreground font-mono text-sm",children:z.base_url}),e.jsx(Ke,{children:e.jsx(ke,{variant:"outline",children:z.client_type})})]},z.name))})]})})]})}),e.jsx(bs,{value:"models",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆจกๅž‹้…็ฝฎ"}),e.jsx(As,{children:"ๆจกๆฟไธญๅŒ…ๅซ็š„ๆจกๅž‹้…็ฝฎ"})]}),e.jsx(Re,{children:e.jsxs(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{children:"ๆจกๅž‹ๅ็งฐ"}),e.jsx(Ze,{children:"ๆ ‡่ฏ†็ฌฆ"}),e.jsx(Ze,{children:"ๆไพ›ๅ•†"}),e.jsx(Ze,{className:"text-right",children:"ไปทๆ ผ (ๅ…ฅ/ๅ‡บ)"})]})}),e.jsx(Ol,{children:i.models.map(z=>e.jsxs(ot,{children:[e.jsx(Ke,{className:"font-medium",children:z.name}),e.jsx(Ke,{className:"text-muted-foreground font-mono text-sm",children:z.model_identifier}),e.jsx(Ke,{children:z.api_provider}),e.jsxs(Ke,{className:"text-right text-muted-foreground",children:["ยฅ",z.price_in," / ยฅ",z.price_out]})]},z.name))})]})})]})}),e.jsx(bs,{value:"tasks",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ไปปๅŠก้…็ฝฎ"}),e.jsx(As,{children:"ๆจกๆฟไธญๅ„ไปปๅŠก็ฑปๅž‹็š„ๆจกๅž‹ๅˆ†้…"})]}),e.jsx(Re,{children:e.jsx(XC,{type:"multiple",className:"w-full",children:Object.entries(i.task_config).map(([z,Q])=>e.jsxs(FN,{value:z,children:[e.jsx(GN,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mn,{className:"w-4 h-4"}),ZC[z]||z,e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[Q.model_list.length," ไธชๆจกๅž‹"]})]})}),e.jsx(VN,{children:e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"ๅˆ†้…็š„ๆจกๅž‹๏ผš"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Q.model_list.map($=>e.jsx(ke,{variant:"outline",children:$},$))}),Q.temperature!==void 0&&e.jsxs("div",{className:"text-sm",children:["Temperature: ",e.jsx("span",{className:"font-mono",children:Q.temperature})]}),Q.max_tokens!==void 0&&e.jsxs("div",{className:"text-sm",children:["Max Tokens: ",e.jsx("span",{className:"font-mono",children:Q.max_tokens})]})]})})]},z))})})]})})]}),e.jsx(e3,{open:N,onOpenChange:v,pack:i,step:y,setStep:w,conflicts:b,detectingConflicts:A,applying:P,options:C,setOptions:M,_providerMapping:G,_setProviderMapping:O,newProviderApiKeys:ee,setNewProviderApiKeys:R,onApply:ge})]})})}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(aa,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("h2",{className:"text-xl font-semibold",children:"ๆจกๆฟไธๅญ˜ๅœจ"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"่ฏฅ้…็ฝฎๆจกๆฟๅฏ่ƒฝๅทฒ่ขซๅˆ ้™คๆˆ–ๅฐšๆœช้€š่ฟ‡ๅฎกๆ ธ"}),e.jsxs(S,{className:"mt-4",onClick:()=>n({to:"/config/pack-market"}),children:[e.jsx(ka,{className:"w-4 h-4 mr-2"}),"่ฟ”ๅ›žๅธ‚ๅœบ"]})]})}function e3({open:l,onOpenChange:n,pack:i,step:c,setStep:u,conflicts:x,detectingConflicts:h,applying:f,options:p,setOptions:g,_providerMapping:N,_setProviderMapping:v,newProviderApiKeys:y,setNewProviderApiKeys:w,onApply:b}){return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(aa,{className:"w-5 h-5"}),"ๅบ”็”จ้…็ฝฎๆจกๆฟ"]}),e.jsxs(Ys,{children:["ๆญฅ้ชค ",c," / ",3,"๏ผš",c===1&&"้€‰ๆ‹ฉ่ฆๅบ”็”จ็š„ๅ†…ๅฎน",c===2&&"้…็ฝฎๆไพ›ๅ•†ๆ˜ ๅฐ„",c===3&&"็กฎ่ฎคๅนถๅบ”็”จ"]})]}),h?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx(Ls,{className:"w-8 h-8 mx-auto animate-spin text-primary"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"ๆญฃๅœจๆฃ€ๆต‹้…็ฝฎๅ†ฒ็ช..."})]}):e.jsxs(e.Fragment,{children:[c===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"apply_providers",checked:p.apply_providers,onCheckedChange:A=>g({...p,apply_providers:A})}),e.jsxs(T,{htmlFor:"apply_providers",className:"flex items-center gap-2",children:[e.jsx(Al,{className:"w-4 h-4"}),"ๅบ”็”จๆไพ›ๅ•†้…็ฝฎ (",i.providers.length," ไธช)"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"apply_models",checked:p.apply_models,onCheckedChange:A=>g({...p,apply_models:A})}),e.jsxs(T,{htmlFor:"apply_models",className:"flex items-center gap-2",children:[e.jsx(In,{className:"w-4 h-4"}),"ๅบ”็”จๆจกๅž‹้…็ฝฎ (",i.models.length," ไธช)"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"apply_task_config",checked:p.apply_task_config,onCheckedChange:A=>g({...p,apply_task_config:A})}),e.jsxs(T,{htmlFor:"apply_task_config",className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"w-4 h-4"}),"ๅบ”็”จไปปๅŠก้…็ฝฎ (",Object.keys(i.task_config).length," ไธช)"]})]})]}),p.apply_task_config&&e.jsxs("div",{className:"pl-6 space-y-2 border-l-2 border-muted",children:[e.jsx(T,{className:"text-sm font-medium",children:"ไปปๅŠก้…็ฝฎๅบ”็”จๆจกๅผ"}),e.jsxs(ax,{value:p.task_mode,onValueChange:A=>g({...p,task_mode:A}),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Bo,{value:"append",id:"mode_append"}),e.jsx(T,{htmlFor:"mode_append",className:"font-normal",children:"่ฟฝๅŠ ๆจกๅผ - ๅฐ†ๆจกๆฟไธญ็š„ๆจกๅž‹ๆทปๅŠ ๅˆฐ็Žฐๆœ‰้…็ฝฎ"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Bo,{value:"replace",id:"mode_replace"}),e.jsx(T,{htmlFor:"mode_replace",className:"font-normal",children:"ๆ›ฟๆขๆจกๅผ - ็”จๆจกๆฟ้…็ฝฎๅฎŒๅ…จๆ›ฟๆข็Žฐๆœ‰้…็ฝฎ"})]})]})]})]}),c===2&&x&&e.jsxs("div",{className:"space-y-4",children:[p.apply_providers&&x.existing_providers.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๅ‘็Žฐๅทฒๆœ‰็š„ๆไพ›ๅ•†"}),e.jsx(ct,{children:"ไปฅไธ‹ๆไพ›ๅ•†็š„ URL ไธŽๆ‚จๆœฌๅœฐ้…็ฝฎไธญ็š„ๆไพ›ๅ•†ๅŒน้…๏ผŒๅฐ†่‡ชๅŠจไฝฟ็”จๆœฌๅœฐๆไพ›ๅ•†๏ผš"})]}),e.jsx("div",{className:"space-y-2",children:x.existing_providers.map(({pack_provider:A,local_providers:_})=>e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),e.jsx("span",{className:"font-medium flex-shrink-0",children:A.name}),e.jsx(ea,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),_.length===1?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:_[0].name}),e.jsx(ke,{variant:"outline",className:"ml-auto",children:"URL ๅŒน้…"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{value:N[A.name]||_[0].name,onValueChange:P=>v({...N,[A.name]:P}),children:[e.jsx(Le,{className:"w-[200px]",children:e.jsx($e,{})}),e.jsx(Ue,{children:_.map(P=>e.jsx(W,{value:P.name,children:P.name},P.name))})]}),e.jsxs(ke,{variant:"outline",className:"ml-auto",children:[_.length," ไธชๅŒน้…"]})]})]},A.name))})]}),p.apply_providers&&x.new_providers.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(it,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsx(Un,{children:"้œ€่ฆ้…็ฝฎ API Key"}),e.jsx(ct,{children:"ไปฅไธ‹ๆไพ›ๅ•†ๅœจๆ‚จ็š„ๆœฌๅœฐ้…็ฝฎไธญไธๅญ˜ๅœจ๏ผŒ้œ€่ฆๅกซๅ†™ API Key๏ผš"})]}),e.jsx("div",{className:"space-y-4",children:x.new_providers.map(A=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pm,{className:"w-4 h-4 text-amber-500"}),e.jsx("span",{className:"font-medium",children:A.name}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",A.base_url,")"]})]}),e.jsx(ne,{type:"password",placeholder:`่พ“ๅ…ฅ ${A.name} ็š„ API Key`,value:y[A.name]||"",onChange:_=>w({...y,[A.name]:_.target.value})})]},A.name))})]}),(!p.apply_providers||x.existing_providers.length===0&&x.new_providers.length===0)&&e.jsxs(it,{children:[e.jsx(_t,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๆ— ้œ€้…็ฝฎ"}),e.jsx(ct,{children:"ๆจกๆฟไธญๆฒกๆœ‰ๆไพ›ๅ•†้…็ฝฎ๏ผŒๆˆ–ๆ‚จ้€‰ๆ‹ฉไธๅบ”็”จๆไพ›ๅ•†ใ€‚"})]})]}),c===3&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(it,{children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(Un,{children:"็กฎ่ฎคๅบ”็”จ"}),e.jsx(ct,{children:"่ฏท็กฎ่ฎคไปฅไธ‹ๅฐ†่ฆๅบ”็”จ็š„ๅ†…ๅฎน๏ผš"})]}),e.jsxs("div",{className:"space-y-2",children:[p.apply_providers&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500"}),e.jsx(Al,{className:"w-4 h-4"}),e.jsxs("span",{children:["ๅบ”็”จ ",i.providers.length," ไธชๆไพ›ๅ•†้…็ฝฎ"]})]}),p.apply_models&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500"}),e.jsx(In,{className:"w-4 h-4"}),e.jsxs("span",{children:["ๅบ”็”จ ",i.models.length," ไธชๆจกๅž‹้…็ฝฎ"]})]}),p.apply_task_config&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500"}),e.jsx(Pn,{className:"w-4 h-4"}),e.jsxs("span",{children:[p.task_mode==="append"?"่ฟฝๅŠ ":"ๆ›ฟๆข"," ",Object.keys(i.task_config).length," ไธชไปปๅŠก้…็ฝฎ"]})]})]}),x&&x.new_providers.length>0&&e.jsxs(it,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsxs(ct,{children:["ๅฐ†ๆทปๅŠ  ",x.new_providers.length," ไธชๆ–ฐๆไพ›ๅ•†๏ผŒ่ฏท็กฎไฟๅทฒๅกซๅ†™ๆญฃ็กฎ็š„ API Keyใ€‚"]})]})]})]}),e.jsxs(et,{className:"flex justify-between",children:[e.jsx("div",{children:c>1&&!h&&e.jsx(S,{variant:"outline",onClick:()=>u(c-1),disabled:f,children:"ไธŠไธ€ๆญฅ"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),disabled:f,children:"ๅ–ๆถˆ"}),c<3?e.jsx(S,{onClick:()=>u(c+1),disabled:h,children:"ไธ‹ไธ€ๆญฅ"}):e.jsxs(S,{onClick:b,disabled:f,children:[f&&e.jsx(Ls,{className:"w-4 h-4 mr-2 animate-spin"}),"ๅบ”็”จๆจกๆฟ"]})]})]})]})})}function s3(){return e.jsx("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(_s,{className:"h-9 w-24"}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_s,{className:"w-10 h-10"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(_s,{className:"h-8 w-2/3"}),e.jsx(_s,{className:"h-4 w-full"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(_s,{className:"h-4 w-24"}),e.jsx(_s,{className:"h-4 w-32"}),e.jsx(_s,{className:"h-4 w-28"}),e.jsx(_s,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(_s,{className:"h-6 w-20"}),e.jsx(_s,{className:"h-6 w-24"}),e.jsx(_s,{className:"h-6 w-16"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 min-w-[160px]",children:[e.jsx(_s,{className:"h-10 w-full"}),e.jsx(_s,{className:"h-10 w-full"})]})]}),e.jsx(_s,{className:"h-px w-full"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_s,{className:"h-24"}),e.jsx(_s,{className:"h-24"}),e.jsx(_s,{className:"h-24"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(_s,{className:"h-10 w-32"}),e.jsx(_s,{className:"h-10 w-32"}),e.jsx(_s,{className:"h-10 w-32"})]}),e.jsx(_s,{className:"h-96 w-full"})]})]})})})}function t3(){const l=ia(),[n,i]=m.useState(!0);return m.useEffect(()=>{let c=!1;return(async()=>{try{const x=await Qi();!c&&!x&&l({to:"/auth"})}catch{c||l({to:"/auth"})}finally{c||i(!1)}})(),()=>{c=!0}},[l]),{checking:n}}async function a3(){return await Qi()}const l3=Hr("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"}}),qN=m.forwardRef(({className:l,size:n,abbrTitle:i,children:c,...u},x)=>e.jsx("kbd",{className:H(l3({size:n,className:l})),ref:x,...u,children:i?e.jsx("abbr",{title:i,children:c}):c}));qN.displayName="Kbd";const n3=[{icon:Fo,title:"้ฆ–้กต",description:"ๆŸฅ็œ‹ไปช่กจๆฟๆฆ‚่งˆ",path:"/",category:"ๆฆ‚่งˆ"},{icon:Sa,title:"้บฆ้บฆไธป็จ‹ๅบ้…็ฝฎ",description:"้…็ฝฎ้บฆ้บฆ็š„ๆ ธๅฟƒ่ฎพ็ฝฎ",path:"/config/bot",category:"้…็ฝฎ"},{icon:Al,title:"้บฆ้บฆๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ",description:"้…็ฝฎๆจกๅž‹ๆไพ›ๅ•†",path:"/config/modelProvider",category:"้…็ฝฎ"},{icon:Rj,title:"้บฆ้บฆๆจกๅž‹้…็ฝฎ",description:"้…็ฝฎๆจกๅž‹ๅ‚ๆ•ฐ",path:"/config/model",category:"้…็ฝฎ"},{icon:Hm,title:"่กจๆƒ…ๅŒ…็ฎก็†",description:"็ฎก็†้บฆ้บฆ็š„่กจๆƒ…ๅŒ…",path:"/resource/emoji",category:"่ต„ๆบ"},{icon:Pa,title:"่กจ่พพๆ–นๅผ็ฎก็†",description:"็ฎก็†้บฆ้บฆ็š„่กจ่พพๆ–นๅผ",path:"/resource/expression",category:"่ต„ๆบ"},{icon:Lj,title:"ไบบ็‰ฉไฟกๆฏ็ฎก็†",description:"็ฎก็†ไบบ็‰ฉไฟกๆฏ",path:"/resource/person",category:"่ต„ๆบ"},{icon:Ir,title:"้ป‘่ฏ็ฎก็†",description:"็ฎก็†้บฆ้บฆๅญฆไน ๅˆฐ็š„้ป‘่ฏๅ’Œไฟš่ฏญ",path:"/resource/jargon",category:"่ต„ๆบ"},{icon:u1,title:"็ปŸ่ฎกไฟกๆฏ",description:"ๆŸฅ็œ‹ไฝฟ็”จ็ปŸ่ฎก",path:"/statistics",category:"็›‘ๆŽง"},{icon:aa,title:"ๆ’ไปถๅธ‚ๅœบ",description:"ๆต่งˆๅ’Œๅฎ‰่ฃ…ๆ’ไปถ",path:"/plugins",category:"ๆ‰ฉๅฑ•"},{icon:Fm,title:"ๆ—ฅๅฟ—ๆŸฅ็œ‹ๅ™จ",description:"ๆŸฅ็œ‹็ณป็ปŸๆ—ฅๅฟ—",path:"/logs",category:"็›‘ๆŽง"},{icon:mn,title:"็ณป็ปŸ่ฎพ็ฝฎ",description:"้…็ฝฎ็ณป็ปŸๅ‚ๆ•ฐ",path:"/settings",category:"็ณป็ปŸ"}];function r3({open:l,onOpenChange:n}){const[i,c]=m.useState(""),[u,x]=m.useState(0),h=ia(),f=n3.filter(N=>N.title.toLowerCase().includes(i.toLowerCase())||N.description.toLowerCase().includes(i.toLowerCase())||N.category.toLowerCase().includes(i.toLowerCase())),p=m.useCallback(N=>{h({to:N}),n(!1),c(""),x(0)},[h,n]),g=m.useCallback(N=>{N.key==="ArrowDown"?(N.preventDefault(),x(v=>(v+1)%f.length)):N.key==="ArrowUp"?(N.preventDefault(),x(v=>(v-1+f.length)%f.length)):N.key==="Enter"&&f[u]&&(N.preventDefault(),p(f[u].path))},[f,u,p]);return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl p-0 gap-0",children:[e.jsxs(Bs,{className:"px-4 pt-4 pb-0",children:[e.jsx($s,{className:"sr-only",children:"ๆœ็ดข"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(ne,{value:i,onChange:N=>{c(N.target.value),x(0)},onKeyDown:g,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(Je,{className:"h-[400px]",children:f.length>0?e.jsx("div",{className:"p-2",children:f.map((N,v)=>{const y=N.icon;return e.jsxs("button",{onClick:()=>p(N.path),onMouseEnter:()=>x(v),className:H("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",v===u?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[e.jsx(y,{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:N.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:N.description})]}),e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:N.category})]},N.path)})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Ot,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i?"ๆœชๆ‰พๅˆฐๅŒน้…็š„้กต้ข":"่พ“ๅ…ฅๅ…ณ้”ฎ่ฏๅผ€ๅง‹ๆœ็ดข"})]})})}),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"}),"ๅ…ณ้—ญ"]})]})})]})})}function i3(){const l=window.location.protocol==="http:",n=window.location.hostname.toLowerCase(),i=n==="localhost"||n==="127.0.0.1"||n==="::1",c=sessionStorage.getItem("http-warning-dismissed")==="true",[u,x]=m.useState(l&&!i&&!c),[h,f]=m.useState(!1),p=()=>{f(!0),x(!1),sessionStorage.setItem("http-warning-dismissed","true")};return!u||h?null:e.jsx("div",{className:"relative bg-amber-500/10 border-b border-amber-500/20 backdrop-blur-sm",children:e.jsx("div",{className:"container mx-auto px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx(Qt,{className:"h-5 w-5 text-amber-600 dark:text-amber-500 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-100",children:[e.jsx("span",{className:"font-semibold",children:"ๅฎ‰ๅ…จ่ญฆๅ‘Š๏ผš"}),"ๆ‚จๆญฃๅœจไฝฟ็”จ ",e.jsx("strong",{children:"HTTP"})," ่ฎฟ้—ฎ MaiBot WebUI"]}),e.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-200 mt-1",children:"ๅฆ‚ๆžœ่ฟ™ๆ˜ฏๅ…ฌ็ฝ‘ๆœๅŠกๅ™จ๏ผŒๆ‚จ็š„ๆ•ฐๆฎ๏ผˆๅŒ…ๆ‹ฌ Tokenใ€่Šๅคฉ่ฎฐๅฝ•็ญ‰๏ผ‰ๅฏ่ƒฝๅœจไผ ่พ“่ฟ‡็จ‹ไธญ่ขซ็ชƒๅ–ใ€‚ๅผบ็ƒˆๅปบ่ฎฎไฝฟ็”จ HTTPS ่ฎฟ้—ฎๆˆ–ไป…ๅœจๆœฌๅœฐ็ฝ‘็ปœไฝฟ็”จใ€‚"})]})]}),e.jsx(S,{variant:"ghost",size:"icon",onClick:p,className:"h-8 w-8 text-amber-700 hover:text-amber-900 dark:text-amber-400 dark:hover:text-amber-200 flex-shrink-0","aria-label":"ๅ…ณ้—ญ่ญฆๅ‘Š",children:e.jsx(Ca,{className:"h-4 w-4"})})]})})})}function c3(){const[l,n]=m.useState(0),[i,c]=m.useState(!1),u=m.useRef(null);m.useEffect(()=>{const g=N=>{const v=N.target;if(v.scrollHeight>v.clientHeight+100){u.current=v;const y=v.scrollTop,w=v.scrollHeight-v.clientHeight,b=w>0?y/w*100:0;n(b),c(y>300)}};return window.addEventListener("scroll",g,{capture:!0,passive:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})},[]);const x=()=>{u.current?.scrollTo({top:0,behavior:"smooth"})},h=18,f=2*Math.PI*h,p=f-l/100*f;return e.jsx("div",{className:H("fixed bottom-24 right-8 z-50 transition-all duration-500 ease-in-out transform",i?"translate-x-0 opacity-100":"translate-x-32 opacity-0 pointer-events-none"),children:e.jsxs(S,{variant:"outline",size:"icon",className:H("relative h-12 w-12 rounded-full shadow-xl","bg-background/80 backdrop-blur-md border-border/50","hover:bg-accent hover:scale-110 hover:shadow-2xl hover:border-primary/50","transition-all duration-300","group"),onClick:x,"aria-label":"ๅ›žๅˆฐ้กถ้ƒจ",children:[e.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90 transform p-1",viewBox:"0 0 44 44",children:[e.jsx("circle",{className:"text-muted-foreground/10",strokeWidth:"3",stroke:"currentColor",fill:"transparent",r:h,cx:"22",cy:"22"}),e.jsx("circle",{className:"text-primary transition-all duration-100 ease-out",strokeWidth:"3",strokeDasharray:f,strokeDashoffset:p,strokeLinecap:"round",stroke:"currentColor",fill:"transparent",r:h,cx:"22",cy:"22"})]}),e.jsx(m1,{className:"h-5 w-5 text-primary transition-transform duration-300 group-hover:-translate-y-1 group-hover:scale-110",strokeWidth:2.5}),e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})})}const o3=Ow,d3=Rw,u3=Lw,KN=m.forwardRef(({className:l,sideOffset:n=4,...i},c)=>e.jsx(Dw,{children:e.jsx(xj,{ref:c,sideOffset:n,className:H("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]",l),...i})}));KN.displayName=xj.displayName;function m3({children:l}){const{checking:n}=t3(),[i,c]=m.useState(!0),[u,x]=m.useState(!1),[h,f]=m.useState(!1),{theme:p,setTheme:g}=Vm(),N=h0();if(m.useEffect(()=>{const D=A=>{(A.metaKey||A.ctrlKey)&&A.key==="k"&&(A.preventDefault(),f(!0))};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[]),n)return e.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:e.jsx("div",{className:"text-muted-foreground",children:"ๆญฃๅœจ้ชŒ่ฏ็™ปๅฝ•็Šถๆ€..."})});const v=[{title:"ๆฆ‚่งˆ",items:[{icon:Fo,label:"้ฆ–้กต",path:"/"}]},{title:"้บฆ้บฆ้…็ฝฎ็ผ–่พ‘",items:[{icon:Sa,label:"้บฆ้บฆไธป็จ‹ๅบ้…็ฝฎ",path:"/config/bot"},{icon:Al,label:"AIๆจกๅž‹ๅŽ‚ๅ•†้…็ฝฎ",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:Rj,label:"ๆจกๅž‹็ฎก็†ไธŽๅˆ†้…",path:"/config/model",tourId:"sidebar-model-management"},{icon:sg,label:"้บฆ้บฆ้€‚้…ๅ™จ้…็ฝฎ",path:"/config/adapter"}]},{title:"้บฆ้บฆ่ต„ๆบ็ฎก็†",items:[{icon:Hm,label:"่กจๆƒ…ๅŒ…็ฎก็†",path:"/resource/emoji"},{icon:Pa,label:"่กจ่พพๆ–นๅผ็ฎก็†",path:"/resource/expression"},{icon:Ir,label:"้ป‘่ฏ็ฎก็†",path:"/resource/jargon"},{icon:Lj,label:"ไบบ็‰ฉไฟกๆฏ็ฎก็†",path:"/resource/person"},{icon:Ej,label:"็Ÿฅ่ฏ†ๅบ“ๅ›พ่ฐฑๅฏ่ง†ๅŒ–",path:"/resource/knowledge-graph"},{icon:Br,label:"้บฆ้บฆ็Ÿฅ่ฏ†ๅบ“็ฎก็†",path:"/resource/knowledge-base"}]},{title:"ๆ‰ฉๅฑ•ไธŽ็›‘ๆŽง",items:[{icon:aa,label:"ๆ’ไปถๅธ‚ๅœบ",path:"/plugins"},{icon:zj,label:"้…็ฝฎๆจกๆฟๅธ‚ๅœบ",path:"/config/pack-market"},{icon:sg,label:"ๆ’ไปถ้…็ฝฎ",path:"/plugin-config"},{icon:Fm,label:"ๆ—ฅๅฟ—ๆŸฅ็œ‹ๅ™จ",path:"/logs"},{icon:$m,label:"่ฎกๅˆ’ๅ™จ&ๅ›žๅคๅ™จ็›‘ๆŽง",path:"/planner-monitor"},{icon:Pa,label:"ๆœฌๅœฐ่Šๅคฉๅฎค",path:"/chat"}]},{title:"็ณป็ปŸ",items:[{icon:mn,label:"็ณป็ปŸ่ฎพ็ฝฎ",path:"/settings"}]}],w=p==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":p,b=async()=>{await K1()};return e.jsx(o3,{delayDuration:300,children:e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsxs("aside",{className:H("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",i?"lg:w-64":"lg:w-16",u?"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:H("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!i&&"lg:flex-none lg:w-8"),children:[e.jsxs("div",{className:H("flex items-baseline gap-2",!i&&"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:g2()})]}),!i&&e.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),e.jsx(Je,{className:H("flex-1 overflow-x-hidden",!i&&"lg:w-16"),children:e.jsx("nav",{className:H("p-4",!i&&"lg:p-2 lg:w-16"),children:e.jsx("ul",{className:H("space-y-6",!i&&"lg:space-y-3 lg:w-full"),children:v.map((D,A)=>e.jsxs("li",{children:[e.jsx("div",{className:H("px-3 h-[1.25rem]","mb-2",!i&&"lg:mb-1 lg:invisible"),children:e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:D.title})}),!i&&A>0&&e.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),e.jsx("ul",{className:"space-y-1",children:D.items.map(_=>{const P=N({to:_.path}),E=_.icon,C=e.jsxs(e.Fragment,{children:[P&&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:H("flex items-center transition-all duration-300",i?"gap-3":"gap-3 lg:gap-0"),children:[e.jsx(E,{className:H("h-5 w-5 flex-shrink-0",P&&"text-primary"),strokeWidth:2,fill:"none"}),e.jsx("span",{className:H("text-sm font-medium whitespace-nowrap transition-all duration-300",P&&"font-semibold",i?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:_.label})]})]});return e.jsx("li",{className:"relative",children:e.jsxs(d3,{children:[e.jsx(u3,{asChild:!0,children:e.jsx(Dr,{to:_.path,"data-tour":_.tourId,className:H("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",P?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",i?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>x(!1),children:C})}),!i&&e.jsx(KN,{side:"right",className:"hidden lg:block",children:e.jsx("p",{children:_.label})})]})},_.path)})})]},D.title))})})})]}),u&&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.jsx(i3,{}),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(!u),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:e.jsx(x1,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>c(!i),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:i?"ๆ”ถ่ตทไพง่พนๆ ":"ๅฑ•ๅผ€ไพง่พนๆ ",children:e.jsx(Fa,{className:H("h-5 w-5 transition-transform",!i&&"rotate-180")})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>f(!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(Ot,{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(qN,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[e.jsx("span",{className:"text-xs",children:"โŒ˜"}),"K"]})]}),e.jsx(r3,{open:h,onOpenChange:f}),e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"ๆŸฅ็œ‹้บฆ้บฆๆ–‡ๆกฃ",children:[e.jsx(h1,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"้บฆ้บฆๆ–‡ๆกฃ"})]}),e.jsx("button",{onClick:D=>{c2(w==="dark"?"light":"dark",g,D)},className:"rounded-lg p-2 hover:bg-accent",title:w==="dark"?"ๅˆ‡ๆขๅˆฐๆต…่‰ฒๆจกๅผ":"ๅˆ‡ๆขๅˆฐๆทฑ่‰ฒๆจกๅผ",children:w==="dark"?e.jsx(bj,{className:"h-5 w-5"}):e.jsx(yj,{className:"h-5 w-5"})}),e.jsx("div",{className:"h-6 w-px bg-border"}),e.jsxs(S,{variant:"ghost",size:"sm",onClick:b,className:"gap-2",title:"็™ปๅ‡บ็ณป็ปŸ",children:[e.jsx(f1,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"็™ปๅ‡บ"})]})]})]}),e.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:l}),e.jsx(c3,{})]})]})})}function x3(l){const n=l.split(` + `,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:ee.previewUrl,alt:ee.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:ee.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee.emotion||"ๆœชๅกซๅ†™ๆƒ…ๆ„Ÿๆ ‡็ญพ"})]}),R?e.jsx(Wt,{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"})]},ee.id)})})}),e.jsx("div",{className:"border rounded-lg p-4",children:A?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:A.previewUrl,alt:A.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:A.name}),b(A)&&e.jsxs(ke,{variant:"outline",className:"text-green-600 border-green-600",children:[e.jsx(_t,{className:"h-3 w-3 mr-1"}),"ๅทฒๅฎŒๆˆ"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"multi-emotion",children:["ๆƒ…ๆ„Ÿๆ ‡็ญพ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"multi-emotion",value:A.emotion,onChange:ee=>w(A.id,{emotion:ee.target.value}),placeholder:"ๅคšไธชๆ ‡็ญพ็”จ้€—ๅทๅˆ†้š”๏ผŒๅฆ‚๏ผšๅผ€ๅฟƒ,้ซ˜ๅ…ด",className:A.emotion.trim()?"":"border-destructive"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"multi-description",children:"ๆ่ฟฐ"}),e.jsx(ne,{id:"multi-description",value:A.description,onChange:ee=>w(A.id,{description:ee.target.value}),placeholder:"่พ“ๅ…ฅ่กจๆƒ…ๅŒ…ๆ่ฟฐ..."})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"multi-is-registered",checked:A.isRegistered,onCheckedChange:ee=>w(A.id,{isRegistered:ee===!0})}),e.jsx(T,{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(Ej,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"็‚นๅ‡ปๅทฆไพงๅก็‰‡็ผ–่พ‘"})]})})})]}),e.jsx(et,{children:e.jsx(S,{onClick:H,disabled:!D||g,children:g?"ไธŠไผ ไธญ...":`ไธŠไผ ๅ…จ้ƒจ (${O})`})})]})};return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-3xl max-h-[90vh] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Qi,{className:"h-5 w-5"}),c==="select"&&"ไธŠไผ ่กจๆƒ…ๅŒ… - ้€‰ๆ‹ฉๆ–‡ไปถ",c==="edit-single"&&"ไธŠไผ ่กจๆƒ…ๅŒ… - ๅกซๅ†™ไฟกๆฏ",c==="edit-multiple"&&"ไธŠไผ ่กจๆƒ…ๅŒ… - ๆ‰น้‡็ผ–่พ‘"]}),e.jsxs(Ys,{children:[c==="select"&&"ๆ”ฏๆŒ JPGใ€PNGใ€GIFใ€WebP ๆ ผๅผ๏ผŒๅ•ไธชๆ–‡ไปถๆœ€ๅคง 10MB๏ผŒๅฏๅŒๆ—ถไธŠไผ ๅคšไธชๆ–‡ไปถ",c==="edit-single"&&"่ฏทๅกซๅ†™่กจๆƒ…ๅŒ…็š„ๆƒ…ๆ„Ÿๆ ‡็ญพ๏ผˆๅฟ…ๅกซ๏ผ‰ๅ’Œๆ่ฟฐ",c==="edit-multiple"&&"็‚นๅ‡ปๅทฆไพงๅก็‰‡็ผ–่พ‘ๆฏไธช่กจๆƒ…ๅŒ…็š„ไฟกๆฏ๏ผŒๆƒ…ๆ„Ÿๆ ‡็ญพไธบๅฟ…ๅกซ้กน"]})]}),e.jsxs("div",{className:"overflow-y-auto pr-1",children:[c==="select"&&E(),c==="edit-single"&&C(),c==="edit-multiple"&&M()]})]})})}const gn="/api/webui/expression";async function yv(){const l=await we(`${gn}/chats`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–่Šๅคฉๅˆ—่กจๅคฑ่ดฅ")}return l.json()}async function c4(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.chat_id&&n.append("chat_id",l.chat_id);const i=await we(`${gn}/list?${n}`,{});if(!i.ok){const c=await i.json();throw new Error(c.detail||"่Žทๅ–่กจ่พพๆ–นๅผๅˆ—่กจๅคฑ่ดฅ")}return i.json()}async function o4(l){const n=await we(`${gn}/${l}`,{});if(!n.ok){const i=await n.json();throw new Error(i.detail||"่Žทๅ–่กจ่พพๆ–นๅผ่ฏฆๆƒ…ๅคฑ่ดฅ")}return n.json()}async function d4(l){const n=await we(`${gn}/`,{method:"POST",body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ›ๅปบ่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return n.json()}async function u4(l,n){const i=await we(`${gn}/${l}`,{method:"PATCH",body:JSON.stringify(n)});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ๆ›ดๆ–ฐ่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return i.json()}async function m4(l){const n=await we(`${gn}/${l}`,{method:"DELETE"});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ ้™ค่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return n.json()}async function x4(l){const n=await we(`${gn}/batch/delete`,{method:"POST",body:JSON.stringify({ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™ค่กจ่พพๆ–นๅผๅคฑ่ดฅ")}return n.json()}async function h4(){const l=await we(`${gn}/stats/summary`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ")}return l.json()}function f4(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(0),[h,f]=m.useState(1),[p,g]=m.useState(20),[N,v]=m.useState(""),[y,w]=m.useState(null),[b,D]=m.useState(!1),[A,_]=m.useState(!1),[H,E]=m.useState(!1),[C,M]=m.useState(null),[G,O]=m.useState(new Set),[ee,R]=m.useState(!1),[me,ce]=m.useState(""),[ve,se]=m.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[ge,fe]=m.useState([]),[z,Q]=m.useState(new Map),{toast:I}=st(),L=async()=>{try{c(!0);const oe=await c4({page:h,page_size:p,search:N||void 0});n(oe.data),x(oe.total)}catch(oe){I({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๅŠ ่ฝฝ่กจ่พพๆ–นๅผ",variant:"destructive"})}finally{c(!1)}},$=async()=>{try{const oe=await h4();oe?.data&&se(oe.data)}catch(oe){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",oe)}},_e=async()=>{try{const oe=await yv();if(oe?.data){fe(oe.data);const Ge=new Map;oe.data.forEach(Y=>{Ge.set(Y.chat_id,Y.chat_name)}),Q(Ge)}}catch(oe){console.error("ๅŠ ่ฝฝ่Šๅคฉๅˆ—่กจๅคฑ่ดฅ:",oe)}},je=oe=>z.get(oe)||oe;m.useEffect(()=>{L(),$(),_e()},[h,p,N]);const Se=async oe=>{try{const Ge=await o4(oe.id);w(Ge.data),D(!0)}catch(Ge){I({title:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ",description:Ge instanceof Error?Ge.message:"ๆ— ๆณ•ๅŠ ่ฝฝ่กจ่พพๆ–นๅผ่ฏฆๆƒ…",variant:"destructive"})}},K=oe=>{w(oe),_(!0)},U=async oe=>{try{await m4(oe.id),I({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค่กจ่พพๆ–นๅผ: ${oe.situation}`}),M(null),L(),$()}catch(Ge){I({title:"ๅˆ ้™คๅคฑ่ดฅ",description:Ge instanceof Error?Ge.message:"ๆ— ๆณ•ๅˆ ้™ค่กจ่พพๆ–นๅผ",variant:"destructive"})}},V=oe=>{const Ge=new Set(G);Ge.has(oe)?Ge.delete(oe):Ge.add(oe),O(Ge)},xe=()=>{G.size===l.length&&l.length>0?O(new Set):O(new Set(l.map(oe=>oe.id)))},Ae=async()=>{try{await x4(Array.from(G)),I({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${G.size} ไธช่กจ่พพๆ–นๅผ`}),O(new Set),R(!1),L(),$()}catch(oe){I({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๆ‰น้‡ๅˆ ้™ค่กจ่พพๆ–นๅผ",variant:"destructive"})}},X=()=>{const oe=parseInt(me),Ge=Math.ceil(u/p);oe>=1&&oe<=Ge?(f(oe),ce("")):I({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${Ge}ไน‹้—ด็š„้กต็ `,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(Pa,{className:"h-8 w-8",strokeWidth:2}),"่กจ่พพๆ–นๅผ็ฎก็†"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"็ฎก็†้บฆ้บฆ็š„่กจ่พพๆ–นๅผๅ’Œ่ฏๆœฏๆจกๆฟ"})]}),e.jsxs(S,{onClick:()=>E(!0),className:"gap-2",children:[e.jsx(Zs,{className:"h-4 w-4"}),"ๆ–ฐๅขž่กจ่พพๆ–นๅผ"]})]})}),e.jsx(Je,{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:ve.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:ve.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:ve.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx(T,{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(Ot,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{id:"search",placeholder:"ๆœ็ดขๆƒ…ๅขƒใ€้ฃŽๆ ผๆˆ–ไธŠไธ‹ๆ–‡...",value:N,onChange:oe=>v(oe.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:G.size>0&&e.jsxs("span",{children:["ๅทฒ้€‰ๆ‹ฉ ",G.size," ไธช่กจ่พพๆ–นๅผ"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:p.toString(),onValueChange:oe=>{g(parseInt(oe)),f(1),O(new Set)},children:[e.jsx(Le,{id:"page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]}),G.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>O(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:()=>R(!0),children:[e.jsx(ns,{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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:G.size===l.length&&l.length>0,onCheckedChange:xe})}),e.jsx(Ze,{children:"ๆƒ…ๅขƒ"}),e.jsx(Ze,{children:"้ฃŽๆ ผ"}),e.jsx(Ze,{children:"่Šๅคฉ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i?e.jsx(ot,{children:e.jsx(Ke,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."})}):l.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"})}):l.map(oe=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:G.has(oe.id),onCheckedChange:()=>V(oe.id)})}),e.jsx(Ke,{className:"font-medium max-w-xs truncate",children:oe.situation}),e.jsx(Ke,{className:"max-w-xs truncate",children:oe.style}),e.jsx(Ke,{className:"max-w-[200px] truncate",title:je(oe.chat_id),style:{wordBreak:"keep-all"},children:e.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:je(oe.chat_id)})}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>K(oe),children:[e.jsx(Hn,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>Se(oe),title:"ๆŸฅ็œ‹่ฏฆๆƒ…",children:e.jsx(na,{className:"h-4 w-4"})}),e.jsxs(S,{size:"sm",onClick:()=>M(oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅˆ ้™ค"]})]})})]},oe.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:i?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."}):l.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):l.map(oe=>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(Ws,{checked:G.has(oe.id),onCheckedChange:()=>V(oe.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:oe.situation,children:oe.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:oe.style,children:oe.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:je(oe.chat_id),style:{wordBreak:"keep-all"},children:je(oe.chat_id)})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>K(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Hn,{className:"h-3 w-3 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>Se(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:e.jsx(na,{className:"h-3 w-3"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>M(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"ๅˆ ้™ค"]})]})]},oe.id))}),u>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:["ๅ…ฑ ",u," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",h," / ",Math.ceil(u/p)," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h-1),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:me,onChange:oe=>ce(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&X(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/p)}),e.jsx(S,{variant:"outline",size:"sm",onClick:X,disabled:!me,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h+1),disabled:h>=Math.ceil(u/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(u/p)),disabled:h>=Math.ceil(u/p),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(p4,{expression:y,open:b,onOpenChange:D,chatNameMap:z}),e.jsx(g4,{open:H,onOpenChange:E,chatList:ge,onSuccess:()=>{L(),$(),E(!1)}}),e.jsx(j4,{expression:y,open:A,onOpenChange:_,chatList:ge,onSuccess:()=>{L(),$(),_(!1)}}),e.jsx(js,{open:!!C,onOpenChange:()=>M(null),children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™ค่กจ่พพๆ–นๅผ "',C?.situation,'" ๅ—๏ผŸ ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>C&&U(C),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๅˆ ้™ค"})]})]})}),e.jsx(v4,{open:ee,onOpenChange:R,onConfirm:Ae,count:G.size})]})}function p4({expression:l,open:n,onOpenChange:i,chatNameMap:c}){if(!l)return null;const u=h=>h?new Date(h*1e3).toLocaleString("zh-CN"):"-",x=h=>c.get(h)||h;return e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(Ui,{label:"ๆƒ…ๅขƒ",value:l.situation}),e.jsx(Ui,{label:"้ฃŽๆ ผ",value:l.style}),e.jsx(Ui,{label:"่Šๅคฉ",value:x(l.chat_id)}),e.jsx(Ui,{icon:Ir,label:"่ฎฐๅฝ•ID",value:l.id.toString(),mono:!0})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsx(Ui,{icon:Ya,label:"ๅˆ›ๅปบๆ—ถ้—ด",value:u(l.create_date)})}),e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-4",children:[e.jsx(T,{className:"text-xs text-muted-foreground mb-3 block",children:"็Šถๆ€ๆ ‡่ฎฐ"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:P("flex h-8 w-8 items-center justify-center rounded-full",l.checked?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-400 dark:bg-gray-800 dark:text-gray-600"),children:l.checked?e.jsx(Wt,{className:"h-5 w-5"}):e.jsx(Ao,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"ๅทฒๆฃ€ๆŸฅ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l.checked?"ๅทฒ้€š่ฟ‡AIๆฃ€ๆŸฅ":"ๆœชๆฃ€ๆŸฅ"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:P("flex h-8 w-8 items-center justify-center rounded-full",l.rejected?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":"bg-gray-100 text-gray-400 dark:bg-gray-800 dark:text-gray-600"),children:l.rejected?e.jsx(Ki,{className:"h-5 w-5"}):e.jsx(Ao,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"ๅทฒๆ‹’็ป"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l.rejected?"ๅทฒๆ‹’็ป":"ๆญฃๅธธ"})]})]})]})]})]}),e.jsx(et,{children:e.jsx(S,{onClick:()=>i(!1),children:"ๅ…ณ้—ญ"})})]})})}function Ui({icon:l,label:n,value:i,mono:c=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l&&e.jsx(l,{className:"h-3 w-3"}),n]}),e.jsx("div",{className:P("text-sm",c&&"font-mono",!i&&"text-muted-foreground"),children:i||"-"})]})}function g4({open:l,onOpenChange:n,chatList:i,onSuccess:c}){const[u,x]=m.useState({situation:"",style:"",chat_id:""}),[h,f]=m.useState(!1),{toast:p}=st(),g=async()=>{if(!u.situation||!u.style||!u.chat_id){p({title:"้ชŒ่ฏๅคฑ่ดฅ",description:"่ฏทๅกซๅ†™ๅฟ…ๅกซๅญ—ๆฎต๏ผšๆƒ…ๅขƒใ€้ฃŽๆ ผๅ’Œ่Šๅคฉ",variant:"destructive"});return}try{f(!0),await d4(u),p({title:"ๅˆ›ๅปบๆˆๅŠŸ",description:"่กจ่พพๆ–นๅผๅทฒๅˆ›ๅปบ"}),x({situation:"",style:"",chat_id:""}),c()}catch(N){p({title:"ๅˆ›ๅปบๅคฑ่ดฅ",description:N instanceof Error?N.message:"ๆ— ๆณ•ๅˆ›ๅปบ่กจ่พพๆ–นๅผ",variant:"destructive"})}finally{f(!1)}};return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{htmlFor:"situation",children:["ๆƒ…ๅขƒ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"situation",value:u.situation,onChange:N=>x({...u,situation:N.target.value}),placeholder:"ๆ่ฟฐไฝฟ็”จๅœบๆ™ฏ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"style",children:["้ฃŽๆ ผ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"style",value:u.style,onChange:N=>x({...u,style:N.target.value}),placeholder:"ๆ่ฟฐ่กจ่พพ้ฃŽๆ ผ"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"chat_id",children:["่Šๅคฉ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Be,{value:u.chat_id,onValueChange:N=>x({...u,chat_id:N}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:i.map(N=>e.jsx(W,{value:N.chat_id,children:e.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[N.chat_name,N.is_group&&e.jsx("span",{className:"text-muted-foreground ml-1",children:"(็พค่Š)"})]})},N.chat_id))})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:g,disabled:h,children:h?"ๅˆ›ๅปบไธญ...":"ๅˆ›ๅปบ"})]})]})})}function j4({expression:l,open:n,onOpenChange:i,chatList:c,onSuccess:u}){const[x,h]=m.useState({}),[f,p]=m.useState(!1),{toast:g}=st();m.useEffect(()=>{l&&h({situation:l.situation,style:l.style,chat_id:l.chat_id,checked:l.checked,rejected:l.rejected})},[l]);const N=async()=>{if(l)try{p(!0),await u4(l.id,x),g({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"่กจ่พพๆ–นๅผๅทฒๆ›ดๆ–ฐ"}),u()}catch(v){g({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:v instanceof Error?v.message:"ๆ— ๆณ•ๆ›ดๆ–ฐ่กจ่พพๆ–นๅผ",variant:"destructive"})}finally{p(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{htmlFor:"edit_situation",children:"ๆƒ…ๅขƒ"}),e.jsx(ne,{id:"edit_situation",value:x.situation||"",onChange:v=>h({...x,situation:v.target.value}),placeholder:"ๆ่ฟฐไฝฟ็”จๅœบๆ™ฏ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_style",children:"้ฃŽๆ ผ"}),e.jsx(ne,{id:"edit_style",value:x.style||"",onChange:v=>h({...x,style:v.target.value}),placeholder:"ๆ่ฟฐ่กจ่พพ้ฃŽๆ ผ"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_chat_id",children:"่Šๅคฉ"}),e.jsxs(Be,{value:x.chat_id||"",onValueChange:v=>h({...x,chat_id:v}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:c.map(v=>e.jsx(W,{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(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(nt,{className:"text-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{children:e.jsx("strong",{children:"็Šถๆ€ๆ ‡่ฎฐ่ฏดๆ˜Ž๏ผš"})}),e.jsx("p",{children:"โ€ข ๅทฒๆฃ€ๆŸฅ๏ผš่กจ็คบ่ฏฅ่กจ่พพๆ–นๅผๅทฒ้€š่ฟ‡AI่‡ชๅŠจๆฃ€ๆŸฅ"}),e.jsx("p",{children:"โ€ข ๅทฒๆ‹’็ป๏ผš่กจ็คบ่ฏฅ่กจ่พพๆ–นๅผ่ขซๆ ‡่ฎฐไธบไธๅˆ้€‚"}),e.jsxs("p",{className:"text-muted-foreground mt-2",children:['ๆ นๆฎ้…็ฝฎไธญ็š„"ไป…ไฝฟ็”จๅทฒๆฃ€ๆŸฅ็š„่กจ่พพๆ–นๅผ"่ฎพ็ฝฎ๏ผš',e.jsx("br",{}),'โ€ข ๅผ€ๅฏๆ—ถ๏ผšๅชไฝฟ็”จ"ๅทฒๆฃ€ๆŸฅ=ๆ˜ฏ"ไธ”"ๅทฒๆ‹’็ป=ๅฆ"็š„่กจ่พพๆ–นๅผ',e.jsx("br",{}),'โ€ข ๅ…ณ้—ญๆ—ถ๏ผšไฝฟ็”จๆ‰€ๆœ‰"ๅทฒๆ‹’็ป=ๅฆ"็š„่กจ่พพๆ–นๅผ๏ผˆไธ็œ‹ๅทฒๆฃ€ๆŸฅ็Šถๆ€๏ผ‰']})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between space-x-2 rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(T,{htmlFor:"edit_checked",className:"text-sm font-medium",children:"ๅทฒๆฃ€ๆŸฅ"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้€š่ฟ‡AI่‡ชๅŠจๆฃ€ๆŸฅ"})]}),e.jsx(Fe,{id:"edit_checked",checked:x.checked??!1,onCheckedChange:v=>h({...x,checked:v})})]}),e.jsxs("div",{className:"flex items-center justify-between space-x-2 rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(T,{htmlFor:"edit_rejected",className:"text-sm font-medium",children:"ๅทฒๆ‹’็ป"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"ๆ ‡่ฎฐไธบๅทฒๆ‹’็ป"})]}),e.jsx(Fe,{id:"edit_rejected",checked:x.rejected??!1,onCheckedChange:v=>h({...x,rejected:v})})]})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:N,disabled:f,children:f?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}function v4({open:l,onOpenChange:n,onConfirm:i,count:c}){return e.jsx(js,{open:l,onOpenChange:n,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["ๆ‚จๅณๅฐ†ๅˆ ้™ค ",c," ไธช่กจ่พพๆ–นๅผ๏ผŒๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎคๅˆ ้™ค"})]})]})})}const Rl="/api/webui/jargon";async function N4(){const l=await we(`${Rl}/chats`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–่Šๅคฉๅˆ—่กจๅคฑ่ดฅ")}return l.json()}async function b4(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.chat_id&&n.append("chat_id",l.chat_id),l.is_jargon!==void 0&&l.is_jargon!==null&&n.append("is_jargon",l.is_jargon.toString()),l.is_global!==void 0&&n.append("is_global",l.is_global.toString());const i=await we(`${Rl}/list?${n}`,{});if(!i.ok){const c=await i.json();throw new Error(c.detail||"่Žทๅ–้ป‘่ฏๅˆ—่กจๅคฑ่ดฅ")}return i.json()}async function y4(l){const n=await we(`${Rl}/${l}`,{});if(!n.ok){const i=await n.json();throw new Error(i.detail||"่Žทๅ–้ป‘่ฏ่ฏฆๆƒ…ๅคฑ่ดฅ")}return n.json()}async function w4(l){const n=await we(`${Rl}/`,{method:"POST",body:JSON.stringify(l)});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ›ๅปบ้ป‘่ฏๅคฑ่ดฅ")}return n.json()}async function _4(l,n){const i=await we(`${Rl}/${l}`,{method:"PATCH",body:JSON.stringify(n)});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ๆ›ดๆ–ฐ้ป‘่ฏๅคฑ่ดฅ")}return i.json()}async function S4(l){const n=await we(`${Rl}/${l}`,{method:"DELETE"});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ ้™ค้ป‘่ฏๅคฑ่ดฅ")}return n.json()}async function k4(l){const n=await we(`${Rl}/batch/delete`,{method:"POST",body:JSON.stringify({ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™ค้ป‘่ฏๅคฑ่ดฅ")}return n.json()}async function C4(){const l=await we(`${Rl}/stats/summary`,{});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–้ป‘่ฏ็ปŸ่ฎกๅคฑ่ดฅ")}return l.json()}async function T4(l,n){const i=new URLSearchParams;l.forEach(u=>i.append("ids",u.toString())),i.append("is_jargon",n.toString());const c=await we(`${Rl}/batch/set-jargon?${i}`,{method:"POST"});if(!c.ok){const u=await c.json();throw new Error(u.detail||"ๆ‰น้‡่ฎพ็ฝฎ้ป‘่ฏ็Šถๆ€ๅคฑ่ดฅ")}return c.json()}function E4(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(0),[h,f]=m.useState(1),[p,g]=m.useState(20),[N,v]=m.useState(""),[y,w]=m.useState("all"),[b,D]=m.useState("all"),[A,_]=m.useState(null),[H,E]=m.useState(!1),[C,M]=m.useState(!1),[G,O]=m.useState(!1),[ee,R]=m.useState(null),[me,ce]=m.useState(new Set),[ve,se]=m.useState(!1),[ge,fe]=m.useState(""),[z,Q]=m.useState({total:0,confirmed_jargon:0,confirmed_not_jargon:0,pending:0,global_count:0,complete_count:0,chat_count:0,top_chats:{}}),[I,L]=m.useState([]),{toast:$}=st(),_e=async()=>{try{c(!0);const te=await b4({page:h,page_size:p,search:N||void 0,chat_id:y==="all"?void 0:y,is_jargon:b==="all"?void 0:b==="true"?!0:b==="false"?!1:void 0});n(te.data),x(te.total)}catch(te){$({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆ— ๆณ•ๅŠ ่ฝฝ้ป‘่ฏๅˆ—่กจ",variant:"destructive"})}finally{c(!1)}},je=async()=>{try{const te=await C4();te?.data&&Q(te.data)}catch(te){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",te)}},Se=async()=>{try{const te=await N4();te?.data&&L(te.data)}catch(te){console.error("ๅŠ ่ฝฝ่Šๅคฉๅˆ—่กจๅคฑ่ดฅ:",te)}};m.useEffect(()=>{_e(),je(),Se()},[h,p,N,y,b]);const K=async te=>{try{const Oe=await y4(te.id);_(Oe.data),E(!0)}catch(Oe){$({title:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ",description:Oe instanceof Error?Oe.message:"ๆ— ๆณ•ๅŠ ่ฝฝ้ป‘่ฏ่ฏฆๆƒ…",variant:"destructive"})}},U=te=>{_(te),M(!0)},V=async te=>{try{await S4(te.id),$({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค้ป‘่ฏ: ${te.content}`}),R(null),_e(),je()}catch(Oe){$({title:"ๅˆ ้™คๅคฑ่ดฅ",description:Oe instanceof Error?Oe.message:"ๆ— ๆณ•ๅˆ ้™ค้ป‘่ฏ",variant:"destructive"})}},xe=te=>{const Oe=new Set(me);Oe.has(te)?Oe.delete(te):Oe.add(te),ce(Oe)},Ae=()=>{me.size===l.length&&l.length>0?ce(new Set):ce(new Set(l.map(te=>te.id)))},X=async()=>{try{await k4(Array.from(me)),$({title:"ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™ค ${me.size} ไธช้ป‘่ฏ`}),ce(new Set),se(!1),_e(),je()}catch(te){$({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆ— ๆณ•ๆ‰น้‡ๅˆ ้™ค้ป‘่ฏ",variant:"destructive"})}},oe=async te=>{try{await T4(Array.from(me),te),$({title:"ๆ“ไฝœๆˆๅŠŸ",description:`ๅทฒๅฐ† ${me.size} ไธช่ฏๆก่ฎพไธบ${te?"้ป‘่ฏ":"้ž้ป‘่ฏ"}`}),ce(new Set),_e(),je()}catch(Oe){$({title:"ๆ“ไฝœๅคฑ่ดฅ",description:Oe instanceof Error?Oe.message:"ๆ‰น้‡่ฎพ็ฝฎๅคฑ่ดฅ",variant:"destructive"})}},Ge=()=>{const te=parseInt(ge),Oe=Math.ceil(u/p);te>=1&&te<=Oe?(f(te),fe("")):$({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${Oe}ไน‹้—ด็š„้กต็ `,variant:"destructive"})},Y=te=>te===!0?e.jsxs(ke,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:[e.jsx(_t,{className:"h-3 w-3 mr-1"}),"ๆ˜ฏ้ป‘่ฏ"]}):te===!1?e.jsxs(ke,{variant:"secondary",children:[e.jsx(Ca,{className:"h-3 w-3 mr-1"}),"้ž้ป‘่ฏ"]}):e.jsxs(ke,{variant:"outline",children:[e.jsx(_j,{className:"h-3 w-3 mr-1"}),"ๆœชๅˆคๅฎš"]});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(Xw,{className:"h-8 w-8",strokeWidth:2}),"้ป‘่ฏ็ฎก็†"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"็ฎก็†้บฆ้บฆๅญฆไน ๅˆฐ็š„้ป‘่ฏๅ’Œไฟš่ฏญ"})]}),e.jsxs(S,{onClick:()=>O(!0),className:"gap-2",children:[e.jsx(Zs,{className:"h-4 w-4"}),"ๆ–ฐๅขž้ป‘่ฏ"]})]})}),e.jsx(Je,{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-2 sm:grid-cols-4 lg:grid-cols-7 gap-3",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๆ€ปๆ•ฐ้‡"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1",children:z.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅทฒ็กฎ่ฎค้ป‘่ฏ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-green-600",children:z.confirmed_jargon})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"็กฎ่ฎค้ž้ป‘่ฏ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-gray-500",children:z.confirmed_not_jargon})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅพ…ๅˆคๅฎš"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-yellow-600",children:z.pending})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅ…จๅฑ€้ป‘่ฏ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-blue-600",children:z.global_count})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๆŽจๆ–ญๅฎŒๆˆ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1 text-purple-600",children:z.complete_count})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:[e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"ๅ…ณ่”่Šๅคฉๆ•ฐ"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold mt-1",children:z.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{htmlFor:"search",children:"ๆœ็ดข"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{id:"search",placeholder:"ๆœ็ดขๅ†…ๅฎนใ€ๅซไน‰...",value:N,onChange:te=>v(te.target.value),className:"pl-9"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{children:"่Šๅคฉ็ญ›้€‰"}),e.jsxs(Be,{value:y,onValueChange:w,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"ๅ…จ้ƒจ่Šๅคฉ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ่Šๅคฉ"}),I.map(te=>e.jsx(W,{value:te.chat_id,children:te.chat_name},te.chat_id))]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{children:"็Šถๆ€็ญ›้€‰"}),e.jsxs(Be,{value:b,onValueChange:D,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"ๅ…จ้ƒจ็Šถๆ€"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ็Šถๆ€"}),e.jsx(W,{value:"true",children:"ๆ˜ฏ้ป‘่ฏ"}),e.jsx(W,{value:"false",children:"้ž้ป‘่ฏ"})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{htmlFor:"page-size",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:p.toString(),onValueChange:te=>{g(parseInt(te)),f(1),ce(new Set)},children:[e.jsx(Le,{id:"page-size",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]})]})]}),me.size>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-4 pt-4 border-t",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["ๅทฒ้€‰ๆ‹ฉ ",me.size," ไธช"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>oe(!0),children:[e.jsx(_t,{className:"h-4 w-4 mr-1"}),"ๆ ‡่ฎฐไธบ้ป‘่ฏ"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>oe(!1),children:[e.jsx(Ca,{className:"h-4 w-4 mr-1"}),"ๆ ‡่ฎฐไธบ้ž้ป‘่ฏ"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>ce(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:()=>se(!0),children:[e.jsx(ns,{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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:me.size===l.length&&l.length>0,onCheckedChange:Ae})}),e.jsx(Ze,{children:"ๅ†…ๅฎน"}),e.jsx(Ze,{children:"ๅซไน‰"}),e.jsx(Ze,{children:"่Šๅคฉ"}),e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{className:"text-center",children:"ๆฌกๆ•ฐ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i?e.jsx(ot,{children:e.jsx(Ke,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."})}):l.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"})}):l.map(te=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:me.has(te.id),onCheckedChange:()=>xe(te.id)})}),e.jsx(Ke,{className:"font-medium max-w-[200px]",children:e.jsxs("div",{className:"flex items-center gap-2",children:[te.is_global&&e.jsx("span",{title:"ๅ…จๅฑ€้ป‘่ฏ",children:e.jsx(zo,{className:"h-4 w-4 text-blue-500 flex-shrink-0"})}),e.jsx("span",{className:"truncate",title:te.content,children:te.content})]})}),e.jsx(Ke,{className:"max-w-[200px] truncate",title:te.meaning||"",children:te.meaning||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Ke,{className:"max-w-[150px] truncate",title:te.chat_name||te.chat_id,children:te.chat_name||te.chat_id}),e.jsx(Ke,{children:Y(te.is_jargon)}),e.jsx(Ke,{className:"text-center",children:te.count}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>U(te),children:[e.jsx(Hn,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>K(te),title:"ๆŸฅ็œ‹่ฏฆๆƒ…",children:e.jsx(na,{className:"h-4 w-4"})}),e.jsxs(S,{size:"sm",onClick:()=>R(te),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅˆ ้™ค"]})]})})]},te.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:i?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."}):l.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):l.map(te=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ws,{checked:me.has(te.id),onCheckedChange:()=>xe(te.id),className:"mt-1"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[te.is_global&&e.jsx(zo,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),e.jsx("h3",{className:"font-semibold text-sm break-all",children:te.content})]}),te.meaning&&e.jsx("p",{className:"text-sm text-muted-foreground break-all",children:te.meaning}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[Y(te.is_jargon),e.jsxs("span",{className:"text-muted-foreground",children:["ๆฌกๆ•ฐ: ",te.count]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:["่Šๅคฉ: ",te.chat_name||te.chat_id]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>U(te),className:"text-xs px-2 py-1 h-auto",children:[e.jsx(Hn,{className:"h-3 w-3 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>K(te),className:"text-xs px-2 py-1 h-auto",children:e.jsx(na,{className:"h-3 w-3"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>R(te),className:"text-xs px-2 py-1 h-auto text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"ๅˆ ้™ค"]})]})]},te.id))}),u>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:["ๅ…ฑ ",u," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",h," / ",Math.ceil(u/p)," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h-1),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:ge,onChange:te=>fe(te.target.value),onKeyDown:te=>te.key==="Enter"&&Ge(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/p)}),e.jsx(S,{variant:"outline",size:"sm",onClick:Ge,disabled:!ge,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h+1),disabled:h>=Math.ceil(u/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(u/p)),disabled:h>=Math.ceil(u/p),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(M4,{jargon:A,open:H,onOpenChange:E}),e.jsx(A4,{open:G,onOpenChange:O,chatList:I,onSuccess:()=>{_e(),je(),O(!1)}}),e.jsx(z4,{jargon:A,open:C,onOpenChange:M,chatList:I,onSuccess:()=>{_e(),je(),M(!1)}}),e.jsx(js,{open:!!ee,onOpenChange:()=>R(null),children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™ค้ป‘่ฏ "',ee?.content,'" ๅ—๏ผŸๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>ee&&V(ee),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:ve,onOpenChange:se,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["ๆ‚จๅณๅฐ†ๅˆ ้™ค ",me.size," ไธช้ป‘่ฏ๏ผŒๆญคๆ“ไฝœๆ— ๆณ•ๆ’ค้”€ใ€‚็กฎๅฎš่ฆ็ปง็ปญๅ—๏ผŸ"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"็กฎ่ฎคๅˆ ้™ค"})]})]})})]})}function M4({jargon:l,open:n,onOpenChange:i}){return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] grid grid-rows-[auto_1fr_auto] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"้ป‘่ฏ่ฏฆๆƒ…"}),e.jsx(Ys,{children:"ๆŸฅ็œ‹้ป‘่ฏ็š„ๅฎŒๆ•ดไฟกๆฏ"})]}),e.jsx(Je,{className:"h-full pr-4",children:e.jsxs("div",{className:"space-y-4 pb-2",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Em,{icon:Ir,label:"่ฎฐๅฝ•ID",value:l.id.toString(),mono:!0}),e.jsx(Em,{label:"ไฝฟ็”จๆฌกๆ•ฐ",value:l.count.toString()})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅ†…ๅฎน"}),e.jsx("div",{className:"text-sm p-2 bg-muted rounded break-all whitespace-pre-wrap",children:l.content})]}),l.raw_content&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅŽŸๅง‹ๅ†…ๅฎน"}),e.jsx("div",{className:"text-sm p-2 bg-muted rounded break-all",children:(()=>{try{const c=JSON.parse(l.raw_content);return Array.isArray(c)?c.map((u,x)=>e.jsxs("div",{children:[x>0&&e.jsx("hr",{className:"my-3 border-border"}),e.jsx("div",{className:"whitespace-pre-wrap",children:u})]},x)):e.jsx("div",{className:"whitespace-pre-wrap",children:l.raw_content})}catch{return e.jsx("div",{className:"whitespace-pre-wrap",children:l.raw_content})}})()})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅซไน‰"}),e.jsx("div",{className:"text-sm p-2 bg-muted rounded break-all",children:l.meaning?e.jsx(Qm,{content:l.meaning}):"-"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Em,{label:"่Šๅคฉ",value:l.chat_name||l.chat_id}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"็Šถๆ€"}),e.jsxs("div",{className:"flex items-center gap-2",children:[l.is_jargon===!0&&e.jsx(ke,{variant:"default",className:"bg-green-600",children:"ๆ˜ฏ้ป‘่ฏ"}),l.is_jargon===!1&&e.jsx(ke,{variant:"secondary",children:"้ž้ป‘่ฏ"}),l.is_jargon===null&&e.jsx(ke,{variant:"outline",children:"ๆœชๅˆคๅฎš"}),l.is_global&&e.jsx(ke,{variant:"outline",className:"border-blue-500 text-blue-500",children:"ๅ…จๅฑ€"}),l.is_complete&&e.jsx(ke,{variant:"outline",className:"border-purple-500 text-purple-500",children:"ๆŽจๆ–ญๅฎŒๆˆ"})]})]})]}),l.inference_with_context&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ไธŠไธ‹ๆ–‡ๆŽจๆ–ญ็ป“ๆžœ"}),e.jsx("div",{className:"p-2 bg-muted rounded break-all whitespace-pre-wrap font-mono text-xs max-h-[200px] overflow-y-auto",children:l.inference_with_context})]}),l.inference_content_only&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"็บฏ่ฏๆกๆŽจๆ–ญ็ป“ๆžœ"}),e.jsx("div",{className:"p-2 bg-muted rounded break-all whitespace-pre-wrap font-mono text-xs max-h-[200px] overflow-y-auto",children:l.inference_content_only})]})]})}),e.jsx(et,{className:"flex-shrink-0",children:e.jsx(S,{onClick:()=>i(!1),children:"ๅ…ณ้—ญ"})})]})}):null}function Em({icon:l,label:n,value:i,mono:c=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l&&e.jsx(l,{className:"h-3 w-3"}),n]}),e.jsx("div",{className:P("text-sm",c&&"font-mono",!i&&"text-muted-foreground"),children:i||"-"})]})}function A4({open:l,onOpenChange:n,chatList:i,onSuccess:c}){const[u,x]=m.useState({content:"",meaning:"",chat_id:"",is_global:!1}),[h,f]=m.useState(!1),{toast:p}=st(),g=async()=>{if(!u.content||!u.chat_id){p({title:"้ชŒ่ฏๅคฑ่ดฅ",description:"่ฏทๅกซๅ†™ๅฟ…ๅกซๅญ—ๆฎต๏ผšๅ†…ๅฎนๅ’Œ่Šๅคฉ",variant:"destructive"});return}try{f(!0),await w4(u),p({title:"ๅˆ›ๅปบๆˆๅŠŸ",description:"้ป‘่ฏๅทฒๅˆ›ๅปบ"}),x({content:"",meaning:"",chat_id:"",is_global:!1}),c()}catch(N){p({title:"ๅˆ›ๅปบๅคฑ่ดฅ",description:N instanceof Error?N.message:"ๆ— ๆณ•ๅˆ›ๅปบ้ป‘่ฏ",variant:"destructive"})}finally{f(!1)}};return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ๆ–ฐๅขž้ป‘่ฏ"}),e.jsx(Ys,{children:"ๅˆ›ๅปบๆ–ฐ็š„้ป‘่ฏ่ฎฐๅฝ•"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"content",children:["ๅ†…ๅฎน ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"content",value:u.content,onChange:N=>x({...u,content:N.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅ†…ๅฎน"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"meaning",children:"ๅซไน‰"}),e.jsx(at,{id:"meaning",value:u.meaning||"",onChange:N=>x({...u,meaning:N.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅซไน‰๏ผˆๅฏ้€‰๏ผ‰",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"chat_id",children:["่Šๅคฉ ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Be,{value:u.chat_id,onValueChange:N=>x({...u,chat_id:N}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:i.map(N=>e.jsx(W,{value:N.chat_id,children:N.chat_name},N.chat_id))})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"is_global",checked:u.is_global,onCheckedChange:N=>x({...u,is_global:N})}),e.jsx(T,{htmlFor:"is_global",children:"่ฎพไธบๅ…จๅฑ€้ป‘่ฏ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:g,disabled:h,children:h?"ๅˆ›ๅปบไธญ...":"ๅˆ›ๅปบ"})]})]})})}function z4({jargon:l,open:n,onOpenChange:i,chatList:c,onSuccess:u}){const[x,h]=m.useState({}),[f,p]=m.useState(!1),{toast:g}=st();m.useEffect(()=>{l&&h({content:l.content,meaning:l.meaning||"",chat_id:l.stream_id||l.chat_id,is_global:l.is_global,is_jargon:l.is_jargon})},[l]);const N=async()=>{if(l)try{p(!0),await _4(l.id,x),g({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"้ป‘่ฏๅทฒๆ›ดๆ–ฐ"}),u()}catch(v){g({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:v instanceof Error?v.message:"ๆ— ๆณ•ๆ›ดๆ–ฐ้ป‘่ฏ",variant:"destructive"})}finally{p(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘้ป‘่ฏ"}),e.jsx(Ys,{children:"ไฟฎๆ”น้ป‘่ฏ็š„ไฟกๆฏ"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_content",children:"ๅ†…ๅฎน"}),e.jsx(ne,{id:"edit_content",value:x.content||"",onChange:v=>h({...x,content:v.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅ†…ๅฎน"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_meaning",children:"ๅซไน‰"}),e.jsx(at,{id:"edit_meaning",value:x.meaning||"",onChange:v=>h({...x,meaning:v.target.value}),placeholder:"่พ“ๅ…ฅ้ป‘่ฏๅซไน‰",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit_chat_id",children:"่Šๅคฉ"}),e.jsxs(Be,{value:x.chat_id||"",onValueChange:v=>h({...x,chat_id:v}),children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅ…ณ่”็š„่Šๅคฉ"})}),e.jsx(Ue,{children:c.map(v=>e.jsx(W,{value:v.chat_id,children:v.chat_name},v.chat_id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"้ป‘่ฏ็Šถๆ€"}),e.jsxs(Be,{value:x.is_jargon===null?"null":x.is_jargon?.toString()||"null",onValueChange:v=>h({...x,is_jargon:v==="null"?null:v==="true"}),children:[e.jsx(Le,{children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"null",children:"ๆœชๅˆคๅฎš"}),e.jsx(W,{value:"true",children:"ๆ˜ฏ้ป‘่ฏ"}),e.jsx(W,{value:"false",children:"้ž้ป‘่ฏ"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Fe,{id:"edit_is_global",checked:x.is_global,onCheckedChange:v=>h({...x,is_global:v})}),e.jsx(T,{htmlFor:"edit_is_global",children:"ๅ…จๅฑ€้ป‘่ฏ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:N,disabled:f,children:f?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}const Gr="/api/webui/person";async function D4(l){const n=new URLSearchParams;l.page&&n.append("page",l.page.toString()),l.page_size&&n.append("page_size",l.page_size.toString()),l.search&&n.append("search",l.search),l.is_known!==void 0&&n.append("is_known",l.is_known.toString()),l.platform&&n.append("platform",l.platform);const i=await we(`${Gr}/list?${n}`,{headers:Fs()});if(!i.ok){const c=await i.json();throw new Error(c.detail||"่Žทๅ–ไบบ็‰ฉๅˆ—่กจๅคฑ่ดฅ")}return i.json()}async function O4(l){const n=await we(`${Gr}/${l}`,{headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"่Žทๅ–ไบบ็‰ฉ่ฏฆๆƒ…ๅคฑ่ดฅ")}return n.json()}async function R4(l,n){const i=await we(`${Gr}/${l}`,{method:"PATCH",headers:Fs(),body:JSON.stringify(n)});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ๆ›ดๆ–ฐไบบ็‰ฉไฟกๆฏๅคฑ่ดฅ")}return i.json()}async function L4(l){const n=await we(`${Gr}/${l}`,{method:"DELETE",headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ ้™คไบบ็‰ฉไฟกๆฏๅคฑ่ดฅ")}return n.json()}async function U4(){const l=await we(`${Gr}/stats/summary`,{headers:Fs()});if(!l.ok){const n=await l.json();throw new Error(n.detail||"่Žทๅ–็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ")}return l.json()}async function B4(l){const n=await we(`${Gr}/batch/delete`,{method:"POST",headers:Fs(),body:JSON.stringify({person_ids:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ")}return n.json()}function $4(){const[l,n]=m.useState([]),[i,c]=m.useState(!0),[u,x]=m.useState(0),[h,f]=m.useState(1),[p,g]=m.useState(20),[N,v]=m.useState(""),[y,w]=m.useState(void 0),[b,D]=m.useState(void 0),[A,_]=m.useState(null),[H,E]=m.useState(!1),[C,M]=m.useState(!1),[G,O]=m.useState(null),[ee,R]=m.useState({total:0,known:0,unknown:0,platforms:{}}),[me,ce]=m.useState(new Set),[ve,se]=m.useState(!1),[ge,fe]=m.useState(""),{toast:z}=st(),Q=async()=>{try{c(!0);const X=await D4({page:h,page_size:p,search:N||void 0,is_known:y,platform:b});n(X.data),x(X.total)}catch(X){z({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:X instanceof Error?X.message:"ๆ— ๆณ•ๅŠ ่ฝฝไบบ็‰ฉไฟกๆฏ",variant:"destructive"})}finally{c(!1)}},I=async()=>{try{const X=await U4();X?.data&&R(X.data)}catch(X){console.error("ๅŠ ่ฝฝ็ปŸ่ฎกๆ•ฐๆฎๅคฑ่ดฅ:",X)}};m.useEffect(()=>{Q(),I()},[h,p,N,y,b]);const L=async X=>{try{const oe=await O4(X.person_id);_(oe.data),E(!0)}catch(oe){z({title:"ๅŠ ่ฝฝ่ฏฆๆƒ…ๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๅŠ ่ฝฝไบบ็‰ฉ่ฏฆๆƒ…",variant:"destructive"})}},$=X=>{_(X),M(!0)},_e=async X=>{try{await L4(X.person_id),z({title:"ๅˆ ้™คๆˆๅŠŸ",description:`ๅทฒๅˆ ้™คไบบ็‰ฉไฟกๆฏ: ${X.person_name||X.nickname||X.user_id}`}),O(null),Q(),I()}catch(oe){z({title:"ๅˆ ้™คๅคฑ่ดฅ",description:oe instanceof Error?oe.message:"ๆ— ๆณ•ๅˆ ้™คไบบ็‰ฉไฟกๆฏ",variant:"destructive"})}},je=m.useMemo(()=>Object.keys(ee.platforms),[ee.platforms]),Se=X=>{const oe=new Set(me);oe.has(X)?oe.delete(X):oe.add(X),ce(oe)},K=()=>{me.size===l.length&&l.length>0?ce(new Set):ce(new Set(l.map(X=>X.person_id)))},U=()=>{if(me.size===0){z({title:"ๆœช้€‰ๆ‹ฉไปปไฝ•ไบบ็‰ฉ",description:"่ฏทๅ…ˆ้€‰ๆ‹ฉ่ฆๅˆ ้™ค็š„ไบบ็‰ฉ",variant:"destructive"});return}se(!0)},V=async()=>{try{const X=await B4(Array.from(me));z({title:"ๆ‰น้‡ๅˆ ้™คๅฎŒๆˆ",description:X.message}),ce(new Set),se(!1),Q(),I()}catch(X){z({title:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",description:X instanceof Error?X.message:"ๆ‰น้‡ๅˆ ้™คๅคฑ่ดฅ",variant:"destructive"})}},xe=()=>{const X=parseInt(ge),oe=Math.ceil(u/p);X>=1&&X<=oe?(f(X),fe("")):z({title:"ๆ— ๆ•ˆ็š„้กต็ ",description:`่ฏท่พ“ๅ…ฅ1-${oe}ไน‹้—ด็š„้กต็ `,variant:"destructive"})},Ae=X=>X?new Date(X*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(zm,{className:"h-8 w-8",strokeWidth:2}),"ไบบ็‰ฉไฟกๆฏ็ฎก็†"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"็ฎก็†้บฆ้บฆ่ฎค่ฏ†็š„ๆ‰€ๆœ‰ไบบ็‰ฉไฟกๆฏ"})]})})}),e.jsx(Je,{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:ee.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:ee.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:ee.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(T,{htmlFor:"search",children:"ๆœ็ดข"}),e.jsxs("div",{className:"relative mt-1.5",children:[e.jsx(Ot,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{id:"search",placeholder:"ๆœ็ดขๅ็งฐใ€ๆ˜ต็งฐๆˆ–็”จๆˆทID...",value:N,onChange:X=>v(X.target.value),className:"pl-9"})]})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"filter-known",children:"่ฎค่ฏ†็Šถๆ€"}),e.jsxs(Be,{value:y===void 0?"all":y.toString(),onValueChange:X=>{w(X==="all"?void 0:X==="true"),f(1)},children:[e.jsx(Le,{id:"filter-known",className:"mt-1.5",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ"}),e.jsx(W,{value:"true",children:"ๅทฒ่ฎค่ฏ†"}),e.jsx(W,{value:"false",children:"ๆœช่ฎค่ฏ†"})]})]})]}),e.jsxs("div",{children:[e.jsx(T,{htmlFor:"filter-platform",children:"ๅนณๅฐ"}),e.jsxs(Be,{value:b||"all",onValueChange:X=>{D(X==="all"?void 0:X),f(1)},children:[e.jsx(Le,{id:"filter-platform",className:"mt-1.5",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจๅนณๅฐ"}),je.map(X=>e.jsxs(W,{value:X,children:[X," (",ee.platforms[X],")"]},X))]})]})]})]}),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:me.size>0&&e.jsxs("span",{children:["ๅทฒ้€‰ๆ‹ฉ ",me.size," ไธชไบบ็‰ฉ"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"ๆฏ้กตๆ˜พ็คบ"}),e.jsxs(Be,{value:p.toString(),onValueChange:X=>{g(parseInt(X)),f(1),ce(new Set)},children:[e.jsx(Le,{id:"page-size",className:"w-20",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10"}),e.jsx(W,{value:"20",children:"20"}),e.jsx(W,{value:"50",children:"50"}),e.jsx(W,{value:"100",children:"100"})]})]}),me.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>ce(new Set),children:"ๅ–ๆถˆ้€‰ๆ‹ฉ"}),e.jsxs(S,{variant:"destructive",size:"sm",onClick:U,children:[e.jsx(ns,{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(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{className:"w-12",children:e.jsx(Ws,{checked:l.length>0&&me.size===l.length,onCheckedChange:K,"aria-label":"ๅ…จ้€‰"})}),e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"ๆ˜ต็งฐ"}),e.jsx(Ze,{children:"ๅนณๅฐ"}),e.jsx(Ze,{children:"็”จๆˆทID"}),e.jsx(Ze,{children:"ๆœ€ๅŽๆ›ดๆ–ฐ"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i?e.jsx(ot,{children:e.jsx(Ke,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."})}):l.length===0?e.jsx(ot,{children:e.jsx(Ke,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"})}):l.map(X=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Ws,{checked:me.has(X.person_id),onCheckedChange:()=>Se(X.person_id),"aria-label":`้€‰ๆ‹ฉ ${X.person_name||X.nickname||X.user_id}`})}),e.jsx(Ke,{children:e.jsx("div",{className:P("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",X.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:X.is_known?"ๅทฒ่ฎค่ฏ†":"ๆœช่ฎค่ฏ†"})}),e.jsx(Ke,{className:"font-medium",children:X.person_name||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Ke,{children:X.nickname||"-"}),e.jsx(Ke,{children:X.platform}),e.jsx(Ke,{className:"font-mono text-sm",children:X.user_id}),e.jsx(Ke,{className:"text-sm text-muted-foreground",children:Ae(X.last_know)}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(S,{variant:"default",size:"sm",onClick:()=>L(X),children:[e.jsx(na,{className:"h-4 w-4 mr-1"}),"่ฏฆๆƒ…"]}),e.jsxs(S,{variant:"default",size:"sm",onClick:()=>$(X),children:[e.jsx(Hn,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsxs(S,{size:"sm",onClick:()=>O(X),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅˆ ้™ค"]})]})})]},X.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:i?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๅŠ ่ฝฝไธญ..."}):l.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๆ•ฐๆฎ"}):l.map(X=>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(Ws,{checked:me.has(X.person_id),onCheckedChange:()=>Se(X.person_id),className:"mt-1"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:P("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",X.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:X.is_known?"ๅทฒ่ฎค่ฏ†":"ๆœช่ฎค่ฏ†"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:X.person_name||e.jsx("span",{className:"text-muted-foreground",children:"ๆœชๅ‘ฝๅ"})}),X.nickname&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["ๆ˜ต็งฐ: ",X.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:X.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:X.user_id,children:X.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:Ae(X.last_know)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>L(X),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(na,{className:"h-3 w-3 mr-1"}),"ๆŸฅ็œ‹"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>$(X),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Hn,{className:"h-3 w-3 mr-1"}),"็ผ–่พ‘"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>O(X),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ns,{className:"h-3 w-3 mr-1"}),"ๅˆ ้™ค"]})]})]},X.id))}),u>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:["ๅ…ฑ ",u," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",h," / ",Math.ceil(u/p)," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(1),disabled:h===1,className:"hidden sm:flex",children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h-1),disabled:h===1,children:[e.jsx(Fa,{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(ne,{type:"number",value:ge,onChange:X=>fe(X.target.value),onKeyDown:X=>X.key==="Enter"&&xe(),placeholder:h.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/p)}),e.jsx(S,{variant:"outline",size:"sm",onClick:xe,disabled:!ge,className:"h-8",children:"่ทณ่ฝฌ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>f(h+1),disabled:h>=Math.ceil(u/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>f(Math.ceil(u/p)),disabled:h>=Math.ceil(u/p),className:"hidden sm:flex",children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(I4,{person:A,open:H,onOpenChange:E}),e.jsx(P4,{person:A,open:C,onOpenChange:M,onSuccess:()=>{Q(),I(),M(!1)}}),e.jsx(js,{open:!!G,onOpenChange:()=>O(null),children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๅˆ ้™ค"}),e.jsxs(hs,{children:['็กฎๅฎš่ฆๅˆ ้™คไบบ็‰ฉไฟกๆฏ "',G?.person_name||G?.nickname||G?.user_id,'" ๅ—๏ผŸ ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚']})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:()=>G&&_e(G),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๅˆ ้™ค"})]})]})}),e.jsx(js,{open:ve,onOpenChange:se,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"็กฎ่ฎคๆ‰น้‡ๅˆ ้™ค"}),e.jsxs(hs,{children:["็กฎๅฎš่ฆๅˆ ้™ค้€‰ไธญ็š„ ",me.size," ไธชไบบ็‰ฉไฟกๆฏๅ—๏ผŸ ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:V,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"ๆ‰น้‡ๅˆ ้™ค"})]})]})})]})}function I4({person:l,open:n,onOpenChange:i}){if(!l)return null;const c=u=>u?new Date(u*1e3).toLocaleString("zh-CN"):"-";return e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ไบบ็‰ฉ่ฏฆๆƒ…"}),e.jsxs(Ys,{children:["ๆŸฅ็œ‹ ",l.person_name||l.nickname||l.user_id," ็š„ๅฎŒๆ•ดไฟกๆฏ"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Cl,{icon:Bn,label:"ไบบ็‰ฉๅ็งฐ",value:l.person_name}),e.jsx(Cl,{icon:Pa,label:"ๆ˜ต็งฐ",value:l.nickname}),e.jsx(Cl,{icon:Ir,label:"็”จๆˆทID",value:l.user_id,mono:!0}),e.jsx(Cl,{icon:Ir,label:"ไบบ็‰ฉID",value:l.person_id,mono:!0}),e.jsx(Cl,{label:"ๅนณๅฐ",value:l.platform}),e.jsx(Cl,{label:"็Šถๆ€",value:l.is_known?"ๅทฒ่ฎค่ฏ†":"ๆœช่ฎค่ฏ†"})]}),l.name_reason&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ๅ็งฐ่ฎพๅฎšๅŽŸๅ› "}),e.jsx("p",{className:"mt-1 text-sm",children:l.name_reason})]}),l.memory_points&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"ไธชไบบๅฐ่ฑก"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:l.memory_points})]}),l.group_nick_name&&l.group_nick_name.length>0&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"็พคๆ˜ต็งฐ"}),e.jsx("div",{className:"mt-2 space-y-1",children:l.group_nick_name.map((u,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:u.group_id}),e.jsx("span",{children:"โ†’"}),e.jsx("span",{children:u.group_nick_name})]},x))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Cl,{icon:Ya,label:"่ฎค่ฏ†ๆ—ถ้—ด",value:c(l.know_times)}),e.jsx(Cl,{icon:Ya,label:"้ฆ–ๆฌก่ฎฐๅฝ•",value:c(l.know_since)}),e.jsx(Cl,{icon:Ya,label:"ๆœ€ๅŽๆ›ดๆ–ฐ",value:c(l.last_know)})]})]}),e.jsx(et,{children:e.jsx(S,{onClick:()=>i(!1),children:"ๅ…ณ้—ญ"})})]})})}function Cl({icon:l,label:n,value:i,mono:c=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l&&e.jsx(l,{className:"h-3 w-3"}),n]}),e.jsx("div",{className:P("text-sm",c&&"font-mono",!i&&"text-muted-foreground"),children:i||"-"})]})}function P4({person:l,open:n,onOpenChange:i,onSuccess:c}){const[u,x]=m.useState({}),[h,f]=m.useState(!1),{toast:p}=st();m.useEffect(()=>{l&&x({person_name:l.person_name||"",name_reason:l.name_reason||"",nickname:l.nickname||"",is_known:l.is_known})},[l]);const g=async()=>{if(l)try{f(!0),await R4(l.person_id,u),p({title:"ไฟๅญ˜ๆˆๅŠŸ",description:"ไบบ็‰ฉไฟกๆฏๅทฒๆ›ดๆ–ฐ"}),c()}catch(N){p({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:N instanceof Error?N.message:"ๆ— ๆณ•ๆ›ดๆ–ฐไบบ็‰ฉไฟกๆฏ",variant:"destructive"})}finally{f(!1)}};return l?e.jsx(Ps,{open:n,onOpenChange:i,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็ผ–่พ‘ไบบ็‰ฉไฟกๆฏ"}),e.jsxs(Ys,{children:["ไฟฎๆ”น ",l.person_name||l.nickname||l.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(T,{htmlFor:"person_name",children:"ไบบ็‰ฉๅ็งฐ"}),e.jsx(ne,{id:"person_name",value:u.person_name||"",onChange:N=>x({...u,person_name:N.target.value}),placeholder:"ไธบ่ฟ™ไธชไบบ่ฎพ็ฝฎไธ€ไธชๅ็งฐ"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"nickname",children:"ๆ˜ต็งฐ"}),e.jsx(ne,{id:"nickname",value:u.nickname||"",onChange:N=>x({...u,nickname:N.target.value}),placeholder:"ๆ˜ต็งฐ"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"name_reason",children:"ๅ็งฐ่ฎพๅฎšๅŽŸๅ› "}),e.jsx(at,{id:"name_reason",value:u.name_reason||"",onChange:N=>x({...u,name_reason:N.target.value}),placeholder:"ไธบไป€ไนˆ่ฟ™ๆ ท็งฐๅ‘ผ่ฟ™ไธชไบบ๏ผŸ",rows:2})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx(T,{htmlFor:"is_known",className:"text-base font-medium",children:"ๅทฒ่ฎค่ฏ†"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆ ‡่ฎฐๆ˜ฏๅฆๅทฒ็ป่ฎค่ฏ†่ฟ™ไธชไบบ"})]}),e.jsx(Fe,{id:"is_known",checked:u.is_known,onCheckedChange:N=>x({...u,is_known:N})})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>i(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:g,disabled:h,children:h?"ไฟๅญ˜ไธญ...":"ไฟๅญ˜"})]})]})}):null}var H4=D1();const kg=b0(H4),sx="/api/webui";async function F4(l=100,n="all"){const i=`${sx}/knowledge/graph?limit=${l}&node_type=${n}`,c=await fetch(i);if(!c.ok)throw new Error(`่Žทๅ–็Ÿฅ่ฏ†ๅ›พ่ฐฑๅคฑ่ดฅ: ${c.status}`);return c.json()}async function G4(){const l=await fetch(`${sx}/knowledge/stats`);if(!l.ok)throw new Error("่Žทๅ–็Ÿฅ่ฏ†ๅ›พ่ฐฑ็ปŸ่ฎกไฟกๆฏๅคฑ่ดฅ");return l.json()}async function V4(l){const n=await fetch(`${sx}/knowledge/search?query=${encodeURIComponent(l)}`);if(!n.ok)throw new Error("ๆœ็ดข็Ÿฅ่ฏ†่Š‚็‚นๅคฑ่ดฅ");return n.json()}const wv=m.memo(({data:l})=>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(Ro,{type:"target",position:Lo.Top}),e.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:l.content,children:l.label}),e.jsx(Ro,{type:"source",position:Lo.Bottom})]}));wv.displayName="EntityNode";const _v=m.memo(({data:l})=>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(Ro,{type:"target",position:Lo.Top}),e.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:l.content,children:l.label}),e.jsx(Ro,{type:"source",position:Lo.Bottom})]}));_v.displayName="ParagraphNode";const q4={entity:wv,paragraph:_v};function K4(l,n){const i=new kg.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const c=[],u=[];return l.forEach(x=>{i.setNode(x.id,{width:150,height:50})}),n.forEach(x=>{i.setEdge(x.source,x.target)}),kg.layout(i),l.forEach(x=>{const h=i.node(x.id);c.push({id:x.id,type:x.type,position:{x:h.x-75,y:h.y-25},data:{label:x.content.slice(0,20)+(x.content.length>20?"...":""),content:x.content}})}),n.forEach((x,h)=>{const f={id:`edge-${h}`,source:x.source,target:x.target,animated:l.length<=200&&x.weight>5,style:{strokeWidth:Math.min(x.weight/2,5),opacity:.6}};x.weight>10&&l.length<100&&(f.label=`${x.weight.toFixed(0)}`),u.push(f)}),{nodes:c,edges:u}}function Q4(){const l=ia(),[n,i]=m.useState(!1),[c,u]=m.useState(null),[x,h]=m.useState(""),[f,p]=m.useState("all"),[g,N]=m.useState(50),[v,y]=m.useState("50"),[w,b]=m.useState(!1),[D,A]=m.useState(!0),[_,H]=m.useState(!1),[E,C]=m.useState(!1),[M,G,O]=O1([]),[ee,R,me]=R1([]),[ce,ve]=m.useState(0),[se,ge]=m.useState(null),[fe,z]=m.useState(null),{toast:Q}=st(),I=m.useCallback(V=>V.type==="entity"?"#6366f1":V.type==="paragraph"?"#10b981":"#6b7280",[]),L=m.useCallback(async(V=!1)=>{try{if(!V&&g>200){C(!0);return}i(!0);const[xe,Ae]=await Promise.all([F4(g,f),G4()]);if(u(Ae),xe.nodes.length===0){Q({title:"ๆ็คบ",description:"็Ÿฅ่ฏ†ๅบ“ไธบ็ฉบ๏ผŒ่ฏทๅ…ˆๅฏผๅ…ฅ็Ÿฅ่ฏ†ๆ•ฐๆฎ"}),G([]),R([]);return}const{nodes:X,edges:oe}=K4(xe.nodes,xe.edges);G(X),R(oe),ve(X.length),Ae&&Ae.total_nodes>g&&Q({title:"ๆ็คบ",description:`็Ÿฅ่ฏ†ๅ›พ่ฐฑๅŒ…ๅซ ${Ae.total_nodes} ไธช่Š‚็‚น๏ผŒๅฝ“ๅ‰ๆ˜พ็คบ ${X.length} ไธช`}),Q({title:"ๅŠ ่ฝฝๆˆๅŠŸ",description:`ๅทฒๅŠ ่ฝฝ ${X.length} ไธช่Š‚็‚น๏ผŒ${oe.length} ๆก่พน`})}catch(xe){console.error("ๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑๅคฑ่ดฅ:",xe),Q({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:xe instanceof Error?xe.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{i(!1)}},[g,f,Q]),$=m.useCallback(async()=>{if(!x.trim()){Q({title:"ๆ็คบ",description:"่ฏท่พ“ๅ…ฅๆœ็ดขๅ…ณ้”ฎ่ฏ"});return}try{const V=await V4(x);if(V.length===0){Q({title:"ๆœชๆ‰พๅˆฐ",description:"ๆฒกๆœ‰ๆ‰พๅˆฐๅŒน้…็š„่Š‚็‚น"});return}const xe=new Set(V.map(Ae=>Ae.id));G(Ae=>Ae.map(X=>({...X,style:{...X.style,opacity:xe.has(X.id)?1:.3,filter:xe.has(X.id)?"brightness(1.2)":"brightness(0.8)"}}))),Q({title:"ๆœ็ดขๅฎŒๆˆ",description:`ๆ‰พๅˆฐ ${V.length} ไธชๅŒน้…่Š‚็‚น`})}catch(V){console.error("ๆœ็ดขๅคฑ่ดฅ:",V),Q({title:"ๆœ็ดขๅคฑ่ดฅ",description:V instanceof Error?V.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},[x,Q]),_e=m.useCallback(()=>{G(V=>V.map(xe=>({...xe,style:{...xe.style,opacity:1,filter:"brightness(1)"}})))},[]),je=m.useCallback(()=>{A(!1),H(!0),L()},[L]),Se=m.useCallback(()=>{C(!1),setTimeout(()=>{L(!0)},0)},[L]),K=m.useCallback((V,xe)=>{M.find(X=>X.id===xe.id)&&ge({id:xe.id,type:xe.type,content:xe.data.content})},[M]);m.useEffect(()=>{D||_&&L()},[g,f,D,_]);const U=m.useCallback((V,xe)=>{const Ae=M.find(Ge=>Ge.id===xe.source),X=M.find(Ge=>Ge.id===xe.target),oe=ee.find(Ge=>Ge.id===xe.id);Ae&&X&&oe&&z({source:{id:Ae.id,type:Ae.type,content:Ae.data.content},target:{id:X.id,type:X.type,content:X.data.content},edge:{source:xe.source,target:xe.target,weight:parseFloat(xe.label||"0")}})},[M,ee]);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:"ๅฏ่ง†ๅŒ–็Ÿฅ่ฏ†ๅฎžไฝ“ไธŽๅ…ณ็ณป็ฝ‘็ปœ"})]}),c&&e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Br,{className:"h-3 w-3"}),"่Š‚็‚น: ",c.total_nodes]}),e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Mj,{className:"h-3 w-3"}),"่พน: ",c.total_edges]}),e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Pt,{className:"h-3 w-3"}),"ๅฎžไฝ“: ",c.entity_nodes]}),e.jsxs(ke,{variant:"outline",className:"gap-1",children:[e.jsx(Sa,{className:"h-3 w-3"}),"ๆฎต่ฝ: ",c.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(ne,{placeholder:"ๆœ็ดข่Š‚็‚นๅ†…ๅฎน...",value:x,onChange:V=>h(V.target.value),onKeyDown:V=>V.key==="Enter"&&$(),className:"flex-1"}),e.jsx(S,{onClick:$,size:"sm",children:e.jsx(Ot,{className:"h-4 w-4"})}),e.jsx(S,{onClick:_e,variant:"outline",size:"sm",children:"้‡็ฝฎ"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Be,{value:f,onValueChange:V=>p(V),children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ่Š‚็‚น"}),e.jsx(W,{value:"entity",children:"ไป…ๅฎžไฝ“"}),e.jsx(W,{value:"paragraph",children:"ไป…ๆฎต่ฝ"})]})]}),e.jsxs(Be,{value:g===1e4?"all":w?"custom":g.toString(),onValueChange:V=>{V==="custom"?(b(!0),y(g.toString())):V==="all"?(b(!1),N(1e4)):(b(!1),N(Number(V)))},children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"50",children:"50 ่Š‚็‚น"}),e.jsx(W,{value:"100",children:"100 ่Š‚็‚น"}),e.jsx(W,{value:"200",children:"200 ่Š‚็‚น"}),e.jsx(W,{value:"500",children:"500 ่Š‚็‚น"}),e.jsx(W,{value:"1000",children:"1000 ่Š‚็‚น"}),e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ (ๆœ€ๅคš10000)"}),e.jsx(W,{value:"custom",children:"่‡ชๅฎšไน‰..."})]})]}),w&&e.jsx(ne,{type:"number",min:"50",value:v,onChange:V=>y(V.target.value),onBlur:()=>{const V=parseInt(v);!isNaN(V)&&V>=50?N(V):(y("50"),N(50))},onKeyDown:V=>{if(V.key==="Enter"){const xe=parseInt(v);!isNaN(xe)&&xe>=50?N(xe):(y("50"),N(50))}},placeholder:"ๆœ€ๅฐ‘50ไธช",className:"w-[120px]"}),e.jsx(S,{onClick:()=>L(),variant:"outline",size:"sm",disabled:n,children:e.jsx(ft,{className:P("h-4 w-4",n&&"animate-spin")})})]})]})]}),e.jsx("div",{className:"flex-1 relative",children:n?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ft,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"ๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑไธญ..."})]})}):M.length===0?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Br,{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(L1,{nodes:M,edges:ee,onNodesChange:O,onEdgesChange:me,onNodeClick:K,onEdgeClick:U,nodeTypes:q4,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:ce<=500,nodesDraggable:ce<=1e3,attributionPosition:"bottom-left",children:[e.jsx(U1,{variant:B1.Dots,gap:12,size:1}),e.jsx($1,{}),ce<=500&&e.jsx(I1,{nodeColor:I,nodeBorderRadius:8,pannable:!0,zoomable:!0}),e.jsxs(P1,{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:"ๆฎต่ฝ่Š‚็‚น"})]}),ce>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:"ๅทฒ็ฆ็”จๅŠจ็”ป"}),ce>500&&e.jsx("div",{children:"ๅทฒ็ฆ็”จ็ผฉ็•ฅๅ›พ"})]})]})]})]})}),e.jsx(Ps,{open:!!se,onOpenChange:V=>!V&&ge(null),children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(Bs,{children:e.jsx($s,{children:"่Š‚็‚น่ฏฆๆƒ…"})}),se&&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(ke,{variant:se.type==="entity"?"default":"secondary",children:se.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:se.id})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ๅ†…ๅฎน"}),e.jsx(Je,{className:"mt-1 h-40 p-3 bg-muted rounded",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:se.content})})]})]})]})}),e.jsx(Ps,{open:!!fe,onOpenChange:V=>!V&&z(null),children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[e.jsx(Bs,{children:e.jsx($s,{children:"่พน่ฏฆๆƒ…"})}),fe&&e.jsx(Je,{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:fe.source.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[fe.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:fe.target.content}),e.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[fe.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(ke,{variant:"outline",className:"text-base font-mono",children:fe.edge.weight.toFixed(4)})})]})]})})]})}),e.jsx(js,{open:D,onOpenChange:A,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"ๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑ"}),e.jsxs(hs,{children:["็Ÿฅ่ฏ†ๅ›พ่ฐฑ็š„ๅŠจๆ€ๅฑ•็คบไผšๆถˆ่€—่พƒๅคš็ณป็ปŸ่ต„ๆบใ€‚",e.jsx("br",{}),"็กฎๅฎš่ฆๅŠ ่ฝฝ็Ÿฅ่ฏ†ๅ›พ่ฐฑๅ—?"]})]}),e.jsxs(ms,{children:[e.jsx(ps,{onClick:()=>l({to:"/"}),children:"ๅ–ๆถˆ (่ฟ”ๅ›ž้ฆ–้กต)"}),e.jsx(fs,{onClick:je,children:"็กฎ่ฎคๅŠ ่ฝฝ"})]})]})}),e.jsx(js,{open:E,onOpenChange:C,children:e.jsxs(ds,{children:[e.jsxs(us,{children:[e.jsx(xs,{children:"โš ๏ธ ่Š‚็‚นๆ•ฐ้‡่พƒๅคš"}),e.jsx(hs,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["ๆ‚จๆญฃๅœจๅฐ่ฏ•ๅŠ ่ฝฝ ",e.jsx("strong",{className:"text-orange-600",children:g>=1e4?"ๅ…จ้ƒจ (ๆœ€ๅคš10000ไธช)":g})," ไธช่Š‚็‚นใ€‚"]}),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(ms,{children:[e.jsx(ps,{onClick:()=>{C(!1),g>200&&(N(50),b(!1))},children:"ๅ–ๆถˆ"}),e.jsx(fs,{onClick:Se,className:"bg-orange-600 hover:bg-orange-700",children:"ๆˆ‘ไบ†่งฃ้ฃŽ้™ฉ๏ผŒ็ปง็ปญๅŠ ่ฝฝ"})]})]})})]})}function Y4(){return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-none border-b bg-card/50 px-6 py-4",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"้บฆ้บฆ็Ÿฅ่ฏ†ๅบ“็ฎก็†"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"็ฎก็†ๅ’Œ็ป„็ป‡้บฆ้บฆ็š„็Ÿฅ่ฏ†ๅบ“ๅ†…ๅฎน"})]})})}),e.jsx("div",{className:"flex-1 overflow-auto p-6",children:e.jsx("div",{className:"mx-auto max-w-4xl",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:e.jsx(Br,{className:"h-10 w-10 text-primary"})}),e.jsx(He,{className:"text-2xl",children:"้บฆ้บฆ็Ÿฅ่ฏ†ๅบ“็ฎก็†"}),e.jsx(As,{className:"text-base",children:"ๅŠŸ่ƒฝๅผ€ๅ‘ไธญ๏ผŒๆ•ฌ่ฏทๆœŸๅพ…"})]}),e.jsx(Re,{className:"text-center text-sm text-muted-foreground",children:e.jsx("p",{children:"ๆญคๅŠŸ่ƒฝๅฐ†ๆไพ›็Ÿฅ่ฏ†ๅบ“็š„ๅˆ›ๅปบใ€็ผ–่พ‘ใ€ๅฏผๅ…ฅๅ’Œ็ฎก็†่ƒฝๅŠ›"})})]})})})]})}function Cg({className:l,classNames:n,showOutsideDays:i=!0,captionLayout:c="label",buttonVariant:u="ghost",formatters:x,components:h,...f}){const p=Kj();return e.jsx(k1,{showOutsideDays:i,className:P("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`,l),captionLayout:c,formatters:{formatMonthDropdown:g=>g.toLocaleString("default",{month:"short"}),...x},classNames:{root:P("w-fit",p.root),months:P("relative flex flex-col gap-4 md:flex-row",p.months),month:P("flex w-full flex-col gap-4",p.month),nav:P("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",p.nav),button_previous:P(Pr({variant:u}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_previous),button_next:P(Pr({variant:u}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_next),month_caption:P("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",p.month_caption),dropdowns:P("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",p.dropdowns),dropdown_root:P("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:P("bg-popover absolute inset-0 opacity-0",p.dropdown),caption_label:P("select-none font-medium",c==="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:P("flex",p.weekdays),weekday:P("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",p.weekday),week:P("mt-2 flex w-full",p.week),week_number_header:P("w-[--cell-size] select-none",p.week_number_header),week_number:P("text-muted-foreground select-none text-[0.8rem]",p.week_number),day:P("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:P("bg-accent rounded-l-md",p.range_start),range_middle:P("rounded-none",p.range_middle),range_end:P("bg-accent rounded-r-md",p.range_end),today:P("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:P("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:P("text-muted-foreground opacity-50",p.disabled),hidden:P("invisible",p.hidden),...n},components:{Root:({className:g,rootRef:N,...v})=>e.jsx("div",{"data-slot":"calendar",ref:N,className:P(g),...v}),Chevron:({className:g,orientation:N,...v})=>N==="left"?e.jsx(Fa,{className:P("size-4",g),...v}):N==="right"?e.jsx(sa,{className:P("size-4",g),...v}):e.jsx(Ta,{className:P("size-4",g),...v}),DayButton:J4,WeekNumber:({children:g,...N})=>e.jsx("td",{...N,children:e.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:g})}),...h},...f})}function J4({className:l,day:n,modifiers:i,...c}){const u=Kj(),x=m.useRef(null);return m.useEffect(()=>{i.focused&&x.current?.focus()},[i.focused]),e.jsx(S,{ref:x,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:P("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",u.day,l),...c})}const _o={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 X4(){const[l,n]=m.useState([]),[i,c]=m.useState(""),[u,x]=m.useState("all"),[h,f]=m.useState("all"),[p,g]=m.useState(void 0),[N,v]=m.useState(void 0),[y,w]=m.useState(!0),[b,D]=m.useState(!1),[A,_]=m.useState("xs"),[H,E]=m.useState(4),[C,M]=m.useState(!1),G=m.useRef(null);m.useEffect(()=>{const $=Ln.getAllLogs();n($);const _e=Ln.onLog(()=>{n(Ln.getAllLogs())}),je=Ln.onConnectionChange(Se=>{D(Se)});return()=>{_e(),je()}},[]);const O=m.useMemo(()=>{const $=new Set(l.map(_e=>_e.module).filter(_e=>_e&&_e.trim()!==""));return Array.from($).sort()},[l]),ee=$=>{switch($){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"}},R=$=>{switch($){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"}},me=()=>{window.location.reload()},ce=()=>{Ln.clearLogs(),n([])},ve=()=>{const $=fe.map(K=>`${K.timestamp} [${K.level.padEnd(8)}] [${K.module}] ${K.message}`).join(` +`),_e=new Blob([$],{type:"text/plain;charset=utf-8"}),je=URL.createObjectURL(_e),Se=document.createElement("a");Se.href=je,Se.download=`logs-${xm(new Date,"yyyy-MM-dd-HHmmss")}.txt`,Se.click(),URL.revokeObjectURL(je)},se=()=>{w(!y)},ge=()=>{g(void 0),v(void 0)},fe=m.useMemo(()=>l.filter($=>{const _e=i===""||$.message.toLowerCase().includes(i.toLowerCase())||$.module.toLowerCase().includes(i.toLowerCase()),je=u==="all"||$.level===u,Se=h==="all"||$.module===h;let K=!0;if(p||N){const U=new Date($.timestamp);if(p){const V=new Date(p);V.setHours(0,0,0,0),K=K&&U>=V}if(N){const V=new Date(N);V.setHours(23,59,59,999),K=K&&U<=V}}return _e&&je&&Se&&K}),[l,i,u,h,p,N]),z=_o[A].rowHeight+H,Q=m0({count:fe.length,getScrollElement:()=>G.current,estimateSize:()=>z,overscan:50}),I=m.useRef(!1),L=m.useRef(fe.length);return m.useEffect(()=>{const $=G.current;if(!$)return;const _e=()=>{if(I.current)return;const{scrollTop:je,scrollHeight:Se,clientHeight:K}=$,U=Se-je-K;U>100&&y?w(!1):U<50&&!y&&w(!0)};return $.addEventListener("scroll",_e,{passive:!0}),()=>$.removeEventListener("scroll",_e)},[y]),m.useEffect(()=>{const $=fe.length>L.current;L.current=fe.length,y&&fe.length>0&&$&&(I.current=!0,Q.scrollToIndex(fe.length-1,{align:"end",behavior:"auto"}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{I.current=!1})}))},[fe.length,y,Q]),e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 space-y-2 sm:space-y-3 p-2 sm:p-3 lg:p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg sm:text-xl lg:text-2xl font-bold",children:"ๆ—ฅๅฟ—ๆŸฅ็œ‹ๅ™จ"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 hidden sm:block",children:"ๅฎžๆ—ถๆŸฅ็œ‹ๅ’Œๅˆ†ๆž้บฆ้บฆ่ฟ่กŒๆ—ฅๅฟ—"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:P("h-2 w-2 sm:h-2.5 sm:w-2.5 rounded-full",b?"bg-green-500 animate-pulse":"bg-red-500")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:b?"ๅทฒ่ฟžๆŽฅ":"ๆœช่ฟžๆŽฅ"})]})]}),e.jsx(Ce,{className:"p-2 sm:p-3",children:e.jsx(Zi,{open:C,onOpenChange:M,children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 relative min-w-0",children:[e.jsx(Ot,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆ—ฅๅฟ—...",value:i,onChange:$=>c($.target.value),className:"pl-8 h-8 text-xs sm:text-sm"})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(S,{variant:y?"default":"outline",size:"sm",onClick:se,className:"h-8 px-2",title:y?"่‡ชๅŠจๆปšๅŠจ":"ๅทฒๆš‚ๅœ",children:[y?e.jsx(Zw,{className:"h-3.5 w-3.5"}):e.jsx(Ww,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1 text-xs hidden sm:inline",children:y?"ๆปšๅŠจ":"ๆš‚ๅœ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:ce,className:"h-8 px-2",title:"ๆธ…็ฉบๆ—ฅๅฟ—",children:[e.jsx(ns,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1 text-xs hidden md:inline",children:"ๆธ…็ฉบ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:ve,className:"h-8 px-2 hidden sm:flex",title:"ๅฏผๅ‡บๆ—ฅๅฟ—",children:[e.jsx(Zt,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"ml-1 text-xs hidden lg:inline",children:"ๅฏผๅ‡บ"})]}),e.jsx(Wi,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:"h-8 px-2",title:C?"ๆ”ถ่ตท็ญ›้€‰":"ๅฑ•ๅผ€็ญ›้€‰",children:[e.jsx(ko,{className:"h-3.5 w-3.5"}),C?e.jsx($r,{className:"h-3.5 w-3.5 ml-1"}):e.jsx(Ta,{className:"h-3.5 w-3.5 ml-1"})]})})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground text-center sm:text-right -mt-1",children:[e.jsxs("span",{className:"font-mono",children:[fe.length," / ",l.length]}),e.jsx("span",{className:"ml-1",children:"ๆกๆ—ฅๅฟ—"})]}),e.jsxs(ec,{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-2",children:[e.jsxs(Be,{value:u,onValueChange:x,children:[e.jsxs(Le,{className:"w-full sm:flex-1 h-8 text-xs",children:[e.jsx(ko,{className:"h-3.5 w-3.5 mr-1.5"}),e.jsx($e,{placeholder:"็บงๅˆซ"})]}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจ็บงๅˆซ"}),e.jsx(W,{value:"DEBUG",children:"DEBUG"}),e.jsx(W,{value:"INFO",children:"INFO"}),e.jsx(W,{value:"WARNING",children:"WARNING"}),e.jsx(W,{value:"ERROR",children:"ERROR"}),e.jsx(W,{value:"CRITICAL",children:"CRITICAL"})]})]}),e.jsxs(Be,{value:h,onValueChange:f,children:[e.jsxs(Le,{className:"w-full sm:flex-1 h-8 text-xs",children:[e.jsx(ko,{className:"h-3.5 w-3.5 mr-1.5"}),e.jsx($e,{placeholder:"ๆจกๅ—"})]}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจๆจกๅ—"}),O.map($=>e.jsx(W,{value:$,children:$},$))]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-2",children:[e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:P("w-full sm:flex-1 justify-start text-left font-normal h-8",!p&&"text-muted-foreground"),children:[e.jsx(Wp,{className:"mr-1.5 h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:p?xm(p,"PP",{locale:yo}):"ๅผ€ๅง‹ๆ—ฅๆœŸ"})]})}),e.jsx(Ja,{className:"w-auto p-0",align:"start",children:e.jsx(Cg,{mode:"single",selected:p,onSelect:g,initialFocus:!0,locale:yo})})]}),e.jsxs(nl,{children:[e.jsx(rl,{asChild:!0,children:e.jsxs(S,{variant:"outline",size:"sm",className:P("w-full sm:flex-1 justify-start text-left font-normal h-8",!N&&"text-muted-foreground"),children:[e.jsx(Wp,{className:"mr-1.5 h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:N?xm(N,"PP",{locale:yo}):"็ป“ๆŸๆ—ฅๆœŸ"})]})}),e.jsx(Ja,{className:"w-auto p-0",align:"start",children:e.jsx(Cg,{mode:"single",selected:N,onSelect:v,initialFocus:!0,locale:yo})})]}),(p||N)&&e.jsxs(S,{variant:"outline",size:"sm",onClick:ge,className:"w-full sm:w-auto h-8",children:[e.jsx(Ca,{className:"h-3.5 w-3.5 sm:mr-1"}),e.jsx("span",{className:"text-xs",children:"ๆธ…้™ค"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3 pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(e1,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:"ๅญ—ๅท"})]}),e.jsx("div",{className:"flex gap-1",children:Object.keys(_o).map($=>e.jsx(S,{variant:A===$?"default":"outline",size:"sm",onClick:()=>_($),className:"h-6 px-2 text-xs",children:_o[$].label},$))})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 max-w-[200px]",children:[e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"่กŒ่ท"}),e.jsx(_a,{value:[H],onValueChange:([$])=>E($),min:0,max:12,step:2,className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground w-7",children:[H,"px"]})]}),e.jsxs("div",{className:"flex gap-2 sm:hidden",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:me,className:"flex-1 h-8",children:[e.jsx(ft,{className:"h-3.5 w-3.5 mr-1"}),e.jsx("span",{className:"text-xs",children:"ๅˆทๆ–ฐ"})]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:ve,className:"flex-1 h-8",children:[e.jsx(Zt,{className:"h-3.5 w-3.5 mr-1"}),e.jsx("span",{className:"text-xs",children:"ๅฏผๅ‡บ"})]})]})]})]})]})})})]}),e.jsx("div",{className:"flex-1 min-h-0 px-2 sm:px-3 lg:px-4 pb-2 sm:pb-3 lg:pb-4",children:e.jsx(Ce,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full overflow-hidden",children:e.jsx("div",{ref:G,className:P("h-full overflow-auto","[&::-webkit-scrollbar]:w-2.5","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full","[&::-webkit-scrollbar-thumb:hover]:bg-border/80"),children:e.jsx("div",{className:P("p-2 sm:p-3 font-mono relative",_o[A].class),style:{height:`${Q.getTotalSize()}px`},children:fe.length===0?e.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-xs sm:text-sm",children:"ๆš‚ๆ— ๆ—ฅๅฟ—ๆ•ฐๆฎ"}):Q.getVirtualItems().map($=>{const _e=fe[$.index];return e.jsxs("div",{"data-index":$.index,ref:Q.measureElement,className:P("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors",R(_e.level)),style:{transform:`translateY(${$.start}px)`,paddingTop:`${H/2}px`,paddingBottom:`${H/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 text-[10px]",children:_e.timestamp}),e.jsxs("span",{className:P("font-semibold text-[10px]",ee(_e.level)),children:["[",_e.level,"]"]})]}),e.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate text-[10px]",children:_e.module}),e.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words text-[10px]",children:_e.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:_e.timestamp}),e.jsxs("span",{className:P("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",ee(_e.level)),children:["[",_e.level,"]"]}),e.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:_e.module}),e.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:_e.message})]})]},$.key)})})})})})]})}async function Z4(){return(await we("/api/planner/overview")).json()}async function W4(l,n=1,i=20,c){const u=new URLSearchParams({page:n.toString(),page_size:i.toString()});return c&&u.append("search",c),(await we(`/api/planner/chat/${l}/logs?${u}`)).json()}async function ek(l,n){return(await we(`/api/planner/log/${l}/${n}`)).json()}async function sk(){return(await we("/api/replier/overview")).json()}async function tk(l,n=1,i=20,c){const u=new URLSearchParams({page:n.toString(),page_size:i.toString()});return c&&u.append("search",c),(await we(`/api/replier/chat/${l}/logs?${u}`)).json()}async function ak(l,n){return(await we(`/api/replier/log/${l}/${n}`)).json()}function Sv(){const[l,n]=m.useState(new Map),[i,c]=m.useState(!0),u=m.useCallback(async()=>{try{c(!0);const h=await yv();if(h?.data){const f=new Map;h.data.forEach(p=>{f.set(p.chat_id,p.chat_name)}),n(f)}}catch(h){console.error("ๅŠ ่ฝฝ่Šๅคฉๅˆ—่กจๅคฑ่ดฅ:",h)}finally{c(!1)}},[]);m.useEffect(()=>{u()},[u]);const x=m.useCallback(h=>l.get(h)||h,[l]);return{chatNameMap:l,getChatName:x,loading:i,reload:u}}function Bo(l){return new Date(l*1e3).toLocaleString("zh-CN")}function kv(l){const i=Date.now()/1e3-l;return i<60?"ๅˆšๅˆš":i<3600?`${Math.floor(i/60)} ๅˆ†้’Ÿๅ‰`:i<86400?`${Math.floor(i/3600)} ๅฐๆ—ถๅ‰`:`${Math.floor(i/86400)} ๅคฉๅ‰`}function Cv(l,n,i=1e4){m.useEffect(()=>{if(!l)return;const c=setInterval(n,i);return()=>clearInterval(c)},[l,n,i])}function lk({autoRefresh:l,refreshKey:n}){const[i,c]=m.useState("overview"),[u,x]=m.useState(null),{getChatName:h}=Sv(),[f,p]=m.useState(null),[g,N]=m.useState(!0),[v,y]=m.useState(null),[w,b]=m.useState(!1),[D,A]=m.useState(1),[_,H]=m.useState(20),[E,C]=m.useState(""),[M,G]=m.useState(""),[O,ee]=m.useState(""),[R,me]=m.useState(null),[ce,ve]=m.useState(!1),[se,ge]=m.useState(!1),fe=m.useCallback(async()=>{try{N(!0);const U=await Z4();p(U)}catch(U){console.error("ๅŠ ่ฝฝ่ง„ๅˆ’ๅ™จๆ€ป่งˆๅคฑ่ดฅ:",U)}finally{N(!1)}},[]),z=m.useCallback(async()=>{if(u)try{b(!0);const U=await W4(u.chat_id,D,_,M||void 0);y(U)}catch(U){console.error("ๅŠ ่ฝฝ่Šๅคฉๆ—ฅๅฟ—ๅคฑ่ดฅ:",U)}finally{b(!1)}},[u,D,_,M]);m.useEffect(()=>{fe()},[fe]),m.useEffect(()=>{n>0&&(i==="overview"?fe():z())},[n,i,fe,z]),m.useEffect(()=>{i==="chat-logs"&&u&&z()},[i,u,z]),Cv(l,m.useCallback(()=>{i==="overview"?fe():z()},[i,fe,z]));const Q=U=>{x(U),A(1),G(""),ee(""),c("chat-logs")},I=()=>{c("overview"),x(null),y(null),G(""),ee("")},L=()=>{G(O),A(1)},$=()=>{ee(""),G(""),A(1)},_e=async(U,V)=>{try{ge(!0),ve(!0);const xe=await ek(U,V);me(xe)}catch(xe){console.error("ๅŠ ่ฝฝ่ฎกๅˆ’่ฏฆๆƒ…ๅคฑ่ดฅ:",xe)}finally{ge(!1)}},je=U=>{H(Number(U)),A(1)},Se=()=>{const U=parseInt(E),V=v?Math.ceil(v.total/v.page_size):0;!isNaN(U)&&U>=1&&U<=V&&(A(U),C(""))},K=v?Math.ceil(v.total/v.page_size):0;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-4",children:i==="overview"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"่Šๅคฉๆ•ฐ้‡"}),e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_chats||0})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"่ฎกๅˆ’ๆ€ปๆ•ฐ"}),e.jsx(Pm,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_plans||0})})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่Šๅคฉๅˆ—่กจ"}),e.jsx(As,{children:"็‚นๅ‡ปๆŸฅ็œ‹่ฏฅ่Šๅคฉ็š„ๆ‰€ๆœ‰่ฎกๅˆ’่ฎฐๅฝ•"})]}),e.jsx(Re,{children:g?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):f?.chats&&f.chats.length>0?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:f.chats.map(U=>e.jsxs("div",{className:"border rounded-lg p-4 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>Q(U),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm truncate max-w-[180px]",title:h(U.chat_id),children:h(U.chat_id)})]}),e.jsx(ke,{variant:"secondary",children:U.plan_count})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ๆœ€ๅŽๆดปๅŠจ: ",kv(U.latest_timestamp)]})]},U.chat_id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ่Šๅคฉ่ฎฐๅฝ•"})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:I,children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"่ฟ”ๅ›ž่Šๅคฉๅˆ—่กจ"]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉ: ",e.jsx("span",{className:"font-medium",children:u?h(u.chat_id):""}),e.jsx("span",{className:"mx-2",children:"โ€ข"}),"ๅ…ฑ ",v?.total||0," ๆก่ฎกๅˆ’่ฎฐๅฝ•"]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(He,{children:"่ฎกๅˆ’ๆ‰ง่กŒ่ฎฐๅฝ•"}),e.jsx(As,{children:u?h(u.chat_id):""})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ne,{placeholder:"ๆœ็ดขๆ็คบ่ฏๅ†…ๅฎน...",value:O,onChange:U=>ee(U.target.value),onKeyDown:U=>U.key==="Enter"&&L(),className:"w-48"}),e.jsx(S,{variant:"outline",size:"icon",onClick:L,children:e.jsx(Ot,{className:"h-4 w-4"})}),M&&e.jsx(S,{variant:"ghost",size:"sm",onClick:$,children:"ๆธ…้™ค"})]}),e.jsxs(Be,{value:_.toString(),onValueChange:je,children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10ๆก/้กต"}),e.jsx(W,{value:"20",children:"20ๆก/้กต"}),e.jsx(W,{value:"50",children:"50ๆก/้กต"}),e.jsx(W,{value:"100",children:"100ๆก/้กต"})]})]})]})]}),M&&e.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:["ๆœ็ดขๅ…ณ้”ฎ่ฏ: ",e.jsxs("span",{className:"font-medium",children:['"',M,'"']})]})]}),e.jsx(Re,{children:w?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-20 w-full"},V))}):v?.data&&v.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-2",children:v.data.map(U=>e.jsxs("div",{className:"border rounded-lg p-3 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>_e(U.chat_id,U.filename),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:Bo(U.timestamp)}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs(ke,{variant:"secondary",className:"text-xs",children:[U.action_count," ไธชๅŠจไฝœ"]}),e.jsxs(ke,{variant:"outline",className:"text-xs",children:[U.total_plan_ms.toFixed(0),"ms"]})]})]}),U.action_types&&U.action_types.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:U.action_types.map((V,xe)=>e.jsx(ke,{variant:"outline",className:"text-xs bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-800",children:V},xe))}),e.jsx("p",{className:"text-sm line-clamp-2",children:U.reasoning_preview||"ๆ— ๆŽจ็†ๅ†…ๅฎน"})]},U.filename))}),e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅ…ฑ ",v.total," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",D," / ",K," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(1),disabled:D===1,children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.max(1,U-1)),disabled:D===1,children:e.jsx(Fa,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{type:"number",min:1,max:K,value:E,onChange:U=>C(U.target.value),onKeyDown:U=>U.key==="Enter"&&Se(),placeholder:"่ทณ่ฝฌ",className:"w-20 h-8"}),e.jsx(S,{size:"sm",variant:"outline",onClick:Se,children:"่ทณ่ฝฌ"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.min(K,U+1)),disabled:D===K,children:e.jsx(sa,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(K),disabled:D===K,children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ่ฎกๅˆ’่ฎฐๅฝ•"})})]})]})}),e.jsx(Ps,{open:ce,onOpenChange:ve,children:e.jsxs(Us,{className:"max-w-4xl max-h-[80vh] grid grid-rows-[auto_1fr_auto] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"h-5 w-5"}),"่ฎกๅˆ’ๆ‰ง่กŒ่ฏฆๆƒ…"]}),e.jsx(Ys,{children:"ๆŸฅ็œ‹้บฆ้บฆ็š„่ฏฆ็ป†่ฎกๅˆ’ๆŽจ็†่ฟ‡็จ‹ๅ’Œๆ‰ง่กŒๅŠจไฝœ"})]}),e.jsx(Je,{className:"h-full pr-4",children:e.jsx("div",{className:"space-y-6 pb-4",children:se?e.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):R?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ya,{className:"h-4 w-4"}),"ๅŸบๆœฌไฟกๆฏ"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-muted/50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"่Šๅคฉ"}),e.jsx("div",{className:"text-sm",title:R.chat_id,children:h(R.chat_id)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๆ—ถ้—ดๆˆณ"}),e.jsx("div",{className:"text-sm",children:Bo(R.timestamp)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"็ฑปๅž‹"}),e.jsx(ke,{variant:"outline",children:R.type})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๅŠจไฝœๆ•ฐ้‡"}),e.jsxs(ke,{children:[R.actions.length," ไธชๅŠจไฝœ"]})]})]})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(El,{className:"h-4 w-4"}),"ๆ€ง่ƒฝ็ปŸ่ฎก"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ็คบ่ฏๆž„ๅปบ"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.prompt_build_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"LLM ๆŽจ็†"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.llm_duration_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ€ป่ฎกๅˆ’ๆ—ถ้—ด"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.total_plan_ms?.toFixed(2)||0,"ms"]})})]})]})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Aj,{className:"h-4 w-4"}),"ๆŽจ็†่ฟ‡็จ‹"]}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:R.reasoning||"ๆ— ๆŽจ็†ๅ†…ๅฎน"})})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(s1,{className:"h-4 w-4"}),"ๆ‰ง่กŒๅŠจไฝœ (",R.actions.length,")"]}),e.jsx("div",{className:"space-y-3",children:R.actions.map((U,V)=>e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-3",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ke,{variant:"default",children:["ๅŠจไฝœ ",V+1]}),e.jsx(ke,{variant:"outline",children:U.action_type})]})})}),e.jsxs(Re,{className:"p-4 pt-0 space-y-3",children:[U.reasoning&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๆŽจ็†ไพๆฎ"}),e.jsx("p",{className:"text-sm bg-muted/30 p-2 rounded",children:typeof U.reasoning=="string"?U.reasoning:JSON.stringify(U.reasoning)})]}),U.action_message&&e.jsxs("div",{className:"overflow-hidden",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๅŠจไฝœๆถˆๆฏ"}),typeof U.action_message=="string"?e.jsx("p",{className:"text-sm bg-muted/30 p-2 rounded break-all whitespace-pre-wrap",children:U.action_message}):e.jsx("pre",{className:"text-xs bg-muted/30 p-2 rounded overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify(U.action_message,null,2)})]}),U.action_data&&Object.keys(U.action_data).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๅŠจไฝœๆ•ฐๆฎ"}),e.jsx("pre",{className:"text-xs bg-muted/30 p-2 rounded overflow-x-auto",children:JSON.stringify(U.action_data,null,2)})]}),U.action_reasoning&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"ๅŠจไฝœๆŽจ็†"}),e.jsx("p",{className:"text-sm bg-muted/30 p-2 rounded",children:typeof U.action_reasoning=="string"?U.action_reasoning:JSON.stringify(U.action_reasoning)})]})]})]},V))})]}),e.jsx(Qt,{}),R.raw_output&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅŽŸๅง‹่พ“ๅ‡บ"}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"็‚นๅ‡ปๅฑ•ๅผ€ๆŸฅ็œ‹ๅฎŒๆ•ดๅŽŸๅง‹่พ“ๅ‡บ"}),e.jsx("div",{className:"mt-2 p-4 bg-muted/50 rounded-lg",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:R.raw_output})})]})]}),R.prompt&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"็‚นๅ‡ปๅฑ•ๅผ€ๆŸฅ็œ‹ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsx("div",{className:"mt-2 p-4 bg-muted/50 rounded-lg",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:R.prompt})})]})]})]}):e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"ๆ— ๆ•ฐๆฎ"})})})}),e.jsx(et,{className:"flex-shrink-0",children:e.jsx(S,{onClick:()=>ve(!1),children:"ๅ…ณ้—ญ"})})]})})]})}function nk({autoRefresh:l,refreshKey:n}){const[i,c]=m.useState("overview"),[u,x]=m.useState(null),{getChatName:h}=Sv(),[f,p]=m.useState(null),[g,N]=m.useState(!0),[v,y]=m.useState(null),[w,b]=m.useState(!1),[D,A]=m.useState(1),[_,H]=m.useState(20),[E,C]=m.useState(""),[M,G]=m.useState(""),[O,ee]=m.useState(""),[R,me]=m.useState(null),[ce,ve]=m.useState(!1),[se,ge]=m.useState(!1),fe=m.useCallback(async()=>{try{N(!0);const U=await sk();p(U)}catch(U){console.error("ๅŠ ่ฝฝๅ›žๅคๅ™จๆ€ป่งˆๅคฑ่ดฅ:",U)}finally{N(!1)}},[]),z=m.useCallback(async()=>{if(u)try{b(!0);const U=await tk(u.chat_id,D,_,M||void 0);y(U)}catch(U){console.error("ๅŠ ่ฝฝ่Šๅคฉๆ—ฅๅฟ—ๅคฑ่ดฅ:",U)}finally{b(!1)}},[u,D,_,M]);m.useEffect(()=>{fe()},[fe]),m.useEffect(()=>{n>0&&(i==="overview"?fe():z())},[n,i,fe,z]),m.useEffect(()=>{i==="chat-logs"&&u&&z()},[i,u,z]),Cv(l,m.useCallback(()=>{i==="overview"?fe():z()},[i,fe,z]));const Q=U=>{x(U),A(1),G(""),ee(""),c("chat-logs")},I=()=>{c("overview"),x(null),y(null),G(""),ee("")},L=()=>{G(O),A(1)},$=()=>{ee(""),G(""),A(1)},_e=async(U,V)=>{try{ge(!0),ve(!0);const xe=await ak(U,V);me(xe)}catch(xe){console.error("ๅŠ ่ฝฝๅ›žๅค่ฏฆๆƒ…ๅคฑ่ดฅ:",xe)}finally{ge(!1)}},je=U=>{H(Number(U)),A(1)},Se=()=>{const U=parseInt(E),V=v?Math.ceil(v.total/v.page_size):0;!isNaN(U)&&U>=1&&U<=V&&(A(U),C(""))},K=v?Math.ceil(v.total/v.page_size):0;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-4",children:i==="overview"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"่Šๅคฉๆ•ฐ้‡"}),e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_chats||0})})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅ›žๅคๆ€ปๆ•ฐ"}),e.jsx(Pm,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(Re,{children:g?e.jsx(_s,{className:"h-8 w-16"}):e.jsx("div",{className:"text-2xl font-bold",children:f?.total_replies||0})})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"่Šๅคฉๅˆ—่กจ"}),e.jsx(As,{children:"็‚นๅ‡ปๆŸฅ็œ‹่ฏฅ่Šๅคฉ็š„ๆ‰€ๆœ‰ๅ›žๅค่ฎฐๅฝ•"})]}),e.jsx(Re,{children:g?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):f?.chats&&f.chats.length>0?e.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:f.chats.map(U=>e.jsxs("div",{className:"border rounded-lg p-4 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>Q(U),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pa,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm truncate max-w-[180px]",title:h(U.chat_id),children:h(U.chat_id)})]}),e.jsx(ke,{variant:"secondary",children:U.reply_count})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ๆœ€ๅŽๆดปๅŠจ: ",kv(U.latest_timestamp)]})]},U.chat_id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ่Šๅคฉ่ฎฐๅฝ•"})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:I,children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"่ฟ”ๅ›ž่Šๅคฉๅˆ—่กจ"]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅฝ“ๅ‰่Šๅคฉ: ",e.jsx("span",{className:"font-medium",children:u?h(u.chat_id):""}),e.jsx("span",{className:"mx-2",children:"โ€ข"}),"ๅ…ฑ ",v?.total||0," ๆกๅ›žๅค่ฎฐๅฝ•"]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(He,{children:"ๅ›žๅค็”Ÿๆˆ่ฎฐๅฝ•"}),e.jsx(As,{children:u?h(u.chat_id):""})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ne,{placeholder:"ๆœ็ดขๆ็คบ่ฏๅ†…ๅฎน...",value:O,onChange:U=>ee(U.target.value),onKeyDown:U=>U.key==="Enter"&&L(),className:"w-48"}),e.jsx(S,{variant:"outline",size:"icon",onClick:L,children:e.jsx(Ot,{className:"h-4 w-4"})}),M&&e.jsx(S,{variant:"ghost",size:"sm",onClick:$,children:"ๆธ…้™ค"})]}),e.jsxs(Be,{value:_.toString(),onValueChange:je,children:[e.jsx(Le,{className:"w-32",children:e.jsx($e,{})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"10",children:"10ๆก/้กต"}),e.jsx(W,{value:"20",children:"20ๆก/้กต"}),e.jsx(W,{value:"50",children:"50ๆก/้กต"}),e.jsx(W,{value:"100",children:"100ๆก/้กต"})]})]})]})]}),M&&e.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:["ๆœ็ดขๅ…ณ้”ฎ่ฏ: ",e.jsxs("span",{className:"font-medium",children:['"',M,'"']})]})]}),e.jsx(Re,{children:w?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-20 w-full"},V))}):v?.data&&v.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-2",children:v.data.map(U=>e.jsxs("div",{className:"border rounded-lg p-3 hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>_e(U.chat_id,U.filename),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:Bo(U.timestamp)}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[U.success?e.jsxs(ke,{variant:"default",className:"text-xs bg-green-600",children:[e.jsx(eg,{className:"h-3 w-3 mr-1"}),"ๆˆๅŠŸ"]}):e.jsxs(ke,{variant:"destructive",className:"text-xs",children:[e.jsx(Ki,{className:"h-3 w-3 mr-1"}),"ๅคฑ่ดฅ"]}),e.jsx(ke,{variant:"outline",className:"text-xs",children:U.model}),e.jsxs(ke,{variant:"secondary",className:"text-xs",children:[U.overall_ms.toFixed(0),"ms"]})]})]}),e.jsx("p",{className:"text-sm line-clamp-2",children:U.output_preview||"ๆ— ่พ“ๅ‡บๅ†…ๅฎน"})]},U.filename))}),e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅ…ฑ ",v.total," ๆก่ฎฐๅฝ•๏ผŒ็ฌฌ ",D," / ",K," ้กต"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(1),disabled:D===1,children:e.jsx(xn,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.max(1,U-1)),disabled:D===1,children:e.jsx(Fa,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{type:"number",min:1,max:K,value:E,onChange:U=>C(U.target.value),onKeyDown:U=>U.key==="Enter"&&Se(),placeholder:"่ทณ่ฝฌ",className:"w-20 h-8"}),e.jsx(S,{size:"sm",variant:"outline",onClick:Se,children:"่ทณ่ฝฌ"})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(U=>Math.min(K,U+1)),disabled:D===K,children:e.jsx(sa,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>A(K),disabled:D===K,children:e.jsx(hn,{className:"h-4 w-4"})})]})]})]}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"ๆš‚ๆ— ๅ›žๅค่ฎฐๅฝ•"})})]})]})}),e.jsx(Ps,{open:ce,onOpenChange:ve,children:e.jsxs(Us,{className:"max-w-4xl max-h-[80vh] grid grid-rows-[auto_1fr_auto] overflow-hidden",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(Sa,{className:"h-5 w-5"}),"ๅ›žๅค็”Ÿๆˆ่ฏฆๆƒ…"]}),e.jsx(Ys,{children:"ๆŸฅ็œ‹้บฆ้บฆ็š„่ฏฆ็ป†ๅ›žๅค็”Ÿๆˆ่ฟ‡็จ‹"})]}),e.jsx(Je,{className:"h-full pr-4",children:e.jsx("div",{className:"space-y-6 pb-4",children:se?e.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,V)=>e.jsx(_s,{className:"h-24 w-full"},V))}):R?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ya,{className:"h-4 w-4"}),"ๅŸบๆœฌไฟกๆฏ"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-muted/50 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"่Šๅคฉ"}),e.jsx("div",{className:"text-sm",title:R.chat_id,children:h(R.chat_id)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๆ—ถ้—ดๆˆณ"}),e.jsx("div",{className:"text-sm",children:Bo(R.timestamp)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"็Šถๆ€"}),R.success?e.jsxs(ke,{variant:"default",className:"bg-green-600",children:[e.jsx(eg,{className:"h-3 w-3 mr-1"}),"ๆˆๅŠŸ"]}):e.jsxs(ke,{variant:"destructive",children:[e.jsx(Ki,{className:"h-3 w-3 mr-1"}),"ๅคฑ่ดฅ"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"ๆ€่€ƒๆทฑๅบฆ"}),e.jsxs(ke,{variant:"outline",children:["Level ",R.think_level]})]})]})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(t1,{className:"h-4 w-4"}),"ๆจกๅž‹ไฟกๆฏ"]}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx(ke,{variant:"secondary",className:"text-sm",children:R.model})})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(El,{className:"h-4 w-4"}),"ๆ€ง่ƒฝ็ปŸ่ฎก"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ็คบ่ฏๆž„ๅปบ"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.prompt_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"LLM ๆŽจ็†"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.llm_ms?.toFixed(2)||0,"ms"]})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{className:"p-4 pb-2",children:e.jsx(He,{className:"text-xs text-muted-foreground",children:"ๆ€ป่€—ๆ—ถ"})}),e.jsx(Re,{className:"p-4 pt-0",children:e.jsxs("div",{className:"text-xl font-bold",children:[R.timing.overall_ms?.toFixed(2)||0,"ms"]})})]})]}),R.timing.timing_logs&&R.timing.timing_logs.length>0&&e.jsxs("div",{className:"mt-3 p-3 bg-muted/30 rounded-lg",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"่€—ๆ—ถ่ฏฆๆƒ…"}),e.jsx("div",{className:"space-y-1",children:R.timing.timing_logs.map((U,V)=>e.jsx("div",{className:"text-xs text-muted-foreground",children:U},V))})]}),R.timing.almost_zero&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"่ฟ‘ไนŽ้›ถ่€—ๆ—ถ: "}),R.timing.almost_zero]})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Aj,{className:"h-4 w-4"}),"ๅ›žๅค่พ“ๅ‡บ"]}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:R.output||"ๆ— ่พ“ๅ‡บๅ†…ๅฎน"})})]}),R.processed_output&&R.processed_output.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅค„็†ๅŽ็š„่พ“ๅ‡บ"}),e.jsx("div",{className:"space-y-2",children:R.processed_output.map((U,V)=>e.jsx("div",{className:"p-3 bg-muted/30 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:U})},V))})]})]}),R.reasoning&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๆŽจ็†่ฟ‡็จ‹"}),e.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:R.reasoning})})]})]}),R.error&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-destructive",children:"้”™่ฏฏไฟกๆฏ"}),e.jsx("div",{className:"p-4 bg-destructive/10 rounded-lg border border-destructive/20",children:e.jsx("p",{className:"text-sm text-destructive whitespace-pre-wrap",children:R.error})})]})]}),R.prompt&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"็‚นๅ‡ปๅฑ•ๅผ€ๆŸฅ็œ‹ๅฎŒๆ•ดๆ็คบ่ฏ"}),e.jsx("div",{className:"mt-2 p-4 bg-muted/50 rounded-lg",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:R.prompt})})]})]})]})]}):e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:"ๆ— ๆ•ฐๆฎ"})})})}),e.jsx(et,{className:"flex-shrink-0",children:e.jsx(S,{onClick:()=>ve(!1),children:"ๅ…ณ้—ญ"})})]})})]})}function rk(){const[l,n]=m.useState("planner"),[i,c]=m.useState(!1),[u,x]=m.useState(0),h=m.useCallback(()=>{x(f=>f+1)},[]);return 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 items-center gap-2",children:[e.jsxs(S,{variant:i?"default":"outline",size:"sm",onClick:()=>c(!i),children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),i?"่‡ชๅŠจๅˆทๆ–ฐไธญ":"่‡ชๅŠจๅˆทๆ–ฐ"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:h,children:e.jsx(ft,{className:"h-4 w-4"})})]})]}),e.jsxs(ra,{value:l,onValueChange:f=>n(f),className:"w-full",children:[e.jsxs(ea,{className:"grid w-full grid-cols-2 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(ts,{value:"planner",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Im,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"่ฎกๅˆ’ๅ™จ็›‘ๆŽง"})]}),e.jsxs(ts,{value:"replier",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(a1,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"ๅ›žๅคๅ™จ็›‘ๆŽง"})]})]}),e.jsxs(Je,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(bs,{value:"planner",className:"mt-0",children:e.jsx(lk,{autoRefresh:i,refreshKey:u})}),e.jsx(bs,{value:"replier",className:"mt-0",children:e.jsx(nk,{autoRefresh:i,refreshKey:u})})]})]})]})}const ik="Mai-with-u",ck="plugin-repo",ok="main",dk="plugin_details.json";async function uk(){try{const l=await we("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:ik,repo:ck,branch:ok,file_path:dk})});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const n=await l.json();if(!n.success||!n.data)throw new Error(n.error||"่Žทๅ–ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");return JSON.parse(n.data).filter(u=>!u?.id||!u?.manifest?(console.warn("่ทณ่ฟ‡ๆ— ๆ•ˆๆ’ไปถๆ•ฐๆฎ:",u),!1):!u.manifest.name||!u.manifest.version?(console.warn("่ทณ่ฟ‡็ผบๅฐ‘ๅฟ…้œ€ๅญ—ๆฎต็š„ๆ’ไปถ:",u.id),!1):!0).map(u=>({id:u.id,manifest:{manifest_version:u.manifest.manifest_version||1,name:u.manifest.name,version:u.manifest.version,description:u.manifest.description||"",author:u.manifest.author||{name:"Unknown"},license:u.manifest.license||"Unknown",host_application:u.manifest.host_application||{min_version:"0.0.0"},homepage_url:u.manifest.homepage_url,repository_url:u.manifest.repository_url,keywords:u.manifest.keywords||[],categories:u.manifest.categories||[],default_locale:u.manifest.default_locale||"zh-CN",locales_path:u.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(l){throw console.error("Failed to fetch plugin list:",l),l}}async function Tv(){try{const l=await we("/api/webui/plugins/git-status");if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return await l.json()}catch(l){return console.error("Failed to check Git status:",l),{installed:!1,error:"ๆ— ๆณ•ๆฃ€ๆต‹ Git ๅฎ‰่ฃ…็Šถๆ€"}}}async function Ev(){try{const l=await we("/api/webui/plugins/version");if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return await l.json()}catch(l){return console.error("Failed to get Maimai version:",l),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function Mv(l,n,i){const c=l.split(".").map(f=>parseInt(f)||0),u=c[0]||0,x=c[1]||0,h=c[2]||0;if(i.version_majorparseInt(v)||0),p=f[0]||0,g=f[1]||0,N=f[2]||0;if(i.version_major>p||i.version_major===p&&i.version_minor>g||i.version_major===p&&i.version_minor===g&&i.version_patch>N)return!1}return!0}async function mk(){try{const l=await we("/api/webui/ws-token");if(!l.ok)return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",l.status),null;const n=await l.json();return n.success&&n.token?n.token:null}catch(l){return console.error("่Žทๅ– WebSocket token ๅคฑ่ดฅ:",l),null}}async function xk(l,n){const i=await mk();if(!i)return console.warn("ๆ— ๆณ•่Žทๅ– WebSocket token๏ผŒๅฏ่ƒฝๆœช็™ปๅฝ•"),null;const c=window.location.protocol==="https:"?"wss:":"ws:",u=window.location.host,x=`${c}//${u}/api/webui/ws/plugin-progress?token=${encodeURIComponent(i)}`;try{const h=new WebSocket(x);return h.onopen=()=>{console.log("Plugin progress WebSocket connected");const f=setInterval(()=>{h.readyState===WebSocket.OPEN?h.send("ping"):clearInterval(f)},3e4)},h.onmessage=f=>{try{if(f.data==="pong")return;const p=JSON.parse(f.data);l(p)}catch(p){console.error("Failed to parse progress data:",p)}},h.onerror=f=>{console.error("Plugin progress WebSocket error:",f),n?.(f)},h.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},h}catch(h){return console.error("ๅˆ›ๅปบ WebSocket ่ฟžๆŽฅๅคฑ่ดฅ:",h),null}}async function Tl(){try{const l=await we("/api/webui/plugins/installed",{headers:Fs()});if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);const n=await l.json();if(!n.success)throw new Error(n.message||"่Žทๅ–ๅทฒๅฎ‰่ฃ…ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");return n.plugins||[]}catch(l){return console.error("Failed to get installed plugins:",l),[]}}function on(l,n){return n.some(i=>i.id===l)}function dn(l,n){const i=n.find(c=>c.id===l);if(i)return i.manifest?.version||i.version}async function Av(l,n,i="main"){const c=await we("/api/webui/plugins/install",{method:"POST",body:JSON.stringify({plugin_id:l,repository_url:n,branch:i})});if(!c.ok){const u=await c.json();throw new Error(u.detail||"ๅฎ‰่ฃ…ๅคฑ่ดฅ")}return await c.json()}async function zv(l){const n=await we("/api/webui/plugins/uninstall",{method:"POST",body:JSON.stringify({plugin_id:l})});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅธ่ฝฝๅคฑ่ดฅ")}return await n.json()}async function Dv(l,n,i="main"){const c=await we("/api/webui/plugins/update",{method:"POST",body:JSON.stringify({plugin_id:l,repository_url:n,branch:i})});if(!c.ok){const u=await c.json();throw new Error(u.detail||"ๆ›ดๆ–ฐๅคฑ่ดฅ")}return await c.json()}async function hk(l){const n=await we(`/api/webui/plugins/config/${l}/schema`,{headers:Fs()});if(!n.ok){const c=await n.text();try{const u=JSON.parse(c);throw new Error(u.detail||"่Žทๅ–้…็ฝฎ Schema ๅคฑ่ดฅ")}catch{throw new Error(`่Žทๅ–้…็ฝฎ Schema ๅคฑ่ดฅ (${n.status})`)}}const i=await n.json();if(!i.success)throw new Error(i.message||"่Žทๅ–้…็ฝฎ Schema ๅคฑ่ดฅ");return i.schema}async function fk(l){const n=await we(`/api/webui/plugins/config/${l}`,{headers:Fs()});if(!n.ok){const c=await n.text();try{const u=JSON.parse(c);throw new Error(u.detail||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ")}catch{throw new Error(`่Žทๅ–้…็ฝฎๅคฑ่ดฅ (${n.status})`)}}const i=await n.json();if(!i.success)throw new Error(i.message||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ");return i.config}async function pk(l){const n=await we(`/api/webui/plugins/config/${l}/raw`,{headers:Fs()});if(!n.ok){const c=await n.text();try{const u=JSON.parse(c);throw new Error(u.detail||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ")}catch{throw new Error(`่Žทๅ–้…็ฝฎๅคฑ่ดฅ (${n.status})`)}}const i=await n.json();if(!i.success)throw new Error(i.message||"่Žทๅ–้…็ฝฎๅคฑ่ดฅ");return i.config}async function gk(l,n){const i=await we(`/api/webui/plugins/config/${l}`,{method:"PUT",headers:Fs(),body:JSON.stringify({config:n})});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}return await i.json()}async function jk(l,n){const i=await we(`/api/webui/plugins/config/${l}/raw`,{method:"PUT",headers:Fs(),body:JSON.stringify({config:n})});if(!i.ok){const c=await i.json();throw new Error(c.detail||"ไฟๅญ˜้…็ฝฎๅคฑ่ดฅ")}return await i.json()}async function vk(l){const n=await we(`/api/webui/plugins/config/${l}/reset`,{method:"POST",headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"้‡็ฝฎ้…็ฝฎๅคฑ่ดฅ")}return await n.json()}async function Nk(l){const n=await we(`/api/webui/plugins/config/${l}/toggle`,{method:"POST",headers:Fs()});if(!n.ok){const i=await n.json();throw new Error(i.detail||"ๅˆ‡ๆข็Šถๆ€ๅคฑ่ดฅ")}return await n.json()}const lc="https://maibot-plugin-stats.maibot-webui.workers.dev";async function Ov(l){try{const n=await fetch(`${lc}/stats/${l}`);return n.ok?await n.json():(console.error("Failed to fetch plugin stats:",n.statusText),null)}catch(n){return console.error("Error fetching plugin stats:",n),null}}async function bk(l,n){try{const i=n||tx(),c=await fetch(`${lc}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l,user_id:i})}),u=await c.json();return c.status===429?{success:!1,error:"ๆ“ไฝœ่ฟ‡ไบŽ้ข‘็น๏ผŒ่ฏท็จๅŽๅ†่ฏ•"}:c.ok?{success:!0,...u}:{success:!1,error:u.error||"็‚น่ตžๅคฑ่ดฅ"}}catch(i){return console.error("Error liking plugin:",i),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function yk(l,n){try{const i=n||tx(),c=await fetch(`${lc}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l,user_id:i})}),u=await c.json();return c.status===429?{success:!1,error:"ๆ“ไฝœ่ฟ‡ไบŽ้ข‘็น๏ผŒ่ฏท็จๅŽๅ†่ฏ•"}:c.ok?{success:!0,...u}:{success:!1,error:u.error||"็‚น่ธฉๅคฑ่ดฅ"}}catch(i){return console.error("Error disliking plugin:",i),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function wk(l,n,i,c){if(n<1||n>5)return{success:!1,error:"่ฏ„ๅˆ†ๅฟ…้กปๅœจ 1-5 ไน‹้—ด"};try{const u=c||tx(),x=await fetch(`${lc}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l,rating:n,comment:i,user_id:u})}),h=await x.json();return x.status===429?{success:!1,error:"ๆฏๅคฉๆœ€ๅคš่ฏ„ๅˆ† 3 ๆฌก"}:x.ok?{success:!0,...h}:{success:!1,error:h.error||"่ฏ„ๅˆ†ๅคฑ่ดฅ"}}catch(u){return console.error("Error rating plugin:",u),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function Rv(l){try{const n=await fetch(`${lc}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:l})}),i=await n.json();return n.status===429?(console.warn("Download recording rate limited"),{success:!0}):n.ok?{success:!0,...i}:(console.error("Failed to record download:",i.error),{success:!1,error:i.error})}catch(n){return console.error("Error recording download:",n),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}function _k(){const l=navigator,n=[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,l.deviceMemory||0].join("|");let i=0;for(let c=0;c{const te=Y.map(async Me=>{try{const de=await Ov(Me.id);return{id:Me.id,stats:de}}catch(de){return console.warn(`Failed to load stats for ${Me.id}:`,de),{id:Me.id,stats:null}}}),Oe=await Promise.all(te),De={};Oe.forEach(({id:Me,stats:de})=>{de&&(De[Me]=de)}),R(De)};m.useEffect(()=>{let Y=null,te=!1;return(async()=>{if(Y=await xk(De=>{te||(C(De),De.stage==="success"?setTimeout(()=>{te||C(null)},2e3):De.stage==="error"&&(b(!1),A(De.error||"ๅŠ ่ฝฝๅคฑ่ดฅ")))},De=>{console.error("WebSocket error:",De),te||je({title:"WebSocket ่ฟžๆŽฅๅคฑ่ดฅ",description:"ๆ— ๆณ•ๅฎžๆ—ถๆ˜พ็คบๅŠ ่ฝฝ่ฟ›ๅบฆ",variant:"destructive"})}),await new Promise(De=>{if(!Y){De();return}const Me=()=>{Y&&Y.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),De()):Y&&Y.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),De()):setTimeout(Me,100)};Me()}),!te){const De=await Tv();H(De),De.installed||je({title:"Git ๆœชๅฎ‰่ฃ…",description:De.error||"่ฏทๅ…ˆๅฎ‰่ฃ… Git ๆ‰่ƒฝไฝฟ็”จๆ’ไปถๅฎ‰่ฃ…ๅŠŸ่ƒฝ",variant:"destructive"})}if(!te){const De=await Ev();G(De)}if(!te)try{b(!0),A(null);const De=await uk();if(!te){const Me=await Tl();O(Me);const de=De.map(Te=>{const rs=on(Te.id,Me),Rt=dn(Te.id,Me);return{...Te,installed:rs,installed_version:Rt}});for(const Te of Me)!de.some(Rt=>Rt.id===Te.id)&&Te.manifest&&de.push({id:Te.id,manifest:{manifest_version:Te.manifest.manifest_version||1,name:Te.manifest.name,version:Te.manifest.version,description:Te.manifest.description||"",author:Te.manifest.author,license:Te.manifest.license||"Unknown",host_application:Te.manifest.host_application,homepage_url:Te.manifest.homepage_url,repository_url:Te.manifest.repository_url,keywords:Te.manifest.keywords||[],categories:Te.manifest.categories||[],default_locale:Te.manifest.default_locale||"zh-CN",locales_path:Te.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:Te.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});y(de),Se(de)}}catch(De){if(!te){const Me=De instanceof Error?De.message:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจๅคฑ่ดฅ";A(Me),je({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:Me,variant:"destructive"})}}finally{te||b(!1)}})(),()=>{te=!0,Y&&Y.close()}},[je]);const K=Y=>{if(!Y.installed&&M&&!U(Y))return e.jsxs(ke,{variant:"destructive",className:"gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),"ไธๅ…ผๅฎน"]});if(Y.installed){const te=Y.installed_version?.trim(),Oe=Y.manifest.version?.trim();if(te!==Oe){const De=te?.split(".").map(Number)||[0,0,0],Me=Oe?.split(".").map(Number)||[0,0,0];for(let de=0;de<3;de++){if((Me[de]||0)>(De[de]||0))return e.jsxs(ke,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[e.jsx(St,{className:"h-3 w-3"}),"ๅฏๆ›ดๆ–ฐ"]});if((Me[de]||0)<(De[de]||0))break}}return e.jsxs(ke,{variant:"default",className:"gap-1",children:[e.jsx(Wt,{className:"h-3 w-3"}),"ๅทฒๅฎ‰่ฃ…"]})}return null},U=Y=>!M||!Y.manifest?.host_application?!0:Mv(Y.manifest.host_application.min_version,Y.manifest.host_application.max_version,M),V=Y=>{if(!Y.installed||!Y.installed_version||!Y.manifest?.version)return!1;const te=Y.installed_version.trim(),Oe=Y.manifest.version.trim();if(te===Oe)return!1;const De=te.split(".").map(Number),Me=Oe.split(".").map(Number);for(let de=0;de<3;de++){if((Me[de]||0)>(De[de]||0))return!0;if((Me[de]||0)<(De[de]||0))return!1}return!1},xe=v.filter(Y=>{if(!Y.manifest)return console.warn("[่ฟ‡ๆปค] ่ทณ่ฟ‡ๆ—  manifest ็š„ๆ’ไปถ:",Y.id),!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(de=>de.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x);let De=!0;f==="installed"?De=Y.installed===!0:f==="updates"&&(De=Y.installed===!0&&V(Y));const Me=!g||!M||U(Y);return te&&Oe&&De&&Me}),Ae=Y=>{if(!_?.installed){je({title:"ๆ— ๆณ•ๅฎ‰่ฃ…",description:"Git ๆœชๅฎ‰่ฃ…",variant:"destructive"});return}if(M&&!U(Y)){je({title:"ๆ— ๆณ•ๅฎ‰่ฃ…",description:"ๆ’ไปถไธŽๅฝ“ๅ‰้บฆ้บฆ็‰ˆๆœฌไธๅ…ผๅฎน",variant:"destructive"});return}se(Y),fe("main"),Q(""),L("preset"),_e(!1),ce(!0)},X=async()=>{if(!ve)return;const Y=I==="custom"?z:ge;if(!Y||Y.trim()===""){je({title:"ๅˆ†ๆ”ฏๅ็งฐไธ่ƒฝไธบ็ฉบ",variant:"destructive"});return}try{ce(!1),await Av(ve.id,ve.manifest.repository_url||"",Y),Rv(ve.id).catch(Oe=>{console.warn("Failed to record download:",Oe)}),je({title:"ๅฎ‰่ฃ…ๆˆๅŠŸ",description:`${ve.manifest.name} ๅทฒๆˆๅŠŸๅฎ‰่ฃ…`});const te=await Tl();O(te),y(Oe=>Oe.map(De=>{if(De.id===ve.id){const Me=on(De.id,te),de=dn(De.id,te);return{...De,installed:Me,installed_version:de}}return De}))}catch(te){je({title:"ๅฎ‰่ฃ…ๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{se(null)}},oe=async Y=>{try{await zv(Y.id),je({title:"ๅธ่ฝฝๆˆๅŠŸ",description:`${Y.manifest.name} ๅทฒๆˆๅŠŸๅธ่ฝฝ`});const te=await Tl();O(te),y(Oe=>Oe.map(De=>{if(De.id===Y.id){const Me=on(De.id,te),de=dn(De.id,te);return{...De,installed:Me,installed_version:de}}return De}))}catch(te){je({title:"ๅธ่ฝฝๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},Ge=async Y=>{if(!_?.installed){je({title:"ๆ— ๆณ•ๆ›ดๆ–ฐ",description:"Git ๆœชๅฎ‰่ฃ…",variant:"destructive"});return}try{const te=await Dv(Y.id,Y.manifest.repository_url||"","main");je({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:`${Y.manifest.name} ๅทฒไปŽ ${te.old_version} ๆ›ดๆ–ฐๅˆฐ ${te.new_version}`});const Oe=await Tl();O(Oe),y(De=>De.map(Me=>{if(Me.id===Y.id){const de=on(Me.id,Oe),Te=dn(Me.id,Oe);return{...Me,installed:de,installed_version:Te}}return Me}))}catch(te){je({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:te instanceof Error?te.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}};return e.jsx(Je,{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("div",{className:"flex gap-2",children:[e.jsxs(S,{variant:"outline",onClick:()=>n(),disabled:i,children:[e.jsx(zj,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"้‡ๅฏ้บฆ้บฆ"]}),e.jsxs(S,{onClick:()=>l({to:"/plugin-mirrors"}),children:[e.jsx(l1,{className:"h-4 w-4 mr-2"}),"้…็ฝฎ้•œๅƒๆบ"]})]})]}),e.jsx(Ce,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:e.jsx(Re,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pt,{className:"h-4 w-4 text-blue-600 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["ๅฎ‰่ฃ…ใ€ๅธ่ฝฝๆˆ–ๆ›ดๆ–ฐๆ’ไปถๅŽ๏ผŒ้œ€่ฆ",e.jsx("span",{className:"font-semibold",children:"้‡ๅฏ้บฆ้บฆ"}),"ๆ‰่ƒฝไฝฟๆ›ดๆ”น็”Ÿๆ•ˆ"]})]})})}),_&&!_.installed&&e.jsxs(Ce,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[e.jsx(Pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Yt,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(He,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git ๆœชๅฎ‰่ฃ…"}),e.jsx(As,{className:"text-orange-800 dark:text-orange-200",children:_.error||"่ฏทๅ…ˆๅฎ‰่ฃ… Git ๆ‰่ƒฝไฝฟ็”จๆ’ไปถๅฎ‰่ฃ…ๅŠŸ่ƒฝ"})]})]})}),e.jsx(Re,{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(Ce,{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(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆ’ไปถ...",value:c,onChange:Y=>u(Y.target.value),className:"pl-9"})]}),e.jsxs(Be,{value:x,onValueChange:h,children:[e.jsx(Le,{className:"w-full sm:w-[200px]",children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅˆ†็ฑป"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"all",children:"ๅ…จ้ƒจๅˆ†็ฑป"}),e.jsx(W,{value:"Group Management",children:"็พค็ป„็ฎก็†"}),e.jsx(W,{value:"Entertainment & Interaction",children:"ๅจฑไนไบ’ๅŠจ"}),e.jsx(W,{value:"Utility Tools",children:"ๅฎž็”จๅทฅๅ…ท"}),e.jsx(W,{value:"Content Generation",children:"ๅ†…ๅฎน็”Ÿๆˆ"}),e.jsx(W,{value:"Multimedia",children:"ๅคšๅช’ไฝ“"}),e.jsx(W,{value:"External Integration",children:"ๅค–้ƒจ้›†ๆˆ"}),e.jsx(W,{value:"Data Analysis & Insights",children:"ๆ•ฐๆฎๅˆ†ๆžไธŽๆดžๅฏŸ"}),e.jsx(W,{value:"Other",children:"ๅ…ถไป–"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"compatible-only",checked:g,onCheckedChange:Y=>N(Y===!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(ra,{value:f,onValueChange:p,className:"w-full",children:e.jsxs(ea,{className:"grid w-full grid-cols-3",children:[e.jsxs(ts,{value:"all",children:["ๅ…จ้ƒจๆ’ไปถ (",v.filter(Y=>{if(!Y.manifest)return!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(Me=>Me.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x),De=!g||!M||U(Y);return te&&Oe&&De}).length,")"]}),e.jsxs(ts,{value:"installed",children:["ๅทฒๅฎ‰่ฃ… (",v.filter(Y=>{if(!Y.manifest)return!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(Me=>Me.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x),De=!g||!M||U(Y);return Y.installed&&te&&Oe&&De}).length,")"]}),e.jsxs(ts,{value:"updates",children:["ๅฏๆ›ดๆ–ฐ (",v.filter(Y=>{if(!Y.manifest)return!1;const te=c===""||Y.manifest.name?.toLowerCase().includes(c.toLowerCase())||Y.manifest.description?.toLowerCase().includes(c.toLowerCase())||Y.manifest.keywords&&Y.manifest.keywords.some(Me=>Me.toLowerCase().includes(c.toLowerCase())),Oe=x==="all"||Y.manifest.categories&&Y.manifest.categories.includes(x),De=!g||!M||U(Y);return Y.installed&&V(Y)&&te&&Oe&&De}).length,")"]})]})}),E&&E.stage==="loading"&&E.operation==="fetch"&&e.jsx(Ce,{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(Ls,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{className:"text-sm font-medium",children:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจ"})]}),e.jsxs("span",{className:"text-sm font-medium",children:[E.progress,"%"]})]}),e.jsx(Fn,{value:E.progress,className:"h-2"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:E.message}),E.total_plugins>0&&e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["ๅทฒๅŠ ่ฝฝ ",E.loaded_plugins," / ",E.total_plugins," ไธชๆ’ไปถ"]})]})}),E&&E.stage==="error"&&E.error&&e.jsx(Ce,{className:"border-destructive bg-destructive/10",children:e.jsx(Pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Yt,{className:"h-5 w-5 text-destructive"}),e.jsxs("div",{children:[e.jsx(He,{className:"text-lg text-destructive",children:"ๅŠ ่ฝฝๅคฑ่ดฅ"}),e.jsx(As,{className:"text-destructive/80",children:E.error})]})]})})}),w?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจไธญ..."})]}):D?e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Yt,{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:D}),e.jsx(S,{onClick:()=>window.location.reload(),children:"้‡ๆ–ฐๅŠ ่ฝฝ"})]})}):xe.length===0?e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Ot,{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:c||x!=="all"?"ๅฐ่ฏ•่ฐƒๆ•ดๆœ็ดขๆกไปถๆˆ–็ญ›้€‰ๅ™จ":"ๆš‚ๆ— ๅฏ็”จๆ’ไปถ"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:xe.map(Y=>e.jsxs(Ce,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[e.jsxs(Pe,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(He,{className:"text-xl",children:Y.manifest?.name||Y.id}),e.jsxs("div",{className:"flex flex-col gap-1",children:[Y.manifest?.categories&&Y.manifest.categories[0]&&e.jsx(ke,{variant:"secondary",className:"text-xs whitespace-nowrap",children:Sk[Y.manifest.categories[0]]||Y.manifest.categories[0]}),K(Y)]})]}),e.jsx(As,{className:"line-clamp-2",children:Y.manifest?.description||"ๆ— ๆ่ฟฐ"})]}),e.jsx(Re,{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(Zt,{className:"h-4 w-4"}),e.jsx("span",{children:(ee[Y.id]?.downloads??Y.downloads??0).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(rn,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:(ee[Y.id]?.rating??Y.rating??0).toFixed(1)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Y.manifest?.keywords&&Y.manifest.keywords.slice(0,3).map(te=>e.jsx(ke,{variant:"outline",className:"text-xs",children:te},te)),Y.manifest?.keywords&&Y.manifest.keywords.length>3&&e.jsxs(ke,{variant:"outline",className:"text-xs",children:["+",Y.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",Y.manifest?.version||"unknown"," ยท ",Y.manifest?.author?.name||"Unknown"]}),Y.manifest?.host_application&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"ๆ”ฏๆŒ:"}),e.jsxs("span",{className:"font-medium",children:[Y.manifest.host_application.min_version,Y.manifest.host_application.max_version?` - ${Y.manifest.host_application.max_version}`:" - ๆœ€ๆ–ฐ็‰ˆๆœฌ"]})]})]})]})}),e.jsx(qo,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>l({to:"/plugin-detail",search:{pluginId:Y.id}}),children:"ๆŸฅ็œ‹่ฏฆๆƒ…"}),Y.installed?V(Y)?e.jsxs(S,{size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",onClick:()=>Ge(Y),children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"ๆ›ดๆ–ฐ"]}):e.jsxs(S,{variant:"destructive",size:"sm",disabled:!_?.installed,title:_?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",onClick:()=>oe(Y),children:[e.jsx(ns,{className:"h-4 w-4 mr-1"}),"ๅธ่ฝฝ"]}):e.jsxs(S,{size:"sm",disabled:!_?.installed||E?.operation==="install"||M!==null&&!U(Y),title:_?.installed?M!==null&&!U(Y)?`ไธๅ…ผๅฎนๅฝ“ๅ‰็‰ˆๆœฌ (้œ€่ฆ ${Y.manifest?.host_application?.min_version||"ๆœช็Ÿฅ"}${Y.manifest?.host_application?.max_version?` - ${Y.manifest.host_application.max_version}`:"+"}๏ผŒๅฝ“ๅ‰ ${M?.version})`:void 0:"Git ๆœชๅฎ‰่ฃ…",onClick:()=>Ae(Y),children:[e.jsx(Zt,{className:"h-4 w-4 mr-1"}),E?.operation==="install"&&E?.plugin_id===Y.id?"ๅฎ‰่ฃ…ไธญ...":"ๅฎ‰่ฃ…"]})]})}),E&&(E.stage==="loading"||E.stage==="success"||E.stage==="error")&&E.operation!=="fetch"&&E.plugin_id===Y.id&&e.jsx("div",{className:"px-6 pb-4 -mt-2",children:e.jsxs("div",{className:`space-y-2 p-3 rounded-lg border ${E.stage==="success"?"bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-900":E.stage==="error"?"bg-red-50 dark:bg-red-950/20 border-red-200 dark:border-red-900":"bg-muted/50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[E.stage==="loading"?e.jsx(Ls,{className:"h-3 w-3 animate-spin"}):E.stage==="success"?e.jsx(Wt,{className:"h-3 w-3 text-green-600"}):e.jsx(St,{className:"h-3 w-3 text-red-600"}),e.jsx("span",{className:`text-xs font-medium ${E.stage==="success"?"text-green-700 dark:text-green-300":E.stage==="error"?"text-red-700 dark:text-red-300":""}`,children:E.stage==="loading"?e.jsxs(e.Fragment,{children:[E.operation==="install"&&"ๆญฃๅœจๅฎ‰่ฃ…",E.operation==="uninstall"&&"ๆญฃๅœจๅธ่ฝฝ",E.operation==="update"&&"ๆญฃๅœจๆ›ดๆ–ฐ"]}):E.stage==="success"?e.jsxs(e.Fragment,{children:[E.operation==="install"&&"ๅฎ‰่ฃ…ๅฎŒๆˆ",E.operation==="uninstall"&&"ๅธ่ฝฝๅฎŒๆˆ",E.operation==="update"&&"ๆ›ดๆ–ฐๅฎŒๆˆ"]}):e.jsxs(e.Fragment,{children:[E.operation==="install"&&"ๅฎ‰่ฃ…ๅคฑ่ดฅ",E.operation==="uninstall"&&"ๅธ่ฝฝๅคฑ่ดฅ",E.operation==="update"&&"ๆ›ดๆ–ฐๅคฑ่ดฅ"]})})]}),E.stage!=="error"&&e.jsxs("span",{className:`text-xs font-medium ${E.stage==="success"?"text-green-700 dark:text-green-300":""}`,children:[E.progress,"%"]})]}),E.stage!=="error"&&e.jsx(Fn,{value:E.progress,className:`h-1.5 ${E.stage==="success"?"[&>div]:bg-green-500":""}`}),e.jsx("div",{className:`text-xs ${E.stage==="success"?"text-green-600 dark:text-green-400 truncate":E.stage==="error"?"text-red-600 dark:text-red-400":"text-muted-foreground truncate"}`,children:E.stage==="error"?E.error||E.message||"ๆ“ไฝœๅคฑ่ดฅ":E.message})]})})]},Y.id))}),e.jsx(Ps,{open:me,onOpenChange:ce,children:e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"ๅฎ‰่ฃ…ๆ’ไปถ"}),e.jsxs(Ys,{children:["ๅฎ‰่ฃ… ",ve?.manifest.name]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["็‰ˆๆœฌ: ",ve?.manifest.version]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["ไฝœ่€…: ",typeof ve?.manifest.author=="string"?ve.manifest.author:ve?.manifest.author?.name]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"advanced-options",checked:$,onCheckedChange:Y=>_e(Y)}),e.jsx("label",{htmlFor:"advanced-options",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"้ซ˜็บง้€‰้กน"})]}),$&&e.jsx("div",{className:"space-y-4 p-4 border rounded-lg",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"ๅˆ†ๆ”ฏ้€‰ๆ‹ฉ"}),e.jsxs(ra,{value:I,onValueChange:Y=>L(Y),children:[e.jsxs(ea,{className:"grid w-full grid-cols-2",children:[e.jsx(ts,{value:"preset",className:"text-xs",children:"้ข„่ฎพๅˆ†ๆ”ฏ"}),e.jsx(ts,{value:"custom",className:"text-xs",children:"่‡ชๅฎšไน‰ๅˆ†ๆ”ฏ"})]}),I==="preset"&&e.jsx("div",{className:"mt-3",children:e.jsxs(Be,{value:ge,onValueChange:fe,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:"้€‰ๆ‹ฉๅˆ†ๆ”ฏ"})}),e.jsxs(Ue,{children:[e.jsx(W,{value:"main",children:"main (้ป˜่ฎค)"}),e.jsx(W,{value:"master",children:"master"}),e.jsx(W,{value:"dev",children:"dev (ๅผ€ๅ‘็‰ˆ)"}),e.jsx(W,{value:"develop",children:"develop"}),e.jsx(W,{value:"beta",children:"beta (ๆต‹่ฏ•็‰ˆ)"}),e.jsx(W,{value:"stable",children:"stable (็จณๅฎš็‰ˆ)"})]})]})}),I==="custom"&&e.jsxs("div",{className:"space-y-2 mt-3",children:[e.jsx("input",{type:"text",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"่พ“ๅ…ฅๅˆ†ๆ”ฏๅ็งฐ๏ผŒไพ‹ๅฆ‚: feature/new-feature",value:z,onChange:Y=>Q(Y.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"่พ“ๅ…ฅ Git ๅˆ†ๆ”ฏๅ็งฐใ€ๆ ‡็ญพๆˆ–ๆไบคๅ“ˆๅธŒ"})]})]})]})}),!$&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๅฐ†ไปŽ้ป˜่ฎคๅˆ†ๆ”ฏ (main) ๅฎ‰่ฃ…ๆ’ไปถ"})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>ce(!1),children:"ๅ–ๆถˆ"}),e.jsxs(S,{onClick:X,children:[e.jsx(Zt,{className:"h-4 w-4 mr-2"}),"ๅฎ‰่ฃ…"]})]})]})}),e.jsx(qn,{})]})})}function Tk(){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(Dj,{className:"h-8 w-8",strokeWidth:2}),"ๆจกๅž‹ๅˆ†้…้ข„่ฎพๅธ‚ๅœบ"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆต่งˆๅ’Œไธ‹่ฝฝ็คพๅŒบๅ…ฑไบซ็š„ๆจกๅž‹ๅˆ†้…้ข„่ฎพ้…็ฝฎ"})]})})}),e.jsx(Je,{className:"flex-1",children:e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-12rem)]",children:e.jsxs(Ce,{className:"max-w-2xl w-full border-dashed",children:[e.jsxs(Pe,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(la,{className:"h-16 w-16 text-muted-foreground"})}),e.jsx(He,{className:"text-2xl",children:"ๅŠŸ่ƒฝๅผ€ๅ‘ไธญ"}),e.jsx(As,{className:"text-base",children:"ๆจกๅž‹ๅˆ†้…้ข„่ฎพๅธ‚ๅœบๅŠŸ่ƒฝๆญฃๅœจๅผ€ๅ‘ไธญ๏ผŒๆ•ฌ่ฏทๆœŸๅพ…๏ผ"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-medium text-foreground",children:"๐Ÿ“ฆ ๅณๅฐ†ๆŽจๅ‡บ็š„ๅŠŸ่ƒฝ๏ผš"}),e.jsxs("ul",{className:"space-y-2 ml-6",children:[e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ๆต่งˆ็คพๅŒบๅ…ฑไบซ็š„ๆจกๅž‹ๅˆ†้…้ข„่ฎพ้…็ฝฎ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ไธ€้”ฎไธ‹่ฝฝๅ’Œๅบ”็”จ้ข„่ฎพ้…็ฝฎ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ๅˆ†ไบซ่‡ชๅทฑ็š„ๆจกๅž‹ๅˆ†้…ๆ–นๆกˆ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"้ข„่ฎพ้…็ฝฎ่ฏ„ๅˆ†ๅ’Œ่ฏ„่ฎบ็ณป็ปŸ"})]}),e.jsxs("li",{className:"flex items-start",children:[e.jsx("span",{className:"mr-2",children:"โ€ข"}),e.jsx("span",{children:"ๆ นๆฎไฝฟ็”จๅœบๆ™ฏๆ™บ่ƒฝๆŽจ่้…็ฝฎ"})]})]})]})})]})})})]})}function Ek({field:l,value:n,onChange:i}){const[c,u]=m.useState(!1);switch(l.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(T,{children:l.label}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]}),e.jsx(Fe,{checked:!!n,onCheckedChange:i,disabled:l.disabled})]});case"number":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(ne,{type:"number",value:n??l.default,onChange:x=>i(parseFloat(x.target.value)||0),min:l.min,max:l.max,step:l.step??1,placeholder:l.placeholder,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"slider":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(T,{children:l.label}),e.jsx("span",{className:"text-sm text-muted-foreground",children:n??l.default})]}),e.jsx(_a,{value:[n??l.default],onValueChange:x=>i(x[0]),min:l.min??0,max:l.max??100,step:l.step??1,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"select":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsxs(Be,{value:String(n??l.default),onValueChange:i,disabled:l.disabled,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:l.placeholder??"่ฏท้€‰ๆ‹ฉ"})}),e.jsx(Ue,{children:l.choices?.map(x=>e.jsx(W,{value:String(x),children:String(x)},String(x)))})]}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"textarea":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(at,{value:n??l.default,onChange:x=>i(x.target.value),placeholder:l.placeholder,rows:l.rows??3,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"password":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{type:c?"text":"password",value:n??"",onChange:x=>i(x.target.value),placeholder:l.placeholder,disabled:l.disabled,className:"pr-10"}),e.jsx(S,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>u(!c),children:c?e.jsx(qi,{className:"h-4 w-4"}):e.jsx(na,{className:"h-4 w-4"})})]}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"list":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(C_,{value:Array.isArray(n)?n:[],onChange:x=>i(x),itemType:l.item_type??"string",itemFields:l.item_fields,minItems:l.min_items,maxItems:l.max_items,disabled:l.disabled,placeholder:l.placeholder}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]});case"text":default:return e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:l.label}),e.jsx(ne,{type:"text",value:n??l.default??"",onChange:x=>i(x.target.value),placeholder:l.placeholder,maxLength:l.max_length,disabled:l.disabled}),l.hint&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l.hint})]})}}function Tg({section:l,config:n,onChange:i}){const[c,u]=m.useState(!l.collapsed),x=Object.entries(l.fields).filter(([,h])=>!h.hidden).sort(([,h],[,f])=>h.order-f.order);return e.jsx(Zi,{open:c,onOpenChange:u,children:e.jsxs(Ce,{children:[e.jsx(Wi,{asChild:!0,children:e.jsxs(Pe,{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:[c?e.jsx(Ta,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(sa,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(He,{className:"text-lg",children:l.title})]}),e.jsxs(ke,{variant:"secondary",className:"text-xs",children:[x.length," ้กน"]})]}),l.description&&e.jsx(As,{className:"ml-6",children:l.description})]})}),e.jsx(ec,{children:e.jsx(Re,{className:"space-y-4 pt-0",children:x.map(([h,f])=>e.jsx(Ek,{field:f,value:n[l.name]?.[h],onChange:p=>i(l.name,h,p),sectionName:l.name},h))})})]})})}function Mk({plugin:l,onBack:n}){const{toast:i}=st(),{triggerRestart:c,isRestarting:u}=fn(),[x,h]=m.useState("visual"),[f,p]=m.useState(null),[g,N]=m.useState({}),[v,y]=m.useState({}),[w,b]=m.useState(""),[D,A]=m.useState(""),[_,H]=m.useState(!0),[E,C]=m.useState(!1),[M,G]=m.useState(!1),[O,ee]=m.useState(!1),[R,me]=m.useState(!1),ce=m.useCallback(async()=>{H(!0);try{const[I,L,$]=await Promise.all([hk(l.id),fk(l.id),pk(l.id)]);p(I),N(L),y(JSON.parse(JSON.stringify(L))),b($),A($)}catch(I){i({title:"ๅŠ ่ฝฝ้…็ฝฎๅคฑ่ดฅ",description:I instanceof Error?I.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{H(!1)}},[l.id,i]);m.useEffect(()=>{ce()},[ce]),m.useEffect(()=>{G(x==="visual"?JSON.stringify(g)!==JSON.stringify(v):w!==D)},[g,v,w,D,x]);const ve=(I,L,$)=>{N(_e=>({..._e,[I]:{..._e[I]||{},[L]:$}}))},se=async()=>{C(!0);try{if(x==="source"){try{vv(w)}catch(I){ee(!0),i({title:"TOML ๆ ผๅผ้”™่ฏฏ",description:I instanceof Error?I.message:"ๆ— ๆณ•่งฃๆž TOML ้…็ฝฎ๏ผŒ่ฏทๆฃ€ๆŸฅ่ฏญๆณ•",variant:"destructive"}),C(!1);return}await jk(l.id,w),A(w),ee(!1)}else await gk(l.id,g),y(JSON.parse(JSON.stringify(g)));i({title:"้…็ฝฎๅทฒไฟๅญ˜",description:"ๆ›ดๆ”นๅฐ†ๅœจๆ’ไปถ้‡ๆ–ฐๅŠ ่ฝฝๅŽ็”Ÿๆ•ˆ"})}catch(I){i({title:"ไฟๅญ˜ๅคฑ่ดฅ",description:I instanceof Error?I.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{C(!1)}},ge=async()=>{try{await vk(l.id),i({title:"้…็ฝฎๅทฒ้‡็ฝฎ",description:"ไธ‹ๆฌกๅŠ ่ฝฝๆ’ไปถๆ—ถๅฐ†ไฝฟ็”จ้ป˜่ฎค้…็ฝฎ"}),me(!1),ce()}catch(I){i({title:"้‡็ฝฎๅคฑ่ดฅ",description:I instanceof Error?I.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},fe=async()=>{try{const I=await Nk(l.id);i({title:I.message,description:I.note}),ce()}catch(I){i({title:"ๅˆ‡ๆข็Šถๆ€ๅคฑ่ดฅ",description:I instanceof Error?I.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}};if(_)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!f)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 space-y-4",children:[e.jsx(St,{className:"h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:"ๆ— ๆณ•ๅŠ ่ฝฝ้…็ฝฎ"}),e.jsxs(S,{onClick:n,variant:"outline",children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"่ฟ”ๅ›ž"]})]});const z=Object.values(f.sections).sort((I,L)=>I.order-L.order),Q=g.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(S,{variant:"ghost",size:"icon",onClick:n,children:e.jsx(ka,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:f.plugin_info.name||l.manifest.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(ke,{variant:Q?"default":"secondary",children:Q?"ๅทฒๅฏ็”จ":"ๅทฒ็ฆ็”จ"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",f.plugin_info.version||l.manifest.version]})]})]})]}),e.jsxs("div",{className:"flex gap-2 ml-10 sm:ml-0",children:[e.jsx(S,{variant:"outline",size:"sm",onClick:()=>h(x==="visual"?"source":"visual"),children:x==="visual"?e.jsxs(e.Fragment,{children:[e.jsx(Cj,{className:"h-4 w-4 mr-2"}),"ๆบไปฃ็ "]}):e.jsxs(e.Fragment,{children:[e.jsx(kj,{className:"h-4 w-4 mr-2"}),"ๅฏ่ง†ๅŒ–"]})}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>c(),disabled:u,children:[e.jsx(zj,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"้‡ๅฏ้บฆ้บฆ"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:fe,children:[e.jsx(sc,{className:"h-4 w-4 mr-2"}),Q?"็ฆ็”จ":"ๅฏ็”จ"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:()=>me(!0),children:[e.jsx(Vi,{className:"h-4 w-4 mr-2"}),"้‡็ฝฎ"]}),e.jsxs(S,{size:"sm",onClick:se,disabled:!M||E,children:[E?e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(tc,{className:"h-4 w-4 mr-2"}),"ไฟๅญ˜"]})]})]}),M&&e.jsx(Ce,{className:"border-orange-200 bg-orange-50 dark:bg-orange-950/20 dark:border-orange-900",children:e.jsx(Re,{className:"py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pt,{className:"h-4 w-4 text-orange-600"}),e.jsx("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:"ๆœ‰ๆœชไฟๅญ˜็š„ๆ›ดๆ”น"})]})})}),x==="source"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(lt,{children:[e.jsx(St,{className:"h-4 w-4"}),e.jsxs(nt,{children:[e.jsx("strong",{children:"ๆบไปฃ็ ๆจกๅผ๏ผˆ้ซ˜็บงๅŠŸ่ƒฝ๏ผ‰๏ผš"}),"็›ดๆŽฅ็ผ–่พ‘ TOML ้…็ฝฎๆ–‡ไปถใ€‚ไฟๅญ˜ๆ—ถไผš้ชŒ่ฏๆ ผๅผ๏ผŒๅชๆœ‰ๆ ผๅผๆญฃ็กฎๆ‰่ƒฝไฟๅญ˜ใ€‚",O&&e.jsx("span",{className:"text-destructive font-semibold ml-2",children:"โš ๏ธ ไธŠๆฌกไฟๅญ˜ๅคฑ่ดฅ๏ผŒ่ฏทๆฃ€ๆŸฅ TOML ๆ ผๅผ"})]})]}),e.jsx(cv,{value:w,onChange:I=>{b(I),O&&ee(!1)},language:"toml",theme:"dark",height:"calc(100vh - 350px)",minHeight:"500px",placeholder:"TOML ้…็ฝฎๅ†…ๅฎน"})]}),x==="visual"&&e.jsxs(e.Fragment,{children:[e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsxs(nt,{children:[e.jsx("strong",{children:"ๆ็คบ๏ผš"}),"ๅฆ‚ๆžœๆ’ไปถๅฝ“ๅ‰ๆœชๅŠ ่ฝฝๆˆ–ๆœชๅฏ็”จ๏ผŒWebUI ้€‚้…ๅ™จ็š„้ซ˜็บงๆ’ไปถๅฏ่ง†ๅŒ–็ผ–่พ‘ๅŠŸ่ƒฝๅฏ่ƒฝไผšไธๅฏ็”จใ€‚ ่ฏท็กฎไฟๆ’ไปถๅทฒๅฏ็”จๅนถๆˆๅŠŸๅŠ ่ฝฝๅŽ๏ผŒๅ†่ฟ›่กŒ้…็ฝฎ็ผ–่พ‘ใ€‚"]})]}),f.layout.type==="tabs"&&f.layout.tabs.length>0?e.jsxs(ra,{defaultValue:f.layout.tabs[0]?.id,children:[e.jsx(ea,{children:f.layout.tabs.map(I=>e.jsxs(ts,{value:I.id,children:[I.title,I.badge&&e.jsx(ke,{variant:"secondary",className:"ml-2 text-xs",children:I.badge})]},I.id))}),f.layout.tabs.map(I=>e.jsx(bs,{value:I.id,className:"space-y-4 mt-4",children:I.sections.map(L=>{const $=f.sections[L];return $?e.jsx(Tg,{section:$,config:g,onChange:ve},L):null})},I.id))]}):e.jsx("div",{className:"space-y-4",children:z.map(I=>e.jsx(Tg,{section:I,config:g,onChange:ve},I.name))})]}),e.jsx(Ps,{open:R,onOpenChange:me,children:e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{children:"็กฎ่ฎค้‡็ฝฎ้…็ฝฎ"}),e.jsx(Ys,{children:"่ฟ™ๅฐ†ๅˆ ้™คๅฝ“ๅ‰้…็ฝฎๆ–‡ไปถ๏ผŒไธ‹ๆฌกๅŠ ่ฝฝๆ’ไปถๆ—ถๅฐ†ไฝฟ็”จ้ป˜่ฎค้…็ฝฎใ€‚ๆญคๆ“ไฝœไธๅฏๆ’ค้”€ใ€‚"})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>me(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{variant:"destructive",onClick:ge,children:"็กฎ่ฎค้‡็ฝฎ"})]})]})})]})}function Ak(){return e.jsx(Vn,{children:e.jsx(zk,{})})}function zk(){const{toast:l}=st(),[n,i]=m.useState([]),[c,u]=m.useState(!0),[x,h]=m.useState(""),[f,p]=m.useState(null),g=async()=>{u(!0);try{const b=await Tl();i(b)}catch(b){l({title:"ๅŠ ่ฝฝๆ’ไปถๅˆ—่กจๅคฑ่ดฅ",description:b instanceof Error?b.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{u(!1)}};m.useEffect(()=>{g()},[]);const v=n.filter(b=>{const D=x.toLowerCase();return b.id.toLowerCase().includes(D)||b.manifest.name.toLowerCase().includes(D)||b.manifest.description?.toLowerCase().includes(D)}).filter((b,D,A)=>D===A.findIndex(_=>_.id===b.id)),y=n.length,w=0;return f?e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"h-full",children:e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx(Mk,{plugin:f,onBack:()=>p(null)})})}),e.jsx(qn,{})]}):e.jsx(Je,{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(S,{variant:"outline",size:"sm",onClick:g,children:[e.jsx(ft,{className:`h-4 w-4 mr-2 ${c?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-3",children:[e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅทฒๅฎ‰่ฃ…ๆ’ไปถ"}),e.jsx(la,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-2xl font-bold",children:n.length}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:c?"ๆญฃๅœจๅŠ ่ฝฝ...":"ไธชๆ’ไปถ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅทฒๅฏ็”จ"}),e.jsx(Wt,{className:"h-4 w-4 text-green-600"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"่ฟ่กŒไธญ็š„ๆ’ไปถ"})]})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(He,{className:"text-sm font-medium",children:"ๅทฒ็ฆ็”จ"}),e.jsx(St,{className:"h-4 w-4 text-orange-600"})]}),e.jsxs(Re,{children:[e.jsx("div",{className:"text-2xl font-bold",children:w}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ๆœชๆฟ€ๆดป็š„ๆ’ไปถ"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆ’ไปถ...",value:x,onChange:b=>h(b.target.value),className:"pl-9"})]}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๅทฒๅฎ‰่ฃ…็š„ๆ’ไปถ"}),e.jsx(As,{children:"็‚นๅ‡ปๆ’ไปถๆŸฅ็œ‹ๅ’Œ็ผ–่พ‘้…็ฝฎ"})]}),e.jsx(Re,{children:c?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Ls,{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(la,{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(b=>e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>p(b),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(la,{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:b.manifest.name}),e.jsxs(ke,{variant:"secondary",className:"text-xs flex-shrink-0",children:["v",b.manifest.version]})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.manifest.description||"ๆš‚ๆ— ๆ่ฟฐ"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(S,{variant:"ghost",size:"sm",children:e.jsx(mn,{className:"h-4 w-4"})}),e.jsx(sa,{className:"h-4 w-4 text-muted-foreground"})]})]},b.id))})})]})]})})}function Dk(){const l=ia(),{toast:n}=st(),[i,c]=m.useState([]),[u,x]=m.useState(!0),[h,f]=m.useState(null),[p,g]=m.useState(null),[N,v]=m.useState(!1),[y,w]=m.useState(!1),[b,D]=m.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),A=m.useCallback(async()=>{try{x(!0),f(null);const O=await we("/api/webui/plugins/mirrors");if(!O.ok)throw new Error("่Žทๅ–้•œๅƒๆบๅˆ—่กจๅคฑ่ดฅ");const ee=await O.json();c(ee.mirrors||[])}catch(O){const ee=O instanceof Error?O.message:"ๅŠ ่ฝฝ้•œๅƒๆบๅคฑ่ดฅ";f(ee),n({title:"ๅŠ ่ฝฝๅคฑ่ดฅ",description:ee,variant:"destructive"})}finally{x(!1)}},[n]);m.useEffect(()=>{A()},[A]);const _=async()=>{try{const O=await we("/api/webui/plugins/mirrors",{method:"POST",body:JSON.stringify(b)});if(!O.ok){const ee=await O.json();throw new Error(ee.detail||"ๆทปๅŠ ้•œๅƒๆบๅคฑ่ดฅ")}n({title:"ๆทปๅŠ ๆˆๅŠŸ",description:"้•œๅƒๆบๅทฒๆทปๅŠ "}),v(!1),D({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),A()}catch(O){n({title:"ๆทปๅŠ ๅคฑ่ดฅ",description:O instanceof Error?O.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},H=async()=>{if(p)try{if(!(await we(`/api/webui/plugins/mirrors/${p.id}`,{method:"PUT",body:JSON.stringify({name:b.name,raw_prefix:b.raw_prefix,clone_prefix:b.clone_prefix,enabled:b.enabled,priority:b.priority})})).ok)throw new Error("ๆ›ดๆ–ฐ้•œๅƒๆบๅคฑ่ดฅ");n({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:"้•œๅƒๆบๅทฒๆ›ดๆ–ฐ"}),w(!1),g(null),A()}catch(O){n({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:O instanceof Error?O.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},E=async O=>{if(confirm("็กฎๅฎš่ฆๅˆ ้™ค่ฟ™ไธช้•œๅƒๆบๅ—๏ผŸ"))try{if(!(await we(`/api/webui/plugins/mirrors/${O}`,{method:"DELETE"})).ok)throw new Error("ๅˆ ้™ค้•œๅƒๆบๅคฑ่ดฅ");n({title:"ๅˆ ้™คๆˆๅŠŸ",description:"้•œๅƒๆบๅทฒๅˆ ้™ค"}),A()}catch(ee){n({title:"ๅˆ ้™คๅคฑ่ดฅ",description:ee instanceof Error?ee.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},C=async O=>{try{if(!(await we(`/api/webui/plugins/mirrors/${O.id}`,{method:"PUT",body:JSON.stringify({enabled:!O.enabled})})).ok)throw new Error("ๆ›ดๆ–ฐ็Šถๆ€ๅคฑ่ดฅ");A()}catch(ee){n({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:ee instanceof Error?ee.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}},M=O=>{g(O),D({id:O.id,name:O.name,raw_prefix:O.raw_prefix,clone_prefix:O.clone_prefix,enabled:O.enabled,priority:O.priority}),w(!0)},G=async(O,ee)=>{const R=ee==="up"?O.priority-1:O.priority+1;if(!(R<1))try{if(!(await we(`/api/webui/plugins/mirrors/${O.id}`,{method:"PUT",body:JSON.stringify({priority:R})})).ok)throw new Error("ๆ›ดๆ–ฐไผ˜ๅ…ˆ็บงๅคฑ่ดฅ");A()}catch(me){n({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:me instanceof Error?me.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}};return e.jsx(Je,{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(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),children:e.jsx(ka,{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(S,{onClick:()=>v(!0),children:[e.jsx(Zs,{className:"h-4 w-4 mr-2"}),"ๆทปๅŠ ้•œๅƒๆบ"]})]}),u?e.jsx(Ce,{className:"p-6",children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-primary"})})}):h?e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Yt,{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:h}),e.jsx(S,{onClick:A,children:"้‡ๆ–ฐๅŠ ่ฝฝ"})]})}):e.jsxs(Ce,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{children:"็Šถๆ€"}),e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"ID"}),e.jsx(Ze,{children:"ไผ˜ๅ…ˆ็บง"}),e.jsx(Ze,{className:"text-right",children:"ๆ“ไฝœ"})]})}),e.jsx(Ol,{children:i.map(O=>e.jsxs(ot,{children:[e.jsx(Ke,{children:e.jsx(Fe,{checked:O.enabled,onCheckedChange:()=>C(O)})}),e.jsx(Ke,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:O.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",O.raw_prefix]})]})}),e.jsx(Ke,{children:e.jsx(ke,{variant:"outline",children:O.id})}),e.jsx(Ke,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:O.priority}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(S,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>G(O,"up"),disabled:O.priority===1,children:e.jsx($r,{className:"h-3 w-3"})}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>G(O,"down"),children:e.jsx(Ta,{className:"h-3 w-3"})})]})]})}),e.jsx(Ke,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>M(O),children:e.jsx($n,{className:"h-4 w-4"})}),e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>E(O.id),children:e.jsx(ns,{className:"h-4 w-4 text-destructive"})})]})})]},O.id))})]})}),e.jsx("div",{className:"md:hidden p-4 space-y-4",children:i.map(O=>e.jsx(Ce,{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:O.name}),O.enabled&&e.jsx(ke,{variant:"default",className:"text-xs",children:"ๅฏ็”จ"})]}),e.jsx(ke,{variant:"outline",className:"mt-1 text-xs",children:O.id})]}),e.jsx(Fe,{checked:O.enabled,onCheckedChange:()=>C(O)})]}),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:O.raw_prefix})]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"ไผ˜ๅ…ˆ็บง: "}),e.jsx("span",{className:"font-mono",children:O.priority})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[e.jsxs(S,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>M(O),children:[e.jsx($n,{className:"h-4 w-4 mr-1"}),"็ผ–่พ‘"]}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>G(O,"up"),disabled:O.priority===1,children:e.jsx($r,{className:"h-4 w-4"})}),e.jsx(S,{variant:"outline",size:"sm",onClick:()=>G(O,"down"),children:e.jsx(Ta,{className:"h-4 w-4"})}),e.jsx(S,{variant:"destructive",size:"sm",onClick:()=>E(O.id),children:e.jsx(ns,{className:"h-4 w-4"})})]})]})},O.id))})]}),e.jsx(Ps,{open:N,onOpenChange:v,children:e.jsxs(Us,{className:"max-w-lg",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{htmlFor:"add-id",children:"้•œๅƒๆบ ID *"}),e.jsx(ne,{id:"add-id",placeholder:"ไพ‹ๅฆ‚: my-mirror",value:b.id,onChange:O=>D({...b,id:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-name",children:"ๅ็งฐ *"}),e.jsx(ne,{id:"add-name",placeholder:"ไพ‹ๅฆ‚: ๆˆ‘็š„้•œๅƒๆบ",value:b.name,onChange:O=>D({...b,name:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-raw",children:"Raw ๆ–‡ไปถๅ‰็ผ€ *"}),e.jsx(ne,{id:"add-raw",placeholder:"https://example.com/raw",value:b.raw_prefix,onChange:O=>D({...b,raw_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-clone",children:"ๅ…‹้š†ๅ‰็ผ€ *"}),e.jsx(ne,{id:"add-clone",placeholder:"https://example.com/clone",value:b.clone_prefix,onChange:O=>D({...b,clone_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"add-priority",children:"ไผ˜ๅ…ˆ็บง"}),e.jsx(ne,{id:"add-priority",type:"number",min:"1",value:b.priority,onChange:O=>D({...b,priority:parseInt(O.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(Fe,{id:"add-enabled",checked:b.enabled,onCheckedChange:O=>D({...b,enabled:O})}),e.jsx(T,{htmlFor:"add-enabled",children:"ๅฏ็”จๆญค้•œๅƒๆบ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>v(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:_,children:"ๆทปๅŠ "})]})]})}),e.jsx(Ps,{open:y,onOpenChange:w,children:e.jsxs(Us,{className:"max-w-lg",children:[e.jsxs(Bs,{children:[e.jsx($s,{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(T,{children:"้•œๅƒๆบ ID"}),e.jsx(ne,{value:b.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-name",children:"ๅ็งฐ *"}),e.jsx(ne,{id:"edit-name",value:b.name,onChange:O=>D({...b,name:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-raw",children:"Raw ๆ–‡ไปถๅ‰็ผ€ *"}),e.jsx(ne,{id:"edit-raw",value:b.raw_prefix,onChange:O=>D({...b,raw_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-clone",children:"ๅ…‹้š†ๅ‰็ผ€ *"}),e.jsx(ne,{id:"edit-clone",value:b.clone_prefix,onChange:O=>D({...b,clone_prefix:O.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"edit-priority",children:"ไผ˜ๅ…ˆ็บง"}),e.jsx(ne,{id:"edit-priority",type:"number",min:"1",value:b.priority,onChange:O=>D({...b,priority:parseInt(O.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(Fe,{id:"edit-enabled",checked:b.enabled,onCheckedChange:O=>D({...b,enabled:O})}),e.jsx(T,{htmlFor:"edit-enabled",children:"ๅฏ็”จๆญค้•œๅƒๆบ"})]})]}),e.jsxs(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>w(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:H,children:"ไฟๅญ˜"})]})]})})]})})}function Ok({pluginId:l,compact:n=!1}){const[i,c]=m.useState(null),[u,x]=m.useState(!0),[h,f]=m.useState(0),[p,g]=m.useState(""),[N,v]=m.useState(!1),{toast:y}=st(),w=async()=>{x(!0);const _=await Ov(l);_&&c(_),x(!1)};m.useEffect(()=>{w()},[l]);const b=async()=>{const _=await bk(l);_.success?(y({title:"ๅทฒ็‚น่ตž",description:"ๆ„Ÿ่ฐขไฝ ็š„ๆ”ฏๆŒ๏ผ"}),w()):y({title:"็‚น่ตžๅคฑ่ดฅ",description:_.error||"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})},D=async()=>{const _=await yk(l);_.success?(y({title:"ๅทฒๅ้ฆˆ",description:"ๆ„Ÿ่ฐขไฝ ็š„ๅ้ฆˆ๏ผ"}),w()):y({title:"ๆ“ไฝœๅคฑ่ดฅ",description:_.error||"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})},A=async()=>{if(h===0){y({title:"่ฏท้€‰ๆ‹ฉ่ฏ„ๅˆ†",description:"่‡ณๅฐ‘้€‰ๆ‹ฉ 1 ้ข—ๆ˜Ÿ",variant:"destructive"});return}const _=await wk(l,h,p||void 0);_.success?(y({title:"่ฏ„ๅˆ†ๆˆๅŠŸ",description:"ๆ„Ÿ่ฐขไฝ ็š„่ฏ„ไปท๏ผ"}),v(!1),f(0),g(""),w()):y({title:"่ฏ„ๅˆ†ๅคฑ่ดฅ",description:_.error||"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})};return u?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(Zt,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(rn,{className:"h-4 w-4"}),e.jsx("span",{children:"-"})]})]}):i?n?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:`ไธ‹่ฝฝ้‡: ${i.downloads.toLocaleString()}`,children:[e.jsx(Zt,{className:"h-4 w-4"}),e.jsx("span",{children:i.downloads.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`่ฏ„ๅˆ†: ${i.rating.toFixed(1)} (${i.rating_count} ๆก่ฏ„ไปท)`,children:[e.jsx(rn,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:i.rating.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-1",title:`็‚น่ตžๆ•ฐ: ${i.likes}`,children:[e.jsx(fm,{className:"h-4 w-4"}),e.jsx("span",{children:i.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(Zt,{className:"h-5 w-5 text-muted-foreground mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:i.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(rn,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),e.jsx("span",{className:"text-2xl font-bold",children:i.rating.toFixed(1)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[i.rating_count," ๆก่ฏ„ไปท"]})]}),e.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[e.jsx(fm,{className:"h-5 w-5 text-green-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:i.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(sg,{className:"h-5 w-5 text-red-500 mb-1"}),e.jsx("span",{className:"text-2xl font-bold",children:i.dislikes}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"็‚น่ธฉ"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(S,{variant:"outline",size:"sm",onClick:b,children:[e.jsx(fm,{className:"h-4 w-4 mr-1"}),"็‚น่ตž"]}),e.jsxs(S,{variant:"outline",size:"sm",onClick:D,children:[e.jsx(sg,{className:"h-4 w-4 mr-1"}),"็‚น่ธฉ"]}),e.jsxs(Ps,{open:N,onOpenChange:v,children:[e.jsx(Qo,{asChild:!0,children:e.jsxs(S,{variant:"default",size:"sm",children:[e.jsx(rn,{className:"h-4 w-4 mr-1"}),"่ฏ„ๅˆ†"]})}),e.jsxs(Us,{children:[e.jsxs(Bs,{children:[e.jsx($s,{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(_=>e.jsx("button",{onClick:()=>f(_),className:"focus:outline-none",children:e.jsx(rn,{className:`h-8 w-8 transition-colors ${_<=h?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},_))}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[h===0&&"็‚นๅ‡ปๆ˜Ÿๆ˜Ÿ่ฟ›่กŒ่ฏ„ๅˆ†",h===1&&"ๅพˆๅทฎ",h===2&&"ไธ€่ˆฌ",h===3&&"่ฟ˜่กŒ",h===4&&"ไธ้”™",h===5&&"้žๅธธๅฅฝ"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"่ฏ„่ฎบ๏ผˆๅฏ้€‰๏ผ‰"}),e.jsx(at,{value:p,onChange:_=>g(_.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(et,{children:[e.jsx(S,{variant:"outline",onClick:()=>v(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:A,disabled:h===0,children:"ๆไบค่ฏ„ๅˆ†"})]})]})]})]}),i.recent_ratings&&i.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:i.recent_ratings.map((_,H)=>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(E=>e.jsx(rn,{className:`h-3 w-3 ${E<=_.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},E))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(_.created_at).toLocaleDateString()})]}),_.comment&&e.jsx("p",{className:"text-sm text-muted-foreground",children:_.comment})]},H))})]})]}):null}const Rk={"Group Management":"็พค็ป„็ฎก็†","Entertainment & Interaction":"ๅจฑไนไบ’ๅŠจ","Utility Tools":"ๅฎž็”จๅทฅๅ…ท","Content Generation":"ๅ†…ๅฎน็”Ÿๆˆ",Multimedia:"ๅคšๅช’ไฝ“","External Integration":"ๅค–้ƒจ้›†ๆˆ","Data Analysis & Insights":"ๆ•ฐๆฎๅˆ†ๆžไธŽๆดžๅฏŸ",Other:"ๅ…ถไป–"};function Lk(){const l=ia(),n=x0({strict:!1}),{toast:i}=st(),[c,u]=m.useState(null),[x,h]=m.useState(""),[f,p]=m.useState(!0),[g,N]=m.useState(!0),[v,y]=m.useState(null),[w,b]=m.useState(null),[D,A]=m.useState(null),[_,H]=m.useState(!1),[E,C]=m.useState(),[M,G]=m.useState(!1);m.useEffect(()=>{(async()=>{if(!n.pluginId){y("็ผบๅฐ‘ๆ’ไปถ ID"),p(!1);return}try{p(!0),y(null);const ge=await we("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:"Mai-with-u",repo:"plugin-repo",branch:"main",file_path:"plugin_details.json"})});if(!ge.ok)throw new Error("่Žทๅ–ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");const fe=await ge.json();if(!fe.success||!fe.data)throw new Error(fe.error||"่Žทๅ–ๆ’ไปถๅˆ—่กจๅคฑ่ดฅ");const Q=JSON.parse(fe.data).find(je=>je.id===n.pluginId);if(!Q)throw new Error("ๆœชๆ‰พๅˆฐ่ฏฅๆ’ไปถ");const I={id:Q.id,manifest:Q.manifest,downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()};u(I);const[L,$,_e]=await Promise.all([Tv(),Ev(),Tl()]);b(L),A($),H(on(n.pluginId,_e)),C(dn(n.pluginId,_e))}catch(ge){y(ge instanceof Error?ge.message:"ๅŠ ่ฝฝๅคฑ่ดฅ")}finally{p(!1)}})()},[n.pluginId]),m.useEffect(()=>{(async()=>{if(!c?.manifest?.repository_url){N(!1);return}try{if(N(!0),_&&n.pluginId)try{const $=await we(`/api/webui/plugins/local-readme/${n.pluginId}`);if($.ok){const _e=await $.json();if(_e.success&&_e.data){h(_e.data),N(!1);return}}}catch($){console.log("ๆœฌๅœฐ README ่Žทๅ–ๅคฑ่ดฅ๏ผŒๅฐ่ฏ•่ฟœ็จ‹่Žทๅ–:",$)}const ge=c.manifest.repository_url.match(/github\.com\/([^/]+)\/([^/\s]+)/);if(!ge){h("ๆ— ๆณ•่งฃๆžไป“ๅบ“ๅœฐๅ€");return}const[,fe,z]=ge,Q=z.replace(/\.git$/,""),I=await we("/api/webui/plugins/fetch-raw",{method:"POST",body:JSON.stringify({owner:fe,repo:Q,branch:"main",file_path:"README.md"})});if(!I.ok)throw new Error("่Žทๅ– README ๅคฑ่ดฅ");const L=await I.json();L.success&&L.data?h(L.data):h("่ฏฅๆ’ไปถๆš‚ๆ—  README ๆ–‡ๆกฃ")}catch(ge){console.error("ๅŠ ่ฝฝ README ๅคฑ่ดฅ:",ge),h("ๅŠ ่ฝฝ README ๅคฑ่ดฅ")}finally{N(!1)}})()},[c,_,n.pluginId]);const O=()=>!c||!_||!E?!1:E!==c.manifest.version,ee=()=>!c||!D?!0:Mv(c.manifest.host_application.min_version,c.manifest.host_application.max_version,D),R=async()=>{if(!(!c||!w?.installed))try{G(!0),await Av(c.id,c.manifest.repository_url||"","main"),Rv(c.id).catch(ge=>{console.warn("Failed to record download:",ge)}),i({title:"ๅฎ‰่ฃ…ๆˆๅŠŸ",description:`${c.manifest.name} ๅทฒๆˆๅŠŸๅฎ‰่ฃ…`});const se=await Tl();H(on(c.id,se)),C(dn(c.id,se))}catch(se){i({title:"ๅฎ‰่ฃ…ๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{G(!1)}},me=async()=>{if(c)try{G(!0),await zv(c.id),i({title:"ๅธ่ฝฝๆˆๅŠŸ",description:`${c.manifest.name} ๅทฒๆˆๅŠŸๅธ่ฝฝ`});const se=await Tl();H(on(c.id,se)),C(dn(c.id,se))}catch(se){i({title:"ๅธ่ฝฝๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{G(!1)}},ce=async()=>{if(!(!c||!w?.installed))try{G(!0);const se=await Dv(c.id,c.manifest.repository_url||"","main");i({title:"ๆ›ดๆ–ฐๆˆๅŠŸ",description:`${c.manifest.name} ๅทฒไปŽ ${se.old_version} ๆ›ดๆ–ฐๅˆฐ ${se.new_version}`});const ge=await Tl();H(on(c.id,ge)),C(dn(c.id,ge))}catch(se){i({title:"ๆ›ดๆ–ฐๅคฑ่ดฅ",description:se instanceof Error?se.message:"ๆœช็Ÿฅ้”™่ฏฏ",variant:"destructive"})}finally{G(!1)}};if(f)return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),children:e.jsx(ka,{className:"h-5 w-5"})}),e.jsx("div",{children:e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"ๆ’ไปถ่ฏฆๆƒ…"})})]}),e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"ๅŠ ่ฝฝๆ’ไปถไฟกๆฏไธญ..."})]})]});if(v||!c)return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),children:e.jsx(ka,{className:"h-5 w-5"})}),e.jsx("div",{children:e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"ๆ’ไปถ่ฏฆๆƒ…"})})]}),e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(St,{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:v}),e.jsx(S,{onClick:()=>l({to:"/plugins"}),children:"่ฟ”ๅ›žๆ’ไปถๅˆ—่กจ"})]})})]});const ve=ee();return 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",{className:"flex items-center gap-3",children:[e.jsx(S,{variant:"ghost",size:"icon",onClick:()=>l({to:"/plugins"}),className:"shrink-0",children:e.jsx(ka,{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-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:c.manifest.name})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:_?e.jsxs(e.Fragment,{children:[O()?e.jsx(S,{disabled:!w?.installed||M,onClick:ce,title:w?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๆ›ดๆ–ฐไธญ..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"h-4 w-4 mr-2"}),"ๆ›ดๆ–ฐ"]})}):null,e.jsx(S,{variant:"destructive",disabled:!w?.installed||M,onClick:me,title:w?.installed?void 0:"Git ๆœชๅฎ‰่ฃ…",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๅธ่ฝฝไธญ..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ns,{className:"h-4 w-4 mr-2"}),"ๅธ่ฝฝ"]})})]}):e.jsx(S,{disabled:!w?.installed||!ve||M,onClick:R,title:w?.installed?ve?void 0:`ไธๅ…ผๅฎนๅฝ“ๅ‰็‰ˆๆœฌ (้œ€่ฆ ${c.manifest.host_application.min_version}${c.manifest.host_application.max_version?` - ${c.manifest.host_application.max_version}`:"+"}๏ผŒๅฝ“ๅ‰ ${D?.version})`:"Git ๆœชๅฎ‰่ฃ…",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๅฎ‰่ฃ…ไธญ..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Zt,{className:"h-4 w-4 mr-2"}),"ๅฎ‰่ฃ…"]})})})]}),e.jsx(Je,{className:"h-[calc(100vh-200px)] sm:h-[calc(100vh-220px)]",children:e.jsxs("div",{className:"space-y-6 pr-4",children:[e.jsx(Ce,{children:e.jsx(Pe,{children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx(He,{className:"text-2xl",children:c.manifest.name}),e.jsxs(ke,{variant:"secondary",className:"text-sm",children:["v",c.manifest.version]}),_&&e.jsxs(ke,{variant:"default",className:"text-sm",children:[e.jsx(Wt,{className:"h-3 w-3 mr-1"}),"ๅทฒๅฎ‰่ฃ… ",E&&`(v${E})`]}),O()&&e.jsxs(ke,{variant:"outline",className:"text-sm border-orange-500 text-orange-500",children:[e.jsx(ft,{className:"h-3 w-3 mr-1"}),"ๅฏๆ›ดๆ–ฐ"]}),!ve&&e.jsxs(ke,{variant:"destructive",className:"text-sm",children:[e.jsx(St,{className:"h-3 w-3 mr-1"}),"ไธๅ…ผๅฎน"]})]}),e.jsx(As,{className:"text-base",children:c.manifest.description})]})})})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"็ปŸ่ฎกไฟกๆฏ"})}),e.jsx(Re,{children:e.jsx(Ok,{pluginId:c.id})})]}),e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"ๅŸบๆœฌไฟกๆฏ"})}),e.jsx(Re,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Bn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ไฝœ่€…:"}),e.jsx("span",{className:"font-medium",children:c.manifest.author?.name||"Unknown"}),c.manifest.author?.url&&e.jsx("a",{href:c.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.jsx(So,{className:"h-3 w-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(la,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"็‰ˆๆœฌ:"}),e.jsxs("span",{className:"font-medium",children:["v",c.manifest.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(bj,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"่ฎธๅฏ่ฏ:"}),e.jsx("span",{className:"font-medium",children:c.manifest.license})]}),c.manifest.homepage_url&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(zo,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ไธป้กต:"}),e.jsxs("a",{href:c.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["่ฎฟ้—ฎ",e.jsx(So,{className:"h-3 w-3"})]})]}),c.manifest.repository_url&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(n1,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ไป“ๅบ“:"}),e.jsxs("a",{href:c.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["GitHub",e.jsx(So,{className:"h-3 w-3"})]})]}),e.jsxs("div",{className:"pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm mb-2",children:[e.jsx(Pt,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"ๆ”ฏๆŒ็‰ˆๆœฌ:"})]}),e.jsxs("div",{className:"text-sm pl-6 font-medium",children:[c.manifest.host_application.min_version,c.manifest.host_application.max_version?` - ${c.manifest.host_application.max_version}`:" - ๆœ€ๆ–ฐ็‰ˆๆœฌ"]})]})]})})]}),(c.manifest.categories||c.manifest.keywords)&&e.jsxs(Ce,{children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"ๅˆ†็ฑปไธŽๆ ‡็ญพ"})}),e.jsxs(Re,{className:"space-y-4",children:[c.manifest.categories&&c.manifest.categories.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"ๅˆ†็ฑป"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:c.manifest.categories.map(se=>e.jsx(ke,{variant:"secondary",children:Rk[se]||se},se))})]}),c.manifest.keywords&&c.manifest.keywords.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"ๆ ‡็ญพ"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:c.manifest.keywords.map(se=>e.jsxs(ke,{variant:"outline",className:"text-xs",children:[e.jsx(Vo,{className:"h-3 w-3 mr-1"}),se]},se))})]})]})]})]}),e.jsxs(Ce,{className:"lg:col-span-2",children:[e.jsx(Pe,{children:e.jsx(He,{className:"text-lg",children:"ๆ’ไปถ่ฏดๆ˜Ž"})}),e.jsx(Re,{children:e.jsx(Je,{className:"h-[600px] pr-4",children:g?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Ls,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-sm text-muted-foreground",children:"ๅŠ ่ฝฝ่ฏดๆ˜Žๆ–‡ๆกฃไธญ..."})]}):x?e.jsx(Qm,{content:x}):e.jsx("div",{className:"text-center text-muted-foreground py-12",children:"ๆš‚ๆ— ่ฏดๆ˜Žๆ–‡ๆกฃ"})})})]})]})]})})]})}const Ii=m.forwardRef(({className:l,...n},i)=>e.jsx(Qg,{ref:i,className:P("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",l),...n}));Ii.displayName=Qg.displayName;const Uk=m.forwardRef(({className:l,...n},i)=>e.jsx(Yg,{ref:i,className:P("aspect-square h-full w-full",l),...n}));Uk.displayName=Yg.displayName;const Pi=m.forwardRef(({className:l,...n},i)=>e.jsx(Jg,{ref:i,className:P("flex h-full w-full items-center justify-center rounded-full bg-muted",l),...n}));Pi.displayName=Jg.displayName;function Bk(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function $k(){const l="maibot_webui_user_id";let n=localStorage.getItem(l);return n||(n=Bk(),localStorage.setItem(l,n)),n}function Ik(){return localStorage.getItem("maibot_webui_user_name")||"WebUI็”จๆˆท"}function Pk(l){localStorage.setItem("maibot_webui_user_name",l)}const Lv="maibot_webui_virtual_tabs";function Hk(){try{const l=localStorage.getItem(Lv);if(l)return JSON.parse(l)}catch(l){console.error("[Chat] ๅŠ ่ฝฝ่™šๆ‹Ÿๆ ‡็ญพ้กตๅคฑ่ดฅ:",l)}return[]}function Eg(l){try{localStorage.setItem(Lv,JSON.stringify(l))}catch(n){console.error("[Chat] ไฟๅญ˜่™šๆ‹Ÿๆ ‡็ญพ้กตๅคฑ่ดฅ:",n)}}function Fk({segment:l}){switch(l.type){case"text":return e.jsx("span",{className:"whitespace-pre-wrap",children:String(l.data)});case"image":case"emoji":return e.jsx("img",{src:String(l.data),alt:l.type==="emoji"?"่กจๆƒ…ๅŒ…":"ๅ›พ็‰‡",className:P("rounded-lg max-w-full",l.type==="emoji"?"max-h-32":"max-h-64"),loading:"lazy",onError:n=>{const i=n.target;i.style.display="none",i.parentElement?.insertAdjacentHTML("beforeend",`[${l.type==="emoji"?"่กจๆƒ…ๅŒ…":"ๅ›พ็‰‡"}ๅŠ ่ฝฝๅคฑ่ดฅ]`)}});case"voice":return e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("audio",{controls:!0,src:String(l.data),className:"max-w-[200px] h-8",children:"ๆ‚จ็š„ๆต่งˆๅ™จไธๆ”ฏๆŒ้Ÿณ้ข‘ๆ’ญๆ”พ"})});case"video":return e.jsx("video",{controls:!0,src:String(l.data),className:"rounded-lg max-w-full max-h-64",children:"ๆ‚จ็š„ๆต่งˆๅ™จไธๆ”ฏๆŒ่ง†้ข‘ๆ’ญๆ”พ"});case"face":return e.jsxs("span",{className:"text-muted-foreground",children:["[่กจๆƒ…:",String(l.data),"]"]});case"music":return e.jsx("span",{className:"text-muted-foreground",children:"[้Ÿณไนๅˆ†ไบซ]"});case"file":return e.jsxs("span",{className:"text-muted-foreground",children:["[ๆ–‡ไปถ: ",String(l.data),"]"]});case"reply":return e.jsx("span",{className:"text-muted-foreground text-xs",children:"[ๅ›žๅคๆถˆๆฏ]"});case"forward":return e.jsx("span",{className:"text-muted-foreground",children:"[่ฝฌๅ‘ๆถˆๆฏ]"});case"unknown":default:return e.jsxs("span",{className:"text-muted-foreground",children:["[",l.original_type||"ๆœช็Ÿฅๆถˆๆฏ","]"]})}}function Gk({message:l,isBot:n}){return l.message_type==="rich"&&l.segments&&l.segments.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:l.segments.map((i,c)=>e.jsx(Fk,{segment:i},c))}):e.jsx("span",{className:"whitespace-pre-wrap",children:l.content})}function Vk(){const l={id:"webui-default",type:"webui",label:"WebUI",messages:[],isConnected:!1,isTyping:!1,sessionInfo:{}},n=()=>{const qe=Hk().map(Qe=>{const We=Qe.virtualConfig;return!We.groupId&&We.platform&&We.userId&&(We.groupId=`webui_virtual_group_${We.platform}_${We.userId}`),{id:Qe.id,type:"virtual",label:Qe.label,virtualConfig:We,messages:[],isConnected:!1,isTyping:!1,sessionInfo:{}}});return[l,...qe]},[i,c]=m.useState(n),[u,x]=m.useState("webui-default"),h=i.find(q=>q.id===u)||i[0],[f,p]=m.useState(""),[g,N]=m.useState(!1),[v,y]=m.useState(!0),[w,b]=m.useState(Ik()),[D,A]=m.useState(!1),[_,H]=m.useState(""),[E,C]=m.useState(!1),[M,G]=m.useState([]),[O,ee]=m.useState([]),[R,me]=m.useState(!1),[ce,ve]=m.useState(!1),[se,ge]=m.useState(""),[fe,z]=m.useState({platform:"",personId:"",userId:"",userName:"",groupName:"",groupId:""}),Q=m.useRef($k()),I=m.useRef(new Map),L=m.useRef(null),$=m.useRef(new Map),_e=m.useRef(0),je=m.useRef(new Map),{toast:Se}=st(),K=q=>(_e.current+=1,`${q}-${Date.now()}-${_e.current}-${Math.random().toString(36).substr(2,9)}`),U=m.useCallback((q,qe)=>{c(Qe=>Qe.map(We=>We.id===q?{...We,...qe}:We))},[]),V=m.useCallback((q,qe)=>{c(Qe=>Qe.map(We=>We.id===q?{...We,messages:[...We.messages,qe]}:We))},[]),xe=m.useCallback(()=>{L.current?.scrollIntoView({behavior:"smooth"})},[]);m.useEffect(()=>{xe()},[h?.messages,xe]);const Ae=m.useCallback(async()=>{me(!0);try{const q=await we("/api/chat/platforms");if(console.log("[Chat] ๅนณๅฐๅˆ—่กจๅ“ๅบ”:",q.status,q.headers.get("content-type")),q.ok){const qe=q.headers.get("content-type");if(qe&&qe.includes("application/json")){const Qe=await q.json();console.log("[Chat] ๅนณๅฐๅˆ—่กจๆ•ฐๆฎ:",Qe),G(Qe.platforms||[])}else{const Qe=await q.text();console.error("[Chat] ่Žทๅ–ๅนณๅฐๅˆ—่กจๅคฑ่ดฅ: ้ž JSON ๅ“ๅบ”:",Qe.substring(0,200)),Se({title:"่ฟžๆŽฅๅคฑ่ดฅ",description:"ๆ— ๆณ•่ฟžๆŽฅๅˆฐๅŽ็ซฏๆœๅŠก๏ผŒ่ฏท็กฎไฟ MaiBot ๅทฒๅฏๅŠจ",variant:"destructive"})}}else console.error("[Chat] ่Žทๅ–ๅนณๅฐๅˆ—่กจๅคฑ่ดฅ: HTTP",q.status),Se({title:"่Žทๅ–ๅนณๅฐๅคฑ่ดฅ",description:`ๆœๅŠกๅ™จ่ฟ”ๅ›ž้”™่ฏฏ: ${q.status}`,variant:"destructive"})}catch(q){console.error("[Chat] ่Žทๅ–ๅนณๅฐๅˆ—่กจๅคฑ่ดฅ:",q),Se({title:"็ฝ‘็ปœ้”™่ฏฏ",description:"ๆ— ๆณ•่ฟžๆŽฅๅˆฐๅŽ็ซฏๆœๅŠก",variant:"destructive"})}finally{me(!1)}},[Se]),X=m.useCallback(async(q,qe)=>{ve(!0);try{const Qe=new URLSearchParams;q&&Qe.append("platform",q),qe&&Qe.append("search",qe),Qe.append("limit","50");const We=await we(`/api/chat/persons?${Qe.toString()}`);if(We.ok){const Ds=We.headers.get("content-type");if(Ds&&Ds.includes("application/json")){const as=await We.json();ee(as.persons||[])}else console.error("[Chat] ่Žทๅ–็”จๆˆทๅˆ—่กจๅคฑ่ดฅ: ๅŽ็ซฏ่ฟ”ๅ›ž้ž JSON ๅ“ๅบ”")}}catch(Qe){console.error("[Chat] ่Žทๅ–็”จๆˆทๅˆ—่กจๅคฑ่ดฅ:",Qe)}finally{ve(!1)}},[]);m.useEffect(()=>{fe.platform&&X(fe.platform,se)},[fe.platform,se,X]);const oe=m.useCallback(async(q,qe)=>{y(!0);try{const Qe=new URLSearchParams;Qe.append("user_id",Q.current),Qe.append("limit","50"),qe&&Qe.append("group_id",qe);const We=`/api/chat/history?${Qe.toString()}`;console.log("[Chat] ๆญฃๅœจๅŠ ่ฝฝๅކๅฒๆถˆๆฏ:",We);const Ds=await we(We);if(Ds.ok){const as=await Ds.text();try{const ks=JSON.parse(as);if(ks.messages&&ks.messages.length>0){const Ee=ks.messages.map(ls=>({id:ls.id,type:ls.type,content:ls.content,timestamp:ls.timestamp,sender:{name:ls.sender_name||(ls.is_bot?"้บฆ้บฆ":"WebUI็”จๆˆท"),user_id:ls.user_id,is_bot:ls.is_bot}}));U(q,{messages:Ee});const vs=je.current.get(q)||new Set;Ee.forEach(ls=>{if(ls.type==="bot"){const es=`bot-${ls.content}-${Math.floor(ls.timestamp*1e3)}`;vs.add(es)}}),je.current.set(q,vs)}}catch(ks){console.error("[Chat] JSON ่งฃๆžๅคฑ่ดฅ:",ks)}}}catch(Qe){console.error("[Chat] ๅŠ ่ฝฝๅކๅฒๆถˆๆฏๅคฑ่ดฅ:",Qe)}finally{y(!1)}},[U]),Ge=m.useCallback(async(q,qe,Qe)=>{const We=I.current.get(q);if(We?.readyState===WebSocket.OPEN||We?.readyState===WebSocket.CONNECTING){console.log(`[Tab ${q}] WebSocket ๅทฒๅญ˜ๅœจ๏ผŒ่ทณ่ฟ‡่ฟžๆŽฅ`);return}N(!0);let Ds=null;try{const vs=await we("/api/webui/ws-token");if(vs.ok){const ls=await vs.json();if(ls.success&&ls.token)Ds=ls.token;else{console.warn(`[Tab ${q}] ่Žทๅ– WebSocket token ๅคฑ่ดฅ: ${ls.message||"ๆœช็™ปๅฝ•"}`),N(!1);return}}}catch(vs){console.error(`[Tab ${q}] ่Žทๅ– WebSocket token ๅคฑ่ดฅ:`,vs),N(!1);return}if(!Ds){N(!1);return}const as=window.location.protocol==="https:"?"wss:":"ws:",ks=new URLSearchParams;ks.append("token",Ds),qe==="virtual"&&Qe?(ks.append("user_id",Qe.userId),ks.append("user_name",Qe.userName),ks.append("platform",Qe.platform),ks.append("person_id",Qe.personId),ks.append("group_name",Qe.groupName||"WebUI่™šๆ‹Ÿ็พค่Š"),Qe.groupId&&ks.append("group_id",Qe.groupId)):(ks.append("user_id",Q.current),ks.append("user_name",w));const Ee=`${as}//${window.location.host}/api/chat/ws?${ks.toString()}`;console.log(`[Tab ${q}] ๆญฃๅœจ่ฟžๆŽฅ WebSocket:`,Ee);try{const vs=new WebSocket(Ee);I.current.set(q,vs),vs.onopen=()=>{U(q,{isConnected:!0}),N(!1),console.log(`[Tab ${q}] WebSocket ๅทฒ่ฟžๆŽฅ`)},vs.onmessage=ls=>{try{const es=JSON.parse(ls.data);switch(es.type){case"session_info":U(q,{sessionInfo:{session_id:es.session_id,user_id:es.user_id,user_name:es.user_name,bot_name:es.bot_name}});break;case"system":V(q,{id:K("sys"),type:"system",content:es.content||"",timestamp:es.timestamp||Date.now()/1e3});break;case"user_message":{const Ns=es.sender?.user_id,pt=qe==="virtual"&&Qe?Qe.userId:Q.current;console.log(`[Tab ${q}] ๆ”ถๅˆฐ user_message, sender: ${Ns}, current: ${pt}`);const Lt=Ns?Ns.replace(/^webui_user_/,""):"",tt=pt?pt.replace(/^webui_user_/,""):"";if(Lt&&tt&&Lt===tt){console.log(`[Tab ${q}] ่ทณ่ฟ‡่‡ชๅทฑ็š„ๆถˆๆฏ๏ผˆuser_id ๅŒน้…๏ผ‰`);break}const Es=je.current.get(q)||new Set,kt=`user-${es.content}-${Math.floor((es.timestamp||0)*1e3)}`;if(Es.has(kt)){console.log(`[Tab ${q}] ่ทณ่ฟ‡่‡ชๅทฑ็š„ๆถˆๆฏ๏ผˆๅ†…ๅฎนๅŽป้‡๏ผ‰`);break}if(Es.add(kt),je.current.set(q,Es),Es.size>100){const Ut=Es.values().next().value;Ut&&Es.delete(Ut)}V(q,{id:es.message_id||K("user"),type:"user",content:es.content||"",timestamp:es.timestamp||Date.now()/1e3,sender:es.sender});break}case"bot_message":{U(q,{isTyping:!1});const Ns=je.current.get(q)||new Set,pt=`bot-${es.content}-${Math.floor((es.timestamp||0)*1e3)}`;if(Ns.has(pt))break;if(Ns.add(pt),je.current.set(q,Ns),Ns.size>100){const Lt=Ns.values().next().value;Lt&&Ns.delete(Lt)}c(Lt=>Lt.map(tt=>{if(tt.id!==q)return tt;const Es=tt.messages.filter(Ut=>Ut.type!=="thinking"),kt={id:K("bot"),type:"bot",content:es.content||"",message_type:es.message_type==="rich"?"rich":"text",segments:es.segments,timestamp:es.timestamp||Date.now()/1e3,sender:es.sender};return{...tt,messages:[...Es,kt]}}));break}case"typing":U(q,{isTyping:es.is_typing||!1});break;case"error":c(Ns=>Ns.map(pt=>{if(pt.id!==q)return pt;const Lt=pt.messages.filter(tt=>tt.type!=="thinking");return{...pt,messages:[...Lt,{id:K("error"),type:"error",content:es.content||"ๅ‘็”Ÿ้”™่ฏฏ",timestamp:es.timestamp||Date.now()/1e3}]}})),Se({title:"้”™่ฏฏ",description:es.content,variant:"destructive"});break;case"pong":break;case"history":{const Ns=es.messages||[];if(Ns.length>0){const pt=je.current.get(q)||new Set,Lt=Ns.map(tt=>{const Es=tt.is_bot||!1,kt=tt.id||K(Es?"bot":"user"),Ut=`${Es?"bot":"user"}-${tt.content}-${Math.floor(tt.timestamp*1e3)}`;return pt.add(Ut),{id:kt,type:Es?"bot":"user",content:tt.content,timestamp:tt.timestamp,sender:{name:tt.sender_name||(Es?"้บฆ้บฆ":"็”จๆˆท"),user_id:tt.sender_id,is_bot:Es}}});je.current.set(q,pt),U(q,{messages:Lt}),console.log(`[Tab ${q}] ๅทฒๅŠ ่ฝฝ ${Lt.length} ๆกๅކๅฒๆถˆๆฏ`)}break}default:console.log("ๆœช็Ÿฅๆถˆๆฏ็ฑปๅž‹:",es.type)}}catch(es){console.error("่งฃๆžๆถˆๆฏๅคฑ่ดฅ:",es)}},vs.onclose=()=>{U(q,{isConnected:!1}),N(!1),I.current.delete(q),console.log(`[Tab ${q}] WebSocket ๅทฒๆ–ญๅผ€`);const ls=$.current.get(q);ls&&clearTimeout(ls);const es=window.setTimeout(()=>{if(!Y.current){const Ns=i.find(pt=>pt.id===q);Ns&&Ge(q,Ns.type,Ns.virtualConfig)}},5e3);$.current.set(q,es)},vs.onerror=ls=>{console.error(`[Tab ${q}] WebSocket ้”™่ฏฏ:`,ls),N(!1)}}catch(vs){console.error(`[Tab ${q}] ๅˆ›ๅปบ WebSocket ๅคฑ่ดฅ:`,vs),N(!1)}},[w,U,V,Se,i]),Y=m.useRef(!1);m.useEffect(()=>{Y.current=!1;const q=I.current,qe=$.current,Qe=je.current;oe("webui-default");const We=setTimeout(()=>{Y.current||(Ge("webui-default","webui"),i.forEach(as=>{as.type==="virtual"&&as.virtualConfig&&(Qe.set(as.id,new Set),setTimeout(()=>{Y.current||Ge(as.id,"virtual",as.virtualConfig)},200))}))},100),Ds=setInterval(()=>{q.forEach(as=>{as.readyState===WebSocket.OPEN&&as.send(JSON.stringify({type:"ping"}))})},3e4);return()=>{Y.current=!0,clearTimeout(We),clearInterval(Ds),qe.forEach(as=>{clearTimeout(as)}),qe.clear(),q.forEach(as=>{as.close()}),q.clear()}},[]);const te=m.useCallback(()=>{const q=I.current.get(u);if(!f.trim()||!q||q.readyState!==WebSocket.OPEN)return;const qe=h?.type==="virtual"&&h.virtualConfig?.userName||w,Qe=f.trim(),We=Date.now()/1e3;q.send(JSON.stringify({type:"message",content:Qe,user_name:qe}));const Ds=je.current.get(u)||new Set,as=`user-${Qe}-${Math.floor(We*1e3)}`;if(Ds.add(as),je.current.set(u,Ds),Ds.size>100){const vs=Ds.values().next().value;vs&&Ds.delete(vs)}const ks={id:K("user"),type:"user",content:Qe,timestamp:We,sender:{name:qe,is_bot:!1}};V(u,ks);const Ee={id:K("thinking"),type:"thinking",content:"",timestamp:We+.001,sender:{name:h?.sessionInfo.bot_name||"้บฆ้บฆ",is_bot:!0}};V(u,Ee),p("")},[f,w,u,h,V]),Oe=q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),te())},De=()=>{H(w),A(!0)},Me=()=>{const q=_.trim()||"WebUI็”จๆˆท";b(q),Pk(q),A(!1);const qe=I.current.get(u);qe?.readyState===WebSocket.OPEN&&qe.send(JSON.stringify({type:"update_nickname",user_name:q}))},de=()=>{H(""),A(!1)},Te=q=>new Date(q*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),rs=()=>{const q=I.current.get(u);q&&(q.close(),I.current.delete(u)),Ge(u,h?.type||"webui",h?.virtualConfig)},Rt=()=>{z({platform:"",personId:"",userId:"",userName:"",groupName:"",groupId:""}),ge(""),Ae(),C(!0)},ta=()=>{if(!fe.platform||!fe.personId){Se({title:"้…็ฝฎไธๅฎŒๆ•ด",description:"่ฏท้€‰ๆ‹ฉๅนณๅฐๅ’Œ็”จๆˆท",variant:"destructive"});return}const q=`webui_virtual_group_${fe.platform}_${fe.userId}`,qe=`virtual-${fe.platform}-${fe.userId}-${Date.now()}`,Qe=fe.userName||fe.userId,We={id:qe,type:"virtual",label:Qe,virtualConfig:{...fe,groupId:q},messages:[],isConnected:!1,isTyping:!1,sessionInfo:{}};c(Ds=>{const as=[...Ds,We],ks=as.filter(Ee=>Ee.type==="virtual"&&Ee.virtualConfig).map(Ee=>({id:Ee.id,label:Ee.label,virtualConfig:Ee.virtualConfig,createdAt:Date.now()}));return Eg(ks),as}),x(qe),C(!1),je.current.set(qe,new Set),setTimeout(()=>{Ge(qe,"virtual",fe)},100),Se({title:"่™šๆ‹Ÿ่บซไปฝๆ ‡็ญพ้กต",description:`ๅทฒๅˆ›ๅปบ ${Qe} ็š„ๅฏน่ฏ`})},Ga=(q,qe)=>{if(qe?.stopPropagation(),q==="webui-default")return;const Qe=I.current.get(q);Qe&&(Qe.close(),I.current.delete(q));const We=$.current.get(q);We&&(clearTimeout(We),$.current.delete(q)),je.current.delete(q),c(Ds=>{const as=Ds.filter(Ee=>Ee.id!==q),ks=as.filter(Ee=>Ee.type==="virtual"&&Ee.virtualConfig).map(Ee=>({id:Ee.id,label:Ee.label,virtualConfig:Ee.virtualConfig,createdAt:Date.now()}));return Eg(ks),as}),u===q&&x("webui-default")},Ht=q=>{x(q)},ut=q=>{z(qe=>({...qe,personId:q.person_id,userId:q.user_id,userName:q.nickname||q.person_name}))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx(Ps,{open:E,onOpenChange:C,children:e.jsxs(Us,{className:"sm:max-w-[500px] max-h-[85vh] overflow-hidden flex flex-col",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(pm,{className:"h-5 w-5"}),"ๆ–ฐๅปบ่™šๆ‹Ÿ่บซไปฝๅฏน่ฏ"]}),e.jsx(Ys,{children:"้€‰ๆ‹ฉไธ€ไธช้บฆ้บฆๅทฒ่ฎค่ฏ†็š„็”จๆˆท๏ผŒไปฅ่ฏฅ็”จๆˆท็š„่บซไปฝไธŽ้บฆ้บฆๅฏน่ฏใ€‚้บฆ้บฆๅฐ†ไฝฟ็”จๅฅนๅฏน่ฏฅ็”จๆˆท็š„่ฎฐๅฟ†ๅ’Œ่ฎค็Ÿฅๆฅๅ›žๅบ”ใ€‚"})]}),e.jsxs("div",{className:"space-y-4 flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(zo,{className:"h-4 w-4"}),"้€‰ๆ‹ฉๅนณๅฐ"]}),e.jsxs(Be,{value:fe.platform,onValueChange:q=>{z(qe=>({...qe,platform:q,personId:"",userId:"",userName:""})),ee([])},children:[e.jsx(Le,{disabled:R,children:e.jsx($e,{placeholder:R?"ๅŠ ่ฝฝไธญ...":"้€‰ๆ‹ฉๅนณๅฐ"})}),e.jsx(Ue,{children:M.map(q=>e.jsxs(W,{value:q.platform,children:[q.platform," (",q.count," ไบบ)"]},q.platform))})]})]}),fe.platform&&e.jsxs("div",{className:"space-y-2 flex-1 overflow-hidden flex flex-col",children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(zm,{className:"h-4 w-4"}),"้€‰ๆ‹ฉ็”จๆˆท"]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดข็”จๆˆทๅ...",value:se,onChange:q=>ge(q.target.value),className:"pl-9"})]}),e.jsx(Je,{className:"h-[250px] border rounded-md",children:e.jsx("div",{className:"p-2",children:ce?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Ls,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):O.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[e.jsx(zm,{className:"h-8 w-8 mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"ๆฒกๆœ‰ๆ‰พๅˆฐ็”จๆˆท"})]}):e.jsx("div",{className:"space-y-1",children:O.map(q=>e.jsxs("button",{onClick:()=>ut(q),className:P("w-full flex items-center gap-3 p-2 rounded-md text-left transition-colors",fe.personId===q.person_id?"bg-primary text-primary-foreground":"hover:bg-muted"),children:[e.jsx(Ii,{className:"h-8 w-8 shrink-0",children:e.jsx(Pi,{className:P("text-xs",fe.personId===q.person_id?"bg-primary-foreground/20":"bg-muted"),children:(q.nickname||q.person_name||"?").charAt(0)})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium truncate",children:q.nickname||q.person_name}),e.jsxs("div",{className:P("text-xs truncate",fe.personId===q.person_id?"text-primary-foreground/70":"text-muted-foreground"),children:["ID: ",q.user_id,q.is_known&&" ยท ๅทฒ่ฎค่ฏ†"]})]})]},q.person_id))})})})]}),fe.personId&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"่™šๆ‹Ÿ็พคๅ๏ผˆๅฏ้€‰๏ผ‰"}),e.jsx(ne,{placeholder:"WebUI่™šๆ‹Ÿ็พค่Š",value:fe.groupName,onChange:q=>z(qe=>({...qe,groupName:q.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"้บฆ้บฆไผš่ฎคไธบ่ฟ™ๆ˜ฏไธ€ไธชๅไธบๆญคๅ็งฐ็š„็พค่Š"})]})]}),e.jsxs(et,{className:"gap-2 sm:gap-0",children:[e.jsx(S,{variant:"outline",onClick:()=>C(!1),children:"ๅ–ๆถˆ"}),e.jsx(S,{onClick:ta,disabled:!fe.platform||!fe.personId,children:"ๅˆ›ๅปบๅฏน่ฏ"})]})]})}),e.jsx("div",{className:"shrink-0 border-b bg-muted/30",children:e.jsx("div",{className:"max-w-4xl mx-auto px-2 sm:px-4",children:e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto py-1.5 scrollbar-thin",children:[i.map(q=>e.jsxs("div",{className:P("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm whitespace-nowrap transition-colors cursor-pointer","hover:bg-muted",u===q.id?"bg-background shadow-sm border":"text-muted-foreground"),onClick:()=>Ht(q.id),children:[q.type==="webui"?e.jsx(Pa,{className:"h-3.5 w-3.5"}):e.jsx(pm,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"max-w-[100px] truncate",children:q.label}),e.jsx("span",{className:P("w-1.5 h-1.5 rounded-full",q.isConnected?"bg-green-500":"bg-muted-foreground/50")}),q.id!=="webui-default"&&e.jsx("span",{onClick:qe=>Ga(q.id,qe),className:"ml-0.5 p-0.5 rounded hover:bg-muted-foreground/20 cursor-pointer",role:"button",tabIndex:0,onKeyDown:qe=>{(qe.key==="Enter"||qe.key===" ")&&(qe.preventDefault(),Ga(q.id,qe))},children:e.jsx(Ca,{className:"h-3 w-3"})})]},q.id)),e.jsx("button",{onClick:Rt,className:"flex items-center gap-1 px-2 py-1.5 rounded-md text-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"ๆ–ฐๅปบ่™šๆ‹Ÿ่บซไปฝๅฏน่ฏ",children:e.jsx(Zs,{className:"h-3.5 w-3.5"})})]})})}),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(Ii,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:e.jsx(Pi,{className:"bg-primary/10 text-primary",children:e.jsx(Bi,{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:h?.sessionInfo.bot_name||"้บฆ้บฆ"}),e.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:h?.isConnected?e.jsxs(e.Fragment,{children:[e.jsx(r1,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"ๅทฒ่ฟžๆŽฅ"})]}):g?e.jsxs(e.Fragment,{children:[e.jsx(Ls,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"่ฟžๆŽฅไธญ..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(i1,{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(Ls,{className:"h-4 w-4 animate-spin text-muted-foreground"}),e.jsx(S,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:rs,disabled:g,title:"้‡ๆ–ฐ่ฟžๆŽฅ",children:e.jsx(ft,{className:P("h-4 w-4",g&&"animate-spin")})})]})]}),e.jsx("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:h?.type==="virtual"&&h.virtualConfig?e.jsxs(e.Fragment,{children:[e.jsx(pm,{className:"h-3 w-3 text-primary"}),e.jsx("span",{children:"่™šๆ‹Ÿ่บซไปฝ๏ผš"}),e.jsx("span",{className:"font-medium text-primary",children:h.virtualConfig.userName}),e.jsxs("span",{className:"text-xs",children:["(",h.virtualConfig.platform,")"]}),h.virtualConfig.groupName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1",children:"ยท"}),e.jsxs("span",{className:"text-xs",children:["็พค๏ผš",h.virtualConfig.groupName]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Bn,{className:"h-3 w-3"}),e.jsx("span",{children:"ๅฝ“ๅ‰่บซไปฝ๏ผš"}),D?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{value:_,onChange:q=>H(q.target.value),onKeyDown:q=>{q.key==="Enter"&&Me(),q.key==="Escape"&&de()},className:"h-7 w-32",placeholder:"่พ“ๅ…ฅๆ˜ต็งฐ",autoFocus:!0}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:Me,children:"ไฟๅญ˜"}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:de,children:"ๅ–ๆถˆ"})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium text-foreground",children:w}),e.jsx(S,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:De,title:"ไฟฎๆ”นๆ˜ต็งฐ",children:e.jsx(c1,{className:"h-3 w-3"})})]})]})})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Je,{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:[h?.messages.length===0&&!v&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(Bi,{className:"h-12 w-12 mb-4 opacity-50"}),e.jsxs("p",{className:"text-sm",children:["ๅผ€ๅง‹ไธŽ ",h?.sessionInfo.bot_name||"้บฆ้บฆ"," ๅฏน่ฏๅง๏ผ"]})]}),h?.messages.map(q=>e.jsxs("div",{className:P("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==="thinking"&&e.jsxs(e.Fragment,{children:[e.jsx(Ii,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pi,{className:"bg-primary/10 text-primary",children:e.jsx(Bi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:"flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",children:[e.jsx("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||h?.sessionInfo.bot_name})}),e.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"w-2 h-2 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-2 h-2 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-2 h-2 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),e.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"ๆ€่€ƒไธญ..."})]})})]})]}),(q.type==="user"||q.type==="bot")&&e.jsxs(e.Fragment,{children:[e.jsx(Ii,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:e.jsx(Pi,{className:P("text-xs",q.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:q.type==="bot"?e.jsx(Bi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):e.jsx(Bn,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),e.jsxs("div",{className:P("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"?h?.sessionInfo.bot_name:w)}),e.jsx("span",{children:Te(q.timestamp)})]}),e.jsx("div",{className:P("rounded-2xl px-3 py-2 text-sm break-words",q.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:e.jsx(Gk,{message:q,isBot:q.type==="bot"})})]})]})]},q.id)),e.jsx("div",{ref:L})]})})}),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(ne,{value:f,onChange:q=>p(q.target.value),onKeyDown:Oe,placeholder:h?.isConnected?"่พ“ๅ…ฅๆถˆๆฏ...":"็ญ‰ๅพ…่ฟžๆŽฅ...",disabled:!h?.isConnected,className:"flex-1 h-10 sm:h-10"}),e.jsx(S,{onClick:te,disabled:!h?.isConnected||!f.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:e.jsx(o1,{className:"h-4 w-4"})})]})})})]})}var ax="Radio",[qk,Uv]=Ho(ax),[Kk,Qk]=qk(ax),Bv=m.forwardRef((l,n)=>{const{__scopeRadio:i,name:c,checked:u=!1,required:x,disabled:h,value:f="on",onCheck:p,form:g,...N}=l,[v,y]=m.useState(null),w=Fo(n,A=>y(A)),b=m.useRef(!1),D=v?g||!!v.closest("form"):!0;return e.jsxs(Kk,{scope:i,checked:u,disabled:h,children:[e.jsx(Gn.button,{type:"button",role:"radio","aria-checked":u,"data-state":Hv(u),"data-disabled":h?"":void 0,disabled:h,value:f,...N,ref:w,onClick:un(l.onClick,A=>{u||p?.(),D&&(b.current=A.isPropagationStopped(),b.current||A.stopPropagation())})}),D&&e.jsx(Pv,{control:v,bubbles:!b.current,name:c,value:f,checked:u,required:x,disabled:h,form:g,style:{transform:"translateX(-100%)"}})]})});Bv.displayName=ax;var $v="RadioIndicator",Iv=m.forwardRef((l,n)=>{const{__scopeRadio:i,forceMount:c,...u}=l,x=Qk($v,i);return e.jsx(Tw,{present:c||x.checked,children:e.jsx(Gn.span,{"data-state":Hv(x.checked),"data-disabled":x.disabled?"":void 0,...u,ref:n})})});Iv.displayName=$v;var Yk="RadioBubbleInput",Pv=m.forwardRef(({__scopeRadio:l,control:n,checked:i,bubbles:c=!0,...u},x)=>{const h=m.useRef(null),f=Fo(h,x),p=Ew(i),g=Mw(n);return m.useEffect(()=>{const N=h.current;if(!N)return;const v=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==i&&w){const b=new Event("click",{bubbles:c});w.call(N,i),N.dispatchEvent(b)}},[p,i,c]),e.jsx(Gn.input,{type:"radio","aria-hidden":!0,defaultChecked:i,...u,tabIndex:-1,ref:f,style:{...u.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Pv.displayName=Yk;function Hv(l){return l?"checked":"unchecked"}var Jk=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ed="RadioGroup",[Xk]=Ho(ed,[Xg,Uv]),Fv=Xg(),Gv=Uv(),[Zk,Wk]=Xk(ed),Vv=m.forwardRef((l,n)=>{const{__scopeRadioGroup:i,name:c,defaultValue:u,value:x,required:h=!1,disabled:f=!1,orientation:p,dir:g,loop:N=!0,onValueChange:v,...y}=l,w=Fv(i),b=xj(g),[D,A]=Po({prop:x,defaultProp:u??null,onChange:v,caller:ed});return e.jsx(Zk,{scope:i,name:c,required:h,disabled:f,value:D,onValueChange:A,children:e.jsx(H0,{asChild:!0,...w,orientation:p,dir:b,loop:N,children:e.jsx(Gn.div,{role:"radiogroup","aria-required":h,"aria-orientation":p,"data-disabled":f?"":void 0,dir:b,...y,ref:n})})})});Vv.displayName=ed;var qv="RadioGroupItem",Kv=m.forwardRef((l,n)=>{const{__scopeRadioGroup:i,disabled:c,...u}=l,x=Wk(qv,i),h=x.disabled||c,f=Fv(i),p=Gv(i),g=m.useRef(null),N=Fo(n,g),v=x.value===u.value,y=m.useRef(!1);return m.useEffect(()=>{const w=D=>{Jk.includes(D.key)&&(y.current=!0)},b=()=>y.current=!1;return document.addEventListener("keydown",w),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",b)}},[]),e.jsx(F0,{asChild:!0,...f,focusable:!h,active:v,children:e.jsx(Bv,{disabled:h,required:x.required,checked:v,...p,...u,name:x.name,ref:N,onCheck:()=>x.onValueChange(u.value),onKeyDown:un(w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:un(u.onFocus,()=>{y.current&&g.current?.click()})})})});Kv.displayName=qv;var eC="RadioGroupIndicator",Qv=m.forwardRef((l,n)=>{const{__scopeRadioGroup:i,...c}=l,u=Gv(i);return e.jsx(Iv,{...u,...c,ref:n})});Qv.displayName=eC;var Yv=Vv,Jv=Kv,sC=Qv;const lx=m.forwardRef(({className:l,...n},i)=>e.jsx(Yv,{className:P("grid gap-2",l),...n,ref:i}));lx.displayName=Yv.displayName;const $o=m.forwardRef(({className:l,...n},i)=>e.jsx(Jv,{ref:i,className:P("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",l),...n,children:e.jsx(sC,{className:"flex items-center justify-center",children:e.jsx(Ao,{className:"h-2.5 w-2.5 fill-current text-current"})})}));$o.displayName=Jv.displayName;function tC({question:l,value:n,onChange:i,error:c,disabled:u=!1}){const[x,h]=m.useState(null),f=u||l.readOnly,p=()=>{switch(l.type){case"single":return e.jsx(lx,{value:n||"",onValueChange:i,disabled:f,className:"space-y-2",children:l.options?.map(g=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx($o,{value:g.value,id:`${l.id}-${g.id}`}),e.jsx(T,{htmlFor:`${l.id}-${g.id}`,className:"cursor-pointer font-normal",children:g.label})]},g.id))});case"multiple":{const g=n||[];return e.jsxs("div",{className:"space-y-2",children:[l.options?.map(N=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:`${l.id}-${N.id}`,checked:g.includes(N.value),disabled:f||l.maxSelections!==void 0&&g.length>=l.maxSelections&&!g.includes(N.value),onCheckedChange:v=>{i(v?[...g,N.value]:g.filter(y=>y!==N.value))}}),e.jsx(T,{htmlFor:`${l.id}-${N.id}`,className:"cursor-pointer font-normal",children:N.label})]},N.id)),l.maxSelections&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ๆœ€ๅคš้€‰ๆ‹ฉ ",l.maxSelections," ้กน"]})]})}case"text":return e.jsx(ne,{value:n||"",onChange:g=>i(g.target.value),placeholder:l.placeholder||"่ฏท่พ“ๅ…ฅ...",disabled:f,readOnly:l.readOnly,maxLength:l.maxLength,className:P(l.readOnly&&"bg-muted cursor-not-allowed")});case"textarea":return e.jsxs("div",{className:"space-y-1",children:[e.jsx(at,{value:n||"",onChange:g=>i(g.target.value),placeholder:l.placeholder||"่ฏท่พ“ๅ…ฅ...",disabled:f,readOnly:l.readOnly,maxLength:l.maxLength,rows:4,className:P(l.readOnly&&"bg-muted cursor-not-allowed")}),l.maxLength&&e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[(n||"").length," / ",l.maxLength]})]});case"rating":{const g=n||0,N=x!==null?x:g;return e.jsxs("div",{className:"flex items-center gap-1",children:[[1,2,3,4,5].map(v=>e.jsx("button",{type:"button",disabled:f,className:P("p-1 transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded",f&&"cursor-not-allowed opacity-50"),onMouseEnter:()=>!f&&h(v),onMouseLeave:()=>h(null),onClick:()=>!f&&i(v),children:e.jsx(rn,{className:P("h-6 w-6 transition-colors",v<=N?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})},v)),g>0&&e.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[g," / 5"]})]})}case"scale":{const g=l.min??1,N=l.max??10,v=l.step??1,y=n??g;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(_a,{value:[y],onValueChange:([w])=>i(w),min:g,max:N,step:v,disabled:f}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:l.minLabel||g}),e.jsx("span",{className:"font-medium text-foreground",children:y}),e.jsx("span",{children:l.maxLabel||N})]})]})}case"dropdown":return e.jsxs(Be,{value:n||"",onValueChange:i,disabled:f,children:[e.jsx(Le,{children:e.jsx($e,{placeholder:l.placeholder||"่ฏท้€‰ๆ‹ฉ..."})}),e.jsx(Ue,{children:l.options?.map(g=>e.jsx(W,{value:g.value,children:g.label},g.id))})]});default:return e.jsx("div",{className:"text-muted-foreground",children:"ไธๆ”ฏๆŒ็š„้—ฎ้ข˜็ฑปๅž‹"})}};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(T,{className:"text-base font-medium",children:[l.title,l.required&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:l.description})]}),p(),c&&e.jsx("p",{className:"text-sm text-destructive",children:c})]})}const Xv="https://maibot-plugin-stats.maibot-webui.workers.dev";function Zv(){const l="maibot_user_id";let n=localStorage.getItem(l);if(!n){const i=Math.random().toString(36).substring(2,10),c=Date.now().toString(36),u=Math.random().toString(36).substring(2,10);n=`fp_${i}_${c}_${u}`,localStorage.setItem(l,n)}return n}async function aC(l,n,i,c){try{const u=c?.userId||Zv(),x={surveyId:l,surveyVersion:n,userId:u,answers:i,submittedAt:new Date().toISOString(),allowMultiple:c?.allowMultiple,metadata:{userAgent:navigator.userAgent,language:navigator.language}},h=await fetch(`${Xv}/survey/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)}),f=await h.json();return h.status===429?{success:!1,error:"ๆไบค่ฟ‡ไบŽ้ข‘็น๏ผŒ่ฏท็จๅŽๅ†่ฏ•"}:h.status===409?{success:!1,error:f.error||"ไฝ ๅทฒ็ปๆไบค่ฟ‡่ฟ™ไปฝ้—ฎๅทไบ†"}:h.ok?{success:!0,submissionId:f.submissionId,message:f.message}:{success:!1,error:f.error||"ๆไบคๅคฑ่ดฅ"}}catch(u){return console.error("Error submitting survey:",u),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}async function lC(l,n){try{const i=n||Zv(),c=new URLSearchParams({user_id:i,survey_id:l}),u=await fetch(`${Xv}/survey/check?${c}`);return u.ok?{success:!0,hasSubmitted:(await u.json()).hasSubmitted}:{success:!1,error:(await u.json()).error||"ๆฃ€ๆŸฅๅคฑ่ดฅ"}}catch(i){return console.error("Error checking submission:",i),{success:!1,error:"็ฝ‘็ปœ้”™่ฏฏ"}}}function Wv({config:l,initialAnswers:n,onSubmitSuccess:i,onSubmitError:c,showProgress:u=!0,paginateQuestions:x=!1,className:h}){const f=m.useCallback(()=>!n||n.length===0?{}:n.reduce((I,L)=>(I[L.questionId]=L.value,I),{}),[n]),[p,g]=m.useState(()=>f()),[N,v]=m.useState({}),[y,w]=m.useState(0),[b,D]=m.useState(!1),[A,_]=m.useState(!1),[H,E]=m.useState(null),[C,M]=m.useState(null),[G,O]=m.useState(!1),[ee,R]=m.useState(!0);m.useEffect(()=>{n&&n.length>0&&g(I=>({...I,...f()}))},[n,f]),m.useEffect(()=>{(async()=>{if(!l.settings?.allowMultiple){const L=await lC(l.id);L.success&&L.hasSubmitted&&O(!0)}R(!1)})()},[l.id,l.settings?.allowMultiple]);const me=m.useCallback(()=>{const I=new Date;return!(l.settings?.startTime&&new Date(l.settings.startTime)>I||l.settings?.endTime&&new Date(l.settings.endTime){const L=p[I.id];return L==null?!1:Array.isArray(L)?L.length>0:typeof L=="string"?L.trim()!=="":!0}).length,ve=ce/l.questions.length*100,se=m.useCallback((I,L)=>{g($=>({...$,[I]:L})),v($=>{const _e={...$};return delete _e[I],_e})},[]),ge=m.useCallback(()=>{const I={};for(const L of l.questions){if(L.required){const $=p[L.id];if($==null){I[L.id]="ๆญค้ข˜ไธบๅฟ…ๅกซ้กน";continue}if(Array.isArray($)&&$.length===0){I[L.id]="่ฏท่‡ณๅฐ‘้€‰ๆ‹ฉไธ€้กน";continue}if(typeof $=="string"&&$.trim()===""){I[L.id]="ๆญค้ข˜ไธบๅฟ…ๅกซ้กน";continue}}L.minLength&&typeof p[L.id]=="string"&&p[L.id].length{if(!ge()){if(x){const I=l.questions.findIndex(L=>N[L.id]);I>=0&&w(I)}return}D(!0),E(null);try{const I=l.questions.filter($=>p[$.id]!==void 0).map($=>({questionId:$.id,value:p[$.id]})),L=await aC(l.id,l.version,I,{allowMultiple:l.settings?.allowMultiple});if(L.success&&L.submissionId)_(!0),M(L.submissionId),i?.(L.submissionId);else{const $=L.error||"ๆไบคๅคฑ่ดฅ";E($),c?.($)}}catch(I){const L=I instanceof Error?I.message:"ๆไบคๅคฑ่ดฅ";E(L),c?.(L)}finally{D(!1)}},[ge,x,l,p,N,i,c]),z=m.useCallback(I=>{I>=0&&Ie.jsxs("div",{className:P("p-4 rounded-lg border bg-card",N[I.id]?"border-destructive bg-destructive/5":"border-border"),children:[x&&e.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:["้—ฎ้ข˜ ",y+1," / ",l.questions.length]}),!x&&e.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:[L+1,"."]}),e.jsx(tC,{question:I,value:p[I.id],onChange:$=>se(I.id,$),error:N[I.id],disabled:b})]},I.id)),H&&e.jsxs(lt,{variant:"destructive",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(nt,{children:H})]}),e.jsx("div",{className:"flex justify-between items-center py-4",children:x?e.jsxs(e.Fragment,{children:[e.jsxs(S,{variant:"outline",onClick:()=>z(y-1),disabled:y===0||b,children:[e.jsx(Fa,{className:"h-4 w-4 mr-1"}),"ไธŠไธ€้ข˜"]}),y===l.questions.length-1?e.jsxs(S,{onClick:fe,disabled:b,children:[b&&e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๆไบค้—ฎๅท"]}):e.jsxs(S,{onClick:()=>z(y+1),disabled:b,children:["ไธ‹ไธ€้ข˜",e.jsx(sa,{className:"h-4 w-4 ml-1"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:Object.keys(N).length>0&&e.jsxs("span",{className:"text-destructive",children:["่ฟ˜ๆœ‰ ",Object.keys(N).length," ไธชๅฟ…ๅกซ้กนๆœชๅฎŒๆˆ"]})}),e.jsxs(S,{onClick:fe,disabled:b,size:"lg",children:[b&&e.jsx(Ls,{className:"h-4 w-4 mr-2 animate-spin"}),"ๆไบค้—ฎๅท"]})]})})]})})]})}const nC={id:"webui-feedback-v1",version:"1.0.0",title:"้บฆ้บฆ WebUI ไฝฟ็”จๅ้ฆˆ้—ฎๅท",description:"ๆ„Ÿ่ฐขๆ‚จไฝฟ็”จ้บฆ้บฆ WebUI๏ผๆ‚จ็š„ๅ้ฆˆๅฐ†ๅธฎๅŠฉๆˆ‘ไปฌไธๆ–ญๆ”น่ฟ›ไบงๅ“ไฝ“้ชŒใ€‚",questions:[{id:"webui_version",type:"text",title:"ไฝ ๆญฃๅœจไฝฟ็”จ็š„ WebUI ็‰ˆๆœฌ",description:"ๆญค้กน็”ฑ็ณป็ปŸ่‡ชๅŠจๅกซๅ†™",required:!0,readOnly:!0,placeholder:"่‡ชๅŠจๆฃ€ๆต‹ไธญ..."},{id:"ui_design_satisfaction",type:"single",title:"ไฝ ่ง‰ๅพ—ๅฝ“ๅ‰็š„ WebUI ็•Œ้ข่ฎพ่ฎกๅฆ‚ไฝ•๏ผŸ",required:!0,options:[{id:"very_satisfied",label:"้žๅธธๆปกๆ„",value:"very_satisfied"},{id:"satisfied",label:"ๆปกๆ„",value:"satisfied"},{id:"neutral",label:"ไธ€่ˆฌ",value:"neutral"},{id:"dissatisfied",label:"ไธๆปกๆ„",value:"dissatisfied"},{id:"very_dissatisfied",label:"้žๅธธไธๆปกๆ„",value:"very_dissatisfied"}]},{id:"problems_encountered",type:"multiple",title:"ไฝ ๅœจไฝฟ็”จ WebUI ๆ—ถ้‡ๅˆฐ่ฟ‡ๅ“ชไบ›้—ฎ้ข˜๏ผŸ",description:"ๅฏๅคš้€‰",required:!0,options:[{id:"lag",label:"็•Œ้ขๅก้กฟ",value:"lag"},{id:"incomplete",label:"ๅŠŸ่ƒฝไธๅฎŒๆ•ด",value:"incomplete"},{id:"complex",label:"ๆ“ไฝœๅคๆ‚",value:"complex"},{id:"bugs",label:"ๅญ˜ๅœจ Bug",value:"bugs"},{id:"none",label:"ๆฒกๆœ‰้‡ๅˆฐ้—ฎ้ข˜",value:"none"},{id:"other",label:"ๅ…ถไป–",value:"other"}]},{id:"problems_other",type:"text",title:'ๅฆ‚้€‰ๆ‹ฉ"ๅ…ถไป–"๏ผŒ่ฏท่ฏดๆ˜Ž้‡ๅˆฐ็š„้—ฎ้ข˜',required:!1,placeholder:"่ฏทๆ่ฟฐไฝ ้‡ๅˆฐ็š„ๅ…ถไป–้—ฎ้ข˜...",maxLength:500},{id:"useful_features",type:"textarea",title:"ไฝ ่ง‰ๅพ—ๅ“ชไบ›ๅŠŸ่ƒฝๆ˜ฏๆœ€ๆœ‰็”จ็š„๏ผŸ",required:!0,placeholder:"่ฏทๅˆ†ไบซไฝ ่ฎคไธบๆœ€ๆœ‰ไปทๅ€ผ็š„ๅŠŸ่ƒฝ...",maxLength:1e3},{id:"feature_requests",type:"textarea",title:"ไฝ ๅธŒๆœ›ๅœจๆœชๆฅ็š„็‰ˆๆœฌไธญๅขžๅŠ ๅ“ชไบ›ๅŠŸ่ƒฝ๏ผŸ",required:!0,placeholder:"่ฏทๅ‘Š่ฏ‰ๆˆ‘ไปฌไฝ ๆœŸๆœ›็š„ๆ–ฐๅŠŸ่ƒฝ...",maxLength:1e3},{id:"overall_satisfaction",type:"single",title:"ไฝ ๅฏน้บฆ้บฆ WebUI ็š„ๆ•ดไฝ“ๆปกๆ„ๅบฆๅฆ‚ไฝ•๏ผŸ",required:!0,options:[{id:"very_satisfied",label:"้žๅธธๆปกๆ„",value:"very_satisfied"},{id:"satisfied",label:"ๆปกๆ„",value:"satisfied"},{id:"neutral",label:"ไธ€่ˆฌ",value:"neutral"},{id:"dissatisfied",label:"ไธๆปกๆ„",value:"dissatisfied"},{id:"very_dissatisfied",label:"้žๅธธไธๆปกๆ„",value:"very_dissatisfied"}]},{id:"would_recommend",type:"single",title:"ไฝ ๆ„ฟๆ„ๆŽจ่้บฆ้บฆ WebUI ็ป™ๅ…ถไป–ไบบไฝฟ็”จๅ—๏ผŸ",required:!0,options:[{id:"yes",label:"ๆ˜ฏ",value:"yes"},{id:"no",label:"ๅฆ",value:"no"}]},{id:"other_suggestions",type:"textarea",title:"ๅ…ถไป–ๅปบ่ฎฎๆˆ–ๆ„่ง",description:"ๆญค้กนไธบ้€‰ๅกซ",required:!1,placeholder:"ๅฆ‚ๆžœไฝ ๆœ‰ไปปไฝ•ๅ…ถไป–ๆƒณๆณ•ๆˆ–ๅปบ่ฎฎ๏ผŒ่ฏทๅœจๆญคๅˆ†ไบซ...",maxLength:2e3}],settings:{allowMultiple:!1,thankYouMessage:"ๆ„Ÿ่ฐขไฝ ็š„ๅ้ฆˆ๏ผไฝ ็š„ๆ„่งๅฏนๆˆ‘ไปฌ้žๅธธ้‡่ฆ๏ผŒๆˆ‘ไปฌไผš่ฎค็œŸ่€ƒ่™‘ๆฏไธ€ๆกๅปบ่ฎฎใ€‚"}},rC={id:"maibot-feedback-v1",version:"1.0.0",title:"้บฆ้บฆไฝฟ็”จไฝ“้ชŒๅ้ฆˆ้—ฎๅท",description:"ๆ„Ÿ่ฐขๆ‚จไฝฟ็”จ้บฆ้บฆ๏ผๆ‚จ็š„ๅ้ฆˆๅฐ†ๅธฎๅŠฉๆˆ‘ไปฌๆ‰“้€ ๆ›ดๅฅฝ็š„ AI ไผ™ไผดใ€‚",questions:[{id:"maibot_version",type:"text",title:"ไฝ ๆญฃๅœจไฝฟ็”จ็š„้บฆ้บฆ็‰ˆๆœฌ",description:"ๆญค้กน็”ฑ็ณป็ปŸ่‡ชๅŠจๅกซๅ†™",required:!0,readOnly:!0,placeholder:"่‡ชๅŠจๆฃ€ๆต‹ไธญ..."},{id:"improvement_areas",type:"textarea",title:"ไฝ ่ฎคไธบ้บฆ้บฆ่ฟ˜ๆœ‰ๅ“ชไบ›้ƒจๅˆ†ๅฏไปฅๆ”น่ฟ›๏ผŸ",required:!0,placeholder:"่ฏทๅˆ†ไบซไฝ ่ฎคไธบๅฏไปฅๆ”น่ฟ›็š„ๆ–น้ข...",maxLength:1e3},{id:"problems_encountered",type:"multiple",title:"ไฝ ๅœจไฝฟ็”จ้บฆ้บฆๆ—ถ้‡ๅˆฐ่ฟ‡ๅ“ชไบ›้—ฎ้ข˜๏ผŸ",description:"ๅฏๅคš้€‰",required:!0,options:[{id:"incomplete",label:"ๅŠŸ่ƒฝไธๅฎŒๆ•ด",value:"incomplete"},{id:"slow_response",label:"ๅ“ๅบ”้€Ÿๅบฆๆ…ข",value:"slow_response"},{id:"complex",label:"ๆ“ไฝœๅคๆ‚",value:"complex"},{id:"unstable",label:"่ฟ่กŒไธ็จณๅฎš",value:"unstable"},{id:"config_difficult",label:"้…็ฝฎๅ›ฐ้šพ",value:"config_difficult"},{id:"none",label:"ๆฒกๆœ‰้‡ๅˆฐ้—ฎ้ข˜",value:"none"},{id:"other",label:"ๅ…ถไป–",value:"other"}]},{id:"problems_other",type:"text",title:'ๅฆ‚้€‰ๆ‹ฉ"ๅ…ถไป–"๏ผŒ่ฏท่ฏดๆ˜Ž้‡ๅˆฐ็š„้—ฎ้ข˜',required:!1,placeholder:"่ฏทๆ่ฟฐไฝ ้‡ๅˆฐ็š„ๅ…ถไป–้—ฎ้ข˜...",maxLength:500},{id:"helpful_features",type:"textarea",title:"ไฝ ่ง‰ๅพ—้บฆ้บฆ็š„ๅ“ชไบ›ๅŠŸ่ƒฝๅฏนไฝ ๆœ€ๆœ‰ๅธฎๅŠฉ๏ผŸ",required:!0,placeholder:"่ฏทๅˆ†ไบซๅฏนไฝ ๆœ€ๆœ‰ๅธฎๅŠฉ็š„ๅŠŸ่ƒฝ...",maxLength:1e3},{id:"feature_requests",type:"textarea",title:"ไฝ ๅธŒๆœ›ๅœจๆœชๆฅ็š„็‰ˆๆœฌไธญๅขžๅŠ ๅ“ชไบ›ๅŠŸ่ƒฝ๏ผŸ",required:!0,placeholder:"่ฏทๅ‘Š่ฏ‰ๆˆ‘ไปฌไฝ ๆœŸๆœ›็š„ๆ–ฐๅŠŸ่ƒฝ...",maxLength:1e3},{id:"overall_satisfaction",type:"single",title:"ไฝ ๅฏน้บฆ้บฆ็š„ๆ•ดไฝ“ๆปกๆ„ๅบฆๅฆ‚ไฝ•๏ผŸ",required:!0,options:[{id:"very_satisfied",label:"้žๅธธๆปกๆ„",value:"very_satisfied"},{id:"satisfied",label:"ๆปกๆ„",value:"satisfied"},{id:"neutral",label:"ไธ€่ˆฌ",value:"neutral"},{id:"dissatisfied",label:"ไธๆปกๆ„",value:"dissatisfied"},{id:"very_dissatisfied",label:"้žๅธธไธๆปกๆ„",value:"very_dissatisfied"}]},{id:"would_recommend",type:"single",title:"ไฝ ๆ„ฟๆ„ๆŽจ่้บฆ้บฆ็ป™ๅ…ถไป–ไบบไฝฟ็”จๅ—๏ผŸ",required:!0,options:[{id:"yes",label:"ๆ˜ฏ",value:"yes"},{id:"no",label:"ๅฆ",value:"no"}]},{id:"other_suggestions",type:"textarea",title:"ๅ…ถไป–ๅปบ่ฎฎๆˆ–ๆ„่ง",description:"ๆญค้กนไธบ้€‰ๅกซ",required:!1,placeholder:"ๅฆ‚ๆžœไฝ ๆœ‰ไปปไฝ•ๅ…ถไป–ๆƒณๆณ•ๆˆ–ๅปบ่ฎฎ๏ผŒ่ฏทๅœจๆญคๅˆ†ไบซ...",maxLength:2e3}],settings:{allowMultiple:!1,thankYouMessage:"ๆ„Ÿ่ฐขไฝ ็š„ๅ้ฆˆ๏ผไฝ ็š„ๆ„่งๅฏน้บฆ้บฆ็š„ๆˆ้•ฟ้žๅธธ้‡่ฆ๏ผŒๆˆ‘ไปฌไผš่ฎค็œŸ่€ƒ่™‘ๆฏไธ€ๆกๅปบ่ฎฎใ€‚"}};function iC(){const[l,n]=m.useState(!0),i=m.useMemo(()=>JSON.parse(JSON.stringify(nC)),[]);m.useEffect(()=>{n(!1)},[]);const c=m.useMemo(()=>[{questionId:"webui_version",value:`v${Ko}`}],[]),u=m.useCallback(h=>{console.log("WebUI Survey submitted:",h)},[]),x=m.useCallback(h=>{console.error("WebUI Survey submission error:",h)},[]);return l?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i?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 shrink-0",children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(Oj,{className:"h-8 w-8",strokeWidth:2}),"WebUI ไฝฟ็”จๅ้ฆˆ้—ฎๅท"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆ„Ÿ่ฐขๆ‚จ็š„ๅ้ฆˆ๏ผŒๅธฎๅŠฉๆˆ‘ไปฌๆŒ็ปญๆ”น่ฟ›ไบงๅ“ไฝ“้ชŒ"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Wv,{config:i,initialAnswers:c,showProgress:!0,paginateQuestions:!1,onSubmitSuccess:u,onSubmitError:x})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[e.jsxs(lt,{variant:"destructive",className:"max-w-md",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(nt,{children:"ๆ— ๆณ•ๅŠ ่ฝฝ้—ฎๅท้…็ฝฎ"})]}),e.jsx(S,{variant:"outline",onClick:()=>window.location.reload(),children:"้‡่ฏ•"})]})}function cC(){const[l,n]=m.useState(null),[i,c]=m.useState(!0),[u,x]=m.useState("ๆœช็Ÿฅ็‰ˆๆœฌ");m.useEffect(()=>{(async()=>{try{const v=await W1();x(v.version||"ๆœช็Ÿฅ็‰ˆๆœฌ")}catch(v){console.error("Failed to get MaiBot version:",v),x("่Žทๅ–ๅคฑ่ดฅ")}const N=JSON.parse(JSON.stringify(rC));n(N),c(!1)})()},[]);const h=m.useMemo(()=>[{questionId:"maibot_version",value:u}],[u]),f=m.useCallback(g=>{console.log("MaiBot Survey submitted:",g)},[]),p=m.useCallback(g=>{console.error("MaiBot Survey submission error:",g)},[]);return i?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx(Ls,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):l?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 shrink-0",children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(Oj,{className:"h-8 w-8",strokeWidth:2}),"้บฆ้บฆไฝฟ็”จไฝ“้ชŒๅ้ฆˆ้—ฎๅท"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆ„Ÿ่ฐขๆ‚จ็š„ๅ้ฆˆ๏ผŒๅธฎๅŠฉๆˆ‘ไปฌๆ‰“้€ ๆ›ดๅฅฝ็š„ AI ไผ™ไผด"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Wv,{config:l,initialAnswers:h,showProgress:!0,paginateQuestions:!1,onSubmitSuccess:f,onSubmitError:p})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[e.jsxs(lt,{variant:"destructive",className:"max-w-md",children:[e.jsx(St,{className:"h-4 w-4"}),e.jsx(nt,{children:"ๆ— ๆณ•ๅŠ ่ฝฝ้—ฎๅท้…็ฝฎ"})]}),e.jsx(S,{variant:"outline",onClick:()=>window.location.reload(),children:"้‡่ฏ•"})]})}var sd="DropdownMenu",[oC]=Ho(sd,[Zg]),ca=Zg(),[dC,eN]=oC(sd),sN=l=>{const{__scopeDropdownMenu:n,children:i,dir:c,open:u,defaultOpen:x,onOpenChange:h,modal:f=!0}=l,p=ca(n),g=m.useRef(null),[N,v]=Po({prop:u,defaultProp:x??!1,onChange:h,caller:sd});return e.jsx(dC,{scope:n,triggerId:Am(),triggerRef:g,contentId:Am(),open:N,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(y=>!y),[v]),modal:f,children:e.jsx(ew,{...p,open:N,onOpenChange:v,dir:c,modal:f,children:i})})};sN.displayName=sd;var tN="DropdownMenuTrigger",aN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,disabled:c=!1,...u}=l,x=eN(tN,i),h=ca(i);return e.jsx(sw,{asChild:!0,...h,children:e.jsx(Gn.button,{type:"button",id:x.triggerId,"aria-haspopup":"menu","aria-expanded":x.open,"aria-controls":x.open?x.contentId:void 0,"data-state":x.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:Aw(n,x.triggerRef),onPointerDown:un(l.onPointerDown,f=>{!c&&f.button===0&&f.ctrlKey===!1&&(x.onOpenToggle(),x.open||f.preventDefault())}),onKeyDown:un(l.onKeyDown,f=>{c||(["Enter"," "].includes(f.key)&&x.onOpenToggle(),f.key==="ArrowDown"&&x.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});aN.displayName=tN;var uC="DropdownMenuPortal",lN=l=>{const{__scopeDropdownMenu:n,...i}=l,c=ca(n);return e.jsx(q0,{...c,...i})};lN.displayName=uC;var nN="DropdownMenuContent",rN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=eN(nN,i),x=ca(i),h=m.useRef(!1);return e.jsx(K0,{id:u.contentId,"aria-labelledby":u.triggerId,...x,...c,ref:n,onCloseAutoFocus:un(l.onCloseAutoFocus,f=>{h.current||u.triggerRef.current?.focus(),h.current=!1,f.preventDefault()}),onInteractOutside:un(l.onInteractOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0,N=p.button===2||g;(!u.modal||N)&&(h.current=!0)}),style:{...l.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rN.displayName=nN;var mC="DropdownMenuGroup",xC=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(tw,{...u,...c,ref:n})});xC.displayName=mC;var hC="DropdownMenuLabel",iN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(Z0,{...u,...c,ref:n})});iN.displayName=hC;var fC="DropdownMenuItem",cN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(Q0,{...u,...c,ref:n})});cN.displayName=fC;var pC="DropdownMenuCheckboxItem",oN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(Y0,{...u,...c,ref:n})});oN.displayName=pC;var gC="DropdownMenuRadioGroup",jC=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(aw,{...u,...c,ref:n})});jC.displayName=gC;var vC="DropdownMenuRadioItem",dN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(X0,{...u,...c,ref:n})});dN.displayName=vC;var NC="DropdownMenuItemIndicator",uN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(J0,{...u,...c,ref:n})});uN.displayName=NC;var bC="DropdownMenuSeparator",mN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(W0,{...u,...c,ref:n})});mN.displayName=bC;var yC="DropdownMenuArrow",wC=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(lw,{...u,...c,ref:n})});wC.displayName=yC;var _C="DropdownMenuSubTrigger",xN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(G0,{...u,...c,ref:n})});xN.displayName=_C;var SC="DropdownMenuSubContent",hN=m.forwardRef((l,n)=>{const{__scopeDropdownMenu:i,...c}=l,u=ca(i);return e.jsx(V0,{...u,...c,ref:n,style:{...l.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hN.displayName=SC;var kC=sN,CC=aN,TC=lN,fN=rN,pN=iN,gN=cN,jN=oN,vN=dN,NN=uN,bN=mN,yN=xN,wN=hN;const EC=kC,MC=CC,AC=m.forwardRef(({className:l,inset:n,children:i,...c},u)=>e.jsxs(yN,{ref:u,className:P("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",l),...c,children:[i,e.jsx(sa,{className:"ml-auto h-4 w-4"})]}));AC.displayName=yN.displayName;const zC=m.forwardRef(({className:l,...n},i)=>e.jsx(wN,{ref:i,className:P("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",l),...n}));zC.displayName=wN.displayName;const _N=m.forwardRef(({className:l,sideOffset:n=4,...i},c)=>e.jsx(TC,{children:e.jsx(fN,{ref:c,sideOffset:n,className:P("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",l),...i})}));_N.displayName=fN.displayName;const SN=m.forwardRef(({className:l,inset:n,...i},c)=>e.jsx(gN,{ref:c,className:P("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",l),...i}));SN.displayName=gN.displayName;const DC=m.forwardRef(({className:l,children:n,checked:i,...c},u)=>e.jsxs(jN,{ref:u,className:P("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l),checked:i,...c,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(NN,{children:e.jsx(_t,{className:"h-4 w-4"})})}),n]}));DC.displayName=jN.displayName;const OC=m.forwardRef(({className:l,children:n,...i},c)=>e.jsxs(vN,{ref:c,className:P("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l),...i,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(NN,{children:e.jsx(Ao,{className:"h-2 w-2 fill-current"})})}),n]}));OC.displayName=vN.displayName;const RC=m.forwardRef(({className:l,inset:n,...i},c)=>e.jsx(pN,{ref:c,className:P("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",l),...i}));RC.displayName=pN.displayName;const LC=m.forwardRef(({className:l,...n},i)=>e.jsx(bN,{ref:i,className:P("-mx-1 my-1 h-px bg-muted",l),...n}));LC.displayName=bN.displayName;const kN=({className:l,...n})=>e.jsx("nav",{role:"navigation","aria-label":"pagination",className:P("mx-auto flex w-full justify-center",l),...n});kN.displayName="Pagination";const CN=m.forwardRef(({className:l,...n},i)=>e.jsx("ul",{ref:i,className:P("flex flex-row items-center gap-1",l),...n}));CN.displayName="PaginationContent";const Eo=m.forwardRef(({className:l,...n},i)=>e.jsx("li",{ref:i,className:P("",l),...n}));Eo.displayName="PaginationItem";const td=({className:l,isActive:n,size:i="icon",...c})=>e.jsx("a",{"aria-current":n?"page":void 0,className:P(Pr({variant:n?"outline":"ghost",size:i}),l),...c});td.displayName="PaginationLink";const TN=({className:l,...n})=>e.jsxs(td,{"aria-label":"Go to previous page",size:"default",className:P("gap-1 pl-2.5",l),...n,children:[e.jsx(Fa,{className:"h-4 w-4"}),e.jsx("span",{children:"ไธŠไธ€้กต"})]});TN.displayName="PaginationPrevious";const EN=({className:l,...n})=>e.jsxs(td,{"aria-label":"Go to next page",size:"default",className:P("gap-1 pr-2.5",l),...n,children:[e.jsx("span",{children:"ไธ‹ไธ€้กต"}),e.jsx(sa,{className:"h-4 w-4"})]});EN.displayName="PaginationNext";const Mm=[{value:"created_at",label:"ๆœ€ๆ–ฐๅ‘ๅธƒ",icon:Ya},{value:"downloads",label:"ไธ‹่ฝฝๆœ€ๅคš",icon:Zt},{value:"likes",label:"ๆœ€ๅ—ๆฌข่ฟŽ",icon:Do}];function UC(){const l=ia(),[n,i]=m.useState([]),[c,u]=m.useState(!0),[x,h]=m.useState(""),[f,p]=m.useState("downloads"),[g,N]=m.useState(1),[v,y]=m.useState(1),[w,b]=m.useState(0),[D,A]=m.useState(new Set),[_,H]=m.useState(new Set),E=pv(),C=m.useCallback(async()=>{u(!0);try{const R=await K_({status:"approved",page:g,page_size:12,search:x||void 0,sort_by:f,sort_order:"desc"});i(R.packs),y(R.total_pages),b(R.total);const me=new Set;for(const ce of R.packs)await fv(ce.id,E)&&me.add(ce.id);A(me)}catch(R){console.error("ๅŠ ่ฝฝ Pack ๅˆ—่กจๅคฑ่ดฅ:",R),Kt({title:"ๅŠ ่ฝฝ Pack ๅˆ—่กจๅคฑ่ดฅ",variant:"destructive"})}finally{u(!1)}},[g,x,f,E]);m.useEffect(()=>{C()},[C]);const M=R=>{R.preventDefault(),N(1),C()},G=async R=>{if(!_.has(R)){H(me=>new Set(me).add(R));try{const me=await hv(R,E);A(ce=>{const ve=new Set(ce);return me.liked?ve.add(R):ve.delete(R),ve}),i(ce=>ce.map(ve=>ve.id===R?{...ve,likes:me.likes}:ve))}catch(me){console.error("็‚น่ตžๅคฑ่ดฅ:",me),Kt({title:"็‚น่ตžๅคฑ่ดฅ",variant:"destructive"})}finally{H(me=>{const ce=new Set(me);return ce.delete(R),ce})}}},O=R=>{l({to:"/config/pack-market/$packId",params:{packId:R}})},ee=Mm.find(R=>R.value===f)||Mm[0];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(la,{className:"h-8 w-8",strokeWidth:2}),"้…็ฝฎๆจกๆฟๅธ‚ๅœบ"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"ๆต่งˆๅ’Œๅบ”็”จ็คพๅŒบๅˆ†ไบซ็š„ๆจกๅž‹้…็ฝฎๆจกๆฟ๏ผŒๅฟซ้€Ÿ้…็ฝฎไฝ ็š„ MaiBot"})]}),e.jsxs(S,{variant:"outline",onClick:C,disabled:c,className:"gap-2",children:[e.jsx(ft,{className:`h-4 w-4 ${c?"animate-spin":""}`}),"ๅˆทๆ–ฐ"]})]})}),e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4 flex-wrap",children:[e.jsx("form",{onSubmit:M,className:"flex-1 min-w-[200px] max-w-md",children:e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ne,{placeholder:"ๆœ็ดขๆจกๆฟๅ็งฐใ€ๆ่ฟฐ...",value:x,onChange:R=>h(R.target.value),className:"pl-10"})]})}),e.jsxs(EC,{children:[e.jsx(MC,{asChild:!0,children:e.jsxs(S,{variant:"outline",className:"min-w-[140px] gap-2",children:[e.jsx(d1,{className:"w-4 h-4"}),ee.label,e.jsx(Ta,{className:"w-4 h-4 ml-auto"})]})}),e.jsx(_N,{align:"end",children:Mm.map(R=>e.jsxs(SN,{onClick:()=>{p(R.value),N(1)},children:[e.jsx(R.icon,{className:"w-4 h-4 mr-2"}),R.label]},R.value))})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["ๅ…ฑๆ‰พๅˆฐ ",e.jsx("span",{className:"font-medium text-foreground",children:w})," ไธชๆจกๆฟ"]}),c?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((R,me)=>e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(_s,{className:"h-6 w-3/4"}),e.jsx(_s,{className:"h-4 w-full mt-2"})]}),e.jsx(Re,{children:e.jsx(_s,{className:"h-20 w-full"})}),e.jsx(qo,{children:e.jsx(_s,{className:"h-9 w-full"})})]},me))}):n.length===0?e.jsx(Ce,{className:"py-12",children:e.jsxs(Re,{className:"text-center text-muted-foreground",children:[e.jsx(la,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{className:"text-lg font-medium",children:"ๆš‚ๆ— ๆจกๆฟ"}),e.jsx("p",{className:"mt-1",children:"่ฟ˜ๆฒกๆœ‰ไบบๅˆ†ไบซ้…็ฝฎๆจกๆฟ๏ผŒๅฟซๆฅๅˆ†ไบซ็ฌฌไธ€ไธชๅง๏ผ"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(R=>e.jsx(BC,{pack:R,liked:D.has(R.id),liking:_.has(R.id),onLike:()=>G(R.id),onView:()=>O(R.id)},R.id))}),v>1&&e.jsx(kN,{children:e.jsxs(CN,{children:[e.jsx(Eo,{children:e.jsx(TN,{onClick:()=>N(R=>Math.max(1,R-1)),className:g===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:v},(R,me)=>me+1).filter(R=>R===1||R===v||Math.abs(R-g)<=1).map((R,me,ce)=>{const ve=me>0&&R-ce[me-1]>1;return e.jsxs(Eo,{children:[ve&&e.jsx("span",{className:"px-2",children:"..."}),e.jsx(td,{onClick:()=>N(R),isActive:R===g,className:"cursor-pointer",children:R})]},R)}),e.jsx(Eo,{children:e.jsx(EN,{onClick:()=>N(R=>Math.min(v,R+1)),className:g===v?"pointer-events-none opacity-50":"cursor-pointer"})})]})})]})})]})}function BC({pack:l,liked:n,liking:i,onLike:c,onView:u}){const x=h=>new Date(h).toLocaleDateString("zh-CN",{year:"numeric",month:"short",day:"numeric"});return e.jsxs(Ce,{className:"flex flex-col hover:shadow-md transition-shadow",children:[e.jsxs(Pe,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(He,{className:"text-lg line-clamp-1",children:l.name}),e.jsxs(ke,{variant:"secondary",className:"text-xs",children:["v",l.version]})]}),e.jsx(As,{className:"line-clamp-2 min-h-[40px]",children:l.description})]}),e.jsxs(Re,{className:"flex-1 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Bn,{className:"w-3.5 h-3.5"}),l.author]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ya,{className:"w-3.5 h-3.5"}),x(l.created_at)]})]}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:"ๆไพ›ๅ•†ๆ•ฐ้‡",children:[e.jsx(Al,{className:"w-3.5 h-3.5"}),l.provider_count]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:"ๆจกๅž‹ๆ•ฐ้‡",children:[e.jsx(In,{className:"w-3.5 h-3.5"}),l.model_count]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",title:"ไปปๅŠก้…็ฝฎๆ•ฐ",children:[e.jsx(Pn,{className:"w-3.5 h-3.5"}),l.task_count]})]}),l.tags&&l.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[l.tags.slice(0,3).map(h=>e.jsxs(ke,{variant:"outline",className:"text-xs",children:[e.jsx(Vo,{className:"w-2.5 h-2.5 mr-1"}),h]},h)),l.tags.length>3&&e.jsxs(ke,{variant:"outline",className:"text-xs",children:["+",l.tags.length-3]})]})]}),e.jsx(qo,{className:"pt-3 border-t",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{className:"w-4 h-4"}),l.downloads]}),e.jsxs("button",{onClick:h=>{h.stopPropagation(),c()},disabled:i,className:`flex items-center gap-1 transition-colors ${n?"text-red-500":"hover:text-red-500"} ${i?"opacity-50":""}`,children:[e.jsx(Do,{className:`w-4 h-4 ${n?"fill-current":""}`}),l.likes]})]}),e.jsx(S,{size:"sm",onClick:u,children:"ๆŸฅ็œ‹่ฏฆๆƒ…"})]})})]})}var Xa="Accordion",$C=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[nx,IC,PC]=zw(Xa),[ad]=Ho(Xa,[PC,Wg]),rx=Wg(),MN=zs.forwardRef((l,n)=>{const{type:i,...c}=l,u=c,x=c;return e.jsx(nx.Provider,{scope:l.__scopeAccordion,children:i==="multiple"?e.jsx(VC,{...x,ref:n}):e.jsx(GC,{...u,ref:n})})});MN.displayName=Xa;var[AN,HC]=ad(Xa),[zN,FC]=ad(Xa,{collapsible:!1}),GC=zs.forwardRef((l,n)=>{const{value:i,defaultValue:c,onValueChange:u=()=>{},collapsible:x=!1,...h}=l,[f,p]=Po({prop:i,defaultProp:c??"",onChange:u,caller:Xa});return e.jsx(AN,{scope:l.__scopeAccordion,value:zs.useMemo(()=>f?[f]:[],[f]),onItemOpen:p,onItemClose:zs.useCallback(()=>x&&p(""),[x,p]),children:e.jsx(zN,{scope:l.__scopeAccordion,collapsible:x,children:e.jsx(DN,{...h,ref:n})})})}),VC=zs.forwardRef((l,n)=>{const{value:i,defaultValue:c,onValueChange:u=()=>{},...x}=l,[h,f]=Po({prop:i,defaultProp:c??[],onChange:u,caller:Xa}),p=zs.useCallback(N=>f((v=[])=>[...v,N]),[f]),g=zs.useCallback(N=>f((v=[])=>v.filter(y=>y!==N)),[f]);return e.jsx(AN,{scope:l.__scopeAccordion,value:h,onItemOpen:p,onItemClose:g,children:e.jsx(zN,{scope:l.__scopeAccordion,collapsible:!0,children:e.jsx(DN,{...x,ref:n})})})}),[qC,ld]=ad(Xa),DN=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,disabled:c,dir:u,orientation:x="vertical",...h}=l,f=zs.useRef(null),p=Fo(f,n),g=IC(i),v=xj(u)==="ltr",y=un(l.onKeyDown,w=>{if(!$C.includes(w.key))return;const b=w.target,D=g().filter(ee=>!ee.ref.current?.disabled),A=D.findIndex(ee=>ee.ref.current===b),_=D.length;if(A===-1)return;w.preventDefault();let H=A;const E=0,C=_-1,M=()=>{H=A+1,H>C&&(H=E)},G=()=>{H=A-1,H{const{__scopeAccordion:i,value:c,...u}=l,x=ld(Io,i),h=HC(Io,i),f=rx(i),p=Am(),g=c&&h.value.includes(c)||!1,N=x.disabled||l.disabled;return e.jsx(KC,{scope:i,open:g,disabled:N,triggerId:p,children:e.jsx(Kg,{"data-orientation":x.orientation,"data-state":IN(g),...f,...u,ref:n,disabled:N,open:g,onOpenChange:v=>{v?h.onItemOpen(c):h.onItemClose(c)}})})});ON.displayName=Io;var RN="AccordionHeader",LN=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,...c}=l,u=ld(Xa,i),x=ix(RN,i);return e.jsx(Gn.h3,{"data-orientation":u.orientation,"data-state":IN(x.open),"data-disabled":x.disabled?"":void 0,...c,ref:n})});LN.displayName=RN;var $m="AccordionTrigger",UN=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,...c}=l,u=ld(Xa,i),x=ix($m,i),h=FC($m,i),f=rx(i);return e.jsx(nx.ItemSlot,{scope:i,children:e.jsx(nw,{"aria-disabled":x.open&&!h.collapsible||void 0,"data-orientation":u.orientation,id:x.triggerId,...f,...c,ref:n})})});UN.displayName=$m;var BN="AccordionContent",$N=zs.forwardRef((l,n)=>{const{__scopeAccordion:i,...c}=l,u=ld(Xa,i),x=ix(BN,i),h=rx(i);return e.jsx(rw,{role:"region","aria-labelledby":x.triggerId,"data-orientation":u.orientation,...h,...c,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...l.style}})});$N.displayName=BN;function IN(l){return l?"open":"closed"}var QC=MN,YC=ON,JC=LN,PN=UN,HN=$N;const XC=QC,FN=m.forwardRef(({className:l,...n},i)=>e.jsx(YC,{ref:i,className:P("border-b",l),...n}));FN.displayName="AccordionItem";const GN=m.forwardRef(({className:l,children:n,...i},c)=>e.jsx(JC,{className:"flex",children:e.jsxs(PN,{ref:c,className:P("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",l),...i,children:[n,e.jsx(Ta,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));GN.displayName=PN.displayName;const VN=m.forwardRef(({className:l,children:n,...i},c)=>e.jsx(HN,{ref:c,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...i,children:e.jsx("div",{className:P("pb-4 pt-0",l),children:n})}));VN.displayName=HN.displayName;const ZC={utils:"้€š็”จๅทฅๅ…ท",utils_small:"่ฝป้‡ๅทฅๅ…ท",tool_use:"ๅทฅๅ…ท่ฐƒ็”จ",replyer:"ๅ›žๅค็”Ÿๆˆ",planner:"่ง„ๅˆ’ๆŽจ็†",vlm:"่ง†่ง‰ๆจกๅž‹",voice:"่ฏญ้Ÿณๅค„็†",embedding:"ๅ‘้‡ๅตŒๅ…ฅ",lpmm_entity_extract:"ๅฎžไฝ“ๆๅ–",lpmm_rdf_build:"RDFๆž„ๅปบ",lpmm_qa:"้—ฎ็ญ”ๆจกๅž‹"};function WC(){const{packId:l}=JN.useParams(),n=ia(),[i,c]=m.useState(null),[u,x]=m.useState(!0),[h,f]=m.useState(!1),[p,g]=m.useState(!1),[N,v]=m.useState(!1),[y,w]=m.useState(1),[b,D]=m.useState(null),[A,_]=m.useState(!1),[H,E]=m.useState(!1),[C,M]=m.useState({apply_providers:!0,apply_models:!0,apply_task_config:!0,task_mode:"append",selected_providers:void 0,selected_models:void 0,selected_tasks:void 0}),[G,O]=m.useState({}),[ee,R]=m.useState({}),me=pv(),ce=m.useCallback(async()=>{if(l){x(!0);try{const z=await Q_(l);c(z);const Q=await fv(l,me);f(Q)}catch(z){console.error("ๅŠ ่ฝฝ Pack ๅคฑ่ดฅ:",z),Kt({title:"ๅŠ ่ฝฝๆจกๆฟๅคฑ่ดฅ",variant:"destructive"})}finally{x(!1)}}},[l,me]);m.useEffect(()=>{ce()},[ce]);const ve=async()=>{if(!(!l||p)){g(!0);try{const z=await hv(l,me);f(z.liked),i&&c({...i,likes:z.likes})}catch(z){console.error("็‚น่ตžๅคฑ่ดฅ:",z),Kt({title:"็‚น่ตžๅคฑ่ดฅ",variant:"destructive"})}finally{g(!1)}}},se=async()=>{if(i){v(!0),w(1),_(!0);try{const z=await X_(i);D(z);const Q={};for(const L of z.existing_providers)Q[L.pack_provider.name]=L.local_providers[0].name;O(Q);const I={};for(const L of z.new_providers)I[L.name]="";R(I)}catch(z){console.error("ๆฃ€ๆต‹ๅ†ฒ็ชๅคฑ่ดฅ:",z),Kt({title:"ๆฃ€ๆต‹้…็ฝฎๅ†ฒ็ชๅคฑ่ดฅ",variant:"destructive"}),v(!1)}finally{_(!1)}}},ge=async()=>{if(i){if(C.apply_providers&&b){for(const z of b.new_providers)if(!ee[z.name]){Kt({title:`่ฏทๅกซๅ†™ๆไพ›ๅ•† "${z.name}" ็š„ API Key`,variant:"destructive"});return}}E(!0);try{await Z_(i,C,G,ee),await J_(i.id,me),c({...i,downloads:i.downloads+1}),Kt({title:"้…็ฝฎๆจกๆฟๅบ”็”จๆˆๅŠŸ๏ผ"}),v(!1)}catch(z){console.error("ๅบ”็”จ Pack ๅคฑ่ดฅ:",z),Kt({title:z instanceof Error?z.message:"ๅบ”็”จ้…็ฝฎๅคฑ่ดฅ",variant:"destructive"})}finally{E(!1)}}},fe=z=>new Date(z).toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric"});return u?e.jsx(s3,{}):i?e.jsx("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>n({to:"/config/pack-market"}),className:"gap-2",children:[e.jsx(ka,{className:"w-4 h-4"}),"่ฟ”ๅ›žๅธ‚ๅœบ"]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(la,{className:"w-10 h-10 text-primary mt-1"}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[i.name,e.jsxs(ke,{variant:"secondary",children:["v",i.version]})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:i.description})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Bn,{className:"w-4 h-4"}),i.author]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ya,{className:"w-4 h-4"}),fe(i.created_at)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{className:"w-4 h-4"}),i.downloads," ๆฌกไธ‹่ฝฝ"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Do,{className:`w-4 h-4 ${h?"fill-red-500 text-red-500":""}`}),i.likes," ่ตž"]})]}),i.tags&&i.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:i.tags.map(z=>e.jsxs(ke,{variant:"outline",children:[e.jsx(Vo,{className:"w-3 h-3 mr-1"}),z]},z))})]}),e.jsxs("div",{className:"flex flex-col gap-2 min-w-[160px]",children:[e.jsxs(S,{size:"lg",onClick:se,children:[e.jsx(Zt,{className:"w-4 h-4 mr-2"}),"ๅบ”็”จๆจกๆฟ"]}),e.jsxs(S,{variant:"outline",onClick:ve,disabled:p,className:h?"text-red-500 border-red-200":"",children:[e.jsx(Do,{className:`w-4 h-4 mr-2 ${h?"fill-current":""}`}),h?"ๅทฒ็‚น่ตž":"็‚น่ตž"]})]})]}),e.jsx(Qt,{}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Ce,{children:e.jsxs(Re,{className:"flex items-center gap-3 py-4",children:[e.jsx(Al,{className:"w-8 h-8 text-blue-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:i.providers.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"API ๆไพ›ๅ•†"})]})]})}),e.jsx(Ce,{children:e.jsxs(Re,{className:"flex items-center gap-3 py-4",children:[e.jsx(In,{className:"w-8 h-8 text-green-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:i.models.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ๆจกๅž‹้…็ฝฎ"})]})]})}),e.jsx(Ce,{children:e.jsxs(Re,{className:"flex items-center gap-3 py-4",children:[e.jsx(Pn,{className:"w-8 h-8 text-purple-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:Object.keys(i.task_config).length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"ไปปๅŠก้…็ฝฎ"})]})]})})]}),e.jsxs(ra,{defaultValue:"providers",className:"space-y-4",children:[e.jsxs(ea,{children:[e.jsxs(ts,{value:"providers",children:[e.jsx(Al,{className:"w-4 h-4 mr-2"}),"ๆไพ›ๅ•† (",i.providers.length,")"]}),e.jsxs(ts,{value:"models",children:[e.jsx(In,{className:"w-4 h-4 mr-2"}),"ๆจกๅž‹ (",i.models.length,")"]}),e.jsxs(ts,{value:"tasks",children:[e.jsx(Pn,{className:"w-4 h-4 mr-2"}),"ไปปๅŠก้…็ฝฎ (",Object.keys(i.task_config).length,")"]})]}),e.jsx(bs,{value:"providers",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"API ๆไพ›ๅ•†"}),e.jsx(As,{children:"ๆจกๆฟไธญๅŒ…ๅซ็š„ API ๆไพ›ๅ•†้…็ฝฎ๏ผˆไธๅซ API Key๏ผ‰"})]}),e.jsx(Re,{children:e.jsxs(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{children:"ๅ็งฐ"}),e.jsx(Ze,{children:"Base URL"}),e.jsx(Ze,{children:"็ฑปๅž‹"})]})}),e.jsx(Ol,{children:i.providers.map(z=>e.jsxs(ot,{children:[e.jsx(Ke,{className:"font-medium",children:z.name}),e.jsx(Ke,{className:"text-muted-foreground font-mono text-sm",children:z.base_url}),e.jsx(Ke,{children:e.jsx(ke,{variant:"outline",children:z.client_type})})]},z.name))})]})})]})}),e.jsx(bs,{value:"models",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ๆจกๅž‹้…็ฝฎ"}),e.jsx(As,{children:"ๆจกๆฟไธญๅŒ…ๅซ็š„ๆจกๅž‹้…็ฝฎ"})]}),e.jsx(Re,{children:e.jsxs(zl,{children:[e.jsx(Dl,{children:e.jsxs(ot,{children:[e.jsx(Ze,{children:"ๆจกๅž‹ๅ็งฐ"}),e.jsx(Ze,{children:"ๆ ‡่ฏ†็ฌฆ"}),e.jsx(Ze,{children:"ๆไพ›ๅ•†"}),e.jsx(Ze,{className:"text-right",children:"ไปทๆ ผ (ๅ…ฅ/ๅ‡บ)"})]})}),e.jsx(Ol,{children:i.models.map(z=>e.jsxs(ot,{children:[e.jsx(Ke,{className:"font-medium",children:z.name}),e.jsx(Ke,{className:"text-muted-foreground font-mono text-sm",children:z.model_identifier}),e.jsx(Ke,{children:z.api_provider}),e.jsxs(Ke,{className:"text-right text-muted-foreground",children:["ยฅ",z.price_in," / ยฅ",z.price_out]})]},z.name))})]})})]})}),e.jsx(bs,{value:"tasks",children:e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(He,{children:"ไปปๅŠก้…็ฝฎ"}),e.jsx(As,{children:"ๆจกๆฟไธญๅ„ไปปๅŠก็ฑปๅž‹็š„ๆจกๅž‹ๅˆ†้…"})]}),e.jsx(Re,{children:e.jsx(XC,{type:"multiple",className:"w-full",children:Object.entries(i.task_config).map(([z,Q])=>e.jsxs(FN,{value:z,children:[e.jsx(GN,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mn,{className:"w-4 h-4"}),ZC[z]||z,e.jsxs(ke,{variant:"secondary",className:"ml-2",children:[Q.model_list.length," ไธชๆจกๅž‹"]})]})}),e.jsx(VN,{children:e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"ๅˆ†้…็š„ๆจกๅž‹๏ผš"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Q.model_list.map(I=>e.jsx(ke,{variant:"outline",children:I},I))}),Q.temperature!==void 0&&e.jsxs("div",{className:"text-sm",children:["Temperature: ",e.jsx("span",{className:"font-mono",children:Q.temperature})]}),Q.max_tokens!==void 0&&e.jsxs("div",{className:"text-sm",children:["Max Tokens: ",e.jsx("span",{className:"font-mono",children:Q.max_tokens})]})]})})]},z))})})]})})]}),e.jsx(e3,{open:N,onOpenChange:v,pack:i,step:y,setStep:w,conflicts:b,detectingConflicts:A,applying:H,options:C,setOptions:M,_providerMapping:G,_setProviderMapping:O,newProviderApiKeys:ee,setNewProviderApiKeys:R,onApply:ge})]})})}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(la,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("h2",{className:"text-xl font-semibold",children:"ๆจกๆฟไธๅญ˜ๅœจ"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"่ฏฅ้…็ฝฎๆจกๆฟๅฏ่ƒฝๅทฒ่ขซๅˆ ้™คๆˆ–ๅฐšๆœช้€š่ฟ‡ๅฎกๆ ธ"}),e.jsxs(S,{className:"mt-4",onClick:()=>n({to:"/config/pack-market"}),children:[e.jsx(ka,{className:"w-4 h-4 mr-2"}),"่ฟ”ๅ›žๅธ‚ๅœบ"]})]})}function e3({open:l,onOpenChange:n,pack:i,step:c,setStep:u,conflicts:x,detectingConflicts:h,applying:f,options:p,setOptions:g,_providerMapping:N,_setProviderMapping:v,newProviderApiKeys:y,setNewProviderApiKeys:w,onApply:b}){return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(Bs,{children:[e.jsxs($s,{className:"flex items-center gap-2",children:[e.jsx(la,{className:"w-5 h-5"}),"ๅบ”็”จ้…็ฝฎๆจกๆฟ"]}),e.jsxs(Ys,{children:["ๆญฅ้ชค ",c," / ",3,"๏ผš",c===1&&"้€‰ๆ‹ฉ่ฆๅบ”็”จ็š„ๅ†…ๅฎน",c===2&&"้…็ฝฎๆไพ›ๅ•†ๆ˜ ๅฐ„",c===3&&"็กฎ่ฎคๅนถๅบ”็”จ"]})]}),h?e.jsxs("div",{className:"py-8 text-center",children:[e.jsx(Ls,{className:"w-8 h-8 mx-auto animate-spin text-primary"}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:"ๆญฃๅœจๆฃ€ๆต‹้…็ฝฎๅ†ฒ็ช..."})]}):e.jsxs(e.Fragment,{children:[c===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"apply_providers",checked:p.apply_providers,onCheckedChange:A=>g({...p,apply_providers:A})}),e.jsxs(T,{htmlFor:"apply_providers",className:"flex items-center gap-2",children:[e.jsx(Al,{className:"w-4 h-4"}),"ๅบ”็”จๆไพ›ๅ•†้…็ฝฎ (",i.providers.length," ไธช)"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"apply_models",checked:p.apply_models,onCheckedChange:A=>g({...p,apply_models:A})}),e.jsxs(T,{htmlFor:"apply_models",className:"flex items-center gap-2",children:[e.jsx(In,{className:"w-4 h-4"}),"ๅบ”็”จๆจกๅž‹้…็ฝฎ (",i.models.length," ไธช)"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ws,{id:"apply_task_config",checked:p.apply_task_config,onCheckedChange:A=>g({...p,apply_task_config:A})}),e.jsxs(T,{htmlFor:"apply_task_config",className:"flex items-center gap-2",children:[e.jsx(Pn,{className:"w-4 h-4"}),"ๅบ”็”จไปปๅŠก้…็ฝฎ (",Object.keys(i.task_config).length," ไธช)"]})]})]}),p.apply_task_config&&e.jsxs("div",{className:"pl-6 space-y-2 border-l-2 border-muted",children:[e.jsx(T,{className:"text-sm font-medium",children:"ไปปๅŠก้…็ฝฎๅบ”็”จๆจกๅผ"}),e.jsxs(lx,{value:p.task_mode,onValueChange:A=>g({...p,task_mode:A}),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx($o,{value:"append",id:"mode_append"}),e.jsx(T,{htmlFor:"mode_append",className:"font-normal",children:"่ฟฝๅŠ ๆจกๅผ - ๅฐ†ๆจกๆฟไธญ็š„ๆจกๅž‹ๆทปๅŠ ๅˆฐ็Žฐๆœ‰้…็ฝฎ"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx($o,{value:"replace",id:"mode_replace"}),e.jsx(T,{htmlFor:"mode_replace",className:"font-normal",children:"ๆ›ฟๆขๆจกๅผ - ็”จๆจกๆฟ้…็ฝฎๅฎŒๅ…จๆ›ฟๆข็Žฐๆœ‰้…็ฝฎ"})]})]})]})]}),c===2&&x&&e.jsxs("div",{className:"space-y-4",children:[p.apply_providers&&x.existing_providers.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๅ‘็Žฐๅทฒๆœ‰็š„ๆไพ›ๅ•†"}),e.jsx(nt,{children:"ไปฅไธ‹ๆไพ›ๅ•†็š„ URL ไธŽๆ‚จๆœฌๅœฐ้…็ฝฎไธญ็š„ๆไพ›ๅ•†ๅŒน้…๏ผŒๅฐ†่‡ชๅŠจไฝฟ็”จๆœฌๅœฐๆไพ›ๅ•†๏ผš"})]}),e.jsx("div",{className:"space-y-2",children:x.existing_providers.map(({pack_provider:A,local_providers:_})=>e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),e.jsx("span",{className:"font-medium flex-shrink-0",children:A.name}),e.jsx(sa,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),_.length===1?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:_[0].name}),e.jsx(ke,{variant:"outline",className:"ml-auto",children:"URL ๅŒน้…"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{value:N[A.name]||_[0].name,onValueChange:H=>v({...N,[A.name]:H}),children:[e.jsx(Le,{className:"w-[200px]",children:e.jsx($e,{})}),e.jsx(Ue,{children:_.map(H=>e.jsx(W,{value:H.name,children:H.name},H.name))})]}),e.jsxs(ke,{variant:"outline",className:"ml-auto",children:[_.length," ไธชๅŒน้…"]})]})]},A.name))})]}),p.apply_providers&&x.new_providers.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(lt,{variant:"destructive",children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx(Un,{children:"้œ€่ฆ้…็ฝฎ API Key"}),e.jsx(nt,{children:"ไปฅไธ‹ๆไพ›ๅ•†ๅœจๆ‚จ็š„ๆœฌๅœฐ้…็ฝฎไธญไธๅญ˜ๅœจ๏ผŒ้œ€่ฆๅกซๅ†™ API Key๏ผš"})]}),e.jsx("div",{className:"space-y-4",children:x.new_providers.map(A=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hm,{className:"w-4 h-4 text-amber-500"}),e.jsx("span",{className:"font-medium",children:A.name}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",A.base_url,")"]})]}),e.jsx(ne,{type:"password",placeholder:`่พ“ๅ…ฅ ${A.name} ็š„ API Key`,value:y[A.name]||"",onChange:_=>w({...y,[A.name]:_.target.value})})]},A.name))})]}),(!p.apply_providers||x.existing_providers.length===0&&x.new_providers.length===0)&&e.jsxs(lt,{children:[e.jsx(_t,{className:"h-4 w-4"}),e.jsx(Un,{children:"ๆ— ้œ€้…็ฝฎ"}),e.jsx(nt,{children:"ๆจกๆฟไธญๆฒกๆœ‰ๆไพ›ๅ•†้…็ฝฎ๏ผŒๆˆ–ๆ‚จ้€‰ๆ‹ฉไธๅบ”็”จๆไพ›ๅ•†ใ€‚"})]})]}),c===3&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(lt,{children:[e.jsx(Pt,{className:"h-4 w-4"}),e.jsx(Un,{children:"็กฎ่ฎคๅบ”็”จ"}),e.jsx(nt,{children:"่ฏท็กฎ่ฎคไปฅไธ‹ๅฐ†่ฆๅบ”็”จ็š„ๅ†…ๅฎน๏ผš"})]}),e.jsxs("div",{className:"space-y-2",children:[p.apply_providers&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500"}),e.jsx(Al,{className:"w-4 h-4"}),e.jsxs("span",{children:["ๅบ”็”จ ",i.providers.length," ไธชๆไพ›ๅ•†้…็ฝฎ"]})]}),p.apply_models&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500"}),e.jsx(In,{className:"w-4 h-4"}),e.jsxs("span",{children:["ๅบ”็”จ ",i.models.length," ไธชๆจกๅž‹้…็ฝฎ"]})]}),p.apply_task_config&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_t,{className:"w-4 h-4 text-green-500"}),e.jsx(Pn,{className:"w-4 h-4"}),e.jsxs("span",{children:[p.task_mode==="append"?"่ฟฝๅŠ ":"ๆ›ฟๆข"," ",Object.keys(i.task_config).length," ไธชไปปๅŠก้…็ฝฎ"]})]})]}),x&&x.new_providers.length>0&&e.jsxs(lt,{variant:"destructive",children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(nt,{children:["ๅฐ†ๆทปๅŠ  ",x.new_providers.length," ไธชๆ–ฐๆไพ›ๅ•†๏ผŒ่ฏท็กฎไฟๅทฒๅกซๅ†™ๆญฃ็กฎ็š„ API Keyใ€‚"]})]})]})]}),e.jsxs(et,{className:"flex justify-between",children:[e.jsx("div",{children:c>1&&!h&&e.jsx(S,{variant:"outline",onClick:()=>u(c-1),disabled:f,children:"ไธŠไธ€ๆญฅ"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>n(!1),disabled:f,children:"ๅ–ๆถˆ"}),c<3?e.jsx(S,{onClick:()=>u(c+1),disabled:h,children:"ไธ‹ไธ€ๆญฅ"}):e.jsxs(S,{onClick:b,disabled:f,children:[f&&e.jsx(Ls,{className:"w-4 h-4 mr-2 animate-spin"}),"ๅบ”็”จๆจกๆฟ"]})]})]})]})})}function s3(){return e.jsx("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:e.jsx(Je,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(_s,{className:"h-9 w-24"}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_s,{className:"w-10 h-10"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(_s,{className:"h-8 w-2/3"}),e.jsx(_s,{className:"h-4 w-full"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(_s,{className:"h-4 w-24"}),e.jsx(_s,{className:"h-4 w-32"}),e.jsx(_s,{className:"h-4 w-28"}),e.jsx(_s,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(_s,{className:"h-6 w-20"}),e.jsx(_s,{className:"h-6 w-24"}),e.jsx(_s,{className:"h-6 w-16"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 min-w-[160px]",children:[e.jsx(_s,{className:"h-10 w-full"}),e.jsx(_s,{className:"h-10 w-full"})]})]}),e.jsx(_s,{className:"h-px w-full"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_s,{className:"h-24"}),e.jsx(_s,{className:"h-24"}),e.jsx(_s,{className:"h-24"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(_s,{className:"h-10 w-32"}),e.jsx(_s,{className:"h-10 w-32"}),e.jsx(_s,{className:"h-10 w-32"})]}),e.jsx(_s,{className:"h-96 w-full"})]})]})})})}function t3(){const l=ia(),[n,i]=m.useState(!0);return m.useEffect(()=>{let c=!1;return(async()=>{try{const x=await Yi();!c&&!x&&l({to:"/auth"})}catch{c||l({to:"/auth"})}finally{c||i(!1)}})(),()=>{c=!0}},[l]),{checking:n}}async function a3(){return await Yi()}const l3=Hr("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"}}),qN=m.forwardRef(({className:l,size:n,abbrTitle:i,children:c,...u},x)=>e.jsx("kbd",{className:P(l3({size:n,className:l})),ref:x,...u,children:i?e.jsx("abbr",{title:i,children:c}):c}));qN.displayName="Kbd";const n3=[{icon:Go,title:"้ฆ–้กต",description:"ๆŸฅ็œ‹ไปช่กจๆฟๆฆ‚่งˆ",path:"/",category:"ๆฆ‚่งˆ"},{icon:Sa,title:"้บฆ้บฆไธป็จ‹ๅบ้…็ฝฎ",description:"้…็ฝฎ้บฆ้บฆ็š„ๆ ธๅฟƒ่ฎพ็ฝฎ",path:"/config/bot",category:"้…็ฝฎ"},{icon:Al,title:"้บฆ้บฆๆจกๅž‹ๆไพ›ๅ•†้…็ฝฎ",description:"้…็ฝฎๆจกๅž‹ๆไพ›ๅ•†",path:"/config/modelProvider",category:"้…็ฝฎ"},{icon:Rj,title:"้บฆ้บฆๆจกๅž‹้…็ฝฎ",description:"้…็ฝฎๆจกๅž‹ๅ‚ๆ•ฐ",path:"/config/model",category:"้…็ฝฎ"},{icon:Fm,title:"่กจๆƒ…ๅŒ…็ฎก็†",description:"็ฎก็†้บฆ้บฆ็š„่กจๆƒ…ๅŒ…",path:"/resource/emoji",category:"่ต„ๆบ"},{icon:Pa,title:"่กจ่พพๆ–นๅผ็ฎก็†",description:"็ฎก็†้บฆ้บฆ็š„่กจ่พพๆ–นๅผ",path:"/resource/expression",category:"่ต„ๆบ"},{icon:Lj,title:"ไบบ็‰ฉไฟกๆฏ็ฎก็†",description:"็ฎก็†ไบบ็‰ฉไฟกๆฏ",path:"/resource/person",category:"่ต„ๆบ"},{icon:Ir,title:"้ป‘่ฏ็ฎก็†",description:"็ฎก็†้บฆ้บฆๅญฆไน ๅˆฐ็š„้ป‘่ฏๅ’Œไฟš่ฏญ",path:"/resource/jargon",category:"่ต„ๆบ"},{icon:u1,title:"็ปŸ่ฎกไฟกๆฏ",description:"ๆŸฅ็œ‹ไฝฟ็”จ็ปŸ่ฎก",path:"/statistics",category:"็›‘ๆŽง"},{icon:la,title:"ๆ’ไปถๅธ‚ๅœบ",description:"ๆต่งˆๅ’Œๅฎ‰่ฃ…ๆ’ไปถ",path:"/plugins",category:"ๆ‰ฉๅฑ•"},{icon:Gm,title:"ๆ—ฅๅฟ—ๆŸฅ็œ‹ๅ™จ",description:"ๆŸฅ็œ‹็ณป็ปŸๆ—ฅๅฟ—",path:"/logs",category:"็›‘ๆŽง"},{icon:mn,title:"็ณป็ปŸ่ฎพ็ฝฎ",description:"้…็ฝฎ็ณป็ปŸๅ‚ๆ•ฐ",path:"/settings",category:"็ณป็ปŸ"}];function r3({open:l,onOpenChange:n}){const[i,c]=m.useState(""),[u,x]=m.useState(0),h=ia(),f=n3.filter(N=>N.title.toLowerCase().includes(i.toLowerCase())||N.description.toLowerCase().includes(i.toLowerCase())||N.category.toLowerCase().includes(i.toLowerCase())),p=m.useCallback(N=>{h({to:N}),n(!1),c(""),x(0)},[h,n]),g=m.useCallback(N=>{N.key==="ArrowDown"?(N.preventDefault(),x(v=>(v+1)%f.length)):N.key==="ArrowUp"?(N.preventDefault(),x(v=>(v-1+f.length)%f.length)):N.key==="Enter"&&f[u]&&(N.preventDefault(),p(f[u].path))},[f,u,p]);return e.jsx(Ps,{open:l,onOpenChange:n,children:e.jsxs(Us,{className:"max-w-2xl p-0 gap-0",children:[e.jsxs(Bs,{className:"px-4 pt-4 pb-0",children:[e.jsx($s,{className:"sr-only",children:"ๆœ็ดข"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(ne,{value:i,onChange:N=>{c(N.target.value),x(0)},onKeyDown:g,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(Je,{className:"h-[400px]",children:f.length>0?e.jsx("div",{className:"p-2",children:f.map((N,v)=>{const y=N.icon;return e.jsxs("button",{onClick:()=>p(N.path),onMouseEnter:()=>x(v),className:P("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",v===u?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[e.jsx(y,{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:N.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:N.description})]}),e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:N.category})]},N.path)})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Ot,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i?"ๆœชๆ‰พๅˆฐๅŒน้…็š„้กต้ข":"่พ“ๅ…ฅๅ…ณ้”ฎ่ฏๅผ€ๅง‹ๆœ็ดข"})]})})}),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"}),"ๅ…ณ้—ญ"]})]})})]})})}function i3(){const l=window.location.protocol==="http:",n=window.location.hostname.toLowerCase(),i=n==="localhost"||n==="127.0.0.1"||n==="::1",c=sessionStorage.getItem("http-warning-dismissed")==="true",[u,x]=m.useState(l&&!i&&!c),[h,f]=m.useState(!1),p=()=>{f(!0),x(!1),sessionStorage.setItem("http-warning-dismissed","true")};return!u||h?null:e.jsx("div",{className:"relative bg-amber-500/10 border-b border-amber-500/20 backdrop-blur-sm",children:e.jsx("div",{className:"container mx-auto px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx(Yt,{className:"h-5 w-5 text-amber-600 dark:text-amber-500 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-100",children:[e.jsx("span",{className:"font-semibold",children:"ๅฎ‰ๅ…จ่ญฆๅ‘Š๏ผš"}),"ๆ‚จๆญฃๅœจไฝฟ็”จ ",e.jsx("strong",{children:"HTTP"})," ่ฎฟ้—ฎ MaiBot WebUI"]}),e.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-200 mt-1",children:"ๅฆ‚ๆžœ่ฟ™ๆ˜ฏๅ…ฌ็ฝ‘ๆœๅŠกๅ™จ๏ผŒๆ‚จ็š„ๆ•ฐๆฎ๏ผˆๅŒ…ๆ‹ฌ Tokenใ€่Šๅคฉ่ฎฐๅฝ•็ญ‰๏ผ‰ๅฏ่ƒฝๅœจไผ ่พ“่ฟ‡็จ‹ไธญ่ขซ็ชƒๅ–ใ€‚ๅผบ็ƒˆๅปบ่ฎฎไฝฟ็”จ HTTPS ่ฎฟ้—ฎๆˆ–ไป…ๅœจๆœฌๅœฐ็ฝ‘็ปœไฝฟ็”จใ€‚"})]})]}),e.jsx(S,{variant:"ghost",size:"icon",onClick:p,className:"h-8 w-8 text-amber-700 hover:text-amber-900 dark:text-amber-400 dark:hover:text-amber-200 flex-shrink-0","aria-label":"ๅ…ณ้—ญ่ญฆๅ‘Š",children:e.jsx(Ca,{className:"h-4 w-4"})})]})})})}function c3(){const[l,n]=m.useState(0),[i,c]=m.useState(!1),u=m.useRef(null);m.useEffect(()=>{const g=N=>{const v=N.target;if(v.scrollHeight>v.clientHeight+100){u.current=v;const y=v.scrollTop,w=v.scrollHeight-v.clientHeight,b=w>0?y/w*100:0;n(b),c(y>300)}};return window.addEventListener("scroll",g,{capture:!0,passive:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})},[]);const x=()=>{u.current?.scrollTo({top:0,behavior:"smooth"})},h=18,f=2*Math.PI*h,p=f-l/100*f;return e.jsx("div",{className:P("fixed bottom-24 right-8 z-50 transition-all duration-500 ease-in-out transform",i?"translate-x-0 opacity-100":"translate-x-32 opacity-0 pointer-events-none"),children:e.jsxs(S,{variant:"outline",size:"icon",className:P("relative h-12 w-12 rounded-full shadow-xl","bg-background/80 backdrop-blur-md border-border/50","hover:bg-accent hover:scale-110 hover:shadow-2xl hover:border-primary/50","transition-all duration-300","group"),onClick:x,"aria-label":"ๅ›žๅˆฐ้กถ้ƒจ",children:[e.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90 transform p-1",viewBox:"0 0 44 44",children:[e.jsx("circle",{className:"text-muted-foreground/10",strokeWidth:"3",stroke:"currentColor",fill:"transparent",r:h,cx:"22",cy:"22"}),e.jsx("circle",{className:"text-primary transition-all duration-100 ease-out",strokeWidth:"3",strokeDasharray:f,strokeDashoffset:p,strokeLinecap:"round",stroke:"currentColor",fill:"transparent",r:h,cx:"22",cy:"22"})]}),e.jsx(m1,{className:"h-5 w-5 text-primary transition-transform duration-300 group-hover:-translate-y-1 group-hover:scale-110",strokeWidth:2.5}),e.jsx("div",{className:"absolute inset-0 rounded-full bg-primary/5 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})})}const o3=Ow,d3=Rw,u3=Lw,KN=m.forwardRef(({className:l,sideOffset:n=4,...i},c)=>e.jsx(Dw,{children:e.jsx(hj,{ref:c,sideOffset:n,className:P("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]",l),...i})}));KN.displayName=hj.displayName;function m3({children:l}){const{checking:n}=t3(),[i,c]=m.useState(!0),[u,x]=m.useState(!1),[h,f]=m.useState(!1),{theme:p,setTheme:g}=qm(),N=h0();if(m.useEffect(()=>{const D=A=>{(A.metaKey||A.ctrlKey)&&A.key==="k"&&(A.preventDefault(),f(!0))};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[]),n)return e.jsx("div",{className:"flex h-screen items-center justify-center bg-background",children:e.jsx("div",{className:"text-muted-foreground",children:"ๆญฃๅœจ้ชŒ่ฏ็™ปๅฝ•็Šถๆ€..."})});const v=[{title:"ๆฆ‚่งˆ",items:[{icon:Go,label:"้ฆ–้กต",path:"/"}]},{title:"้บฆ้บฆ้…็ฝฎ็ผ–่พ‘",items:[{icon:Sa,label:"้บฆ้บฆไธป็จ‹ๅบ้…็ฝฎ",path:"/config/bot"},{icon:Al,label:"AIๆจกๅž‹ๅŽ‚ๅ•†้…็ฝฎ",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:Rj,label:"ๆจกๅž‹็ฎก็†ไธŽๅˆ†้…",path:"/config/model",tourId:"sidebar-model-management"},{icon:tg,label:"้บฆ้บฆ้€‚้…ๅ™จ้…็ฝฎ",path:"/config/adapter"}]},{title:"้บฆ้บฆ่ต„ๆบ็ฎก็†",items:[{icon:Fm,label:"่กจๆƒ…ๅŒ…็ฎก็†",path:"/resource/emoji"},{icon:Pa,label:"่กจ่พพๆ–นๅผ็ฎก็†",path:"/resource/expression"},{icon:Ir,label:"้ป‘่ฏ็ฎก็†",path:"/resource/jargon"},{icon:Lj,label:"ไบบ็‰ฉไฟกๆฏ็ฎก็†",path:"/resource/person"},{icon:Mj,label:"็Ÿฅ่ฏ†ๅบ“ๅ›พ่ฐฑๅฏ่ง†ๅŒ–",path:"/resource/knowledge-graph"},{icon:Br,label:"้บฆ้บฆ็Ÿฅ่ฏ†ๅบ“็ฎก็†",path:"/resource/knowledge-base"}]},{title:"ๆ‰ฉๅฑ•ไธŽ็›‘ๆŽง",items:[{icon:la,label:"ๆ’ไปถๅธ‚ๅœบ",path:"/plugins"},{icon:Dj,label:"้…็ฝฎๆจกๆฟๅธ‚ๅœบ",path:"/config/pack-market"},{icon:tg,label:"ๆ’ไปถ้…็ฝฎ",path:"/plugin-config"},{icon:Gm,label:"ๆ—ฅๅฟ—ๆŸฅ็œ‹ๅ™จ",path:"/logs"},{icon:Im,label:"่ฎกๅˆ’ๅ™จ&ๅ›žๅคๅ™จ็›‘ๆŽง",path:"/planner-monitor"},{icon:Pa,label:"ๆœฌๅœฐ่Šๅคฉๅฎค",path:"/chat"}]},{title:"็ณป็ปŸ",items:[{icon:mn,label:"็ณป็ปŸ่ฎพ็ฝฎ",path:"/settings"}]}],w=p==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":p,b=async()=>{await K1()};return e.jsx(o3,{delayDuration:300,children:e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsxs("aside",{className:P("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",i?"lg:w-64":"lg:w-16",u?"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:P("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!i&&"lg:flex-none lg:w-8"),children:[e.jsxs("div",{className:P("flex items-baseline gap-2",!i&&"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:g2()})]}),!i&&e.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),e.jsx(Je,{className:P("flex-1 overflow-x-hidden",!i&&"lg:w-16"),children:e.jsx("nav",{className:P("p-4",!i&&"lg:p-2 lg:w-16"),children:e.jsx("ul",{className:P("space-y-6",!i&&"lg:space-y-3 lg:w-full"),children:v.map((D,A)=>e.jsxs("li",{children:[e.jsx("div",{className:P("px-3 h-[1.25rem]","mb-2",!i&&"lg:mb-1 lg:invisible"),children:e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:D.title})}),!i&&A>0&&e.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),e.jsx("ul",{className:"space-y-1",children:D.items.map(_=>{const H=N({to:_.path}),E=_.icon,C=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:P("flex items-center transition-all duration-300",i?"gap-3":"gap-3 lg:gap-0"),children:[e.jsx(E,{className:P("h-5 w-5 flex-shrink-0",H&&"text-primary"),strokeWidth:2,fill:"none"}),e.jsx("span",{className:P("text-sm font-medium whitespace-nowrap transition-all duration-300",H&&"font-semibold",i?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:_.label})]})]});return e.jsx("li",{className:"relative",children:e.jsxs(d3,{children:[e.jsx(u3,{asChild:!0,children:e.jsx(Dr,{to:_.path,"data-tour":_.tourId,className:P("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",i?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>x(!1),children:C})}),!i&&e.jsx(KN,{side:"right",className:"hidden lg:block",children:e.jsx("p",{children:_.label})})]})},_.path)})})]},D.title))})})})]}),u&&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.jsx(i3,{}),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(!u),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:e.jsx(x1,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>c(!i),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:i?"ๆ”ถ่ตทไพง่พนๆ ":"ๅฑ•ๅผ€ไพง่พนๆ ",children:e.jsx(Fa,{className:P("h-5 w-5 transition-transform",!i&&"rotate-180")})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>f(!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(Ot,{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(qN,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[e.jsx("span",{className:"text-xs",children:"โŒ˜"}),"K"]})]}),e.jsx(r3,{open:h,onOpenChange:f}),e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"ๆŸฅ็œ‹้บฆ้บฆๆ–‡ๆกฃ",children:[e.jsx(h1,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"้บฆ้บฆๆ–‡ๆกฃ"})]}),e.jsx("button",{onClick:D=>{c2(w==="dark"?"light":"dark",g,D)},className:"rounded-lg p-2 hover:bg-accent",title:w==="dark"?"ๅˆ‡ๆขๅˆฐๆต…่‰ฒๆจกๅผ":"ๅˆ‡ๆขๅˆฐๆทฑ่‰ฒๆจกๅผ",children:w==="dark"?e.jsx(yj,{className:"h-5 w-5"}):e.jsx(wj,{className:"h-5 w-5"})}),e.jsx("div",{className:"h-6 w-px bg-border"}),e.jsxs(S,{variant:"ghost",size:"sm",onClick:b,className:"gap-2",title:"็™ปๅ‡บ็ณป็ปŸ",children:[e.jsx(f1,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"็™ปๅ‡บ"})]})]})]}),e.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:l}),e.jsx(c3,{})]})]})})}function x3(l){const n=l.split(` `).slice(1),i=[];for(const c of n){const u=c.trim();if(!u.startsWith("at "))continue;const x=u.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);x?i.push({functionName:x[1]||"",fileName:x[2],lineNumber:x[3],columnNumber:x[4],raw:u}):i.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:u})}return i}function h3({error:l,errorInfo:n}){const[i,c]=m.useState(!0),[u,x]=m.useState(!1),[h,f]=m.useState(!1),p=l.stack?x3(l.stack):[],g=async()=>{const N=` Error: ${l.name} Message: ${l.message} @@ -87,4 +87,4 @@ ${n?.componentStack||"No component stack available"} URL: ${window.location.href} User Agent: ${navigator.userAgent} Time: ${new Date().toISOString()} - `.trim();try{await navigator.clipboard.writeText(N),f(!0),setTimeout(()=>f(!1),2e3)}catch(v){console.error("Failed to copy:",v)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(it,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsxs(ct,{className:"font-mono text-sm",children:[e.jsxs("span",{className:"font-semibold",children:[l.name,":"]})," ",l.message]})]}),p.length>0&&e.jsxs(Xi,{open:i,onOpenChange:c,children:[e.jsx(Zi,{asChild:!0,children:e.jsxs(S,{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(p1,{className:"h-4 w-4"}),"Stack Trace (",p.length," frames)"]}),i?e.jsx($r,{className:"h-4 w-4"}):e.jsx(Ta,{className:"h-4 w-4"})]})}),e.jsx(Wi,{children:e.jsx(Je,{className:"h-[280px] rounded-md border bg-muted/30",children:e.jsx("div",{className:"p-3 space-y-1",children:p.map((N,v)=>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:[v+1,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-primary font-medium",children:N.functionName}),N.fileName&&e.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[N.fileName,N.lineNumber&&e.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",N.lineNumber,":",N.columnNumber]})]})]})]})},v))})})})]}),n?.componentStack&&e.jsxs(Xi,{open:u,onOpenChange:x,children:[e.jsx(Zi,{asChild:!0,children:e.jsxs(S,{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(Qt,{className:"h-4 w-4"}),"Component Stack"]}),u?e.jsx($r,{className:"h-4 w-4"}):e.jsx(Ta,{className:"h-4 w-4"})]})}),e.jsx(Wi,{children:e.jsx(Je,{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:n.componentStack})})})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:g,className:"w-full",children:h?e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"mr-2 h-4 w-4 text-green-500"}),"ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"]}):e.jsxs(e.Fragment,{children:[e.jsx(Eo,{className:"mr-2 h-4 w-4"}),"ๅคๅˆถ้”™่ฏฏไฟกๆฏ"]})})]})}function QN({error:l,errorInfo:n}){const i=()=>{window.location.href="/"},c=()=>{window.location.reload()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(Ce,{className:"w-full max-w-2xl shadow-lg",children:[e.jsxs(Pe,{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(Qt,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),e.jsx(He,{className:"text-2xl font-bold",children:"้กต้ขๅ‡บ็Žฐไบ†้—ฎ้ข˜"}),e.jsx(As,{className:"text-base mt-2",children:"ๅบ”็”จ็จ‹ๅบ้‡ๅˆฐไบ†ๆ„ๅค–้”™่ฏฏใ€‚ๆ‚จๅฏไปฅๅฐ่ฏ•ๅˆทๆ–ฐ้กต้ขๆˆ–่ฟ”ๅ›ž้ฆ–้กตใ€‚"})]}),e.jsxs(Re,{className:"space-y-4",children:[e.jsx(h3,{error:l,errorInfo:n}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[e.jsxs(S,{onClick:c,className:"flex-1",children:[e.jsx(ft,{className:"mr-2 h-4 w-4"}),"ๅˆทๆ–ฐ้กต้ข"]}),e.jsxs(S,{onClick:i,variant:"outline",className:"flex-1",children:[e.jsx(Fo,{className:"mr-2 h-4 w-4"}),"่ฟ”ๅ›ž้ฆ–้กต"]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"ๅฆ‚ๆžœ้—ฎ้ข˜ๆŒ็ปญๅญ˜ๅœจ๏ผŒ่ฏทๅฐ†้”™่ฏฏไฟกๆฏๅคๅˆถๅนถๅ้ฆˆ็ป™ๅผ€ๅ‘่€…"})]})]})})}class f3 extends m.Component{constructor(n){super(n),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,i){console.error("ErrorBoundary caught an error:",n,i),this.setState({errorInfo:i})}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(QN,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function YN({error:l}){return e.jsx(QN,{error:l,errorInfo:null})}const lc=f0({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(Eg,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!a3())throw g0({to:"/auth"})}}),p3=Js({getParentRoute:()=>lc,path:"/auth",component:O2}),g3=Js({getParentRoute:()=>lc,path:"/setup",component:J2}),dt=Js({getParentRoute:()=>lc,id:"protected",component:()=>e.jsx(m3,{children:e.jsx(Eg,{})}),errorComponent:({error:l})=>e.jsx(YN,{error:l})}),j3=Js({getParentRoute:()=>dt,path:"/",component:l2}),v3=Js({getParentRoute:()=>dt,path:"/config/bot",component:M_}),N3=Js({getParentRoute:()=>dt,path:"/config/modelProvider",component:H_}),b3=Js({getParentRoute:()=>dt,path:"/config/model",component:xS}),y3=Js({getParentRoute:()=>dt,path:"/config/adapter",component:RS}),w3=Js({getParentRoute:()=>dt,path:"/resource/emoji",component:l4}),_3=Js({getParentRoute:()=>dt,path:"/resource/expression",component:f4}),S3=Js({getParentRoute:()=>dt,path:"/resource/person",component:$4}),k3=Js({getParentRoute:()=>dt,path:"/resource/jargon",component:E4}),C3=Js({getParentRoute:()=>dt,path:"/resource/knowledge-graph",component:Q4}),T3=Js({getParentRoute:()=>dt,path:"/resource/knowledge-base",component:Y4}),E3=Js({getParentRoute:()=>dt,path:"/logs",component:X4}),M3=Js({getParentRoute:()=>dt,path:"/planner-monitor",component:rk}),A3=Js({getParentRoute:()=>dt,path:"/chat",component:Vk}),z3=Js({getParentRoute:()=>dt,path:"/plugins",component:kk}),D3=Js({getParentRoute:()=>dt,path:"/plugin-detail",component:Lk}),O3=Js({getParentRoute:()=>dt,path:"/model-presets",component:Tk}),R3=Js({getParentRoute:()=>dt,path:"/plugin-config",component:Ak}),L3=Js({getParentRoute:()=>dt,path:"/plugin-mirrors",component:Dk}),U3=Js({getParentRoute:()=>dt,path:"/settings",component:C2}),B3=Js({getParentRoute:()=>dt,path:"/config/pack-market",component:UC}),JN=Js({getParentRoute:()=>dt,path:"/config/pack-market/$packId",component:WC}),$3=Js({getParentRoute:()=>dt,path:"/survey/webui-feedback",component:iC}),I3=Js({getParentRoute:()=>dt,path:"/survey/maibot-feedback",component:cC}),P3=Js({getParentRoute:()=>lc,path:"*",component:nv}),H3=lc.addChildren([p3,g3,dt.addChildren([j3,v3,N3,b3,y3,w3,_3,k3,S3,C3,T3,z3,D3,O3,R3,L3,E3,M3,A3,U3,B3,JN,$3,I3]),P3]),F3=p0({routeTree:H3,defaultNotFoundComponent:nv,defaultErrorComponent:({error:l})=>e.jsx(YN,{error:l})});function G3({children:l,defaultTheme:n="system",storageKey:i="ui-theme",...c}){const[u,x]=m.useState(()=>localStorage.getItem(i)||n);m.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),u==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(u)},[u]),m.useEffect(()=>{const f=localStorage.getItem("accent-color");if(f){const p=document.documentElement,N={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%)"}}[f];N&&(p.style.setProperty("--primary",N.hsl),N.gradient?(p.style.setProperty("--primary-gradient",N.gradient),p.classList.add("has-gradient")):(p.style.removeProperty("--primary-gradient"),p.classList.remove("has-gradient")))}},[]);const h={theme:u,setTheme:f=>{localStorage.setItem(i,f),x(f)}};return e.jsx(Wj.Provider,{...c,value:h,children:l})}function V3({children:l,defaultEnabled:n=!0,defaultWavesEnabled:i=!0,storageKey:c="enable-animations",wavesStorageKey:u="enable-waves-background"}){const[x,h]=m.useState(()=>{const N=localStorage.getItem(c);return N!==null?N==="true":n}),[f,p]=m.useState(()=>{const N=localStorage.getItem(u);return N!==null?N==="true":i});m.useEffect(()=>{const N=document.documentElement;x?N.classList.remove("no-animations"):N.classList.add("no-animations"),localStorage.setItem(c,String(x))},[x,c]),m.useEffect(()=>{localStorage.setItem(u,String(f))},[f,u]);const g={enableAnimations:x,setEnableAnimations:h,enableWavesBackground:f,setEnableWavesBackground:p};return e.jsx(ev.Provider,{value:g,children:l})}const q3=Uw,XN=m.forwardRef(({className:l,...n},i)=>e.jsx(hj,{ref:i,className:H("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",l),...n}));XN.displayName=hj.displayName;const K3=Hr("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"}}),ZN=m.forwardRef(({className:l,variant:n,...i},c)=>e.jsx(fj,{ref:c,className:H(K3({variant:n}),l),...i}));ZN.displayName=fj.displayName;const Q3=m.forwardRef(({className:l,...n},i)=>e.jsx(pj,{ref:i,className:H("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",l),...n}));Q3.displayName=pj.displayName;const WN=m.forwardRef(({className:l,...n},i)=>e.jsx(gj,{ref:i,className:H("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",l),"toast-close":"",...n,children:e.jsx(Ca,{className:"h-4 w-4"})}));WN.displayName=gj.displayName;const eb=m.forwardRef(({className:l,...n},i)=>e.jsx(jj,{ref:i,className:H("text-sm font-semibold [&+div]:text-xs",l),...n}));eb.displayName=jj.displayName;const sb=m.forwardRef(({className:l,...n},i)=>e.jsx(vj,{ref:i,className:H("text-sm opacity-90",l),...n}));sb.displayName=vj.displayName;function Y3(){const{toasts:l}=st();return e.jsxs(q3,{children:[l.map(function({id:n,title:i,description:c,action:u,...x}){return e.jsxs(ZN,{...x,children:[e.jsxs("div",{className:"grid gap-1",children:[i&&e.jsx(eb,{children:i}),c&&e.jsx(sb,{children:c})]}),u,e.jsx(WN,{})]},n)}),e.jsx(XN,{})]})}q1.createRoot(document.getElementById("root")).render(e.jsx(m.StrictMode,{children:e.jsx(f3,{children:e.jsx(G3,{defaultTheme:"system",children:e.jsx(V3,{children:e.jsxs(L_,{children:[e.jsx(j0,{router:F3}),e.jsx($_,{}),e.jsx(Y3,{})]})})})})})); + `.trim();try{await navigator.clipboard.writeText(N),f(!0),setTimeout(()=>f(!1),2e3)}catch(v){console.error("Failed to copy:",v)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(lt,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsxs(nt,{className:"font-mono text-sm",children:[e.jsxs("span",{className:"font-semibold",children:[l.name,":"]})," ",l.message]})]}),p.length>0&&e.jsxs(Zi,{open:i,onOpenChange:c,children:[e.jsx(Wi,{asChild:!0,children:e.jsxs(S,{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(p1,{className:"h-4 w-4"}),"Stack Trace (",p.length," frames)"]}),i?e.jsx($r,{className:"h-4 w-4"}):e.jsx(Ta,{className:"h-4 w-4"})]})}),e.jsx(ec,{children:e.jsx(Je,{className:"h-[280px] rounded-md border bg-muted/30",children:e.jsx("div",{className:"p-3 space-y-1",children:p.map((N,v)=>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:[v+1,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-primary font-medium",children:N.functionName}),N.fileName&&e.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[N.fileName,N.lineNumber&&e.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",N.lineNumber,":",N.columnNumber]})]})]})]})},v))})})})]}),n?.componentStack&&e.jsxs(Zi,{open:u,onOpenChange:x,children:[e.jsx(Wi,{asChild:!0,children:e.jsxs(S,{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(Yt,{className:"h-4 w-4"}),"Component Stack"]}),u?e.jsx($r,{className:"h-4 w-4"}):e.jsx(Ta,{className:"h-4 w-4"})]})}),e.jsx(ec,{children:e.jsx(Je,{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:n.componentStack})})})]}),e.jsx(S,{variant:"outline",size:"sm",onClick:g,className:"w-full",children:h?e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"mr-2 h-4 w-4 text-green-500"}),"ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ"]}):e.jsxs(e.Fragment,{children:[e.jsx(Mo,{className:"mr-2 h-4 w-4"}),"ๅคๅˆถ้”™่ฏฏไฟกๆฏ"]})})]})}function QN({error:l,errorInfo:n}){const i=()=>{window.location.href="/"},c=()=>{window.location.reload()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsxs(Ce,{className:"w-full max-w-2xl shadow-lg",children:[e.jsxs(Pe,{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(Yt,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),e.jsx(He,{className:"text-2xl font-bold",children:"้กต้ขๅ‡บ็Žฐไบ†้—ฎ้ข˜"}),e.jsx(As,{className:"text-base mt-2",children:"ๅบ”็”จ็จ‹ๅบ้‡ๅˆฐไบ†ๆ„ๅค–้”™่ฏฏใ€‚ๆ‚จๅฏไปฅๅฐ่ฏ•ๅˆทๆ–ฐ้กต้ขๆˆ–่ฟ”ๅ›ž้ฆ–้กตใ€‚"})]}),e.jsxs(Re,{className:"space-y-4",children:[e.jsx(h3,{error:l,errorInfo:n}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[e.jsxs(S,{onClick:c,className:"flex-1",children:[e.jsx(ft,{className:"mr-2 h-4 w-4"}),"ๅˆทๆ–ฐ้กต้ข"]}),e.jsxs(S,{onClick:i,variant:"outline",className:"flex-1",children:[e.jsx(Go,{className:"mr-2 h-4 w-4"}),"่ฟ”ๅ›ž้ฆ–้กต"]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"ๅฆ‚ๆžœ้—ฎ้ข˜ๆŒ็ปญๅญ˜ๅœจ๏ผŒ่ฏทๅฐ†้”™่ฏฏไฟกๆฏๅคๅˆถๅนถๅ้ฆˆ็ป™ๅผ€ๅ‘่€…"})]})]})})}class f3 extends m.Component{constructor(n){super(n),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,i){console.error("ErrorBoundary caught an error:",n,i),this.setState({errorInfo:i})}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(QN,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function YN({error:l}){return e.jsx(QN,{error:l,errorInfo:null})}const nc=f0({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(Mg,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!a3())throw g0({to:"/auth"})}}),p3=Js({getParentRoute:()=>nc,path:"/auth",component:O2}),g3=Js({getParentRoute:()=>nc,path:"/setup",component:J2}),dt=Js({getParentRoute:()=>nc,id:"protected",component:()=>e.jsx(m3,{children:e.jsx(Mg,{})}),errorComponent:({error:l})=>e.jsx(YN,{error:l})}),j3=Js({getParentRoute:()=>dt,path:"/",component:l2}),v3=Js({getParentRoute:()=>dt,path:"/config/bot",component:M_}),N3=Js({getParentRoute:()=>dt,path:"/config/modelProvider",component:H_}),b3=Js({getParentRoute:()=>dt,path:"/config/model",component:xS}),y3=Js({getParentRoute:()=>dt,path:"/config/adapter",component:RS}),w3=Js({getParentRoute:()=>dt,path:"/resource/emoji",component:l4}),_3=Js({getParentRoute:()=>dt,path:"/resource/expression",component:f4}),S3=Js({getParentRoute:()=>dt,path:"/resource/person",component:$4}),k3=Js({getParentRoute:()=>dt,path:"/resource/jargon",component:E4}),C3=Js({getParentRoute:()=>dt,path:"/resource/knowledge-graph",component:Q4}),T3=Js({getParentRoute:()=>dt,path:"/resource/knowledge-base",component:Y4}),E3=Js({getParentRoute:()=>dt,path:"/logs",component:X4}),M3=Js({getParentRoute:()=>dt,path:"/planner-monitor",component:rk}),A3=Js({getParentRoute:()=>dt,path:"/chat",component:Vk}),z3=Js({getParentRoute:()=>dt,path:"/plugins",component:kk}),D3=Js({getParentRoute:()=>dt,path:"/plugin-detail",component:Lk}),O3=Js({getParentRoute:()=>dt,path:"/model-presets",component:Tk}),R3=Js({getParentRoute:()=>dt,path:"/plugin-config",component:Ak}),L3=Js({getParentRoute:()=>dt,path:"/plugin-mirrors",component:Dk}),U3=Js({getParentRoute:()=>dt,path:"/settings",component:C2}),B3=Js({getParentRoute:()=>dt,path:"/config/pack-market",component:UC}),JN=Js({getParentRoute:()=>dt,path:"/config/pack-market/$packId",component:WC}),$3=Js({getParentRoute:()=>dt,path:"/survey/webui-feedback",component:iC}),I3=Js({getParentRoute:()=>dt,path:"/survey/maibot-feedback",component:cC}),P3=Js({getParentRoute:()=>nc,path:"*",component:nv}),H3=nc.addChildren([p3,g3,dt.addChildren([j3,v3,N3,b3,y3,w3,_3,k3,S3,C3,T3,z3,D3,O3,R3,L3,E3,M3,A3,U3,B3,JN,$3,I3]),P3]),F3=p0({routeTree:H3,defaultNotFoundComponent:nv,defaultErrorComponent:({error:l})=>e.jsx(YN,{error:l})});function G3({children:l,defaultTheme:n="system",storageKey:i="ui-theme",...c}){const[u,x]=m.useState(()=>localStorage.getItem(i)||n);m.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),u==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(u)},[u]),m.useEffect(()=>{const f=localStorage.getItem("accent-color");if(f){const p=document.documentElement,N={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%)"}}[f];N&&(p.style.setProperty("--primary",N.hsl),N.gradient?(p.style.setProperty("--primary-gradient",N.gradient),p.classList.add("has-gradient")):(p.style.removeProperty("--primary-gradient"),p.classList.remove("has-gradient")))}},[]);const h={theme:u,setTheme:f=>{localStorage.setItem(i,f),x(f)}};return e.jsx(Wj.Provider,{...c,value:h,children:l})}function V3({children:l,defaultEnabled:n=!0,defaultWavesEnabled:i=!0,storageKey:c="enable-animations",wavesStorageKey:u="enable-waves-background"}){const[x,h]=m.useState(()=>{const N=localStorage.getItem(c);return N!==null?N==="true":n}),[f,p]=m.useState(()=>{const N=localStorage.getItem(u);return N!==null?N==="true":i});m.useEffect(()=>{const N=document.documentElement;x?N.classList.remove("no-animations"):N.classList.add("no-animations"),localStorage.setItem(c,String(x))},[x,c]),m.useEffect(()=>{localStorage.setItem(u,String(f))},[f,u]);const g={enableAnimations:x,setEnableAnimations:h,enableWavesBackground:f,setEnableWavesBackground:p};return e.jsx(ev.Provider,{value:g,children:l})}const q3=Uw,XN=m.forwardRef(({className:l,...n},i)=>e.jsx(fj,{ref:i,className:P("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",l),...n}));XN.displayName=fj.displayName;const K3=Hr("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"}}),ZN=m.forwardRef(({className:l,variant:n,...i},c)=>e.jsx(pj,{ref:c,className:P(K3({variant:n}),l),...i}));ZN.displayName=pj.displayName;const Q3=m.forwardRef(({className:l,...n},i)=>e.jsx(gj,{ref:i,className:P("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",l),...n}));Q3.displayName=gj.displayName;const WN=m.forwardRef(({className:l,...n},i)=>e.jsx(jj,{ref:i,className:P("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",l),"toast-close":"",...n,children:e.jsx(Ca,{className:"h-4 w-4"})}));WN.displayName=jj.displayName;const eb=m.forwardRef(({className:l,...n},i)=>e.jsx(vj,{ref:i,className:P("text-sm font-semibold [&+div]:text-xs",l),...n}));eb.displayName=vj.displayName;const sb=m.forwardRef(({className:l,...n},i)=>e.jsx(Nj,{ref:i,className:P("text-sm opacity-90",l),...n}));sb.displayName=Nj.displayName;function Y3(){const{toasts:l}=st();return e.jsxs(q3,{children:[l.map(function({id:n,title:i,description:c,action:u,...x}){return e.jsxs(ZN,{...x,children:[e.jsxs("div",{className:"grid gap-1",children:[i&&e.jsx(eb,{children:i}),c&&e.jsx(sb,{children:c})]}),u,e.jsx(WN,{})]},n)}),e.jsx(XN,{})]})}q1.createRoot(document.getElementById("root")).render(e.jsx(m.StrictMode,{children:e.jsx(f3,{children:e.jsx(G3,{defaultTheme:"system",children:e.jsx(V3,{children:e.jsxs(L_,{children:[e.jsx(j0,{router:F3}),e.jsx($_,{}),e.jsx(Y3,{})]})})})})})); diff --git a/webui/dist/assets/index-DUbuoQZO.css b/webui/dist/assets/index-DUbuoQZO.css deleted file mode 100644 index f54be48d..00000000 --- a/webui/dist/assets/index-DUbuoQZO.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: 210 40% 98%;--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}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-16{inset:4rem}.inset-8{inset:2rem}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-24{bottom:6rem}.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\/3{right:33.333333%}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.right-8{right:2rem}.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-3\/4{top:75%}.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-1{margin-left:.25rem;margin-right:.25rem}.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-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-1{margin-top:-.25rem}.-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-0\.5{margin-left:.125rem}.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-1\.5{margin-right:.375rem}.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-block{display:inline-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-24{height:6rem}.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-96{height:24rem}.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-\[600px\]{height:600px}.h-\[70vh\]{height:70vh}.h-\[calc\(100vh-12rem\)\]{height:calc(100vh - 12rem)}.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-\[calc\(85vh-220px\)\]{height:calc(85vh - 220px)}.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-32{max-height:8rem}.max-h-64{max-height:16rem}.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-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.max-h-\[60vh\]{max-height:60vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.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-\[400px\]{min-height:400px}.min-h-\[40px\]{min-height:40px}.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-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.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-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[140px\]{width:140px}.w-\[1px\]{width:1px}.w-\[200px\]{width:200px}.w-\[600px\]{width:600px}.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-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[200px\]{min-width:200px}.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-\[100px\]{max-width:100px}.max-w-\[150px\]{max-width:150px}.max-w-\[180px\]{max-width:180px}.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-none{flex:none}.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-1\/2{--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-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-32{--tw-translate-x: 8rem;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-90{--tw-rotate: -90deg;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))}.animate-\[ping_3s_ease-in-out_infinite\]{animation:ping 3s ease-in-out infinite}.animate-\[ping_3s_ease-in-out_infinite_0\.5s\]{animation:ping 3s ease-in-out infinite .5s}.animate-\[ping_3s_ease-in-out_infinite_1s\]{animation:ping 3s ease-in-out infinite 1s}@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 ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) 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-none{resize:none}.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))}.grid-rows-\[auto_1fr_auto\]{grid-template-rows:auto 1fr auto}.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-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\/20{border-color:#f59e0b33}.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-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / 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-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / 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\/10{border-color:hsl(var(--primary) / .1)}.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-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.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-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.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\/50{background-color:hsl(var(--card) / .5)}.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-muted\/60{background-color:hsl(var(--muted) / .6)}.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-foreground\/20{background-color:hsl(var(--primary-foreground) / .2)}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/15{background-color:hsl(var(--primary) / .15)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-primary\/60{background-color:hsl(var(--primary) / .6)}.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-red-500{fill:#ef4444}.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-0\.5{padding:.125rem}.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-\[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-6{padding-left:1.5rem;padding-right:1.5rem}.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}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.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-2\.5{padding-right:.625rem}.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-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.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-800{--tw-text-opacity: 1;color:rgb(146 64 14 / 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\/10{color:hsl(var(--muted-foreground) / .1)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.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-foreground\/70{color:hsl(var(--primary-foreground) / .7)}.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-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.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-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.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}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,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\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}.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-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.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:hover{background-color:hsl(var(--muted))}.hover\:bg-muted-foreground\/20:hover{background-color:hsl(var(--muted-foreground) / .2)}.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-amber-900:hover{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.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:hover{color:hsl(var(--primary))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.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\:opacity-80:hover{opacity:.8}.hover\:shadow-2xl:hover{--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)}.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\:shadow-md:hover{--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)}.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\:-translate-y-1{--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))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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-\[state\=inactive\]\:hidden[data-state=inactive]{display:none}.data-\[state\=inactive\]\:h-0[data-state=inactive]{height:0px}.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-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / 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-green-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(20 83 45 / 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-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / 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\/20:is(.dark *){background-color:#450a0a33}.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-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / 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-amber-500:is(.dark *){--tw-text-opacity: 1;color:rgb(245 158 11 / 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-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / 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-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / 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\:hover\:text-amber-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 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\: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-2\.5{height:.625rem}.sm\:h-24{height:6rem}.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-220px\)\]{height:calc(100vh - 220px)}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-2\.5{width:.625rem}.sm\:w-24{width:6rem}.sm\:w-28{width:7rem}.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-\[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-\[500px\]{max-width:500px}.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\: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-3{padding-bottom:.75rem}.sm\:text-left{text-align:left}.sm\:text-right{text-align:right}.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\:inline{display:inline}.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\:inline{display:inline}.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-\[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-7{grid-template-columns:repeat(7,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-4{padding:1rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:pb-4{padding-bottom:1rem}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.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}.\[\&\:\:-webkit-scrollbar-thumb\:hover\]\:bg-border\/80::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--border) / .8)}.\[\&\:\:-webkit-scrollbar-thumb\]\:rounded-full::-webkit-scrollbar-thumb{border-radius:9999px}.\[\&\:\:-webkit-scrollbar-thumb\]\:bg-border::-webkit-scrollbar-thumb{background-color:hsl(var(--border))}.\[\&\:\:-webkit-scrollbar-track\]\:bg-transparent::-webkit-scrollbar-track{background-color:transparent}.\[\&\:\:-webkit-scrollbar\]\:w-2\.5::-webkit-scrollbar{width:.625rem}.\[\&\: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))}.\[\&\>div\]\:bg-green-500>div{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.\[\&\>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}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--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))}.\[\&_\.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}@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.27"}.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}.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-truncate-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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)}.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/index.html b/webui/dist/index.html index 4c919a75..6e216986 100644 --- a/webui/dist/index.html +++ b/webui/dist/index.html @@ -11,21 +11,21 @@ MaiBot Dashboard - + - + - +