1import{j as e,A as ce,m as C}from"./vendor-motion-DxUzV8Dr.js";import{r as i}from"./vendor-react-hNfcizNV.js";import{h as y,X as de,g as A,a as xe,v as P,u as S,x as me,d as pe}from"./index-b2X1zv7I.js";import{b as k}from"./blogService-sJE45vVf.js";import{A as he,P as ue}from"./PostBlogModal-BZh0PRM1.js";import{j as v}from"./jobService-D83EMEqy.js";import{B as ge}from"./building-2-rpGWjAbe.js";import{C as fe}from"./clock-C4P8FfY_.js";import{M as G}from"./map-pin-DPiRis9d.js";import{C as be}from"./calendar-BIMvfm3L.js";import{G as je}from"./graduation-cap-BS63tHwD.js";import{S as Y}from"./search-BuCtvcgt.js";import{P as K}from"./plus-DSURxCHr.js";import{L as M}from"./loader-2-A8VFngYD.js";import{E as Ne}from"./eye-off-C0ssQfnj.js";import{T as X}from"./trash-2-KfXPWFTs.js";import{L as I}from"./lock-8Zljtfgj.js";import{A as ye}from"./alert-circle-x2PJxujV.js";import{K as we}from"./key-Bpattv5z.js";import{B as ve}from"./bell-CRZOTRe3.js";import{U as Se}from"./users-C490Err2.js";import{T as ke}from"./trending-up-BHiVnVe-.js";import{A as U}from"./activity-eDI7YiWt.js";import{E as Ce}from"./eye-BmtFHWFa.js";import{u as Ae}from"./vendor-router-DRm9ii2v.js";import"./vendor-helmet-BVKaRJ85.js";import"./tag-seGtDNqc.js";import"./upload-MAR6nHI6.js";import"./link-CCTFufxL.js";/** 2 * @license lucide-react v0.344.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 Pe=y("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"}]]);/** 7 * @license lucide-react v0.344.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Le=y("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** 12 * @license lucide-react v0.344.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const H=y("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 17 * @license lucide-react v0.344.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const Te=y("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** 22 * @license lucide-react v0.344.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const Z=y("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/** 27 * @license lucide-react v0.344.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const W=y("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),O=["Software Development","Sales & Support","Marketing","Internship","HR","Accounts","Office Administration"],J=["Full-time","Part-time","Internship","Contract"],E={title:"",department:O[0],location:"Vadodara, Gujarat",employmentType:J[0],experience:"",description:"",responsibilities:"",requirements:"",isActive:!0};function Ee({isOpen:h,onClose:p,onSuccess:u,initialData:r}){const[d,f]=i.useState(!1),[g,x]=i.useState(""),[l,n]=i.useState(E);i.useEffect(()=>{n(r?{title:r.title||"",department:r.department||O[0],location:r.location||"Vadodara, Gujarat",employmentType:r.employmentType||J[0],experience:r.experience||"",description:r.description||"",responsibilities:(r.responsibilities||[]).join(` 32`),requirements:(r.requirements||[]).join(` 33`),isActive:r.isActive??!0}:E),x("")},[r,h]);const m=t=>t.split(` 34`).map(o=>
34o.trim()).filter(Boolean),w=async t=>{t.preventDefault(),f(!0),x("");try{if(!l.title.trim()||!l.description.trim())throw new Error("Please provide at least a Role title and a Description.");const o={title:l.title.trim(),department:l.department,location:l.location.trim(),employmentType:l.employmentType,experience:l.experience.trim(),description:l.description.trim(),responsibilities:m(l.responsibilities),requirements:m(l.requirements),isActive:l.isActive};if(r?.id)await v.updateJob(r.id,o);else{const b=o.title.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),a=Math.random().toString(36).substring(2,6);await v.addJob({...o,slug:`${b}-${a}`})}u(),p(),n(E)}catch(o){x(o.message||"Failed to save job. Please check your Supabase connection / table.")}finally{f(!1)}};return e.jsx(ce,{children:h&&e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 sm:p-6",children:[e.jsx(C.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:p,className:"absolute inset-0 bg-slate-900/60 backdrop-blur-sm"}),e.jsxs(C.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"relative w-full max-w-2xl bg-white rounded-3xl shadow-2xl overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-indigo-600 to-blue-600 p-6 text-white flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold",children:r?"Edit Opening":"New Job Opening"}),e.jsx("p",{className:"text-indigo-100 text-sm",children:r?"Update this role and its JD":"Add a role + JD that shows on the careers page"})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-white/20 rounded-full transition-colors",children:e.jsx(de,{className:"w-6 h-6"})})]}),e.jsxs("form",{onSubmit:w,className:"p-6 max-h-[70vh] overflow-y-auto custom-scrollbar",children:[e.jsxs("div",{className:"space-y-5",children:[g&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-100 text-red-600 rounded-xl text-sm italic",children:["â ï¸ ",g]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4 text-indigo-500"})," Role / Title *"]}),e.jsx("input",{required:!0,type:"text",value:l.title,onChange:t=>n({...l,title:t.target.value}),placeholder:"e.g. Senior .NET Core Developer",className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(ge,{className:"w-4 h-4 text-indigo-500"})," Department"]}),e.jsx("select",{value:l.department,onChange:t=>n({...l,department:t.target.value}),className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all bg-white",children:O.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(fe,{className:"w-4 h-4 text-indigo-500"})," Employment Type"]}),e.jsx("select",{value:l.employmentType,onChange:t=>n({...l,employmentType:t.target.value}),className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all bg-white",children:J.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4 text-indigo-500"})," Location"]}),e.jsx("input",{type:"text",value:l.location,onChange:t=>n({...l,location:t.target.value}),placeholder:"e.g. Indore, MP / Remote",className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(be,{className:"w-4 h-4 text-indigo-500"})," Experience"]}),e.jsx("input",{type:"text",value:l.experience,onChange:t=>n({...l,experience:t.target.value}),placeholder:"e.g. 2-4 Years / Fresher",className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(he,{className:"w-4 h-4 text-indigo-500"})," Short Description (JD summary) *"]}),e.jsx("textarea",{required:!0,value:l.description,onChange:t=>n({...l,description:t.target.value}),placeholder:"A short summary of the role shown on the opening card...",rows:3,className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all resize-none"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(Le,{className:"w-4 h-4 text-indigo-500"})," Key Responsibilities"]}),e.jsx("textarea",{value:l.responsibilities,onChange:t=>n({...l,responsibilities:t.target.value}),placeholder:`One per line, e.g. 35Build and maintain REST APIs in .NET Core 36Write optimized stored procedures`,rows:4,className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all resize-none"}),e.jsx("p",{className:"text-[10px] text-slate-400 italic",children:"One responsibility per line â each line becomes a bullet point."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-gray-700 flex items-center gap-2",children:[e.jsx(je,{className:"w-4 h-4 text-indigo-500"})," Requirements / Skills"]}),e.jsx("textarea",{value:l.requirements,onChange:t=>n({...l,requirements:t.target.value}),placeholder:`One per line, e.g. 37.NET Core, Dapper, Stored Procedures 38SQL / MariaDB, Database-First approach`,rows:4,className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all resize-none"}),e.jsx("p",{className:"text-[10px] text-slate-400 italic",children:"One requirement per line â each line becomes a bullet point."})]}),e.jsxs("label",{className:"flex items-center gap-3 p-4 bg-slate-50 rounded-xl border border-slate-100 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:l.isActive,onChange:t=>n({...l,isActive:t.target.checked}),className:"w-5 h-5 rounded text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{className:"text-sm font-semibold text-slate-700",children:"Active â show this opening on the public careers page"})]})]}),e.jsxs("div",{className:"mt-8 flex gap-4",children:[e.jsx("button",{type:"button",onClick:p,className:"flex-1 py-4 px-6 rounded-xl border border-gray-200 text-gray-600 font-bold hover:bg-gray-50 transition-all",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:d,className:"flex-1 bg-gradient-to-r from-indigo-600 to-blue-600 text-white py-4 px-10 rounded-xl font-bold hover:shadow-lg transform transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:[d?e.jsx("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}):e.jsx(xe,{className:"w-5 h-5"}),d?r?"Updating...":"Posting...":r?"Update Opening":"Post Opening"]})]})]})]})]})})}function Me(){const[h,p]=i.useState([]),[u,r]=i.useState(!0),[d,f]=i.useState(""),[g,x]=i.useState(!1),[l,n]=i.useState(null);i.useEffect(()=>{m()},[]);const m=async()=>{r(!0);const a=await v.getJobs();p(a),r(!1)},w=async a=>{if(window.confirm(`Delete the opening "${a.title}"? This cannot be undone.`))try{await v.deleteJob(a.id),m()}catch{alert("Failed to delete opening.")}},t=async a=>
38{try{await v.updateActive(a.id,!a.isActive),m()}catch{alert("Failed to update status.")}},o=h.filter(a=>a.title.toLowerCase().includes(d.toLowerCase())||a.department.toLowerCase().includes(d.toLowerCase())),b=h.filter(a=>a.isActive).length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6 mb-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h1",{className:"text-4xl font-bold text-slate-900 font-[Arial,sans-serif]",children:"Current Hiring"}),e.jsxs("span",{className:"bg-emerald-500 text-white px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1 shadow-lg shadow-emerald-200",children:[b," Live"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),e.jsx("input",{type:"text",placeholder:"Search roles...",value:d,onChange:a=>f(a.target.value),className:"w-full sm:w-64 pl-10 pr-4 py-2 rounded-xl border border-slate-200 bg-white focus:ring-2 focus:ring-indigo-500 outline-none"})]}),e.jsxs("button",{onClick:()=>{n(null),x(!0)},className:"px-6 py-2 bg-indigo-600 text-white rounded-xl font-bold hover:bg-indigo-700 shadow-md flex items-center justify-center gap-2",children:[e.jsx(K,{className:"w-5 h-5"}),"New Opening"]})]})]}),e.jsxs("div",{className:"bg-white rounded-3xl border border-slate-200 overflow-hidden shadow-sm",children:[u?e.jsx("div",{className:"py-20 text-center",children:e.jsx(M,{className:"w-8 h-8 text-indigo-600 animate-spin mx-auto"})}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Role"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Department"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:o.map(a=>e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-indigo-50 flex items-center justify-center text-indigo-600 flex-shrink-0",children:e.jsx(A,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-bold text-slate-900 truncate max-w-xs",children:a.title}),e.jsxs("p",{className:"text-xs text-slate-500 truncate max-w-xs flex items-center gap-1",children:[e.jsx(G,{className:"w-3 h-3"})," ",a.location||"â",a.experience?` · ${a.experience}`:""]})]})]})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("span",{className:"px-2 py-1 bg-indigo-50 text-indigo-600 rounded text-xs font-bold",children:a.department})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("span",{className:"text-xs font-semibold text-slate-600",children:a.employmentType})}),e.jsx("td",{className:"px-6 py-5",children:a.isActive?e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 bg-emerald-50 text-emerald-700 rounded-lg text-xs font-bold border border-emerald-100",children:[e.jsx(P,{className:"w-3.5 h-3.5"})," Live"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 bg-slate-100 text-slate-500 rounded-lg text-xs font-bold border border-slate-200",children:[e.jsx(Ne,{className:"w-3.5 h-3.5"})," Hidden"]})}),e.jsx("td",{className:"px-6 py-5 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(a),className:`p-2 rounded-lg transition-all ${a.isActive?"text-slate-400 hover:text-amber-600 hover:bg-amber-50":"text-slate-400 hover:text-emerald-600 hover:bg-emerald-50"}`,title:a.isActive?"Hide from careers page":"Make live",children:a.isActive?e.jsx(W,{className:"w-5 h-5"}):e.jsx(P,{className:"w-5 h-5"})}),e.jsx("button",{onClick:()=>{n(a),x(!0)},className:"p-2 text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 rounded-lg transition-all",title:"Edit Opening",children:e.jsx(Z,{className:"w-5 h-5"})}),e.jsx("button",{onClick:()=>w(a),className:"p-2 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-all",title:"Delete Opening",children:e.jsx(X,{className:"w-5 h-5"})})]})})]},a.id))})]})}),!u&&o.length===0&&e.jsxs("div",{className:"py-20 text-center",children:[e.jsx(A,{className:"w-12 h-12 text-slate-200 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-500",children:'No openings yet. Click "New Opening" to add a role + JD.'})]})]}),e.jsx(Ee,{isOpen:g,onClose:()=>{x(!1),n(null)},onSuccess:m,initialData:l})]})}function os(){const h=Ae(),[p,u]=i.useState(null),[r,d]=i.useState(!0),[f,g]=i.useState([]),[x,l]=i.useState(""),[n,m]=i.useState(!1),[w,t]=i.useState(null),[o,b]=i.useState("blogs"),[a,L]=i.useState(""),[T,Q]=i.useState(""),[q,_]=i.useState(""),[B,D]=i.useState(!1),[$,ee]=i.useState({lifetimeVisitors:0,todayVisitors:0}
38),[F,V]=i.useState(!0),[z,se]=i.useState(0);i.useEffect(()=>{S.auth.getSession().then(({data:{session:c}})=>{u(c),c&&j(),d(!1)});const{data:{subscription:s}}=S.auth.onAuthStateChange((c,N)=>{u(N),N&&j()});return()=>s.unsubscribe()},[]);const j=async()=>{d(!0);const s=await k.getBlogs();g(s);const c=s.filter(N=>!N.is_static&&!N.is_approved).length;se(c),d(!1),te()},te=async()=>{V(!0);const s=await me.getStats();ee(s),V(!1)},ae=async s=>{s.preventDefault(),D(!0),_("");const{error:c}=await S.auth.signInWithPassword({email:a,password:T});c&&_(c.message),D(!1)},le=async()=>{await S.auth.signOut(),g([])},ie=async s=>{if(s.is_static)return;if(window.confirm(`Are you sure you want to delete "${s.title}"? This action cannot be undone.`))try{await k.deleteBlog(s.id),j()}catch{alert("Failed to delete post.")}},re=s=>{if(s.is_static){alert("Static blogs from JSON cannot be edited. They are read-only.");return}window.confirm(`Open editor for "${s.title}"?`)&&(t(s),m(!0))},ne=async s=>{if(!s.is_static)try{await k.updateApproval(s.id,!0),j()}catch{alert("Failed to approve post.")}},oe=async s=>{if(!s.is_static)try{await k.updateApproval(s.id,!1),j()}catch{alert("Failed to unapprove post.")}},R=f.filter(s=>s.title.toLowerCase().includes(x.toLowerCase())||s.category.toLowerCase().includes(x.toLowerCase()));return r&&!p?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50",children:e.jsx(M,{className:"w-10 h-10 text-indigo-600 animate-spin"})}):p?e.jsxs("div",{className:"min-h-screen bg-slate-50",children:[e.jsxs("nav",{className:"bg-white border-b border-slate-200 px-6 py-4 flex items-center justify-between sticky top-0 z-50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-600 rounded-xl flex items-center justify-center",children:e.jsx(Pe,{className:"w-6 h-6 text-white"})}),e.jsx("h2",{className:"text-xl font-bold text-slate-800 font-[Arial,sans-serif] hidden sm:block",children:"Blog Control"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-slate-500 hidden md:block",children:p.user.email}),e.jsxs("button",{onClick:le,className:"flex items-center gap-2 px-4 py-2 text-slate-600 hover:text-red-600 transition-colors font-medium border border-slate-100 rounded-lg",children:[e.jsx(H,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Sign Out"})]})]})]}),e.jsxs("main",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"flex gap-2 mb-8 border-b border-slate-200",children:[e.jsxs("button",{onClick:()=>b("blogs"),className:`flex items-center gap-2 px-5 py-3 font-bold text-sm border-b-2 -mb-px transition-all ${o==="blogs"?"border-indigo-600 text-indigo-600":"border-transparent text-slate-500 hover:text-slate-700"}`,children:[e.jsx(Te,{className:"w-4 h-4"})," Blogs"]}),e.jsxs("button",{onClick:()=>b("jobs"),className:`flex items-center gap-2 px-5 py-3 font-bold text-sm border-b-2 -mb-px transition-all ${o==="jobs"?"border-indigo-600 text-indigo-600":"border-transparent text-slate-500 hover:text-slate-700"}`,children:[e.jsx(A,{className:"w-4 h-4"})," Careers / Jobs"]})]}),o==="jobs"&&e.jsx(Me,{}),o==="blogs"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6 mb-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h1",{className:"text-4xl font-bold text-slate-900 font-[Arial,sans-serif]",children:"Manage Content"}),z>0&&e.jsxs(C.div,{initial:{scale:0},animate:{scale:1},className:"bg-red-500 text-white px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1 shadow-lg shadow-red-200",children:[e.jsx(ve,{className:"w-3 h-3"}),z," Pending"]})]}),e.jsx("div",{className:"flex-grow md:max-w-md",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-2xl border border-slate-200 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-50 flex items-center justify-center text-indigo-600",children:e.jsx(Se,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Lifetime Visitors"})]}),e.jsx("div",{className:"text-2xl font-bold text-slate-900",children:F?e.jsx("div",{className:"h-8 w-16 bg-slate-100 animate-pulse rounded"}
38):$.lifetimeVisitors.toLocaleString()})]}),e.jsxs("div",{className:"bg-white p-4 rounded-2xl border border-slate-200 shadow-sm relative overflow-hidden group",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-emerald-50 flex items-center justify-center text-emerald-600",children:e.jsx(ke,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Today's Visitors"})]}),e.jsx("div",{className:"text-2xl font-bold text-slate-900",children:F?e.jsx("div",{className:"h-8 w-16 bg-slate-100 animate-pulse rounded"}):$.todayVisitors.toLocaleString()}),e.jsx("div",{className:"absolute -bottom-2 -right-2 opacity-5 group-hover:opacity-10 transition-opacity",children:e.jsx(U,{className:"w-16 h-16 text-emerald-600"})})]})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),e.jsx("input",{type:"text",placeholder:"Search posts...",value:x,onChange:s=>l(s.target.value),className:"w-full sm:w-64 pl-10 pr-4 py-2 rounded-xl border border-slate-200 bg-white focus:ring-2 focus:ring-indigo-500 outline-none"})]}),e.jsxs("button",{onClick:()=>{t(null),m(!0)},className:"px-6 py-2 bg-indigo-600 text-white rounded-xl font-bold hover:bg-indigo-700 shadow-md flex items-center justify-center gap-2",children:[e.jsx(K,{className:"w-5 h-5"}),"New Post"]})]})]}),e.jsxs("div",{className:"bg-white rounded-3xl border border-slate-200 overflow-hidden shadow-sm",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Post Details"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Category"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-slate-500 uppercase tracking-wider text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:R.map(s=>e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:s.image,alt:"",className:"w-12 h-12 rounded-lg object-cover flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-bold text-slate-900 truncate max-w-xs",children:s.title}),e.jsxs("p",{className:"text-xs text-slate-500 truncate max-w-xs",children:["/",s.slug]})]})]})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("span",{className:"px-2 py-1 bg-indigo-50 text-indigo-600 rounded text-xs font-bold",children:s.category})}),e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[s.is_static?e.jsxs("span",{className:"flex items-center gap-1 text-slate-400 text-xs",children:[e.jsx(I,{className:"w-3 h-3"})," Static JSON"]}):e.jsx("div",{className:"flex flex-col gap-2",children:s.is_approved?e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 bg-emerald-50 text-emerald-700 rounded-lg text-xs font-bold border border-emerald-100",children:[e.jsx(P,{className:"w-3.5 h-3.5"})," Approved"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 bg-amber-50 text-amber-700 rounded-lg text-xs font-bold border border-amber-100",children:[e.jsx(U,{className:"w-3.5 h-3.5 animate-pulse"})," Pending"]})}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-1",children:s.date})]})}),e.jsx("td",{className:"px-6 py-5 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[!s.is_static&&e.jsx(e.Fragment,{children:s.is_approved?e.jsx("button",{onClick:()=>oe(s),className:"p-2 text-slate-400 hover:text-amber-600 hover:bg-amber-50 rounded-lg transition-all",title:"Unapprove Post",children:e.jsx(W,{className:"w-5 h-5"})}):e.jsx("button",{onClick:()=>ne(s),className:"p-2 text-slate-400 hover:text-emerald-600 hover:bg-emerald-50 rounded-lg transition-all",title:"Ap
38prove Post",children:e.jsx(P,{className:"w-5 h-5"})})}),e.jsx("button",{onClick:()=>h(`/blog/${s.slug}`),className:"p-2 text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 rounded-lg transition-all",title:"View Post",children:e.jsx(Ce,{className:"w-5 h-5"})}),e.jsx("button",{disabled:s.is_static,onClick:()=>re(s),className:`p-2 rounded-lg transition-all ${s.is_static?"text-slate-200 cursor-not-allowed":"text-slate-400 hover:text-emerald-600 hover:bg-emerald-50"}`,title:"Edit Post",children:e.jsx(Z,{className:"w-5 h-5"})}),e.jsx("button",{disabled:s.is_static,onClick:()=>ie(s),className:`p-2 rounded-lg transition-all ${s.is_static?"text-slate-200 cursor-not-allowed":"text-slate-400 hover:text-red-600 hover:bg-red-50"}`,title:"Delete Post",children:e.jsx(X,{className:"w-5 h-5"})})]})})]},s.slug))})]})}),R.length===0&&e.jsxs("div",{className:"py-20 text-center",children:[e.jsx(H,{className:"w-12 h-12 text-slate-200 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-500",children:"No posts found matching your search."})]})]})]})]}),e.jsx(ue,{isOpen:n,onClose:()=>{m(!1),t(null)},onSuccess:j,initialData:w})]}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50 p-4",children:e.jsxs(C.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"w-full max-w-md bg-white rounded-3xl shadow-2xl p-8 border border-slate-100",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-indigo-100 rounded-2xl flex items-center justify-center mx-auto mb-4",children:e.jsx(I,{className:"w-8 h-8 text-indigo-600"})}),e.jsx("h1",{className:"text-3xl font-bold text-slate-900 font-[Arial,sans-serif]",children:"Admin Portal"}),e.jsx("p",{className:"text-slate-500 mt-2",children:"Sign in to manage icpaas.ai blogs"})]}),e.jsxs("form",{onSubmit:ae,className:"space-y-5",children:[q&&e.jsxs("div",{className:"p-4 bg-red-50 border border-red-100 text-red-600 rounded-xl text-sm flex items-center gap-2",children:[e.jsx(ye,{className:"w-4 h-4 flex-shrink-0"}),q]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-slate-700 flex items-center gap-2",children:[e.jsx(pe,{className:"w-4 h-4"})," Email Address"]}),e.jsx("input",{required:!0,type:"email",value:a,onChange:s=>L(s.target.value),className:"w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all",placeholder:"[email protected]"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-semibold text-slate-700 flex items-center gap-2",children:[e.jsx(we,{className:"w-4 h-4"})," Password"]}),e.jsx("input",{required:!0,type:"password",value:T,onChange:s=>Q(s.target.value),className:"w-full px-4 py-3 rounded-xl border border-slate-200 focus:ring-2 focus:ring-indigo-500 outline-none transition-all",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),e.jsx("button",{type:"submit",disabled:B,className:"w-full py-4 bg-indigo-600 text-white rounded-xl font-bold hover:bg-indigo-700 shadow-lg transform active:scale-95 transition-all flex items-center justify-center gap-2",children:B?e.jsx(M,{className:"w-5 h-5 animate-spin"}):"Enter Dashboard"})]})]})})}export{os 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.