1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[960],{607:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(4232);let r=a.forwardRef(function(e,t){let{title:s,titleId:r,...l}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},l),s?a.createElement("title",{id:r},s):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))})},1457:(e,t,s)=>{"use strict";s.d(t,{LZ:()=>n,Wy:()=>l,wR:()=>i,xq:()=>o});let a={NEWS:"news",ARTICLES:"articles",INFOGRAPHIC:"infographic",COVER_STORY:"cover-story",EVENTS:"events",MAGAZINE:"magazine"},r={NEWS:{LOCAL_GOVERNMENT:"local-government",POLICY_GOVERNANCE:"policy-governance",URBAN_INFRASTRUCTURE:"urban-infrastructure",CIVIC_SERVICES:"civic-services",CLIMATE_CHANGE:"climate-change",INTERNATIONAL:"international"},ARTICLES:{EDITORIALS:"editorials",LEADERSPEAK:"leaderspeak",EXPERT_COLUMNS:"expert-columns",OPINION:"opinion"},INFOGRAPHIC:{},COVER_STORY:{},EVENTS:{UPCOMING_EVENTS:"upcoming-events",ACS_SUMMIT:"acs-summit",URBAN_DIALOGUES:"urban-dialogues",PHOTO_GALLERY:"photo-gallery"},MAGAZINE:{URBAN_UPDATE:"urban-update",E_NEWSLETTERS:"e-newsletters"}},l=e=>!e||"general"===e.toLowerCase(),i=e=>"policy-governance"===e?"Policy & Governance":"e-newsletters"===e?"E-Newsletters":e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),n=Object.values(a),o=Object.keys(r).reduce((e,t)=>(e[a[t]]=Object.values(r[t]),e),{})},3532:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(4232);let r=a.forwardRef(function(e,t){let{title:s,titleId:r,...l}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},l),s?a.createElement("title",{id:r},s):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))})},5395:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(4232);let r=a.forwardRef(function(e,t){let{title:s,titleId:r,...l}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},l),s?a.createElement("title",{id:r},s):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})},5613:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(4232);let r=a.forwardRef(function(e,t){let{title:s,titleId:r,...l}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},l),s?a.createElement("title",{id:r},s):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})},8820:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/cms/admin/assignments",function(){return s(9927)}])},9363:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(4232);let r=a.forwardRef(function(e,t){let{title:s,titleId:r,...l}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},l),s?a.createElement("title",{id:r},s):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))})},9927:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var a=s(7876),r=s(4232);s(8230);var l=s(4587),i=s.n(l),n=s(5395),o=s(5613),d=s(9363),c=s(607),g=s(3532),u=s(6822),x=s(1457),m=s(4559);let h=e=>{let{className:t="w-5 h-5"}=e;return(0,a.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})},p=e=>{let{className:t="w-5 h-5"}=e;return(0,a.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})})},v=()=>{let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)([]),[v,f]=(0,r.useState)(!0),[b,w]=(0,r.useState)(null),[j,y]=(0,r.useState)(""),[N,k]=(0,r.useState)("all"),[A,C]=(0,r.useState)("all"),[E,L]=(0,r.useState)([]),[S,R]=(0,r.useState)(!0),[I,T]=(0,r.useState)({}),[O,B]=(0,r.useState)({}),[M,_]=(0,r.useState)([]),[W,U]=(0,r.useState)(""),[G,P]=(0,r.useState)(!1),V=async()=>{try{f(!0),w(null);let e=await m.WT.list({size:100,status:"submitted"}),s=await m.WT.list({size:100,status:"assigned"}),a=[...e.articles,...s.articles];t(a)}catch(e){w((null==e?void 0:e.message)||"Failed to load articles")}finally{f(!1)}},z=async()=>{try{R(!0);let e=await m.dG.list({role:"editor"});L(e);let t=await m.dG.list(),s={};for(let e of t)s[e.id]=e.name||e.email||e.id;T(s)}catch(e){}finally{R(!1)}};(0,r.useEffect)(()=>{V(),z()},[]),(0,r.useEffect)(()=>{let t=e;"all"!==N&&(t=t.filter(e=>e.status===N)),"all"!==A&&(t=t.filter(e=>e.category===A)),j&&(t=t.filter(e=>{var t,s,a,r;return(null==(t=e.title)?void 0:t.toLowerCase().includes(j.toLowerCase()))||(null==(s=e.intro)?void 0:s.toLowerCase().includes(j.toLowerCase()))||(null==(r=e.author)||null==(a=r.name)?void 0:a.toLowerCase().includes(j.toLowerCase()))})),l(t),_(e=>e.filter(e=>t.some(t=>t.id===e)))},[e,N,A,j]);let Z=(0,r.useMemo)(()=>[...new Set(e.map(e=>
1e.category).filter(Boolean))].sort(),[e]),F=async(e,s)=>{if(s){B(t=>({...t,[e]:{status:"assigning",editorId:s}}));try{let a=localStorage.getItem("userId");await m.WT.update(e,{status:"assigned",assignedBy:a,approverId:s});let r=E.find(e=>e.id===s);t(t=>t.map(t=>t.id===e?{...t,status:"assigned",assignedBy:a,approver:r?{userId:s,name:r.name}:{userId:s}}:t)),B(t=>({...t,[e]:{status:"assigned",editorId:s}}))}catch(t){B(t=>({...t,[e]:void 0})),w("Failed to assign editor")}}},H=async()=>{if(W&&0!==M.length){P(!0);try{let e=localStorage.getItem("userId");await Promise.all(M.map(t=>m.WT.update(t,{status:"assigned",assignedBy:e,approverId:W})));let s=E.find(e=>e.id===W);t(t=>t.map(t=>M.includes(t.id)?{...t,status:"assigned",assignedBy:e,approver:s?{userId:W,name:s.name}:{userId:W}}:t)),B(e=>{let t={...e};return M.forEach(e=>{t[e]={status:"assigned",editorId:W}}),t}),_([]),U("")}catch(e){w("Failed to bulk assign articles")}finally{P(!1)}}},Y=e=>{_(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},D=e=>({submitted:"bg-yellow-100 text-yellow-800",assigned:"bg-blue-100 text-blue-800"})[e]||"bg-gray-100 text-gray-800",X=e=>e&&"string"==typeof e?e.length<=10?e:"".concat(e.slice(0,6),"â¦").concat(e.slice(-4)):"-",q=e=>["submitted","assigned"].includes(e),K=e=>e?e.charAt(0).toUpperCase()+e.slice(1):e,J=e.filter(e=>"submitted"===e.status).length,Q=e.filter(e=>"assigned"===e.status).length,$=[{name:"Submitted (Awaiting Assignment)",value:v?"...":J,icon:n.A,gradient:"from-yellow-500 to-orange-600",iconBg:"bg-yellow-100",iconColor:"text-yellow-600"},{name:"Currently Assigned",value:v?"...":Q,icon:o.A,gradient:"from-blue-500 to-indigo-600",iconBg:"bg-blue-100",iconColor:"text-blue-600"},{name:"Available Editors",value:S?"...":E.length,icon:d.A,gradient:"from-green-500 to-emerald-600",iconBg:"bg-green-100",iconColor:"text-green-600"}];return(0,a.jsx)(u.A,{userType:"admin",children:(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsx)("div",{className:"bg-gradient-to-r from-indigo-600 via-purple-600 to-pink-600 rounded-2xl shadow-xl p-8 text-white",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"bg-white/20 backdrop-blur-sm p-3 rounded-xl",children:(0,a.jsx)(c.A,{className:"w-8 h-8 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold",children:"Article Assignments"}),(0,a.jsx)("p",{className:"text-indigo-100 mt-1",children:"Assign articles to editors for review and approval"})]})]})}),(0,a.jsx)("div",{className:"hidden lg:flex items-center gap-6",children:(0,a.jsx)("div",{className:"relative w-24 h-24 opacity-90",children:(0,a.jsx)(i(),{src:"https://d1w9ndzbu7z2ut.cloudfront.net/Full%20Red%20Logo.jpg",alt:"Urban Update Logo",fill:!0,className:"object-contain",priority:!0})})})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("h3",{className:"text-2xl font-bold text-gray-900",children:"Assignment Overview"})}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3",children:$.map(e=>(0,a.jsxs)("div",{className:"group relative bg-white rounded-xl shadow-md hover:shadow-xl transition-all duration-300 overflow-hidden cursor-pointer transform hover:-translate-y-1",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br ".concat(e.gradient," opacity-0 group-hover:opacity-5 transition-opacity duration-300")}),(0,a.jsxs)("div",{className:"p-6 relative",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsx)("div",{className:"".concat(e.iconBg," p-3 rounded-xl"),children:(0,a.jsx)(e.icon,{className:"w-6 h-6 ".concat(e.iconColor)})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-600 mb-1",children:e.name}),(0,a.jsx)("p",{className:"text-3xl font-bold text-gray-900",children:e.value})]}),(0,a.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-gradient-to-r ".concat(e.gradient," transform scale-x-0 group-hover:scale-x-100 transition-transform duration-300")})]})]},e.name))})]}),b&&(0,a.jsx)("div",{className:"bg-red-50 border-l-4 border-red-500 p-4 rounded-lg",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)(g.A,{className:"h-5 w-5 text-red-400"})}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Error"}),(0,a.jsx)("div",{className:"mt-2 text-sm text-red-700",children:b})]})]})}),(0,a.jsxs)("div",{className:"bg-white rounded-xl shadow-md p-6 border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex flex-col lg:flex-row gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 relative group",children:[(0,a.jsx)("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:(0,a.jsx)(h,{className:"text-gray-400 group-focus-within:text-indigo-500 transition-colors duration-200"})}),(0,a.jsx)("input",{type:"text",placeholder:"Search by title, intro, or author...",value:j,onChange:e=>y(e.target.value),className:"block w-full pl-12 pr-10 py-3 border-2 border-gray-200 rounded-xl leading-5 bg-gray-50 placeholder-gray-400 text-gray-700 font-medium hover:bg-white hover:border-gray-300 focus:outline-none focus:bg-white focus:placeholder-gray-400 focus:ring-2 focus:ring-indigo-100 focus:border-indigo-500 transition-all duration-200"}),j&&(0,a.jsx)("button",{onClick:()=>y(""),className:"absolute inset-y-0 right-0 pr-4 flex items-center text-gray-400 hover:text-gray-600 transition-colors duration-200",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsx)("div",{className:"lg:w-56",children:(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsx)("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:(0,a.jsx)(p,{className:"text-gray-400 group-focus-within:text-indigo-500 transition-colors duration-200"})}),(0,a.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"block w-full pl-12 pr-10 py-3 border-2 border-gray-200 rounded-xl leading-5 bg-gray-50 text-gray-700 font-medium hover:bg-white hover:border-gray-300 focus:outline-none focus:bg-white focus:ring-2 focus:ring-indigo-100 focus:border-indigo-500 transition-all duration-200 appearance-none cursor-pointer",children:[(0,a.jsxs)("option",{value:"all",children:["All Status (",e.length,")"]}),(0,a.jsxs)("option",{value:"submitted",children:["Submitted (",e.filter(e=>"submitted"===e.status).length,")"]}),(0,a.jsxs)("option",{value:"assigned",children:["Assigned (",e.filter(e=>"assigned"===e.status).length,")"]})]}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 pr-4 flex items-center text-gray-400 group-focus-within:text-indigo-500 transition-colors duration-200",children:(0,a.jsx)("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.08 1.04l-4.25 4.25a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})})]})}),(0,a.jsx)("div",{className:"lg:w-56",children:(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsx)("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-gray-400 group-focus-within:text-indigo-500 transition-colors duration-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}),(0,a.jsxs)("select",{value:A,onChange:e=>C(e.target.value),className:"block w-full pl-12 pr-10 py-3 border-2 border-gray-200 rounded-xl leading-5 bg-gray-50 text-gray-700 font-medium hover:bg-white hover:border-gray-300 focus:outline-none focus:bg-white focus:ring-2 focus:ring-indigo-100 focus:border-indigo-500 transition-all duration-200 appearance-none cursor-pointer",children:[(0,a.jsx)("option",{value:"all",children:"All Categories"}),Z.map(t=>(0,a.jsxs)("option",{value:t,children:[K(t)," (",e.filter(e=>e.category===t).length,")"]},t))]}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 pr-4 flex items-center text-gray-400 group-focus-within:text-indigo-500 transition-colors duration-200",children:(0,a.jsx)("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.08 1.04l-4.25 4.25a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})})]})})]}),("all"!==N||"all"!==A||j)&&(0,a.jsxs)("div",{className:"mt-4 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm text-gray-600 font-medium",children:"Active filters:"}),"all"!==N&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-medium bg-indigo-100 text-indigo-700",children:["Status: ",K(N),(0,a.jsx)("button",{onClick:()=>k("all"),className:"ml-1 hover:text-indigo-900",children:"\xd7"})]}),"all"!==A&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-700",children:["Category: ",K(A),(0,a.jsx)("button",{onClick:()=>C("all"),className:"ml-1 hover:text-purple-900",children:"\xd7"})]}),j&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-700",children:["Search: ",j,(0,a.jsx)("button",{onClick:()=>y(""),className:"ml-1 hover:text-blue-900",children:"\xd7"})]}),(0,a.jsx)("button",{onClick:()=>{k("all"),C("all"),y("")},className:"text-sm text-gray-600 hover:text-gray-900 underline",children:"Clear all"})]})]}),M.length>0&&(0,a.jsx)("div",{className:"bg-gradient-to-r from-indigo-600 to-purple-600 rounded-xl shadow-lg p-6 border-2 border-indigo-400",children:(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1",children:[(0,a.jsx)("div",{className:"bg-white/20 backdrop-blur-sm p-2 rounded-lg",children:(0,a.jsx)(o.A,{className:"h-6 w-6 text-white"})}),(0,a.jsxs)("div",{className:"text-white",children:[(0,a.jsxs)("p",{className:"font-bold text-lg",children:[M.length," Article",1!==M.length?"s":""," Selected"]}),(0,a.jsx)("p",{className:"text-indigo-100 text-sm",children:"Assign all selected articles to an editor"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 w-full md:w-auto",children:[(0,a.jsxs)("div",{className:"relative flex-1 md:flex-initial md:w-68",children:[(0,a.jsxs)("select",{value:W,onChange:e=>U(e.target.value),className:"block w-full text-black px-4 py-2.5 pr-10 rounded-lg border-2 border-white bg-white shadow-sm focus:border-indigo-300 focus:ring-2 focus:ring-white appearance-none font-medium",disabled:S||G,children:[(0,a.jsx)("option",{value:"",children:"Select editor for bulk assign"}),E.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsx)("svg",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 011.08 1.04l-4.25 4.25a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]}),(0,a.jsx)("button",{onClick:H,disabled:!W||G,className:"inline-flex items-center gap-2 px-6 py-2.5 bg-white text-indigo-600 font-semibold rounded-lg hover:bg-indigo-50 transition-all duration-200 shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",children:G?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-indigo-600 border-t-transparent"}),"Assigning..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{className:"h-5 w-5"}),"Assign All"]})}),(0,a.jsx)("button",{onClick:()=>_([]),className:"px-4 py-2.5 bg-white/20 backdrop-blur-sm border border-white/30 text-white font-medium rounded-lg hover:bg-white/30 transition-all duration-200",children:"Clear"})]})]})}),(0,a.jsxs)("div",{className:"bg-white shadow-lg rounded-2xl overflow-hidden border border-gray-100",children:[(0,a.jsx)("div",{className:"bg-gradient-to-r from-gray-50 to-gray-100 px-6 py-5 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"bg-indigo-600 p-2 rounded-lg",children:(0,a.jsx)(c.A,{className:"w-5 h-5 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-xl font-bold text-gray-900",children:[s.length," Article",1!==s.length?"s":""," to Assign"]}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Submitted and assigned articles. You can assign or reassign editors here."})]})]}),s.length>0&&s.length!==e.length&&(0,a.jsxs)("span",{className:"text-sm text-gray-600",children:["Showing ",s.length," of ",e.length," total"]})]})}),(0,a.jsx)("div",{className:"",children:v?(0,a.jsxs)("div",{className:"flex flex-col justify-center items-center py-12",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-indigo-600 border-t-transparent"}),(0,a.jsx)("p",{className:"mt-4 text-sm text-gray-600",children:"Loading assignments..."})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3 text-left",children:(0,a.jsx)("input",{type:"checkbox",checked:s.length>0&&M.length===s.length,onChange:()=>{M.length===s.length?_([]):_(s.map(e=>e.id))},className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded cursor-pointer"})}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Title"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Category"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Author"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Currently Assigned To"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Assign to Editor"})]})}),(0,a.jsxs)("tbody",{className:"bg-white divide-y divide-gray-200",children:[s.map(e=>{var t,s,r,l,i;let n=O[e.id],o=(null==n?void 0:n.status)==="assigning",d=(null==e||null==(t=e.approver)?void 0:t.userId)||"",c=null!=(i=null==n?void 0:n.editorId)?i:d;return(0,a.jsxs)("tr",{className:"hover:bg-gray-50 ".concat(M.includes(e.id)?"bg-indigo-50":""),children:[(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,a.jsx)("input",{type:"checkbox",checked:M.includes(e.id),onChange:()=>Y(e.id),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded cursor-pointer"})}),(0,a.jsxs)("td",{className:"px-6 py-4 max-w-xs",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",title:e.title,children:e.title}),(0,a.jsxs)("div",{className:"text-sm text-gray-500 truncate",children:[null==(s=e.intro)?void 0:s.substring(0,60),"..."]})]}),(0,a.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap",children:[(0,a.jsx)("div",{className:"text-sm text-gray-900",children:K(e.category)}),e.subCategory&&!(0,x.Wy)(e.subCategory)&&(0,a.jsx)("div",{className:"text-xs text-gray-500",ch
1ildren:K(e.subCategory)})]}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat(D(e.status)),children:K(e.status)})}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:K(null==(r=e.author)?void 0:r.name)||"Unknown"}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:K(null==e||null==(l=e.approver)?void 0:l.name)||((null==e?void 0:e.assignedBy)?K(I[e.assignedBy])||X(e.assignedBy):"-")}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsxs)("select",{className:"block w-44 py-2.5 pl-4 pr-10 text-sm font-medium rounded-lg border-2 appearance-none transition-all duration-200 cursor-pointer\n ".concat(S||o||!q(e.status)?"bg-gray-100 border-gray-200 text-gray-400 cursor-not-allowed":c?"bg-indigo-50 border-indigo-300 text-indigo-700 hover:border-indigo-400 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200":"bg-white border-gray-300 text-gray-700 hover:border-indigo-400 hover:bg-gray-50 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200"),disabled:S||o||!q(e.status),value:c,onChange:t=>F(e.id,t.target.value),children:[(0,a.jsx)("option",{value:"",children:S?"â³ Loading...":"\uD83D\uDC64 Select editor"}),!S&&E.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsx)("div",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 transition-colors duration-200 ".concat(S||o||!q(e.status)?"text-gray-300":"text-gray-500 group-hover:text-indigo-500"),children:(0,a.jsx)("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.08 1.04l-4.25 4.25a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})})]}),o&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-indigo-50 rounded-full",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-indigo-600 border-t-transparent"}),(0,a.jsx)("span",{className:"text-xs font-medium text-indigo-600",children:"Assigning..."})]})]})})]},e.id)}),0===s.length&&(0,a.jsx)("tr",{children:(0,a.jsxs)("td",{colSpan:7,className:"px-6 py-12 text-center",children:[(0,a.jsx)("div",{className:"mx-auto w-24 h-24 bg-gray-100 rounded-full flex items-center justify-center mb-4",children:(0,a.jsx)(c.A,{className:"h-12 w-12 text-gray-400"})}),(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:j||"all"!==N||"all"!==A?"No articles found":"No articles to assign"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:j||"all"!==N||"all"!==A?"Try adjusting your filters or search query":"There are currently no submitted articles awaiting assignment."})]})})]})]})})})]})]})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[230,587,559,822,636,593,792],()=>t(8820)),_N_E=e.O()}]);
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.