import{j as e}from"./ui-vendor-Cn57k9R1.js";import{r as a}from"./react-vendor-B9tfxWGs.js";import{d as j,Y as yt,ay as Bt,az as Vt,u as Yt,c as qt,e as R,B as d,aA as Ot,g as Wt,af as Gt,aB as Kt,aC as Xt,aD as $t,p as D}from"./index-DT-X9ySe.js";import{I as r}from"./input-DSW3IQ5Z.js";import{T as v}from"./textarea-WSPgJoPP.js";import{S as Qt,a as Zt,b as Jt,c as es,d as bt}from"./select-89bDitg8.js";import{u as ts,b as ss,c as as}from"./query-vendor-BGnEs3s8.js";import{u as os}from"./upload-Cg2O8dPG.js";import{U as z}from"./upload-DyWnrTJq.js";import{E as ht}from"./eye-off-vu7LJGiw.js";import{E as ft}from"./eye-B79ITPqV.js";import{P as rs}from"./plus-DuJLbiOF.js";import{G as ls}from"./globe-Bn5b9dTR.js";import"./charts-vendor-DecUTkfU.js";import"./editor-vendor-BA3QzDsK.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ns=j("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const is=j("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ds=j("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cs=j("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);function ms(){return ts({queryKey:yt.settings.list({}),queryFn:()=>Bt(),staleTime:12e4,refetchOnWindowFocus:!1})}function us(){const n=ss();return as({mutationFn:k=>Vt(k),onSuccess:()=>{n.invalidateQueries({queryKey:yt.settings.all()})}})}const pt=[{id:"company",label:"Company Info",icon:Wt},{id:"social",label:"Social Media",icon:ds},{id:"seo",label:"SEO Defaults",icon:ls},{id:"homepage",label:"Homepage Config",icon:ns},{id:"integrations",label:"Integrations",icon:is},{id:"users",label:"Admin Users",icon:Gt},{id:"account",label:"My Account",icon:Kt}],xs=[{id:"1",name:"Admin User",email:"admin@boaze.com",role:"super_admin",lastLogin:"12 Apr 2026, 9:30am"},{id:"2",name:"Staff Member",email:"staff@boaze.com",role:"staff",lastLogin:"10 Apr 2026, 2:15pm"}],Ps=()=>{const{user:n,refreshUser:k}=Yt(),u=(n==null?void 0:n.role)??"staff",[c,H]=a.useState(u==="super_admin"?"company":"account"),{toast:i}=qt();a.useEffect(()=>{u!=="super_admin"&&c!=="account"&&H("account")},[u,c]);const vt=u==="super_admin"?pt:pt.filter(t=>t.id==="account"),[B,V]=a.useState("Boaze Estate Development and Investment LTD"),[Y,q]=a.useState("Building the future of living, one verified plot at a time."),[O,W]=a.useState("RC6914089"),[G,K]=a.useState("+234 806 444 0389"),[X,$]=a.useState("2348064440389"),[Q,Z]=a.useState("boazedev@gmail.com"),[J,ee]=a.useState("Suite F4, Block 134, HFP Shopping Complex, Abraham Adesanya Roundabout, Ajah, Lagos State"),[te,se]=a.useState("Mon–Fri 8am–6pm, Sat 10am–4pm"),[ae,oe]=a.useState(""),[re,le]=a.useState(""),[ne,ie]=a.useState(""),[de,ce]=a.useState(""),[me,ue]=a.useState(""),[xe,ge]=a.useState("{page} | Boaze Estate"),[p,be]=a.useState(""),[he,fe]=a.useState(""),[pe,ye]=a.useState(`Your Dream Land,
Verified & Ready.`),[ve,je]=a.useState("We help Nigerians — at home and in the diaspora — own prime land in Lagos's fastest-growing corridors."),[N,ke]=a.useState("200"),[Ne,Se]=a.useState("Happy Landowners"),[S,we]=a.useState("4"),[_e,Ce]=a.useState("Active Estates"),[w,Le]=a.useState("7"),[Pe,Ue]=a.useState("Years of Excellence"),[Ee,Ie]=a.useState("100%"),[Me,Ae]=a.useState("Verified Titles"),[Te,Fe]=a.useState("https://wa.link/boazebook"),[Re,De]=a.useState("https://wa.link/boazeinquiry"),[ze,He]=a.useState("https://wa.link/boazediaspora"),[Be,Ve]=a.useState(""),[_,jt]=a.useState(!1),[Ye,qe]=a.useState(""),[Oe,We]=a.useState(""),[Ge,Ke]=a.useState(""),[Xe,$e]=a.useState(""),[C,kt]=a.useState(!1),[L,Qe]=a.useState(""),[P,Ze]=a.useState(""),[g,U]=a.useState(""),[x,Je]=a.useState(null),et=a.useRef(null),tt=a.useRef(null),st=a.useRef(null),[at,ot]=a.useState((n==null?void 0:n.name)??""),[E,rt]=a.useState((n==null?void 0:n.email)??""),[lt,nt]=a.useState(""),[I,it]=a.useState(""),[M,dt]=a.useState(""),[ct,mt]=a.useState(!1),[ut,xt]=a.useState(!1),b=ms(),A=us();a.useMemo(()=>{var t;return new Map(((t=b.data)==null?void 0:t.map(s=>[s.key,s.value]))??[])},[b.data]);const o=(t,s)=>{if(t==null)return s;if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t)}catch{return s}},Nt=t=>{const s=new Map(t.map(m=>[m.key,m.value]));V(o(s.get("company_name"),"Boaze Estate Development and Investment LTD")),q(o(s.get("tagline"),"Building the future of living, one verified plot at a time.")),W(o(s.get("rc_number"),"RC6914089")),K(o(s.get("phone"),"+234 806 444 0389")),$(o(s.get("whatsapp_number"),"2348064440389")),Z(o(s.get("email"),"boazedev@gmail.com")),ee(o(s.get("address"),"Suite F4, Block 134, HFP Shopping Complex, Abraham Adesanya Roundabout, Ajah, Lagos State")),se(o(s.get("working_hours"),"Mon–Fri 8am–6pm, Sat 10am–4pm")),oe(o(s.get("social_instagram"),"https://instagram.com/boazeestate")),le(o(s.get("social_facebook"),"https://facebook.com/boazeestate")),ie(o(s.get("social_linkedin"),"https://linkedin.com/company/boazeestate")),ce(o(s.get("social_youtube"),"https://youtube.com/@boazeestate")),ue(o(s.get("social_twitter"),"https://x.com/boazeestate")),ge(o(s.get("site_title"),"{page} | Boaze Estate")),be(o(s.get("site_description"),"")),fe(o(s.get("ga_id"),"")),ye(o(s.get("hero_headline"),`Your Dream Land,
Verified & Ready.`)),je(o(s.get("hero_subheadline"),"We help Nigerians — at home and in the diaspora — own prime land in Lagos's fastest-growing corridors.")),ke(o(s.get("stats_happy_landowners"),"200")),Se(o(s.get("stats_happy_landowners_label"),"Happy Landowners")),we(o(s.get("stats_active_estates"),"4")),Ce(o(s.get("stats_active_estates_label"),"Active Estates")),Le(o(s.get("stats_years_excellence"),"7")),Ue(o(s.get("stats_years_excellence_label"),"Years of Excellence")),Ie(o(s.get("stats_verified_titles"),"100%")),Ae(o(s.get("stats_verified_titles_label"),"Verified Titles")),Fe(o(s.get("whatsapp_book_link"),"https://wa.link/boazebook")),De(o(s.get("whatsapp_inquiry_link"),"https://wa.link/boazeinquiry")),He(o(s.get("whatsapp_diaspora_link"),"https://wa.link/boazediaspora")),Ve(o(s.get("google_maps_key"),"")),qe(o(s.get("smtp_host"),"")),We(o(s.get("smtp_port"),"")),Ke(o(s.get("smtp_username"),"")),$e(o(s.get("smtp_password"),"")),Qe(o(s.get("logo_url"),"")),Ze(o(s.get("og_image_url"),""));const l=s.get("hero_carousel_urls");Array.isArray(l)&&l.length>0&&typeof l[0]=="string"?U(String(l[0])):U(o(s.get("hero_image_url"),""))};a.useEffect(()=>{var t;(t=b.data)!=null&&t.length&&Nt(b.data)},[b.dataUpdatedAt]);const h=A.isPending;a.useEffect(()=>{n&&(ot(n.name),rt(n.email))},[n]);const St=async()=>{mt(!0);try{await Xt({name:at,email:E}),await k(),i({title:"Profile updated",description:"Your account details have been saved."})}catch{i({title:"Unable to update profile",description:"Please check your name and email, then try again.",variant:"destructive"})}finally{mt(!1)}},wt=async()=>{if(I!==M){i({title:"Passwords don't match",variant:"destructive"});return}xt(!0);try{await $t({current_password:lt,password:I,password_confirmation:M}),nt(""),it(""),dt(""),i({title:"Password updated",description:"Your password has been changed."})}catch{i({title:"Unable to change password",description:"Please verify your current password and try again.",variant:"destructive"})}finally{xt(!1)}},_t=()=>{i({title:"Logged out of all sessions",description:"This feature will be available soon."})},f=t=>{A.mutate(t,{onSuccess:()=>{i({title:"Settings saved",description:"Your changes have been saved successfully."})},onError:s=>{const{message:l,fieldErrors:m}=D(s),F=m?` ${Object.values(m).flat().join(" ")}`:"";i({title:"Unable to save settings",description:`${l}${F}`,variant:"destructive"})}})},T=async(t,s)=>{Je(s);try{const{url:l}=await os(t,{folder:"uploads"}),m=s==="hero"?[{key:"hero_image_url",value:l},{key:"hero_carousel_urls",value:[l]}]:s==="logo"?[{key:"logo_url",value:l}]:[{key:"og_image_url",value:l}];A.mutate(m,{onSuccess:()=>{i({title:"Image uploaded",description:"Saved to site settings."}),s==="logo"&&Qe(l),s==="og"&&Ze(l),s==="hero"&&U(l)},onError:F=>{const{message:zt,fieldErrors:gt}=D(F),Ht=gt?` ${Object.values(gt).flat().join(" ")}`:"";i({title:"Unable to save image URL",description:`${zt}${Ht}`,variant:"destructive"})}})}catch(l){i({title:"Upload failed",description:D(l).message,variant:"destructive"})}finally{Je(null)}},Ct=()=>f([{key:"company_name",value:B},{key:"tagline",value:Y},{key:"rc_number",value:O},{key:"phone",value:G},{key:"whatsapp_number",value:X},{key:"email",value:Q},{key:"address",value:J},{key:"working_hours",value:te},{key:"logo_url",value:L}]),Lt=()=>f([{key:"social_instagram",value:ae},{key:"social_facebook",value:re},{key:"social_linkedin",value:ne},{key:"social_youtube",value:de},{key:"social_twitter",value:me}]),Pt=()=>f([{key:"site_title",value:xe},{key:"site_description",value:p},{key:"ga_id",value:he},{key:"og_image_url",value:P}]),Ut=()=>f([{key:"hero_headline",value:pe},{key:"hero_subheadline",value:ve},{key:"stats_happy_landowners",value:Number(N)||N},{key:"stats_happy_landowners_label",value:Ne},{key:"stats_active_estates",value:Number(S)||S},{key:"stats_active_estates_label",value:_e},{key:"stats_years_excellence",value:Number(w)||w},{key:"stats_years_excellence_label",value:Pe},{key:"stats_verified_titles",value:Ee},{key:"stats_verified_titles_label",value:Me},{key:"hero_image_url",value:g},{key:"hero_carousel_urls",value:g?[g]:[]}]),Et=()=>f([{key:"whatsapp_book_link",value:Te},{key:"whatsapp_inquiry_link",value:Re},{key:"whatsapp_diaspora_link",value:ze},{key:"google_maps_key",value:Be},{key:"smtp_host",value:Ye},{key:"smtp_port",value:Oe},{key:"smtp_username",value:Ge},{key:"smtp_password",value:Xe}]),[It,y]=a.useState(!1),[Mt,At]=a.useState(""),[Tt,Ft]=a.useState(""),[Rt,Dt]=a.useState("staff");return u!=="super_admin"&&c!=="account"?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsxs("div",{className:"text-center",children:[e.jsx(cs,{className:"w-16 h-16 text-muted-foreground/30 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground font-body",children:"Access Restricted"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body mt-1",children:"Only super admins can access site settings."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-[22px] font-bold text-foreground font-body",children:"Site Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body mt-1",children:"Manage your website configuration"})]}),e.jsxs("div",{className:"flex gap-6 flex-col lg:flex-row",children:[e.jsx("div",{className:"lg:w-[220px] shrink-0",children:e.jsx("nav",{className:"flex lg:flex-col gap-1 overflow-x-auto lg:overflow-visible",children:vt.map(t=>e.jsxs("button",{onClick:()=>H(t.id),className:R("flex items-center gap-2 px-3 py-2.5 text-sm rounded-lg font-body transition-colors whitespace-nowrap",c===t.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[e.jsx(t.icon,{className:"w-4 h-4 shrink-0"}),t.label]},t.id))})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 space-y-5",children:[c==="company"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"Company Information"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Company Name"}),e.jsx(r,{value:B,onChange:t=>V(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"RC Number"}),e.jsx(r,{value:O,onChange:t=>W(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Tagline"}),e.jsx(r,{value:Y,onChange:t=>q(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Main Phone"}),e.jsx(r,{type:"tel",value:G,onChange:t=>K(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"WhatsApp Number"}),e.jsx(r,{type:"tel",value:X,onChange:t=>$(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Main Email"}),e.jsx(r,{type:"email",value:Q,onChange:t=>Z(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Physical Address"}),e.jsx(v,{value:J,onChange:t=>ee(t.target.value),rows:3})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Working Hours"}),e.jsx(r,{value:te,onChange:t=>se(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Logo"}),e.jsx("input",{ref:et,type:"file",accept:"image/*",className:"hidden",onChange:t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];s&&T(s,"logo"),t.target.value=""}}),e.jsxs("button",{type:"button",disabled:x==="logo",onClick:()=>{var t;return(t=et.current)==null?void 0:t.click()},className:"border-2 border-dashed border-primary/30 rounded-xl p-6 flex flex-col items-center gap-2 cursor-pointer hover:border-primary/50 transition-colors w-full",children:[e.jsx(z,{className:"w-8 h-8 text-primary/50"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body",children:x==="logo"?"Uploading…":"Upload logo (navbar / footer)"})]}),L?e.jsx("img",{src:L,alt:"Current logo",className:"mt-4 h-16 object-contain rounded border border-border p-2"}):null]}),e.jsx(d,{disabled:h,onClick:Ct,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:"Save Changes"})]}),c==="social"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"Social Media Links"}),[{label:"Instagram URL",value:ae,set:oe},{label:"Facebook URL",value:re,set:le},{label:"LinkedIn URL",value:ne,set:ie},{label:"YouTube URL",value:de,set:ce},{label:"Twitter/X URL",value:me,set:ue}].map(t=>e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:t.label}),e.jsx(r,{value:t.value,onChange:s=>t.set(s.target.value),placeholder:"https://..."})]},t.label)),e.jsx(d,{disabled:h,onClick:Lt,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:"Save Changes"})]}),c==="seo"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"SEO Defaults"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Default Meta Title Template"}),e.jsx(r,{value:xe,onChange:t=>ge(t.target.value)}),e.jsxs("p",{className:"text-xs text-muted-foreground font-body mt-1",children:["Use ","{page}"," for page name"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Default Meta Description"}),e.jsx(v,{value:p,onChange:t=>be(t.target.value),rows:3}),e.jsxs("p",{className:R("text-xs mt-1 font-body",p.length>160?"text-destructive":"text-muted-foreground"),children:[p.length,"/160"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Default OG Image"}),e.jsx("input",{ref:tt,type:"file",accept:"image/*",className:"hidden",onChange:t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];s&&T(s,"og"),t.target.value=""}}),e.jsxs("button",{type:"button",disabled:x==="og",onClick:()=>{var t;return(t=tt.current)==null?void 0:t.click()},className:"border-2 border-dashed border-primary/30 rounded-xl p-6 flex flex-col items-center gap-2 cursor-pointer hover:border-primary/50 transition-colors w-full",children:[e.jsx(z,{className:"w-8 h-8 text-primary/50"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body",children:x==="og"?"Uploading…":"Upload OG image"})]}),P?e.jsx("img",{src:P,alt:"Open Graph preview",className:"mt-4 max-h-40 rounded-lg border border-border"}):null]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Google Analytics Measurement ID"}),e.jsx(r,{value:he,onChange:t=>fe(t.target.value),placeholder:"G-XXXXXXX"})]}),e.jsx(d,{disabled:h,onClick:Pt,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:"Save Changes"})]}),c==="homepage"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"Homepage Configuration"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Hero Image"}),e.jsx("input",{ref:st,type:"file",accept:"image/*",className:"hidden",onChange:t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];s&&T(s,"hero"),t.target.value=""}}),e.jsxs("button",{type:"button",disabled:x==="hero",onClick:()=>{var t;return(t=st.current)==null?void 0:t.click()},className:"border-2 border-dashed border-primary/30 rounded-xl p-6 flex flex-col items-center gap-2 cursor-pointer hover:border-primary/50 transition-colors w-full",children:[e.jsx(z,{className:"w-8 h-8 text-primary/50"}),e.jsx("p",{className:"text-sm text-muted-foreground font-body",children:x==="hero"?"Uploading…":"Upload hero image (replaces carousel)"})]}),g?e.jsx("img",{src:g,alt:"Hero preview",className:"mt-4 max-h-48 rounded-lg border border-border object-cover w-full max-w-md"}):null]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Hero Headline"}),e.jsx(v,{value:pe,onChange:t=>ye(t.target.value),rows:2})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Hero Subheadline"}),e.jsx(v,{value:ve,onChange:t=>je(t.target.value),rows:3})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Featured Properties"}),e.jsx("p",{className:"text-xs text-muted-foreground font-body mb-2",children:"Select up to 4 properties to feature on the homepage (drag to reorder)"}),e.jsx("div",{className:"border border-input rounded-lg p-4 min-h-[80px] text-sm text-muted-foreground font-body",children:"Will connect to properties data — select and reorder here"})]}),e.jsxs("div",{className:"border-t border-border pt-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground font-body mb-4",children:"Trust Stats"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[{label:"Landowners Count",value:N,set:ke,labelField:Ne,setLabel:Se},{label:"Estates Count",value:S,set:we,labelField:_e,setLabel:Ce},{label:"Years Count",value:w,set:Le,labelField:Pe,setLabel:Ue},{label:"Verification Text",value:Ee,set:Ie,labelField:Me,setLabel:Ae}].map(t=>e.jsxs("div",{className:"space-y-2 bg-muted/30 rounded-lg p-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground font-body",children:t.label}),e.jsx(r,{value:t.value,onChange:s=>t.set(s.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground font-body",children:"Label"}),e.jsx(r,{value:t.labelField,onChange:s=>t.setLabel(s.target.value),className:"mt-1"})]})]},t.label))})]}),e.jsx(d,{disabled:h,onClick:Ut,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:"Save Changes"})]}),c==="integrations"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"Integrations"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground font-body",children:"WhatsApp Links"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Contact / Book Inspection Link"}),e.jsx(r,{value:Te,onChange:t=>Fe(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Property Inquiry Link"}),e.jsx(r,{value:Re,onChange:t=>De(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Diaspora Team Link"}),e.jsx(r,{value:ze,onChange:t=>He(t.target.value)})]})]}),e.jsxs("div",{className:"border-t border-border pt-5 space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground font-body",children:"Google Maps"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx(r,{type:_?"text":"password",value:Be,onChange:t=>Ve(t.target.value),placeholder:"AIza..."}),e.jsx("button",{type:"button",onClick:()=>jt(!_),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:_?e.jsx(ht,{className:"w-4 h-4"}):e.jsx(ft,{className:"w-4 h-4"})})]})]})]}),e.jsxs("div",{className:"border-t border-border pt-5 space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground font-body",children:"SMTP Email"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"SMTP Host"}),e.jsx(r,{value:Ye,onChange:t=>qe(t.target.value),placeholder:"smtp.gmail.com"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"SMTP Port"}),e.jsx(r,{type:"number",value:Oe,onChange:t=>We(t.target.value),placeholder:"587"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"SMTP Username"}),e.jsx(r,{value:Ge,onChange:t=>Ke(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"SMTP Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(r,{type:C?"text":"password",value:Xe,onChange:t=>$e(t.target.value)}),e.jsx("button",{type:"button",onClick:()=>kt(!C),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:C?e.jsx(ht,{className:"w-4 h-4"}):e.jsx(ft,{className:"w-4 h-4"})})]})]}),e.jsxs(d,{variant:"outline",className:"font-body",onClick:()=>i({title:"Test email sent",description:"Check your inbox."}),children:[e.jsx(Ot,{className:"w-4 h-4 mr-1"})," Send Test Email"]})]}),e.jsx(d,{disabled:h,onClick:Et,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:"Save Changes"})]}),c==="users"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"Admin Users"}),e.jsxs(d,{onClick:()=>y(!0),className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:[e.jsx(rs,{className:"w-4 h-4 mr-1"})," Invite Admin User"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b",style:{background:"#F4F1EB"},children:["Name","Email","Role","Last Login","Actions"].map(t=>e.jsx("th",{className:"text-left px-4 py-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider font-body",children:t},t))})}),e.jsx("tbody",{children:xs.map(t=>e.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30",children:[e.jsx("td",{className:"px-4 py-3 text-sm font-medium text-foreground font-body",children:t.name}),e.jsx("td",{className:"px-4 py-3 text-sm text-muted-foreground font-body",children:t.email}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:R("text-xs px-2 py-1 rounded-full font-medium font-body",t.role==="super_admin"?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:t.role})}),e.jsx("td",{className:"px-4 py-3 text-sm text-muted-foreground font-body",children:t.lastLogin}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{className:"text-xs text-primary hover:underline font-body",children:"Edit role"}),e.jsx("button",{className:"text-xs text-muted-foreground hover:underline font-body",children:"Reset password"}),t.email!==E&&e.jsx("button",{className:"text-xs text-destructive hover:underline font-body",children:"Delete"})]})})]},t.id))})]})}),It&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-foreground/30 z-50",onClick:()=>y(!1)}),e.jsxs("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-card rounded-2xl p-6 z-50 w-full max-w-md shadow-2xl border border-border",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground font-body mb-4",children:"Invite Admin User"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Name"}),e.jsx(r,{value:Mt,onChange:t=>At(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Email"}),e.jsx(r,{type:"email",value:Tt,onChange:t=>Ft(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Role"}),e.jsxs(Qt,{value:Rt,onValueChange:Dt,children:[e.jsx(Zt,{children:e.jsx(Jt,{})}),e.jsxs(es,{children:[e.jsx(bt,{value:"super_admin",children:"Super Admin"}),e.jsx(bt,{value:"staff",children:"Staff"})]})]})]})]}),e.jsxs("div",{className:"flex gap-3 mt-6 justify-end",children:[e.jsx(d,{variant:"outline",className:"font-body",onClick:()=>y(!1),children:"Cancel"}),e.jsx(d,{className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",onClick:()=>{y(!1),i({title:"Invitation sent"})},children:"Send Invitation"})]})]})]})]}),c==="account"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground font-body",children:"My Account"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Name"}),e.jsx(r,{value:at,onChange:t=>ot(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Email"}),e.jsx(r,{type:"email",value:E,onChange:t=>rt(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Role"}),e.jsx(r,{value:u,disabled:!0,className:"max-w-xs"})]}),e.jsx(d,{disabled:ct,onClick:St,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:ct?"Saving…":"Update Profile"}),e.jsxs("div",{className:"border-t border-border pt-5 space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground font-body",children:"Change Password"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Current Password"}),e.jsx(r,{type:"password",value:lt,onChange:t=>nt(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"New Password"}),e.jsx(r,{type:"password",value:I,onChange:t=>it(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground font-body mb-1.5 block",children:"Confirm Password"}),e.jsx(r,{type:"password",value:M,onChange:t=>dt(t.target.value)})]})]}),e.jsx(d,{disabled:ut,onClick:wt,className:"bg-primary hover:bg-primary-dark text-primary-foreground font-body",children:ut?"Updating…":"Update Password"})]}),e.jsxs("div",{className:"border-t border-destructive/20 pt-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-destructive font-body mb-2",children:"Danger Zone"}),e.jsx(d,{variant:"outline",className:"text-destructive border-destructive/30 font-body",onClick:_t,children:"Log Out All Sessions"})]})]})]})})]})]})};export{Ps as default};
