import{c as r,r as c,j as e,P as d,i as p,u as m,k as x,B as u,s as g,t as l}from"./index-nQTX7hqb.js";import{C as h,a as y,c as f,d as j,b,I as v}from"./card-xYEGGa2v.js";const N=[["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"}]],k=r("key",N);const C=[["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"}]],w=r("save",C);const D=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],K=r("shield-check",D);var M="Label",o=c.forwardRef((s,a)=>e.jsx(d.label,{...s,ref:a,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(s.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName=M;var L=o;function S({className:s,...a}){return e.jsx(L,{"data-slot":"label",className:p("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),...a})}function A(){const{t:s}=m(),[a,t]=c.useState(x()),n=i=>{i.preventDefault();try{g(a.trim()),l.success(s("settings.toast.saved"),{description:s("settings.toast.savedDesc")})}catch{l.error(s("settings.toast.failed"),{description:s("settings.toast.failedDesc")})}};return e.jsxs("div",{className:"p-6 space-y-6 max-w-2xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("h1",{className:"text-3xl font-bold tracking-tight flex items-center gap-2",children:[e.jsx(k,{className:"text-primary"}),s("settings.title")]}),e.jsx("p",{className:"text-muted-foreground",children:s("settings.subtitle")})]}),e.jsxs(h,{children:[e.jsxs(y,{children:[e.jsx(f,{children:s("settings.configTitle")}),e.jsx(j,{children:s("settings.configDesc")})]}),e.jsxs(b,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-blue-500/10 border border-blue-500/20 text-blue-600 dark:text-blue-400",children:[e.jsx(K,{className:"mt-0.5 shrink-0",size:20}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-bold",children:s("settings.privacy")}),e.jsx("p",{className:"opacity-90 leading-relaxed",children:s("settings.privacyDesc")})]})]}),e.jsxs("form",{onSubmit:n,className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full items-center gap-2",children:[e.jsx(S,{htmlFor:"api-key",children:s("settings.apiKeyLabel")}),e.jsx(v,{id:"api-key",type:"password",placeholder:s("settings.apiKeyPlaceholder"),value:a,onChange:i=>t(i.target.value),className:"font-mono"}),e.jsx("p",{className:"text-[0.8rem] text-muted-foreground",children:s("settings.apiKeyHint")})]}),e.jsxs(u,{type:"submit",className:"w-full sm:w-auto gap-2",children:[e.jsx(w,{size:16}),s("settings.save")]})]})]})]})]})}export{A as component};
