1import{j as e}from"./vendor-query-DPZO-Gta.js";import{u as ze,r as t}from"./vendor-react-BomFe3BT.js";import{a as Te,V as b,z as _,d as qe,q as Le,Y as j}from"./index-BLzMsaFd.js";import{c as ie}from"./vendor-charts-DodUWJ0z.js";function We(){var Q,X,Z,ee,se,ae,te,re,le;const ne=ze(),{user:y,startImpersonation:de}=Te(),[oe,ce]=t.useState([]),[me,T]=t.useState(!0),[v,N]=t.useState(1),[C,xe]=t.useState(1),[ue,pe]=t.useState(0),[q,ge]=t.useState(""),[k,he]=t.useState(void 0),[S,be]=t.useState(void 0),[ye,E]=t.useState(!1),[fe,R]=t.useState(!1),[je,D]=t.useState(!1),[ve,I]=t.useState(!1),[Ne,L]=t.useState(!1),[l,g]=t.useState(null),[we,_e]=t.useState([]),[d,B]=t.useState(null),[w,$]=t.useState(""),[V,J]=t.useState(0),[O,W]=t.useState(0),[Y,G]=t.useState(""),[Ce,H]=t.useState(!1),[n,x]=t.useState({email:"",password:"",full_name:"",is_superuser:!1}),[U,z]=t.useState(""),[o,c]=t.useState(!1),[u,i]=t.useState(null),[ke,K]=t.useState(!1);t.useEffect(()=>{f()},[v,k,S]);const f=async()=>{try{T(!0);const a=(await b.listUsers({page:v,per_page:20,search:q||void 0,is_active:k,is_superuser:S})).data;ce(a.users),xe(a.total_pages),pe(a.total)}catch(s){console.error("Failed to load users:",s)}finally{T(!1)}},Se=s=>{s.preventDefault(),N(1),f()},Ue=async()=>{var s,a;try{c(!0),i(null),await b.createUser({email:n.email,password:n.password,full_name:n.full_name||void 0},n.is_superuser),E(!1),x({email:"",password:"",full_name:"",is_superuser:!1}),f()}catch(r){i(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to create user")}finally{c(!1)}},Pe=async()=>{var s,a;if(l)try{c(!0),i(null),await b.updateUser(l.id,{email:n.email,full_name:n.full_name||void 0,is_active:l.is_active,is_verified:l.is_verified,is_superuser:n.is_superuser}),R(!1),g(null),f()}catch(r){i(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to update user")}finally{c(!1)}},Me=async()=>{var s,a;if(l)try{c(!0),i(null),await b.deleteUser(l.id),D(!1),g(null),f()}catch(r){i(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to delete user")}finally{c(!1)}},Ae=async()=>{var s,a;if(!(!l||!U))try{c(!0),i(null),await b.resetPassword(l.id,U),I(!1),g(null),z("")}catch(r){i(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to reset password")}finally{c(!1)}},Fe=async s=>{try{await b.updateUser(s.id,{is_active:!s.is_active}),f()}catch(a){console.error("Failed to toggle user status:",a)}},Ee=async s=>{var a,r;if(s.id===(y==null?void 0:y.id)){_.error("Cannot impersonate yourself");return}try{K(!0);const m=await b.impersonateUser(s.id),{access_token:h,refresh_token:P,original_admin_id:M,impersonating_user_email:A}=m.data;localStorage.setItem("access_token",h);const p=(await qe.getMe()).data;de(p,h,P,M,A),Le.clear(),_.success(`Now viewing as ${s.email}`),ne("/dashboard")}catch(m){const h=m;_.error(((r=(a=h.response)==null?void 0:a.data)==null?void 0:r.detail)||"Failed to impersonate user")}finally{K(!1)}},Re=s=>{g(s),x({email:s.email,password:"",full_name:s.full_name||"",is_superuser:s.is_superuser}),i(null),R(!0)},De=async s=>{var a,r,m,h,P,M,A;g(s),i(null),L(!0),H(!0);try{const[F,p]=await Promise.all([j.listPlans(!0),j.getUserSubscription(s.id)]);_e(F.data),B(p.data),$(((r=(a=p.data.subscription)==null?void 0:a.plan)==null?void 0:r.id)||""),J(((m=p.data.credits)==null?void 0:m.extra_messages)||0),W(((h=p.data.credits)==null?void 0:h.extra_chatbots)||0),G(((P=p.data.credits)==null?void 0:P.notes)||"")}catch(F){i(((A=(M=F.response)==null?void 0:M.data)==null?void 0:A.detail)||"Failed to load billing info")}finally{H(!1)}},Ie=async()=>{var s,a;if(!(!l||!w))try{c(!0),i(null),await j.changeUserPlan(l.id,w),_.success("Plan updated successfully");const r=await j.getUserSubscription(l.id);B(r.data)}catch(r){i(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to change plan")}finally{c(!1)}},Be=async()=>{var s,a;if(l)try{c(!0),i(null),await j.setUserCredits(l.id,{extra_messages:V,extra_chatbots:O,notes:Y||void 0}),_.success("Credits updated successfully");const r=await j.getUserSubscription(l.id);B(r.data)}catch(r){i(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to update credits")}finally{c(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"User Management"}),e.jsxs("p",{className:"text-gray-500 mt-1",children:[ue," total users"]})]}),e.jsx("button",{onClick:()=>{x({email:"",password:"",full_name:"",is_superuser:!1}),i(null),E(!0)},className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors",children:"Create User"})]}),e.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx("form",{onSubmit:Se,className:"flex-1 min-w-[200px]",children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:q,onChange:s=>ge(s.target.value),placeholder:"Search by email or name...",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})]})}),e.jsxs("select",{value:k===void 0?"":k?"active":"inactive",onChange:s=>{he(s.target.value===""?void 0:s.target.value==="active"),N(1)},className:"px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"All Status"}),e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"inactive",children:"Inactive"})]}),e.jsxs("select",{value:S===void 0?"":S?"admin":"user",onChange:s=>
1{be(s.target.value===""?void 0:s.target.value==="admin"),N(1)},className:"px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"All Roles"}),e.jsx("option",{value:"admin",children:"Admins"}),e.jsx("option",{value:"user",children:"Regular Users"})]})]})}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[me?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Stats"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Joined"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:oe.map(s=>{var a;return e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"w-10 h-10 bg-primary-100 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-sm font-medium text-primary-700",children:((a=s.full_name)==null?void 0:a[0])||s.email[0].toUpperCase()})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:s.full_name||"No name"}),e.jsx("div",{className:"text-sm text-gray-500",children:s.email})]})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("button",{onClick:()=>Fe(s),className:ie("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",s.is_active?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.is_active?"Active":"Inactive"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:ie("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium w-fit",s.user_type==="Admin"||s.is_superuser?"bg-purple-100 text-purple-800":s.user_type==="Client"?"bg-green-100 text-green-800":"bg-blue-100 text-blue-800"),children:s.is_superuser?"Admin":s.user_type||"Owner"}),s.business_memberships&&s.business_memberships.length>0&&e.jsxs("span",{className:"text-xs text-gray-500 cursor-help",title:s.business_memberships.map(r=>`${r.business_name} (${r.role})`).join(", "),children:[s.business_memberships.length," business",s.business_memberships.length>1?"es":""]})]})}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:[e.jsxs("div",{children:[s.chatbot_count," chatbots"]}),e.jsxs("div",{children:[s.total_conversations," conversations"]})]}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:new Date(s.created_at).toLocaleDateString()}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.id!==(y==null?void 0:y.id)&&s.is_active&&e.jsx("button",{onClick:()=>Ee(s),disabled:ke,className:"text-purple-600 hover:text-purple-900 disabled:opacity-50",title:"View as this user",children:"Impersonate"}),e.jsx("button",{onClick:()=>De(s),className:"text-green-600 hover:text-green-900",children:"Billing"}),e.jsx("button",{onClick:()=>Re(s),className:"text-primary-600 hover:text-primary-900",children:"Edit"}),e.jsx("button",{onClick:()=>{g(s),z(""),i(null),I(!0)},className:"text-gray-600 hover:text-gray-900",children:"Reset Password"}),e.jsx("button",{onClick:()=>{g(s),i(null),D(!0)},className:"text-red-600 hover:text-red-900",children:"Delete"})]})})]},s.id)})})]})}),C>1&&e.jsxs("div",{className:"px-6 py-4 border-t border-gray-200 flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm text-gray-500",children:["Page ",v," of ",C]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>N(s=>
1Math.max(1,s-1)),disabled:v===1,className:"px-3 py-1 border border-gray-300 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Previous"}),e.jsx("button",{onClick:()=>N(s=>Math.min(C,s+1)),disabled:v===C,className:"px-3 py-1 border border-gray-300 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Next"})]})]})]}),ye&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Create New User"}),u&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:u}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),e.jsx("input",{type:"email",value:n.email,onChange:s=>x(a=>({...a,email:s.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),e.jsx("input",{type:"password",value:n.password,onChange:s=>x(a=>({...a,password:s.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Full Name (optional)"}),e.jsx("input",{type:"text",value:n.full_name,onChange:s=>x(a=>({...a,full_name:s.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:n.is_superuser,onChange:s=>x(a=>({...a,is_superuser:s.target.checked})),className:"rounded border-gray-300 text-primary-600 focus:ring-primary-500"}),e.jsx("span",{className:"text-sm text-gray-700",children:"Make this user an admin"})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[e.jsx("button",{onClick:()=>E(!1),className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Ue,disabled:o||!n.email||!n.password,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:o?"Creating...":"Create User"})]})]})}),fe&&l&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Edit User"}),u&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:u}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),e.jsx("input",{type:"email",value:n.email,onChange:s=>x(a=>({...a,email:s.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Full Name"}),e.jsx("input",{type:"text",value:n.full_name,onChange:s=>x(a=>({...a,full_name:s.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:n.is_superuser,onChange:s=>x(a=>({...a,is_superuser:s.target.checked})),className:"rounded border-gray-300 text-primary-600 focus:ring-primary-500"}),e.jsx("span",{className:"text-sm text-gray-700",children:"Admin privileges"})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[e.jsx("button",{onClick:()=>R(!1),className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Pe,disabled:o,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:o?"Saving...":"Save Changes"})]})]})}),ve&&l&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Reset Password"}),e.jsxs("p",{className:"text-gray-600 mb-4",children:["Set a new password for ",l.email]}),u&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:u}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"New Password"}),e.jsx("input",{type:"password",value:U,onChange:s=>
1z(s.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0})]}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[e.jsx("button",{onClick:()=>I(!1),className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Ae,disabled:o||!U,className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:o?"Resetting...":"Reset Password"})]})]})}),je&&l&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Delete User"}),e.jsxs("p",{className:"text-gray-600 mb-4",children:["Are you sure you want to delete ",e.jsx("strong",{children:l.email}),"? This will also delete all their chatbots and data. This action cannot be undone."]}),u&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:u}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>D(!1),className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Me,disabled:o,className:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors disabled:opacity-50",children:o?"Deleting...":"Delete User"})]})]})}),Ne&&l&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Manage Billing"}),e.jsx("p",{className:"text-gray-500 text-sm mb-4",children:l.email}),u&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:u}),Ce?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):e.jsxs("div",{className:"space-y-6",children:[d&&e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[e.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:"Current Usage"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"Chatbots:"})," ",e.jsx("span",{className:"font-medium",children:((Q=d.usage)==null?void 0:Q.chatbots)||0}),e.jsxs("span",{className:"text-gray-400",children:[" / ",((X=d.limits)==null?void 0:X.max_chatbots)===-1?"â":(Z=d.limits)==null?void 0:Z.max_chatbots]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"Messages:"})," ",e.jsx("span",{className:"font-medium",children:((ee=d.usage)==null?void 0:ee.messages_this_month)||0}),e.jsxs("span",{className:"text-gray-400",children:[" / ",((se=d.limits)==null?void 0:se.max_messages_per_month)===-1?"â":(ae=d.limits)==null?void 0:ae.max_messages_per_month]})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:"Subscription Plan"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{value:w,onChange:s=>$(s.target.value),className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent",children:[e.jsx("option",{value:"",children:"Select a plan"}),we.map(s=>e.jsxs("option",{value:s.id,children:[s.name," - $",parseFloat(s.price_monthly).toFixed(0),"/mo (",s.max_chatbots===-1?"â":s.max_chatbots," bots, ",s.max_messages_per_month===-1?"â":s.max_messages_per_month," msgs)"]},s.id))]}),e.jsx("button",{onClick:Ie,disabled:o||!w||w===((re=(te=d==null?void 0:d.subscription)==null?void 0:te.plan)==null?void 0:re.id),className:"px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:o?"Saving...":"Update"})]}),((le=d==null?void 0:d.subscription)==null?void 0:le.plan)&&e.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Current: ",e.jsx("strong",{children:d.subscription.plan.name})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:"Extra Credits"}),e.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"Add credits on top of the plan limits"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-gray-600 mb-1",children:"Extra Messages"}),e.jsx("input",{type:"number",min:"0",value:V,onChange:s=>J(parseInt(s.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-gray-600 mb-1",children:"Extra Chatbots"}),e.jsx("input",{type:"number",min:"0",value:O,onChange:s=>W(parseInt(s.target.value)||0),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-gray-600 mb-1",children:"Notes (optional)"}),e.jsx("input",{type:"text",value:Y,onChange:s=>G(s.target.value),placeholder:"e.g., Promotional credits, Support compensation",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),e.jsx("button",{onClick:Be,disabled:o,className:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors disabled:opacity-50",children:o?"Saving...":"Update Credits"})]})]})]}),e.jsx("div",{className:"flex justify-end mt-6 pt-4 border-t",children:e.jsx("button",{onClick:()=>L(!1),className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:"Close"})})]})})]})}export{We as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.