PageSourceSearch

https://ethioexplorer.com/assets/EthiopianMonarchs-DunazyRu.js

js ethioexplorer.com collected 2026-10-02 13:11:29 UTC 53,424 bytes, 6 lines download raw bytes

1import{J as he,r as d,j as e,O as L,X as W,B as me,F as be,aF as re,a as ge,V as pe,b as ue,aA as ie,L as oe,H as O,i as fe,d as je,E as Z,P as ne,aC as ve,W as de,ax as ce,a7 as ee,A as ke,Q as ye,S as Ne,v as we,m as Se,n as J,aa as xe,ab as ae,ad as Ae}from"./index-D82aNb1r.js";import{S as Ce}from"./SEOHead-iRFO5ScQ.js";import{H as te}from"./HistoricalImagePlaceholder-BUfP8xsm.js";import{T as B}from"./trash-2-x7t2PzmZ.js";import{S as Ee}from"./save-BtDfcIPz.js";import{S as Te}from"./SocialShare-BI4mvhXG.js";import{A as Le}from"./arrow-up-down-BcFDOpDV.js";import{G as Me}from"./grid-3x3-DWK_50E4.js";import{L as Pe}from"./list-Co21CSIL.js";import{P as Re}from"./plus-PVxxLbiE.js";import{P as se}from"./pen-line-DrANO68i.js";import{C as Ie}from"./chevron-left-DR0CKUKS.js";import"./imageOptimization-DN6a4zir.js";import"./send-BHb2NlWg.js";import"./message-circle-BB6jNWzx.js";import"./copy-BWMihUhf.js";import"./printer-DPZbjqrG.js";/**
2 * @license lucide-react v1.34.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 De=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Fe=he("scroll-text",De);function _e({isOpen:M,onClose:D,monarch:x,onSave:F}){var K,l,b,f,V,q;const[s,o]=d.useState({name:"",amharicName:"",title:"",dynasty:"",eraId:"modern_empire",eraName:"Modern Empire & Reunification",reignStartYear:1889,reignEndYear:1913,reignDates:"1889 – 1913",ethiopianCalendarReign:"",capitalOrSeat:"Addis Ababa",portraitUrl:"",shortSummary:"",keyAccomplishments:[],tags:[],biographyTabs:{overview:"",earlyLifeAndRise:"",reignAndAchievements:"",militaryAndForeignPolicy:"",culturalAndReligiousLegacy:"",keyMilestones:[]}}),[u,Y]=d.useState("basic"),[P,$]=d.useState(""),[v,U]=d.useState(""),[w,g]=d.useState(""),[C,S]=d.useState(!1);if(d.useEffect(()=>{var t,i,m,h,j,A;o(x?{...x,biographyTabs:{overview:((t=x.biographyTabs)==null?void 0:t.overview)||"",earlyLifeAndRise:((i=x.biographyTabs)==null?void 0:i.earlyLifeAndRise)||"",reignAndAchievements:((m=x.biographyTabs)==null?void 0:m.reignAndAchievements)||"",militaryAndForeignPolicy:((h=x.biographyTabs)==null?void 0:h.militaryAndForeignPolicy)||"",culturalAndReligiousLegacy:((j=x.biographyTabs)==null?void 0:j.culturalAndReligiousLegacy)||"",keyMilestones:((A=x.biographyTabs)==null?void 0:A.keyMilestones)||[]}}:{id:`monarch-${Date.now()}`,name:"",amharicName:"",title:"Emperor of Ethiopia",dynasty:"Solomonic Dynasty",eraId:"modern_empire",eraName:"Modern Empire & Reunification",reignStartYear:1889,reignEndYear:1913,reignDates:"1889 – 1913",ethiopianCalendarReign:"",capitalOrSeat:"Addis Ababa",portraitUrl:"",shortSummary:"",keyAccomplishments:[],tags:["Monarch","Ethiopian History"],biographyTabs:{overview:"",earlyLifeAndRise:"",reignAndAchievements:"",militaryAndForeignPolicy:"",culturalAndReligiousLegacy:"",keyMilestones:[]}})},[x,M]),!M)return null;const Q=t=>{const i=re.find(m=>m.id===t);o(m=>({...m,eraId:t,eraName:i?i.label.replace(/\s*\([^)]*\)/,""):"Modern Era"}))},k=()=>{P.trim()&&(o(t=>({...t,keyAccomplishments:[...t.keyAccomplishments||[],P.trim()]})),$(""))},X=t=>{o(i=>({...i,keyAccomplishments:(i.keyAccomplishments||[]).filter((m,h)=>h!==t)}))},R=()=>{v.trim()&&(o(t=>({...t,tags:[...t.tags||[],v.trim()]})),U(""))},z=t=>{o(i=>({...i,tags:(i.tags||[]).filter((m,h)=>h!==t)}))},y=()=>{w.trim()&&(o(t=>{var i;return{...t,biographyTabs:{...t.biographyTabs,keyMilestones:[...((i=t.biographyTabs)==null?void 0:i.keyMilestones)||[],w.trim()]}}}),g(""))},I=t=>{o(i=>{var m;return{...i,biographyTabs:{...i.biographyTabs,keyMilestones:(((m=i.biographyTabs)==null?void 0:m.keyMilestones)||[]).filter((h,j)=>j!==t)}}})},N=async t=>{var i,m,h,j,A,G,p;if(t.preventDefault(),!((i=s.name)!=null&&i.trim())){alert("Please enter a monarch name.");return}S(!0);try{const _={id:s.id||`monarch-${Date.now()}`,name:s.name||"Unnamed Monarch",amharicName:s.amharicName||"",title:s.title||"Head of State",dynasty:s.dynasty||"Solomonic Dynasty",eraId:s.eraId||"modern_empire",eraName:s.eraName||"Modern Era",reignStartYear:Number(s.reignStartYear)||0,reignEndYear:Number(s.reignEndYear)||0,reignDates:s.reignDates||`${s.reignStartYear} – ${s.reignEndYear}`,ethiopianCalendarReign:s.ethiopianCalendarReign||"",capitalOrSeat:s.capitalOrSeat||"Addis Ababa",portraitUrl:s.portraitUrl||"",shortSummary:s.shortSummary||"",keyAccomplishments:s.keyAccomplishments||[],tags:s.tags||["Monarch"],biographyTabs:{overview:((m=s.biographyTabs)==null?void 0:m.overview)||s.shortSummary||"",earlyLifeAndRise:((h=s.biographyTabs)==null?void 0:h.earlyLifeAndRise)||"",reignAndAchievements:((j=s.biographyTabs)==null?void 0:j.reignAndAchievements)||"",militaryAndForeignPolicy:((A=s.biographyTabs)==null?void 0:A.militaryAndForeignPolicy)||"",culturalAndReligiousLegacy:((G=s.biographyTabs)==null?void 0:G.culturalAndReligiousLegacy)||"",keyMilestones:((p=s.biographyTabs)==null?void 0:p.keyMilestones)||[]}};await F(_),D()}catch(_){console.error("Error saving monarch:",_),alert("Failed to save monarch data. Please check connection.")}finally{S(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/80 backdrop-blur-sm overflow-y-auto",children:e.jsxs("div",{className:"relative w-full max-w-4xl bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 my-8 overflow-hidden flex flex-col max-h-[90vh]",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-200 dark:border-slate-800 bg-gradient-to-r from-amber-950/40 via-slate-900 to-slate-950 text-white",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-2xl bg-amber-500/20 border border-amber-500/40 text-amber-400",children:e.jsx(L,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold font-serif text-amber-200",children:x?`Edit Ruler
6: ${x.name}`:"Add New Monarch / Head of State"}),e.jsx("p",{className:"text-xs text-slate-300",children:"Update historical attributes, dynasty, era, accomplishments, and biography tabs."})]})]}),e.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-white hover:bg-slate-800 rounded-xl transition-colors",children:e.jsx(W,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"flex items-center gap-2 px-6 pt-4 border-b border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900/50",children:[e.jsxs("button",{type:"button",onClick:()=>Y("basic"),className:`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 ${u==="basic"?"bg-amber-500 text-slate-950 shadow-sm":"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:[e.jsx(L,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Basic Info & Era"})]}),e.jsxs("button",{type:"button",onClick:()=>Y("bio"),className:`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 ${u==="bio"?"bg-amber-500 text-slate-950 shadow-sm":"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:[e.jsx(me,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Multi-Tab Biography"})]}),e.jsxs("button",{type:"button",onClick:()=>Y("milestones"),className:`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 ${u==="milestones"?"bg-amber-500 text-slate-950 shadow-sm":"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:[e.jsx(be,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Accomplishments & Milestones"})]})]}),e.jsxs("form",{onSubmit:N,className:"p-6 overflow-y-auto space-y-6 flex-1",children:[u==="basic"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Monarch / Leader Name (English) *"}),e.jsx("input",{type:"text",required:!0,value:s.name,onChange:t=>o({...s,name:t.target.value}),placeholder:"e.g. Emperor Menelik II",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Amharic Name (አማርኛ ስም)"}),e.jsx("input",{type:"text",value:s.amharicName,onChange:t=>o({...s,amharicName:t.target.value}),placeholder:"e.g. ዳግማዊ ምኒልክ",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500 font-serif"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Official Title / Honorific"}),e.jsx("input",{type:"text",value:s.title,onChange:t=>o({...s,title:t.target.value}),placeholder:"e.g. Emperor of Ethiopia (King of Kings)",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Dynasty / Lineage"}),e.jsx("input",{type:"text",value:s.dynasty,onChange:t=>o({...s,dynasty:t.target.value}),placeholder:"e.g. Solomonic Dynasty",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Historical Era"}),e.jsx("select",{value:s.eraId,onChange:t=>Q(t.target.value),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500",children:re.filter(t=>t.id!=="all").map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Reign Start Year (BCE negative, e.g. -1005 or 1889)"}),e.jsx("input",{type:"number",value:s.reignStartYear,onChange:t=>o({...s,reignStartYear:Number(t.target.value)}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Reign End Year"}),e.jsx("input",{type:"number",value:s.reignEndYear,onChange:t=>o({...s,reignEndYear:Number(t.target.value)}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Reign Display Text"}),e.jsx("input",{type:"text",value:s.reignDates,onChange:t=>o({...s,reignDates:t.target.value}),placeholder:"e.g. 1889 – 1913",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Ethiopian Calendar Reign Text"}),e.jsx("input",{type:"text",value:s.ethiopianCalendarReign,onChange:t=>o({...s,ethiopianCalendarReign:t.target.value}),placeholder:"e.g. 1882 – 1906 ዓ.ም.",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Capital / Seat of Power"}),e.jsx("input",{type:"text",value:s.capitalOrSeat,onChange:t=>o({...s,capitalOrSeat:t.target.value}),placeholder:"e.g. Ankober / Entoto / Addis Ababa",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Portrait / Image URL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:s.portraitUrl,onChange:t=>o({...s,portraitUrl:t.target.value}),placeholder:"",className:"flex-1 px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"}),s.portraitUrl&&e.jsx("img",{src:s.portraitUrl||void 0,alt:"Preview",className:"w-10 h-10 rounded-lg object-cover border border-slate-300 dark:border-slate-700"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Short Summary"}),e.jsx("textarea",{rows:3,value:s.shortSummary,onChange:t=>o({...s,shortSummary:t.target.value}),placeholder:"A concise 2-3 sentence overview...",className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]})]}),u==="bio"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"1. Overview & Heritage"}),e.jsx("textarea",{rows:3,value:(K=s.biographyTabs)==null?void 0:K.overview,onChange:t=>o({...s,biographyTabs:{...s.biographyTabs,overview:t.target.value}}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"2. Early Life & Rise to Power"}),e.jsx("textarea",{rows:3,value:(l=s.biographyTabs)==null?void 0:l.earlyLifeAndRise,onChange:t=>o({...s,biographyTabs:{...s.biographyTabs,earlyLifeAndRise:t.target.value}}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"3. Reign, Reforms & Domestic Achievements"}),e.jsx("textarea",{rows:3,value:(b=s.biographyTabs)==null?void 0:b.reignAndAchievements,onChange:t=>o({...s,biographyTabs:{...s.biographyTabs,reignAndAchievements:t.target.value}}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"4. Military Campaign & Foreign Policy"}),e.jsx("textarea",{rows:3,value:(f=s.biographyTabs)==null?void 0:f.militaryAndForeignPolicy,onChange:t=>o({...s,biographyTabs:{...s.biographyTabs,militaryAndForeignPolicy:t.target.value}}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"5. Cultural & Religious Legacy"}),e.jsx("textarea",{rows:3,value:(V=s.biographyTabs)==null?void 0:V.culturalAndReligiousLegacy,onChange:t=>o({...s,biographyTabs:{...s.biographyTabs,culturalAndReligiousLegacy:t.target.value}}),className:"w-full px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm focus:ring-2 focus:ring-amber-500"})]})]}),u==="milestones"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Key Accomplishments"}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx("input",{type:"text",value:P,onChange:t=>$(t.target.value),placeholder:"Add major accomplishment...",className:"flex-1 px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm"}),e.jsx("button",{type:"button",onClick:k,className:"px-4 py-2 rounded-xl bg-amber-500 text-slate-950 font-bold text-xs hover:bg-amber-400",children:"Add"})]}),e.jsx("ul",{className:"space-y-2",children:(s.keyAccomplishments||[]).map((t,i)=>e.jsxs("li",{className:"flex items-center justify-between p-2.5 rounded-xl bg-slate-100 dar
6k:bg-slate-800 text-xs text-slate-700 dark:text-slate-200",children:[e.jsxs("span",{children:["• ",t]}),e.jsx("button",{type:"button",onClick:()=>X(i),className:"text-rose-500 hover:text-rose-700 p-1",children:e.jsx(B,{className:"w-3.5 h-3.5"})})]},i))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Key Historical Chronological Milestones"}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx("input",{type:"text",value:w,onChange:t=>g(t.target.value),placeholder:"e.g. 1896: Led Ethiopian forces to victory at Adwa",className:"flex-1 px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm"}),e.jsx("button",{type:"button",onClick:y,className:"px-4 py-2 rounded-xl bg-amber-500 text-slate-950 font-bold text-xs hover:bg-amber-400",children:"Add"})]}),e.jsx("ul",{className:"space-y-2",children:(((q=s.biographyTabs)==null?void 0:q.keyMilestones)||[]).map((t,i)=>e.jsxs("li",{className:"flex items-center justify-between p-2.5 rounded-xl bg-slate-100 dark:bg-slate-800 text-xs text-slate-700 dark:text-slate-200",children:[e.jsxs("span",{children:["📅 ",t]}),e.jsx("button",{type:"button",onClick:()=>I(i),className:"text-rose-500 hover:text-rose-700 p-1",children:e.jsx(B,{className:"w-3.5 h-3.5"})})]},i))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-1",children:"Search & Indexing Tags"}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx("input",{type:"text",value:v,onChange:t=>U(t.target.value),placeholder:"e.g. Adwa, Solomonic, Reformer",className:"flex-1 px-3.5 py-2 rounded-xl border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-sm"}),e.jsx("button",{type:"button",onClick:R,className:"px-4 py-2 rounded-xl bg-slate-800 text-white font-bold text-xs hover:bg-slate-700",children:"Add Tag"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:(s.tags||[]).map((t,i)=>e.jsxs("span",{className:"px-2.5 py-1 rounded-lg bg-amber-500/10 text-amber-700 dark:text-amber-300 border border-amber-500/20 text-xs font-bold flex items-center gap-1",children:["#",t,e.jsx("button",{type:"button",onClick:()=>z(i),className:"hover:text-rose-500",children:e.jsx(W,{className:"w-3 h-3"})})]},i))})]})]}),e.jsxs("div",{className:"pt-4 border-t border-slate-200 dark:border-slate-800 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:D,className:"px-5 py-2.5 rounded-xl border border-slate-300 dark:border-slate-700 text-slate-700 dark:text-slate-300 font-bold text-xs hover:bg-slate-100 dark:hover:bg-slate-800",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:C,className:"px-6 py-2.5 rounded-xl bg-amber-500 hover:bg-amber-400 text-slate-950 font-black text-xs shadow-md flex items-center gap-2 transition-all disabled:opacity-50",children:[e.jsx(Ee,{className:"w-4 h-4"}),e.jsx("span",{children:C?"Saving to Database...":"Save Monarch"})]})]})]})]})})}function aa(){var le;const{userProfile:M,hasPermission:D}=ge(),{addToast:x}=pe(),[F]=ue(),s=!!M&&(M.role==="super_admin"||M.role==="editor"||D("history:manage")),[o,u]=d.useState(ie),[Y,P]=d.useState(!1),[$,v]=d.useState(!1),[U,w]=d.useState(null),[g,C]=d.useState(""),[S,Q]=d.useState("all"),[k,X]=d.useState("chrono_asc"),[R,z]=d.useState("grid"),[y,I]=d.useState(1),[N,K]=d.useState(12),[l,b]=d.useState(null),[f,V]=d.useState("overview");d.useEffect(()=>{const a=F.get("search"),r=F.get("id");if(a&&C(a),r){const n=o.find(c=>c.id===r);n&&b(n)}},[F,o]),d.useEffect(()=>{async function a(){P(!0);try{const r=await we(Se(J,"ethiopian_monarchs")),n=[];r.forEach(c=>{n.push({id:c.id,...c.data()})});for(const c of ie)n.some(T=>T.id===c.id)||(await xe(ae(J,"ethiopian_monarchs",c.id),c),n.push(c));u(n)}catch(r){console.warn("Using default local monarch data due to Firestore fetch error:",r)}finally{P(!1)}}a()},[]);const q=async a=>{try{await xe(ae(J,"ethiopian_monarchs",a.id),a),u(r=>r.some(c=>c.id===a.id)?r.map(c=>c.id===a.id?a:c):[a,...r]),(l==null?void 0:l.id)===a.id&&b(a),x(`Successfully saved monarch "${a.name}".`,"success")}catch(r){console.error("Error saving monarch:",r),x("Failed to save monarch. Please try again.","error")}},t=async(a,r,n)=>{if(n&&n.stopPropagation(),!!window.confirm(`Are you sure you want to delete "${r}" from the catalog? This action cannot be undone.`))try{await Ae(ae(J,"ethiopian_monarchs",a)),u(c=>c.filter(T=>T.id!==a)),(l==null?void 0:l.id)===a&&b(null),x(`Monarch "${r}" has been deleted.`,"info")}catch(c){console.error("Error deleting monarch:",c),x("Failed to delete monarch. Please try again.","error")}},[i,m]=d.useState(()=>{try{const a=localStorage.getItem("bookmarked_monarchs");return a?JSON.parse(a):[]}catch{return[]}}
6),[h,j]=d.useState(null),A=(a,r)=>{r&&r.stopPropagation(),m(n=>{const c=n.includes(a)?n.filter(T=>T!==a):[...n,a];try{localStorage.setItem("bookmarked_monarchs",JSON.stringify(c))}catch(T){console.error("Failed to save bookmark:",T)}return c})},G=(a,r)=>{r&&r.stopPropagation();const n=`${window.location.origin}/monarchs?leader=${a.id}`;navigator.clipboard.writeText(n).then(()=>{j(a.id),setTimeout(()=>j(null),2e3)})},p=d.useMemo(()=>o.filter(a=>{if(S!=="all"&&a.eraId!==S)return!1;if(!g.trim())return!0;const r=g.toLowerCase().trim();return a.name.toLowerCase().includes(r)||a.amharicName.includes(r)||a.title.toLowerCase().includes(r)||a.dynasty.toLowerCase().includes(r)||a.capitalOrSeat.toLowerCase().includes(r)||a.eraName.toLowerCase().includes(r)||a.shortSummary.toLowerCase().includes(r)||a.tags&&a.tags.some(n=>n.toLowerCase().includes(r))||a.reignDates.toLowerCase().includes(r)}).sort((a,r)=>{if(k==="chrono_asc")return a.reignStartYear-r.reignStartYear;if(k==="chrono_desc")return r.reignStartYear-a.reignStartYear;if(k==="reign_length"){const n=a.reignEndYear-a.reignStartYear;return r.reignEndYear-r.reignStartYear-n}else if(k==="name")return a.name.localeCompare(r.name);return 0}),[o,g,S,k]);d.useEffect(()=>{I(1)},[g,S,k,N]),d.useEffect(()=>{const r=new URLSearchParams(window.location.search).get("leader");if(r){const n=o.find(c=>c.id===r);n&&b(n)}},[o]);const _=p.length,E=Math.ceil(_/N)||1,H=d.useMemo(()=>{if(N===999)return p;const a=(y-1)*N;return p.slice(a,a+N)},[p,y,N]);return e.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-900 text-slate-800 dark:text-slate-100 transition-colors duration-200",children:[e.jsx(Ce,{title:"Ethiopian Kings, Emperors & Heads of State - Sovereign Catalog | EthioExplorer",description:"Explore the complete, searchable chronological catalog and detailed multi-page biographies of Ethiopian Kings, Queens, Emperors, and Heads of State spanning over 3,000 years of history.",keywords:"Ethiopian monarchs, Ethiopian emperors, Menelik II, Haile Selassie, Ezana of Axum, Kaleb, Lalibela, Fasilides, Tewodros II, Yohannes IV, Zewditu",canonical:"https://ethioexplorer.com/history/monarchs"}),e.jsxs("section",{className:"relative overflow-hidden bg-gradient-to-b from-amber-950 via-slate-900 to-slate-950 text-white py-12 md:py-16 border-b border-amber-900/40",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(245,158,11,0.15),transparent_50%)]"}),e.jsx("div",{className:"absolute inset-0 opacity-10 bg-[radial-gradient(#d97706_1px,transparent_1px)] [background-size:16px_16px]"}),e.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("nav",{className:"flex items-center gap-2 text-xs text-amber-200/80 mb-6 font-medium",children:[e.jsx(oe,{to:"/",className:"hover:text-amber-400 transition-colors",children:"Home"}),e.jsx(O,{className:"w-3.5 h-3.5 text-amber-500/60"}),e.jsx(oe,{to:"/history",className:"hover:text-amber-400 transition-colors",children:"History Archives"}),e.jsx(O,{className:"w-3.5 h-3.5 text-amber-500/60"}),e.jsx("span",{className:"text-amber-400 font-bold",children:"Kings & Heads of State"})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row items-start lg:items-center justify-between gap-8",children:[e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-amber-500/20 border border-amber-500/30 text-amber-300 text-xs font-bold uppercase tracking-wider mb-4",children:[e.jsx(L,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{children:"3,000+ Years of Sovereignty"})]}),e.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-black tracking-tight text-white mb-4 leading-tight font-serif",children:"Ethiopian Monarchs & Heads of State"}),e.jsx("p",{className:"text-base sm:text-lg text-slate-300 leading-relaxed max-w-2xl",children:"Comprehensive, searchable chronological database documenting the lives, achievements, foreign relations, and legacies of Ethiopia’s Kings, Queens, Emperors, and Presidents from antiquity to the modern era."})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-2 gap-3 w-full lg:w-auto",children:[e.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-900/80 border border-amber-900/50 backdrop-blur-md",children:[e.jsx("div",{className:"text-2xl font-black text-amber-400",children:o.length}),e.jsx("div",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:"Monarchs Cataloged"})]}),e.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-900/80 border border-amber-900/50 backdrop-blur-md",children:[e.jsx("div",{className:"text-2xl font-black text-emerald-400",children:"1000 BCE+"}),e.jsx("div",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:"Chronology Span"})]}),e.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-900/80 border border-amber-900/50 backdrop-blur-md",children:[e.jsx("div",{className:"text-2xl font-black text-indigo-400",children:"8"}),e.jsx("div",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:"Historical Epochs"})]}),e.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-900/80 border border-amber-900/50 backdrop-blur-md",children:[e.jsx("div",{className:"text-2xl font-black text-rose-400",children:i.length}),e.jsx("div",{className:"text-[11px] font-bold text-slate-400 uppercase tracking-wider",children:"Bookmarked Leaders"})]})]})]})]})]}
6),e.jsx("section",{className:"sticky top-0 z-30 bg-white/95 dark:bg-slate-900/95 backdrop-blur-md border-b border-slate-200 dark:border-slate-800 shadow-xs",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row items-stretch lg:items-center justify-between gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(fe,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),e.jsx("input",{type:"text",value:g,onChange:a=>C(a.target.value),placeholder:"Search by name, Amharic, title, capital, victory, or keyword (e.g. Adwa, Ezana, Lalibela)...",className:"w-full pl-10 pr-10 py-2.5 rounded-xl border border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/80 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent transition-all"}),g&&e.jsx("button",{onClick:()=>C(""),className:"absolute right-3 top-1/2 -translate-y-1/2 p-1 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 rounded-full",children:e.jsx(W,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-100 dark:bg-slate-800 p-1 rounded-xl border border-slate-200 dark:border-slate-700",children:[e.jsx(Le,{className:"w-3.5 h-3.5 text-slate-500 ml-1.5"}),e.jsxs("select",{value:k,onChange:a=>X(a.target.value),className:"bg-transparent text-xs font-bold text-slate-700 dark:text-slate-200 focus:outline-none pr-2 py-1",children:[e.jsx("option",{value:"chrono_asc",className:"dark:bg-slate-800",children:"Chronological (Earliest First)"}),e.jsx("option",{value:"chrono_desc",className:"dark:bg-slate-800",children:"Chronological (Latest First)"}),e.jsx("option",{value:"reign_length",className:"dark:bg-slate-800",children:"Reign Length (Longest First)"}),e.jsx("option",{value:"name",className:"dark:bg-slate-800",children:"Alphabetical Name"})]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 bg-slate-100 dark:bg-slate-800 px-2 py-1.5 rounded-xl border border-slate-200 dark:border-slate-700 text-xs font-bold text-slate-600 dark:text-slate-300",children:[e.jsx("span",{children:"Show:"}),e.jsxs("select",{value:N,onChange:a=>K(Number(a.target.value)),className:"bg-transparent font-black text-amber-600 dark:text-amber-400 focus:outline-none",children:[e.jsx("option",{value:6,className:"dark:bg-slate-800",children:"6"}),e.jsx("option",{value:12,className:"dark:bg-slate-800",children:"12"}),e.jsx("option",{value:24,className:"dark:bg-slate-800",children:"24"}),e.jsxs("option",{value:999,className:"dark:bg-slate-800",children:["All (",p.length,")"]})]})]}),e.jsxs("div",{className:"flex items-center bg-slate-100 dark:bg-slate-800 p-1 rounded-xl border border-slate-200 dark:border-slate-700",children:[e.jsx("button",{onClick:()=>z("grid"),className:`p-1.5 rounded-lg transition-colors ${R==="grid"?"bg-amber-500 text-slate-950 font-bold shadow-xs":"text-slate-500 hover:text-slate-800 dark:hover:text-slate-200"}`,title:"Grid View",children:e.jsx(Me,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>z("table"),className:`p-1.5 rounded-lg transition-colors ${R==="table"?"bg-amber-500 text-slate-950 font-bold shadow-xs":"text-slate-500 hover:text-slate-800 dark:hover:text-slate-200"}`,title:"Timeline Table View",children:e.jsx(Pe,{className:"w-4 h-4"})})]})]})]}),e.jsx("div",{className:"flex items-center gap-2 mt-3 overflow-x-auto pb-1 scrollbar-thin",children:re.map(a=>e.jsxs("button",{onClick:()=>Q(a.id),className:`px-3 py-1.5 rounded-lg text-xs font-bold whitespace-nowrap transition-all flex items-center gap-1.5 border ${S===a.id?"bg-amber-600 text-white border-amber-500 shadow-xs":"bg-slate-100 dark:bg-slate-800/80 text-slate-700 dark:text-slate-300 border-slate-200 dark:border-slate-700 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:[a.id==="all"&&e.jsx(je,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:a.label})]},a.id))})]})}),e.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[s&&e.jsxs("div",{className:"mb-6 p-4 rounded-2xl bg-amber-500/10 border border-amber-500/30 dark:bg-amber-950/30 flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-amber-500 text-slate-950 font-bold",children:e.jsx(L,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-amber-900 dark:text-amber-200",children:"Administrator Catalog Management"}
6),e.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Add, edit, update, or delete Ethiopian monarchs and rulers."})]})]}),e.jsxs("button",{onClick:()=>{w(null),v(!0)},className:"px-4 py-2 rounded-xl bg-amber-500 hover:bg-amber-400 text-slate-950 font-extrabold text-xs shadow-md flex items-center gap-2 transition-all",children:[e.jsx(Re,{className:"w-4 h-4"}),e.jsx("span",{children:"Add New Monarch / Ruler"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 mb-6 pb-4 border-b border-slate-200 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-medium text-slate-500 dark:text-slate-400",children:["Showing ",e.jsx("strong",{className:"text-slate-900 dark:text-white",children:H.length})," of"," ",e.jsx("strong",{className:"text-slate-900 dark:text-white",children:p.length})," Ethiopian Leaders"]}),g&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300 text-xs font-semibold",children:['Query: "',g,'"']})]}),E>1&&e.jsxs("div",{className:"text-xs font-bold text-slate-500 dark:text-slate-400",children:["Page ",e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:y})," of ",E]})]}),p.length===0&&e.jsxs("div",{className:"text-center py-16 bg-white dark:bg-slate-800/50 rounded-2xl border border-dashed border-slate-300 dark:border-slate-700 p-8 my-8",children:[e.jsx(L,{className:"w-12 h-12 text-slate-400 mx-auto mb-3 opacity-50"}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 dark:text-slate-100 mb-1",children:"No Ethiopian Monarchs Found"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-md mx-auto mb-4",children:"No historical leaders matched your current search parameters or era filter."}),e.jsx("button",{onClick:()=>{C(""),Q("all")},className:"px-4 py-2 bg-amber-600 hover:bg-amber-700 text-white rounded-xl text-xs font-bold transition-colors",children:"Reset Search & Filters"})]}),R==="grid"&&H.length>0&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:H.map(a=>{const r=i.includes(a.id);return e.jsxs("div",{onClick:()=>b(a),className:"group relative bg-white dark:bg-slate-800/90 rounded-2xl border border-slate-200 dark:border-slate-700/80 shadow-xs hover:shadow-xl transition-all duration-300 overflow-hidden cursor-pointer flex flex-col hover:-translate-y-1",children:[e.jsxs("div",{className:"relative h-48 w-full overflow-hidden bg-slate-900",children:[e.jsx(te,{imageUrl:a.portraitUrl||"",alt:a.name,type:"monarch",className:"w-full h-full object-contain group-hover:scale-105 transition-transform duration-500 opacity-90 group-hover:opacity-100"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-950/90 via-slate-950/30 to-transparent"}),e.jsxs("div",{className:"absolute top-3 left-3 px-2.5 py-1 rounded-full bg-slate-950/80 backdrop-blur-md border border-amber-500/40 text-[10px] font-bold text-amber-300 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(Z,{className:"w-3 h-3 text-amber-400"}),e.jsx("span",{children:a.eraName})]}),e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1.5 z-10",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n=>{n.stopPropagation(),w(a),v(!0)},className:"p-2 rounded-full bg-amber-500 text-slate-950 hover:bg-amber-400 font-bold shadow-md transition-colors",title:"Edit Leader Data",children:e.jsx(se,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:n=>t(a.id,a.name,n),className:"p-2 rounded-full bg-rose-600 text-white hover:bg-rose-700 shadow-md transition-colors",title:"Delete Leader",children:e.jsx(B,{className:"w-3.5 h-3.5"})})]}),e.jsx("button",{onClick:n=>G(a,n),className:"p-2 rounded-full bg-slate-900/80 backdrop-blur-md text-slate-300 hover:text-white hover:bg-slate-800 transition-colors",title:"Share Leader Link",children:h===a.id?e.jsx(ne,{className:"w-3.5 h-3.5 text-emerald-400"}):e.jsx(ve,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:n=>A(a.id,n),className:`p-2 rounded-full backdrop-blur-md transition-colors ${r?"bg-amber-500 text-slate-950 font-bold":"bg-slate-900/80 text-slate-300 hover:text-white"}`,title:r?"Remove Bookmark":"Bookmark Leader",children:e.jsx(de,{className:"w-3.5 h-3.5 fill-current"})})]}),e.jsxs("div",{className:"absolute bottom-3 left-3 right-3 flex items-end justify-between",children:[e.jsx("div",{className:"text-amber-200 text-xs font-bold font-serif tracking-wide bg-slate-950/70 px-2 py-0.5 rounded-md backdrop-blur-xs",children:a.amharicName}),e.jsx("div",{className:"text-[11px] font-bold text-white bg-amber-600/90 px-2 py-0.5 rounded-md",children:a.reignDates})]})]}),e.jsxs("div",{className:"p-5 flex-1 flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-widest text-amber-600 dar
6k:text-amber-400 mb-1 flex items-center gap-1",children:[e.jsx(L,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:a.title})]}),e.jsx("h2",{className:"text-xl font-black text-slate-900 dark:text-white mb-2 group-hover:text-amber-600 dark:group-hover:text-amber-400 transition-colors font-serif",children:a.name}),e.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 line-clamp-3 leading-relaxed mb-4",children:a.shortSummary})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"pt-3 border-t border-slate-100 dark:border-slate-700/60 grid grid-cols-2 gap-2 text-[11px] text-slate-500 dark:text-slate-400 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ce,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),e.jsx("span",{className:"truncate",children:a.capitalOrSeat})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ee,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"}),e.jsx("span",{className:"truncate",children:a.dynasty})]})]}),e.jsxs("div",{className:"w-full py-2.5 px-3 bg-slate-100 dark:bg-slate-700/60 hover:bg-amber-500 hover:text-slate-950 dark:hover:bg-amber-500 dark:hover:text-slate-950 rounded-xl text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center justify-between transition-all duration-200",children:[e.jsx("span",{children:"Read Multi-Page Biography"}),e.jsx(O,{className:"w-4 h-4"})]})]})]})]},a.id)})}),R==="table"&&H.length>0&&e.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-2xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-xs",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left text-xs text-slate-700 dark:text-slate-300",children:[e.jsx("thead",{className:"bg-slate-100 dark:bg-slate-900 text-slate-900 dark:text-slate-100 font-bold uppercase tracking-wider text-[10px] border-b border-slate-200 dark:border-slate-700",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-4",children:"Monarch / Head of State"}),e.jsx("th",{className:"p-4",children:"Amharic Title"}),e.jsx("th",{className:"p-4",children:"Reign Period"}),e.jsx("th",{className:"p-4",children:"Era & Dynasty"}),e.jsx("th",{className:"p-4",children:"Capital Seat"}),e.jsx("th",{className:"p-4 text-right",children:"Action"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700/50",children:H.map(a=>e.jsxs("tr",{onClick:()=>b(a),className:"hover:bg-amber-50/50 dark:hover:bg-slate-700/50 transition-colors cursor-pointer group",children:[e.jsxs("td",{className:"p-4 font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg overflow-hidden shrink-0 border border-amber-500/30",children:e.jsx(te,{imageUrl:a.portraitUrl||"",alt:a.name,type:"monarch",className:"w-full h-full object-contain"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-serif text-sm font-bold group-hover:text-amber-600 dark:group-hover:text-amber-400 transition-colors",children:a.name}),e.jsx("div",{className:"text-[11px] font-medium text-slate-500 dark:text-slate-400",children:a.title})]})]}),e.jsx("td",{className:"p-4 font-serif text-amber-700 dark:text-amber-300 font-bold",children:a.amharicName}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:"inline-flex px-2 py-0.5 rounded-md bg-amber-100 dark:bg-amber-900/40 text-amber-900 dark:text-amber-200 font-bold text-[11px]",children:a.reignDates})}),e.jsxs("td",{className:"p-4",children:[e.jsx("div",{className:"font-semibold text-slate-800 dark:text-slate-200",children:a.eraName}),e.jsx("div",{className:"text-[10px] text-slate-500",children:a.dynasty})]}),e.jsx("td",{className:"p-4 font-medium",children:a.capitalOrSeat}),e.jsx("td",{className:"p-4 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:r=>{r.stopPropagation(),w(a),v(!0)},className:"p-1.5 rounded-lg bg-amber-500 text-slate-950 hover:bg-amber-400 font-bold transition-colors",title:"Edit Monarch",children:e.jsx(se,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:r=>t(a.id,a.name,r),className:"p-1.5 rounded-lg bg-rose-600 text-white hover:bg-rose-700 transition-colors",title:"Delete Monarch",children:e.jsx(B,{className:"w-3.5 h-3.5"})})]}),e.jsxs("button",{onClick:r=>{r.stopPropagation(),b(a)},className:"px-3 py-1.5 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-xs font-bold inline-flex items-center gap-1 transition-colors",children:[e.jsx("span",{children:"View Bio"}),e.jsx(O,{className:"w-3.5 h-3.5"})]})]})})]},a.id))})]})})}),E>1&&e.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row items-center justify-between gap-4 bg-white dark:bg-slate-800 p-4 rounded-2xl border border-slate-200 dark:border-slate-700 shadow-xs",children:[e.jsxs("div",{className:"text-xs font-medium text-slate-500 dark:text-slate-400",children:["Page ",e.jsx("strong",{className:"text-slate-900 dark:text-white",children:y})," of"," ",e.jsx("strong",{className:"text-slate-900 dark:text-white",children:E})," (",p.length," total items)"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>I(a=>Math.max(a-1,1)),disabled:y===1,className:"px-3 py-2 rounded-xl bg-slate-100 dar
6k:bg-slate-700 text-slate-700 dark:text-slate-200 text-xs font-bold disabled:opacity-40 hover:bg-amber-500 hover:text-slate-950 transition-colors flex items-center gap-1",children:[e.jsx(Ie,{className:"w-4 h-4"}),e.jsx("span",{children:"Prev"})]}),e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto max-w-[200px] sm:max-w-none",children:Array.from({length:E},(a,r)=>r+1).map(a=>e.jsx("button",{onClick:()=>I(a),className:`w-8 h-8 rounded-xl text-xs font-bold transition-all ${y===a?"bg-amber-600 text-white shadow-xs scale-105":"bg-slate-100 dark:bg-slate-700/60 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600"}`,children:a},a))}),e.jsxs("button",{onClick:()=>I(a=>Math.min(a+1,E)),disabled:y===E,className:"px-3 py-2 rounded-xl bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-200 text-xs font-bold disabled:opacity-40 hover:bg-amber-500 hover:text-slate-950 transition-colors flex items-center gap-1",children:[e.jsx("span",{children:"Next"}),e.jsx(O,{className:"w-4 h-4"})]})]})]})]}),l&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-4 bg-slate-950/80 backdrop-blur-md animate-fadeIn overflow-y-auto",children:e.jsxs("div",{className:"relative w-full max-w-4xl max-h-[92vh] bg-white dark:bg-slate-900 rounded-2xl shadow-2xl border border-amber-500/30 overflow-hidden flex flex-col my-auto",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"relative h-44 sm:h-56 w-full bg-slate-950 shrink-0",children:[e.jsx(te,{imageUrl:l.portraitUrl||"",alt:l.name,type:"monarch",className:"w-full h-full object-contain opacity-80"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-950 via-slate-950/50 to-transparent"}),e.jsx("button",{onClick:()=>b(null),className:"absolute top-4 right-4 p-2 rounded-full bg-slate-950/80 text-slate-300 hover:text-white hover:bg-slate-800 transition-colors z-10","aria-label":"Close Biography",children:e.jsx(W,{className:"w-5 h-5"})}),e.jsxs("div",{className:"absolute bottom-4 left-4 right-4 flex flex-col sm:flex-row items-start sm:items-end justify-between gap-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs font-bold text-amber-400 uppercase tracking-widest flex items-center gap-1",children:[e.jsx(L,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{children:l.title})]}),e.jsx("h2",{className:"text-2xl sm:text-3xl font-black text-white font-serif",children:l.name}),e.jsx("div",{className:"text-amber-200 text-sm font-bold font-serif",children:l.amharicName})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:"px-3 py-1 rounded-lg bg-amber-600 text-white font-bold text-xs shadow-xs",children:["Reign: ",l.reignDates]})})]})]}),e.jsx("div",{className:"bg-slate-100 dark:bg-slate-950 border-b border-slate-200 dark:border-slate-800 px-4 overflow-x-auto scrollbar-thin shrink-0",children:e.jsx("div",{className:"flex items-center gap-2 min-w-max py-2",children:[{id:"overview",label:"📖 Overview & Fast Facts",icon:me},{id:"earlyLife",label:"📜 Early Life & Ascension",icon:Fe},{id:"reign",label:"🏰 Reign & Achievements",icon:Z},{id:"military",label:"⚔️ Military & Diplomacy",icon:ee},{id:"legacy",label:"🏛️ Cultural Legacy",icon:be},{id:"milestones",label:"📌 Timeline Milestones",icon:ke}].map(a=>e.jsx("button",{onClick:()=>V(a.id),className:`px-3.5 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 ${f===a.id?"bg-amber-600 text-white shadow-xs":"text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-800"}`,children:e.jsx("span",{children:a.label})},a.id))})}),e.jsxs("div",{className:"p-6 overflow-y-auto flex-1 space-y-6",children:[f==="overview"&&e.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[e.jsx("div",{className:"bg-amber-50/80 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800/50 p-4 rounded-2xl text-slate-800 dark:text-amber-100 text-sm leading-relaxed",children:e.jsx("p",{className:"font-serif text-base leading-relaxed",children:l.biographyTabs.overview})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-slate-50 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-1",children:"Dynasty Lineage"}),e.jsxs("div",{className:"text-sm font-bold text-slate-900 dark:text-white flex items-center gap-1.5",children:[e.jsx(ee,{className:"w-4 h-4 text-emerald-500"}),e.jsx("span",{children:l.dynasty})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-slate-50 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-1",children:"Capital / Royal Seat"}),e.jsxs("div",{className:"text-sm font-bold text-slate-900 dark:text-white flex items-center gap-1.5",children:[e.jsx(ce,{className:"w-4 h-4 text-amber-500"}),e.jsx("span",{children:l.capitalOrSeat})]})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-slate-50 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider mb-1",children:"Historical Era"}),e.jsxs("div",{className:"text-sm font-bold text-slate-900 dark:text-white flex items-center gap-1.5",children:[e.jsx(Z,{className:"w-4 h-4 text-indigo-500"}),e.jsx("span",{children:l.eraName})]})]})]}),l.notableQuotesOrProclamations&&l.notableQuotesOrProclamations.length>0&&e.jsxs("div",{className:"p-4 rounded-2xl bg-amber-500/10 border border-amber-500/30",children:[e.jsxs("h4",{className:"text-xs font-black uppercase tracking-wider text-amber-600 dar
6k:text-amber-400 mb-2 flex items-center gap-1.5",children:[e.jsx(ye,{className:"w-4 h-4"}),e.jsx("span",{children:"Famous Historic Quotes & Proclamations"})]}),e.jsx("div",{className:"space-y-2",children:l.notableQuotesOrProclamations.map((a,r)=>e.jsxs("blockquote",{className:"text-xs italic font-serif text-slate-800 dark:text-amber-100 border-l-2 border-amber-500 pl-3 py-0.5",children:['"',a,'"']},r))})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-black uppercase tracking-wider text-amber-600 dark:text-amber-400 mb-3 flex items-center gap-1.5",children:[e.jsx(Ne,{className:"w-4 h-4"}),e.jsx("span",{children:"Major Achievements & Historical Impact"})]}),e.jsx("ul",{className:"space-y-2",children:l.keyAccomplishments.map((a,r)=>e.jsxs("li",{className:"flex items-start gap-2.5 text-xs text-slate-700 dark:text-slate-300",children:[e.jsx(ne,{className:"w-4 h-4 text-emerald-500 shrink-0 mt-0.5"}),e.jsx("span",{children:a})]},r))})]})]}),f==="earlyLife"&&e.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white font-serif",children:"Early Life, Lineage & Path to the Crown"}),e.jsx("div",{className:"text-sm text-slate-700 dark:text-slate-300 leading-relaxed space-y-3 font-serif",children:e.jsx("p",{children:l.biographyTabs.earlyLifeAndRise})})]}),f==="reign"&&e.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white font-serif",children:"Reign, Statecraft & Architectural Achievements"}),e.jsx("div",{className:"text-sm text-slate-700 dark:text-slate-300 leading-relaxed space-y-3 font-serif",children:e.jsx("p",{children:l.biographyTabs.reignAndAchievements})})]}),f==="military"&&e.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white font-serif",children:"Military Campaigns, Sovereignty & Foreign Relations"}),e.jsx("div",{className:"text-sm text-slate-700 dark:text-slate-300 leading-relaxed space-y-3 font-serif",children:e.jsx("p",{children:l.biographyTabs.militaryAndForeignPolicy})})]}),f==="legacy"&&e.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white font-serif",children:"Cultural, Religious & Historical Legacy"}),e.jsx("div",{className:"text-sm text-slate-700 dark:text-slate-300 leading-relaxed space-y-3 font-serif",children:e.jsx("p",{children:l.biographyTabs.culturalAndReligiousLegacy})})]}),f==="milestones"&&e.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white font-serif mb-4",children:"Chronological Timeline Milestones"}),e.jsx("div",{className:"relative border-l-2 border-amber-500/40 ml-3 space-y-4 pl-4",children:l.biographyTabs.keyMilestones.map((a,r)=>e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[21px] top-1 w-2.5 h-2.5 rounded-full bg-amber-500 border-2 border-white dark:border-slate-900"}),e.jsx("div",{className:"text-xs font-semibold text-slate-800 dark:text-slate-200 bg-slate-50 dark:bg-slate-800/60 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:a})]},r))})]})]}),e.jsxs("div",{className:"p-4 bg-slate-100 dark:bg-slate-950 border-t border-slate-200 dark:border-slate-800 flex items-center justify-between gap-2 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{w(l),v(!0)},className:"px-3 py-1.5 rounded-xl bg-amber-500 hover:bg-amber-400 text-slate-950 font-extrabold text-xs flex items-center gap-1.5 shadow-sm transition-colors",children:[e.jsx(se,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Edit Leader"})]}),e.jsxs("button",{onClick:()=>t(l.id,l.name),className:"px-3 py-1.5 rounded-xl bg-rose-600 hover:bg-rose-700 text-white font-bold text-xs flex items-center gap-1.5 shadow-sm transition-colors",children:[e.jsx(B,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Delete"})]})]}),e.jsxs("button",{onClick:a=>A(l.id,a),className:`px-3 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1.5 transition-colors ${i.includes(l.id)?"bg-amber-500 text-slate-950":"bg-slate-200 dark:bg-slate-800 text-slate-800 dark:text-slate-200 hover:bg-slate-300"}`,children:[e.jsx(de,{className:"w-3.5 h-3.5 fill-current"}),e.jsx("span",{children:i.includes(l.id)?"Bookmarked":"Bookmark"})]}),e.jsx(Te,{title:`${l.name} (${l.reignDates}) — Ethiopian Sovereign Biography`,summary:l.shortSummary||((le=l.biographyTabs)==null?void 0:le.overview),date:l.reign
6Dates,category:l.eraName,url:typeof window<"u"?`${window.location.origin}/history/monarchs?leader=${encodeURIComponent(l.name)}`:void 0,variant:"button",buttonLabel:"Share Sovereign"})]}),e.jsx("button",{onClick:()=>b(null),className:"px-4 py-1.5 bg-amber-600 hover:bg-amber-700 text-white rounded-xl text-xs font-bold transition-colors",children:"Close Biography"})]})]})}),e.jsx(_e,{isOpen:$,onClose:()=>v(!1),monarch:U,onSave:q})]})}export{aa 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.