1import{u as x,j as e,c6 as j,I as w}from"./index-DGRgO-qd.js";import{m as N,r as t}from"./vendor-CcMWqYlm.js";import{s as r}from"./supabase-admin-CdNnRSUI.js";import{l as b}from"./adminOAuth-BRZuUEPg.js";import"./leaflet-BYsLm_qT.js";import"./adminAuthErrors-Cv-eeWhC.js";function C(){const{siteAdmin:l}=N(),[i,p]=t.useState([]),[o,c]=t.useState(""),[d,m]=t.useState(null),[u,n]=t.useState(null);x({title:"Account",robots:"noindex,follow"}),t.useEffect(()=>{r&&r.auth.getUserIdentities().then(({data:s,error:a})=>{a||p(((s==null?void 0:s.identities)??[]).map(f=>f.provider))})},[]);async function h(){n(null);const{error:s}=await b();s&&n(s)}async function g(s){if(s.preventDefault(),n(null),m(null),o.length<8){n("Use at least 8 characters.");return}if(!r)return;const{error:a}=await r.auth.updateUser({password:o});if(a){n(a.message);return}c(""),m("Password updated.")}return e.jsxs("div",{className:"admin-screen admin-screen--account",children:[e.jsx("p",{className:"admin-eyebrow",children:"ACCOUNT"}),e.jsx("h1",{className:"admin-title",children:"Account"}),e.jsxs("p",{className:"admin-subtitle",children:["Signed in as ",e.jsx("strong",{children:l.email})," (",l.role,")"]}),e.jsx("h2",{className:"admin-section-title",children:"Linked sign-in methods"}),e.jsxs("p",{style:{fontSize:"0.9rem"},children:["Email: ",i.includes("email")?"linked":"active via password",e.jsx("br",{}),"Google: ",i.includes("google")?"linked":"not linked"]}),!i.includes("google")&&e.jsx(j,{className:"admin-auth-google",onClick:()=>void h()}),e.jsx("h2",{className:"admin-section-title",children:"Change password"}),e.jsxs("form",{onSubmit:g,className:"admin-form-panel admin-form-panel--narrow",children:[e.jsx(w,{type:"password",value:o,onChange:s=>c(s.target.value),placeholder:"New password"}),e.jsx("button",{type:"submit",className:"btn btn-primary",children:"Update password"})]}),d&&e.jsx("p",{className:"admin-feedback",children:d}),u&&e.jsx("p",{className:"field-error",children:u})]})}export{C 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.