spec-cat 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{C5HhonQV.js → -2tR8Cph.js} +1 -1
- package/.output/public/_nuxt/{DoFlIjCg.js → BBA9sqLe.js} +1 -1
- package/.output/public/_nuxt/BdnBYIQg.js +85 -0
- package/.output/public/_nuxt/{eqa72KqC.js → BjExtU_8.js} +1 -1
- package/.output/public/_nuxt/{Dwz5cRi5.js → C5VmlmOK.js} +1 -1
- package/.output/public/_nuxt/{DetqH2Au.js → CPsvWw1J.js} +1 -1
- package/.output/public/_nuxt/{2bVyJ3C-.js → CUhpW37J.js} +19 -19
- package/.output/public/_nuxt/{C05Lqpax.js → DFgtAR95.js} +1 -1
- package/.output/public/_nuxt/{B23a03ff.js → DIEyni0K.js} +1 -1
- package/.output/public/_nuxt/{DvDpGQk1.js → D_05ko21.js} +1 -1
- package/.output/public/_nuxt/DphOOigU.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7a0d0443-5ff4-47d0-b629-668dc37b3124.json +1 -0
- package/.output/public/_nuxt/{default.BcCh6loI.css → default.DKSPicGu.css} +1 -1
- package/.output/public/_nuxt/{entry.DWv01Nib.css → entry.DJNhqbsn.css} +1 -1
- package/.output/public/_nuxt/{Bow35xGg.js → lyWV44Wc.js} +1 -1
- package/.output/public/_nuxt/{useTheme.CYTdpguX.css → useTheme.Cny4Z64J.css} +1 -1
- package/.output/public/_nuxt/wserZ5KO.js +4 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +637 -637
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/git/branches.get.mjs +2 -2
- package/.output/server/chunks/routes/api/git/branches.get.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/BZYSrnwm.js +0 -1
- package/.output/public/_nuxt/CcZ9D4X4.js +0 -85
- package/.output/public/_nuxt/Dx2SytMU.js +0 -4
- package/.output/public/_nuxt/builds/meta/ae049918-a9f5-4b30-9768-e9f982a19172.json +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{y as h,z as m,A as f,d as xe,L as ne,P as _e,Q as ar,S as lr,U as wn,B as E,K as C,C as we,G as c,g as Ne,k as y,H as re,I as he,J as Oe,N as Ht,E as Ze,V as cr}from"./Dx2SytMU.js";import{a as ur,m as pr,u as hr}from"./DvDpGQk1.js";import{_ as fr}from"./DlAUqK2U.js";function dr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function mr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Gt(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function Nn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function yn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function gr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function kr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function xr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function ai(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function br(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function li(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function wr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}const yr={class:"flex items-start justify-between gap-2"},vr={class:"flex-1 min-w-0"},Tr={key:1,class:"flex items-center gap-2"},_r={class:"text-sm font-mono text-retro-text truncate"},Ar={key:0,class:"text-xs font-mono text-retro-green bg-retro-green/10 px-1.5 py-0.5 rounded flex-shrink-0"},Sr={key:2,class:"text-xs font-mono text-retro-cyan bg-retro-cyan/10 px-1.5 py-0.5 rounded border border-retro-cyan/30 flex-shrink-0"},Er={class:"text-xs text-retro-muted mt-1 truncate"},Rr={class:"text-xs text-retro-muted/60 mt-1"},Cr={class:"truncate"},Lr={class:"truncate"},$r={class:"truncate"},Ir=xe({__name:"ConversationItem",props:{conversation:{},isActive:{type:Boolean},isStreaming:{type:Boolean},isPreviewing:{type:Boolean}},emits:["select","archive","rename"],setup(t,{emit:e}){const n=t,s=e,r=Ne(!1),i=Ne("");function a(){i.value=n.conversation.title,r.value=!0}function l(){const A=i.value.trim();A&&A!==n.conversation.title&&s("rename",A),r.value=!1}function d(){r.value=!1}const u=ur();async function T(A){try{await navigator.clipboard.writeText(A),u.success("Copied to clipboard",1500)}catch{u.error("Failed to copy")}}const S=y(()=>{const A=n.conversation.messages;if(!A.length)return"No messages";const x=A[A.length-1],$=x.content.slice(0,60);return $.length<x.content.length?$+"...":$}),_=y(()=>{const A=new Date(n.conversation.updatedAt),$=new Date().getTime()-A.getTime(),ee=Math.floor($/(1e3*60*60*24));return ee===0?A.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):ee===1?"Yesterday":ee<7?`${ee} days ago`:A.toLocaleDateString()});return(A,x)=>(h(),m("div",{class:ne(["p-3 rounded border cursor-pointer transition-colors",[t.isPreviewing&&t.isActive?"border-retro-magenta bg-retro-magenta/15 ring-1 ring-retro-magenta/40":t.isPreviewing?"border-retro-magenta/40 bg-retro-magenta/5":t.isActive?"border-retro-cyan/80 bg-retro-cyan/8":"border-retro-border hover:border-retro-cyan/40",t.isStreaming&&t.isPreviewing&&t.isActive?"streaming-preview-active-border":t.isStreaming&&t.isPreviewing?"streaming-preview-border":t.isStreaming&&t.isActive?"streaming-active-border":t.isStreaming?"streaming-border":"",t.conversation.finalized?"opacity-50":""]]),onClick:x[8]||(x[8]=$=>s("select"))},[f("div",yr,[f("div",vr,[r.value?(h(),m("div",{key:0,class:"flex gap-2",onClick:x[1]||(x[1]=_e(()=>{},["stop"]))},[ar(f("input",{"onUpdate:modelValue":x[0]||(x[0]=$=>i.value=$),onKeyup:[wn(l,["enter"]),wn(d,["escape"])],onBlur:l,class:"flex-1 px-2 py-1 text-sm font-mono bg-retro-black border border-retro-cyan rounded text-retro-text focus:outline-none focus:ring-1 focus:ring-retro-cyan",autofocus:""},null,544),[[lr,i.value]])])):(h(),m("div",Tr,[f("h3",_r,E(t.conversation.title),1),t.conversation.finalized?(h(),m("span",Ar," finalized ")):t.isPreviewing?(h(),m("span",{key:1,class:ne(["text-xs font-mono px-1.5 py-0.5 rounded border border-retro-magenta/30 flex-shrink-0",t.isActive?"text-retro-magenta bg-retro-magenta/15":"text-retro-magenta/80 bg-retro-magenta/5"])}," previewing ",2)):C("",!0),t.isStreaming?(h(),m("span",Sr," streaming ")):C("",!0)])),f("p",Er,E(S.value),1),f("p",Rr,E(_.value),1),t.conversation.worktreeBranch||t.conversation.baseBranch?(h(),m("div",{key:2,class:"mt-1.5 flex flex-wrap gap-1",onClick:x[5]||(x[5]=_e(()=>{},["stop"]))},[t.conversation.baseBranch?(h(),m("button",{key:0,onClick:x[2]||(x[2]=$=>T(t.conversation.baseBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-cyan/30 text-retro-cyan hover:border-retro-cyan hover:bg-retro-cyan/10 transition-colors max-w-full",title:"Click to copy base branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),f("span",Cr,"base: "+E(t.conversation.baseBranch),1)])):C("",!0),f("button",{onClick:x[3]||(x[3]=$=>T(t.conversation.worktreeBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-green/30 text-retro-green hover:border-retro-green hover:bg-retro-green/10 transition-colors max-w-full",title:"Click to copy branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),f("span",Lr,E(t.conversation.worktreeBranch),1)]),t.conversation.worktreePath?(h(),m("button",{key:1,onClick:x[4]||(x[4]=$=>T(t.conversation.worktreePath)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-muted/30 text-retro-muted hover:border-retro-muted hover:bg-retro-muted/10 transition-colors max-w-full",title:"Click to copy path"},[we(c(xr),{class:"w-3 h-3 flex-shrink-0"}),f("span",$r,E(t.conversation.worktreePath),1)])):C("",!0)])):C("",!0)]),f("div",{class:"flex gap-1 flex-shrink-0",onClick:x[7]||(x[7]=_e(()=>{},["stop"]))},[f("button",{onClick:a,class:"p-1 hover:bg-retro-panel rounded transition-colors",title:"Rename conversation"},[we(c(br),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})]),f("button",{onClick:x[6]||(x[6]=$=>s("archive")),class:"p-1 hover:bg-retro-cyan/20 rounded transition-colors",title:"Archive conversation"},[we(c(dr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})])])])],2))}}),ci=fr(Ir,[["__scopeId","data-v-4d7fd350"]]),Mr={key:0,class:"h-3 w-3 flex-shrink-0 rounded-full border-2 border-retro-yellow border-t-transparent animate-spin"},Dr={key:2,class:"h-2 w-2 flex-shrink-0 rounded-full bg-retro-muted/70"},Or={class:"text-retro-muted"},Nr={class:"truncate text-retro-muted"},Pr={key:3,class:"hidden flex-shrink-0 text-retro-muted/70 sm:inline"},zr={key:0,class:"space-y-1 border-t border-retro-border/20 px-3 pb-2 pt-2"},Br={class:"min-w-14 flex-shrink-0"},Ur={class:"flex-shrink-0 text-retro-cyan"},Fr={class:"break-all"},Hr=xe({__name:"ChatToolGroupSummary",props:{tools:{}},setup(t){const e=t,n=Ne(!1),s=y(()=>e.tools.filter(S=>S.status==="running").length),r=y(()=>e.tools.filter(S=>S.status==="pending").length),i=y(()=>e.tools.filter(S=>S.status==="complete").length),a=y(()=>[...e.tools].reverse().find(S=>S.status!=="complete")??e.tools[e.tools.length-1]);function l(S){const _=S.inputSummary.trim();return _?`${S.name} ${_}`:S.name}const d=y(()=>{const S=a.value;if(!S)return"Tools";const _=l(S);return e.tools.length===1?_:s.value>0||r.value>0?`${e.tools.length} tools · latest ${_}`:`${e.tools.length} tools · ${_}`}),u=y(()=>s.value>0?"[RUN]":r.value>0?"[WAIT]":"[TOOLS]"),T=y(()=>s.value>0||r.value>0);return(S,_)=>(h(),m("div",{class:ne(["my-2 rounded border",c(T)?"border-retro-border/40 bg-retro-dark/30":"border-retro-border/20 bg-retro-panel/20"]),"data-testid":"tool-group-summary"},[f("button",{class:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-mono transition-colors hover:bg-retro-dark/30",onClick:_[0]||(_[0]=A=>n.value=!c(n))},[c(s)>0?(h(),m("span",Mr)):c(r)>0?(h(),re(c(Nn),{key:1,class:"h-3.5 w-3.5 flex-shrink-0 animate-pulse text-retro-muted"})):(h(),m("span",Dr)),f("span",Or,E(c(u)),1),_[1]||(_[1]=f("span",{class:"font-bold text-retro-cyan"},"Tools",-1)),f("span",Nr,E(c(d)),1),c(T)&&c(i)>0?(h(),m("span",Pr," · "+E(c(i))+" done ",1)):C("",!0),we(c(Gt),{class:ne(["ml-auto h-3 w-3 flex-shrink-0 text-retro-muted transition-transform",{"rotate-90":c(n)}])},null,8,["class"])]),c(n)?(h(),m("div",zr,[(h(!0),m(he,null,Oe(t.tools,A=>(h(),m("div",{key:A.id,class:"flex items-start gap-2 text-xs font-mono text-retro-muted"},[f("span",Br,E(A.status==="running"?"[RUN]":A.status==="pending"?"[WAIT]":"[OK]"),1),f("span",Ur,E(A.name),1),f("span",Fr,E(A.inputSummary||"No summary available"),1)]))),128))])):C("",!0)],2))}});function Wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Se=Wt();function Pn(t){Se=t}var Ye={exec:()=>null};function I(t,e=""){let n=typeof t=="string"?t:t.source;const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(X.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var X={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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,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+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Gr=/^(?:[ \t]*(?:\n|$))+/,Wr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/(?:[*+-]|\d{1,9}[.)])/,zn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Bn=I(zn).replace(/bull/g,jt).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(),Zr=I(zn).replace(/bull/g,jt).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(),qt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yr=/^[^\n]+/,Zt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Vr=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xr=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),dt="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",Yt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qr=I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yt).replace("tag",dt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Un=I(qt).replace("hr",Ve).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),Kr=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Un).getRegex(),Vt={blockquote:Kr,code:Wr,def:Vr,fences:jr,heading:qr,hr:Ve,html:Qr,lheading:Bn,list:Xr,newline:Gr,paragraph:Un,table:Ye,text:Yr},vn=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ve).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex(),Jr={...Vt,lheading:Zr,table:vn,paragraph:I(qt).replace("hr",Ve).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dt).getRegex()},es={...Vt,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(qt).replace("hr",Ve).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",
|
|
1
|
+
import{y as h,z as m,A as d,d as xe,L as ne,P as _e,Q as lr,S as cr,U as wn,B as E,K as C,C as we,G as c,g as Ne,k as y,H as re,I as he,J as Oe,N as Ht,E as Ze,V as ur}from"./wserZ5KO.js";import{a as pr,m as hr,u as dr}from"./D_05ko21.js";import{_ as fr}from"./DlAUqK2U.js";function mr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function gr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Gt(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function Pn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function yn(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function kr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function xr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function br(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function ci(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function wr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function ui(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function yr(t,e){return h(),m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function vn(t){if(typeof document>"u"||!document.body)throw new Error("Clipboard is unavailable in this environment");const e=document.createElement("textarea"),n=document.activeElement instanceof HTMLElement?document.activeElement:null;e.value=t,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="-9999px",e.style.opacity="0",document.body.appendChild(e);try{if(e.focus(),e.select(),e.setSelectionRange(0,e.value.length),!(typeof document.execCommand=="function"&&document.execCommand("copy")))throw new Error("Failed to copy to clipboard")}finally{document.body.removeChild(e),n?.focus()}}async function vr(t){if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{vn(t);return}vn(t)}const Tr={class:"flex items-start justify-between gap-2"},_r={class:"flex-1 min-w-0"},Ar={key:1,class:"flex items-center gap-2"},Sr={class:"text-sm font-mono text-retro-text truncate"},Er={key:0,class:"text-xs font-mono text-retro-green bg-retro-green/10 px-1.5 py-0.5 rounded flex-shrink-0"},Rr={key:2,class:"text-xs font-mono text-retro-cyan bg-retro-cyan/10 px-1.5 py-0.5 rounded border border-retro-cyan/30 flex-shrink-0"},Cr={class:"text-xs text-retro-muted mt-1 truncate"},Lr={class:"text-xs text-retro-muted/60 mt-1"},$r={class:"truncate"},Ir={class:"truncate"},Mr={class:"truncate"},Dr=xe({__name:"ConversationItem",props:{conversation:{},isActive:{type:Boolean},isStreaming:{type:Boolean},isPreviewing:{type:Boolean}},emits:["select","archive","rename"],setup(t,{emit:e}){const n=t,s=e,r=Ne(!1),i=Ne("");function a(){i.value=n.conversation.title,r.value=!0}function l(){const A=i.value.trim();A&&A!==n.conversation.title&&s("rename",A),r.value=!1}function f(){r.value=!1}const u=pr();async function T(A){try{await vr(A),u.success("Copied to clipboard",1500)}catch{u.error("Failed to copy")}}const S=y(()=>{const A=n.conversation.messages;if(!A.length)return"No messages";const x=A[A.length-1],$=x.content.slice(0,60);return $.length<x.content.length?$+"...":$}),_=y(()=>{const A=new Date(n.conversation.updatedAt),$=new Date().getTime()-A.getTime(),ee=Math.floor($/(1e3*60*60*24));return ee===0?A.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):ee===1?"Yesterday":ee<7?`${ee} days ago`:A.toLocaleDateString()});return(A,x)=>(h(),m("div",{class:ne(["p-3 rounded border cursor-pointer transition-colors",[t.isPreviewing&&t.isActive?"border-retro-magenta bg-retro-magenta/15 ring-1 ring-retro-magenta/40":t.isPreviewing?"border-retro-magenta/40 bg-retro-magenta/5":t.isActive?"border-retro-cyan/80 bg-retro-cyan/8":"border-retro-border hover:border-retro-cyan/40",t.isStreaming&&t.isPreviewing&&t.isActive?"streaming-preview-active-border":t.isStreaming&&t.isPreviewing?"streaming-preview-border":t.isStreaming&&t.isActive?"streaming-active-border":t.isStreaming?"streaming-border":"",t.conversation.finalized?"opacity-50":""]]),onClick:x[8]||(x[8]=$=>s("select"))},[d("div",Tr,[d("div",_r,[r.value?(h(),m("div",{key:0,class:"flex gap-2",onClick:x[1]||(x[1]=_e(()=>{},["stop"]))},[lr(d("input",{"onUpdate:modelValue":x[0]||(x[0]=$=>i.value=$),onKeyup:[wn(l,["enter"]),wn(f,["escape"])],onBlur:l,class:"flex-1 px-2 py-1 text-sm font-mono bg-retro-black border border-retro-cyan rounded text-retro-text focus:outline-none focus:ring-1 focus:ring-retro-cyan",autofocus:""},null,544),[[cr,i.value]])])):(h(),m("div",Ar,[d("h3",Sr,E(t.conversation.title),1),t.conversation.finalized?(h(),m("span",Er," finalized ")):t.isPreviewing?(h(),m("span",{key:1,class:ne(["text-xs font-mono px-1.5 py-0.5 rounded border border-retro-magenta/30 flex-shrink-0",t.isActive?"text-retro-magenta bg-retro-magenta/15":"text-retro-magenta/80 bg-retro-magenta/5"])}," previewing ",2)):C("",!0),t.isStreaming?(h(),m("span",Rr," streaming ")):C("",!0)])),d("p",Cr,E(S.value),1),d("p",Lr,E(_.value),1),t.conversation.worktreeBranch||t.conversation.baseBranch?(h(),m("div",{key:2,class:"mt-1.5 flex flex-wrap gap-1",onClick:x[5]||(x[5]=_e(()=>{},["stop"]))},[t.conversation.baseBranch?(h(),m("button",{key:0,onClick:x[2]||(x[2]=$=>T(t.conversation.baseBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-cyan/30 text-retro-cyan hover:border-retro-cyan hover:bg-retro-cyan/10 transition-colors max-w-full",title:"Click to copy base branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),d("span",$r,"base: "+E(t.conversation.baseBranch),1)])):C("",!0),d("button",{onClick:x[3]||(x[3]=$=>T(t.conversation.worktreeBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-green/30 text-retro-green hover:border-retro-green hover:bg-retro-green/10 transition-colors max-w-full",title:"Click to copy branch"},[we(c(yn),{class:"w-3 h-3 flex-shrink-0"}),d("span",Ir,E(t.conversation.worktreeBranch),1)]),t.conversation.worktreePath?(h(),m("button",{key:1,onClick:x[4]||(x[4]=$=>T(t.conversation.worktreePath)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-muted/30 text-retro-muted hover:border-retro-muted hover:bg-retro-muted/10 transition-colors max-w-full",title:"Click to copy path"},[we(c(br),{class:"w-3 h-3 flex-shrink-0"}),d("span",Mr,E(t.conversation.worktreePath),1)])):C("",!0)])):C("",!0)]),d("div",{class:"flex gap-1 flex-shrink-0",onClick:x[7]||(x[7]=_e(()=>{},["stop"]))},[d("button",{onClick:a,class:"p-1 hover:bg-retro-panel rounded transition-colors",title:"Rename conversation"},[we(c(wr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})]),d("button",{onClick:x[6]||(x[6]=$=>s("archive")),class:"p-1 hover:bg-retro-cyan/20 rounded transition-colors",title:"Archive conversation"},[we(c(mr),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})])])])],2))}}),pi=fr(Dr,[["__scopeId","data-v-64e8df74"]]),Or={key:0,class:"h-3 w-3 flex-shrink-0 rounded-full border-2 border-retro-yellow border-t-transparent animate-spin"},Nr={key:2,class:"h-2 w-2 flex-shrink-0 rounded-full bg-retro-muted/70"},Pr={class:"text-retro-muted"},zr={class:"truncate text-retro-muted"},Br={key:3,class:"hidden flex-shrink-0 text-retro-muted/70 sm:inline"},Ur={key:0,class:"space-y-1 border-t border-retro-border/20 px-3 pb-2 pt-2"},Fr={class:"min-w-14 flex-shrink-0"},Hr={class:"flex-shrink-0 text-retro-cyan"},Gr={class:"break-all"},Wr=xe({__name:"ChatToolGroupSummary",props:{tools:{}},setup(t){const e=t,n=Ne(!1),s=y(()=>e.tools.filter(S=>S.status==="running").length),r=y(()=>e.tools.filter(S=>S.status==="pending").length),i=y(()=>e.tools.filter(S=>S.status==="complete").length),a=y(()=>[...e.tools].reverse().find(S=>S.status!=="complete")??e.tools[e.tools.length-1]);function l(S){const _=S.inputSummary.trim();return _?`${S.name} ${_}`:S.name}const f=y(()=>{const S=a.value;if(!S)return"Tools";const _=l(S);return e.tools.length===1?_:s.value>0||r.value>0?`${e.tools.length} tools · latest ${_}`:`${e.tools.length} tools · ${_}`}),u=y(()=>s.value>0?"[RUN]":r.value>0?"[WAIT]":"[TOOLS]"),T=y(()=>s.value>0||r.value>0);return(S,_)=>(h(),m("div",{class:ne(["my-2 rounded border",c(T)?"border-retro-border/40 bg-retro-dark/30":"border-retro-border/20 bg-retro-panel/20"]),"data-testid":"tool-group-summary"},[d("button",{class:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs font-mono transition-colors hover:bg-retro-dark/30",onClick:_[0]||(_[0]=A=>n.value=!c(n))},[c(s)>0?(h(),m("span",Or)):c(r)>0?(h(),re(c(Pn),{key:1,class:"h-3.5 w-3.5 flex-shrink-0 animate-pulse text-retro-muted"})):(h(),m("span",Nr)),d("span",Pr,E(c(u)),1),_[1]||(_[1]=d("span",{class:"font-bold text-retro-cyan"},"Tools",-1)),d("span",zr,E(c(f)),1),c(T)&&c(i)>0?(h(),m("span",Br," · "+E(c(i))+" done ",1)):C("",!0),we(c(Gt),{class:ne(["ml-auto h-3 w-3 flex-shrink-0 text-retro-muted transition-transform",{"rotate-90":c(n)}])},null,8,["class"])]),c(n)?(h(),m("div",Ur,[(h(!0),m(he,null,Oe(t.tools,A=>(h(),m("div",{key:A.id,class:"flex items-start gap-2 text-xs font-mono text-retro-muted"},[d("span",Fr,E(A.status==="running"?"[RUN]":A.status==="pending"?"[WAIT]":"[OK]"),1),d("span",Hr,E(A.name),1),d("span",Gr,E(A.inputSummary||"No summary available"),1)]))),128))])):C("",!0)],2))}});function Wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Se=Wt();function zn(t){Se=t}var Ye={exec:()=>null};function I(t,e=""){let n=typeof t=="string"?t:t.source;const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(X.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}var X={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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,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+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},jr=/^(?:[ \t]*(?:\n|$))+/,qr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ve=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/(?:[*+-]|\d{1,9}[.)])/,Bn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Un=I(Bn).replace(/bull/g,jt).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(),Vr=I(Bn).replace(/bull/g,jt).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(),qt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xr=/^[^\n]+/,Zt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Qr=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kr=I(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),ft="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",Yt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jr=I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yt).replace("tag",ft).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fn=I(qt).replace("hr",Ve).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex(),es=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fn).getRegex(),Vt={blockquote:es,code:qr,def:Qr,fences:Zr,heading:Yr,hr:Ve,html:Jr,lheading:Un,list:Kr,newline:jr,paragraph:Fn,table:Ye,text:Xr},Tn=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ve).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex(),ts={...Vt,lheading:Vr,table:Tn,paragraph:I(qt).replace("hr",Ve).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ft).getRegex()},ns={...Vt,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(qt).replace("hr",Ve).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Un).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ss=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Hn=/^( {2,}|\\)\n(?!\s*$)/,os=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,mt=/[\p{P}\p{S}]/u,Xt=/[\s\p{P}\p{S}]/u,Gn=/[^\s\p{P}\p{S}]/u,is=I(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xt).getRegex(),Wn=/(?!~)[\p{P}\p{S}]/u,as=/(?!~)[\s\p{P}\p{S}]/u,ls=/(?:[^\s\p{P}\p{S}]|~)/u,cs=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,jn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,us=I(jn,"u").replace(/punct/g,mt).getRegex(),ps=I(jn,"u").replace(/punct/g,Wn).getRegex(),qn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",hs=I(qn,"gu").replace(/notPunctSpace/g,Gn).replace(/punctSpace/g,Xt).replace(/punct/g,mt).getRegex(),ds=I(qn,"gu").replace(/notPunctSpace/g,ls).replace(/punctSpace/g,as).replace(/punct/g,Wn).getRegex(),fs=I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gn).replace(/punctSpace/g,Xt).replace(/punct/g,mt).getRegex(),ms=I(/\\(punct)/,"gu").replace(/punct/g,mt).getRegex(),gs=I(/^<(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(),ks=I(Yt).replace("(?:-->|$)","-->").getRegex(),xs=I("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ks).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,bs=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",pt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zn=I(/^!?\[(label)\]\[(ref)\]/).replace("label",pt).replace("ref",Zt).getRegex(),Yn=I(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zt).getRegex(),ws=I("reflink|nolink(?!\\()","g").replace("reflink",Zn).replace("nolink",Yn).getRegex(),Qt={_backpedal:Ye,anyPunctuation:ms,autolink:gs,blockSkip:cs,br:Hn,code:ss,del:Ye,emStrongLDelim:us,emStrongRDelimAst:hs,emStrongRDelimUnd:fs,escape:rs,link:bs,nolink:Yn,punctuation:is,reflink:Zn,reflinkSearch:ws,tag:xs,text:os,url:Ye},ys={...Qt,link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",pt).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pt).getRegex()},Nt={...Qt,emStrongRDelimAst:ds,emStrongLDelim:ps,url:I(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vs={...Nt,br:I(Hn).replace("{2,}","*").getRegex(),text:I(Nt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},it={normal:Vt,gfm:ts,pedantic:ns},Ue={normal:Qt,gfm:Nt,breaks:vs,pedantic:ys},Ts={"&":"&","<":"<",">":">",'"':""","'":"'"},_n=t=>Ts[t];function ue(t,e){if(e){if(X.escapeTest.test(t))return t.replace(X.escapeReplace,_n)}else if(X.escapeTestNoEncode.test(t))return t.replace(X.escapeReplaceNoEncode,_n);return t}function An(t){try{t=encodeURI(t).replace(X.percentDecode,"%")}catch{return null}return t}function Sn(t,e){const n=t.replace(X.findPipe,(i,a,l)=>{let f=!1,u=a;for(;--u>=0&&l[u]==="\\";)f=!f;return f?"|":" |"}),s=n.split(X.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(X.slashPipe,"|");return s}function Fe(t,e,n){const s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function _s(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function En(t,e,n,s,r){const i=e.href,a=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;const f={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,f}function As(t,e,n){const s=t.match(n.other.indentCodeCompensation);if(s===null)return e;const r=s[1];return e.split(`
|
|
3
3
|
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
4
4
|
`)}var ht=class{options;rules;lexer;constructor(t){this.options=t||Se}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Fe(n,`
|
|
5
|
-
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],s=
|
|
5
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],s=As(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const s=Fe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Fe(e[0],`
|
|
6
6
|
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Fe(e[0],`
|
|
7
7
|
`).split(`
|
|
8
|
-
`),s="",r="";const i=[];for(;n.length>0;){let a=!1;const l=[];let
|
|
8
|
+
`),s="",r="";const i=[];for(;n.length>0;){let a=!1;const l=[];let f;for(f=0;f<n.length;f++)if(this.rules.other.blockquoteStart.test(n[f]))l.push(n[f]),a=!0;else if(!a)l.push(n[f]);else break;n=n.slice(f);const u=l.join(`
|
|
9
9
|
`),T=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
10
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
11
|
${u}`:u,r=r?`${r}
|
|
@@ -14,26 +14,26 @@ ${T}`:T;const S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
14
14
|
`),$=this.blockquote(x);i[i.length-1]=$,s=s.substring(0,s.length-A.raw.length)+$.raw,r=r.substring(0,r.length-A.text.length)+$.text;break}else if(_?.type==="list"){const A=_,x=A.raw+`
|
|
15
15
|
`+n.join(`
|
|
16
16
|
`),$=this.list(x);i[i.length-1]=$,s=s.substring(0,s.length-_.raw.length)+$.raw,r=r.substring(0,r.length-A.raw.length)+$.raw,n=x.substring(i.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;t;){let
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;t;){let f=!1,u="",T="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let S=e[2].split(`
|
|
18
18
|
`,1)[0].replace(this.rules.other.listReplaceTabs,W=>" ".repeat(3*W.length)),_=t.split(`
|
|
19
19
|
`,1)[0],A=!S.trim(),x=0;if(this.options.pedantic?(x=2,T=S.trimStart()):A?x=e[1].length+1:(x=e[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,T=S.slice(x),x+=e[1].length),A&&this.rules.other.blankLine.test(_)&&(u+=_+`
|
|
20
|
-
`,t=t.substring(_.length+1),
|
|
20
|
+
`,t=t.substring(_.length+1),f=!0),!f){const W=this.rules.other.nextBulletRegex(x),B=this.rules.other.hrRegex(x),P=this.rules.other.fencesBeginRegex(x),M=this.rules.other.headingBeginRegex(x),H=this.rules.other.htmlBeginRegex(x);for(;t;){const O=t.split(`
|
|
21
21
|
`,1)[0];let z;if(_=O,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),z=_):z=_.replace(this.rules.other.tabCharGlobal," "),P.test(_)||M.test(_)||H.test(_)||W.test(_)||B.test(_))break;if(z.search(this.rules.other.nonSpaceChar)>=x||!_.trim())T+=`
|
|
22
22
|
`+z.slice(x);else{if(A||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||P.test(S)||M.test(S)||B.test(S))break;T+=`
|
|
23
23
|
`+_}!A&&!_.trim()&&(A=!0),u+=O+`
|
|
24
|
-
`,t=t.substring(O.length+1),S=z.slice(x)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let $=null,ee;this.options.gfm&&($=this.rules.other.listIsTask.exec(T),$&&(ee=$[0]!=="[ ] ",T=T.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!$,checked:ee,loose:!1,text:T,tokens:[]}),r.raw+=u}const l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let
|
|
25
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of r)i.rows.push(
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Fe(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=
|
|
24
|
+
`,t=t.substring(O.length+1),S=z.slice(x)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let $=null,ee;this.options.gfm&&($=this.rules.other.listIsTask.exec(T),$&&(ee=$[0]!=="[ ] ",T=T.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!$,checked:ee,loose:!1,text:T,tokens:[]}),r.raw+=u}const l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let f=0;f<r.items.length;f++)if(this.lexer.state.top=!1,r.items[f].tokens=this.lexer.blockTokens(r.items[f].text,[]),!r.loose){const u=r.items[f].tokens.filter(S=>S.type==="space"),T=u.length>0&&u.some(S=>this.rules.other.anyLine.test(S.raw));r.loose=T}if(r.loose)for(let f=0;f<r.items.length;f++)r.items[f].loose=!0;return r}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=Sn(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of r)i.rows.push(Sn(a,i.header.length).map((l,f)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[f]})));return i}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Fe(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=_s(e[2],"()");if(i===-2)return;if(i>-1){const l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),En(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return En(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let a,l,f=i,u=0;const T=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(T.lastIndex=0,e=e.slice(-1*t.length+i);(s=T.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){f+=l;continue}else if((s[5]||s[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(f-=l,f>0)continue;l=Math.min(l,l+f+u);const S=[...s[0]][0].length,_=t.slice(0,i+s.index+S+l);if(Math.min(i,l)%2){const x=_.slice(1,-1);return{type:"em",raw:_,text:x,tokens:this.lexer.inlineTokens(x)}}const A=_.slice(2,-2);return{type:"strong",raw:_,text:A,tokens:this.lexer.inlineTokens(A)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ge=class Pt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Se,this.options.tokenizer=this.options.tokenizer||new ht,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:X,block:it.normal,inline:Ue.normal};this.options.pedantic?(n.block=it.pedantic,n.inline=Ue.pedantic):this.options.gfm&&(n.block=it.gfm,this.options.breaks?n.inline=Ue.breaks:n.inline=Ue.gfm),this.tokenizer.rules=n}static get rules(){return{block:it,inline:Ue}}static lex(e,n){return new Pt(n).lex(e)}static lexInline(e,n){return new Pt(n).inlineTokens(e)}lex(e){e=e.replace(X.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.options.pedantic&&(e=e.replace(X.tabCharGlobal," ").replace(X.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
28
28
|
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
29
29
|
`+r.raw,a.text+=`
|
|
30
30
|
`+r.text,this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
31
31
|
`+r.raw,a.text+=`
|
|
32
|
-
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0;const l=e.slice(1);let
|
|
32
|
+
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0;const l=e.slice(1);let f;this.options.extensions.startBlock.forEach(u=>{f=u.call({lexer:this},l),typeof f=="number"&&f>=0&&(a=Math.min(a,f))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const a=n.at(-1);s&&a?.type==="paragraph"?(a.raw+=`
|
|
33
33
|
`+r.raw,a.text+=`
|
|
34
34
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
35
35
|
`+r.raw,a.text+=`
|
|
36
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,r=null;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){i||(a=""),i=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);const u=n.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,s,a)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let
|
|
36
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,r=null;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){i||(a=""),i=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);const u=n.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,s,a)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let f=e;if(this.options.extensions?.startInline){let u=1/0;const T=e.slice(1);let S;this.options.extensions.startInline.forEach(_=>{S=_.call({lexer:this},T),typeof S=="number"&&S>=0&&(u=Math.min(u,S))}),u<1/0&&u>=0&&(f=e.substring(0,u+1))}if(l=this.tokenizer.inlineText(f)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),i=!0;const u=n.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},dt=class{options;parser;constructor(t){this.options=t||Se}space(t){return""}code({text:t,lang:e,escaped:n}){const s=(e||"").match(X.notSpaceStart)?.[0],r=t.replace(X.endingNewline,"")+`
|
|
37
37
|
`;return s?'<pre><code class="language-'+ue(s)+'">'+(n?r:ue(r,!0))+`</code></pre>
|
|
38
38
|
`:"<pre><code>"+(n?r:ue(r,!0))+`</code></pre>
|
|
39
39
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -51,14 +51,14 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
51
51
|
`}tablerow({text:t}){return`<tr>
|
|
52
52
|
${t}</tr>
|
|
53
53
|
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
54
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ue(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n),r=
|
|
55
|
-
`+this.renderer.text(l);n?s+=this.renderer.paragraph({type:"paragraph",raw:
|
|
56
|
-
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+ue(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ae=new _s;function D(t,e){return Ae.parse(t,e)}D.options=D.setOptions=function(t){return Ae.setOptions(t),D.defaults=Ae.defaults,Pn(D.defaults),D};D.getDefaults=Wt;D.defaults=Se;D.use=function(...t){return Ae.use(...t),D.defaults=Ae.defaults,Pn(D.defaults),D};D.walkTokens=function(t,e){return Ae.walkTokens(t,e)};D.parseInline=Ae.parseInline;D.Parser=ke;D.parser=ke.parse;D.Renderer=ft;D.TextRenderer=Kt;D.Lexer=ge;D.lexer=ge.lex;D.Tokenizer=ht;D.Hooks=ct;D.parse=D;D.options;D.setOptions;D.use;D.walkTokens;D.parseInline;ke.parse;ge.lex;const{entries:Yn,setPrototypeOf:En,isFrozen:As,getPrototypeOf:Ss,getOwnPropertyDescriptor:Es}=Object;let{freeze:Q,seal:se,create:Bt}=Object,{apply:Ut,construct:Ft}=typeof Reflect<"u"&&Reflect;Q||(Q=function(e){return e});se||(se=function(e){return e});Ut||(Ut=function(e,n){for(var s=arguments.length,r=new Array(s>2?s-2:0),i=2;i<s;i++)r[i-2]=arguments[i];return e.apply(n,r)});Ft||(Ft=function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return new e(...s)});const at=K(Array.prototype.forEach),Rs=K(Array.prototype.lastIndexOf),Rn=K(Array.prototype.pop),He=K(Array.prototype.push),Cs=K(Array.prototype.splice),ut=K(String.prototype.toLowerCase),Lt=K(String.prototype.toString),$t=K(String.prototype.match),Ge=K(String.prototype.replace),Ls=K(String.prototype.indexOf),$s=K(String.prototype.trim),ie=K(Object.prototype.hasOwnProperty),V=K(RegExp.prototype.test),We=Is(TypeError);function K(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return Ut(t,e,s)}}function Is(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Ft(t,n)}}function R(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ut;En&&En(t,null);let s=e.length;for(;s--;){let r=e[s];if(typeof r=="string"){const i=n(r);i!==r&&(As(e)||(e[s]=i),r=i)}t[r]=!0}return t}function Ms(t){for(let e=0;e<t.length;e++)ie(t,e)||(t[e]=null);return t}function pe(t){const e=Bt(null);for(const[n,s]of Yn(t))ie(t,n)&&(Array.isArray(s)?e[n]=Ms(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=pe(s):e[n]=s);return e}function je(t,e){for(;t!==null;){const s=Es(t,e);if(s){if(s.get)return K(s.get);if(typeof s.value=="function")return K(s.value)}t=Ss(t)}function n(){return null}return n}const Cn=Q(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),It=Q(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mt=Q(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ds=Q(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dt=Q(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Os=Q(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ln=Q(["#text"]),$n=Q(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ot=Q(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),In=Q(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lt=Q(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ns=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ps=se(/<%[\w\W]*|[\w\W]*%>/gm),zs=se(/\$\{[\w\W]*/gm),Bs=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),Us=se(/^aria-[\-\w]+$/),Vn=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fs=se(/^(?:\w+script|data):/i),Hs=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xn=se(/^html$/i),Gs=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var Mn=Object.freeze({__proto__:null,ARIA_ATTR:Us,ATTR_WHITESPACE:Hs,CUSTOM_ELEMENT:Gs,DATA_ATTR:Bs,DOCTYPE_NAME:Xn,ERB_EXPR:Ps,IS_ALLOWED_URI:Vn,IS_SCRIPT_OR_DATA:Fs,MUSTACHE_EXPR:Ns,TMPLIT_EXPR:zs});const qe={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ws=function(){return typeof window>"u"?null:window},js=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(s=n.getAttribute(r));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Dn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ws();const e=v=>Qn(v);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==qe.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const s=n,r=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:l,Element:d,NodeFilter:u,NamedNodeMap:T=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:S,DOMParser:_,trustedTypes:A}=t,x=d.prototype,$=je(x,"cloneNode"),ee=je(x,"remove"),W=je(x,"nextSibling"),B=je(x,"childNodes"),P=je(x,"parentNode");if(typeof a=="function"){const v=n.createElement("template");v.content&&v.content.ownerDocument&&(n=v.content.ownerDocument)}let M,H="";const{implementation:O,createNodeIterator:z,createDocumentFragment:te,getElementsByTagName:be}=n,{importNode:Z}=s;let j=Dn();e.isSupported=typeof Yn=="function"&&typeof P=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ee,ERB_EXPR:ae,TMPLIT_EXPR:Pe,DATA_ATTR:Xe,ARIA_ATTR:Qe,IS_SCRIPT_OR_DATA:gt,ATTR_WHITESPACE:ye,CUSTOM_ELEMENT:kt}=Mn;let{IS_ALLOWED_URI:Ke}=Mn,w=null;const k=R({},[...Cn,...It,...Mt,...Dt,...Ln]);let g=null;const U=R({},[...$n,...Ot,...In,...lt]);let L=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,xt=null;const Re=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Jt=!0,bt=!0,en=!1,tn=!0,Ce=!1,Je=!0,ve=!1,wt=!1,yt=!1,Le=!1,et=!1,tt=!1,nn=!0,rn=!1;const Jn="user-content-";let vt=!0,ze=!1,$e={},le=null;const Tt=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let sn=null;const on=R({},["audio","video","img","source","image","track"]);let _t=null;const an=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ie=fe,At=!1,St=null;const er=R({},[nt,rt,fe],Lt);let st=R({},["mi","mo","mn","ms","mtext"]),ot=R({},["annotation-xml"]);const tr=R({},["title","style","font","a","script"]);let Be=null;const nr=["application/xhtml+xml","text/html"],rr="text/html";let G=null,Me=null;const sr=n.createElement("form"),ln=function(o){return o instanceof RegExp||o instanceof Function},Et=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Me&&Me===o)){if((!o||typeof o!="object")&&(o={}),o=pe(o),Be=nr.indexOf(o.PARSER_MEDIA_TYPE)===-1?rr:o.PARSER_MEDIA_TYPE,G=Be==="application/xhtml+xml"?Lt:ut,w=ie(o,"ALLOWED_TAGS")?R({},o.ALLOWED_TAGS,G):k,g=ie(o,"ALLOWED_ATTR")?R({},o.ALLOWED_ATTR,G):U,St=ie(o,"ALLOWED_NAMESPACES")?R({},o.ALLOWED_NAMESPACES,Lt):er,_t=ie(o,"ADD_URI_SAFE_ATTR")?R(pe(an),o.ADD_URI_SAFE_ATTR,G):an,sn=ie(o,"ADD_DATA_URI_TAGS")?R(pe(on),o.ADD_DATA_URI_TAGS,G):on,le=ie(o,"FORBID_CONTENTS")?R({},o.FORBID_CONTENTS,G):Tt,oe=ie(o,"FORBID_TAGS")?R({},o.FORBID_TAGS,G):pe({}),xt=ie(o,"FORBID_ATTR")?R({},o.FORBID_ATTR,G):pe({}),$e=ie(o,"USE_PROFILES")?o.USE_PROFILES:!1,Jt=o.ALLOW_ARIA_ATTR!==!1,bt=o.ALLOW_DATA_ATTR!==!1,en=o.ALLOW_UNKNOWN_PROTOCOLS||!1,tn=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=o.SAFE_FOR_TEMPLATES||!1,Je=o.SAFE_FOR_XML!==!1,ve=o.WHOLE_DOCUMENT||!1,Le=o.RETURN_DOM||!1,et=o.RETURN_DOM_FRAGMENT||!1,tt=o.RETURN_TRUSTED_TYPE||!1,yt=o.FORCE_BODY||!1,nn=o.SANITIZE_DOM!==!1,rn=o.SANITIZE_NAMED_PROPS||!1,vt=o.KEEP_CONTENT!==!1,ze=o.IN_PLACE||!1,Ke=o.ALLOWED_URI_REGEXP||Vn,Ie=o.NAMESPACE||fe,st=o.MATHML_TEXT_INTEGRATION_POINTS||st,ot=o.HTML_INTEGRATION_POINTS||ot,L=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&ln(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&ln(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(bt=!1),et&&(Le=!0),$e&&(w=R({},Ln),g=[],$e.html===!0&&(R(w,Cn),R(g,$n)),$e.svg===!0&&(R(w,It),R(g,Ot),R(g,lt)),$e.svgFilters===!0&&(R(w,Mt),R(g,Ot),R(g,lt)),$e.mathMl===!0&&(R(w,Dt),R(g,In),R(g,lt))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Re.tagCheck=o.ADD_TAGS:(w===k&&(w=pe(w)),R(w,o.ADD_TAGS,G))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Re.attributeCheck=o.ADD_ATTR:(g===U&&(g=pe(g)),R(g,o.ADD_ATTR,G))),o.ADD_URI_SAFE_ATTR&&R(_t,o.ADD_URI_SAFE_ATTR,G),o.FORBID_CONTENTS&&(le===Tt&&(le=pe(le)),R(le,o.FORBID_CONTENTS,G)),o.ADD_FORBID_CONTENTS&&(le===Tt&&(le=pe(le)),R(le,o.ADD_FORBID_CONTENTS,G)),vt&&(w["#text"]=!0),ve&&R(w,["html","head","body"]),w.table&&(R(w,["tbody"]),delete oe.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=o.TRUSTED_TYPES_POLICY,H=M.createHTML("")}else M===void 0&&(M=js(A,r)),M!==null&&typeof H=="string"&&(H=M.createHTML(""));Q&&Q(o),Me=o}},cn=R({},[...It,...Mt,...Ds]),un=R({},[...Dt,...Os]),or=function(o){let p=P(o);(!p||!p.tagName)&&(p={namespaceURI:Ie,tagName:"template"});const b=ut(o.tagName),N=ut(p.tagName);return St[o.namespaceURI]?o.namespaceURI===rt?p.namespaceURI===fe?b==="svg":p.namespaceURI===nt?b==="svg"&&(N==="annotation-xml"||st[N]):!!cn[b]:o.namespaceURI===nt?p.namespaceURI===fe?b==="math":p.namespaceURI===rt?b==="math"&&ot[N]:!!un[b]:o.namespaceURI===fe?p.namespaceURI===rt&&!ot[N]||p.namespaceURI===nt&&!st[N]?!1:!un[b]&&(tr[b]||!cn[b]):!!(Be==="application/xhtml+xml"&&St[o.namespaceURI]):!1},ce=function(o){He(e.removed,{element:o});try{P(o).removeChild(o)}catch{ee(o)}},Te=function(o,p){try{He(e.removed,{attribute:p.getAttributeNode(o),from:p})}catch{He(e.removed,{attribute:null,from:p})}if(p.removeAttribute(o),o==="is")if(Le||et)try{ce(p)}catch{}else try{p.setAttribute(o,"")}catch{}},pn=function(o){let p=null,b=null;if(yt)o="<remove></remove>"+o;else{const F=$t(o,/^[\r\n\t ]+/);b=F&&F[0]}Be==="application/xhtml+xml"&&Ie===fe&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const N=M?M.createHTML(o):o;if(Ie===fe)try{p=new _().parseFromString(N,Be)}catch{}if(!p||!p.documentElement){p=O.createDocument(Ie,"template",null);try{p.documentElement.innerHTML=At?H:N}catch{}}const Y=p.body||p.documentElement;return o&&b&&Y.insertBefore(n.createTextNode(b),Y.childNodes[0]||null),Ie===fe?be.call(p,ve?"html":"body")[0]:ve?p.documentElement:Y},hn=function(o){return z.call(o.ownerDocument||o,o,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Rt=function(o){return o instanceof S&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof T)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},fn=function(o){return typeof l=="function"&&o instanceof l};function de(v,o,p){at(v,b=>{b.call(e,o,p,Me)})}const dn=function(o){let p=null;if(de(j.beforeSanitizeElements,o,null),Rt(o))return ce(o),!0;const b=G(o.nodeName);if(de(j.uponSanitizeElement,o,{tagName:b,allowedTags:w}),Je&&o.hasChildNodes()&&!fn(o.firstElementChild)&&V(/<[/\w!]/g,o.innerHTML)&&V(/<[/\w!]/g,o.textContent)||o.nodeType===qe.progressingInstruction||Je&&o.nodeType===qe.comment&&V(/<[/\w]/g,o.data))return ce(o),!0;if(!(Re.tagCheck instanceof Function&&Re.tagCheck(b))&&(!w[b]||oe[b])){if(!oe[b]&&gn(b)&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b)))return!1;if(vt&&!le[b]){const N=P(o)||o.parentNode,Y=B(o)||o.childNodes;if(Y&&N){const F=Y.length;for(let J=F-1;J>=0;--J){const me=$(Y[J],!0);me.__removalCount=(o.__removalCount||0)+1,N.insertBefore(me,W(o))}}}return ce(o),!0}return o instanceof d&&!or(o)||(b==="noscript"||b==="noembed"||b==="noframes")&&V(/<\/no(script|embed|frames)/i,o.innerHTML)?(ce(o),!0):(Ce&&o.nodeType===qe.text&&(p=o.textContent,at([Ee,ae,Pe],N=>{p=Ge(p,N," ")}),o.textContent!==p&&(He(e.removed,{element:o.cloneNode()}),o.textContent=p)),de(j.afterSanitizeElements,o,null),!1)},mn=function(o,p,b){if(nn&&(p==="id"||p==="name")&&(b in n||b in sr))return!1;if(!(bt&&!xt[p]&&V(Xe,p))){if(!(Jt&&V(Qe,p))){if(!(Re.attributeCheck instanceof Function&&Re.attributeCheck(p,o))){if(!g[p]||xt[p]){if(!(gn(o)&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,o)||L.tagNameCheck instanceof Function&&L.tagNameCheck(o))&&(L.attributeNameCheck instanceof RegExp&&V(L.attributeNameCheck,p)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(p,o))||p==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b))))return!1}else if(!_t[p]){if(!V(Ke,Ge(b,ye,""))){if(!((p==="src"||p==="xlink:href"||p==="href")&&o!=="script"&&Ls(b,"data:")===0&&sn[o])){if(!(en&&!V(gt,Ge(b,ye,"")))){if(b)return!1}}}}}}}return!0},gn=function(o){return o!=="annotation-xml"&&$t(o,kt)},kn=function(o){de(j.beforeSanitizeAttributes,o,null);const{attributes:p}=o;if(!p||Rt(o))return;const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:g,forceKeepAttr:void 0};let N=p.length;for(;N--;){const Y=p[N],{name:F,namespaceURI:J,value:me}=Y,De=G(F),Ct=me;let q=F==="value"?Ct:$s(Ct);if(b.attrName=De,b.attrValue=q,b.keepAttr=!0,b.forceKeepAttr=void 0,de(j.uponSanitizeAttribute,o,b),q=b.attrValue,rn&&(De==="id"||De==="name")&&(Te(F,o),q=Jn+q),Je&&V(/((--!?|])>)|<\/(style|title|textarea)/i,q)){Te(F,o);continue}if(De==="attributename"&&$t(q,"href")){Te(F,o);continue}if(b.forceKeepAttr)continue;if(!b.keepAttr){Te(F,o);continue}if(!tn&&V(/\/>/i,q)){Te(F,o);continue}Ce&&at([Ee,ae,Pe],bn=>{q=Ge(q,bn," ")});const xn=G(o.nodeName);if(!mn(xn,De,q)){Te(F,o);continue}if(M&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!J)switch(A.getAttributeType(xn,De)){case"TrustedHTML":{q=M.createHTML(q);break}case"TrustedScriptURL":{q=M.createScriptURL(q);break}}if(q!==Ct)try{J?o.setAttributeNS(J,F,q):o.setAttribute(F,q),Rt(o)?ce(o):Rn(e.removed)}catch{Te(F,o)}}de(j.afterSanitizeAttributes,o,null)},ir=function v(o){let p=null;const b=hn(o);for(de(j.beforeSanitizeShadowDOM,o,null);p=b.nextNode();)de(j.uponSanitizeShadowNode,p,null),dn(p),kn(p),p.content instanceof i&&v(p.content);de(j.afterSanitizeShadowDOM,o,null)};return e.sanitize=function(v){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,b=null,N=null,Y=null;if(At=!v,At&&(v="<!-->"),typeof v!="string"&&!fn(v))if(typeof v.toString=="function"){if(v=v.toString(),typeof v!="string")throw We("dirty is not a string, aborting")}else throw We("toString is not a function");if(!e.isSupported)return v;if(wt||Et(o),e.removed=[],typeof v=="string"&&(ze=!1),ze){if(v.nodeName){const me=G(v.nodeName);if(!w[me]||oe[me])throw We("root node is forbidden and cannot be sanitized in-place")}}else if(v instanceof l)p=pn("<!---->"),b=p.ownerDocument.importNode(v,!0),b.nodeType===qe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?p=b:p.appendChild(b);else{if(!Le&&!Ce&&!ve&&v.indexOf("<")===-1)return M&&tt?M.createHTML(v):v;if(p=pn(v),!p)return Le?null:tt?H:""}p&&yt&&ce(p.firstChild);const F=hn(ze?v:p);for(;N=F.nextNode();)dn(N),kn(N),N.content instanceof i&&ir(N.content);if(ze)return v;if(Le){if(et)for(Y=te.call(p.ownerDocument);p.firstChild;)Y.appendChild(p.firstChild);else Y=p;return(g.shadowroot||g.shadowrootmode)&&(Y=Z.call(s,Y,!0)),Y}let J=ve?p.outerHTML:p.innerHTML;return ve&&w["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&V(Xn,p.ownerDocument.doctype.name)&&(J="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
57
|
-
`+J),Ce&&at([Ee,ae,Pe],me=>{J=Ge(J,me," ")}),M&&tt?M.createHTML(J):J},e.setConfig=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Et(v),wt=!0},e.clearConfig=function(){Me=null,wt=!1},e.isValidAttribute=function(v,o,p){Me||Et({});const b=G(v),N=G(o);return mn(b,N,p)},e.addHook=function(v,o){typeof o=="function"&&He(j[v],o)},e.removeHook=function(v,o){if(o!==void 0){const p=
|
|
58
|
-
`).length),r=y(()=>e.block.thinking.length>0&&e.block.thinking.length<=240&&s.value<=6),i=y(()=>{const a=e.block.thinking.replace(/\s+/g," ").trim();return a?a.length>140?`${a.slice(0,140)}...`:a:""});return Ht(()=>e.block.id,()=>{n.value=r.value},{immediate:!0}),(a,l)=>(h(),m("div",
|
|
54
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ue(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n),r=An(t);if(r===null)return s;t=r;let i='<a href="'+t+'"';return e&&(i+=' title="'+ue(e)+'"'),i+=">"+s+"</a>",i}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const r=An(t);if(r===null)return ue(n);t=r;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${ue(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ue(t.text)}},Kt=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ke=class zt{options;renderer;textRenderer;constructor(e){this.options=e||Se,this.options.renderer=this.options.renderer||new dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kt}static parse(e,n){return new zt(n).parse(e)}static parseInline(e,n){return new zt(n).parseInline(e)}parse(e,n=!0){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions?.renderers?.[i.type]){const l=i,f=this.options.extensions.renderers[l.type].call({parser:this},l);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){s+=f||"";continue}}const a=i;switch(a.type){case"space":{s+=this.renderer.space(a);continue}case"hr":{s+=this.renderer.hr(a);continue}case"heading":{s+=this.renderer.heading(a);continue}case"code":{s+=this.renderer.code(a);continue}case"table":{s+=this.renderer.table(a);continue}case"blockquote":{s+=this.renderer.blockquote(a);continue}case"list":{s+=this.renderer.list(a);continue}case"html":{s+=this.renderer.html(a);continue}case"paragraph":{s+=this.renderer.paragraph(a);continue}case"text":{let l=a,f=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],f+=`
|
|
55
|
+
`+this.renderer.text(l);n?s+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):s+=f;continue}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,n=this.renderer){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions?.renderers?.[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}const a=i;switch(a.type){case"escape":{s+=n.text(a);break}case"html":{s+=n.html(a);break}case"link":{s+=n.link(a);break}case"image":{s+=n.image(a);break}case"strong":{s+=n.strong(a);break}case"em":{s+=n.em(a);break}case"codespan":{s+=n.codespan(a);break}case"br":{s+=n.br(a);break}case"del":{s+=n.del(a);break}case"text":{s+=n.text(a);break}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},ct=class{options;block;constructor(t){this.options=t||Se}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?ge.lex:ge.lexInline}provideParser(){return this.block?ke.parse:ke.parseInline}},Ss=class{defaults=Wt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ke;Renderer=dt;TextRenderer=Kt;Lexer=ge;Tokenizer=ht;Hooks=ct;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{const r=s;for(const i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(const i of r.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{const r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{const a=r[i].flat(1/0);n=n.concat(this.walkTokens(a,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){const r=this.defaults.renderer||new dt(this.defaults);for(const i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=n.renderer[a],f=r[a];r[a]=(...u)=>{let T=l.apply(r,u);return T===!1&&(T=f.apply(r,u)),T||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new ht(this.defaults);for(const i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=n.tokenizer[a],f=r[a];r[a]=(...u)=>{let T=l.apply(r,u);return T===!1&&(T=f.apply(r,u)),T}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new ct;for(const i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=n.hooks[a],f=r[a];ct.passThroughHooks.has(i)?r[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(r,u)).then(S=>f.call(r,S));const T=l.call(r,u);return f.call(r,T)}:r[a]=(...u)=>{let T=l.apply(r,u);return T===!1&&(T=f.apply(r,u)),T}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ge.lex(t,e??this.defaults)}parser(t,e){return ke.parse(t,e??this.defaults)}parseMarkdown(t){return(n,s)=>{const r={...s},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(new 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 n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const l=i.hooks?i.hooks.provideLexer():t?ge.lex:ge.lexInline,f=i.hooks?i.hooks.provideParser():t?ke.parse:ke.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>f(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let u=l(n,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let T=f(u,i);return i.hooks&&(T=i.hooks.postprocess(T)),T}catch(u){return a(u)}}}onError(t,e){return n=>{if(n.message+=`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,t){const s="<p>An error occurred:</p><pre>"+ue(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ae=new Ss;function D(t,e){return Ae.parse(t,e)}D.options=D.setOptions=function(t){return Ae.setOptions(t),D.defaults=Ae.defaults,zn(D.defaults),D};D.getDefaults=Wt;D.defaults=Se;D.use=function(...t){return Ae.use(...t),D.defaults=Ae.defaults,zn(D.defaults),D};D.walkTokens=function(t,e){return Ae.walkTokens(t,e)};D.parseInline=Ae.parseInline;D.Parser=ke;D.parser=ke.parse;D.Renderer=dt;D.TextRenderer=Kt;D.Lexer=ge;D.lexer=ge.lex;D.Tokenizer=ht;D.Hooks=ct;D.parse=D;D.options;D.setOptions;D.use;D.walkTokens;D.parseInline;ke.parse;ge.lex;const{entries:Vn,setPrototypeOf:Rn,isFrozen:Es,getPrototypeOf:Rs,getOwnPropertyDescriptor:Cs}=Object;let{freeze:Q,seal:se,create:Bt}=Object,{apply:Ut,construct:Ft}=typeof Reflect<"u"&&Reflect;Q||(Q=function(e){return e});se||(se=function(e){return e});Ut||(Ut=function(e,n){for(var s=arguments.length,r=new Array(s>2?s-2:0),i=2;i<s;i++)r[i-2]=arguments[i];return e.apply(n,r)});Ft||(Ft=function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return new e(...s)});const at=K(Array.prototype.forEach),Ls=K(Array.prototype.lastIndexOf),Cn=K(Array.prototype.pop),He=K(Array.prototype.push),$s=K(Array.prototype.splice),ut=K(String.prototype.toLowerCase),Lt=K(String.prototype.toString),$t=K(String.prototype.match),Ge=K(String.prototype.replace),Is=K(String.prototype.indexOf),Ms=K(String.prototype.trim),ie=K(Object.prototype.hasOwnProperty),V=K(RegExp.prototype.test),We=Ds(TypeError);function K(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return Ut(t,e,s)}}function Ds(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Ft(t,n)}}function R(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ut;Rn&&Rn(t,null);let s=e.length;for(;s--;){let r=e[s];if(typeof r=="string"){const i=n(r);i!==r&&(Es(e)||(e[s]=i),r=i)}t[r]=!0}return t}function Os(t){for(let e=0;e<t.length;e++)ie(t,e)||(t[e]=null);return t}function pe(t){const e=Bt(null);for(const[n,s]of Vn(t))ie(t,n)&&(Array.isArray(s)?e[n]=Os(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=pe(s):e[n]=s);return e}function je(t,e){for(;t!==null;){const s=Cs(t,e);if(s){if(s.get)return K(s.get);if(typeof s.value=="function")return K(s.value)}t=Rs(t)}function n(){return null}return n}const Ln=Q(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),It=Q(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mt=Q(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ns=Q(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dt=Q(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ps=Q(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$n=Q(["#text"]),In=Q(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ot=Q(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Mn=Q(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lt=Q(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zs=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bs=se(/<%[\w\W]*|[\w\W]*%>/gm),Us=se(/\$\{[\w\W]*/gm),Fs=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hs=se(/^aria-[\-\w]+$/),Xn=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gs=se(/^(?:\w+script|data):/i),Ws=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qn=se(/^html$/i),js=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var Dn=Object.freeze({__proto__:null,ARIA_ATTR:Hs,ATTR_WHITESPACE:Ws,CUSTOM_ELEMENT:js,DATA_ATTR:Fs,DOCTYPE_NAME:Qn,ERB_EXPR:Bs,IS_ALLOWED_URI:Xn,IS_SCRIPT_OR_DATA:Gs,MUSTACHE_EXPR:zs,TMPLIT_EXPR:Us});const qe={element:1,text:3,progressingInstruction:7,comment:8,document:9},qs=function(){return typeof window>"u"?null:window},Zs=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(s=n.getAttribute(r));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},On=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qs();const e=v=>Kn(v);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==qe.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const s=n,r=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:l,Element:f,NodeFilter:u,NamedNodeMap:T=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:S,DOMParser:_,trustedTypes:A}=t,x=f.prototype,$=je(x,"cloneNode"),ee=je(x,"remove"),W=je(x,"nextSibling"),B=je(x,"childNodes"),P=je(x,"parentNode");if(typeof a=="function"){const v=n.createElement("template");v.content&&v.content.ownerDocument&&(n=v.content.ownerDocument)}let M,H="";const{implementation:O,createNodeIterator:z,createDocumentFragment:te,getElementsByTagName:be}=n,{importNode:Z}=s;let j=On();e.isSupported=typeof Vn=="function"&&typeof P=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ee,ERB_EXPR:ae,TMPLIT_EXPR:Pe,DATA_ATTR:Xe,ARIA_ATTR:Qe,IS_SCRIPT_OR_DATA:gt,ATTR_WHITESPACE:ye,CUSTOM_ELEMENT:kt}=Dn;let{IS_ALLOWED_URI:Ke}=Dn,w=null;const k=R({},[...Ln,...It,...Mt,...Dt,...$n]);let g=null;const U=R({},[...In,...Ot,...Mn,...lt]);let L=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,xt=null;const Re=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Jt=!0,bt=!0,en=!1,tn=!0,Ce=!1,Je=!0,ve=!1,wt=!1,yt=!1,Le=!1,et=!1,tt=!1,nn=!0,rn=!1;const er="user-content-";let vt=!0,ze=!1,$e={},le=null;const Tt=R({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let sn=null;const on=R({},["audio","video","img","source","image","track"]);let _t=null;const an=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml";let Ie=de,At=!1,St=null;const tr=R({},[nt,rt,de],Lt);let st=R({},["mi","mo","mn","ms","mtext"]),ot=R({},["annotation-xml"]);const nr=R({},["title","style","font","a","script"]);let Be=null;const rr=["application/xhtml+xml","text/html"],sr="text/html";let G=null,Me=null;const or=n.createElement("form"),ln=function(o){return o instanceof RegExp||o instanceof Function},Et=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Me&&Me===o)){if((!o||typeof o!="object")&&(o={}),o=pe(o),Be=rr.indexOf(o.PARSER_MEDIA_TYPE)===-1?sr:o.PARSER_MEDIA_TYPE,G=Be==="application/xhtml+xml"?Lt:ut,w=ie(o,"ALLOWED_TAGS")?R({},o.ALLOWED_TAGS,G):k,g=ie(o,"ALLOWED_ATTR")?R({},o.ALLOWED_ATTR,G):U,St=ie(o,"ALLOWED_NAMESPACES")?R({},o.ALLOWED_NAMESPACES,Lt):tr,_t=ie(o,"ADD_URI_SAFE_ATTR")?R(pe(an),o.ADD_URI_SAFE_ATTR,G):an,sn=ie(o,"ADD_DATA_URI_TAGS")?R(pe(on),o.ADD_DATA_URI_TAGS,G):on,le=ie(o,"FORBID_CONTENTS")?R({},o.FORBID_CONTENTS,G):Tt,oe=ie(o,"FORBID_TAGS")?R({},o.FORBID_TAGS,G):pe({}),xt=ie(o,"FORBID_ATTR")?R({},o.FORBID_ATTR,G):pe({}),$e=ie(o,"USE_PROFILES")?o.USE_PROFILES:!1,Jt=o.ALLOW_ARIA_ATTR!==!1,bt=o.ALLOW_DATA_ATTR!==!1,en=o.ALLOW_UNKNOWN_PROTOCOLS||!1,tn=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=o.SAFE_FOR_TEMPLATES||!1,Je=o.SAFE_FOR_XML!==!1,ve=o.WHOLE_DOCUMENT||!1,Le=o.RETURN_DOM||!1,et=o.RETURN_DOM_FRAGMENT||!1,tt=o.RETURN_TRUSTED_TYPE||!1,yt=o.FORCE_BODY||!1,nn=o.SANITIZE_DOM!==!1,rn=o.SANITIZE_NAMED_PROPS||!1,vt=o.KEEP_CONTENT!==!1,ze=o.IN_PLACE||!1,Ke=o.ALLOWED_URI_REGEXP||Xn,Ie=o.NAMESPACE||de,st=o.MATHML_TEXT_INTEGRATION_POINTS||st,ot=o.HTML_INTEGRATION_POINTS||ot,L=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&ln(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&ln(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(bt=!1),et&&(Le=!0),$e&&(w=R({},$n),g=[],$e.html===!0&&(R(w,Ln),R(g,In)),$e.svg===!0&&(R(w,It),R(g,Ot),R(g,lt)),$e.svgFilters===!0&&(R(w,Mt),R(g,Ot),R(g,lt)),$e.mathMl===!0&&(R(w,Dt),R(g,Mn),R(g,lt))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Re.tagCheck=o.ADD_TAGS:(w===k&&(w=pe(w)),R(w,o.ADD_TAGS,G))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Re.attributeCheck=o.ADD_ATTR:(g===U&&(g=pe(g)),R(g,o.ADD_ATTR,G))),o.ADD_URI_SAFE_ATTR&&R(_t,o.ADD_URI_SAFE_ATTR,G),o.FORBID_CONTENTS&&(le===Tt&&(le=pe(le)),R(le,o.FORBID_CONTENTS,G)),o.ADD_FORBID_CONTENTS&&(le===Tt&&(le=pe(le)),R(le,o.ADD_FORBID_CONTENTS,G)),vt&&(w["#text"]=!0),ve&&R(w,["html","head","body"]),w.table&&(R(w,["tbody"]),delete oe.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=o.TRUSTED_TYPES_POLICY,H=M.createHTML("")}else M===void 0&&(M=Zs(A,r)),M!==null&&typeof H=="string"&&(H=M.createHTML(""));Q&&Q(o),Me=o}},cn=R({},[...It,...Mt,...Ns]),un=R({},[...Dt,...Ps]),ir=function(o){let p=P(o);(!p||!p.tagName)&&(p={namespaceURI:Ie,tagName:"template"});const b=ut(o.tagName),N=ut(p.tagName);return St[o.namespaceURI]?o.namespaceURI===rt?p.namespaceURI===de?b==="svg":p.namespaceURI===nt?b==="svg"&&(N==="annotation-xml"||st[N]):!!cn[b]:o.namespaceURI===nt?p.namespaceURI===de?b==="math":p.namespaceURI===rt?b==="math"&&ot[N]:!!un[b]:o.namespaceURI===de?p.namespaceURI===rt&&!ot[N]||p.namespaceURI===nt&&!st[N]?!1:!un[b]&&(nr[b]||!cn[b]):!!(Be==="application/xhtml+xml"&&St[o.namespaceURI]):!1},ce=function(o){He(e.removed,{element:o});try{P(o).removeChild(o)}catch{ee(o)}},Te=function(o,p){try{He(e.removed,{attribute:p.getAttributeNode(o),from:p})}catch{He(e.removed,{attribute:null,from:p})}if(p.removeAttribute(o),o==="is")if(Le||et)try{ce(p)}catch{}else try{p.setAttribute(o,"")}catch{}},pn=function(o){let p=null,b=null;if(yt)o="<remove></remove>"+o;else{const F=$t(o,/^[\r\n\t ]+/);b=F&&F[0]}Be==="application/xhtml+xml"&&Ie===de&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const N=M?M.createHTML(o):o;if(Ie===de)try{p=new _().parseFromString(N,Be)}catch{}if(!p||!p.documentElement){p=O.createDocument(Ie,"template",null);try{p.documentElement.innerHTML=At?H:N}catch{}}const Y=p.body||p.documentElement;return o&&b&&Y.insertBefore(n.createTextNode(b),Y.childNodes[0]||null),Ie===de?be.call(p,ve?"html":"body")[0]:ve?p.documentElement:Y},hn=function(o){return z.call(o.ownerDocument||o,o,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Rt=function(o){return o instanceof S&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof T)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},dn=function(o){return typeof l=="function"&&o instanceof l};function fe(v,o,p){at(v,b=>{b.call(e,o,p,Me)})}const fn=function(o){let p=null;if(fe(j.beforeSanitizeElements,o,null),Rt(o))return ce(o),!0;const b=G(o.nodeName);if(fe(j.uponSanitizeElement,o,{tagName:b,allowedTags:w}),Je&&o.hasChildNodes()&&!dn(o.firstElementChild)&&V(/<[/\w!]/g,o.innerHTML)&&V(/<[/\w!]/g,o.textContent)||o.nodeType===qe.progressingInstruction||Je&&o.nodeType===qe.comment&&V(/<[/\w]/g,o.data))return ce(o),!0;if(!(Re.tagCheck instanceof Function&&Re.tagCheck(b))&&(!w[b]||oe[b])){if(!oe[b]&&gn(b)&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b)))return!1;if(vt&&!le[b]){const N=P(o)||o.parentNode,Y=B(o)||o.childNodes;if(Y&&N){const F=Y.length;for(let J=F-1;J>=0;--J){const me=$(Y[J],!0);me.__removalCount=(o.__removalCount||0)+1,N.insertBefore(me,W(o))}}}return ce(o),!0}return o instanceof f&&!ir(o)||(b==="noscript"||b==="noembed"||b==="noframes")&&V(/<\/no(script|embed|frames)/i,o.innerHTML)?(ce(o),!0):(Ce&&o.nodeType===qe.text&&(p=o.textContent,at([Ee,ae,Pe],N=>{p=Ge(p,N," ")}),o.textContent!==p&&(He(e.removed,{element:o.cloneNode()}),o.textContent=p)),fe(j.afterSanitizeElements,o,null),!1)},mn=function(o,p,b){if(nn&&(p==="id"||p==="name")&&(b in n||b in or))return!1;if(!(bt&&!xt[p]&&V(Xe,p))){if(!(Jt&&V(Qe,p))){if(!(Re.attributeCheck instanceof Function&&Re.attributeCheck(p,o))){if(!g[p]||xt[p]){if(!(gn(o)&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,o)||L.tagNameCheck instanceof Function&&L.tagNameCheck(o))&&(L.attributeNameCheck instanceof RegExp&&V(L.attributeNameCheck,p)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(p,o))||p==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&V(L.tagNameCheck,b)||L.tagNameCheck instanceof Function&&L.tagNameCheck(b))))return!1}else if(!_t[p]){if(!V(Ke,Ge(b,ye,""))){if(!((p==="src"||p==="xlink:href"||p==="href")&&o!=="script"&&Is(b,"data:")===0&&sn[o])){if(!(en&&!V(gt,Ge(b,ye,"")))){if(b)return!1}}}}}}}return!0},gn=function(o){return o!=="annotation-xml"&&$t(o,kt)},kn=function(o){fe(j.beforeSanitizeAttributes,o,null);const{attributes:p}=o;if(!p||Rt(o))return;const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:g,forceKeepAttr:void 0};let N=p.length;for(;N--;){const Y=p[N],{name:F,namespaceURI:J,value:me}=Y,De=G(F),Ct=me;let q=F==="value"?Ct:Ms(Ct);if(b.attrName=De,b.attrValue=q,b.keepAttr=!0,b.forceKeepAttr=void 0,fe(j.uponSanitizeAttribute,o,b),q=b.attrValue,rn&&(De==="id"||De==="name")&&(Te(F,o),q=er+q),Je&&V(/((--!?|])>)|<\/(style|title|textarea)/i,q)){Te(F,o);continue}if(De==="attributename"&&$t(q,"href")){Te(F,o);continue}if(b.forceKeepAttr)continue;if(!b.keepAttr){Te(F,o);continue}if(!tn&&V(/\/>/i,q)){Te(F,o);continue}Ce&&at([Ee,ae,Pe],bn=>{q=Ge(q,bn," ")});const xn=G(o.nodeName);if(!mn(xn,De,q)){Te(F,o);continue}if(M&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!J)switch(A.getAttributeType(xn,De)){case"TrustedHTML":{q=M.createHTML(q);break}case"TrustedScriptURL":{q=M.createScriptURL(q);break}}if(q!==Ct)try{J?o.setAttributeNS(J,F,q):o.setAttribute(F,q),Rt(o)?ce(o):Cn(e.removed)}catch{Te(F,o)}}fe(j.afterSanitizeAttributes,o,null)},ar=function v(o){let p=null;const b=hn(o);for(fe(j.beforeSanitizeShadowDOM,o,null);p=b.nextNode();)fe(j.uponSanitizeShadowNode,p,null),fn(p),kn(p),p.content instanceof i&&v(p.content);fe(j.afterSanitizeShadowDOM,o,null)};return e.sanitize=function(v){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,b=null,N=null,Y=null;if(At=!v,At&&(v="<!-->"),typeof v!="string"&&!dn(v))if(typeof v.toString=="function"){if(v=v.toString(),typeof v!="string")throw We("dirty is not a string, aborting")}else throw We("toString is not a function");if(!e.isSupported)return v;if(wt||Et(o),e.removed=[],typeof v=="string"&&(ze=!1),ze){if(v.nodeName){const me=G(v.nodeName);if(!w[me]||oe[me])throw We("root node is forbidden and cannot be sanitized in-place")}}else if(v instanceof l)p=pn("<!---->"),b=p.ownerDocument.importNode(v,!0),b.nodeType===qe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?p=b:p.appendChild(b);else{if(!Le&&!Ce&&!ve&&v.indexOf("<")===-1)return M&&tt?M.createHTML(v):v;if(p=pn(v),!p)return Le?null:tt?H:""}p&&yt&&ce(p.firstChild);const F=hn(ze?v:p);for(;N=F.nextNode();)fn(N),kn(N),N.content instanceof i&&ar(N.content);if(ze)return v;if(Le){if(et)for(Y=te.call(p.ownerDocument);p.firstChild;)Y.appendChild(p.firstChild);else Y=p;return(g.shadowroot||g.shadowrootmode)&&(Y=Z.call(s,Y,!0)),Y}let J=ve?p.outerHTML:p.innerHTML;return ve&&w["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&V(Qn,p.ownerDocument.doctype.name)&&(J="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
57
|
+
`+J),Ce&&at([Ee,ae,Pe],me=>{J=Ge(J,me," ")}),M&&tt?M.createHTML(J):J},e.setConfig=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Et(v),wt=!0},e.clearConfig=function(){Me=null,wt=!1},e.isValidAttribute=function(v,o,p){Me||Et({});const b=G(v),N=G(o);return mn(b,N,p)},e.addHook=function(v,o){typeof o=="function"&&He(j[v],o)},e.removeHook=function(v,o){if(o!==void 0){const p=Ls(j[v],o);return p===-1?void 0:$s(j[v],p,1)[0]}return Cn(j[v])},e.removeHooks=function(v){j[v]=[]},e.removeAllHooks=function(){j=On()},e}var Ys=Kn();function Jn(){function t(e){const n=D.parse(e);return Ys.sanitize(n)}return{renderMarkdown:t}}const Vs=["innerHTML"],Xs=xe({__name:"ChatTextBlock",props:{block:{}},setup(t){const e=t,{renderMarkdown:n}=Jn(),s=y(()=>n(e.block.text));return(r,i)=>t.block.text.trim()?(h(),m("div",{key:0,class:"text-sm font-mono text-retro-text break-words chat-markdown px-1",innerHTML:c(s)},null,8,Vs)):C("",!0)}}),Qs={class:"my-1 border border-retro-border/30 rounded bg-retro-dark/30"},Ks={key:0,class:"text-retro-muted/80 truncate min-w-0 flex-1"},Js={class:"ml-auto flex-shrink-0 text-retro-muted/60 text-[10px]"},eo={key:0,class:"px-3 pb-2 text-xs font-mono text-retro-muted whitespace-pre-wrap max-h-60 overflow-y-auto scrollbar-custom border-t border-retro-border/20"},to=xe({__name:"ChatThinkingBlock",props:{block:{}},setup(t){const e=t,n=Ne(!1),s=y(()=>e.block.thinking.split(`
|
|
58
|
+
`).length),r=y(()=>e.block.thinking.length>0&&e.block.thinking.length<=240&&s.value<=6),i=y(()=>{const a=e.block.thinking.replace(/\s+/g," ").trim();return a?a.length>140?`${a.slice(0,140)}...`:a:""});return Ht(()=>e.block.id,()=>{n.value=r.value},{immediate:!0}),(a,l)=>(h(),m("div",Qs,[d("button",{class:"flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-yellow transition-colors",onClick:l[0]||(l[0]=f=>n.value=!c(n))},[we(c(Gt),{class:ne(["w-3 h-3 transition-transform flex-shrink-0",{"rotate-90":c(n)}])},null,8,["class"]),l[1]||(l[1]=d("span",{class:"text-retro-yellow"},"Thinking",-1)),!c(n)&&c(i)?(h(),m("span",Ks,E(c(i)),1)):C("",!0),d("span",Js,E(c(s))+" lines · "+E(t.block.thinking.length)+" chars ",1)]),c(n)?(h(),m("div",eo,E(t.block.thinking),1)):C("",!0)]))}}),no={class:"my-2 border border-retro-border/40 rounded bg-retro-dark/30"},ro={key:0,class:"w-3 h-3 border-2 border-retro-yellow border-t-transparent rounded-full animate-spin flex-shrink-0"},so={class:"text-retro-muted"},oo={class:"text-retro-cyan font-bold"},io={class:"text-retro-muted truncate"},ao={key:0,class:"px-3 pb-2 border-t border-retro-border/20"},lo={key:0,class:"mt-2"},co={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-36 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},uo={class:"text-xs font-mono text-retro-muted space-y-2 mt-2"},po={key:0,class:"flex items-start gap-2"},ho={class:"text-retro-cyan break-all"},fo={key:1,class:"flex items-start gap-2"},mo={class:"text-retro-cyan break-all whitespace-pre-wrap"},go={key:2,class:"flex items-start gap-2"},ko={key:1,class:"mt-2"},xo={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-52 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},bo={key:0,class:"text-[10px] text-retro-muted mt-1"},wo={class:"mt-2"},yo={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom"},vo={key:2,class:"mt-3"},To={class:"space-y-2"},_o={key:0,class:"text-[11px] font-mono text-retro-yellow mb-1"},Ao={key:1,class:"text-xs font-mono text-retro-text whitespace-pre-wrap"},So={key:2,class:"mt-2 space-y-1"},Eo={key:0,class:"text-retro-muted/80"},Ro={key:3,class:"mt-3 border-t border-retro-border/20 pt-2"},Co={class:"mb-1 text-[10px] text-retro-muted"},Lo={class:"text-retro-green"},$o={class:"text-retro-red"},Io={class:"space-y-0.5"},Mo={class:"whitespace-pre-wrap pl-1"},Do={class:"whitespace-pre-wrap pl-1"},Oo=xe({__name:"ChatToolBlock",props:{block:{},result:{}},setup(t){const e=t,n=Ne(!1),s=Ne(!1);function r(w,k){for(const g of k){const U=w[g];if(typeof U=="string"&&U.trim())return U}return""}function i(w,k){for(const g of k){const U=w[g];if(typeof U=="number"&&Number.isFinite(U))return U;if(typeof U=="string"&&U.trim()){const L=Number(U);if(Number.isFinite(L))return L}}return null}function a(w,k=14,g=1400){if(!w)return{text:"",truncated:!1};const U=w.split(`
|
|
59
59
|
`);let L=U.slice(0,k).join(`
|
|
60
|
-
`),oe=U.length>k;return L.length>g&&(L=L.slice(0,g),oe=!0),{text:L,truncated:oe}}const l=y(()=>e.block.name.toLowerCase()),
|
|
60
|
+
`),oe=U.length>k;return L.length>g&&(L=L.slice(0,g),oe=!0),{text:L,truncated:oe}}const l=y(()=>e.block.name.toLowerCase()),f=y(()=>l.value.replace(/[^a-z0-9]/g,"")),u=y(()=>f.value==="requestuserinput"||f.value==="askuserquestion"),T=y(()=>["read","read_file","readfile"].includes(l.value)),S=y(()=>["write","write_file","writefile","create_file"].includes(l.value)),_=y(()=>["edit","multiedit","replace","edit_file","editfile"].includes(l.value)),A=y(()=>["bash","exec","execcommand","runcommand","shell","run_shell_command"].includes(l.value)),x=y(()=>{if(!u.value)return[];const w=e.block.input.questions;if(Array.isArray(w))return w.map(g=>g&&typeof g=="object"?g:null).filter(g=>!!g);const k={header:r(e.block.input,["header","title"]),id:r(e.block.input,["id"]),question:r(e.block.input,["question"]),prompt:r(e.block.input,["prompt"]),message:r(e.block.input,["message","text","description"]),options:Array.isArray(e.block.input.options)?e.block.input.options:void 0};return!k.question&&!k.prompt&&!k.message&&!k.header?[]:[k]});function $(w,k=120){const g=w.replace(/\s+/g," ").trim();return g?g.length>k?`${g.slice(0,k)}...`:g:""}const ee=y(()=>{const w=x.value[0];return w?$(w.question||w.prompt||w.message||w.header||""):""}),W=y(()=>r(e.block.input,["file_path","path","file","filepath","target_file"])),B=y(()=>{const w=i(e.block.input,["offset","start_line","line"]),k=i(e.block.input,["limit","lines","line_count"]),g=i(e.block.input,["end_line"]);return w!==null&&k!==null?`from line ${w}, ${k} lines`:w!==null&&g!==null?`lines ${w}-${g}`:w!==null?`from line ${w}`:k!==null?`${k} lines`:""}),P=y(()=>r(e.block.input,["content","text","new_content"])),M=y(()=>r(e.block.input,["cmd","command","script","chars"])),H=y(()=>a(P.value)),O=y(()=>{if(u.value)return ee.value||"Prompting user for clarification";if(T.value){if(W.value&&B.value)return`Read ${W.value} (${B.value})`;if(W.value)return`Read ${W.value}`}return S.value&&W.value?`Write ${W.value}`:_.value&&W.value?`Edit ${W.value}`:A.value&&M.value?`$ ${M.value}`:e.block.inputSummary}),z=y(()=>{switch(e.block.status){case"running":return"[RUN]";case"pending":return"[WAIT]";case"complete":return"[OK]";case"error":return"[ERR]"}}),te=y(()=>Object.entries(e.block.input).filter(([k,g])=>g==null||typeof g=="string"&&(!g.trim()||g.length>90)?!1:!["content","new_content","text","old_string","new_string"].includes(k)).slice(0,6).map(([k,g])=>`${k}=${JSON.stringify(g)}`)),be=y(()=>{switch(e.block.status){case"running":return"text-retro-yellow";case"pending":return"text-retro-muted";case"complete":return"text-retro-green";case"error":return"text-retro-red"}}),Z=y(()=>e.result?.content??""),j=y(()=>e.result?.isError??!1),Ee=y(()=>Z.value.length),ae=y(()=>Z.value.split(`
|
|
61
61
|
`)),Pe=y(()=>s.value?ae.value:ae.value.slice(0,6)),Xe=y(()=>!Z.value||!/^diff --git\s|\+\+\+\s|---\s|@@\s/m.test(Z.value)?!1:/^[+\- ]/.test(ae.value.find(k=>k.length>0)||"")||ae.value.some(k=>k.startsWith("@@"))),Qe=y(()=>{if(!Xe.value)return{added:0,removed:0};let w=0,k=0;for(const g of ae.value)g.startsWith("+++")||g.startsWith("---")||(g.startsWith("+")&&(w+=1),g.startsWith("-")&&(k+=1));return{added:w,removed:k}}),gt=y(()=>Z.value?Z.value.split(`
|
|
62
62
|
`).slice(0,3).join(`
|
|
63
|
-
`):""),ye=y(()=>Z.value?ae.value.length>6||Z.value.length>320:!1),kt=y(()=>Z.value.trim().length>0);function Ke(w){return w.startsWith("@@")?"text-retro-cyan bg-retro-cyan/10":w.startsWith("+")&&!w.startsWith("+++")?"text-retro-green bg-retro-green/10":w.startsWith("-")&&!w.startsWith("---")?"text-retro-red bg-retro-red/10":w.startsWith("diff --git")||w.startsWith("index ")||w.startsWith("---")||w.startsWith("+++")?"text-retro-yellow":"text-retro-muted"}return Ht(()=>e.block.id,()=>{n.value=!1,s.value=!1},{immediate:!0}),(w,k)=>(h(),m("div",
|
|
64
|
-
`)),1)])):C("",!0),
|
|
63
|
+
`):""),ye=y(()=>Z.value?ae.value.length>6||Z.value.length>320:!1),kt=y(()=>Z.value.trim().length>0);function Ke(w){return w.startsWith("@@")?"text-retro-cyan bg-retro-cyan/10":w.startsWith("+")&&!w.startsWith("+++")?"text-retro-green bg-retro-green/10":w.startsWith("-")&&!w.startsWith("---")?"text-retro-red bg-retro-red/10":w.startsWith("diff --git")||w.startsWith("index ")||w.startsWith("---")||w.startsWith("+++")?"text-retro-yellow":"text-retro-muted"}return Ht(()=>e.block.id,()=>{n.value=!1,s.value=!1},{immediate:!0}),(w,k)=>(h(),m("div",no,[d("button",{class:"flex items-center gap-2 w-full px-3 py-2 text-xs font-mono hover:bg-retro-dark/40 transition-colors text-left",onClick:k[0]||(k[0]=g=>n.value=!c(n))},[t.block.status==="running"?(h(),m("span",ro)):t.block.status==="pending"?(h(),re(c(Pn),{key:1,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-muted animate-pulse"})):t.block.status==="complete"?(h(),re(c(gr),{key:2,class:ne(["w-3.5 h-3.5 flex-shrink-0",c(be)])},null,8,["class"])):(h(),re(c(xr),{key:3,class:ne(["w-3.5 h-3.5 flex-shrink-0",c(be)])},null,8,["class"])),d("span",so,E(c(z)),1),d("span",oo,E(t.block.name),1),d("span",io,E(c(O)||t.block.inputSummary),1),we(c(Gt),{class:ne(["w-3 h-3 ml-auto transition-transform text-retro-muted flex-shrink-0",{"rotate-90":c(n)}])},null,8,["class"])]),c(n)?(h(),m("div",ao,[c(te).length>0?(h(),m("div",lo,[k[5]||(k[5]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Args",-1)),d("pre",co,E(c(te).join(`
|
|
64
|
+
`)),1)])):C("",!0),d("div",uo,[c(W)?(h(),m("div",po,[k[6]||(k[6]=d("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),d("code",ho,E(c(W)),1)])):C("",!0),c(A)&&c(M)?(h(),m("div",fo,[k[7]||(k[7]=d("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),d("code",mo,E(c(M)),1)])):C("",!0),c(T)&&c(B)?(h(),m("div",go,[k[8]||(k[8]=d("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),d("span",null,E(c(B)),1)])):C("",!0)]),c(S)&&c(H).text?(h(),m("div",ko,[k[9]||(k[9]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),d("pre",xo,E(c(H).text),1),c(H).truncated?(h(),m("div",bo,"Truncated preview")):C("",!0)])):C("",!0),d("details",wo,[k[10]||(k[10]=d("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),d("pre",yo,E(JSON.stringify(t.block.input,null,2)),1)]),c(u)&&c(x).length>0?(h(),m("div",vo,[k[11]||(k[11]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),d("div",To,[(h(!0),m(he,null,Oe(c(x),(g,U)=>(h(),m("div",{key:`${g.id||"q"}-${U}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[g.header?(h(),m("div",_o,E(g.header),1)):C("",!0),g.question||g.prompt||g.message?(h(),m("div",Ao,E(g.question||g.prompt||g.message),1)):C("",!0),Array.isArray(g.options)&&g.options.length>0?(h(),m("div",So,[(h(!0),m(he,null,Oe(g.options,(L,oe)=>(h(),m("div",{key:`${g.id||"q"}-opt-${oe}`,class:"text-xs font-mono text-retro-muted"},[Ze(E(L.label||`Option ${oe+1}`)+" ",1),L.description?(h(),m("span",Eo," - "+E(L.description),1)):C("",!0)]))),128))])):C("",!0)]))),128))])])):C("",!0),c(kt)?(h(),m("div",Ro,[d("div",{class:ne(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",c(j)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:ur(c(s)?"max-height: 20rem":"")},[c(Xe)?(h(),m(he,{key:0},[d("div",Co,[k[12]||(k[12]=Ze(" Diff · ",-1)),d("span",Lo,"+"+E(c(Qe).added),1),k[13]||(k[13]=Ze(" / ",-1)),d("span",$o,"-"+E(c(Qe).removed),1)]),d("div",Io,[(h(!0),m(he,null,Oe(c(Pe),(g,U)=>(h(),m("div",{key:`diff-${U}`,class:ne(["px-2 rounded whitespace-pre-wrap break-all",Ke(g)])},E(g||" "),3))),128))]),!c(s)&&c(ye)?(h(),m("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[1]||(k[1]=_e(g=>s.value=!0,["stop"]))}," Show full diff ("+E(c(Ee))+" chars) ",1)):c(ye)?(h(),m("button",{key:1,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[2]||(k[2]=_e(g=>s.value=!1,["stop"]))}," Collapse diff ")):C("",!0)],64)):!c(s)&&c(ye)?(h(),m(he,{key:1},[d("pre",Mo,E(c(gt)),1),d("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[3]||(k[3]=_e(g=>s.value=!0,["stop"]))}," Show full ("+E(c(Ee))+" chars) ",1)],64)):(h(),m(he,{key:2},[d("pre",Do,E(c(Z)),1),c(ye)?(h(),m("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:k[4]||(k[4]=_e(g=>s.value=!1,["stop"]))}," Collapse ")):C("",!0)],64))],6)])):C("",!0)])):C("",!0)]))}}),No={class:"mt-2 pt-2 border-t border-retro-border/20 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] font-mono text-retro-muted"},Po={class:"flex items-center gap-1"},zo={class:"flex items-center gap-1"},Bo=xe({__name:"ChatResultSummary",props:{block:{}},setup(t){const e=t,n=y(()=>{const i=Math.round(e.block.durationMs/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}),s=y(()=>`$${e.block.totalCostUsd.toFixed(4)}`),r=y(()=>{const{inputTokens:i,outputTokens:a}=e.block.usage;return`${i.toLocaleString()} in / ${a.toLocaleString()} out`});return(i,a)=>(h(),m("div",No,[d("span",Po,[a[0]||(a[0]=d("span",{class:"text-retro-muted/60"},"time",-1)),Ze(" "+E(c(n)),1)]),d("span",zo,[a[1]||(a[1]=d("span",{class:"text-retro-muted/60"},"cost",-1)),Ze(" "+E(c(s)),1)]),d("span",null,E(c(r)),1),d("span",null,E(t.block.numTurns)+" turn"+E(t.block.numTurns!==1?"s":""),1)]))}}),Uo={class:"px-2 py-1 text-[10px] font-mono text-retro-muted border-b border-retro-border/20 mb-1 flex items-center gap-2"},Fo={class:"text-retro-cyan"},Ho={key:0,class:"text-retro-border"},Go={key:1},Wo=xe({__name:"ChatSessionInit",props:{block:{}},setup(t){return(e,n)=>(h(),m("div",Uo,[d("span",Fo,E(t.block.model),1),n[0]||(n[0]=d("span",{class:"text-retro-border"},"|",-1)),d("span",null,E(t.block.tools.length)+" tools",1),t.block.permissionMode?(h(),m("span",Ho,"|")):C("",!0),t.block.permissionMode?(h(),m("span",Go,E(t.block.permissionMode),1)):C("",!0)]))}}),jo=xe({__name:"ChatContentBlock",props:{block:{},toolResultsByUseId:{}},setup(t){const e=t,n=y(()=>{if(e.block.type==="tool_use")return e.toolResultsByUseId.get(e.block.toolUseId)});return(s,r)=>{const i=Xs,a=to,l=Oo,f=Bo,u=Wo;return t.block.type==="text"?(h(),re(i,{key:0,block:t.block},null,8,["block"])):t.block.type==="thinking"?(h(),re(a,{key:1,block:t.block},null,8,["block"])):t.block.type==="tool_use"?(h(),re(l,{key:2,block:t.block,result:c(n)},null,8,["block","result"])):t.block.type==="result_summary"?(h(),re(f,{key:3,block:t.block},null,8,["block"])):t.block.type==="session_init"?(h(),re(u,{key:4,block:t.block},null,8,["block"])):C("",!0)}}}),qo={class:"flex items-center gap-2 mb-1"},Zo={class:"text-xs font-mono text-retro-muted"},Yo={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},Vo={key:1,class:"text-xs font-mono text-retro-muted"},Xo={key:2,class:"text-xs font-mono text-retro-red"},Qo={class:"flex-1 min-w-0 w-full"},Ko={key:1,class:"mb-2 flex flex-wrap gap-2"},Jo=["href","download"],ei=["src","alt"],ti={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},ni={key:2,class:"text-sm font-mono text-retro-text break-words whitespace-pre-wrap pl-[3px] pt-[5px]"},ri=["innerHTML"],si={key:4,class:"text-xs font-mono text-retro-muted italic"},oi={key:5,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},hi=xe({__name:"ChatMessage",props:{message:{}},setup(t){const e=t,{renderMarkdown:n}=Jn(),s=new Set(["read","readfile","view","glob","rg","grep","ls","list","listdir","listdirectory","listfiles","findfiles","searchfiles","searchcode","readbash","listbash"]);function r(B){return B.toLowerCase().replace(/[^a-z0-9]/g,"")}function i(B,P){return B.status==="error"||P?.isError?!1:s.has(r(B.name))}const a=y(()=>e.message.role==="user"),l=y(()=>e.message.status==="streaming"),f=y(()=>e.message.status==="error"),u=y(()=>e.message.status==="stopped"),T=y(()=>hr(e.message)),S=y(()=>{const B=new Map;for(const P of e.message.contentBlocks??[])P.type==="tool_result"&&B.set(P.toolUseId,P);return B}),_=y(()=>{if(!e.message.contentBlocks)return[];const B=e.message.contentBlocks.filter(z=>z.type!=="tool_result"),P=[];for(const z of B){const te=P.length>0?P[P.length-1]:null;if(te?.type==="text"&&z.type==="text"){const be=te.text||"",Z=z.text||"";te.text=`${be}${Z}`;continue}if(te?.type==="thinking"&&z.type==="thinking"){const be=te.thinking||"",Z=z.thinking||"";te.thinking=`${be}${Z}`;continue}P.push({...z})}const M=[];let H=[];const O=()=>{H.length!==0&&(M.push({id:`tool-group-${H[0].id}`,type:"tool_group_summary",tools:[...H]}),H=[])};for(const z of P){if(z.type==="tool_use"){const te=S.value.get(z.toolUseId);if(i(z,te)){H.push(z);continue}}O(),M.push(z)}return O(),M}),A=y(()=>T.value&&_.value.length>0),x=y(()=>e.message.content.trim().length>0),$=y(()=>e.message.attachments??[]),ee=B=>new Date(B).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),W=y(()=>n(e.message.content));return(B,P)=>{const M=Wr,H=jo;return h(),m("div",{class:ne(["flex flex-col p-3",[c(a)?"bg-retro-dark/50":"bg-transparent",c(f)?"border-l-2 border-retro-red":""]])},[d("div",qo,[d("div",{class:ne(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",c(a)?"bg-retro-cyan/20":"bg-retro-green/20"])},[c(a)?(h(),re(c(yr),{key:0,class:"w-4 h-4 text-retro-cyan"})):(h(),re(c(kr),{key:1,class:"w-4 h-4 text-retro-green"}))],2),d("span",{class:ne(["text-xs font-mono",c(a)?"text-retro-cyan":"text-retro-green"])},E(c(a)?"You":"Assistant"),3),d("span",Zo,E(ee(t.message.timestamp)),1),c(l)?(h(),m("span",Yo," typing... ")):C("",!0),c(u)?(h(),m("span",Vo," (stopped) ")):C("",!0),c(f)?(h(),m("span",Xo," (error) ")):C("",!0)]),d("div",Qo,[c(A)?(h(!0),m(he,{key:0},Oe(c(_),O=>(h(),m(he,{key:O.id},[O.type==="tool_group_summary"?(h(),re(M,{key:0,tools:O.tools},null,8,["tools"])):(h(),re(H,{key:1,block:O,"tool-results-by-use-id":c(S)},null,8,["block","tool-results-by-use-id"]))],64))),128)):C("",!0),c(a)&&c($).length>0?(h(),m("div",Ko,[(h(!0),m(he,null,Oe(c($),O=>(h(),m("a",{key:O.id,href:O.dataUrl,download:O.name,target:"_blank",rel:"noopener noreferrer",class:"w-28 rounded border border-retro-border/70 bg-retro-black/70 p-1 hover:border-retro-cyan/60"},[d("img",{src:O.dataUrl,alt:O.name,class:"h-20 w-full rounded object-cover"},null,8,ei),d("div",ti,E(O.name),1)],8,Jo))),128))])):C("",!0),!c(A)&&c(x)&&c(a)?(h(),m("div",ni,E(t.message.content),1)):C("",!0),!c(A)&&c(x)&&!c(a)?(h(),m("div",{key:3,class:"text-sm font-mono text-retro-text break-words chat-markdown px-1",innerHTML:c(W)},null,8,ri)):C("",!0),!c(A)&&!c(x)&&!c(a)&&!c(l)?(h(),m("div",si," (no visible response content) ")):C("",!0),c(l)?(h(),m("span",oi)):C("",!0)])],2)}}});function Nn(t){typeof document>"u"||(t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),document.cookie=`spec-cat-theme=${t};path=/;SameSite=Lax`)}function di(){const t=dr(),e=y(()=>t.theme),n=y(()=>t.theme==="dark");function s(){const r=t.theme==="dark"?"light":"dark";t.setTheme(r),Nn(r)}return Ht(()=>t.theme,r=>{Nn(r)},{immediate:!0}),{theme:e,isDark:n,toggleTheme:s}}export{pi as C,hi as _,ci as a,Wo as b,Xs as c,to as d,Oo as e,Bo as f,xr as g,yr as h,Pn as i,br as j,Gt as k,wr as l,D as m,yn as n,kr as o,Ys as p,Jn as q,ui as r,mr as s,gr as t,di as u,vr as w};
|