1import{j as t}from"./jsx-runtime-D_zvdyIk.js";import{r as j,u as A,d as w}from"./chunk-EF7DTUVF-BXS4vzWS.js";import{u as T}from"./hooks-KPfNan3X.js";import{P as k,D as C}from"./index-tDb3vN6V.js";import{D as f}from"./routes-Beb14OxE.js";import{u as R}from"./useTranslation-DZ5yJ_G6.js";import{B as g}from"./Box-C6rW1ow8.js";import{A as E}from"./Alert-BmMwPi4_.js";import{g as z,d as I,u as P,s as D,c as L,b as S,m as M}from"./memoTheme-PGpTvV_L.js";import{T as p}from"./Typography-C1UKWRKc.js";import{B}from"./Button-I3nl3k84.js";import{I as F}from"./IconButton-l1BQfvWq.js";import{c as v}from"./createSvgIcon-CjkfkFCM.js";import{E as U,C as W}from"./ExpandMore-BpDYwyfE.js";import{L as n}from"./Login-D6a9_hRK.js";function _(a){return z("MuiAlertTitle",a)}I("MuiAlertTitle",["root"]);const N=a=>{const{classes:l}=a;return S({root:["root"]},_,l)},Y=D(p,{name:"MuiAlertTitle",slot:"Root"})(M(({theme:a})=>({fontWeight:a.typography.fontWeightMedium,marginTop:-2}))),$=j.forwardRef(function(l,i){const c=P({props:l,name:"MuiAlertTitle"}),{className:x,...e}=c,h=c,u=N(h);return t.jsx(Y,{gutterBottom:!0,component:"div",ownerState:h,ref:i,className:L(u.root,x),...e})}),H=v(t.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"})),s=v(t.jsx("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"})),y=v(t.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}
1)),le=({error:a,errorType:l="unknown",onRetry:i,showDetails:c=!1,className:x})=>{const{t:e}=R(),h=A(),u=T(),[d,b]=w.useState(!1),m=(r=>{const o={home:()=>h("/"),login:()=>u(C({redirectTo:`/${f.Dashboard}/${f.Accounts}`})),retry:()=>i==null?void 0:i(),reinitialize:()=>u(k())};return{network:{severity:"warning",title:e("auth.errors.network.title","Connection Problem"),message:e("auth.errors.network.message","Unable to connect to the authentication server. Please check your internet connection and try again."),actions:[{label:e("common.retry"),action:o.retry,variant:"contained",icon:t.jsx(y,{})},{label:e("common.home"),action:o.home,variant:"outlined",icon:t.jsx(s,{})}],canRetry:!0},oauth_provider:{severity:"error",title:e("auth.errors.provider.title","Authentication Service Error"),message:e("auth.errors.provider.message","There was a problem with the authentication service. This is usually temporary."),actions:[{label:e("auth.tryAgain"),action:o.login,variant:"contained",icon:t.jsx(n,{})},{label:e("common.home"),action:o.home,variant:"outlined",icon:t.jsx(s,{})}],canRetry:!0},token_refresh:{severity:"warning",title:e("auth.errors.refresh.title","Session Refresh Failed"),message:e("auth.errors.refresh.message","Your session could not be renewed. Please log in again to continue."),actions:[{label:e("auth.loginAgain"),action:o.login,variant:"contained",icon:t.jsx(n,{})},{label:e("common.home"),action:o.home,variant:"outlined",icon:t.jsx(s,{})}],canRetry:!1},session_timeout:{severity:"info",title:e("auth.errors.timeout.title","Session Expired"),message:e("auth.errors.timeout.message","Your session has expired for security reasons. Please log in again to continue."),actions:[{label:e("auth.loginAgain"),action:o.login,variant:"contained",icon:t.jsx(n,{})}],canRetry:!1},invalid_credentials:{severity:"error",title:e("auth.errors.credentials.title","Invalid Credentials"),message:e("auth.errors.credentials.message","The provided credentials are invalid or have expired. Please try logging in again."),actions:[{label:e("auth.tryAgain"),action:o.login,variant:"contained",icon:t.jsx(n,{})},{label:e("common.home"),action:o.home,variant:"outlined",icon:t.jsx(s,{})}],canRetry:!1},initialization:{severity:"warning",title:e("auth.errors.init.title","Authentication Setup Failed"),message:e("auth.errors.init.message","Failed to initialize the authentication system. Please refresh the page or try again."),actions:[{label:e("common.retry"),action:o.reinitialize,variant:"contained",icon:t.jsx(y,{})},{label:e("common.refresh"),action:()=>window.location.reload(),variant:"outlined"}],canRetry:!0},callback:{severity:"error",title:e("auth.errors.callback.title","Login Completion Failed"),message:e("auth.errors.callback.message","There was a problem completing your login. Please try signing in again."),actions:[{label:e("auth.tryAgain"),action:o.login,variant:"contained",icon:t.jsx(n,{})},{label:e("common.home"),action:o.home,variant:"outlined",icon:t.jsx(s,{})}],canRetry:!1},unknown:{severity:"error",title:e("auth.errors.unknown.title","Authentication Error"),message:e("auth.errors.unknown.message","An unexpected authentication error occurred. Please try again or contact support if the problem persists."),actions:[{label:e("common.retry"),action:o.retry,variant:"contained",icon:t.jsx(y,{})},{label:e("auth.tryAgain"),action:o.login,variant:"outlined",icon:t.jsx(n,{})},{label:e("common.home"),action:o.home,variant:"text",icon:t.jsx(s,{})}],canRetry:!0}}[r]})(l);return t.jsx(g,{className:x,sx:{maxWidth:600,mx:"auto",mt:2},children:t.jsxs(E,{severity:m.severity,sx:{mb:2},children:[t.jsx($,{children:m.title}),t.jsx(p,{variant:"body2",sx:{mb:2},children:m.message}),t.jsx(g,{sx:{display:"flex",gap:1,flexWrap:"wrap",mb:c?1:0},children:m.actions.map((r,o)=>t.jsx(B,{variant:r.variant,size:"small",startIcon:r.icon,onClick:r.action,disabled:r.label===e("common.retry")&&!m.canRetry,children:r.label},o))}),c&&a&&t.jsxs(t.Fragment,{children:[t.jsxs(g,{sx:{display:"flex",alignItems:"center",mt:1},children:[t.jsx(F,{size:"small",onClick:()=>b(!d),sx:{mr:1},children:d?t.jsx(H,{}):t.jsx(U,{})}),t.jsx(p,{variant:"caption",color:"text.secondary",children:e(d?"common.hideDetails":"common.showDetail
1s")})]}),t.jsx(W,{in:d,children:t.jsx(g,{sx:{mt:1,p:1,backgroundColor:"rgba(0, 0, 0, 0.04)",borderRadius:1,fontFamily:"monospace",fontSize:"0.75rem",wordBreak:"break-all"},children:t.jsx(p,{variant:"caption",component:"pre",children:a})})})]})]})})};export{le as A};
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.