1import{c as _,g as J,h as U,v as K,u as H,aG as Y,a as $,r as N,j as e,a9 as V,aH as A,C as x,e as m,f as g,n as G,aJ as W,B as X,b as Z,aN as c,G as ee,aO as se,aP as te,aK as ae,aL as ie,L as R,I,s as re}from"./index-RN3KaJm1.js";import{S as ne}from"./switch-BhrWlD3y.js";import{A as ce}from"./arrow-up-right-dQRy1ykV.js";import{R as le}from"./radar-DTXjRuFg.js";import"./index-CnFF1EPa.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const oe=_("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const de=_("Palette",[["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:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);function p({icon:s,title:i,description:a}){return e.jsxs("div",{className:"flex items-start gap-3 pt-2 pb-1",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10 text-primary mt-0.5",children:e.jsx(s,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:i}),a&&e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:a})]})]})}function n({label:s,description:i,checked:a,onChange:u}){return e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsxs("div",{className:"min-w-0 pr-4",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i})]}),e.jsx(ne,{checked:a,onCheckedChange:u})]})}const T="askent_notification_prefs",M="askent_monitoring_prefs";function O(s,i){try{const a=localStorage.getItem(s);if(a)return{...i,...JSON.parse(a)}}catch{}return i}function fe(){var D,S;const{t:s}=J(),i=U(),{toast:a}=K(),{user:u}=H(),{profile:r}=Y(),{subscribed:l,subscription_tier:q,createCheckout:xe}=$(),z={emailNotifications:!0,weeklyReports:!0,mentionAlerts:!0,competitorAlerts:!1,coverageGapAlerts:!1},[o,E]=N.useState(()=>O(T,z)),h=(t,P)=>{const y={...o,[t]:P};E(y),localStorage.setItem(T,JSON.stringify(y))},B={defaultFrequency:"daily",chatgpt:!0,perplexity:!0,google_ai:!0,autoQueryDiscovery:!1},[d,L]=N.useState(()=>O(M,B)),f=(t,P)=>{const y={...d,[t]:P};L(y),localStorage.setItem(M,JSON.stringify(y))},[v,b]=N.useState(!1),[j,C]=N.useState(""),[w,k]=N.useState(""),F=async()=>{if(j!==w){a({title:s("passwordMismatch"),description:s("passwordMismatchDesc"),variant:"destructive"});return}if(j.length<8){a({title:s("passwordTooShort"),description:s("passwordTooShortDesc"),variant:"destructive"});return}try{const{error:t}=await re.auth.updateUser({password:j});if(t)throw t;a({title:s("passwordChanged"),description:s("passwordChangedDesc")}),C(""),k(""),b(!1)}catch{a({title:s("passwordChangeError"),description:s("passwordChangeErrorDesc"),variant:"destructive"})}},Q=[{value:"hourly",label:s("settingsPage.hourly")},{value:"daily",label:s("settingsPage.daily")},{value:"weekly",label:s("settingsPage.weekly")}];return e.jsxs("div",{className:"page-container",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(V,{className:"h-6 w-6 text-primary"}),e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:s("settingsPage.title")}),e.jsx("p",{className:"page-description",children:s("settingsPage.description")})]})]}),e.jsx(p,{icon:A,title:s("accountOverview"),description:s("accountOverviewDesc")}),e.jsx(x,{children:e.jsx(m,{className:"pt-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-lg",children:((S=(D=r==null?void 0:r.full_name)==null?void 0:D[0])==null?void 0:S.toUpperCase())||e.jsx(A,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground",children:(r==null?void 0:r.full_name)||s("notSet")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:u==null?void 0:u.email}),(r==null?void 0:r.company)&&e.jsx("p",{className:"text-xs text-muted-foreground",children:r.company})]})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>i("/profile"),children:[s("editProfile")," ",e.jsx(G,{className:"h-4 w-4 ml-1"})]})]})})}),e.jsx(p,{icon:W,title:s("billingSubscription"),description:s("billingSubscriptionDesc")}),e.jsx(x,{children:e.jsx(m,{className:"pt-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(X,{className:l?"bg-primary/10 text-primary border-primary/20 text-sm px-3 py-1":"text-sm px-3 py-1",variant:l?"default":"secondary",children:[l&&e.jsx(Z,{className:"w-3.5 h-3.5 mr-1"}),l?q||s("premiumPlan"):s("freePlan")]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:s(l?"unlimitedAccess":"limitedAccess")})]}),e.jsxs("div",{className:"flex gap-2",children:[!l&&e.jsxs(g,{size:"sm",onClick:()=>i("/billing"),children:[s("upgradeToPremium")," ",e.jsx(ce,{className:"w-3.5 h-3.5 ml-1"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>i("/billing"),children:[s("manageBilling")," ",e.jsx(G,{className:"h-4 w-4 ml-1"})]})]})]})})}),e.jsx(p,{icon:le,title:s("settingsPage.aiMonitoring"),description:s("settingsPage.aiMonitoringDesc")}),e.jsx(x,{children:e.jsxs(m,{className:"pt-5 space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s("settingsPage.defaultFrequency")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:s("settingsPage.defaultFrequencyDesc")}),e.jsx("div",{className:"flex gap-2",children:Q.map(t=>e.jsx(g,{size:"sm",variant:d.defaultFrequency===t.value?"default":"outline",onClick:()=>f("defaultFrequency",t.value),children:t.label},t.value))})]}),e.jsx(c,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s("settingsPage.platformsToMonitor")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:s("settingsPage.platformsToMonitorDesc")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{label:"ChatGPT",description:"OpenAI ChatGPT",checked:d.chatgpt,onChange:t=>f("chatgpt",t)}),e.jsx(n,{label:"Perplexity",description:"Perplexity AI",checked:d.perplexity,onChange:t=>f("perplexity",t)}),e.jsx(n,{label:"Google AI",description:"Google AI Overviews",checked:d.google_ai,onChange:t=>f("google_ai",t)})]})]}),e.jsx(c,{}),e.jsx(n,{label:s("settingsPage.autoQueryDiscovery"),description:s("settingsPage.autoQueryDiscoveryDesc"),checked:d.autoQueryDiscovery,onChange:t=>f("autoQueryDiscovery",t)})]})}),e.jsx(p,{icon:de,title:s("preferences"),description:s("preferencesDesc")}),e.jsx(x,{children:e.jsxs(m,{className:"pt-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[e.jsx(ee,{className:"w-4 h-4"})," ",s("language")]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("languageDesc")})]}),e.jsx(se,{})]}),e.jsx(c,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s("theme")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("themeDesc")})]}),e.jsx(te,{})]})]})}),e.jsx(p,{icon:oe,title:s("notifications"),description:s("notificationsDesc")}),e.jsx(x,{children:e.jsxs(m,{className:"pt-5 space-y-3",children:[e.jsx(n,{label:s("emailN
11otifications"),description:s("emailNotificationsDesc"),checked:o.emailNotifications,onChange:t=>h("emailNotifications",t)}),e.jsx(c,{}),e.jsx(n,{label:s("weeklyReports"),description:s("weeklyReportsDesc"),checked:o.weeklyReports,onChange:t=>h("weeklyReports",t)}),e.jsx(c,{}),e.jsx(n,{label:s("settingsPage.mentionAlerts"),description:s("settingsPage.mentionAlertsDesc"),checked:o.mentionAlerts,onChange:t=>h("mentionAlerts",t)}),e.jsx(c,{}),e.jsx(n,{label:s("settingsPage.competitorAlerts"),description:s("settingsPage.competitorAlertsDesc"),checked:o.competitorAlerts,onChange:t=>h("competitorAlerts",t)}),e.jsx(c,{}),e.jsx(n,{label:s("settingsPage.coverageGapAlerts"),description:s("settingsPage.coverageGapAlertsDesc"),checked:o.coverageGapAlerts,onChange:t=>h("coverageGapAlerts",t)})]})}),e.jsx(p,{icon:ae,title:s("security"),description:s("securityDesc")}),e.jsx(x,{children:e.jsxs(m,{className:"pt-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ie,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s("changePassword")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("changePasswordDesc")})]})]}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>b(!v),children:s(v?"cancel":"changePassword")})]}),v&&e.jsxs("div",{className:"space-y-4 pt-3 border-t",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s("passwordResetNote")}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-lg",children:[e.jsxs("div",{children:[e.jsx(R,{className:"text-xs",children:s("newPassword")}),e.jsx(I,{type:"password",value:j,onChange:t=>C(t.target.value),placeholder:s("enterNewPassword"),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs",children:s("confirmPassword")}),e.jsx(I,{type:"password",value:w,onChange:t=>k(t.target.value),placeholder:s("confirmNewPassword"),className:"mt-1"})]})]}),e.jsx(g,{size:"sm",onClick:F,disabled:!j||!w,children:s("updatePassword")})]})]})})]})}export{fe 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.