const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dashboard-C1bTnf9G.js","assets/rolldown-runtime-WkwZ5CU-.js","assets/react-QV7DAAIx.js","assets/semi-CHxO7u8f.js","assets/semi-BUXPdXzR.css","assets/dashboard-Dk6QMmtm.css","assets/chat-B6cOdvxB.js","assets/retest-EzTZPjnQ.js","assets/project-form-B7LOVrYq.js","assets/model-channel-mQ6lfvSO.js","assets/project-options-CMQbwv_U.js","assets/chat-B4gtUsym.css","assets/deep-assessments-D9Eh-P7-.js","assets/graph-parents-C3k12cpw.js","assets/graph-parents-BbkuhUnk.css","assets/deep-assessments-BVUI7zDD.css","assets/hitl-BXv08yGA.js","assets/hitl-BqmzzDjt.css","assets/tool-guard-YZfmNQZ9.js","assets/tool-guard-DKIWLN1V.css","assets/projects-CGHGDxFZ.js","assets/AssetEditorModal-CqjQgJt8.js","assets/assetTarget-D2PEjBAg.js","assets/projects-CCzxY6zz.css","assets/asset-overview-CJNzTj95.js","assets/AssetBits-RToEHLbz.js","assets/asset-overview-DEMYiRVr.css","assets/asset-library-Be1fEX32.js","assets/asset-library-a5Vth3JU.css","assets/info-collect-Cz_FrKnl.js","assets/info-collect-BrIcieOX.css","assets/vulnerabilities-CLjF5w8M.js","assets/vulnerabilities-BPt2JmiL.css","assets/tasks-CMXgkYzg.js","assets/tasks-BtBBHKoW.css","assets/workflows-D0hIK8-5.js","assets/workflows-EsKm07MV.css","assets/webshell-CIHejtP-.js","assets/webshell-BdcYpY5u.css","assets/c2-listeners-D48uHMNt.js","assets/c2-shared-Bp5-se02.js","assets/c2-shared-B-Nz9eUh.css","assets/c2-shared-CLxa-jXi.js","assets/c2-listeners-KjhK45yg.css","assets/c2-sessions-B3T6vNBp.js","assets/c2-sessions-DLf_n8Eq.css","assets/c2-tasks-BPlX1VSv.js","assets/c2-tasks-B5H34xZF.css","assets/c2-payloads-DkiAq8H3.js","assets/c2-payloads-CnRJmaJm.css","assets/c2-events-DBkH1Ps2.js","assets/c2-events-BVd4qqKy.css","assets/c2-profiles-B9vlWJDM.js","assets/c2-profiles-BpNJlhDC.css","assets/chat-files-DvYZqigo.js","assets/chat-files-wKL7Vwmw.css","assets/mcp-monitor-BktPgkRb.js","assets/mcp-monitor-8VvqmnVY.css","assets/mcp-management-D08mlkbU.js","assets/mcp-management-CEr7J00D.css","assets/knowledge-retrieval-logs-EGeeNq1a.js","assets/knowledge-management-C95HlQvj.js","assets/skills-monitor-DDzWiLjF.js","assets/skills-management-D14i0o-C.js","assets/agents-management-D1UoWtYg.js","assets/roles-management-DHztKoq9.js","assets/roles-management-CAkb5FLz.css","assets/platform-rbac-CGyXELTK.js","assets/settings-ClSXlHvg.js","assets/settings-Cjg19I8_.css","assets/api-docs-B5EmdKmF.js","assets/api-docs-B_T3BEfL.css"])))=>i.map(i=>d[i]); import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{$ as t,B as n,Bt as r,C as i,D as a,Dt as o,F as s,G as c,Gt as l,Ht as u,I as d,It as f,K as p,Kt as ee,L as m,Lt as h,M as g,Mt as _,Nt as te,P as v,Q as ne,Qt as re,R as y,Rt as ie,T as b,Tt as ae,U as x,Ut as S,V as oe,W as se,Wt as ce,_t as le,bt as ue,ct as de,f as fe,ft as pe,ht as me,i as C,it as he,j as ge,k as _e,l as ve,mt as w,n as ye,nt as be,o as xe,q as Se,qt as Ce,r as we,rt as Te,st as Ee,t as De,vt as T,w as Oe,wt as E,y as ke,yt as D,z as Ae,zt as je}from"./semi-CHxO7u8f.js";import{S as Me,b as Ne,d as Pe,f as Fe,g as Ie,h as O,l as Le,m as Re,p as ze,t as Be,v as Ve}from"./react-QV7DAAIx.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var k=e(Me(),1),He=Ne(),Ue=`cyberstrike-auth`;function We(){try{let e=localStorage.getItem(Ue);if(!e)return null;let t=JSON.parse(e);if(!t?.token||!t?.expiresAt)return null;let n=new Date(t.expiresAt);return!Number.isFinite(n.getTime())||n.getTime()<=Date.now()?null:{token:t.token,expiresAt:n.toISOString(),user:t.user||null,roles:Array.isArray(t.roles)?t.roles:[],permissions:Array.isArray(t.permissions)?t.permissions:[],scope:t.scope||``}}catch(e){return console.warn(`读取会话失败:`,e),null}}function Ge(e){e?localStorage.setItem(Ue,JSON.stringify(e)):localStorage.removeItem(Ue)}var Ke=null,qe=null;function Je(e){Ke=e||null}function Ye(e,t){let n=qe;qe=e||null;try{return t()}finally{qe=n}}var A=class extends Error{constructor(e,{status:t=0,payload:n=null,path:r=``}={}){super(e),this.name=`ApiError`,this.status=t,this.payload=n,this.path=r}};function Xe(e,t){let n=e.startsWith(`http`)?e:`/api${e.startsWith(`/`)?e:`/${e}`}`;if(!t)return n;let r=new URLSearchParams;for(let[e,n]of Object.entries(t))n!=null&&n!==``&&(Array.isArray(n)?n.forEach(t=>r.append(e,t)):r.append(e,String(n)));let i=r.toString();return i?`${n}${n.includes(`?`)?`&`:`?`}${i}`:n}async function Ze(e){let t=e.headers.get(`content-type`)||``;try{if(t.includes(`application/json`)){let t=await e.json();return{message:t.error||t.message||`请求失败(HTTP ${e.status})`,payload:t}}let n=await e.text();return{message:n?.slice(0,300)||`请求失败(HTTP ${e.status})`,payload:n}}catch{return{message:`请求失败(HTTP ${e.status})`,payload:null}}}async function j(e,t={}){let{method:n=`GET`,body:r,query:i,headers:a={},signal:o,raw:s=!1,timeout:c=6e4}=t,l=o===void 0?n.toUpperCase()===`GET`?qe:void 0:o,u={Accept:`application/json`,...a},d=r;r!=null&&!(r instanceof FormData)&&typeof r!=`string`&&!(r instanceof Blob)&&(u[`Content-Type`]=`application/json`,d=JSON.stringify(r)),Ke&&!u.Authorization&&(u.Authorization=`Bearer ${Ke}`);let f=new AbortController,p=c?setTimeout(()=>f.abort(),c):null,ee=()=>f.abort();l&&(l.aborted?f.abort():l.addEventListener(`abort`,ee,{once:!0}));let m;try{m=await fetch(Xe(e,i),{method:n,headers:u,body:d,signal:f.signal})}catch(t){throw t.name===`AbortError`?new A(`请求已取消`,{path:e}):new A(`网络连接失败,请检查服务状态`,{path:e})}finally{p&&clearTimeout(p),l&&l.removeEventListener(`abort`,ee)}if(m.status===401&&window.dispatchEvent(new CustomEvent(`csai:unauthorized`)),!m.ok){let{message:t,payload:n}=await Ze(m);throw new A(t,{status:m.status,payload:n,path:e})}return s?m:m.status===204?null:(m.headers.get(`content-type`)||``).includes(`application/json`)?m.json():m.text()}var M={get:(e,t,n={})=>j(e,{...n,query:t}),post:(e,t,n={})=>j(e,{...n,method:`POST`,body:t}),put:(e,t,n={})=>j(e,{...n,method:`PUT`,body:t}),patch:(e,t,n={})=>j(e,{...n,method:`PATCH`,body:t}),del:(e,t={})=>j(e,{...t,method:`DELETE`}),raw:(e,t={})=>j(e,{...t,raw:!0})};async function Qe(e,{query:t,filename:n,method:r=`GET`,body:i}={}){let a=await j(e,{method:r,body:i,query:t,raw:!0,timeout:12e4}),o=await a.blob(),s=a.headers.get(`content-disposition`)||``,c=s.match(/filename\*=UTF-8''([^;]+)/i),l=s.match(/filename="?([^";]+)"?/i),u=n||(c?decodeURIComponent(c[1]):l?.[1])||`download.bin`,d=URL.createObjectURL(o),f=document.createElement(`a`);return f.href=d,f.download=u,document.body.appendChild(f),f.click(),f.remove(),setTimeout(()=>URL.revokeObjectURL(d),1e3),u}function $e(e,t,{onEvent:n,onError:r,onClose:i,signal:a}={}){let o=new AbortController;a&&(a.aborted?o.abort():a.addEventListener(`abort`,()=>o.abort(),{once:!0}));let s={"Content-Type":`application/json`,Accept:`text/event-stream`};return Ke&&(s.Authorization=`Bearer ${Ke}`),(async()=>{try{let r=await fetch(Xe(e),{method:`POST`,headers:s,body:JSON.stringify(t||{}),signal:o.signal});if(r.status===401&&window.dispatchEvent(new CustomEvent(`csai:unauthorized`)),!r.ok){let{message:t}=await Ze(r);throw new A(t,{status:r.status,path:e})}if(!r.body)throw new A(`服务端未返回流式响应`,{path:e});let a=r.body.getReader(),c=new TextDecoder,l=``,u=!1;for(;!u;){let{done:e,value:t}=await a.read();if(e)break;l+=c.decode(t,{stream:!0});let r;for(;(r=l.indexOf(` `))>=0;){let e=l.slice(0,r).replace(/\r$/,``);if(l=l.slice(r+1),!e.startsWith(`data:`))continue;let t=e.slice(5).trim();if(!t)continue;if(t===`[DONE]`){u=!0;break}let i;try{i=JSON.parse(t)}catch{continue}n?.(i)}}i?.()}catch(e){if(e.name===`AbortError`){i?.();return}r?.(e)}})(),()=>o.abort()}function et(e,t=`操作失败`){return e?typeof e==`string`?e:e.message||t:t}var N=e(Be(),1),tt=(0,k.createContext)(null);function P(e,t){return e?{token:t||e.token,expiresAt:e.expires_at||e.expiresAt||``,appVersion:typeof e.app_version==`string`?e.app_version.trim():``,user:e.user||null,roles:Array.isArray(e.roles)?e.roles:[],permissions:Array.isArray(e.permissions)?e.permissions:[],scope:e.scope||``}:null}function nt({children:e}){let t=(0,k.useRef)(We()).current,[n,r]=(0,k.useState)(t),[i,a]=(0,k.useState)(!!t);(0,k.useEffect)(()=>{if(Je(t?.token||null),!t?.token){a(!1);return}let e=!1;return M.get(`/auth/validate`).then(n=>{if(e)return;let i=P(n,t.token);r(i),Ge(i)}).catch(()=>{e||(r(null),Ge(null),Je(null))}).finally(()=>{e||a(!1)}),()=>{e=!0}},[]);let o=(0,k.useCallback)(()=>{r(null),Je(null),Ge(null)},[]);(0,k.useEffect)(()=>{let e=()=>o();return window.addEventListener(`csai:unauthorized`,e),()=>window.removeEventListener(`csai:unauthorized`,e)},[o]);let s=(0,k.useCallback)(async(e,t)=>{let n=await M.post(`/auth/login`,{username:String(e||``).trim(),password:t}),i=P(n,n?.token);return Je(i?.token||null),Ge(i),r(i),i},[]),c=(0,k.useCallback)(async()=>{try{await M.post(`/auth/logout`,{})}catch{}o()},[o]),l=(0,k.useMemo)(()=>new Set(n?.permissions||[]),[n]),u=(0,k.useCallback)(e=>!e||String(e).split(/\s+/).some(e=>l.has(e)),[l]),d=(0,k.useCallback)(e=>{let t=Array.isArray(e)?e:String(e||``).split(/\s+/).filter(Boolean);return!t.length||t.some(e=>l.has(e))},[l]),f=(0,k.useCallback)(async()=>{if(!n?.token)return null;let e=P(await M.get(`/auth/validate`),n.token);return r(e),Ge(e),e},[n?.token]),p=(0,k.useMemo)(()=>({session:n,user:n?.user||null,roles:n?.roles||[],permissions:l,hasPermission:u,hasAnyPermission:d,checking:i,authenticated:!!n?.token,login:s,logout:c,refresh:f}),[n,l,u,d,i,s,c,f]);return(0,N.jsx)(tt.Provider,{value:p,children:e})}function rt(){let e=(0,k.useContext)(tt);if(!e)throw Error(`useAuth 必须在 AuthProvider 内使用`);return e}var it=[{id:`zh-CN`,label:`简体中文`},{id:`en-US`,label:`English`},{id:`ru-RU`,label:`Русский`},{id:`ar-SA`,label:`العربية`}],at=`csai_lang`,ot=`zh-CN`,st=`/static/i18n`,ct=new Map;function lt(){try{let e=localStorage.getItem(at);if(e&&it.some(t=>t.id===e))return e}catch{}let e=String(navigator.language||``).toLowerCase();return e.startsWith(`zh`)?`zh-CN`:e.startsWith(`ru`)?`ru-RU`:e.startsWith(`ar`)?`ar-SA`:e.startsWith(`en`)?`en-US`:ot}function ut(e){return ct.has(e)||ct.set(e,fetch(`${st}/${e}.json`,{cache:`no-cache`}).then(e=>e.ok?e.json():{}).catch(()=>({}))),ct.get(e)}function dt(e,t){if(!e)return;let n=e;for(let e of String(t).split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return typeof n==`string`?n:void 0}function ft(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,(e,n)=>t[n]===void 0?e:String(t[n])):e}var pt=(0,k.createContext)({lang:ot,t:e=>e,ready:!1,setLanguage:()=>{}});function F({children:e}){let[t,n]=(0,k.useState)(lt),[r,i]=(0,k.useState)({}),[a,o]=(0,k.useState)(!1);(0,k.useEffect)(()=>{let e=!1;Promise.all([ut(t),ut(ot),ut(`en-US`)]).then(([t,n,r])=>{e||(i({current:t,fallback:n,english:r}),o(!0))}),document.documentElement.lang=t,document.documentElement.dir=t===`ar-SA`?`rtl`:`ltr`;try{localStorage.setItem(at,t)}catch{}return()=>{e=!0}},[t]);let s=(0,k.useCallback)((e,t,n)=>{if(!e)return n??``;let i=dt(r.current,e)??dt(r.fallback,e)??dt(r.english,e);return i===void 0?n??e:ft(i,t)},[r]),c=(0,k.useCallback)(e=>{e&&e!==t&&(o(!1),n(e),window.dispatchEvent(new CustomEvent(`csai:languagechange`,{detail:{lang:e}})))},[t]),l=(0,k.useMemo)(()=>({lang:t,t:s,ready:a,setLanguage:c}),[t,s,a,c]);return(0,N.jsx)(pt.Provider,{value:l,children:e})}function mt(){return(0,k.useContext)(pt)}function I(){return(0,k.useContext)(pt).t}var ht=`cyberstrike-theme`,gt=[`system`,`light`,`dark`];function _t(){try{let e=localStorage.getItem(ht);return gt.includes(e)?e:`system`}catch{return`system`}}function vt(){return typeof window<`u`&&window.matchMedia?window.matchMedia(`(prefers-color-scheme: dark)`).matches:!1}function yt(e){return e===`dark`||e===`light`?e:vt()?`dark`:`light`}function bt(e){let t=yt(e),n=document.documentElement;return n.setAttribute(`data-theme`,t),n.setAttribute(`data-theme-preference`,e),n.style.colorScheme=t,document.body?.setAttribute(`theme-mode`,t===`dark`?`dark`:`light`),t}var xt=(0,k.createContext)({preference:`system`,theme:`light`,setPreference:()=>{},toggle:()=>{}});function St({children:e}){let[t,n]=(0,k.useState)(_t),[r,i]=(0,k.useState)(()=>yt(_t()));(0,k.useLayoutEffect)(()=>{i(bt(t));try{localStorage.setItem(ht,t)}catch{}if(t!==`system`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>i(bt(t));return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),(0,k.useEffect)(()=>{document.body?.setAttribute(`theme-mode`,r===`dark`?`dark`:`light`)},[r]);let a=(0,k.useCallback)(e=>{gt.includes(e)&&n(e)},[]),o=(0,k.useCallback)(()=>{n(e=>yt(e)===`dark`?`light`:`dark`)},[]),s=(0,k.useMemo)(()=>({preference:t,theme:r,setPreference:a,toggle:o}),[t,r,a,o]);return(0,N.jsx)(xt.Provider,{value:s,children:e})}function Ct(){return(0,k.useContext)(xt)}var wt=[{id:`dashboard`,i18n:`nav.dashboard`,fallback:`仪表盘`,icon:ue},{id:`chat`,i18n:`nav.chat`,fallback:`对话`,icon:te},{id:`deep-assessments`,i18n:`nav.deepAssessments`,fallback:`深度测评`,icon:Ce},{id:`security`,i18n:`nav.security`,fallback:`安全防护`,icon:be,anyPermission:[`hitl:read`,`config:read`],children:[{id:`hitl`,i18n:`nav.hitl`,fallback:`人机协同`,permission:`hitl:read`},{id:`tool-guard`,i18n:`nav.toolGuard`,fallback:`调用拦截`,permission:`config:read`}]},{id:`projects`,i18n:`nav.projects`,fallback:`项目管理`,icon:u},{id:`assets`,i18n:`nav.assets`,fallback:`资产管理`,icon:ae,anyPermission:[`asset:read`,`fofa:execute`],children:[{id:`asset-overview`,i18n:`nav.assetOverview`,fallback:`资产概览`},{id:`asset-library`,i18n:`nav.assetLibrary`,fallback:`资产库`},{id:`info-collect`,i18n:`nav.infoCollect`,fallback:`信息收集`}]},{id:`vulnerabilities`,i18n:`nav.vulnerabilities`,fallback:`漏洞管理`,icon:be},{id:`tasks`,i18n:`nav.tasks`,fallback:`任务管理`,icon:r},{id:`workflows`,i18n:`nav.workflows`,fallback:`工作流`,icon:S},{id:`webshell`,i18n:`nav.webshell`,fallback:`WebShell管理`,icon:ne},{id:`c2`,i18n:`nav.c2`,fallback:`C2`,icon:l,children:[{id:`c2-listeners`,i18n:`nav.c2Listeners`,fallback:`监听器`},{id:`c2-sessions`,i18n:`nav.c2Sessions`,fallback:`会话`},{id:`c2-tasks`,i18n:`nav.c2Tasks`,fallback:`任务`},{id:`c2-payloads`,i18n:`nav.c2Payloads`,fallback:`载荷`},{id:`c2-events`,i18n:`nav.c2Events`,fallback:`事件`},{id:`c2-profiles`,i18n:`nav.c2Profiles`,fallback:`流量伪装`}]},{id:`chat-files`,i18n:`nav.chatFiles`,fallback:`文件管理`,icon:E},{id:`mcp`,i18n:`nav.mcp`,fallback:`MCP`,icon:he,children:[{id:`mcp-monitor`,i18n:`nav.mcpMonitor`,fallback:`MCP状态监控`},{id:`mcp-management`,i18n:`nav.mcpManagement`,fallback:`MCP管理`}]},{id:`knowledge`,i18n:`nav.knowledge`,fallback:`知识`,icon:ce,children:[{id:`knowledge-retrieval-logs`,i18n:`nav.knowledgeRetrievalLogs`,fallback:`检索历史`},{id:`knowledge-management`,i18n:`nav.knowledgeManagement`,fallback:`知识管理`}]},{id:`skills`,i18n:`nav.skills`,fallback:`技能`,icon:de,children:[{id:`skills-monitor`,i18n:`nav.skillsMonitor`,fallback:`技能状态`},{id:`skills-management`,i18n:`nav.skillsManagement`,fallback:`技能管理`}]},{id:`agents`,i18n:`nav.agents`,fallback:`智能体`,icon:p,children:[{id:`agents-management`,i18n:`nav.agentsManagement`,fallback:`智能体管理`}]},{id:`roles`,i18n:`nav.roles`,fallback:`角色`,icon:Se,children:[{id:`roles-management`,i18n:`nav.rolesManagement`,fallback:`角色管理`}]},{id:`platform-rbac`,i18n:`nav.platformRbac`,fallback:`平台权限`,icon:me},{id:`settings`,i18n:`nav.settings`,fallback:`系统设置`,icon:Te},{id:`api-docs`,i18n:`apiDocs.title`,fallback:`API 文档`,icon:Ce}],Tt=[{id:`workspace`,i18n:`nav.groupWorkspace`,fallback:`工作台`,pages:[`dashboard`,`chat`,`deep-assessments`,`security`]},{id:`operations`,i18n:`nav.groupOperations`,fallback:`安全作业`,pages:[`projects`,`assets`,`vulnerabilities`,`tasks`,`workflows`,`webshell`,`c2`,`chat-files`]},{id:`capabilities`,i18n:`nav.groupCapabilities`,fallback:`能力中心`,pages:[`mcp`,`knowledge`,`skills`,`agents`,`roles`]},{id:`platform`,i18n:`nav.groupPlatform`,fallback:`平台管理`,pages:[`platform-rbac`,`settings`,`api-docs`]}],Et=wt.flatMap(e=>e.children?e.children.map(t=>({...t,parent:e.id})):[e]);function Dt(e){return Et.find(t=>t.id===e)||wt.find(t=>t.id===e)||null}function Ot(e){"@babel/helpers - typeof";return Ot=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ot(e)}function kt(e,t){if(Ot(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ot(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function At(e){var t=kt(e,`string`);return Ot(t)==`symbol`?t:t+``}function L(e,t,n){return(t=At(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jt;function Mt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=Mt();function Pt(e){Nt=e}var Ft={exec:()=>null};function R(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(z.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var It=(()=>{try{return!0}catch{return!1}})(),z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},Lt=/^(?:[ \t]*(?:\n|$))+/,Rt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ht=/(?:[*+-]|\d{1,9}[.)])/,Ut=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,B=R(Ut).replace(/bull/g,Ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Wt=R(Ut).replace(/bull/g,Ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Gt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kt=/^[^\n]+/,qt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jt=R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,qt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yt=R(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ht).getRegex(),Xt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Zt=/|$))/,Qt=R(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Zt).replace(`tag`,Xt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$t=R(Gt).replace(`hr`,Bt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Xt).getRegex(),en={blockquote:R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,$t).getRegex(),code:Rt,def:Jt,fences:zt,heading:Vt,hr:Bt,html:Qt,lheading:B,list:Yt,newline:Lt,paragraph:$t,table:Ft,text:Kt},tn=R(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Bt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Xt).getRegex(),nn={...en,lheading:Wt,table:tn,paragraph:R(Gt).replace(`hr`,Bt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,tn).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Xt).getRegex()},rn={...en,html:R(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Zt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:R(Gt).replace(`hr`,Bt).replace(`heading`,` *#{1,6} *[^ ]`).replace(`lheading`,B).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},an=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,on=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sn=/^( {2,}|\\)\n(?!\s*$)/,cn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,It?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),_n=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vn=R(_n,`u`).replace(/punct/g,ln).getRegex(),yn=R(_n,`u`).replace(/punct/g,pn).getRegex(),bn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,xn=R(bn,`gu`).replace(/notPunctSpace/g,dn).replace(/punctSpace/g,un).replace(/punct/g,ln).getRegex(),Sn=R(bn,`gu`).replace(/notPunctSpace/g,hn).replace(/punctSpace/g,mn).replace(/punct/g,pn).getRegex(),Cn=R(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,dn).replace(/punctSpace/g,un).replace(/punct/g,ln).getRegex(),wn=R(/\\(punct)/,`gu`).replace(/punct/g,ln).getRegex(),Tn=R(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),En=R(Zt).replace(`(?:-->|$)`,`-->`).getRegex(),Dn=R(`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,En).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),On=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,kn=R(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,On).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),An=R(/^!?\[(label)\]\[(ref)\]/).replace(`label`,On).replace(`ref`,qt).getRegex(),jn=R(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,qt).getRegex(),Mn=R(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,An).replace(`nolink`,jn).getRegex(),Nn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Pn={_backpedal:Ft,anyPunctuation:wn,autolink:Tn,blockSkip:gn,br:sn,code:on,del:Ft,emStrongLDelim:vn,emStrongRDelimAst:xn,emStrongRDelimUnd:Cn,escape:an,link:kn,nolink:jn,punctuation:fn,reflink:An,reflinkSearch:Mn,tag:Dn,text:cn,url:Ft},Fn={...Pn,link:R(/^!?\[(label)\]\((.*?)\)/).replace(`label`,On).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,On).getRegex()},In={...Pn,emStrongRDelimAst:Sn,emStrongLDelim:yn,url:R(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Nn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:R(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},Vn=e=>Bn[e];function V(e,t){if(t){if(z.escapeTest.test(e))return e.replace(z.escapeReplace,Vn)}else if(z.escapeTestNoEncode.test(e))return e.replace(z.escapeReplaceNoEncode,Vn);return e}function Hn(e){try{e=encodeURI(e).replace(z.percentDecode,`%`)}catch{return null}return e}function Un(e,t){let n=e.replace(z.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(z.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function Kn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function qn(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(` `)}var Jn=class{constructor(e){L(this,`options`,void 0),L(this,`rules`,void 0),L(this,`lexer`,void 0),this.options=e||Nt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Wn(e,` `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=qn(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Wn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Wn(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Wn(t[0],` `).split(` `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(` `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+` `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(` `,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=` `+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=` `+l}!u&&!l.trim()&&(u=!0),r+=f+` `,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;ee.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Wn(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Gn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Kn(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Kn(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},H=class e{constructor(e){L(this,`tokens`,void 0),L(this,`options`,void 0),L(this,`state`,void 0),L(this,`tokenizer`,void 0),L(this,`inlineQueue`,void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Nt,this.options.tokenizer=this.options.tokenizer||new Jn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:z,block:Rn.normal,inline:zn.normal};this.options.pedantic?(t.block=Rn.pedantic,t.inline=zn.pedantic):this.options.gfm&&(t.block=Rn.gfm,t.inline=this.options.breaks?zn.breaks:zn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Rn,inline:zn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(z.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let e=0;e(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=` `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(` `)?``:` `)+r.raw,a.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},Yn=class{constructor(e){L(this,`options`,void 0),L(this,`parser`,void 0),this.options=e||Nt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(z.notSpaceStart)?.[0],i=e.replace(z.endingNewline,``)+` `;return r?`
`+(n?i:V(i,!0))+`
`:`
`+(n?i:V(i,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t `+r+` `}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+V(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • `}checkbox({checked:e}){return``}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t=``,n=``;for(let t=0;t${r}`),` `+t+` `+r+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${V(e,!0)}`}br(e){return`
    `}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Hn(e);if(i===null)return r;e=i;let a=`
    `+r+``,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Hn(e);if(i===null)return V(n);e=i;let a=`${n}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:V(e.text)}},Xn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},U=class e{constructor(e){L(this,`options`,void 0),L(this,`renderer`,void 0),L(this,`textRenderer`,void 0),this.options=e||Nt,this.options.renderer=this.options.renderer||new Yn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xn}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Yn(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Jn(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Zn;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Zn.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Zn.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return H.lex(e,t??this.defaults)}parser(e,t){return U.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?H.lex:H.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?U.parse:U.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?H.lex:H.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?U.parse:U.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e){let e=`

    An error occurred:

    `+V(n.message+``,!0)+`
    `;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function W(e,t){return Qn.parse(e,t)}W.options=W.setOptions=function(e){return Qn.setOptions(e),W.defaults=Qn.defaults,Pt(W.defaults),W},W.getDefaults=Mt,W.defaults=Nt,W.use=function(...e){return Qn.use(...e),W.defaults=Qn.defaults,Pt(W.defaults),W},W.walkTokens=function(e,t){return Qn.walkTokens(e,t)},W.parseInline=Qn.parseInline,W.Parser=U,W.parser=U.parse,W.Renderer=Yn,W.TextRenderer=Xn,W.Lexer=H,W.lexer=H.lex,W.Tokenizer=Jn,W.Hooks=Zn,W.parse=W,W.options,W.setOptions,W.use,W.walkTokens,W.parseInline,U.parse,H.lex;function $n(e,t){this.v=e,this.k=t}function er(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:Y(BigInt.prototype.toString),Ir=typeof Symbol>`u`?null:Y(Symbol.prototype.toString),q=Y(Object.prototype.hasOwnProperty),Lr=Y(Object.prototype.toString),Rr=RegExp.prototype.test,J=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),hr(Rr,e,[t])},zr=Br(TypeError);function Y(e){return function(t){var n=[...arguments].slice(1);return hr(e,t,n)}}function Br(e){return function(){return gr(e,[...arguments])}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dr;if(lr&&lr(e,null),!Cr(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ur(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Vr(e){for(let t=0;t/g),oi=K(/\${[\w\W]*/g),si=K(/{{|}}|\${|<%|%>|<%|%>/),ci=K(/^data-[\-\w.\u00B7-\uFFFF]+$/),li=K(/^aria-[\-\w]+$/),ui=K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),di=K(/^(?:\w+script|data):/i),fi=K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pi=K(/^html$/i),mi=K(/^[a-z][.\w]*(-[.\w]+)+$/i),hi=K(/<[/\w!]/g),gi=K(/<[/\w]/g),_i=K(/<\/no(script|embed|frames)/i),vi=K(/\/>/i),yi=K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),bi=K(/^[\r\n\t ]+/),Q={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},xi=G(X({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Si=function(){return typeof window>`u`?null:window},Ci=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},wi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ti=function(e,t,n,r){return q(e,t)&&Cr(e[t])?X(r.base?Ur(r.base):{},e[t],r.transform):n},Ei=function(e,t,n){let r=q(e,t)?e[t]:void 0;return r&&typeof r==`object`?Hr(r):n};function Di(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Si(),t=e=>Di(e);if(t.version=`3.4.18`,t.removed=[],!e||!e.document||e.document.nodeType!==Q.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter,l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Z(d,`cloneNode`),p=Z(d,`remove`),ee=Z(d,`removeAttributeNode`),m=Z(d,`nextSibling`),h=Z(d,`childNodes`),g=Z(d,`parentNode`),_=Z(d,`shadowRoot`),te=Z(d,`attributes`),v=o&&o.prototype?Z(o.prototype,`nodeType`):null,ne=o&&o.prototype?Z(o.prototype,`nodeName`):null,re=o&&o.prototype?Z(o.prototype,`ownerDocument`):null,y=function(e){return v?v(e):e.nodeType},ie=function(e){return ne?ne(e):e.nodeName},b=Gr(d,`namespaceURI`),ae=function(e){return b?b(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,oe,se=!1,ce=0,le=function(){if(ce>0)throw zr(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ue=function(e){le(),ce++;try{return x.createHTML(e)}finally{ce--}},de=function(e){return x&&We?ue(e):e},fe=function(e){le(),ce++;try{return x.createScriptURL(e)}finally{ce--}},pe=function(){return se||(oe=Ci(u,i),se=!0),oe},me=n,C=me.implementation,he=me.createNodeIterator,ge=me.createDocumentFragment,_e=me.getElementsByTagName,ve=r.importNode,w=wi();t.isSupported=typeof sr==`function`&&typeof g==`function`&&C&&C.createHTMLDocument!==void 0;let ye=ii,be=ai,xe=oi,Se=ci,Ce=li,we=di,Te=fi,Ee=mi,De=ui,T=null,Oe=X({},[...qr,...Jr,...Yr,...Zr,...$r]),E=null,ke=X({},[...ei,...ti,...ni,...ri]),D=null,Ae=null,je=null,Me=Object.seal(pr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ne=!0,Pe=!0,Fe=!1,Ie=!0,O=!1,Le=!0,Re=!1,ze=!1,Be=null,Ve=null,k=!1,He=!1,Ue=!1,We=!1,Ge=!0,Ke=!1,qe=`user-content-`,Je=!0,Ye=!1,A=null,Xe=!1,Ze=null,j=X({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),M=null,Qe=X({},[`audio`,`video`,`img`,`source`,`image`,`track`]),$e=null,et=X({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),N=`http://www.w3.org/1998/Math/MathML`,tt=`http://www.w3.org/2000/svg`,P=`http://www.w3.org/1999/xhtml`,nt=P,rt=!1,it=null,at=X({},[N,tt,P],Or),ot=G(X({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),st=null,ct=G(X({},[`annotation-xml`])),lt=null,ut=G(pr(null)),dt=X({},[`title`,`style`,`font`,`a`,`script`]),ft=null,pt=[`application/xhtml+xml`,`text/html`],F=null,mt=null,I=n.createElement(`form`),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=Hr(e),ft=pt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,F=ft===`application/xhtml+xml`?Or:Dr,T=Ti(e,`ALLOWED_TAGS`,Oe,{transform:F}),E=Ti(e,`ALLOWED_ATTR`,ke,{transform:F}),it=Ti(e,`ALLOWED_NAMESPACES`,at,{transform:Or}),$e=Ti(e,`ADD_URI_SAFE_ATTR`,et,{transform:F,base:et}),M=Ti(e,`ADD_DATA_URI_TAGS`,Qe,{transform:F,base:Qe}),Ze=Ti(e,`FORBID_CONTENTS`,j,{transform:F}),Ae=Ti(e,`FORBID_TAGS`,pr(null),{transform:F}),je=Ti(e,`FORBID_ATTR`,pr(null),{transform:F}),Xe=q(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Hr(e.USE_PROFILES):e.USE_PROFILES:!1,Ne=e.ALLOW_ARIA_ATTR!==!1,Pe=e.ALLOW_DATA_ATTR!==!1,Fe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,O=e.SAFE_FOR_TEMPLATES||!1,Le=e.SAFE_FOR_XML!==!1,Re=e.WHOLE_DOCUMENT||!1,He=e.RETURN_DOM||!1,Ue=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,k=e.FORCE_BODY||!1,Ge=e.SANITIZE_DOM!==!1,Ke=e.SANITIZE_NAMED_PROPS||!1,Je=e.KEEP_CONTENT!==!1,Ye=e.IN_PLACE||!1,De=Kr(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ui,nt=typeof e.NAMESPACE==`string`?e.NAMESPACE:P,st=Ei(e,`MATHML_TEXT_INTEGRATION_POINTS`,ot),lt=Ei(e,`HTML_INTEGRATION_POINTS`,ct);let t=Ei(e,`CUSTOM_ELEMENT_HANDLING`,ut);if(D=pr(null),q(t,`tagNameCheck`)&&ht(t.tagNameCheck)&&(D.tagNameCheck=t.tagNameCheck),q(t,`attributeNameCheck`)&&ht(t.attributeNameCheck)&&(D.attributeNameCheck=t.attributeNameCheck),q(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(D.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),K(D),O&&(Pe=!1),Ue&&(He=!0),Xe&&((q(e,`ALLOWED_TAGS`)||q(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),T=X({},$r),E=pr(null),Xe.html===!0&&(X(T,qr),X(E,ei)),Xe.svg===!0&&(X(T,Jr),X(E,ti),X(E,ri)),Xe.svgFilters===!0&&(X(T,Yr),X(E,ti),X(E,ri)),Xe.mathMl===!0&&(X(T,Zr),X(E,ni),X(E,ri))),Me.tagCheck=null,Me.attributeCheck=null,q(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Me.tagCheck=e.ADD_TAGS:Cr(e.ADD_TAGS)&&(T===Oe&&(T=Ur(T)),X(T,e.ADD_TAGS,F))),q(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Me.attributeCheck=e.ADD_ATTR:Cr(e.ADD_ATTR)&&(E===ke&&(E=Ur(E)),X(E,e.ADD_ATTR,F))),q(e,`ADD_FORBID_CONTENTS`)&&Cr(e.ADD_FORBID_CONTENTS)&&(Ze===j&&(Ze=Ur(Ze)),X(Ze,e.ADD_FORBID_CONTENTS,F)),Je&&(T[`#text`]=!0),Re&&X(T,[`html`,`head`,`body`]),T.table&&(T.tbody=!0,delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zr(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zr(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=ue(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=pe()),x&&typeof S==`string`&&(S=ue(``)));mt=G(e)},_t=X({},[...Jr,...Yr,...Xr]),vt=X({},[...Zr,...Qr]),yt=function(e,t,n){return t===P?e===`svg`:t===N?e===`svg`&&(n===`annotation-xml`||st[n]):!!_t[e]},bt=function(e,t,n){return t===P?e===`math`:t===tt?e===`math`&<[n]:!!vt[e]},xt=function(e,t,n){return t===tt&&!lt[n]||t===N&&!st[n]?!1:!vt[e]&&(dt[e]||!_t[e])},St=function(e){let t=ae(e),n=Dr(ie(e)),r=g(e),i=nt,a=`template`;return r&&y(r)===Q.element&&(i=ae(r),a=Dr(ie(r))),it[t]?t===tt?yt(n,i,a):t===N?bt(n,i,a):t===P?xt(n,i,a):ft===`application/xhtml+xml`:!1},Ct=function(e){br(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw zr(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},wt=function(e,t,n){try{ee(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Tt=function(e){kt(e);let t=h(e);t&&_r(xr(t),e=>{try{p(e)}catch{}}),y(e)===Q.element&&Dt(e,!1)},Et=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}if(br(t.removed,{attribute:r||null,from:n}),r)wt(n,r,e);else try{n.removeAttribute(e)}catch{}if(e===`is`){if(He||Ue)try{Ct(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Dt=function(e,t){let n=te(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&E[F(a)])&&wt(e,i,a)}},Ot=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&y(e)===Q.element){let t=_(e);Ht(t)&&r.push(t)}let i=h(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},kt=function(e){Ot(e,e=>{y(e)===Q.element&&Dt(e,!0)})},At=function(e){let t=[];return Ot(e,e=>{t.push(e)},!0),t},L=function(e,t){let n=wr();_r(At(e),e=>{y(e)===Q.element&&Tr(n,e)}),_r(t,e=>{y(e)===Q.element&&!Er(n,e)&&Dt(e,!0)})},jt=function(e,n){let r=!1;return _r(t.removed,t=>{t.element&&(r=r||t.element===e,kt(t.element))}),L(e,n),r},Mt=function(e,t){let n=A,r=null,i=()=>(r||(r=wr(),_r(t,e=>{Tr(r,e)})),r);for(let t=0;;t++){let r=At(e),a=[e],o=!1;if(_r(r,e=>{y(e)===Q.documentFragment?br(a,e):!o&&!Er(n,e)&&(o=Er(i(),e))}),!o)return;if(t>=8)throw zr(`the tree kept changing during in-place sanitization; refusing to return it`);_r(a,(t,n)=>{Nt(t,n>0,e,i())})}},Nt=function(e,t,n,r){let i=z(e),a;for(;a=i.nextNode();)Er(r,a)&&!Er(A,a)&&(t&&B(w.uponSanitizeShadowNode,a,null),rn(a,n))},Pt=function(e){A&&Tr(A,e)},Ft=function(e,t){return Le?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},R=function(e){Le&&Ot(e,e=>{let t=y(e);if(t===Q.processingInstruction||t===Q.comment&&J(gi,e.data)){try{p(e)}catch{}return!1}if(t===Q.element){let t=e,n=F(ie(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Ft(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},It=function(e){let t=null,r=null;if(k)e=``+e;else{let t=kr(e,bi);r=t&&t[0]}ft===`application/xhtml+xml`&&nt===P&&(e=``+e+``);let i=x?ue(e):e;if(nt===P)try{t=new l().parseFromString(i,ft)}catch{}if(!t||!t.documentElement){t=C.createDocument(nt,`template`,null);try{t.documentElement.innerHTML=rt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),nt===P?_e.call(t,Re?`html`:`body`)[0]:Re?t.documentElement:a},z=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=re?re(e):e.ownerDocument;return he.call(n||e,e,(t?0:c.SHOW_ELEMENT)|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Lt=function(e){return e=Ar(e,ye,` `),e=Ar(e,be,` `),e=Ar(e,xe,` `),e},Rt=function(e){zt(e);let t=e.querySelectorAll?.call(e,`template`);t&&_r(t,e=>{Ht(e.content)&&Rt(e.content)})},zt=function(e){e.normalize();let t=z(e,!0),n=t.nextNode();for(;n;)n.data=Lt(n.data),n=t.nextNode()},Bt=function(e){let t=ne?ne(e):null;return typeof t!=`string`||F(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==te(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==v(e)||e.childNodes!==h(e)},Vt=function(e){if(!v||typeof e!=`object`||!e)return null;try{let t=v(e);return typeof t==`number`?t:null}catch{return null}},Ht=function(e){return Vt(e)===Q.documentFragment},Ut=function(e){return Vt(e)!==null};function B(e,n,r){e.length!==0&&_r(e,e=>{e.call(t,n,r,mt)})}let Wt=function(e,t,n){return!!(Le&&n===Q.element&&e.hasChildNodes()&&!Ut(e.firstElementChild)&&J(hi,e.textContent)&&J(hi,e.innerHTML)||Le&&xi[t]&&n===Q.element&&ae(e)===P&&(Ut(e.firstElementChild)||typeof e.textContent==`string`&&J(hi,e.textContent))||n===Q.processingInstruction||Le&&n===Q.comment&&J(gi,e.data))},Gt=function(e,t){return e instanceof RegExp?J(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Kt=function(e,t,n){if(!Ae[t]&&Qt(t)&&Gt(D.tagNameCheck,t))return!1;if(Je&&!Ze[t]&&!Ze[Dr(t)]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return Ct(e),!0},qt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ur(t):t},Jt=function(e,t){return e===t||g(e)!==null?!1:(Ye&&kt(e),!0)},Yt=function(e,n){if(Pt(e),B(w.beforeSanitizeElements,e,null),Jt(e,n))return!0;if(Bt(e))return Ct(e),!0;let r=F(ie(e)),i=y(e);if(T=qt(w.uponSanitizeElement,T,Oe,Be),B(w.uponSanitizeElement,e,{tagName:r,allowedTags:T}),Jt(e,n))return!0;if(Wt(e,r,i))return Ct(e),!0;if(Ae[r]||!(Me.tagCheck instanceof Function&&Me.tagCheck(r))&&!T[r]){let t=Kt(e,r,n);return t===!1&&(B(w.afterSanitizeElements,e,null),Jt(e,n))?!0:t}if(i===Q.element&&!St(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&J(_i,e.innerHTML))return Ct(e),!0;if(O&&i===Q.text){let n=e.textContent,r=Lt(n);n!==r&&(br(t.removed,{element:e.cloneNode()}),e.textContent=r)}return B(w.afterSanitizeElements,e,null),Jt(e,n)},Xt=function(e,t,r){if(je[t]||Ft(t,e)||Ge&&(t===`id`||t===`name`)&&(r in n||r in I))return!1;let i=E[t]||Me.attributeCheck instanceof Function&&Me.attributeCheck(t,e);if(Pe&&J(Se,t)||Ne&&J(Ce,t))return!0;if(!i)return Qt(e)&&Gt(D.tagNameCheck,e)&&Gt(D.attributeNameCheck,t,e)||t===`is`&&D.allowCustomizedBuiltInElements&&Gt(D.tagNameCheck,r);if($e[t])return!0;let a=Ar(r,Te,``);return J(De,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&jr(r,`data:`)===0&&M[e]||Fe&&!J(we,a)?!0:!r},Zt=X({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Qt=function(e){return!Zt[Dr(e)]&&J(Ee,e)},$t=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ue(r);case`TrustedScriptURL`:return fe(r)}return r},en=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Bt(e)||(Ct(e),!1)}catch{return Et(t,e),!1}},tn=function(e,t){return Le&&J(yi,t)?!0:Dr(e)===`attributename`&&jr(t,`href`)!==-1},nn=function(e,n){if(B(w.beforeSanitizeAttributes,e,null),Jt(e,n))return;let r=e.attributes;if(!r||Bt(e))return;E=qt(w.uponSanitizeAttribute,E,ke,Ve);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0},a=r.length,o=F(ie(e));for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=F(s),d=l,f=s===`value`?d:Mr(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,B(w.uponSanitizeAttribute,e,i),f=i.attrValue,Ke&&(u===`id`||u===`name`)&&jr(f,qe)!==0&&(Et(s,e,n),f=qe+f,p=!0),tn(s,f)?Et(s,e,n):i.forceKeepAttr||(i.keepAttr?!Ie&&J(vi,f)?Et(s,e,n):(O&&(f=Lt(f)),Xt(o,u,f)?(f=$t(o,u,c,f),f!==d&&en(e,s,c,f)&&p&&yr(t.removed)):Et(s,e,n)):Et(s,e,n))}B(w.afterSanitizeAttributes,e,null),Jt(e,n)},rn=function(e,t){Yt(e,t),nn(e,t),Ht(e.content)&&an(e.content)},an=function(e){let t=null,n=z(e);for(B(w.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(B(w.uponSanitizeShadowNode,t,null),rn(t,e),y(t)===Q.element){let e=_(t);Ht(e)&&(on(e),an(e))}O&&zt(e),B(w.afterSanitizeShadowDOM,e,null)},on=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){an(e.shadow);continue}let n=e.node,r=y(n)===Q.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ne?ne(n):null;if(typeof e==`string`&&F(e)===`template`){let e=n.content;Ht(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Ht(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(rt=!e,rt&&(e=``),typeof e!=`string`&&!Ut(e)&&(e=Wr(e),typeof e!=`string`))throw zr(`dirty is not a string, aborting`);if(!t.isSupported)return e;ze?(T=Be,E=Ve):gt(n),t.removed=[];let c=Ye&&typeof e!=`string`&&Ut(e),l=[],u=A;if(c){R(e);let t=ie(e);if(typeof t==`string`){let n=F(t);if(!T[n]||Ae[n])throw Tt(e),zr(`root node is forbidden and cannot be sanitized in-place`)}if(Bt(e))throw Tt(e),zr(`root node is clobbered and cannot be sanitized in-place`);l=At(e),A=wr()}else if(Ut(e))i=It(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===Q.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),on(i);else{if(!He&&!O&&!Re&&e.indexOf(`<`)===-1)return de(e);if(i=It(e),!i)return He?null:We?S:``}i&&k&&Ct(i.firstChild);let d=c?e:i;try{c&&on(e);let t=z(d);for(;o=t.nextNode();)rn(o,d);c&&Mt(e,l)}catch(t){throw c&&(Tt(e),jt(e,l)),t}finally{A=u}if(c){if(jt(e,l))throw zr(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return O&&Rt(e),e}if(He){if(O&&Rt(i),Ue)for(s=ge.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(E.shadowroot||E.shadowrootmode)&&(s=ve.call(r,s,!0)),s}let f=()=>Re?i.outerHTML:i.innerHTML,p=f();return O&&J(si,p)&&(zt(i),p=f()),Re&&T[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&J(pi,i.ownerDocument.doctype.name)&&(p=` `+p),de(p)},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(e),ze=!0,Be=T,Ve=E},t.clearConfig=function(){mt=null,ze=!1,Be=null,Ve=null,x=oe,S=``},t.isValidAttribute=function(e,t,n){mt||gt({});let r=F(e),i=F(t);return typeof n==`string`&&(tn(t,n)||!Ie&&J(vi,n))?!1:Xt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&q(w,e)&&br(w[e],t)},t.removeHook=function(e,t){if(q(w,e)){if(t!==void 0){let n=vr(w[e],t);return n===-1?void 0:Sr(w[e],n,1)[0]}return yr(w[e])}},t.removeHooks=function(e){q(w,e)&&(w[e]=[])},t.removeAllHooks=function(){w=wi()},t}var Oi=Di(),ki=[`critical`,`high`,`medium`,`low`,`info`],Ai={critical:`red`,high:`orange`,medium:`amber`,low:`blue`,info:`grey`},ji={critical:`严重`,high:`高危`,medium:`中危`,low:`低危`,info:`信息`},Mi={running:`blue`,pending:`amber`,queued:`amber`,paused:`grey`,success:`green`,succeeded:`green`,completed:`green`,done:`green`,failed:`red`,error:`red`,cancelled:`grey`,canceled:`grey`,stopped:`grey`,active:`green`,inactive:`grey`,online:`green`,offline:`grey`,open:`red`,closed:`green`,archived:`grey`};function Ni(e,t=`zh-CN`){if(!e)return`—`;let n=e instanceof Date?e:new Date(e);return Number.isFinite(n.getTime())?n.toLocaleString(t,{hour12:!1}):`—`}function Pi(e,t=`zh-CN`){if(!e)return`—`;let n=e instanceof Date?e:new Date(e);return Number.isFinite(n.getTime())?n.toLocaleDateString(t):`—`}function Fi(e,t){if(!e)return`—`;let n=new Date(e);if(!Number.isFinite(n.getTime()))return`—`;let r=Date.now()-n.getTime();return r<6e4?t?.(`common.justNow`,null,`刚刚`)||`刚刚`:r<36e5?t?.(`common.minutesAgo`,{n:Math.floor(r/6e4)},`${Math.floor(r/6e4)} 分钟前`):r<864e5?t?.(`common.hoursAgo`,{n:Math.floor(r/36e5)},`${Math.floor(r/36e5)} 小时前`):r<2592e6?t?.(`common.daysAgo`,{n:Math.floor(r/864e5)},`${Math.floor(r/864e5)} 天前`):Pi(e)}function Ii(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return`—`;if(t<1024)return`${t} B`;let n=[`KB`,`MB`,`GB`,`TB`],r=t/1024,i=0;for(;r>=1024&&i=100?0:1)} ${n[i]}`}function Li(e,t=`zh-CN`){let n=Number(e);return Number.isFinite(n)?n.toLocaleString(t):`—`}function Ri(e,t=1){let n=Number(e);return Number.isFinite(n)?`${(n*(n<=1?100:1)).toFixed(t)}%`:`—`}function zi(e){return Ai[String(e||``).toLowerCase()]||`grey`}function Bi(e){return Mi[String(e||``).toLowerCase()]||`grey`}function Vi(e,t=120){let n=String(e??``);return n.length>t?`${n.slice(0,t)}…`:n}var{Title:Hi,Text:Ui,Paragraph:Wi}=se;function Gi(e){xe.success({content:e,duration:2})}function Ki(e){xe.warning({content:e,duration:3})}function qi(e,t=`操作失败`){xe.error({content:et(e,t),duration:4})}function Ji({title:e,description:t,extra:n,children:r}){return(0,N.jsxs)(`header`,{className:`cs-page-header`,children:[(0,N.jsxs)(`div`,{className:`cs-page-header-main`,children:[(0,N.jsx)(Hi,{heading:3,className:`cs-page-title`,children:e}),t&&(0,N.jsx)(Ui,{type:`tertiary`,className:`cs-page-desc`,children:t}),r]}),n&&(0,N.jsx)(s,{className:`cs-page-header-extra`,wrap:!0,children:n})]})}function Yi({title:e,description:t,extra:n,children:r,className:i=``,bodyClassName:a=``}){return(0,N.jsxs)(v,{className:`cs-section-card ${i}`,title:e?(0,N.jsx)(`span`,{className:`cs-section-title`,children:e}):void 0,headerExtraContent:n,bordered:!1,children:[t&&(0,N.jsx)(Wi,{type:`tertiary`,className:`cs-section-desc`,children:t}),(0,N.jsx)(`div`,{className:a,children:r})]})}function Xi({metrics:e,columns:t=4}){return(0,N.jsx)(`div`,{className:`cs-stat-grid`,style:{"--cs-stat-columns":t},children:e.map(e=>(0,N.jsx)(Zi,{...e},e.id||e.label))})}function Zi({label:e,value:t,valueTitle:n,detail:r,tone:i,severity:a,icon:o,onClick:s,pressed:c,loading:l=!1}){let u=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`span`,{className:`cs-stat-head`,children:[(0,N.jsx)(Ui,{type:`tertiary`,className:`cs-stat-label`,children:e}),o&&(0,N.jsx)(`span`,{className:`cs-stat-icon ${i?`tone-${i}`:``}`,"aria-hidden":`true`,children:o})]}),(0,N.jsx)(d,{loading:l,placeholder:(0,N.jsx)(d.Title,{style:{width:`60%`,height:36,margin:`8px 0`}}),children:(0,N.jsx)(`span`,{className:`cs-stat-value ${i?`tone-${i}`:``}`,title:n,children:t??`—`})}),r&&(0,N.jsx)(`span`,{className:`cs-stat-detail`,children:r})]});return s?(0,N.jsx)(m,{className:`cs-stat-card is-clickable`,theme:`borderless`,onClick:s,"aria-label":String(e),"aria-pressed":c,"data-severity":a,children:u}):(0,N.jsx)(v,{className:`cs-stat-card`,"data-severity":a,bordered:!1,children:u})}function Qi({columns:e,dataSource:t,rowKey:n=`id`,loading:r,pagination:i,emptyText:a,onRefresh:o,toolbar:s,size:c=`default`,className:l=``,...u}){let d=I(),f=i!==!1&&{pageSize:10,showSizeChanger:!0,pageSizeOpts:[10,20,50,100],showTotal:!0,...i||{}};return(0,N.jsxs)(`div`,{className:`cs-table-wrap ${l}`,children:[(s||o)&&(0,N.jsxs)(`div`,{className:`cs-table-toolbar`,children:[(0,N.jsx)(`div`,{className:`cs-table-toolbar-main`,children:s}),o&&(0,N.jsx)(m,{icon:(0,N.jsx)(Ee,{}),theme:`borderless`,onClick:o,loading:r,children:d(`common.refresh`,null,`刷新`)})]}),(0,N.jsx)(`div`,{className:`cs-table-scroll`,children:(0,N.jsx)(ve,{columns:e,dataSource:t||[],rowKey:n,loading:r,pagination:f,size:c,empty:(0,N.jsx)(b,{image:(0,N.jsx)(D,{size:`extra-large`}),title:a||d(`common.noData`,null,`暂无数据`),description:null,className:`cs-table-empty`}),...u})})]})}function $i({error:e,onRetry:t}){let n=I();return e?(0,N.jsx)(Ae,{type:`danger`,bordered:!0,closeIcon:null,className:`cs-error-banner`,description:(0,N.jsxs)(s,{wrap:!0,children:[(0,N.jsx)(`span`,{children:et(e,n(`common.loadFailed`,null,`加载失败`))}),t&&(0,N.jsx)(m,{size:`small`,onClick:t,children:n(`common.refresh`,null,`刷新`)})]})}):null}function ea({severity:e,size:t=`small`}){let n=String(e||``).toLowerCase();return(0,N.jsx)(g,{size:t,color:zi(n),shape:`circle`,className:`cs-severity-tag`,"data-severity":ki.includes(n)?n:void 0,children:ji[n]||e||`—`})}function ta({status:e,label:t,size:n=`small`}){let r=String(e||``).toLowerCase();return(0,N.jsx)(g,{size:n,color:Bi(r),shape:`square`,children:t||e||`—`})}function na({text:e,label:t,size:n=`default`,theme:r=`borderless`}){let i=I();return(0,N.jsx)(m,{size:n,theme:r,icon:(0,N.jsx)(_,{}),"aria-label":t||i(`common.copy`,null,`复制`),onClick:async()=>{try{await navigator.clipboard.writeText(String(e??``)),Gi(i(`common.copied`,null,`已复制`))}catch(e){qi(e,i(`common.copyFailed`,null,`复制失败`))}},children:t})}function ra({content:e,className:t=``}){let n=(0,k.useMemo)(()=>{let t=W.parse(String(e??``),{breaks:!0,gfm:!0});return Oi.sanitize(t,{ADD_ATTR:[`target`,`rel`]})},[e]);return(0,N.jsx)(`div`,{className:`cs-markdown ${t}`,dangerouslySetInnerHTML:{__html:n}})}function ia({value:e,collapsed:t=!1,title:n}){let[r,i]=(0,k.useState)(!t),a=I(),o=(0,k.useMemo)(()=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},[e]);return(0,N.jsxs)(`div`,{className:`cs-json-viewer`,children:[(0,N.jsxs)(`div`,{className:`cs-json-viewer-head`,children:[(0,N.jsx)(Ui,{strong:!0,children:n||`JSON`}),(0,N.jsxs)(s,{spacing:4,children:[(0,N.jsx)(na,{text:o}),(0,N.jsx)(m,{theme:`borderless`,size:`small`,icon:r?(0,N.jsx)(f,{}):(0,N.jsx)(je,{}),"aria-expanded":r,"aria-label":a(r?`common.collapse`:`common.expand`,null,r?`收起`:`展开`),onClick:()=>i(e=>!e)})]})]}),(0,N.jsx)(ge,{isOpen:r,children:(0,N.jsx)(`pre`,{className:`cs-json-viewer-body`,children:o})})]})}function aa({items:e,columns:t=2}){return(0,N.jsx)(a,{className:`cs-description-list`,layout:`horizontal`,align:`plain`,column:t,data:e.filter(Boolean).map(e=>({key:e.label,value:e.value??`—`}))})}function oa({title:e,content:t,okText:n,danger:r=!0,onOk:i}){Oe.confirm({title:e,content:t,okText:n||`确定`,cancelText:`取消`,okButtonProps:r?{type:`danger`}:void 0,onOk:i})}var sa=`a[href], button, input, select, textarea, iframe, [tabindex], [contenteditable="true"]`;function ca({title:e,visible:t,onCancel:n,width:r=560,footer:i,children:a,className:o,closeOnEsc:s=!0,mask:c=!0,maskClosable:l=!0,onOk:u,formId:d,okText:f,cancelText:p,okButtonProps:ee,cancelButtonProps:h,confirmLoading:g,..._}){let te=I(),v=(0,k.useRef)(null),[ne,re]=(0,k.useState)(!1),y=g??ne,ie=(0,k.useCallback)(e=>{let t=e?.closest(`[role="dialog"]`);if(!t)return;v.current=t;let n=document.activeElement;return c&&(t.setAttribute(`aria-modal`,`true`),queueMicrotask(()=>{v.current===t&&!t.contains(document.activeElement)&&t.focus({preventScroll:!0})})),()=>{if(v.current=null,!c)return;t.removeAttribute(`aria-modal`);let e=document.activeElement;n?.isConnected&&(t.contains(e)||e===document.body)&&n.focus({preventScroll:!0})}},[c]);(0,k.useEffect)(()=>{if(!t)return;let e=e=>{let t=v.current,r=document.activeElement;if(e.defaultPrevented||!t?.contains(r)||(e.key===`Escape`&&s&&n&&(e.preventDefault(),n(e)),e.key!==`Tab`||!c))return;let i=[...t.querySelectorAll(sa)].filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.getClientRects().length),a=i[0],o=i.at(-1);(!a||(e.shiftKey?r===a||r===t:r===o))&&(e.preventDefault(),(e.shiftKey?o:a)?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,c,n,t]);let b=e=>{if(y)return;let t=u?.(e);if(g===void 0&&typeof t?.then==`function`){re(!0);let e=()=>re(!1);Promise.resolve(t).then(e,e)}},ae=i===void 0&&(u||d)?(0,N.jsxs)(N.Fragment,{children:[n&&(0,N.jsx)(m,{type:`tertiary`,onClick:n,...h,children:p||te(`common.cancel`,null,`取消`)}),(0,N.jsx)(m,{theme:`solid`,type:`primary`,...ee,loading:y,disabled:y||ee?.disabled,onClick:d?void 0:b,form:d,htmlType:d?`submit`:`button`,children:f||te(`common.ok`,null,`确定`)})]}):i;return(0,N.jsxs)(fe,{title:e,visible:t,onCancel:n,width:r,footer:ae,mask:c,maskClosable:l&&!y,closeOnEsc:!1,className:`cs-drawer ${o||``}`,"aria-label":typeof e==`string`?e:void 0,..._,children:[(0,N.jsx)(`span`,{hidden:!0,ref:ie}),a]})}function la(e,t=[],{initial:n=null,skip:r=!1}={}){let[i,a]=(0,k.useState)(n),[o,s]=(0,k.useState)(!r),[c,l]=(0,k.useState)(null),u=(0,k.useRef)(0),d=(0,k.useRef)(null),f=(0,k.useRef)(!1),p=(0,k.useCallback)(async(t={})=>{if(r||t.silent&&!t.force&&f.current)return null;d.current?.abort();let n=new AbortController;d.current=n,f.current=!0;let i=++u.current;t.silent||s(!0),l(null);try{let t=await Ye(n.signal,()=>e({signal:n.signal}));return!n.signal.aborted&&i===u.current&&a(t),t}catch(e){return n.signal.aborted||i===u.current&&l(e),null}finally{d.current===n&&(d.current=null,f.current=!1),!n.signal.aborted&&i===u.current&&s(!1)}},t);return(0,k.useEffect)(()=>{if(r)d.current?.abort(),d.current=null,f.current=!1,s(!1);else return p(),()=>{u.current+=1,d.current?.abort(),d.current=null,f.current=!1}},[p,r]),{data:i,setData:a,loading:o,error:c,reload:p}}function ua(e,t=300){let[n,r]=(0,k.useState)(e);return(0,k.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function da(e,t){let n=(0,k.useRef)(e);(0,k.useEffect)(()=>{n.current=e},[e]),(0,k.useEffect)(()=>{if(!t)return;let e=setInterval(()=>n.current(),t);return()=>clearInterval(e)},[t])}function fa(e,t){let[n,r]=(0,k.useState)(()=>{try{let n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}});return(0,k.useEffect)(()=>{try{localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}var{Text:pa}=se,ma={position:`right`,contentClassName:`cs-nav-flyout`};function ha(){let[e,t]=(0,k.useState)(()=>window.matchMedia(`(max-width: 900px)`).matches);return(0,k.useEffect)(()=>{let e=window.matchMedia(`(max-width: 900px)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function ga(e,t,n,r){return e.filter(e=>(!e.anyPermission||r(e.anyPermission))&&(!e.permission||n(e.permission))).map(e=>{let r=e.children?e.children.filter(e=>!e.permission||n(e.permission)):null;return r&&r.length===0?null:{itemKey:e.id,text:t(e.i18n,null,e.fallback),icon:e.icon?(0,N.jsx)(e.icon,{"aria-hidden":`true`}):void 0,items:r?r.map(e=>({itemKey:e.id,text:t(e.i18n,null,e.fallback)})):void 0}}).filter(Boolean)}function _a(){let{preference:e,setPreference:n}=Ct(),r=I(),a=[{key:`system`,label:r(`theme.system`,null,`跟随系统`)},{key:`light`,label:r(`theme.light`,null,`浅色`)},{key:`dark`,label:r(`theme.dark`,null,`暗色`)}],o=a.find(t=>t.key===e)||a[0];return(0,N.jsx)(i,{trigger:`click`,position:`bottomRight`,menu:a.map(t=>({node:`item`,name:t.label,active:t.key===e,onClick:()=>n(t.key)})),children:(0,N.jsx)(m,{theme:`borderless`,type:`tertiary`,icon:e===`dark`?(0,N.jsx)(pe,{}):(0,N.jsx)(t,{}),"aria-label":o.label})})}function va(){let{lang:e,setLanguage:t}=mt();return(0,N.jsx)(i,{trigger:`click`,position:`bottomRight`,menu:it.map(n=>({node:`item`,name:n.label,active:n.id===e,onClick:()=>t(n.id)})),children:(0,N.jsx)(m,{theme:`borderless`,type:`tertiary`,icon:(0,N.jsx)(le,{}),"aria-label":e})})}function ya({navigate:e}){let t=I(),[r,i]=(0,k.useState)([]),[a,o]=(0,k.useState)(0),[s,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(!1),f=(0,k.useRef)(null),p=(0,k.useRef)(!1),h=async({force:e=!1}={})=>{if(!e&&p.current)return;f.current?.abort();let t=new AbortController;f.current=t,p.current=!0;try{let e=await M.get(`/notifications/summary`,{limit:80,lang:document.documentElement.lang||`zh-CN`},{signal:t.signal});if(t.signal.aborted)return;let n=Array.isArray(e?.items)?e.items:[];i(n),o(e?.unreadCount??n.filter(e=>!e.read).length)}catch{}finally{f.current===t&&(f.current=null,p.current=!1)}};(0,k.useEffect)(()=>(h({force:!0}),()=>{f.current?.abort(),f.current=null,p.current=!1}),[]),da(()=>h(),6e4);let g=async()=>{let e=r.filter(e=>!e.read).map(e=>e.id).filter(Boolean);if(e.length&&!u){d(!0);try{await M.post(`/notifications/read`,{eventIds:e}),await h({force:!0})}catch(e){qi(e)}finally{d(!1)}}},_=t=>{l(!1),t.type===`vulnerability_created`&&t.vulnerabilityId?e(`/vulnerabilities?id=${encodeURIComponent(t.vulnerabilityId)}`):(t.type===`task_completed`||t.type===`long_running_tasks`)&&t.conversationId?e(`/chat?conversation=${encodeURIComponent(t.conversationId)}`):t.type===`task_failed`?e(`/mcp-monitor`):t.type===`hitl_pending`?e(`/hitl`):t.type===`c2_session_online`&&e(`/c2-sessions`)},te=(0,N.jsxs)(`div`,{className:`cs-notification-panel`,children:[(0,N.jsxs)(`div`,{className:`cs-notification-head`,children:[(0,N.jsx)(pa,{strong:!0,children:t(`notifications.title`,null,`通知`)}),(0,N.jsx)(m,{size:`small`,theme:`borderless`,onClick:g,loading:u,children:t(`notifications.markAllRead`,null,`全部标记已读`)})]}),(0,N.jsxs)(`div`,{className:`cs-notification-list`,children:[r.length===0&&(0,N.jsx)(pa,{type:`tertiary`,children:t(`notifications.empty`,null,`暂无新通知`)}),r.map(e=>(0,N.jsxs)(`button`,{type:`button`,className:`cs-notification-item`,onClick:()=>_(e),children:[(0,N.jsx)(`span`,{className:`cs-notification-dot level-${e.level||`p2`}`}),(0,N.jsxs)(`span`,{className:`cs-notification-body`,children:[(0,N.jsx)(`span`,{className:`cs-notification-title`,children:e.title||e.message||e.type}),(0,N.jsxs)(`span`,{className:`cs-notification-meta`,children:[e.ts?Ni(e.ts):``,e.count>1?` · ×${e.count}`:``]})]})]},e.id||`${e.type}-${e.ts}`))]})]});return(0,N.jsx)(c,{content:te,trigger:`click`,position:`bottomRight`,visible:s,onVisibleChange:l,children:(0,N.jsx)(n,{count:a||null,overflowCount:99,type:`danger`,children:(0,N.jsx)(m,{theme:`borderless`,type:`tertiary`,icon:(0,N.jsx)(ee,{}),"aria-label":t(`notifications.title`,null,`通知`)})})})}function ba({navigate:e}){let{user:t,logout:n,refresh:r}=rt(),a=I(),[s,c]=(0,k.useState)(!1),l=(0,k.useId)(),[u,d]=(0,k.useState)(null),[f,p]=(0,k.useState)(!1);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(i,{trigger:`click`,position:`bottomRight`,menu:[{node:`title`,name:t?.display_name||t?.username||`admin`},{node:`item`,name:a(`auth.changePassword`,null,`修改密码`),icon:(0,N.jsx)(T,{}),onClick:()=>c(!0)},{node:`item`,name:a(`auth.refreshSession`,null,`刷新会话权限`),onClick:()=>r().then(()=>Gi(a(`auth.sessionRefreshed`,null,`会话已刷新`))).catch(e=>qi(e))},{node:`divider`},{node:`item`,name:a(`auth.logout`,null,`退出登录`),icon:(0,N.jsx)(o,{}),onClick:async()=>{await n(),e(`/dashboard`)}}],children:(0,N.jsxs)(m,{theme:`borderless`,type:`tertiary`,className:`cs-user-trigger`,"aria-label":a(`auth.userMenu`,null,`用户菜单`),children:[(0,N.jsx)(oe,{size:`extra-small`,color:`blue`,children:(t?.display_name||t?.username||`A`).slice(0,1).toUpperCase()}),(0,N.jsx)(`span`,{className:`cs-user-name`,children:t?.display_name||t?.username||`admin`})]})}),(0,N.jsx)(ca,{title:a(`auth.changePassword`,null,`修改密码`),visible:s,onCancel:()=>c(!1),formId:l,okText:a(`common.save`,null,`保存`),confirmLoading:f,width:420,children:(0,N.jsxs)(C,{id:l,onSubmit:async e=>{p(!0);try{await M.post(`/auth/change-password`,{oldPassword:e.oldPassword,newPassword:e.newPassword}),Gi(a(`auth.passwordChanged`,null,`密码已更新`)),c(!1),u?.reset()}catch(e){qi(e,a(`auth.changeFailed`,null,`修改密码失败`))}finally{p(!1)}},getFormApi:d,children:[(0,N.jsx)(C.Input,{field:`oldPassword`,label:a(`auth.currentPassword`,null,`当前密码`),type:`password`,rules:[{required:!0,message:a(`auth.required`,null,`必填`)}]}),(0,N.jsx)(C.Input,{field:`newPassword`,label:a(`auth.newPassword`,null,`新密码`),type:`password`,rules:[{required:!0,min:8,message:a(`auth.passwordMin`,null,`至少 8 位`)}]}),(0,N.jsx)(C.Input,{field:`confirmPassword`,label:a(`auth.confirmPassword`,null,`确认新密码`),type:`password`,rules:[{required:!0,message:a(`auth.required`,null,`必填`)},{validator:(e,t)=>t===u?.getValue(`newPassword`),message:a(`auth.passwordMismatch`,null,`两次输入不一致`)}]})]})})]})}function xa(){let{session:e,hasPermission:t,hasAnyPermission:n}=rt(),r=(0,k.useId)(),i=I(),a=O(),o=Ie(),c=ha(),[l,u]=(0,k.useState)(()=>localStorage.getItem(`csai-nav-collapsed`)===`1`),[d,f]=(0,k.useState)(!1),[p,ee]=(0,k.useState)([]),g=a.pathname.replace(/^\//,``).split(`/`)[0]||`dashboard`,_=Dt(g),te=(0,k.useMemo)(()=>[g],[g]),v=(0,k.useMemo)(()=>ga(wt,i,t,n),[i,t,n]);(0,k.useEffect)(()=>{f(!1),_?.parent&&ee(e=>e.includes(_.parent)?e:[...e,_.parent])},[a.pathname,_?.parent]),(0,k.useEffect)(()=>{document.title=`${_?i(_.i18n,null,_.fallback):`工作台`} · CyberStrikeAI`},[_,i]);let ne=({itemKey:e})=>{let t=a.search,n=[`chat`,`vulnerabilities`,`settings`,`deep-assessments`].includes(e)&&g===e?t:``;o(`/${e}${n}`)},re=()=>{u(e=>(localStorage.setItem(`csai-nav-collapsed`,e?`0`:`1`),!e))},b=l&&!c,ae=!b&&e?.appVersion,x=(0,N.jsxs)(`div`,{className:`cs-sidebar-inner ${b?`is-compact`:``}`,children:[(0,N.jsxs)(m,{className:`cs-brand`,theme:`borderless`,type:`tertiary`,onClick:()=>o(`/dashboard`),"aria-label":`CyberStrikeAI`,"aria-describedby":ae?r:void 0,children:[(0,N.jsx)(`img`,{src:`/static/logo.png`,alt:``,className:`cs-brand-logo`}),!b&&(0,N.jsxs)(`span`,{className:`cs-brand-copy`,children:[(0,N.jsxs)(`span`,{className:`cs-brand-name`,children:[`CyberStrike`,(0,N.jsx)(`span`,{children:`AI`})]}),ae&&(0,N.jsx)(`span`,{id:r,className:`cs-brand-version`,dir:`ltr`,title:`${i(`header.version`,null,`当前版本`)} ${ae}`,children:ae})]})]}),(0,N.jsx)(`div`,{className:`cs-nav-scroll`,children:Tt.map(e=>{let t=v.filter(t=>e.pages.includes(t.itemKey));return t.length?(0,N.jsxs)(`section`,{className:`cs-nav-section`,"aria-label":i(e.i18n,null,e.fallback),children:[!b&&(0,N.jsx)(`div`,{className:`cs-nav-section-label`,children:i(e.i18n,null,e.fallback)}),(0,N.jsx)(ke,{className:`cs-nav`,style:{width:`100%`},items:t,selectedKeys:te,onSelect:ne,isCollapsed:b,subDropdownProps:ma,openKeys:p,onOpenChange:({openKeys:e})=>ee(e)})]},e.id):null})}),!c&&(0,N.jsx)(`div`,{className:`cs-nav-footer`,children:(0,N.jsx)(m,{theme:`borderless`,type:`tertiary`,block:!0,icon:b?(0,N.jsx)(h,{}):(0,N.jsx)(ie,{}),"aria-label":i(b?`nav.expand`:`nav.collapse`,null,b?`展开菜单`:`收起菜单`),onClick:re,children:!b&&i(`nav.collapse`,null,`收起菜单`)})})]}),S=_?i(_.i18n,null,_.fallback):`CyberStrikeAI`,oe=_?.parent?Dt(_.parent):null,se=oe?i(oe.i18n,null,oe.fallback):``;return(0,N.jsxs)(`div`,{className:`cs-shell ${l&&!c?`is-collapsed`:``}`,children:[!c&&(0,N.jsx)(`aside`,{className:`cs-sider`,children:x}),c&&(0,N.jsx)(fe,{visible:d,onCancel:()=>f(!1),placement:`left`,width:264,title:i(`nav.navigation`,null,`导航`),bodyStyle:{padding:0},className:`cs-mobile-nav`,children:x}),(0,N.jsxs)(`div`,{className:`cs-main`,children:[(0,N.jsxs)(`header`,{className:`cs-header`,children:[(0,N.jsxs)(`div`,{className:`cs-header-left`,children:[c&&(0,N.jsx)(m,{theme:`borderless`,icon:(0,N.jsx)(w,{}),onClick:()=>f(!0),"aria-label":i(`common.expandPanel`,null,`展开面板`)}),(0,N.jsxs)(y,{className:`cs-header-crumb`,compact:!1,children:[(0,N.jsx)(y.Item,{onClick:()=>o(`/dashboard`),children:i(`nav.groupWorkspace`,null,`工作台`)}),se&&(0,N.jsx)(y.Item,{children:se}),(0,N.jsx)(y.Item,{children:S})]})]}),(0,N.jsxs)(s,{className:`cs-header-actions`,spacing:4,children:[(0,N.jsx)(ya,{navigate:o}),(0,N.jsx)(va,{}),(0,N.jsx)(_a,{}),(0,N.jsx)(ba,{navigate:o})]})]}),(0,N.jsx)(`main`,{className:`cs-content ${g===`chat`?`cs-content-workspace`:``}`,id:`main-content`,children:(0,N.jsx)(Fe,{context:{navigate:o,pageId:g,mobile:c}})})]})]})}var{Title:Sa,Text:Ca,Paragraph:wa}=se;function Ta(){let{login:e}=rt(),t=I(),[n,r]=(0,k.useState)(!1),[i,a]=(0,k.useState)(``);async function o(n){r(!0),a(``);try{await e(n.username,n.password)}catch(e){a(et(e,t(`login.loginFailed`,null,`登录失败`)))}finally{r(!1)}}return(0,N.jsxs)(`main`,{className:`cs-login-page`,children:[(0,N.jsxs)(`section`,{className:`cs-login-story`,children:[(0,N.jsxs)(`div`,{className:`cs-login-brand`,children:[(0,N.jsx)(`img`,{src:`/static/logo.png`,alt:``,className:`cs-login-logo`}),(0,N.jsxs)(`span`,{className:`cs-brand-name`,children:[`CyberStrike`,(0,N.jsx)(`span`,{children:`AI`})]})]}),(0,N.jsxs)(`div`,{className:`cs-login-intro`,children:[(0,N.jsx)(`span`,{className:`cs-login-emblem`,"aria-hidden":`true`,children:(0,N.jsx)(be,{size:`extra-large`})}),(0,N.jsx)(Sa,{heading:1,className:`cs-login-headline`,children:t(`login.headline`,null,`让每一次探索,都有据可循。`)}),(0,N.jsx)(wa,{type:`tertiary`,children:t(`login.intro`,null,`从目标梳理到证据归档,在一个工作台中完成你的安全研究。`)}),(0,N.jsxs)(`div`,{className:`cs-login-features`,children:[(0,N.jsxs)(`div`,{className:`cs-login-feature`,children:[(0,N.jsx)(u,{size:`large`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:t(`login.projectTitle`,null,`围绕项目协作`)}),t(`login.projectHint`,null,`跨会话共享目标、上下文与研究进展`)]})]}),(0,N.jsxs)(`div`,{className:`cs-login-feature`,children:[(0,N.jsx)(S,{size:`large`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:t(`login.assessmentTitle`,null,`让探索持续推进`)}),t(`login.assessmentHint`,null,`规划、执行与人工复核,始终保持可控`)]})]}),(0,N.jsxs)(`div`,{className:`cs-login-feature`,children:[(0,N.jsx)(Ce,{size:`large`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:t(`login.evidenceTitle`,null,`以证据支撑结论`)}),t(`login.evidenceHint`,null,`保留发现、来源与验收记录`)]})]})]})]}),(0,N.jsx)(Ca,{type:`tertiary`,size:`small`,children:t(`login.platformTagline`,null,`AI 驱动的安全研究工作台`)})]}),(0,N.jsx)(`section`,{className:`cs-login-form-panel`,children:(0,N.jsxs)(v,{className:`cs-login-card`,bordered:!1,children:[(0,N.jsx)(Sa,{heading:2,className:`cs-login-form-heading`,children:t(`login.welcome`,null,`欢迎回来`)}),(0,N.jsx)(Ca,{type:`tertiary`,children:t(`login.welcomeHint`,null,`登录你的安全工作台,继续探索。`)}),(0,N.jsxs)(C,{onSubmit:o,className:`cs-login-form`,children:[i&&(0,N.jsx)(Ae,{type:`danger`,description:i,closeIcon:null,className:`cs-error-banner`}),(0,N.jsx)(C.Input,{field:`username`,label:t(`login.username`,null,`用户名`),prefix:(0,N.jsx)(Se,{}),placeholder:t(`login.usernamePlaceholder`,null,`请输入用户名`),size:`large`,autoComplete:`username`,rules:[{required:!0,message:t(`login.usernameRequired`,null,`请输入用户名`)}]}),(0,N.jsx)(C.Input,{field:`password`,label:t(`login.password`,null,`密码`),prefix:(0,N.jsx)(me,{}),type:`password`,size:`large`,autoComplete:`current-password`,placeholder:t(`login.passwordPlaceholder`,null,`请输入密码`),rules:[{required:!0,message:t(`login.passwordRequired`,null,`请输入密码`)}]}),(0,N.jsx)(m,{htmlType:`submit`,theme:`solid`,type:`primary`,size:`large`,block:!0,loading:n,children:t(`login.submit`,null,`登录`)})]}),(0,N.jsx)(Ca,{type:`tertiary`,className:`cs-login-note`,children:t(`login.authorizedOnly`,null,`仅在明确授权的范围内开展安全测试`)})]})})]})}var Ea=`modulepreload`,Da=function(e){return`/static/app/`+e},Oa={},ka=function(e){return e.pathname.endsWith(`.css`)},Aa=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Da(t,n);let r=s(t),i=ka(r);return Aa(Oa,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ea,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ja={dashboard:(0,k.lazy)(()=>$(()=>import(`./dashboard-C1bTnf9G.js`),__vite__mapDeps([0,1,2,3,4,5]))),chat:(0,k.lazy)(()=>$(()=>import(`./chat-B6cOdvxB.js`),__vite__mapDeps([6,1,2,3,4,7,8,9,10,11]))),"deep-assessments":(0,k.lazy)(()=>$(()=>import(`./deep-assessments-D9Eh-P7-.js`),__vite__mapDeps([12,1,2,3,4,9,8,13,14,15]))),hitl:(0,k.lazy)(()=>$(()=>import(`./hitl-BXv08yGA.js`),__vite__mapDeps([16,1,2,3,4,17]))),"tool-guard":(0,k.lazy)(()=>$(()=>import(`./tool-guard-YZfmNQZ9.js`),__vite__mapDeps([18,1,2,3,4,19]))),projects:(0,k.lazy)(()=>$(()=>import(`./projects-CGHGDxFZ.js`),__vite__mapDeps([20,1,2,3,4,8,13,14,21,10,22,23]))),"asset-overview":(0,k.lazy)(()=>$(()=>import(`./asset-overview-CJNzTj95.js`),__vite__mapDeps([24,1,2,3,4,25,22,26]))),"asset-library":(0,k.lazy)(()=>$(()=>import(`./asset-library-Be1fEX32.js`),__vite__mapDeps([27,1,2,3,4,10,22,25,21,28]))),"info-collect":(0,k.lazy)(()=>$(()=>import(`./info-collect-Cz_FrKnl.js`),__vite__mapDeps([29,1,2,3,4,10,25,22,30]))),vulnerabilities:(0,k.lazy)(()=>$(()=>import(`./vulnerabilities-CLjF5w8M.js`),__vite__mapDeps([31,1,2,3,4,7,10,32]))),tasks:(0,k.lazy)(()=>$(()=>import(`./tasks-CMXgkYzg.js`),__vite__mapDeps([33,1,2,3,4,10,34]))),workflows:(0,k.lazy)(()=>$(()=>import(`./workflows-D0hIK8-5.js`),__vite__mapDeps([35,1,2,3,4,36]))),webshell:(0,k.lazy)(()=>$(()=>import(`./webshell-CIHejtP-.js`),__vite__mapDeps([37,1,2,3,4,10,38]))),"c2-listeners":(0,k.lazy)(()=>$(()=>import(`./c2-listeners-D48uHMNt.js`),__vite__mapDeps([39,1,2,3,4,40,41,42,10,43]))),"c2-sessions":(0,k.lazy)(()=>$(()=>import(`./c2-sessions-B3T6vNBp.js`),__vite__mapDeps([44,1,2,3,4,40,41,42,45]))),"c2-tasks":(0,k.lazy)(()=>$(()=>import(`./c2-tasks-BPlX1VSv.js`),__vite__mapDeps([46,1,2,3,4,40,41,42,47]))),"c2-payloads":(0,k.lazy)(()=>$(()=>import(`./c2-payloads-DkiAq8H3.js`),__vite__mapDeps([48,1,2,3,4,40,41,42,49]))),"c2-events":(0,k.lazy)(()=>$(()=>import(`./c2-events-DBkH1Ps2.js`),__vite__mapDeps([50,1,2,3,4,40,41,42,51]))),"c2-profiles":(0,k.lazy)(()=>$(()=>import(`./c2-profiles-B9vlWJDM.js`),__vite__mapDeps([52,1,2,3,4,40,41,53]))),"chat-files":(0,k.lazy)(()=>$(()=>import(`./chat-files-DvYZqigo.js`),__vite__mapDeps([54,1,2,3,4,55]))),"mcp-monitor":(0,k.lazy)(()=>$(()=>import(`./mcp-monitor-BktPgkRb.js`),__vite__mapDeps([56,1,2,3,4,57]))),"mcp-management":(0,k.lazy)(()=>$(()=>import(`./mcp-management-D08mlkbU.js`),__vite__mapDeps([58,1,2,3,4,59]))),"knowledge-retrieval-logs":(0,k.lazy)(()=>$(()=>import(`./knowledge-retrieval-logs-EGeeNq1a.js`),__vite__mapDeps([60,1,2,3,4]))),"knowledge-management":(0,k.lazy)(()=>$(()=>import(`./knowledge-management-C95HlQvj.js`),__vite__mapDeps([61,1,2,3,4]))),"skills-monitor":(0,k.lazy)(()=>$(()=>import(`./skills-monitor-DDzWiLjF.js`),__vite__mapDeps([62,1,3,2,4]))),"skills-management":(0,k.lazy)(()=>$(()=>import(`./skills-management-D14i0o-C.js`),__vite__mapDeps([63,1,2,3,4]))),"agents-management":(0,k.lazy)(()=>$(()=>import(`./agents-management-D1UoWtYg.js`),__vite__mapDeps([64,1,2,3,4]))),"roles-management":(0,k.lazy)(()=>$(()=>import(`./roles-management-DHztKoq9.js`),__vite__mapDeps([65,1,2,3,4,66]))),"platform-rbac":(0,k.lazy)(()=>$(()=>import(`./platform-rbac-CGyXELTK.js`),__vite__mapDeps([67,1,2,3,4]))),settings:(0,k.lazy)(()=>$(()=>import(`./settings-ClSXlHvg.js`),__vite__mapDeps([68,1,2,3,4,9,69]))),"api-docs":(0,k.lazy)(()=>$(()=>import(`./api-docs-B5EmdKmF.js`),__vite__mapDeps([70,1,2,3,4,71])))},{Title:Ma,Text:Na}=se;function Pa(){return(0,N.jsx)(`div`,{className:`cs-page-loading`,children:(0,N.jsx)(x,{size:`large`})})}function Fa({code:e,title:t,description:n}){return(0,N.jsxs)(`div`,{className:`cs-page-loading`,style:{flexDirection:`column`,gap:8},children:[(0,N.jsx)(Ma,{heading:2,style:{margin:0},children:e}),(0,N.jsx)(Na,{strong:!0,children:t}),n&&(0,N.jsx)(Na,{type:`tertiary`,children:n})]})}function Ia(){let{pageId:e}=Ve(),{hasPermission:t,hasAnyPermission:n}=rt(),r=I(),i=Dt(e),a=e?ja[e]:null,o=(0,k.useMemo)(()=>{if(!i)return!0;if(i.anyPermission)return n(i.anyPermission);if(i.permission)return t(i.permission);let e=i.parent?Dt(i.parent):null;return!e?.anyPermission||n(e.anyPermission)},[i,t,n]);return i?a?o?(0,N.jsx)(k.Suspense,{fallback:(0,N.jsx)(Pa,{}),children:(0,N.jsx)(a,{})}):(0,N.jsx)(Fa,{code:`403`,title:r(`common.forbidden`,null,`当前账号没有访问该页面的权限`)}):(0,N.jsx)(Fa,{code:`404`,title:i.fallback,description:r(`common.pagePending`,null,`页面尚未注册`)}):(0,N.jsx)(Fa,{code:`404`,title:r(`common.pageNotFound`,null,`页面不存在`)})}function La(){let{authenticated:e,checking:t}=rt();return t?(0,N.jsx)(Pa,{}):e?(0,N.jsx)(Re,{children:(0,N.jsxs)(ze,{element:(0,N.jsx)(xa,{}),children:[(0,N.jsx)(ze,{path:`/`,element:(0,N.jsx)(Pe,{to:`/dashboard`,replace:!0})}),(0,N.jsx)(ze,{path:`/system-update`,element:(0,N.jsx)(Pe,{to:`/settings?section=update`,replace:!0})}),(0,N.jsx)(ze,{path:`/:pageId`,element:(0,N.jsx)(Ia,{})}),(0,N.jsx)(ze,{path:`*`,element:(0,N.jsx)(Pe,{to:`/dashboard`,replace:!0})})]})}):(0,N.jsx)(Ta,{})}var Ra={"zh-CN":re,"en-US":we,"ru-RU":ye,"ar-SA":De};function za(){let{lang:e}=mt();return(0,N.jsx)(_e,{locale:Ra[e]||re,direction:e===`ar-SA`?`rtl`:`ltr`,children:(0,N.jsx)(nt,{children:(0,N.jsx)(Le,{children:(0,N.jsx)(La,{})})})})}(0,He.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(k.StrictMode,{children:(0,N.jsx)(St,{children:(0,N.jsx)(F,{children:(0,N.jsx)(za,{})})})}));export{Vi as A,j as B,ji as C,Li as D,Ni as E,rt as F,M as I,Qe as L,it as M,mt as N,Ri as O,I as P,et as R,Ki as S,Ii as T,Xi as _,la as a,qi as b,ca as c,aa as d,ra as f,Zi as g,ea as h,fa as i,Ct as j,Fi as k,$i as l,Yi as m,ua as n,na as o,Ji as p,da as r,Qi as s,$ as t,ia as u,ta as v,ki as w,Gi as x,oa as y,$e as z};