PageSourceSearch

https://kael.es/assets/Settings-qTEn2CFf.js

js kael.es collected 2026-10-02 01:53:21 UTC 23,146 bytes, 1 lines download raw bytes

1import{a as e}from"./chunk-BEqpzyXh.js";import{t}from"./react-B5CJznQh.js";import{d as n}from"./dist-Bg3ZcS8T.js";import{t as r}from"./client-Dck7oPiH.js";import{t as i}from"./jsx-runtime-B7rXg8Vy.js";import{n as a}from"./AuthContext-B8CZ-Ay1.js";import{t as o}from"./createLucideIcon-pP46p6YD.js";import{t as s}from"./dollar-sign-DJlEpBsb.js";import{t as c}from"./message-square-CkKLqveK.js";import{t as l}from"./plus-B5pqgFaA.js";import{t as u}from"./trash-2-BzVFroCF.js";import{t as d}from"./trending-up-CPUo4Y4o.js";import{t as f}from"./user-qBXpXcfJ.js";import{t as ee}from"./proxy-DyLbloXW.js";import{d as p,n as m,r as h,v as g}from"./index-BIS86LOi.js";var _=o(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),v=o(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),y=o(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),b=o(`lock`,[[`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`}]]),x=o(`tag`,[[`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`}]]),S=e(t(),1),C=i(),w=[`MAD`,`USD`,`EUR`,`GBP`,`CAD`,`AUD`,`JPY`,`CHF`,`CNY`,`INR`,`BRL`,`SAR`,`AED`];function T(){let{user:e,setUser:t}=a(),{t:i}=h(),[o,T]=(0,S.useState)({name:e?.name||``,currency:e?.currency||`EUR`,base_currency:e?.base_currency||`MAD`}),[E,D]=(0,S.useState)({currentPassword:``,newPassword:``,confirmPassword:``}),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),[M,te]=(0,S.useState)(``),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)(Notification.permission===`granted`),[ne,L]=(0,S.useState)(!1),[R,z]=(0,S.useState)(e?.email_digest_enabled!==0),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)({name:``,type:`expense`,icon:`circle`,color:`#6366f1`}),[W,G]=(0,S.useState)(!1),[K,q]=(0,S.useState)([]),[J,Y]=(0,S.useState)([]),[X,Z]=(0,S.useState)({keyword:``,category_id:``}),[Q,$]=(0,S.useState)(!1);(0,S.useEffect)(()=>{re()},[]);let re=async()=>{try{let[e,t]=await Promise.all([r.get(`/rules`),r.get(`/categories`)]);q(e.data),Y(t.data)}catch{console.error(`Failed to load rules/categories`)}},ie=async e=>{e.preventDefault(),G(!0);try{let e=await r.post(`/categories`,H);Y([...J,e.data].sort((e,t)=>e.type.localeCompare(t.type)||e.name.localeCompare(t.name))),U({name:``,type:`expense`,icon:`circle`,color:`#6366f1`}),n.success(i(`common.save`,`Category added`))}catch(e){n.error(e.response?.data?.message||`Error adding category`)}finally{G(!1)}},ae=async e=>{if(confirm(`Delete this category? Transactions using it will be uncategorized.`))try{await r.delete(`/categories/${e}`),Y(J.filter(t=>t.id!==e)),q(K.filter(t=>t.category_id!==e)),n.success(i(`common.delete`,`Category deleted`))}catch(e){n.error(e.response?.data?.message||`Error deleting category`)}},oe=async e=>{e.preventDefault(),$(!0);try{q([(await r.post(`/rules`,X)).data,...K]),Z({keyword:``,category_id:``}),n.success(i(`common.save`,`Rule added`))}catch(e){n.error(e.response?.data?.message||`Error adding rule`)}finally{$(!1)}},se=async e=>{try{await r.delete(`/rules/${e}`),q(K.filter(t=>t.id!==e)),n.success(i(`common.delete`,`Rule deleted`))}catch{n.error(`Error deleting rule`)}},ce=async e=>{e.preventDefault(),k(!0);try{t((await r.put(`/auth/profile`,o)).data),n.success(i(`common.save`,`Profile updated!`))}catch(e){n.error(e.response?.data?.message||`Error updating profile`)}finally{k(!1)}},le=async e=>{if(e.preventDefault(),E.newPassword!==E.confirmPassword)return n.error(i(`register.passwords_match_error`));if(E.newPassword.length<6)return n.error(i(`register.password_length_error`));j(!0);try{await r.put(`/auth/password`,{currentPassword:E.currentPassword,newPassword:E.newPassword}),n.success(i(`common.save`,`Password changed!`)),D({currentPassword:``,newPassword:``,confirmPassword:``})}catch(e){n.error(e.response?.data?.message||`Error`)}finally{j(!1)}},ue=async()=>{P(!0);try{te((await r.get(`/auth/telegram-token`)).data.token),n.success(`Pairing token generated!`)}catch{n.error(`Failed to generate token`)}finally{P(!1)}},de=async()=>{try{let e=await r.get(`/google/auth`);window.location.href=e.data.url}catch{n.error(`Failed to start Google OAuth`)}},fe=async()=>{L(!0);try{if(F){let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();e&&(await r.post(`/notifications/unsubscribe`,{endpoint:e.endpoint}),await e.unsubscribe()),I(!1),n.success(`Push notifications disabled`)}else{if(await Notification.requestPermission()!==`granted`)throw Error(`Permission denied`);let e=await navigator.serviceWorker.register(`/sw.js`),t=me((await r.get(`/notifications/vapidPublicKey`)).data.publicKey),i=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t});await r.post(`/notifications/subscribe`,i),I(!0),n.success(`Push notifications enabled!`)}}catch(e){console.error(e),n.error(e.message===`Permission denied`?`Notifications blocked by browser`:`Failed to toggle push notifications`)}finally{L(!1)}}
1,pe=async()=>{V(!0);try{let i=!R;await r.put(`/auth/preferences`,{email_digest_enabled:i}),z(i),t({...e,email_digest_enabled:i}),n.success(i?`Weekly Digest enabled`:`Weekly Digest disabled`)}catch{n.error(`Failed to update email preferences`)}finally{V(!1)}};function me(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/\-/g,`+`).replace(/_/g,`/`),n=window.atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}return(0,C.jsxs)(`div`,{className:`fade-in`,children:[(0,C.jsxs)(`div`,{className:`page-header`,children:[(0,C.jsx)(`h1`,{children:i(`settings.title`)}),(0,C.jsx)(`p`,{children:i(`settings.subtitle`)})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginBottom:20},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:20},children:[(0,C.jsx)(f,{size:18,color:`var(--accent)`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:i(`settings.profile`)})]}),(0,C.jsxs)(`form`,{onSubmit:ce,style:{display:`flex`,flexDirection:`column`,gap:14,maxWidth:440},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,marginBottom:8},children:[(0,C.jsx)(`div`,{className:`user-avatar`,style:{width:60,height:60,fontSize:`1.3rem`},children:e?.name?.[0]?.toUpperCase()}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{style:{fontWeight:600},children:e?.name}),(0,C.jsx)(`div`,{style:{color:`var(--text-secondary)`,fontSize:`0.85rem`},children:e?.email})]})]}),(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`settings.display_name`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`text`,value:o.name,onChange:e=>T({...o,name:e.target.value}),required:!0})]}),(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`common.email`,`Email`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`email`,value:e?.email,disabled:!0,style:{opacity:.5}})]}),(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsxs)(`label`,{className:`form-label`,children:[(0,C.jsx)(s,{size:14,style:{display:`inline`,verticalAlign:`middle`,marginRight:4}}),i(`settings.tx_currency`)]}),(0,C.jsx)(`select`,{className:`form-control`,value:o.currency,onChange:e=>T({...o,currency:e.target.value}),children:w.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))}),(0,C.jsx)(`small`,{style:{color:`var(--text-muted)`},children:i(`settings.tx_currency_desc`)})]}),(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsxs)(`label`,{className:`form-label`,children:[(0,C.jsx)(d,{size:14,style:{display:`inline`,verticalAlign:`middle`,marginRight:4}}),i(`settings.base_currency`)]}),(0,C.jsx)(`select`,{className:`form-control`,value:o.base_currency,onChange:e=>T({...o,base_currency:e.target.value}),children:w.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))}),(0,C.jsx)(`small`,{style:{color:`var(--text-muted)`},children:i(`settings.base_currency_desc`)})]}),(0,C.jsx)(`div`,{children:(0,C.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:O,children:O?(0,C.jsx)(`span`,{className:`spinner`}):i(`common.save_changes`,`Save Changes`)})})]})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginBottom:20},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:20},children:[(0,C.jsx)(b,{size:18,color:`var(--accent)`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:i(`settings.change_password`)})]}),(0,C.jsxs)(`form`,{onSubmit:le,style:{display:`flex`,flexDirection:`column`,gap:14,maxWidth:440},children:[(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`settings.current_password`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`password`,placeholder:i(`settings.current_password`),value:E.currentPassword,onChange:e=>D({...E,currentPassword:e.target.value}),required:!0})]}),(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`settings.new_password`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`password`,placeholder:i(`register.password_length_error`),value:E.newPassword,onChange:e=>D({...E,newPassword:e.target.value}),required:!0})]}),(0,C.jsxs)(`div`,{className:`form-group`,children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`settings.confirm_new_password`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`password`,placeholder:i(`settings.confirm_new_password`),value:E.confirmPassword,onChange:e=>D({...E,confirmPassword:e.target.value}),required:!0})]}),(0,C.jsx)(`div`,{children:(0,C.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:A,children:A?(0,C.jsx)(`span`,{className:`spinner`}):i(`settings.change_password`)})})]})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginBottom:20,border:`1px solid var(--accent-glow)`,background:`rgba(59,130,246,0.02)`},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,C.jsx)(c,{size:18,color:`#0088cc`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:`Telegram Integration`})]}),(0,C.jsx)(`span`,{className:`badge`,style:{background:`#0088cc20`,color:`#0088cc`},children:`Beta`})]}),(0,C.jsxs)(`p`,{style:{color:`var(--text-secondary)`,fontSize:`0.9rem`,marginBottom:20},children:[`Chat with your `,(0,C.jsx)(`strong`,{children:`FinWise Bot`}),` to log transactions instantly using natural language (e.g., "50 DH for coffee").`]}),e?.telegram_id?(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`var(--bg-input)`,padding:`12px 16px`,borderRadius:12,border:`1px solid var(--accent)`},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,C.jsx)(c,{size:16,color:`var(--accent)`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{style:{fontSize:`0.9rem`,fontWeight:600},children:`Connected`}),(0,C.jsx)(`div`,{style:{fontSize:`0.75rem`,color:`var(--text-secondary)`},children:`You're active on @FinwiseBudget_bot`})]})]}),(0,C.jsx)(`button`,{className:`btn btn-ghost btn-sm`,style:{color:`var(--danger)`,fontSize:`0.8rem`},onClick:async()=>
1{if(window.confirm(`Disconnect your Telegram account?`))try{await r.put(`/auth/profile`,{...o,telegram_id:null}),t({...e,telegram_id:null}),n.success(`Disconnected`)}catch{n.error(`Failed to disconnect`)}},children:`Disconnect`})]}):M?(0,C.jsxs)(`div`,{style:{background:`var(--bg-input)`,padding:16,borderRadius:12,border:`1px solid var(--border)`},children:[(0,C.jsxs)(`div`,{style:{fontSize:`0.85rem`,color:`var(--text-secondary)`,marginBottom:8},children:[`1. Open Telegram and find `,(0,C.jsx)(`strong`,{children:`@FinwiseBudget_bot`})]}),(0,C.jsx)(`div`,{style:{fontSize:`0.85rem`,color:`var(--text-secondary)`,marginBottom:12},children:`2. Send this command to pair your account:`}),(0,C.jsxs)(`div`,{style:{background:`var(--bg-main)`,padding:`12px 16px`,borderRadius:8,fontFamily:`monospace`,fontWeight:600,color:`var(--accent)`,border:`1px solid var(--border)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[`/start `,M,(0,C.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(`/start ${M}`),n.success(`Copied!`)},style:{background:`none`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`0.7rem`},children:`Copy`})]}),(0,C.jsx)(`p`,{style:{fontSize:`0.75rem`,color:`var(--text-muted)`,marginTop:12},children:`Expires in 10 minutes.`})]}):(0,C.jsxs)(`button`,{onClick:ue,className:`btn btn-secondary`,disabled:N,style:{display:`flex`,alignItems:`center`,gap:8},children:[N?(0,C.jsx)(p,{size:16,className:`spin`}):(0,C.jsx)(l,{size:16}),`Connect to Telegram`]})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginBottom:20,border:`1px solid var(--accent-glow)`,background:`rgba(234,67,53,0.02)`},children:[(0,C.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20},children:(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,C.jsx)(g,{size:18,color:`#EA4335`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:`Google Calendar Integration`})]})}),(0,C.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:`0.9rem`,marginBottom:20},children:`Automatically sync detected bill reminders to your Google Calendar.`}),(0,C.jsxs)(`button`,{onClick:de,className:`btn btn-secondary`,style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,C.jsx)(`img`,{src:`https://www.google.com/favicon.ico`,alt:`Google`,style:{width:16,height:16}}),new URLSearchParams(window.location.search).get(`google`)===`connected`?`Google Connected`:`Connect Google Calendar`]})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginBottom:20,border:`1px solid var(--accent-glow)`,background:`var(--bg-main)`},children:[(0,C.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20},children:(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[F?(0,C.jsx)(_,{size:18,color:`var(--accent)`}):(0,C.jsx)(v,{size:18,color:`var(--text-secondary)`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:`Push Notifications`})]})}),(0,C.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:`0.9rem`,marginBottom:20},children:`Receive instant push alerts on this device when you near or exceed a budget limit.`}),(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`var(--bg-input)`,padding:`12px 16px`,borderRadius:12,border:`1px solid var(--border)`},children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{style:{fontSize:`0.9rem`,fontWeight:600},children:`Budget Overspend Alerts`}),(0,C.jsx)(`div`,{style:{fontSize:`0.75rem`,color:`var(--text-secondary)`},children:`Warns at 90% and 100% capacity`})]}),(0,C.jsxs)(`label`,{className:`toggle-switch`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:F,onChange:fe,disabled:ne}),(0,C.jsx)(`span`,{className:`slider round`})]})]})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginBottom:20,border:`1px solid var(--accent-glow)`,background:`var(--bg-main)`},children:[(0,C.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20},children:(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,C.jsx)(y,{size:18,color:`var(--accent)`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:`Weekly Email Digest`})]})}),(0,C.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:`0.9rem`,marginBottom:20},children:`Receive a financial summary straight to your inbox every Sunday morning.`}),(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`var(--bg-input)`,padding:`12px 16px`,borderRadius:12,border:`1px solid var(--border)`},children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{style:{fontSize:`0.9rem`,fontWeight:600},children:`Weekly Summary`}),(0,C.jsxs)(`div`,{style:{fontSize:`0.75rem`,color:`var(--text-secondary)`},children:[`Sent to `,e?.email]})]}),(0,C.jsxs)(`label`,{className:`toggle-switch`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:R,onChange:pe,disabled:B}),(0,C.jsx)(`span`,{className:`slider round`})]})]})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginTop:20},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:20},children:[(0,C.jsx)(x,{size:18,color:`var(--accent)`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:`Custom Categories`})]}),(0,C.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:`0.9rem`,marginBottom:20},children:`Create personalized categories to better organize your finances. Default categories cannot be deleted.`}),(0,C.jsxs)(`form`,{onSubmit:ie,style:{display:`flex`,gap:12,flexWrap:`wrap`,marginBottom:24,alignItems:`flex-end`},children:[(0,C.jsxs)(`div`,{className:`form-group`,style:{flex:1,minWidth:200,marginBottom:0},children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`common.name`,`Name`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`text`,placeholder:`e.g. Pet Care, Hobbies`,value:H.name,onChange:e=>U({...H,name:e.target.value}),required:!0})]}),(0,C.jsxs)(`div`,{className:`form-group`,style:{width:120,marginBottom:0},children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`common.type`,`Type`)}),(0,C.jsxs)(`select`,{className:`form-control`,value:H.type,onCh
1ange:e=>U({...H,type:e.target.value}),children:[(0,C.jsx)(`option`,{value:`expense`,children:`Expense`}),(0,C.jsx)(`option`,{value:`income`,children:`Income`}),(0,C.jsx)(`option`,{value:`both`,children:`Both`})]})]}),(0,C.jsxs)(`div`,{className:`form-group`,style:{width:100,marginBottom:0},children:[(0,C.jsx)(`label`,{className:`form-label`,children:`Color`}),(0,C.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,height:42,background:`var(--bg-input)`,padding:`0 8px`,borderRadius:8,border:`1px solid var(--border)`},children:[(0,C.jsx)(`input`,{type:`color`,value:H.color,onChange:e=>U({...H,color:e.target.value}),style:{width:28,height:28,padding:0,border:`none`,borderRadius:4,cursor:`pointer`,background:`transparent`}}),(0,C.jsx)(`span`,{style:{fontSize:`0.8rem`,color:`var(--text-secondary)`},children:`Hex`})]})]}),(0,C.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:W,style:{height:42},children:W?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(l,{size:16}),` Add Option`]})})]}),(0,C.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(280px, 1fr))`,gap:12},children:J.map(e=>{let t=e.user_id===null;return(0,C.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,background:`var(--bg-main)`,border:`1px solid var(--border)`,borderRadius:12,padding:12},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,C.jsx)(`div`,{style:{width:36,height:36,borderRadius:8,background:`${e.color}20`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,C.jsx)(x,{size:18,color:e.color})}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{style:{fontWeight:600,fontSize:`0.95rem`},children:e.name}),(0,C.jsxs)(`div`,{style:{fontSize:`0.75rem`,color:`var(--text-secondary)`,textTransform:`capitalize`},children:[t?`System • `:`Custom • `,e.type]})]})]}),!t&&(0,C.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>ae(e.id),title:`Delete Category`,style:{color:`var(--danger)`,padding:6},children:(0,C.jsx)(u,{size:16})})]},e.id)})})]}),(0,C.jsxs)(`div`,{className:`card`,style:{marginTop:20},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginBottom:20},children:[(0,C.jsx)(y,{size:18,color:`var(--accent)`}),(0,C.jsx)(`span`,{style:{fontWeight:600,fontSize:`1rem`},children:i(`settings.auto_cat`)})]}),(0,C.jsx)(`p`,{style:{color:`var(--text-secondary)`,fontSize:`0.9rem`,marginBottom:20},children:i(`settings.auto_cat_desc`)}),(0,C.jsxs)(`form`,{onSubmit:oe,style:{display:`flex`,gap:12,flexWrap:`wrap`,marginBottom:24,alignItems:`flex-end`},children:[(0,C.jsxs)(`div`,{className:`form-group`,style:{flex:1,minWidth:200,marginBottom:0},children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`settings.keyword_match`)}),(0,C.jsx)(`input`,{className:`form-control`,type:`text`,placeholder:`e.g. 'Starbucks', 'Uber'`,value:X.keyword,onChange:e=>Z({...X,keyword:e.target.value}),required:!0})]}),(0,C.jsxs)(`div`,{className:`form-group`,style:{flex:1,minWidth:200,marginBottom:0},children:[(0,C.jsx)(`label`,{className:`form-label`,children:i(`settings.assign_category`)}),(0,C.jsxs)(`select`,{className:`form-control`,value:X.category_id,onChange:e=>Z({...X,category_id:e.target.value}),required:!0,children:[(0,C.jsxs)(`option`,{value:``,children:[i(`common.category`),`...`]}),J.map(e=>(0,C.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,C.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,disabled:Q,style:{height:42},children:Q?(0,C.jsx)(`span`,{className:`spinner`}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(l,{size:16}),` `,i(`settings.add_rule`)]})})]}),(0,C.jsx)(`div`,{className:`table-wrapper`,style:{border:`none`},children:(0,C.jsxs)(`table`,{children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{children:i(`settings.keyword_match`)}),(0,C.jsx)(`th`,{children:i(`settings.automatically_assigned`)}),(0,C.jsx)(`th`,{style:{width:80,textAlign:`right`},children:i(`common.type`,`Action`)})]})}),(0,C.jsx)(`tbody`,{children:K.length===0?(0,C.jsx)(`tr`,{children:(0,C.jsx)(`td`,{colSpan:`3`,style:{textAlign:`center`,color:`var(--text-muted)`,padding:`24px 0`},children:i(`settings.no_rules`)})}):(0,C.jsx)(m,{children:K.map(e=>(0,C.jsxs)(ee.tr,{layout:!0,initial:{opacity:0,y:-10}
1,animate:{opacity:1,y:0},exit:{opacity:0,scale:.9},children:[(0,C.jsxs)(`td`,{style:{fontWeight:600},children:[`"`,e.keyword,`"`]}),(0,C.jsx)(`td`,{children:(0,C.jsx)(`span`,{className:`badge`,style:{background:`${e.category_color}20`,color:e.category_color},children:e.category_name})}),(0,C.jsx)(`td`,{style:{textAlign:`right`},children:(0,C.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:()=>se(e.id),title:i(`common.delete`),children:(0,C.jsx)(u,{size:16,color:`var(--danger)`})})})]},e.id))})})]})})]})]})}export{T 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.