const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ReportPage-BH0iEKUw.js","./vendor-element-B5S5pUKo.js","./vendor-vue-CVxSw_oJ.js","./vendor-misc-BeoNyvBp.js","./vendor-element-C68yOrAy.css","./email-DaWcU8Ml.js","./tasks-suSBBmw0.js","./system-EPeBJB57.js","./MetricGrid-Df-Dlkt_.js","./MetricGrid-yP_dkP6X.css","./vendor-axios-B9ygI19o.js","./ReportPage-DN5YlEZa.css","./UsersPage-70roiEdR.js","./users-D8nCLsxD.js","./UsersPage-Cow_LicY.css","./FeedbacksPage-Bm8Gi6uF.js","./FeedbacksPage-mrXjCiV2.css","./LogsPage-BXJhmaAD.js","./LogsPage-D1bozCEo.css","./AnnouncementsPage-Bt9ScJoU.js","./AnnouncementsPage-DOwZaaOu.css","./EmailPage-lCqi22rV.js","./EmailPage-BmPCDPYC.css","./SecurityPage-BINdqm-Z.js","./SecurityPage-DN76ndc_.css","./SystemPage-BOHCIy1Q.js","./SystemPage-DYBocGi2.css","./SettingsPage-Bb497CTW.js","./SettingsPage-DaB8PeRL.css"])))=>i.map(i=>d[i]); import{aj as f,D as E,q as _,ax as pe,ay as _e,r as L,c as z,o as he,R as ye,E as o,G as W,L as d,t as u,n as V,K as X,a3 as J,H as Q,J as x,I as Z,az as ge,p as M,aA as be,aB as ve,as as we}from"./vendor-vue-CVxSw_oJ.js";import{E as ae,a as se,d as Ee,u as ke,c as Te,l as Pe,b as Se,m as Re,e as Ae,t as Le,s as xe,i as Oe,z as Ne}from"./vendor-element-B5S5pUKo.js";import{a as Be}from"./vendor-axios-B9ygI19o.js";import"./vendor-misc-BeoNyvBp.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const oe=(e,t)=>{const n=e.__vccOpts||e;for(const[a,s]of t)n[a]=s;return n},De={};function Ce(e,t){const n=f("RouterView");return _(),E(n)}const Ve=oe(De,[["render",Ce]]),Ie="modulepreload",Me=function(e,t){return new URL(e,t).href},ee={},k=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let R=function(p){return Promise.all(p.map(b=>Promise.resolve(b).then(P=>({status:"fulfilled",value:P}),P=>({status:"rejected",reason:P}))))};const c=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),T=m?.nonce||m?.getAttribute("nonce");s=R(n.map(p=>{if(p=Me(p,a),p in ee)return;ee[p]=!0;const b=p.endsWith(".css"),P=b?'[rel="stylesheet"]':"";if(a)for(let S=c.length-1;S>=0;S--){const v=c[S];if(v.href===p&&(!b||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${P}`))return;const h=document.createElement("link");if(h.rel=b?"stylesheet":Ie,b||(h.as="script"),h.crossOrigin="",h.href=p,T&&h.setAttribute("nonce",T),document.head.appendChild(h),b)return new Promise((S,v)=>{h.addEventListener("load",S),h.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(c){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=c,window.dispatchEvent(m),!m.defaultPrevented)throw c}return s.then(c=>{for(const m of c||[])m.status==="rejected"&&i(m.reason);return t().catch(i)})};let te="",ne=0;const $e=new Set([408,425,429,500,502,503,504]),Fe=1,qe=300;function O(e,t,n=1500){const a=Date.now();e===te&&a-ne=Fe)return!1;const a=String(e?.code||"");if(a==="ECONNABORTED"||a==="ERR_NETWORK")return!0;const s=Number(e?.response?.status||0);return $e.has(s)}function He(e){return new Promise(t=>{window.setTimeout(t,Math.max(0,Number(e||0)))})}async function Ke(e,t){const n=e?.config||{},a=Number(n.__retry_count||0);n.__retry_count=a+1;const s=qe*(a+1);return await He(s),t.request(n)}const y=Be.create({baseURL:"/yuyx/api",timeout:3e4,withCredentials:!0});let N=null;async function Ye(){return N||(N=ae.prompt("请输入管理员密码进行二次确认","安全确认",{inputType:"password",inputPlaceholder:"管理员密码",confirmButtonText:"确认",cancelButtonText:"取消",inputValidator:e=>!!String(e||"").trim(),inputErrorMessage:"密码不能为空"}).then(async e=>{const t=String(e.value||"").trim();await y.post("/admin/reauth",{password:t}),se.success("已通过安全确认")}).finally(()=>{N=null}),N)}y.interceptors.request.use(e=>{const t=String(e?.method||"GET").toUpperCase();if(!["GET","HEAD","OPTIONS"].includes(t)){const n=Ue("csrf_token");n&&(e.headers=e.headers||{},e.headers["X-CSRF-Token"]=n)}return e});y.interceptors.response.use(e=>e,async e=>{const t=e?.response?.status,n=e?.response?.data,a=n?.error||n?.message||e?.message||"请求失败";if(n?.code==="reauth_required"&&e?.config&&!e.config.__reauth_retry)try{return e.config.__reauth_retry=!0,await Ye(),y.request(e.config)}catch{return Promise.reject(e)}return Ge(e)?Ke(e,y):(t===401?(O("401",a,3e3),(window.location?.pathname||"").startsWith("/yuyx")||(window.location.href="/yuyx")):t===403?O("403",a,5e3):t?O(`http:${t}:${a}`,a):e?.code==="ECONNABORTED"?O("timeout","请求超时",3e3):O(`net:${a}`,a,3e3),Promise.reject(e))});let B=null;async function Tt(e=""){const{data:t}=await y.get("/feedbacks",{params:e?{status:e}:{}});return t}async function ze(){return B||(B=y.get("/feedbacks",{params:{limit:1,offset:0}}).then(({data:e})=>e?.stats).finally(()=>{B=null}),B)}async function Pt(e,t){const{data:n}=await y.post(`/feedbacks/${e}/reply`,{reply:t});return n}async function St(e){const{data:t}=await y.post(`/feedbacks/${e}/close`);return t}async function Rt(e){const{data:t}=await y.delete(`/feedbacks/${e}`);return t}const w={value:null,expiresAt:0,inflight:null},We=2e3;async function Xe(e={}){const t=!!e?.force,n=Date.now();if(!t&&w.value&&n(w.value=s,w.expiresAt=Date.now()+We,s)).finally(()=>{w.inflight=null});return w.inflight=a,a}const Je={class:"menu-label"},Qe={key:1,class:"menu-label"},Ze={class:"header-left"},et={class:"header-right"},tt={class:"admin-name"},nt={class:"main-shell"},at={class:"menu-label"},st={key:1,class:"menu-label"},ot=6e4,rt=18e4,lt={__name:"AdminLayout",setup(e){const t=pe(),n=_e(),a=L({}),s=z(()=>a.value?.admin_username||"");async function i(){try{a.value=await Xe()}finally{}}const c=L(!1),m=L(0);let T=null;async function R(g=null){if(g&&typeof g=="object"){Object.prototype.hasOwnProperty.call(g,"pendingFeedbacks")&&(m.value=Number(g.pendingFeedbacks||0));return}if(!c.value){c.value=!0;try{const r=await ze();m.value=Number(r?.pending||0)}finally{c.value=!1}}}function p(){return typeof document>"u"?!1:document.visibilityState==="hidden"}function b(){return p()?rt:ot}function P(){T&&(window.clearTimeout(T),T=null)}function h(){P(),T=window.setTimeout(async()=>{T=null,await R().catch(()=>{}),h()},b())}function S(){h()}M("refreshStats",i),M("adminStats",a),M("refreshNavBadges",R);const v=L(!1),A=L(!1);let D;function I(){v.value=!!D?.matches,v.value||(A.value=!1)}he(async()=>{D=window.matchMedia("(max-width: 768px)"),D.addEventListener?.("change",I),I(),await i(),await R(),h(),window.addEventListener("visibilitychange",S)}),ye(()=>{D?.removeEventListener?.("change",I),P(),window.removeEventListener("visibilitychange",S)});const $=[{path:"/reports",label:"报表",icon:Ee},{path:"/users",label:"用户",icon:ke},{path:"/feedbacks",label:"反馈",icon:Te,badgeKey:"feedbacks"},{path:"/logs",label:"任务日志",icon:Pe},{path:"/announcements",label:"公告",icon:Se},{path:"/email",label:"邮件",icon:Re},{path:"/security",label:"安全防护",icon:Ae},{path:"/system",label:"系统配置",icon:Le},{path:"/settings",label:"设置",icon:xe}],F=z(()=>t.path);function C(g){return g?.badgeKey&&g.badgeKey==="feedbacks"?Number(m.value||0):0}async function re(){try{await ae.confirm("确定退出管理员登录吗?","退出登录",{confirmButtonText:"退出",cancelButtonText:"取消",type:"warning"})}catch{return}try{await y.post("/logout")}finally{window.location.href="/yuyx"}}async function q(g){await n.push(g),A.value=!1}return(g,r)=>{const U=f("el-icon"),j=f("el-badge"),G=f("el-menu-item"),H=f("el-menu"),le=f("el-aside"),K=f("el-button"),ie=f("el-header"),ce=f("RouterView"),ue=f("el-skeleton"),de=f("el-card"),fe=f("el-main"),Y=f("el-container"),me=f("el-drawer");return _(),E(Y,{class:"layout-root"},{default:o(()=>[v.value?W("",!0):(_(),E(le,{key:0,width:"220px",class:"layout-aside"},{default:o(()=>[r[2]||(r[2]=u("div",{class:"brand"},[u("div",{class:"brand-title"},"后台管理"),u("div",{class:"brand-sub app-muted"},"知识管理平台")],-1)),d(H,{"default-active":F.value,class:"aside-menu",router:"",onSelect:q},{default:o(()=>[(_(),V(X,null,J($,l=>d(G,{key:l.path,index:l.path},{default:o(()=>[d(U,null,{default:o(()=>[(_(),E(Q(l.icon)))]),_:2},1024),C(l)>0?(_(),E(j,{key:0,value:C(l),max:99,class:"menu-badge"},{default:o(()=>[u("span",Je,x(l.label),1)]),_:2},1032,["value"])):(_(),V("span",Qe,x(l.label),1))]),_:2},1032,["index"])),64))]),_:1},8,["default-active"])]),_:1})),d(Y,null,{default:o(()=>[d(ie,{class:"layout-header"},{default:o(()=>[u("div",Ze,[v.value?(_(),E(K,{key:0,text:"",class:"header-menu-btn",onClick:r[0]||(r[0]=l=>A.value=!0)},{default:o(()=>[...r[3]||(r[3]=[Z(" 菜单 ",-1)])]),_:1})):W("",!0),r[4]||(r[4]=u("div",{class:"header-title"},"后台管理系统",-1))]),u("div",et,[u("div",tt,[r[5]||(r[5]=u("span",{class:"app-muted"},"管理员",-1)),u("strong",null,x(s.value||"-"),1)]),d(K,{type:"primary",plain:"",class:"logout-btn",onClick:re},{default:o(()=>[...r[6]||(r[6]=[Z("退出",-1)])]),_:1})])]),_:1}),d(fe,{class:"layout-main"},{default:o(()=>[u("div",nt,[(_(),E(ge,null,{default:o(()=>[d(ce)]),fallback:o(()=>[d(de,{shadow:"never","body-style":{padding:"16px"},class:"fallback-card"},{default:o(()=>[d(ue,{rows:5,animated:""})]),_:1})]),_:1}))])]),_:1})]),_:1}),d(me,{modelValue:A.value,"onUpdate:modelValue":r[1]||(r[1]=l=>A.value=l),size:"min(82vw, 280px)",direction:"ltr","with-header":!1},{default:o(()=>[r[7]||(r[7]=u("div",{class:"drawer-brand"},[u("div",{class:"brand-title"},"后台管理"),u("div",{class:"brand-sub app-muted"},"知识管理平台")],-1)),d(H,{"default-active":F.value,class:"aside-menu",router:"",onSelect:q},{default:o(()=>[(_(),V(X,null,J($,l=>d(G,{key:l.path,index:l.path},{default:o(()=>[d(U,null,{default:o(()=>[(_(),E(Q(l.icon)))]),_:2},1024),C(l)>0?(_(),E(j,{key:0,value:C(l),max:99,class:"menu-badge"},{default:o(()=>[u("span",at,x(l.label),1)]),_:2},1032,["value"])):(_(),V("span",st,x(l.label),1))]),_:2},1032,["index"])),64))]),_:1},8,["default-active"])]),_:1},8,["modelValue"])]),_:1})}}},it=oe(lt,[["__scopeId","data-v-ce83ce8c"]]),ct=()=>k(()=>import("./ReportPage-BH0iEKUw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),ut=()=>k(()=>import("./UsersPage-70roiEdR.js"),__vite__mapDeps([12,13,1,2,3,4,10,14]),import.meta.url),dt=()=>k(()=>import("./FeedbacksPage-Bm8Gi6uF.js"),__vite__mapDeps([15,8,2,9,1,3,4,10,16]),import.meta.url),ft=()=>k(()=>import("./LogsPage-BXJhmaAD.js"),__vite__mapDeps([17,13,6,1,2,3,4,10,18]),import.meta.url),mt=()=>k(()=>import("./AnnouncementsPage-Bt9ScJoU.js"),__vite__mapDeps([19,1,2,3,4,10,20]),import.meta.url),pt=()=>k(()=>import("./EmailPage-lCqi22rV.js"),__vite__mapDeps([21,5,8,2,9,1,3,4,10,22]),import.meta.url),_t=()=>k(()=>import("./SecurityPage-BINdqm-Z.js"),__vite__mapDeps([23,8,2,9,1,3,4,10,24]),import.meta.url),ht=()=>k(()=>import("./SystemPage-BOHCIy1Q.js"),__vite__mapDeps([25,7,1,2,3,4,10,26]),import.meta.url),yt=()=>k(()=>import("./SettingsPage-Bb497CTW.js"),__vite__mapDeps([27,1,2,3,4,10,28]),import.meta.url),gt=[{path:"/",component:it,children:[{path:"",redirect:"/reports"},{path:"/pending",redirect:"/reports"},{path:"/stats",redirect:"/reports"},{path:"/reports",name:"reports",component:ct},{path:"/users",name:"users",component:ut},{path:"/feedbacks",name:"feedbacks",component:dt},{path:"/logs",name:"logs",component:ft},{path:"/announcements",name:"announcements",component:mt},{path:"/email",name:"email",component:pt},{path:"/security",name:"security",component:_t},{path:"/system",name:"system",component:ht},{path:"/settings",name:"settings",component:yt}]}],bt=be({history:ve(),routes:gt});we(Ve).use(bt).use(Oe,{locale:Ne}).mount("#app");export{oe as _,y as a,Tt as b,St as c,Rt as d,ze as f,Pt as r};