PageSourceSearch

https://www.propora.ai/assets/AdminLearn-ClWNtriE.js

js propora.ai collected 2026-10-05 14:30:16 UTC 22,715 bytes, 1 lines download raw bytes

1import{bo as Ae,aa as Ie,r,j as e,bd as Se,au as _e,cv as Pe,be as Me,bq as Fe,D as le,d as x,B as p,t as g,a9 as m,Y as w}from"./index-BzAldwSt.js";import{I as Oe}from"./InlineLoader-Dz1DSjy6.js";import{C as We}from"./CustomQuillEditor-BRNHP8zV.js";import{B as Le}from"./BusinessProfileCompletionModal-DD3r_62b.js";import{b as Be}from"./defaultTheme-O4OWyfGu.js";import{T as Ee}from"./ThemeProvider-C6Be_NfH.js";import{B as N}from"./Button-Cl5DhJph.js";import{T as h,F as M,c as F,S as O}from"./TextField-BCIOC2yy.js";import{M as k}from"./mui-tel-input.es-c7JD7Np0.js";import{B as re}from"./Box-CAdOfAkK.js";import{C as ie}from"./Chip-Q7uy_fds.js";import"./quill.snow-FxEw-Ia8.js";import"./isEqual-DzSeg6ii.js";import"./editorImageUpload-DQ0rSbGc.js";import"./BusinessInfoWizard-RNQ1iLID.js";import"./TransitionGroupContext-DjhLzqxi.js";import"./inheritsLoose-Dh9mjS0Z.js";import"./useTheme-43nxTsPI.js";import"./isHostComponent-BwN-UhHR.js";import"./ButtonBase-DW7xFNvQ.js";import"./useSlot-BnWCHB59.js";import"./InputAdornment-B7-qhujA.js";const $e=d=>Be({palette:{mode:d?"light":"dark",primary:{main:"#0ea5e9"},background:{paper:d?"#ffffff":"#1f2937",default:d?"#f1f5f9":"#111827"},text:{primary:d?"#0f172a":"#f3f4f6",secondary:d?"#475569":"#d1d5db"}}});function da(){var ae,te,se;const{businessProfileCompletionData:d}=Ae(),ne=d&&d.businessPrefix!=null&&d.businessPrefix!=""||!1,$=(d==null?void 0:d.businessPrefix)||"",oe=d&&d.staffSuperUser||!1,{theme:R}=Ie(),de=r.useMemo(()=>$e(R==="light"),[R]),[ce,D]=r.useState(!1),[U,me]=r.useState([]),[ue,z]=r.useState(!0),[T,xe]=r.useState(""),[W,pe]=r.useState("all"),[L,ge]=r.useState("all"),[he,H]=r.useState(!1),[o,B]=r.useState(null),[fe,q]=r.useState(!1),[s,be]=r.useState(null),[i,n]=r.useState({title:"",description:"",content:"",category:"website-usage",type:"guide",tags:[],readTime:"",enabled:!0,access:"both",permalink:"",hero_image_url:null,video_url:""}),[A,V]=r.useState(""),[f,b]=r.useState(null),[G,y]=r.useState(null),[I,S]=r.useState(!1),ye=a=>{const t=["develop","auth","proposal","learn","dashboard","client","admin","login","register","reset-password","forgot-password","verify-email","invite","guest","admin","guest","www","ripehouse","advisory","ba","buyer"],l=a.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim();return t.includes(l)?l+"-perma":l},_=[{value:"website-usage",label:"Website Usage"},{value:"faq",label:"FAQs"},{value:"education",label:"Education"},...$==="ripehouse-advisory"?[{value:"propora-blog",label:"Propora Blog"}]:[]],P=[{value:"guide",label:"Guide"},{value:"faq",label:"FAQ"},{value:"article",label:"Article"},...$==="ripehouse-advisory"?[{value:"blog",label:"Blog Post"}]:[]],Q=[{value:"client",label:"Client Only"},{value:"admin",label:"Admin Only"},{value:"both",label:"Both Client & Admin"}],C=async()=>{try{z(!0);const a=await x.get(`${p}/api_new/admin/learn`,{headers:g()});me(a.data.articles||[])}catch{m("Failed to fetch articles")}finally{z(!1)}};r.useEffect(()=>{if(!localStorage.getItem("token")){window.location.href="/admin/login";return}C()},[]);const J=U.filter(a=>{const t=a.title.toLowerCase().includes(T.toLowerCase())||a.description.toLowerCase().includes(T.toLowerCase())||a.tags.some(u=>u.toLowerCase().includes(T.toLowerCase())),l=W==="all"||a.category===W,c=L==="all"||a.type===L;return t&&l&&c}),je=async a=>{var t,l,c;a.preventDefault();try{let u=o==null?void 0:o.id;if(o?(await x.put(`${p}/api_new/admin/learn/${o.id}`,i,{headers:g()}),w("Article updated successfully")):(u=(t=(await x.post(`${p}/api_new/admin/learn`,i,{headers:g()})).data.article)==null?void 0:t.id,w("Article created successfully")),f&&u)try{const v=new FormData;v.append("heroImage",f);const Re=await x.post(`${p}/api_new/admin/learn/${u}/hero-image`,v,{headers:{...g(),"Content-Type":"multipart/form-data"}});w("Hero image uploaded successfully")}catch(v){m("Article saved but hero image upload failed: "+(((c=(l=v.response)==null?void 0:l.data)==null?void 0:c.message)||v.message))}E(),C()}catch{m("Failed to save article")}},ve=async a=>{if(window.confirm("Are you sure you want to delete this article?"))try{await x.delete(`${p}/api_new/admin/learn/${a}`,{headers:g()}),w("Article deleted successfully"),C()}catch{m("Failed to delete article")}},K=(a=null)=>
1{a?(B(a),n({title:a.title,description:a.description,content:a.content,category:a.category,type:a.type,tags:j(a.tags),readTime:a.readTime||"",enabled:a.enabled!==!1,access:a.access||"both",permalink:a.permalink||"",hero_image_url:a.hero_image_url||null,video_url:a.video_url||""}),y(a.hero_image_url||null)):(B(null),n({title:"",description:"",content:"",category:"website-usage",type:"guide",tags:[],readTime:"",enabled:!0,access:"both",permalink:"",hero_image_url:null,video_url:""}),y(null)),b(null),H(!0)},E=()=>{H(!1),B(null),n({title:"",description:"",content:"",category:"website-usage",type:"guide",tags:[],readTime:"",enabled:!0,access:"both",permalink:"",hero_image_url:null,video_url:""}),b(null),y(null)},we=a=>{be(a),q(!0)},Y=()=>{A.trim()&&!i.tags.includes(A.trim())&&(n(a=>({...a,tags:[...a.tags,A.trim()]})),V(""))},Ne=a=>{n(t=>({...t,tags:t.tags.filter(l=>l!==a)}))},X=a=>{const t=a.target.files[0];if(t){if(!["image/jpeg","image/jpg","image/png","image/gif","image/webp"].includes(t.type)){m("Please select a valid image file (JPEG, PNG, GIF, or WebP)");return}const c=5*1024*1024;if(t.size>c){m("Image size must be less than 5MB");return}b(t),y(URL.createObjectURL(t))}},Ce=async()=>{if(!f||!o){m("Please select an image and ensure the article is saved first");return}try{S(!0);const a=new FormData;a.append("heroImage",f);const t=await x.post(`${p}/api_new/admin/learn/${o.id}/hero-image`,a,{headers:{...g(),"Content-Type":"multipart/form-data"}});t.data.success&&(w("Hero image uploaded successfully"),n(l=>({...l,hero_image_url:t.data.imageUrl})),b(null),C())}catch{m("Failed to upload hero image")}finally{S(!1)}},ke=async()=>{if(!(!o||!i.hero_image_url)&&window.confirm("Are you sure you want to remove the hero image?"))try{S(!0),(await x.delete(`${p}/api_new/admin/learn/${o.id}/hero-image`,{headers:g()})).data.success&&(w("Hero image removed successfully"),n(t=>({...t,hero_image_url:null})),y(null),b(null),C())}catch{m("Failed to remove hero image")}finally{S(!1)}},j=a=>{if(!a)return[];if(Array.isArray(a))return a;if(typeof a=="string")try{const t=JSON.parse(a);return Array.isArray(t)?t:[]}catch{return[]}return[]},Z=a=>{switch(a){case"website-usage":return"bg-blue-900 text-blue-300";case"faq":return"bg-yellow-900 text-yellow-300";case"education":return"bg-green-900 text-green-300";case"propora-blog":return"bg-purple-900 text-purple-300";default:return"bg-gray-700 text-gray-300"}},ee=a=>{switch(a){case"guide":return"bg-purple-900 text-purple-300";case"faq":return"bg-orange-900 text-orange-300";case"article":return"bg-teal-900 text-teal-300";case"blog":return"bg-indigo-900 text-indigo-300";default:return"bg-gray-700 text-gray-300"}};if(ue)return e.jsx(Oe,{message:"Loading articles...",fullPage:!0});const Te=window.innerWidth<768;return e.jsx(Ee,{theme:de,children:e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"card-gradient  shadow-md px-4 pt-4 pb-0 mb-2 border-left-0 border-top-0 border-right-0",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{className:" mt-2",children:[e.jsx("h1",{className:"text-2xl sm:text-2xl font-semibold text-whitetext-xl font-semibold text-white",children:"Knowledge Base Management"}),e.jsx("p",{className:"text-gray-400 mt-1 mr-6",children:"Manage articles, guides, and FAQs for the client Learn page"})]}),e.jsxs(N,{variant:"contained",className:"btn-primary text-white",style:{backgroundColor:"var(--surface-1)",color:"var(--text-strong)",borderColor:"var(--surface-1)","&:hover":{backgroundColor:"var(--surface-1)",color:"var(--text-strong)",borderColor:"var(--surface-1)"}},onClick:()=>{!ne&&oe?D(!0):K()},children:[Te?e.jsx(e.Fragment,{}):e.jsx(Se,{className:"mr-2"}),"Add Article"]})]}),e.jsx("div",{className:"mt-6 mb-6",children:e.jsxs("div",{className:"flex flex-wrap gap-4 items-center",children:[e.jsx("div",{className:"flex-1 bg-gray-800/50 rounded-lg px-2 py-1 border border-gray-700",children:e.jsx(h,{placeholder:"Search articles...",value:T,onChange:a=>xe(a.target.value),InputProps:{startAdornment:e.jsx(_e,{className:"mr-2 text-gray-400"})},size:"small",sx:{"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"none"}}})}),e.jsx("div",{className:"flex items-center bg-gray-800/50 rounded-lg px-3 py-1.5 border border-gray-700",children:e.jsxs("select",{value:W,onChange:a=>pe(a.target.value),className:"bg-transparent text-gray-300 text-sm font-medium border-none focus:outline-none cursor-pointer p-2",children:[e.jsx("option",{value:"all",children:"All Categories"},"all"),_.map(a=>e.jsx("option",{value:a.value,className:"bg-gray-800 text-gray-300",children:a.label},a.value))]})}),e.jsx("div",{className:"flex items-center bg-gray-800/50 rounded-lg px-3 py-1.5 border border-gray-700",children:e.jsxs("select",{value:L,onChange:a=>ge(a.target.value),className:"bg-transparent text-gray-300 text-sm font-medium border-none focus:outline-none cursor-pointer p-2",children:[e.jsx("option",{value:"all",children:"All Types"},"all"),P.map(a=>e.jsx("option",{value:a.value,className:"bg-gray-800 text-gray-300",children:a.label},a.value))]})})]})})]}),U.length===0?e.jsx("div",{className:"card-gradient rounded-xl shadow-md m-6",children:e.jsxs("div",{className:"text-center py-8",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"mx-auto mb-4 text-gray-500",children:[e.jsx("path",{d:"M12 2v8"}),e.jsx("path",{d:"m4.93 10.93 1.41 1.41"}),e.jsx("path",{d:"M2 18h2"}),e.jsx("path",{d:"M20 18h2"}),e.jsx("path",{d:"m19.07 10.93-1.41 1.41"}),e.jsx("path",{d:"M22 22H2"}),e.jsx("path",{d:"m16 6-4 4-4-4"}),e.jsx("path",{d:"M16 18a4 4 0 0 0-8 0"})]}),e.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No Learning Articles Added"}),e.jsx("p",{className:"text-gray-400 mb-6 max-w-md mx-auto",children:"To add a learning article, click Add Article above."})]})}):e.jsx("div",{className:"bg-gray-800 rounded-lg shadow-lg border border-gray-700 overflow-hidden m-6",children:e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-900 border-b border-gray-700",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Title"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Category"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Tags"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Read Time"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Access"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-gray-800 divide-y divide-gray-700",children:J.map(a=>{var t,l;return e.jsxs("tr",{className:"hover:bg-gray-700 transition-colors duration-150",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-white",children:a.title}),e.jsx("div",{className:"text-sm text-gray-400 truncate max-w-xs",children:a.description})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Z(a.category)}`,children:((t=_.find(c=>c.value===a.category))==null?void 0:t.label)||a.category})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${ee(a.type)}`,children:((l=P.find(c=>c.value===a.type))==null?void 0:l.label)||a.type})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[j(a.tags).slice(0,2).map((c,u)=>e.jsx("span",{className:"inline-flex px-2 py-1 text-xs bg-gray-700 text-gray-300 rounded",children:c},u)),j(a.tags).length>2&&e.jsxs("span",{className:"text-xs text-gray-400",children:["+",j(a.tags).length-2," more"]})]})}),e.jsx("td",{className:"px-6 py-4 text-sm text-gray-300",children:a.readTime||"N/A"}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${a.enabled!==!1?"bg-green-900 text-green-300":"bg-red-900 text-red-300"}`,children:a.enabled!==!1?"Published":"Draft"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${a.access==="both"?"bg-blue-900 text-blue-300":a.access==="client"?"bg-purple-900 text-purple-300":"bg-indigo-900 text-indigo-300"}`,children:a.access==="both"?"Both":a.access==="client"?"Client Only":"Admin Only"})}),e.jsx("td",{className:"px-6 py-4 text-sm font-medium",children:e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("button",{onClick:()=>we(a),className:"text-blue-400 hover:text-blue-300",title:"View",children:e.jsx(Pe,{})}),e.jsx("button",{onClick:()=>K(a),className:"text-indigo-400 hover:text-indigo-300",title:"Edit",children:e.jsx(Me,{})}),e.jsx("button",{onClick:()=>ve(a.id),className:"text-red-400 hover:text-red-300",title:"Delete",children:e.jsx(Fe,{})})]})})]},a.id)})})]}),J.length===0&&e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-gray-400",children:"No articles found matching your criteria."})})]})}),e.jsx(Le,{isOpen:ce,title:"Business Information Required",subtitle:"We need your Business N
1ame to Continue",blurb:"You need to complete your business profile before adding a Learning Article. This includes setting up your business prefix and essential company information.",onClose:()=>D(!1),displayWhatWeNeed:!1}),e.jsx(le,{isOpen:he,onClose:E,title:o?"Edit Article":"Create New Article",maxWidthClass:"max-w-7xl",bodyClassName:"p-6 overflow-y-auto max-h-[80vh]",footer:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:E,className:"btn-secondary px-4 py-2",children:"Cancel"}),e.jsx("button",{type:"button",onClick:a=>{const t=document.getElementById("admin-learn-form");t&&t.requestSubmit()},className:"btn-primary px-4 py-2",children:o?"Update":"Create"})]}),children:e.jsxs("form",{id:"admin-learn-form",onSubmit:je,className:"space-y-4",children:[e.jsx(h,{fullWidth:!0,label:"Title",value:i.title,onChange:a=>{const t=a.target.value,l=o?i.permalink:ye(t);n(c=>({...c,title:t,permalink:l}))},required:!0}),e.jsx(h,{fullWidth:!0,label:"Description",value:i.description,onChange:a=>n(t=>({...t,description:a.target.value})),multiline:!0,rows:2,required:!0}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Content *"}),e.jsx("div",{className:"bg-white rounded-lg overflow-auto",style:{height:"400px"},children:e.jsx(We,{value:i.content,onChange:a=>n(t=>({...t,content:a})),placeholder:"Write your article content here...",theme:"light"})})]}),e.jsx(h,{fullWidth:!0,label:"Permalink",value:i.permalink,InputProps:{readOnly:!0,sx:{color:"#9ca3af"}},helperText:o?"Permalink cannot be modified after article creation":"Generated from title - this will be used in the article URL",FormHelperTextProps:{sx:{color:"#6b7280"}}}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs(M,{fullWidth:!0,children:[e.jsx(F,{children:"Category"}),e.jsx(O,{value:i.category,onChange:a=>n(t=>({...t,category:a.target.value})),label:"Category",children:_.map(a=>e.jsx(k,{value:a.value,children:a.label},a.value))})]}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(F,{children:"Type"}),e.jsx(O,{value:i.type,onChange:a=>n(t=>({...t,type:a.target.value})),label:"Type",children:P.map(a=>e.jsx(k,{value:a.value,children:a.label},a.value))})]})]}),e.jsx(h,{fullWidth:!0,label:"Read Time (e.g., '5 min')",value:i.readTime,onChange:a=>n(t=>({...t,readTime:a.target.value}))}),e.jsx(h,{fullWidth:!0,label:"Video URL (optional)",value:i.video_url,onChange:a=>n(t=>({...t,video_url:a.target.value}))}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Tags"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(h,{size:"small",placeholder:"Add a tag",value:A,onChange:a=>V(a.target.value),onKeyPress:a=>a.key==="Enter"&&(a.preventDefault(),Y())}),e.jsx(N,{onClick:Y,variant:"outlined",size:"small",children:"Add"})]}),e.jsx(re,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:i.tags.map((a,t)=>e.jsx(ie,{label:a,onDelete:()=>Ne(a),size:"small"},t))})]}),o&&e.jsxs("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-900",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Hero Image"}),G?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"relative rounded-lg overflow-hidden border border-gray-700",children:e.jsx("img",{src:G,alt:"Hero preview",className:"w-full h-64 object-cover"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{onClick:ke,disabled:I,variant:"outlined",color:"error",size:"small",fullWidth:!0,children:I?"Removing...":"Remove Image"}),e.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif,image/webp",onChange:X,style:{display:"none"},id:"hero-image-replace"}),e.jsx("label",{htmlFor:"hero-image-replace",style:{width:"100%"},children:e.jsx(N,{component:"span",variant:"outlined",size:"small",fullWidth:!0,children:"Replace Image"})})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif,image/webp",onChange:X,style:{display:"none"},id:"hero-image-upload"}),e.jsx("label",{htmlFor:"hero-image-upload",children:e.jsxs("div",{className:"border-2 border-dashed border-gray-700 rounded-lg p-8 text-center hover:border-teal-500 transition-colors cursor-pointer",children:[e.jsx("div",{className:"text-gray-400 mb-2",children:e.jsx("svg",{className:"mx-auto h-12 w-12 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),e.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"Click to upload hero image"}),e.jsx("p",{className:"text-xs text-gray-500",children:"JPEG, PNG, GIF, or WebP (Max 5MB)"})]})}),f&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 text-sm text-gray-400 truncate bg-gray-800 px-3 py-2 rounded",children:f.name}),e.jsx(N,{onClick:Ce,disabled:I,variant:"contained",size:"small",children:I?"Uploading...":"Upload"}),e.jsx(N,{onClick:()=>{b(null),y(null)},variant:"outlined",size:"small",children:"Cancel"})]})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:o.id?"Recommended image size: 1200x630px":"Save the article first to upload a hero image"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs(M,{fullWidth:!0,children:[e.jsx(F,{children:"Status"}),e.jsxs(O,{value:i.enabled,onChange:a=>n(t=>({...t,enabled:a.target.value})),label:"Status",children:[e.jsx(k,{value:!0,children:"Published"}),e.jsx(k,{value:!1,children:"Draft"})]})]}),e.jsxs(M,{fullWidth:!0,children:[e.jsx(F,{children:"Access"}),e.jsx(O,{value:i.access,onChange:a=>n(t=>({...t,access:a.target.value})),label:"Access",children:Q.map(a=>e.jsx(k,{value:a.value,children:a.label},a.value))})]})]})]})}),e.jsx(le,{isOpen:fe,onClose:()=>q(!1),title:(s==null?void 0:s.title)||"View Article",maxWidthClass:"max-w-3xl",children:s&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Description"}),e.jsx("p",{className:"text-gray-300",children:s.description})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Content"}),e.jsx("div",{className:"text-gray-300 whitespace-pre-wrap",children:s.content})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Category"}),e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Z(s.category)}`,children:((ae=_.find(a=>a.value===s.category))==null?void 0:ae.label)||s.category})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Type"}),e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${ee(s.type)}`,children:((te=P.find(a=>a.value===s.type))==null?void 0:te.label)||s.type})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Access"}),e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${s.access==="both"?"bg-blue-900 text-blue-300":s.access==="client"?"bg-purple-900 text-purple-300":"bg-indigo-900 text-indigo-300"}`,children:((se=Q.find(a=>a.value===s.access))==null?void 0:se.label)||"Both Client & Admin"})]})]}),j(s.tags).length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Tags"}),e.jsx(re,{sx:{display:"flex",flexWrap:"wrap",gap:1,mt:1},children:j(s.tags).map((a,t)=>e.jsx(ie,{label:a,size:"small"},t))})]}),s.video_url&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Video URL"}),e.jsx("div",{className:"flex items-center mt-1 bg-gray-800 rounded p-2 border border-gray-700",children:e.jsx("span",{className:"text-gray-400 text-sm font-mono break-all",children:s.video_url})})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-white",children:"Permalink"}),e.jsx("div",{className:"flex items-center mt-1 bg-gray-800 rounded p-2 border border-gray-700",children:e.jsx("span",{className:"text-gray-400 text-sm font-mono",children:s.permalink})})]})]})})]})})}export{da 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.