1import{j as e}from"./ui-vendor-B5O6TaIB.js";import{r as n,m as Ie,L as K}from"./react-vendor-Dwsg5a2_.js";import{a as u,S as ee,T as De,U as Te,R as $e,V as te,Q as I,N as Me,W as D,O as se,t as Ee,X as Be,v as Re,Y as re,Z as ae,_ as Ue,$ as Xe,a0 as qe,a1 as We,a2 as Oe,L as le,M as ne}from"./index-Cbf_hYLb.js";function Ye(){const y=n.useRef(null),ie=Ie(),[d,w]=n.useState([]),[T,$]=n.useState(!0),[M,E]=n.useState(null),[v,oe]=n.useState(""),[k,de]=n.useState("all"),[c,x]=n.useState(1),[m,ce]=n.useState(10),[o,j]=n.useState([]),[B,R]=n.useState(!1),h=new URLSearchParams(ie.search).get("status");n.useEffect(()=>{ue()},[]);const ue=async()=>{$(!0);try{const s=(await u.get("/api/admin/posts")).data.filter(r=>r.type==="post");w(s)}catch(t){console.error("Error fetching admin posts, trying public:",t);try{const s=await u.get("/api/posts"),r=Array.isArray(s.data)?s.data:s.data.data||[];w(r)}catch(s){console.error("Error fetching public posts:",s)}}finally{$(!1)}},xe=()=>{y.current.click()},[me,U]=n.useState(!1),[S,F]=n.useState({current:0,total:0}),[X,P]=n.useState([]),he=async t=>{var a,l;const s=t.target.files[0];if(!s)return;U(!0),F({current:0,total:0}),P([]);const r=new FormData;r.append("file",s);try{const i=await u.post("/api/admin/import/wordpress/upload",r,{headers:{"Content-Type":"multipart/form-data"}}),{import_id:Le,items:Z,total:Ae}=i.data;F({current:0,total:Ae});const H=5;for(let b=0;b<Z.length;b+=H){const J=Z.slice(b,b+H),_e=J.map(g=>g.index);try{const g=await u.post("/api/admin/import/wordpress/process",{import_id:Le,indices:_e,download_images:!0});F(f=>({...f,current:Math.min(f.total,b+J.length)})),P(f=>[...f,...g.data.results])}catch(g){console.error("Batch Error:",g),P(f=>[...f,{title:`Batch starting at ${b}`,status:"error",message:g.message}])}}alert("Import process completed!"),window.location.reload()}catch(i){console.error("Import Error:",i),alert("Failed to start import: "+(((l=(a=i.response)==null?void 0:a.data)==null?void 0:l.message)||i.message))}finally{U(!1),y.current&&(y.current.value="")}},[pe,z]=n.useState(!1),[q,be]=n.useState("https://rainxmainsitegallery.s3.us-east-005.backblazeb2.com/blog"),[W,ge]=n.useState(null),[L,O]=n.useState(!1),fe=async t=>{var r,a;if(t.preventDefault(),!W)return alert("Please select an XML file.");O(!0);const s=new FormData;s.append("file",W),s.append("s3_base_url",q);try{const l=await u.post("/api/admin/import/wordpress/link-s3",s,{headers:{"Content-Type":"multipart/form-data"}});alert(l.data.message),z(!1),window.location.reload()}catch(l){console.error("S3 Link Error:",l),alert("Failed to link images: "+(((a=(r=l.response)==null?void 0:r.data)==null?void 0:a.message)||l.message))}finally{O(!1)}},[je,A]=n.useState(!1),[V,Ne]=n.useState(null),[_,G]=n.useState(!1),ye=async t=>{var r,a;if(t.preventDefault(),!V)return alert("Please select an XML file.");G(!0);const s=new FormData;s.append("file",V);try{const l=await u.post("/api/admin/import/wordpress/fix-authors",s,{headers:{"Content-Type":"multipart/form-data"}});alert(l.data.message),A(!1),window.location.reload()}catch(l){console.error("Author Fix Error:",l),alert("Failed to fix authors: "+(((a=(r=l.response)==null?void 0:r.data)==null?void 0:a.message)||l.message))}finally{G(!1)}},Q=t=>{const s=window.location.origin;return t.type==="post"?`${s}/blog/${t.slug}`:`${s}/${t.slug}`},we=t=>{const s=Q(t);navigator.clipboard.writeText(s),E(t.id),setTimeout(()=>E(null),2e3)},ve=async t=>{if(window.confirm("Are you sure you want to delete this post?"))try{await u.delete(`/api/posts/${t}`),w(d.filter(s=>s.id!==t)),j(s=>s.filter(r=>r!==t))}catch(s){console.error("Error deleting post:",s),alert("Error deleting post")}},ke=async()=>{if(window.confirm(`Are you sure you want to delete ${o.length} items? This action cannot be undone.`)){R(!0);try{await u.delete("/api/posts/bulk",{data:{ids:o}}),w(d.filter(t=>!o.includes(t.id))),j([])}catch(t){console.error("Bulk delete error:",t),alert("Failed to delete selected items")}finally{R(!1)}}},Y=t=>{j(s=>s.includes(t)?s.filter(r=>r!==t):[...s,t])},Se=()=>{const t=N.map(r=>r.id),s=t.every(r=>o.includes(r));j(s?r=>r.filter(a=>!t.includes(a)):r=>[...new Set([...r,...t])])},p=n.useMemo(()=>d.filter(t=>{var l,i;const s=((l=t.title)==null?void 0:l.toLowerCase().includes(v.toLowerCase()))||((i=t.slug)==null?void 0:i.toLowerCase().includes(v.toLowerCase())),r=k==="all"||t.type===k,a=!h||h==="published"&&t.is_published||h==="draft"&&!t.is_published;return s&&r&&a}),[d,v,k,h]),C=Math.max(1,Math.ceil(p.length/m)),N=p.slice((c-1)*m,c*m),Ce=t=>{oe(t.target.value),x(1)},Fe=t=>{de(t.target.value),x(1)},Pe=t=>{ce(Number(t.target.value)),x(1)},ze=[{label:"Total Posts",value:d.length.toString(),change:"+12%",isPositive:!0,icon:e.jsx(ee,{className:"w-6 h-6 text-blue-500"}),iconBg:"bg-blue-50"},{label:"Published",value:d.filter(t=>t.is_published).length.toString(),change:"+5.4%",isPositive:!0,icon:e.jsx(De,{className:"w-6 h-6 text-purple-500"}),iconBg:"bg-purple-50"},{label:"Drafts",value:d.filter(t=>!t.is_published).length.toString(),badge:"Action Still Needed",isAlert:!0,icon:e.jsx(Te,{className:"w-6 h-6 text-orange-500"}),iconBg:"bg-orange-50"}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center text-sm text-neutral-muted mb-4",children:[e.jsx("span",{children:"Dashboard"}),e.jsx("span",{className:"mx-2",children:"âº"}),e.jsx("span",{className:"font-medium text-neutral-dark",children:"Blog"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-neutral-dark flex items-center gap-3",children:["Content Management",h==="published"&&e.jsx("span",{className:"text-sm font-semibold bg-green-100 text-green-700 px-3 py-1 rounded-full",children:"Published"}),h==="draft"&&e.jsx("span",{className:"text-sm font-semibold bg-amber-100 text-amber-700 px-3 py-1 rounded-full",children:"Drafts"})]}),e.jsx("p",{className:"text-neutral-muted mt-1",children:"Create, edit, and manage your blog posts and static pages."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"file",ref:y,onChange:he,className:"hidden",accept:".csv,.json,.xml"}),e.jsxs("button",{onClick:xe,className:"flex items-center gap-2 bg-white border border-neutral-border text-neutral-dark hover:bg-neutral-50 px-4 py-2 rounded-lg font-medium transition-colors",children:[e.jsx($e,{size:18}),"Import"]}),e.jsxs("button",{onClick:()=>z(!0),className:"flex items-center gap-2 bg-indigo-50 border border-indigo-200 text-indigo-700 hover:bg-indigo-100 px-4 py-2 rounded-lg font-medium transition-colors",children:[e.jsx(te,{size:18}),"Fix S3 Images"]}),e.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-2 bg-amber-50 border border-amber-200 text-amber-700 hover:bg-amber-100 px-4 py-2 rounded-lg font-medium transition-colors",children:[e.jsx(I,{size:18}),"Fix Authors"]}),e.jsxs(K,{to:"/admin/blog/create",className:"flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg font-medium transition-colors shadow-lg shadow-blue-500/20",children:[e.jsx(Me,{size:18}),"Create New"]}),o.length>0&&e.jsxs("button",{onClick:ke,disabled:B,className:"flex items-center gap-2 bg-red-50 text-red-600 border border-red-200 hover:bg-red-100 px-4 py-2 rounded-lg font-medium transition-all shadow-sm",children:[B?e.jsx(D,{className:"animate-spin"}):e.jsx(se,{size:18}),"Delete (",o.length,")"]})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:ze.map((t,s)=>e.jsxs("div",{className:"bg-white p-6 rounded-xl border border-neutral-border shadow-sm flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center mb-4 ${t.iconBg}`,children:t.icon}),e.jsx("p",{className:"text-neutral-muted text-sm font-medium mb-1",children:t.label}),e.jsx("h3",{className:"text-3xl font-bold text-neutral-dark",children:t.value})]}),t.change&&e.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-bold ${t.isPositive?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:t.change})]},s))}),e.jsxs("div",{className:"bg-white p-4 rounded-xl border border-neutral-border shadow-sm flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ee,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-neutral-muted"}),e.jsx("input",{type:"text",placeholder:"Search content...",value:v,onCh
1ange:Ce,className:"pl-10 pr-4 py-2 border border-neutral-border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500"})]}),e.jsxs("select",{value:k,onChange:Fe,className:"px-3 py-2 border border-neutral-border rounded-lg text-sm text-neutral-dark focus:outline-none focus:ring-2 focus:ring-blue-500/20",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"post",children:"Blog Posts"}),e.jsx("option",{value:"page",children:"Static Pages"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("select",{value:m,onChange:Pe,className:"px-3 py-2 border border-neutral-border rounded-lg text-sm text-neutral-dark focus:outline-none focus:ring-2 focus:ring-blue-500/20",children:[e.jsx("option",{value:5,children:"5 / page"}),e.jsx("option",{value:10,children:"10 / page"}),e.jsx("option",{value:25,children:"25 / page"}),e.jsx("option",{value:50,children:"50 / page"})]}),e.jsx("button",{className:"p-2 text-neutral-muted hover:text-neutral-dark hover:bg-neutral-100 rounded-lg transition-colors",children:e.jsx(Be,{size:18})}),e.jsx("button",{className:"p-2 text-neutral-muted hover:text-neutral-dark hover:bg-neutral-100 rounded-lg transition-colors",children:e.jsx(Re,{size:18})})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-neutral-border shadow-sm overflow-hidden",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-neutral-border bg-neutral-50/50",children:[e.jsx("th",{className:"px-4 py-4 w-10",children:e.jsx("button",{onClick:Se,className:"text-neutral-400 hover:text-blue-600 transition-colors",children:N.length>0&&N.every(t=>o.includes(t.id))?e.jsx(re,{size:20,className:"text-blue-600"}):e.jsx(ae,{size:20})})}),e.jsx("th",{className:"px-4 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider w-20",children:"Thumb"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider",children:"Content Info"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider",children:"Author"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider",children:"Tags"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider",children:"Date"}),e.jsx("th",{className:"px-6 py-4 text-xs font-bold text-neutral-muted uppercase tracking-wider text-right",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-neutral-border",children:T?e.jsx("tr",{children:e.jsx("td",{colSpan:"7",className:"px-6 py-12 text-center text-neutral-muted",children:"Loading content..."})}):d.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:"7",className:"px-6 py-12 text-center text-neutral-muted",children:"No content found. Start by creating one!"})}):N.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:"7",className:"px-6 py-12 text-center text-neutral-muted",children:"No content matches your search."})}):N.map(t=>{var s,r;return e.jsxs("tr",{className:`hover:bg-neutral-50/50 transition-colors group ${o.includes(t.id)?"bg-blue-50/30":""}`,onClick:()=>Y(t.id),children:[e.jsx("td",{className:"px-4 py-4",onClick:a=>a.stopPropagation(),children:e.jsx("button",{onClick:()=>Y(t.id),className:"text-neutral-400 hover:text-blue-600 transition-colors",children:o.includes(t.id)?e.jsx(re,{size:20,className:"text-blue-600"}):e.jsx(ae,{size:20})})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"w-16 h-12 rounded-lg bg-neutral-100 flex items-center justify-center flex-shrink-0 overflow-hidden border border-neutral-border",children:[t.featured_image||t.og_image?e.jsx("img",{src:t.featured_image||t.og_image,alt:"",loading:"lazy",decoding:"async",className:"w-full h-full object-cover opacity-90 blur-sm scale-110 transition-all duration-700 hover:opacity-100",onLoad:a=>{a.target.classList.remove("blur-sm","scale-110")},onError:a=>{a.target.style.display="none",a.target.nextSibling.style.display="flex"}}):null,e.jsx("div",{className:`w-full h-full items-center justify-center ${t.featured_image||t.og_image?"hidden":"flex"}`,children:e.jsx(ee,{className:"text-neutral-400",size:18})})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-neutral-dark text-sm leading-tight max-w-xs truncate",title:t.title,children:t.title}),e.jsx("p",{className:"text-[11px] text-neutral-muted mt-1 uppercase tracking-tighter font-semibold truncate max-w-xs",children:t.slug}),e.jsx("span",{className:`mt-1.5 inline-block px-2 py-0.5 rounded-md text-[10px] font-bold uppercase ${t.type==="post"?"bg-blue-50 text-blue-600 border border-blue-100":"bg-purple-50 text-purple-600 border border-purple-100"}`,children:t.type})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",children:(((s=t.author)==null?void 0:s.name)||t.author_name||"A").charAt(0).toUpperCase()}),e.jsx("span",{className:"text-sm text-neutral-dark font-medium truncate max-w-[100px]",children:((r=t.author)==null?void 0:r.name)||t.author_name||"Admin"})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("div",{className:"flex flex-wrap gap-1 max-w-[150px]",children:(()=>{let a=[];return Array.isArray(t.tags)?a=t.tags:typeof t.tags=="string"&&t.tags.trim()&&(a=t.tags.split(",").map(l=>l.trim())),a.length>0?e.jsxs(e.Fragment,{children:[a.slice(0,3).map((l,i)=>e.jsx("span",{className:"px-2 py-0.5 bg-neutral-100 text-neutral-600 text-[10px] font-semibold rounded-full border border-neutral-200",children:typeof l=="string"?l:l.name||""},i)),a.length>3&&e.jsxs("span",{className:"px-2 py-0.5 bg-neutral-200 text-neutral-500 text-[10px] font-bold rounded-full",children:["+",a.length-3]})]}):e.jsx("span",{className:"text-[11px] text-neutral-300 italic",children:"â"})})()})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${t.is_published?"bg-green-500 animate-pulse":"bg-amber-500"}`}),e.jsx("span",{className:`text-sm font-bold ${t.is_published?"text-green-600":"text-amber-600"}`,children:t.is_published?"Published":"Draft"})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-neutral-dark font-medium whitespace-nowrap",children:new Date(t.created_at).toLocaleDateString()})}),e.jsx("td",{className:"px-6 py-4 text-right",onClick:a=>a.stopPropagation(),children:e.jsxs("div",{className:"flex items-center justify-end gap-1 opacity-100 md:opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:()=>window.open(Q(t),"_blank"),className:"p-2 text-neutral-muted hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-all",title:"View Page",children:e.jsx(Ue,{size:16})}),e.jsx("button",{onClick:()=>we(t),className:`p-2 rounded-lg transition-all ${M===t.id?"text-green-600 bg-green-50":"text-neutral-muted hover:text-green-600 hover:bg-green-50"}`,title:"Copy URL",children:M===t.id?e.jsx(Xe,{size:16}):e.jsx(qe,{size:16})}),e.jsx(K,{to:`/admin/blog/edit/${t.id}`,className:"p-2 text-neutral-muted hover:text-amber-600 hover:bg-amber-50 rounded-lg transition-all",title:"Edit",children:e.jsx(I,{size:16})}),e.jsx("button",{onClick:()=>ve(t.id),className:"p-2 text-neutral-muted hover:text-red-600 hover:bg-red-50 rounded-lg transition-all",title:"Delete",children:e.jsx(se,{size:16})})]})})]},t.id)})})]})}),!T&&p.length>0&&e.jsxs("div",{className:"px-6 py-4 border-t border-neutral-border flex flex-col sm:flex-row items-center justify-between gap-4 bg-neutral-50/30",children:[e.jsxs("p",{className:"text-sm text-neutral-muted font-medium",children:["Showing"," ",e.jsx("span",{className:"text-neutral-dark font-bold",children:Math.min((c-1)*m+1,p.length)})," ","â"," ",e.jsx("span",{className:"text-neutral-dark font-bold",children:Math.min(c*m,p.length)})," ","of"," ",e.jsx("span",{className:"text-neutral-dark font-bold",children:p.length})," ","items"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>x(t=>Math.max(1,t-1)),disabled:c===1,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-bold rounded-lg border border-neutral-border bg-white hover:bg-neutral-50 disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:[e.jsx(We,{size:15})," Previous"]}),e.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:C},(t,s)=>s+1).filter(t=>t===1||t===C||Math.abs(t-c)<=1).reduce((t,s,r,a)=>(r>0&&a[r-1]!==s-1&&t.push("..."),t.push(s),t),[]).map((t,s)=>t==="..."?e.jsx("span",{className:"px-2 py-1 text-neutral-muted text-sm select-none",children:"â¦"},`ellipsis-${s}`):e.jsx("button",{onClick:()=>x(t),className:`w-9 h-9 rounded-lg text-sm font-bold transition-all ${c===t?"bg-blue-600 text-white shadow-md shadow-blue-500/20":"border border-neutral-border bg-white text-neutral-dark hover:bg-neutral-50"}`,children:t},t))}),e.jsxs("button",{onClick:()=>x(t=>Math.min(C,t+1)),disabled:c===C,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-bold rounded-lg border border-neutral-border bg-white hover:bg-neutral-50 disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:["Next ",e.jsx(Oe,{size:15})]})]})]})]}),me&&e.jsx("div",{className:"fixed inset-0 bg-neutral-dark/50 backdrop-blur-sm z-[60] flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg overflow-hidden border border-neutral-border",children:[e.jsxs("div",{className:"p-6 border-b border-neutral-border bg-neutral-50",children:[e.jsxs("h2",{className:"text-xl font-bold text-neutral-dark flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-blue-600 border-t-transparent animate-spin"}),"Importing WordPress Content"]}),e.jsx("p",{className:"text-neutral-muted text-sm mt-1",children:"Please keep this window open until the process completes."})]}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm font-bold",children:[e.jsx("span",{className:"text-neutral-muted",children:"Progress"}),e.jsxs("span",{className:"text-blue-600",children:[S.current," / ",S.total," items"]})]}),e.jsx("div",{className:"w-full h-3 bg-neutral-100 rounded-full overflow-hidden border border-neutral-border",children:e.jsx("div",{className:"h-full bg-blue-600 transition-all duration-500 ease-out",style:{width:`${S.current/S.total*100}%`}})})]}),e.jsx("div",{className:"bg-neutral-900 rounded-xl p-4 h-48 overflow-y-auto font-mono text-xs space-y-1 custom-scrollbar",children:X.length===0?e.jsx("div",{className:"text-neutral-500 italic",children:"Initializing import..."}):X.map((t,s)=>
1e.jsxs("div",{className:t.status==="success"?"text-green-400":"text-red-400",children:[e.jsxs("span",{className:"text-neutral-500",children:["[",s+1,"]"]})," ",t.status==="success"?"â":"â"," ",t.title,t.message&&e.jsxs("span",{className:"ml-2 opacity-70",children:["â ",t.message]})]},s)).reverse()})]}),e.jsx("div",{className:"p-4 bg-neutral-50 border-t border-neutral-border flex justify-end",children:e.jsx("p",{className:"text-[10px] text-neutral-400 uppercase font-bold tracking-widest",children:"Powered by RainX Importer"})})]})}),pe&&e.jsx("div",{className:"fixed inset-0 bg-neutral-dark/50 backdrop-blur-sm z-[60] flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg overflow-hidden border border-neutral-border",children:[e.jsxs("div",{className:"p-6 border-b border-neutral-border flex items-center justify-between",children:[e.jsxs("h2",{className:"text-xl font-bold text-neutral-dark flex items-center gap-2",children:[e.jsx(te,{className:"text-indigo-600"}),"Fix S3 Images via XML"]}),e.jsx("button",{onClick:()=>z(!1),className:"text-neutral-muted hover:text-red-500 transition-colors",children:e.jsx(le,{size:24})})]}),e.jsxs("form",{onSubmit:fe,className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-neutral-dark mb-1",children:"Backblaze / S3 Base URL"}),e.jsx("input",{type:"url",value:q,onChange:t=>be(t.target.value),className:"w-full px-4 py-2 border border-neutral-border rounded-lg bg-neutral-50 text-neutral-dark focus:border-indigo-600 focus:ring-1 focus:ring-indigo-600 outline-none",required:!0}),e.jsx("p",{className:"text-xs text-neutral-muted mt-1",children:"E.g. https://your-bucket.s3.us-east.backblazeb2.com/blog"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-neutral-dark mb-1",children:"WordPress .xml File"}),e.jsx("input",{type:"file",accept:".xml",onChange:t=>ge(t.target.files[0]),className:"w-full text-sm border border-neutral-border rounded-lg p-2",required:!0})]}),e.jsxs("button",{type:"submit",disabled:L,className:"w-full py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-lg transition-colors flex items-center justify-center gap-2",children:[L?e.jsx(D,{className:"animate-spin"}):e.jsx(ne,{}),L?"Processing...":"Link Images Now"]})]})]})}),je&&e.jsx("div",{className:"fixed inset-0 bg-neutral-dark/50 backdrop-blur-sm z-[60] flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg overflow-hidden border border-neutral-border",children:[e.jsxs("div",{className:"p-6 border-b border-neutral-border flex items-center justify-between",children:[e.jsxs("h2",{className:"text-xl font-bold text-neutral-dark flex items-center gap-2",children:[e.jsx(I,{className:"text-amber-600"}),"Fix Authors via XML"]}),e.jsx("button",{onClick:()=>A(!1),className:"text-neutral-muted hover:text-red-500 transition-colors",children:e.jsx(le,{size:24})})]}),e.jsxs("form",{onSubmit:ye,className:"p-6 space-y-4",children:[e.jsx("p",{className:"text-sm text-neutral-muted mb-2",children:"Select your original WordPress .xml file again. This will restore the real author names for all your imported posts!"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-neutral-dark mb-1",children:"WordPress .xml File"}),e.jsx("input",{type:"file",accept:".xml",onChange:t=>Ne(t.target.files[0]),className:"w-full text-sm border border-neutral-border rounded-lg p-2",required:!0})]}),e.jsxs("button",{type:"submit",disabled:_,className:"w-full py-3 bg-amber-600 hover:bg-amber-700 text-white font-bold rounded-lg transition-colors flex items-center justify-center gap-2",children:[_?e.jsx(D,{className:"animate-spin"}):e.jsx(ne,{}),_?"Processing...":"Fix Authors Now"]})]})]})})]})}export{Ye 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.