@codori/server 0.0.7 → 0.0.8
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/client-dist/200.html +1 -1
- package/client-dist/404.html +1 -1
- package/client-dist/_nuxt/B7yopJE3.js +3 -0
- package/client-dist/_nuxt/B8_cBFA9.js +1 -0
- package/client-dist/_nuxt/Bk7H2xOD.js +1 -0
- package/client-dist/_nuxt/CQFyC11H.js +1 -0
- package/client-dist/_nuxt/CffXNgAK.js +30 -0
- package/client-dist/_nuxt/{Ca5zoVcr.js → D6utdzqd.js} +1 -1
- package/client-dist/_nuxt/D9aI13e2.js +1 -0
- package/client-dist/_nuxt/DXa1zfQy.js +597 -0
- package/client-dist/_nuxt/{CmqtzKLI.js → Dxmgurnr.js} +1 -1
- package/client-dist/_nuxt/KaTeX_AMS-Regular.BQhdFMY1.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_AMS-Regular.DMm9YOAa.woff +0 -0
- package/client-dist/_nuxt/KaTeX_AMS-Regular.DRggAlZN.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Bold.BEiXGLvX.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Regular.CTRA-rTL.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Regular.wX97UBjC.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Bold.BdnERNNW.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Bold.BsDP51OF.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Bold.CL6g_b3V.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Regular.CB_wures.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Regular.CTYiF6lA.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Regular.Dxdc4cR9.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Bold.Cx986IdX.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Bold.Jm3AIy58.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Bold.waoOVXN0.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-BoldItalic.DzxPMmG6.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Main-BoldItalic.SpSLRI95.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Italic.3WenGoN9.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Italic.BMLOBm91.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Italic.NWA7e6Wa.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Regular.B22Nviop.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Regular.Dr94JaBh.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Regular.ypZvNtVU.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Math-BoldItalic.B3XSjfu4.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Math-BoldItalic.iY-2wyZ7.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Math-Italic.DA0__PXp.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Math-Italic.flOr_0UB.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Math-Italic.t53AETM-.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Bold.CFMepnvq.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Bold.D1sUS0GD.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Bold.DbIhKOiC.woff +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Italic.C3H0VqGB.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Italic.DN2j7dab.woff +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Regular.BNo7hRIc.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Regular.CS6fqUqJ.woff +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Script-Regular.C5JkGWo-.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Script-Regular.D3wIWfF6.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Script-Regular.D5yQViql.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size1-Regular.C195tn64.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size1-Regular.Dbsnue_I.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size1-Regular.mCD8mA8B.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Size2-Regular.B7gKUWhC.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size2-Regular.Dy4dx90m.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Size2-Regular.oD1tc_U0.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size3-Regular.CTq5MqoE.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size3-Regular.DgpXs0kz.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size4-Regular.BF-4gkZK.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size4-Regular.DWFBv043.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size4-Regular.Dl5lxZxV.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Typewriter-Regular.C0xS9mPB.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Typewriter-Regular.CO6r4hn1.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf +0 -0
- package/client-dist/_nuxt/Slideover.J-Ge-Kkm.css +1 -0
- package/client-dist/_nuxt/ThreadPanel.BHk6HOog.css +1 -0
- package/client-dist/_nuxt/{CGmODCAh.js → WoCgUiHo.js} +1 -1
- package/client-dist/_nuxt/builds/latest.json +1 -1
- package/client-dist/_nuxt/builds/meta/01eeb64a-c6d1-42a4-a4e3-81068fd206df.json +1 -0
- package/client-dist/_nuxt/entry.CVhSK9VF.css +1 -0
- package/client-dist/_nuxt/{BRjoAfmA.js → hh6-qavt.js} +1 -1
- package/client-dist/_nuxt/i8dRX8kB.js +1 -0
- package/client-dist/index.html +1 -1
- package/dist/git.d.ts +5 -0
- package/dist/git.js +45 -0
- package/dist/http-server.js +7 -0
- package/package.json +1 -1
- package/client-dist/_nuxt/B_aAQ6Nr.js +0 -1
- package/client-dist/_nuxt/Be-Ripyl.js +0 -30
- package/client-dist/_nuxt/Bk7RrgsR.js +0 -1
- package/client-dist/_nuxt/BuV4AypJ.js +0 -1
- package/client-dist/_nuxt/CL5qMgFz.js +0 -1
- package/client-dist/_nuxt/D22De_nZ.js +0 -3
- package/client-dist/_nuxt/NavigationMenu.DYbev1Hq.css +0 -1
- package/client-dist/_nuxt/builds/meta/78a17f74-935f-43eb-ac36-10bc5108d0f2.json +0 -1
- package/client-dist/_nuxt/entry.BFUss7SH.css +0 -1
- package/client-dist/_nuxt/hZbQM4Kn.js +0 -1
- package/client-dist/_nuxt/vB75A7qQ.js +0 -202
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CkyjGvrk.js","./DEUVOdPa.js","./wDzz0qaB.js","./BPQ3VLAy.js","./Cp-IABpG.js","./DuhV8rPH.js","./FeFRdv_D.js","./DnzrXTVv.js","./DBQR3AJH.js","./Buea-lGh.js","./CV1c1Dy6.js","./COt5Ahok.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{m as G,af as bn,aq as Tl,an as UA,ax as Yl,a3 as ZA,g as he,L as Ll,ar as hs,aP as pr,o as v,c as K,w as J,s as te,l as m,ag as No,d as M,z as L,F as Ce,ac as Se,y as de,J as P,M as gr,N as Ye,a as F,W as HA,Z as Ai,G as jA,b as Ae,H as Ot,aF as qA,X as zA,as as di,j as ct,S as Xe,aS as VA,P as tt,I as hi,v as Qn,K as Pl,x as mr,at as Ol,aR as $A,b4 as XA,R as Jl,aH as ed,p as It,q as xt,e as ze,t as X,A as O,C as ke,n as jt,B as Re,ab as rr,k as Jt,b5 as Ur,b6 as td,am as Qo,b7 as Ys,b8 as nd,E as Dt,a9 as Xn,Y as fi,$ as rd,b9 as Ul,T as Zl,U as id,ba as Hl,aV as sd,aW as jl,bb as ir,a$ as qn,a_ as od,bc as Go,b3 as ad,bd as ql,a7 as ld,au as fs,a8 as Ro,aY as Ls,_ as cd,be as Ne,bf as ud,bg as Ad,bh as dd,O as hd,bi as fd,aK as pd,bj as rt,bk as gd,bl as md,aZ as yd,i as Cd,a5 as ps,aX as bd,h as Id,Q as xd}from"./Be-Ripyl.js";import{l as wd,P as vd,m as kd,o as Bd,q as _d,r as Sd,F as Ed,s as Mo,v as Dd,w as Ps,x as Fd,_ as Nd,y as Os,z as zl,A as Vl,C as $l,B as Xl,E as ec,k as Qd,G as Gd,u as tc,H as Rd,I as nc,i as Md,j as Wd}from"./CL5qMgFz.js";function Wo(e,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(t,e))}function Kd(e){return G(()=>bn(e)?!!Tl(e)?.closest("form"):!0)}function rc(e){const t=UA("",1e3);return{search:t,handleTypeaheadSearch:(i,s)=>{t.value=t.value+i;{const o=Yl(),a=s.map(d=>({...d,textValue:d.value?.textValue??d.ref.textContent?.trim()??""})),l=a.find(d=>d.ref===o),c=a.map(d=>d.textValue),A=Yd(c,t.value,l?.textValue),u=a.find(d=>d.textValue===A);return u&&u.ref.focus(),u?.ref}},resetTypeahead:()=>{t.value=""}}}function Td(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Yd(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=Td(e,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}const Ld=[" ","Enter","ArrowUp","ArrowDown"],Pd=[" ","Enter"],dt=10;function Zr(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(r=>gs(r,t,n)):gs(e,t,n)}function gs(e,t,n){return e===void 0||t===void 0?!1:typeof e=="string"?e===t:typeof n=="function"?n(e,t):typeof n=="string"?e?.[n]===t?.[n]:ZA(e,t)}function Od(e){return e==null||e===""||Array.isArray(e)&&e.length===0}const Jd={key:0,value:""},[an,ic]=gr("SelectRoot");var Ud=he({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(e,{emit:t}){const n=e,r=t,{required:i,disabled:s,multiple:o,dir:a}=Ll(n),l=hs(n,"modelValue",r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),c=hs(n,"open",r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),A=P(),u=P(),d=P({x:0,y:0}),f=G(()=>o.value&&Array.isArray(l.value)?l.value?.length===0:No(l.value));pr({isProvider:!0});const h=wd(a),y=Kd(A),C=P(new Set),x=G(()=>Array.from(C.value).map(I=>I.value).join(";"));function p(I){if(o.value){const k=Array.isArray(l.value)?[...l.value]:[],B=k.findIndex(D=>gs(D,I,n.by));B===-1?k.push(I):k.splice(B,1),l.value=[...k]}else l.value=I}function b(I){return Array.from(C.value).find(k=>Zr(I,k.value,n.by))}return ic({triggerElement:A,onTriggerChange:I=>{A.value=I},valueElement:u,onValueElementChange:I=>{u.value=I},contentId:"",modelValue:l,onValueChange:p,by:n.by,open:c,multiple:o,required:i,onOpenChange:I=>{c.value=I},dir:h,triggerPointerDownPosRef:d,disabled:s,isEmptyModelValue:f,optionsSet:C,onOptionAdd:I=>{const k=b(I.value);k&&C.value.delete(k),C.value.add(I)},onOptionRemove:I=>{const k=b(I.value);k&&C.value.delete(k)}}),(I,k)=>(v(),K(m(vd),null,{default:J(()=>[te(I.$slots,"default",{modelValue:m(l),open:m(c)}),m(y)?(v(),K(jd,{key:x.value,"aria-hidden":"true",tabindex:"-1",multiple:m(o),required:m(i),name:I.name,autocomplete:I.autocomplete,disabled:m(s),value:m(l)},{default:J(()=>[m(No)(m(l))?(v(),M("option",Jd)):L("v-if",!0),(v(!0),M(Ce,null,Se(Array.from(C.value),B=>(v(),M("option",de({key:B.value??""},{ref_for:!0},B),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):L("v-if",!0)]),_:3}))}}),Zd=Ud,Hd=he({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){const t=e,n=P(),r=an();Ye(()=>t.value,(s,o)=>{const a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==o&&c&&n.value){const A=new Event("change",{bubbles:!0});c.call(n.value,s),n.value.dispatchEvent(A)}});function i(s){r.onValueChange(s.target.value)}return(s,o)=>(v(),K(m(HA),{"as-child":""},{default:J(()=>[F("select",de({ref_key:"selectElement",ref:n},t,{onInput:i}),[te(s.$slots,"default")],16)]),_:3}))}}),jd=Hd,qd=he({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:dt},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const n=Ai(e);return(r,i)=>(v(),K(m(kd),de(m(n),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:J(()=>[te(r.$slots,"default")]),_:3},16))}}),zd=qd;const sc={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[pi,oc]=gr("SelectContent");var Vd=he({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=t,i=an();Bd(),_d(n.bodyLock);const{CollectionSlot:s,getItems:o}=pr(),a=P();Sd(a);const{search:l,handleTypeaheadSearch:c}=rc(),A=P(),u=P(),d=P(),f=P(!1),h=P(!1),y=P(!1);function C(){u.value&&a.value&&Mo([u.value,a.value])}Ye(f,()=>{C()});const{onOpenChange:x,triggerPointerDownPosRef:p}=i;jA(B=>{if(!a.value)return;let D={x:0,y:0};const Q=Y=>{D={x:Math.abs(Math.round(Y.pageX)-(p.value?.x??0)),y:Math.abs(Math.round(Y.pageY)-(p.value?.y??0))}},R=Y=>{Y.pointerType!=="touch"&&(D.x<=10&&D.y<=10?Y.preventDefault():a.value?.contains(Y.target)||x(!1),document.removeEventListener("pointermove",Q),p.value=null)};p.value!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",R,{capture:!0,once:!0})),B(()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",R,{capture:!0})})});function b(B){const D=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!D&&B.key.length===1&&c(B.key,o()),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let R=[...o().map(Y=>Y.ref)];if(["ArrowUp","End"].includes(B.key)&&(R=R.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const Y=B.target,U=R.indexOf(Y);R=R.slice(U+1)}setTimeout(()=>Mo(R)),B.preventDefault()}}const I=G(()=>n.position==="popper"?n:{}),k=Ai(I.value);return oc({content:a,viewport:A,onViewportChange:B=>{A.value=B},itemRefCallback:(B,D,Q)=>{const R=!h.value&&!Q,Y=Zr(i.modelValue.value,D,i.by);if(i.multiple.value){if(y.value)return;(Y||R)&&(u.value=B,Y&&(y.value=!0))}else(Y||R)&&(u.value=B);R&&(h.value=!0)},selectedItem:u,selectedItemText:d,onItemLeave:()=>{a.value?.focus()},itemTextRefCallback:(B,D,Q)=>{const R=!h.value&&!Q;(Zr(i.modelValue.value,D,i.by)||R)&&(d.value=B)},focusSelectedItem:C,position:n.position,isPositioned:f,searchRef:l}),(B,D)=>(v(),K(m(s),null,{default:J(()=>[Ae(m(Ed),{"as-child":"",onMountAutoFocus:D[6]||(D[6]=Ot(()=>{},["prevent"])),onUnmountAutoFocus:D[7]||(D[7]=Q=>{r("closeAutoFocus",Q),!Q.defaultPrevented&&(m(i).triggerElement.value?.focus({preventScroll:!0}),Q.preventDefault())})},{default:J(()=>[Ae(m(qA),{"as-child":"","disable-outside-pointer-events":B.disableOutsidePointerEvents,onFocusOutside:D[2]||(D[2]=Ot(()=>{},["prevent"])),onDismiss:D[3]||(D[3]=Q=>m(i).onOpenChange(!1)),onEscapeKeyDown:D[4]||(D[4]=Q=>r("escapeKeyDown",Q)),onPointerDownOutside:D[5]||(D[5]=Q=>r("pointerDownOutside",Q))},{default:J(()=>[(v(),K(zA(B.position==="popper"?zd:th),de({...B.$attrs,...m(k)},{id:m(i).contentId,ref:Q=>{const R=m(Tl)(Q);R?.hasAttribute("data-reka-popper-content-wrapper")?a.value=R.firstElementChild:a.value=R},role:"listbox","data-state":m(i).open.value?"open":"closed",dir:m(i).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:D[0]||(D[0]=Ot(()=>{},["prevent"])),onPlaced:D[1]||(D[1]=Q=>f.value=!0),onKeydown:b}),{default:J(()=>[te(B.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3})]),_:3}))}}),$d=Vd;const[Ck,Xd]=gr("SelectItemAlignedPosition");var eh=he({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(e,{emit:t}){const n=e,r=t,{getItems:i}=pr(),s=an(),o=pi(),a=P(!1),l=P(!0),c=P(),{forwardRef:A,currentElement:u}=di(),{viewport:d,selectedItem:f,selectedItemText:h,focusSelectedItem:y}=o;function C(){if(s.triggerElement.value&&s.valueElement.value&&c.value&&u.value&&d?.value&&f?.value&&h?.value){const b=s.triggerElement.value.getBoundingClientRect(),I=u.value.getBoundingClientRect(),k=s.valueElement.value.getBoundingClientRect(),B=h.value.getBoundingClientRect();if(s.dir.value!=="rtl"){const We=B.left-I.left,Be=k.left-We,we=b.left-Be,W=b.width+we,fe=Math.max(W,I.width),wt=window.innerWidth-dt,$e=Wo(Be,dt,Math.max(dt,wt-fe));c.value.style.minWidth=`${W}px`,c.value.style.left=`${$e}px`}else{const We=I.right-B.right,Be=window.innerWidth-k.right-We,we=window.innerWidth-b.right-Be,W=b.width+we,fe=Math.max(W,I.width),wt=window.innerWidth-dt,$e=Wo(Be,dt,Math.max(dt,wt-fe));c.value.style.minWidth=`${W}px`,c.value.style.right=`${$e}px`}const D=i().map(We=>We.ref),Q=window.innerHeight-dt*2,R=d.value.scrollHeight,Y=window.getComputedStyle(u.value),U=Number.parseInt(Y.borderTopWidth,10),V=Number.parseInt(Y.paddingTop,10),ge=Number.parseInt(Y.borderBottomWidth,10),q=Number.parseInt(Y.paddingBottom,10),ee=U+V+R+q+ge,se=Math.min(f.value.offsetHeight*5,ee),Me=window.getComputedStyle(d.value),ce=Number.parseInt(Me.paddingTop,10),He=Number.parseInt(Me.paddingBottom,10),le=b.top+b.height/2-dt,xe=Q-le,ue=f.value.offsetHeight/2,Ve=f.value.offsetTop+ue,ne=U+V+Ve,Ge=ee-ne;if(ne<=le){const We=f.value===D[D.length-1];c.value.style.bottom="0px";const Be=u.value.clientHeight-d.value.offsetTop-d.value.offsetHeight,we=Math.max(xe,ue+(We?He:0)+Be+ge),W=ne+we;c.value.style.height=`${W}px`}else{const We=f.value===D[0];c.value.style.top="0px";const we=Math.max(le,U+d.value.offsetTop+(We?ce:0)+ue)+Ge;c.value.style.height=`${we}px`,d.value.scrollTop=ne-le+d.value.offsetTop}c.value.style.margin=`${dt}px 0`,c.value.style.minHeight=`${se}px`,c.value.style.maxHeight=`${Q}px`,r("placed"),requestAnimationFrame(()=>a.value=!0)}}const x=P("");ct(async()=>{await Xe(),C(),u.value&&(x.value=window.getComputedStyle(u.value).zIndex)});function p(b){b&&l.value===!0&&(C(),y?.(),l.value=!1)}return VA(s.triggerElement,()=>{C()}),Xd({contentWrapper:c,shouldExpandOnScrollRef:a,onScrollButtonChange:p}),(b,I)=>(v(),M("div",{ref_key:"contentWrapperElement",ref:c,style:hi({display:"flex",flexDirection:"column",position:"fixed",zIndex:x.value})},[Ae(m(tt),de({ref:m(A),style:{boxSizing:"border-box",maxHeight:"100%"}},{...b.$attrs,...n}),{default:J(()=>[te(b.$slots,"default")]),_:3},16)],4))}}),th=eh,nh=he({__name:"SelectArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e,n=pi(sc);return(r,i)=>m(n).position==="popper"?(v(),K(m(Dd),Qn(de({key:0},t)),{default:J(()=>[te(r.$slots,"default")]),_:3},16)):L("v-if",!0)}}),rh=nh,ih=he({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(e){return ic(e.context),oc(sc),(n,r)=>te(n.$slots,"default")}}),sh=ih;const oh={key:1};var ah=he({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,i=Pl(n,t),s=an(),o=P();ct(()=>{o.value=new DocumentFragment});const a=P(),l=G(()=>n.forceMount||s.open.value),c=P(l.value);return Ye(l,()=>{setTimeout(()=>c.value=l.value)}),(A,u)=>l.value||c.value||a.value?.present?(v(),K(m(Ol),{key:0,ref_key:"presenceRef",ref:a,present:l.value},{default:J(()=>[Ae($d,Qn(mr({...m(i),...A.$attrs})),{default:J(()=>[te(A.$slots,"default")]),_:3},16)]),_:3},8,["present"])):o.value?(v(),M("div",oh,[(v(),K($A,{to:o.value},[Ae(sh,{context:m(s)},{default:J(()=>[te(A.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):L("v-if",!0)}}),lh=ah;const[ch,uh]=gr("SelectGroup");var Ah=he({__name:"SelectGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=Ps(void 0,"reka-select-group");return uh({id:n}),(r,i)=>(v(),K(m(tt),de({role:"group"},t,{"aria-labelledby":m(n)}),{default:J(()=>[te(r.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),dh=Ah;const[ac,hh]=gr("SelectItem");var fh=he({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const n=e,r=t,{disabled:i}=Ll(n),s=an(),o=pi(),{forwardRef:a,currentElement:l}=di(),{CollectionItem:c}=pr(),A=G(()=>Zr(s.modelValue?.value,n.value,s.by)),u=P(!1),d=P(n.textValue??""),f=Ps(void 0,"reka-select-item-text"),h="select.select";async function y(I){if(I.defaultPrevented)return;const k={originalEvent:I,value:n.value};XA(h,C,k)}async function C(I){await Xe(),r("select",I),!I.defaultPrevented&&(i.value||(s.onValueChange(n.value),s.multiple.value||s.onOpenChange(!1)))}async function x(I){await Xe(),!I.defaultPrevented&&(i.value?o.onItemLeave?.():I.currentTarget?.focus({preventScroll:!0}))}async function p(I){await Xe(),!I.defaultPrevented&&I.currentTarget===Yl()&&o.onItemLeave?.()}async function b(I){await Xe(),!(I.defaultPrevented||o.searchRef?.value!==""&&I.key===" ")&&(Pd.includes(I.key)&&y(I),I.key===" "&&I.preventDefault())}if(n.value==="")throw new Error("A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return ct(()=>{l.value&&o.itemRefCallback(l.value,n.value,n.disabled)}),hh({value:n.value,disabled:i,textId:f,isSelected:A,onItemTextChange:I=>{d.value=((d.value||I?.textContent)??"").trim()}}),(I,k)=>(v(),K(m(c),{value:{textValue:d.value}},{default:J(()=>[Ae(m(tt),{ref:m(a),role:"option","aria-labelledby":m(f),"data-highlighted":u.value?"":void 0,"aria-selected":A.value,"data-state":A.value?"checked":"unchecked","aria-disabled":m(i)||void 0,"data-disabled":m(i)?"":void 0,tabindex:m(i)?void 0:-1,as:I.as,"as-child":I.asChild,onFocus:k[0]||(k[0]=B=>u.value=!0),onBlur:k[1]||(k[1]=B=>u.value=!1),onPointerup:y,onPointerdown:k[2]||(k[2]=B=>{B.currentTarget.focus({preventScroll:!0})}),onTouchend:k[3]||(k[3]=Ot(()=>{},["prevent","stop"])),onPointermove:x,onPointerleave:p,onKeydown:b},{default:J(()=>[te(I.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),ph=fh,gh=he({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,n=ac();return(r,i)=>m(n).isSelected.value?(v(),K(m(tt),de({key:0,"aria-hidden":"true"},t),{default:J(()=>[te(r.$slots,"default")]),_:3},16)):L("v-if",!0)}}),mh=gh,yh=he({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,n=an(),r=pi(),i=ac(),{forwardRef:s,currentElement:o}=di(),a=G(()=>({value:i.value,disabled:i.disabled.value,textContent:o.value?.textContent??i.value?.toString()??""}));return ct(()=>{o.value&&(i.onItemTextChange(o.value),r.itemTextRefCallback(o.value,i.value,i.disabled.value),n.onOptionAdd(a.value))}),Jl(()=>{n.onOptionRemove(a.value)}),(l,c)=>(v(),K(m(tt),de({id:m(i).textId,ref:m(s)},{...t,...l.$attrs}),{default:J(()=>[te(l.$slots,"default")]),_:3},16,["id"]))}}),Ch=yh,bh=he({__name:"SelectLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,n=ch({id:""});return(r,i)=>(v(),K(m(tt),de(t,{id:m(n).id}),{default:J(()=>[te(r.$slots,"default")]),_:3},16,["id"]))}}),Ih=bh,xh=he({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,r)=>(v(),K(m(ed),Qn(mr(t)),{default:J(()=>[te(n.$slots,"default")]),_:3},16))}}),wh=xh,vh=he({__name:"SelectSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(n,r)=>(v(),K(m(tt),de({"aria-hidden":"true"},t),{default:J(()=>[te(n.$slots,"default")]),_:3},16))}}),kh=vh,Bh=he({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=an(),{forwardRef:r,currentElement:i}=di(),s=G(()=>n.disabled?.value||t.disabled);n.contentId||=Ps(void 0,"reka-select-content"),ct(()=>{n.onTriggerChange(i.value)});const{getItems:o}=pr(),{search:a,handleTypeaheadSearch:l,resetTypeahead:c}=rc();function A(){s.value||(n.onOpenChange(!0),c())}function u(d){A(),n.triggerPointerDownPosRef.value={x:Math.round(d.pageX),y:Math.round(d.pageY)}}return(d,f)=>(v(),K(m(Fd),{"as-child":"",reference:d.reference},{default:J(()=>[Ae(m(tt),{ref:m(r),role:"combobox",type:d.as==="button"?"button":void 0,"aria-controls":m(n).contentId,"aria-expanded":m(n).open.value||!1,"aria-required":m(n).required?.value,"aria-autocomplete":"none",disabled:s.value,dir:m(n)?.dir.value,"data-state":m(n)?.open.value?"open":"closed","data-disabled":s.value?"":void 0,"data-placeholder":m(Od)(m(n).modelValue?.value)?"":void 0,"as-child":d.asChild,as:d.as,onClick:f[0]||(f[0]=h=>{h?.currentTarget?.focus()}),onPointerdown:f[1]||(f[1]=h=>{if(h.pointerType==="touch")return h.preventDefault();const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(u(h),h.preventDefault())}),onPointerup:f[2]||(f[2]=Ot(h=>{h.pointerType==="touch"&&u(h)},["prevent"])),onKeydown:f[3]||(f[3]=h=>{const y=m(a)!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&y&&h.key===" "||(m(l)(h.key,m(o)()),m(Ld).includes(h.key)&&(A(),h.preventDefault()))})},{default:J(()=>[te(d.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]),_:3},8,["reference"]))}}),_h=Bh;const Sh={base:"text-transparent bg-clip-text bg-no-repeat bg-size-[calc(200%+var(--spread)*2+2px)_100%,auto] bg-[image:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--ui-text-highlighted),#0000_calc(50%+var(--spread))),linear-gradient(var(--ui-text-muted),var(--ui-text-muted))] animate-[shimmer_var(--duration)_linear_infinite] rtl:animate-[shimmer-rtl_var(--duration)_linear_infinite] will-change-[background-position]"},Js={__name:"UChatShimmer",props:{as:{type:null,required:!1,default:"span"},text:{type:String,required:!0},duration:{type:Number,required:!1,default:2},spread:{type:Number,required:!1,default:2},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){const t=e,n=It(),r=xt("chatShimmer",t),i=G(()=>ke({extend:ke(Sh),...n.ui?.chatShimmer||{}})),s=G(()=>t.text.length*t.spread);return(o,a)=>(v(),K(m(tt),{as:e.as,style:hi({"--spread":`${s.value}px`,"--duration":`${e.duration}s`}),"data-slot":"base",class:O(i.value({class:[m(r)?.base,t.class]}))},{default:J(()=>[ze(X(e.text),1)]),_:1},8,["as","style","class"]))}},Eh={slots:{root:"group/message relative w-full",container:"relative flex items-start",leading:"inline-flex items-center justify-center min-h-6",leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",files:"flex items-center gap-1.5 mb-1.5",content:"relative text-pretty min-w-0 *:first:mt-0 *:last:mb-0",actions:["opacity-0 group-hover/message:opacity-100 absolute bottom-0 flex items-center","transition-opacity"]},variants:{variant:{solid:{content:"bg-inverted text-inverted"},outline:{content:"bg-default ring ring-default"},soft:{content:"bg-elevated/50"},subtle:{content:"bg-elevated/50 ring ring-default"},naked:{content:""}},side:{left:{},right:{container:"justify-end ms-auto max-w-[75%]",files:"justify-end"}},leading:{true:""},actions:{true:""},compact:{true:{root:"scroll-mt-3",container:"gap-1.5 pb-3",content:"space-y-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},false:{root:"scroll-mt-4 sm:scroll-mt-6",container:"gap-3 pb-8",content:"space-y-4",leadingIcon:"size-8",leadingAvatarSize:"md"}}},compoundVariants:[{compact:!0,actions:!0,class:{container:"pb-8"}},{leading:!0,compact:!1,side:"left",class:{actions:"left-11"}},{leading:!0,compact:!0,side:"left",class:{actions:"left-6.5"}},{variant:["solid","outline","soft","subtle"],compact:!1,class:{content:"px-4 py-3 rounded-lg min-h-12",leading:"mt-2"}},{variant:["solid","outline","soft","subtle"],compact:!0,class:{content:"px-2 py-1 rounded-lg min-h-8",leading:"mt-1"}},{variant:"naked",side:"left",class:{content:"w-full"}}],defaultVariants:{variant:"naked"}},Ko={__name:"UChatMessage",props:{as:{type:null,required:!1,default:"article"},icon:{type:null,required:!1},avatar:{type:Object,required:!1},variant:{type:null,required:!1},side:{type:null,required:!1},actions:{type:Array,required:!1},compact:{type:Boolean,required:!1},content:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},id:{type:String,required:!0},role:{type:String,required:!0},metadata:{type:null,required:!1},parts:{type:Array,required:!0}},setup(e){const t=e,n=jt(),r=It(),i=xt("chatMessage",t),s=G(()=>t.parts?.filter(a=>a.type==="file")??[]),o=G(()=>ke({extend:ke(Eh),...r.ui?.chatMessage||{}})({variant:t.variant,side:t.side,leading:!!t.icon||!!t.avatar||!!n.leading,actions:!!t.actions||!!n.actions,compact:t.compact}));return(a,l)=>(v(),K(m(tt),{as:e.as,"data-role":e.role,"data-slot":"root",class:O(o.value.root({class:[m(i)?.root,t.class]}))},{default:J(()=>[n.files&&s.value.length?(v(),M("div",{key:0,"data-slot":"files",class:O(o.value.files({class:m(i)?.files}))},[te(a.$slots,"files",{parts:s.value})],2)):L("",!0),F("div",{"data-slot":"container",class:O(o.value.container({class:m(i)?.container}))},[e.icon||e.avatar||n.leading?(v(),M("div",{key:0,"data-slot":"leading",class:O(o.value.leading({class:m(i)?.leading}))},[te(a.$slots,"leading",{avatar:e.avatar,ui:o.value},()=>[e.icon?(v(),K(Re,{key:0,name:e.icon,"data-slot":"leadingIcon",class:O(o.value.leadingIcon({class:m(i)?.leadingIcon}))},null,8,["name","class"])):e.avatar?(v(),K(rr,de({key:1,size:m(i)?.leadingAvatarSize||o.value.leadingAvatarSize()},e.avatar,{"data-slot":"leadingAvatar",class:o.value.leadingAvatar({class:m(i)?.leadingAvatar})}),null,16,["size","class"])):L("",!0)])],2)):L("",!0),e.content||e.parts.length||n.content?(v(),M("div",{key:1,"data-slot":"content",class:O(o.value.content({class:m(i)?.content}))},[te(a.$slots,"content",{id:e.id,role:e.role,content:e.content,parts:e.parts},()=>[e.content?(v(),M(Ce,{key:0},[ze(X(e.content),1)],64)):(v(!0),M(Ce,{key:1},Se(e.parts,(c,A)=>(v(),M(Ce,{key:`${e.id}-${c.type}-${A}`},[c.type==="text"?(v(),M(Ce,{key:0},[ze(X(c.text),1)],64)):L("",!0)],64))),128))])],2)):L("",!0),e.actions||n.actions?(v(),M("div",{key:2,"data-slot":"actions",class:O(o.value.actions({class:m(i)?.actions}))},[te(a.$slots,"actions",{actions:e.actions},()=>[(v(!0),M(Ce,null,Se(e.actions,(c,A)=>(v(),K(Nd,{key:A,text:c.label},{default:J(()=>[Ae(Jt,de({size:"sm",color:"neutral",variant:"ghost"},{ref_for:!0},m(Ur)(c,["onClick"]),{label:void 0,onClick:u=>typeof c.onClick=="function"?c.onClick(u,t):void 0}),null,16,["onClick"])]),_:2},1032,["text"]))),128))])],2)):L("",!0)],2)]),_:3},8,["as","data-role","class"]))}},Dh={slots:{root:"w-full flex flex-col gap-1 flex-1 px-2.5 [&>article]:last-of-type:min-h-(--last-message-height)",indicator:"h-6 flex items-center gap-1 py-3 *:size-2 *:rounded-full *:bg-elevated [&>*:nth-child(1)]:animate-[bounce_1s_infinite] [&>*:nth-child(2)]:animate-[bounce_1s_0.15s_infinite] [&>*:nth-child(3)]:animate-[bounce_1s_0.3s_infinite]",viewport:"absolute inset-x-0 top-[86%] data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",autoScroll:"rounded-full absolute right-1/2 translate-x-1/2 bottom-0"},variants:{compact:{true:"",false:""}}},Fh=["data-status"],Nh=["data-state"],Qh={__name:"UChatMessages",props:{messages:{type:Array,required:!1},status:{type:String,required:!1},shouldAutoScroll:{type:Boolean,required:!1,default:!1},shouldScrollToBottom:{type:Boolean,required:!1,default:!0},autoScroll:{type:[Boolean,Object],required:!1,default:!0},autoScrollIcon:{type:null,required:!1},user:{type:Object,required:!1},assistant:{type:Object,required:!1},compact:{type:Boolean,required:!1},spacingOffset:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){const t=e,n=jt(),r=()=>Ur(n,["default","indicator","viewport"]),i=G(()=>{if(t.status==="submitted")return!0;if(t.status!=="streaming")return!1;const R=t.messages?.[t.messages.length-1];return R?.role==="assistant"&&!R.parts?.length}),s=It(),o=xt("chatMessages",t),a=Dt(()=>Xn(t.user,{side:"right",variant:"soft"})),l=Dt(()=>Xn(t.assistant,{side:"left",variant:"naked"})),c=G(()=>ke({extend:ke(Dh),...s.ui?.chatMessages||{}})({compact:t.compact})),A=P(null),u=P(null),d=P(new Map),f=P(!1),h=P(0),y=P(!1),C=P(0),x=P(!1);function p(R,Y){const U=Y?.$el;U&&d.value.set(R,U)}function b(R){const Y=d.value.get(R);Y&&Y.scrollIntoView({behavior:"smooth",block:"start"})}function I(R=!0){u.value&&(R?u.value.scrollTo({top:u.value.scrollHeight,behavior:"smooth"}):u.value.scrollTop=u.value.scrollHeight)}td([()=>t.messages,()=>t.status],([R,Y])=>{if(!t.messages?.length){f.value=!1,x.value=!1,C.value=0,d.value.clear();return}if(Y==="streaming"){if(!t.shouldAutoScroll){k();return}Xe(()=>{!u.value||x.value||u.value.scrollHeight-u.value.scrollTop-u.value.clientHeight<150&&I(!1)})}},{deep:!0,throttle:50,leading:!0}),Ye(()=>t.status,R=>{if(R!=="submitted")return;const Y=t.messages?.[t.messages.length-1];!Y||Y.role!=="user"||(x.value=!1,Xe(()=>{y.value=!0,Q(),Xe(()=>{b(Y.id)})}))});function k(){if(!u.value)return;const R=u.value.scrollTop+u.value.clientHeight,Y=u.value.scrollHeight,U=100;f.value=Y-R>=U,u.value.scrollTop<C.value?x.value=!0:Y-R<U&&(x.value=!1),C.value=u.value.scrollTop}function B(){x.value=!1,I()}function D(R){if(!R)return document.documentElement;const Y=/auto|scroll/;let U=R;for(;U&&U!==document.body&&U!==document.documentElement;){const V=window.getComputedStyle(U);if(Y.test(V.overflowY))return U;U=U.parentElement}return document.documentElement}function Q(){if(!A.value||!u.value||!t.messages?.length||!y.value)return;const{height:R}=nd(u.value),Y=t.messages.findLast(ee=>ee.role==="user");if(!Y)return;const U=d.value.get(Y.id);if(!U)return;let V=t.spacingOffset||0;const ge=window.getComputedStyle(A.value),q=window.getComputedStyle(u.value);V+=Number.parseFloat(ge.rowGap)||Number.parseFloat(ge.gap)||0,V+=Number.parseFloat(q.paddingTop)||0,V+=Number.parseFloat(q.paddingBottom)||0,h.value=Math.max(R.value-U.offsetHeight-V,0)}return ct(()=>{u.value=D(A.value),u.value&&(C.value=u.value.scrollTop,t.shouldScrollToBottom?(I(!1),setTimeout(()=>{I(!1)},100)):Xe(()=>{k()}),Qo(u,"scroll",k),Qo(window,"resize",()=>Xe(Q)))}),(R,Y)=>(v(),M("div",{ref_key:"el",ref:A,"data-status":e.status,"data-slot":"root",class:O(c.value.root({class:[m(o)?.root,t.class]})),style:hi({"--last-message-height":`${h.value}px`})},[te(R.$slots,"default",{},()=>[(v(!0),M(Ce,null,Se(e.messages,U=>(v(),K(Ko,de({key:U.id},{ref_for:!0},{...U.role==="user"?a.value:l.value,...U},{ref_for:!0,ref:V=>p(U.id,V),compact:e.compact}),Ys({_:2},[Se(r(),(V,ge)=>({name:ge,fn:J(q=>[te(R.$slots,ge,de({ref_for:!0},q,{message:U}))])}))]),1040,["compact"]))),128))]),i.value?(v(),K(Ko,de({key:0,id:"indicator",role:"assistant"},{...l.value,actions:void 0,parts:[]},{compact:e.compact}),{content:J(()=>[te(R.$slots,"indicator",{ui:c.value},()=>[F("div",{"data-slot":"indicator",class:O(c.value.indicator({class:m(o)?.indicator}))},[...Y[0]||(Y[0]=[F("span",null,null,-1),F("span",null,null,-1),F("span",null,null,-1)])],2)])]),_:3},16,["compact"])):L("",!0),Ae(m(Ol),{present:f.value},{default:J(()=>[F("div",{"data-state":f.value?"open":"closed","data-slot":"viewport",class:O(c.value.viewport({class:m(o)?.viewport}))},[te(R.$slots,"viewport",{ui:c.value,onClick:B},()=>[e.autoScroll?(v(),K(Jt,de({key:0,icon:e.autoScrollIcon||m(s).ui.icons.arrowDown,color:"neutral",variant:"outline"},typeof e.autoScroll=="object"?e.autoScroll:{},{"data-slot":"autoScroll",class:c.value.autoScroll({class:m(o)?.autoScroll}),onClick:B}),null,16,["icon","class"])):L("",!0)])],10,Nh)]),_:3},8,["present"])],14,Fh))}},Gh={slots:{root:"relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5",wrapper:"min-w-0 flex-1 flex flex-col",title:"text-sm font-medium",description:"text-sm opacity-90",icon:"shrink-0 size-5",avatar:"shrink-0",avatarSize:"2xl",actions:"flex flex-wrap gap-1.5 shrink-0",close:"p-0"},variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},orientation:{horizontal:{root:"items-center",actions:"items-center"},vertical:{root:"items-start",actions:"items-start mt-2.5"}},title:{true:{description:"mt-1"}}},compoundVariants:[{color:"primary",variant:"solid",class:{root:"bg-primary text-inverted"}},{color:"secondary",variant:"solid",class:{root:"bg-secondary text-inverted"}},{color:"success",variant:"solid",class:{root:"bg-success text-inverted"}},{color:"info",variant:"solid",class:{root:"bg-info text-inverted"}},{color:"warning",variant:"solid",class:{root:"bg-warning text-inverted"}},{color:"error",variant:"solid",class:{root:"bg-error text-inverted"}},{color:"primary",variant:"outline",class:{root:"text-primary ring ring-inset ring-primary/25"}},{color:"secondary",variant:"outline",class:{root:"text-secondary ring ring-inset ring-secondary/25"}},{color:"success",variant:"outline",class:{root:"text-success ring ring-inset ring-success/25"}},{color:"info",variant:"outline",class:{root:"text-info ring ring-inset ring-info/25"}},{color:"warning",variant:"outline",class:{root:"text-warning ring ring-inset ring-warning/25"}},{color:"error",variant:"outline",class:{root:"text-error ring ring-inset ring-error/25"}},{color:"primary",variant:"soft",class:{root:"bg-primary/10 text-primary"}},{color:"secondary",variant:"soft",class:{root:"bg-secondary/10 text-secondary"}},{color:"success",variant:"soft",class:{root:"bg-success/10 text-success"}},{color:"info",variant:"soft",class:{root:"bg-info/10 text-info"}},{color:"warning",variant:"soft",class:{root:"bg-warning/10 text-warning"}},{color:"error",variant:"soft",class:{root:"bg-error/10 text-error"}},{color:"primary",variant:"subtle",class:{root:"bg-primary/10 text-primary ring ring-inset ring-primary/25"}},{color:"secondary",variant:"subtle",class:{root:"bg-secondary/10 text-secondary ring ring-inset ring-secondary/25"}},{color:"success",variant:"subtle",class:{root:"bg-success/10 text-success ring ring-inset ring-success/25"}},{color:"info",variant:"subtle",class:{root:"bg-info/10 text-info ring ring-inset ring-info/25"}},{color:"warning",variant:"subtle",class:{root:"bg-warning/10 text-warning ring ring-inset ring-warning/25"}},{color:"error",variant:"subtle",class:{root:"bg-error/10 text-error ring ring-inset ring-error/25"}},{color:"neutral",variant:"solid",class:{root:"text-inverted bg-inverted"}},{color:"neutral",variant:"outline",class:{root:"text-highlighted bg-default ring ring-inset ring-default"}},{color:"neutral",variant:"soft",class:{root:"text-highlighted bg-elevated/50"}},{color:"neutral",variant:"subtle",class:{root:"text-highlighted bg-elevated/50 ring ring-inset ring-accented"}}],defaultVariants:{color:"primary",variant:"solid"}},yr={__name:"UAlert",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:"vertical"},actions:{type:Array,required:!1},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=t,i=jt(),{t:s}=fi(),o=It(),a=xt("alert",n),l=G(()=>ke({extend:ke(Gh),...o.ui?.alert||{}})({color:n.color,variant:n.variant,orientation:n.orientation,title:!!n.title||!!i.title}));return(c,A)=>(v(),K(m(tt),{as:e.as,"data-orientation":e.orientation,"data-slot":"root",class:O(l.value.root({class:[m(a)?.root,n.class]}))},{default:J(()=>[te(c.$slots,"leading",{ui:l.value},()=>[e.avatar?(v(),K(rr,de({key:0,size:m(a)?.avatarSize||l.value.avatarSize()},e.avatar,{"data-slot":"avatar",class:l.value.avatar({class:m(a)?.avatar})}),null,16,["size","class"])):e.icon?(v(),K(Re,{key:1,name:e.icon,"data-slot":"icon",class:O(l.value.icon({class:m(a)?.icon}))},null,8,["name","class"])):L("",!0)]),F("div",{"data-slot":"wrapper",class:O(l.value.wrapper({class:m(a)?.wrapper}))},[e.title||i.title?(v(),M("div",{key:0,"data-slot":"title",class:O(l.value.title({class:m(a)?.title}))},[te(c.$slots,"title",{},()=>[ze(X(e.title),1)])],2)):L("",!0),e.description||i.description?(v(),M("div",{key:1,"data-slot":"description",class:O(l.value.description({class:m(a)?.description}))},[te(c.$slots,"description",{},()=>[ze(X(e.description),1)])],2)):L("",!0),e.orientation==="vertical"&&(e.actions?.length||i.actions)?(v(),M("div",{key:2,"data-slot":"actions",class:O(l.value.actions({class:m(a)?.actions}))},[te(c.$slots,"actions",{},()=>[(v(!0),M(Ce,null,Se(e.actions,(u,d)=>(v(),K(Jt,de({key:d,size:"xs"},{ref_for:!0},u),null,16))),128))])],2)):L("",!0)],2),e.orientation==="horizontal"&&(e.actions?.length||i.actions)||e.close?(v(),M("div",{key:0,"data-slot":"actions",class:O(l.value.actions({class:m(a)?.actions,orientation:"horizontal"}))},[e.orientation==="horizontal"&&(e.actions?.length||i.actions)?te(c.$slots,"actions",{key:0},()=>[(v(!0),M(Ce,null,Se(e.actions,(u,d)=>(v(),K(Jt,de({key:d,size:"xs"},{ref_for:!0},u),null,16))),128))]):L("",!0),te(c.$slots,"close",{ui:l.value},()=>[e.close?(v(),K(Jt,de({key:0,icon:e.closeIcon||m(o).ui.icons.close,color:"neutral",variant:"link","aria-label":m(s)("alert.close")},typeof e.close=="object"?e.close:{},{"data-slot":"close",class:l.value.close({class:m(a)?.close}),onClick:A[0]||(A[0]=u=>r("update:open",!1))}),null,16,["icon","aria-label","class"])):L("",!0)])],2)):L("",!0)]),_:3},8,["as","data-orientation","class"]))}},Rh={slots:{base:""}},Mh=Object.assign({inheritAttrs:!1},{__name:"UChatPromptSubmit",props:{status:{type:String,required:!1,default:"ready"},icon:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},streamingIcon:{type:null,required:!1},streamingColor:{type:null,required:!1,default:"neutral"},streamingVariant:{type:null,required:!1,default:"subtle"},submittedIcon:{type:null,required:!1},submittedColor:{type:null,required:!1,default:"neutral"},submittedVariant:{type:null,required:!1,default:"subtle"},errorIcon:{type:null,required:!1},errorColor:{type:null,required:!1,default:"error"},errorVariant:{type:null,required:!1,default:"soft"},ui:{type:Object,required:!1},class:{type:null,required:!1},label:{type:String,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},emits:["stop","reload"],setup(e,{emit:t}){const n=e,r=t,i=jt(),{t:s}=fi(),o=It(),a=xt("chatPromptSubmit",n),l=Ai(rd(n,"icon","color","variant","status","streamingIcon","streamingColor","streamingVariant","submittedIcon","submittedColor","submittedVariant","errorIcon","errorColor","errorVariant","class","ui")),c=G(()=>({ready:{icon:n.icon||o.ui.icons.arrowUp,color:n.color,variant:n.variant,type:"submit"},submitted:{icon:n.submittedIcon||o.ui.icons.stop,color:n.submittedColor,variant:n.submittedVariant,onClick(u){r("stop",u)}},streaming:{icon:n.streamingIcon||o.ui.icons.stop,color:n.streamingColor,variant:n.streamingVariant,onClick(u){r("stop",u)}},error:{icon:n.errorIcon||o.ui.icons.reload,color:n.errorColor,variant:n.errorVariant,onClick(u){r("reload",u)}}})[n.status]),A=G(()=>ke({extend:ke(Rh),...o.ui?.chatPromptSubmit||{}})());return(u,d)=>(v(),K(Jt,de({...m(l),...c.value,"aria-label":m(s)("chatPromptSubmit.label"),...u.$attrs},{class:A.value.base({class:[m(a)?.base,n.class]}),ui:m(Ul)(A.value,m(a))}),Ys({_:2},[Se(i,(f,h)=>({name:h,fn:J(y=>[te(u.$slots,h,Qn(mr(y)))])}))]),1040,["class","ui"]))}}),Wh={slots:{base:["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed",value:"truncate pointer-events-none",placeholder:"truncate text-dimmed",arrow:"fill-bg stroke-default",content:"max-h-60 w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col",viewport:"relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",separator:"-mx-1 my-1 h-px bg-border",item:["group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"],itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0",itemWrapper:"flex-1 flex flex-col min-w-0",itemLabel:"truncate",itemDescription:"truncate text-muted"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},size:{xs:{base:"px-2 py-1 text-xs gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-2 text-xs"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-2.5 text-xs"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-2.5 text-sm"},lg:{base:"px-3 py-2 text-sm gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-3 text-sm"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailingIcon:"size-6",empty:"p-3 text-base"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented hover:bg-elevated disabled:bg-default",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented hover:bg-accented/75 disabled:bg-elevated",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Kh=Object.assign({inheritAttrs:!1},{__name:"USelect",props:{id:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["change","blur","focus","update:modelValue","update:open"],setup(e,{expose:t,emit:n}){const r=e,i=n,s=jt(),o=It(),a=xt("select",r),l=Pl(Zl(r,"open","defaultOpen","disabled","autocomplete","required","multiple"),i),c=id(Dt(()=>r.portal)),A=Dt(()=>Xn(r.content,{side:"bottom",sideOffset:8,collisionPadding:8,position:"popper"})),u=Dt(()=>Xn(r.arrow,{rounded:!0})),{emitFormChange:d,emitFormInput:f,emitFormBlur:h,emitFormFocus:y,size:C,color:x,id:p,name:b,highlight:I,disabled:k,ariaAttrs:B}=Hl(r),{orientation:D,size:Q}=sd(r),{isLeading:R,isTrailing:Y,leadingIconName:U,trailingIconName:V}=jl(Dt(()=>Xn(r,{trailingIcon:o.ui.icons.chevronDown}))),ge=G(()=>Q.value||C.value),q=G(()=>ke({extend:ke(Wh),...o.ui?.select||{}})({color:x.value,variant:r.variant,size:ge?.value,loading:r.loading,highlight:I.value,leading:R.value||!!r.avatar||!!s.leading,trailing:Y.value||!!s.trailing,fieldGroup:D.value})),ee=G(()=>r.items?.length?ad(r.items)?r.items:[r.items]:[]),se=G(()=>ee.value.flatMap(ne=>ne));function Me(ne){if(r.multiple&&Array.isArray(ne)){const Ge=ne.map(je=>Go(se.value,je,{labelKey:r.labelKey,valueKey:r.valueKey})).filter(je=>je!=null&&je!=="");return Ge.length>0?Ge.join(", "):void 0}return Go(se.value,ne,{labelKey:r.labelKey,valueKey:r.valueKey})}const ce=ir("triggerRef");function He(){r.autofocus&&ce.value?.$el?.focus({focusVisible:!0})}ct(()=>{setTimeout(()=>{He()},r.autofocusDelay)});function le(ne){r.modelModifiers?.trim&&(typeof ne=="string"||ne===null||ne===void 0)&&(ne=ne?.trim()??null),r.modelModifiers?.number&&(ne=ql(ne)),r.modelModifiers?.nullable&&(ne??=null),r.modelModifiers?.optional&&!r.modelModifiers?.nullable&&ne!==null&&(ne??=void 0);const Ge=new Event("change",{target:{value:ne}});i("change",Ge),d(),f()}function xe(ne){if(ne){const Ge=new FocusEvent("focus");i("focus",Ge),y()}else{const Ge=new FocusEvent("blur");i("blur",Ge),h()}}function ue(ne){return typeof ne=="object"&&ne!==null}const Ve=ir("viewportRef");return t({triggerRef:Dt(()=>ce.value?.$el),viewportRef:Dt(()=>Ve.value)}),(ne,Ge)=>(v(),K(m(Zd),de({name:m(b)},m(l),{autocomplete:e.autocomplete,disabled:m(k),"default-value":e.defaultValue,"model-value":e.modelValue,"onUpdate:modelValue":le,"onUpdate:open":xe}),{default:J(({modelValue:je,open:We})=>[Ae(m(_h),de({id:m(p),ref_key:"triggerRef",ref:ce,"data-slot":"base",class:q.value.base({class:[m(a)?.base,r.class]})},{...ne.$attrs,...m(B)}),{default:J(()=>[m(R)||e.avatar||s.leading?(v(),M("span",{key:0,"data-slot":"leading",class:O(q.value.leading({class:m(a)?.leading}))},[te(ne.$slots,"leading",{modelValue:je,open:We,ui:q.value},()=>[m(R)&&m(U)?(v(),K(Re,{key:0,name:m(U),"data-slot":"leadingIcon",class:O(q.value.leadingIcon({class:m(a)?.leadingIcon}))},null,8,["name","class"])):e.avatar?(v(),K(rr,de({key:1,size:m(a)?.itemLeadingAvatarSize||q.value.itemLeadingAvatarSize()},e.avatar,{"data-slot":"itemLeadingAvatar",class:q.value.itemLeadingAvatar({class:m(a)?.itemLeadingAvatar})}),null,16,["size","class"])):L("",!0)])],2)):L("",!0),te(ne.$slots,"default",{modelValue:je,open:We,ui:q.value},()=>[(v(!0),M(Ce,null,Se([Me(je)],Be=>(v(),M(Ce,{key:Be},[Be!=null?(v(),M("span",{key:0,"data-slot":"value",class:O(q.value.value({class:m(a)?.value}))},X(Be),3)):(v(),M("span",{key:1,"data-slot":"placeholder",class:O(q.value.placeholder({class:m(a)?.placeholder}))},X(e.placeholder??" "),3))],64))),128))]),m(Y)||s.trailing?(v(),M("span",{key:1,"data-slot":"trailing",class:O(q.value.trailing({class:m(a)?.trailing}))},[te(ne.$slots,"trailing",{modelValue:je,open:We,ui:q.value},()=>[m(V)?(v(),K(Re,{key:0,name:m(V),"data-slot":"trailingIcon",class:O(q.value.trailingIcon({class:m(a)?.trailingIcon}))},null,8,["name","class"])):L("",!0)])],2)):L("",!0)]),_:2},1040,["id","class"]),Ae(m(wh),Qn(mr(m(c))),{default:J(()=>[Ae(m(lh),de({"data-slot":"content",class:q.value.content({class:m(a)?.content})},A.value),{default:J(()=>[te(ne.$slots,"content-top"),F("div",{ref_key:"viewportRef",ref:Ve,role:"presentation","data-slot":"viewport",class:O(q.value.viewport({class:m(a)?.viewport}))},[(v(!0),M(Ce,null,Se(ee.value,(Be,we)=>(v(),K(m(dh),{key:`group-${we}`,"data-slot":"group",class:O(q.value.group({class:m(a)?.group}))},{default:J(()=>[(v(!0),M(Ce,null,Se(Be,(W,fe)=>(v(),M(Ce,{key:`group-${we}-${fe}`},[ue(W)&&W.type==="label"?(v(),K(m(Ih),{key:0,"data-slot":"label",class:O(q.value.label({class:[m(a)?.label,W.ui?.label,W.class]}))},{default:J(()=>[ze(X(m(qn)(W,r.labelKey)),1)]),_:2},1032,["class"])):ue(W)&&W.type==="separator"?(v(),K(m(kh),{key:1,"data-slot":"separator",class:O(q.value.separator({class:[m(a)?.separator,W.ui?.separator,W.class]}))},null,8,["class"])):(v(),K(m(ph),{key:2,"data-slot":"item",class:O(q.value.item({class:[m(a)?.item,ue(W)&&W.ui?.item,ue(W)&&W.class]})),disabled:ue(W)&&W.disabled,value:ue(W)?m(qn)(W,r.valueKey):W,onSelect:wt=>ue(W)&&W.onSelect?.(wt)},{default:J(()=>[te(ne.$slots,"item",{item:W,index:fe,ui:q.value},()=>[te(ne.$slots,"item-leading",{item:W,index:fe,ui:q.value},()=>[ue(W)&&W.icon?(v(),K(Re,{key:0,name:W.icon,"data-slot":"itemLeadingIcon",class:O(q.value.itemLeadingIcon({class:[m(a)?.itemLeadingIcon,W.ui?.itemLeadingIcon]}))},null,8,["name","class"])):ue(W)&&W.avatar?(v(),K(rr,de({key:1,size:W.ui?.itemLeadingAvatarSize||m(a)?.itemLeadingAvatarSize||q.value.itemLeadingAvatarSize()},{ref_for:!0},W.avatar,{"data-slot":"itemLeadingAvatar",class:q.value.itemLeadingAvatar({class:[m(a)?.itemLeadingAvatar,W.ui?.itemLeadingAvatar]})}),null,16,["size","class"])):ue(W)&&W.chip?(v(),K(od,de({key:2,size:W.ui?.itemLeadingChipSize||m(a)?.itemLeadingChipSize||q.value.itemLeadingChipSize(),inset:"",standalone:""},{ref_for:!0},W.chip,{"data-slot":"itemLeadingChip",class:q.value.itemLeadingChip({class:[m(a)?.itemLeadingChip,W.ui?.itemLeadingChip]})}),null,16,["size","class"])):L("",!0)]),F("span",{"data-slot":"itemWrapper",class:O(q.value.itemWrapper({class:[m(a)?.itemWrapper,ue(W)&&W.ui?.itemWrapper]}))},[Ae(m(Ch),{"data-slot":"itemLabel",class:O(q.value.itemLabel({class:[m(a)?.itemLabel,ue(W)&&W.ui?.itemLabel]}))},{default:J(()=>[te(ne.$slots,"item-label",{item:W,index:fe},()=>[ze(X(ue(W)?m(qn)(W,r.labelKey):W),1)])]),_:2},1032,["class"]),ue(W)&&(m(qn)(W,r.descriptionKey)||s["item-description"])?(v(),M("span",{key:0,"data-slot":"itemDescription",class:O(q.value.itemDescription({class:[m(a)?.itemDescription,ue(W)&&W.ui?.itemDescription]}))},[te(ne.$slots,"item-description",{item:W,index:fe},()=>[ze(X(m(qn)(W,r.descriptionKey)),1)])],2)):L("",!0)],2),F("span",{"data-slot":"itemTrailing",class:O(q.value.itemTrailing({class:[m(a)?.itemTrailing,ue(W)&&W.ui?.itemTrailing]}))},[te(ne.$slots,"item-trailing",{item:W,index:fe,ui:q.value}),Ae(m(mh),{"as-child":""},{default:J(()=>[Ae(Re,{name:e.selectedIcon||m(o).ui.icons.check,"data-slot":"itemTrailingIcon",class:O(q.value.itemTrailingIcon({class:[m(a)?.itemTrailingIcon,ue(W)&&W.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:2},1032,["class","disabled","value","onSelect"]))],64))),128))]),_:2},1032,["class"]))),128))],2),te(ne.$slots,"content-bottom"),e.arrow?(v(),K(m(rh),de({key:0},u.value,{"data-slot":"arrow",class:q.value.arrow({class:m(a)?.arrow})}),null,16,["class"])):L("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["name","autocomplete","disabled","default-value","model-value"]))}});function Th(e){let t=!1;function n(o){return o.isComposing||o.keyCode===229}function r(o){t||n(o)||(o.preventDefault(),e(o))}let i;function s(){clearTimeout(i),t=!0,i=setTimeout(()=>{t=!1},50)}return{onKeydown:r,onCompositionEnd:s}}const Yh={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute start-0 flex items-start",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute end-0 flex items-start",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2 inset-y-1",trailing:"pe-2 inset-y-1",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"},autoresize:{true:{base:"resize-none"}}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Lh=["id","value","name","rows","placeholder","disabled","required"],Ph=Object.assign({inheritAttrs:!1},{__name:"UTextarea",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},autoresize:{type:Boolean,required:!1},autoresizeDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},rows:{type:Number,required:!1,default:3},maxrows:{type:Number,required:!1,default:0},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(e,{expose:t,emit:n}){const r=e,i=n,s=jt(),o=hs(r,"modelValue",i,{defaultValue:r.defaultValue}),a=It(),l=xt("textarea",r),{emitFormFocus:c,emitFormBlur:A,emitFormInput:u,emitFormChange:d,size:f,color:h,id:y,name:C,highlight:x,disabled:p,ariaAttrs:b}=Hl(r,{deferInputValidation:!0}),{isLeading:I,isTrailing:k,leadingIconName:B,trailingIconName:D}=jl(r),Q=G(()=>ke({extend:ke(Yh),...a.ui?.textarea||{}})({color:h.value,variant:r.variant,size:f?.value,loading:r.loading,highlight:x.value,fixed:r.fixed,autoresize:r.autoresize,leading:I.value||!!r.avatar||!!s.leading,trailing:k.value||!!s.trailing})),R=ir("textareaRef");function Y(se){r.modelModifiers?.trim&&(typeof se=="string"||se===null||se===void 0)&&(se=se?.trim()??null),r.modelModifiers?.number&&(se=ql(se)),r.modelModifiers?.nullable&&(se||=null),r.modelModifiers?.optional&&!r.modelModifiers?.nullable&&se!==null&&(se||=void 0),o.value=se,u()}function U(se){ee(),r.modelModifiers?.lazy||Y(se.target.value)}function V(se){const Me=se.target.value;r.modelModifiers?.lazy&&Y(Me),r.modelModifiers?.trim&&(se.target.value=Me.trim()),d(),i("change",se)}function ge(se){A(),i("blur",se)}function q(){r.autofocus&&R.value?.focus()}function ee(){if(r.autoresize&&R.value){R.value.rows=r.rows;const se=R.value.style.overflow;R.value.style.overflow="hidden";const Me=window.getComputedStyle(R.value),ce=Number.parseInt(Me.paddingTop),He=Number.parseInt(Me.paddingBottom),le=ce+He,xe=Number.parseInt(Me.lineHeight),{scrollHeight:ue}=R.value,Ve=(ue-le)/xe;Ve>r.rows&&(R.value.rows=r.maxrows?Math.min(Ve,r.maxrows):Ve),R.value.style.overflow=se}}return Ye(o,()=>{Xe(ee)}),ct(()=>{setTimeout(()=>{q()},r.autofocusDelay),setTimeout(()=>{ee()},r.autoresizeDelay)}),t({textareaRef:R}),(se,Me)=>(v(),K(m(tt),{as:e.as,"data-slot":"root",class:O(Q.value.root({class:[m(l)?.root,r.class]}))},{default:J(()=>[F("textarea",de({id:m(y),ref_key:"textareaRef",ref:R,value:m(o),name:m(C),rows:e.rows,placeholder:e.placeholder,"data-slot":"base",class:Q.value.base({class:m(l)?.base}),disabled:m(p),required:e.required},{...se.$attrs,...m(b)},{onInput:U,onBlur:ge,onChange:V,onFocus:Me[0]||(Me[0]=(...ce)=>m(c)&&m(c)(...ce))}),null,16,Lh),te(se.$slots,"default",{ui:Q.value}),m(I)||e.avatar||s.leading?(v(),M("span",{key:0,"data-slot":"leading",class:O(Q.value.leading({class:m(l)?.leading}))},[te(se.$slots,"leading",{ui:Q.value},()=>[m(I)&&m(B)?(v(),K(Re,{key:0,name:m(B),"data-slot":"leadingIcon",class:O(Q.value.leadingIcon({class:m(l)?.leadingIcon}))},null,8,["name","class"])):e.avatar?(v(),K(rr,de({key:1,size:m(l)?.leadingAvatarSize||Q.value.leadingAvatarSize()},e.avatar,{"data-slot":"leadingAvatar",class:Q.value.leadingAvatar({class:m(l)?.leadingAvatar})}),null,16,["size","class"])):L("",!0)])],2)):L("",!0),m(k)||s.trailing?(v(),M("span",{key:1,"data-slot":"trailing",class:O(Q.value.trailing({class:m(l)?.trailing}))},[te(se.$slots,"trailing",{ui:Q.value},()=>[m(D)?(v(),K(Re,{key:0,name:m(D),"data-slot":"trailingIcon",class:O(Q.value.trailingIcon({class:m(l)?.trailingIcon}))},null,8,["name","class"])):L("",!0)])],2)):L("",!0)]),_:3},8,["as","class"]))}}),Oh={slots:{root:"relative flex flex-col items-stretch gap-2 px-2.5 py-2 w-full rounded-lg backdrop-blur",header:"flex items-center gap-1.5",body:"items-start",footer:"flex items-center justify-between gap-1.5",base:""},variants:{variant:{outline:{root:"bg-default/75 ring ring-default"},soft:{root:"bg-elevated/50"},subtle:{root:"bg-elevated/50 ring ring-default"},naked:{root:""}}},defaultVariants:{variant:"outline"}},Jh=Object.assign({inheritAttrs:!1},{__name:"UChatPrompt",props:Ro({as:{type:null,required:!1,default:"form"},placeholder:{type:String,required:!1},variant:{type:null,required:!1},error:{type:Error,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},rows:{type:Number,required:!1,default:1},autofocus:{type:Boolean,required:!1,default:!0},autofocusDelay:{type:Number,required:!1},autoresize:{type:Boolean,required:!1,default:!0},autoresizeDelay:{type:Number,required:!1},maxrows:{type:Number,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},disabled:{type:Boolean,required:!1}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:Ro(["submit","close"],["update:modelValue"]),setup(e,{expose:t,emit:n}){const r=e,i=n,s=jt(),o=ld(e,"modelValue",{type:String,default:""}),{t:a}=fi(),l=It(),c=xt("chatPrompt",r),A=Ai(Zl(r,"rows","autofocus","autofocusDelay","autoresize","autoresizeDelay","maxrows","icon","avatar","loading","loadingIcon")),u=()=>Ur(s,["header","footer"]),d=G(()=>ke({extend:ke(Oh),...l.ui?.chatPrompt||{}})({variant:r.variant})),f=ir("textareaRef");function h(p){o.value.trim()!==""&&i("submit",p)}function y(p){f.value?.textareaRef?.blur(),i("close",p)}const{onKeydown:C,onCompositionEnd:x}=Th(p=>{h(p)});return t({textareaRef:Dt(()=>f.value?.textareaRef)}),(p,b)=>(v(),K(m(tt),{as:e.as,"data-slot":"root",class:O(d.value.root({class:[m(c)?.root,r.class]})),onSubmit:Ot(h,["prevent"])},{default:J(()=>[s.header?(v(),M("div",{key:0,"data-slot":"header",class:O(d.value.header({class:m(c)?.header}))},[te(p.$slots,"header")],2)):L("",!0),Ae(Ph,de({ref_key:"textareaRef",ref:f,modelValue:o.value,"onUpdate:modelValue":b[0]||(b[0]=I=>o.value=I),placeholder:e.placeholder||m(a)("chatPrompt.placeholder"),disabled:!!e.error||e.disabled,variant:"none",fixed:""},{...m(A),...p.$attrs},{ui:m(Ul)(m(Ur)(d.value,["root","body","header","footer"]),m(c)),"data-slot":"body",class:d.value.body({class:m(c)?.body}),onKeydown:[fs(Ot(m(C),["exact"]),["enter"]),fs(y,["esc"])],onCompositionend:m(x)}),Ys({_:2},[Se(u(),(I,k)=>({name:k,fn:J(B=>[te(p.$slots,k,Qn(mr(B)))])}))]),1040,["modelValue","placeholder","disabled","ui","class","onKeydown","onCompositionend"]),s.footer?(v(),M("div",{key:1,"data-slot":"footer",class:O(d.value.footer({class:m(c)?.footer}))},[te(p.$slots,"footer")],2)):L("",!0)]),_:3},8,["as","class"]))}}),Us="data-thread-event",Ue="data-thread-item",Uh=e=>e===null||e==="pendingInit"||e==="running",To=e=>e?"streaming":"done",Zh=e=>e.type==="text"?e.text.trim()?[{type:"text",text:e.text,state:"done"}]:[]:[{type:"attachment",attachment:{kind:"image",name:e.path.split(/[\\/]/).pop()||"image",mediaType:"image/*",localPath:e.path}}],In=e=>{switch(e.type){case"userMessage":return[{id:e.id,role:"user",parts:e.content.flatMap(Zh)}];case"agentMessage":return[{id:e.id,role:"assistant",parts:[{type:"text",text:e.text,state:"done"}]}];case"plan":return[{id:e.id,role:"assistant",parts:[{type:"text",text:e.text,state:"done"}]}];case"reasoning":return[{id:e.id,role:"assistant",parts:[{type:"reasoning",summary:e.summary,content:e.content,state:"done"}]}];case"commandExecution":return[{id:e.id,role:"system",pending:e.status==="inProgress",parts:[{type:Ue,data:{kind:"command_execution",item:e}}]}];case"fileChange":return[{id:e.id,role:"system",pending:e.status==="inProgress",parts:[{type:Ue,data:{kind:"file_change",item:e}}]}];case"mcpToolCall":return[{id:e.id,role:"system",pending:e.status==="inProgress",parts:[{type:Ue,data:{kind:"mcp_tool_call",item:e}}]}];case"dynamicToolCall":return[{id:e.id,role:"system",pending:e.status==="inProgress",parts:[{type:Ue,data:{kind:"dynamic_tool_call",item:e}}]}];case"collabAgentToolCall":return[{id:e.id,role:"system",pending:e.status==="inProgress",parts:[{type:Ue,data:{kind:"subagent_activity",item:{...e,agentsStates:[...e.receiverThreadIds,...Object.keys(e.agentsStates).filter(t=>!e.receiverThreadIds.includes(t))].map(t=>({threadId:t,status:e.agentsStates[t]?.status??null,message:e.agentsStates[t]?.message??null}))}}}]}];case"webSearch":return[{id:e.id,role:"system",pending:e.status==="inProgress",parts:[{type:Ue,data:{kind:"web_search",item:e}}]}];case"contextCompaction":return[{id:e.id,role:"system",parts:[{type:Ue,data:{kind:"context_compaction",item:e}}]}];default:return[]}},Yo=e=>e.turns.flatMap(t=>t.items.flatMap(n=>In(n))),Oi=(e,t)=>({id:e,role:"system",parts:[{type:Us,data:t}]}),lc=e=>e.parts.map(t=>t.type==="text"?{...t,state:t.state??To(e.pending)}:t.type==="reasoning"?{...t,state:t.state??To(e.pending)}:t),cc=e=>({...e,parts:lc(e)}),St=(e,t)=>{const n=cc(t),r=e.slice(),i=r.findIndex(s=>s.id===n.id);return i===-1?(r.push(n),r):(r.splice(i,1,{...r[i],...n,parts:lc({...r[i],...n})}),r)},Lo=(e,t)=>{const n=cc(t),r=e.slice(),i=r.findIndex(s=>s.id===n.id);return i===-1?(r.push(n),r):(r.splice(i,1,n),r)},Po=8,Oo=20*1024*1024,Hh=e=>e.toLowerCase().startsWith("image/"),jh=(e,t)=>{const n=[],r=[];for(const i of e){if(t+r.length>=Po){n.push({code:"tooMany",fileName:i.name,message:`You can attach up to ${Po} images per message.`});continue}const s=i.type||"application/octet-stream";if(!Hh(s)){n.push({code:"unsupportedType",fileName:i.name,message:"Only image attachments are currently supported."});continue}if(i.size>Oo){n.push({code:"tooLarge",fileName:i.name,message:`Each image must be ${Math.floor(Oo/(1024*1024))} MB or smaller.`});continue}r.push(i)}return{accepted:r,issues:n}},Jo=(e,t)=>{const n=[],r=e.trim();r&&n.push({type:"text",text:r,text_elements:[]});for(const i of t)n.push({type:"localImage",path:i.path});return n},qh=e=>{const t=new URLSearchParams({path:e.path}),n=`/projects/${Os(e.projectId)}/attachments/file?${t.toString()}`;return zl(e.configuredBase)?`/api/codori${n}`:Vl(n,e.configuredBase)},zh=e=>{const t=`/projects/${Os(e.projectId)}/attachments`;return zl(e.configuredBase)?`/api/codori${t}`:Vl(t,e.configuredBase)},Vh={class:"overflow-hidden rounded-2xl border border-default bg-elevated/30"},$h=["src","alt"],Xh={class:"flex items-center gap-3 px-3 py-2 text-sm text-toned"},ef={class:"truncate"},tf=he({__name:"Attachment",props:{projectId:{},part:{}},setup(e){const t=e,n=Ls(),r=G(()=>{const i=t.part?.attachment;return i?i.url?i.url:!i.localPath||!t.projectId?null:qh({projectId:t.projectId,path:i.localPath,configuredBase:String(n.public.serverBase??"")}):null});return(i,s)=>{const o=Re;return v(),M("div",Vh,[r.value?(v(),M("img",{key:0,src:r.value,alt:e.part?.attachment.name,class:"max-h-80 w-full object-cover",loading:"lazy"},null,8,$h)):L("",!0),F("div",Xh,[Ae(o,{name:"i-lucide-image",class:"size-4 text-primary"}),F("span",ef,X(e.part?.attachment.name),1)])])}}}),nf=Object.assign(tf,{__name:"MessagePartAttachment"}),rf={class:"text-sm"},sf=he({__name:"Event",props:{part:{}},setup(e){const t=e,n=G(()=>t.part?.type===Us?t.part.data:null),r=G(()=>{const s=n.value;return s?s.kind==="turn.failed"||s.kind==="stream.error":!1}),i=G(()=>{switch(n.value?.kind){case"turn.failed":return"Turn failed";case"stream.error":return"Stream error";default:return"Event"}});return(s,o)=>{const a=yr;return r.value?(v(),K(a,{key:0,color:"error",variant:"soft",icon:"i-lucide-circle-alert",title:i.value},{description:J(()=>[F("span",rf,X(n.value?.kind==="turn.failed"?n.value.error?.message??"The turn failed.":n.value?.kind==="stream.error"?n.value.message:""),1)]),_:1},8,["title"])):L("",!0)}}}),of=Object.assign(sf,{__name:"MessagePartEvent"}),af={slots:{root:"",trigger:["group flex w-full items-center gap-1.5 text-muted text-sm disabled:cursor-default disabled:hover:text-muted hover:text-default focus-visible:outline-offset-2 focus-visible:outline-primary min-w-0","transition-colors"],leading:"relative size-4 shrink-0",leadingIcon:"size-4 shrink-0",chevronIcon:"size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",label:"truncate",suffix:"text-dimmed ms-1",trailingIcon:"size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",content:"data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden",body:"text-sm text-dimmed whitespace-pre-wrap"},variants:{variant:{inline:{body:"pt-2"},card:{root:"rounded-md ring ring-default overflow-hidden",trigger:"px-2 py-1",trailingIcon:"ms-auto",body:"border-t border-default p-2 max-h-[200px] overflow-y-auto"}},chevron:{leading:{leadingIcon:"group-hover:opacity-0"},trailing:""},loading:{true:{leadingIcon:"animate-spin"}},alone:{false:{leadingIcon:["absolute inset-0 group-data-[state=open]:opacity-0","transition-opacity duration-200"],chevronIcon:["absolute inset-0 opacity-0 group-hover:opacity-100 group-data-[state=open]:opacity-100","transition-[rotate,opacity] duration-200"]}}},defaultVariants:{variant:"inline"}},Gn={__name:"UChatTool",props:{text:{type:String,required:!1},suffix:{type:String,required:!1},icon:{type:null,required:!1},loading:{type:Boolean,required:!1,default:!1},loadingIcon:{type:null,required:!1},streaming:{type:Boolean,required:!1,default:!1},variant:{type:null,required:!1,default:"inline"},chevron:{type:String,required:!1,default:"trailing"},chevronIcon:{type:null,required:!1},shimmer:{type:Object,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=t,i=jt(),s=It(),o=xt("chatTool",n),a=G(()=>ke({extend:ke(af),...s.ui?.chatTool||{}})({variant:n.variant,chevron:n.chevron,loading:n.loading})),l=G(()=>n.open!==void 0),c=P(n.defaultOpen??!1),A=G(()=>l.value?n.open:c.value);function u(C){c.value=C,r("update:open",C)}const d=G(()=>!!i.default),f=G(()=>n.loadingIcon||s.ui.icons?.loading),h=G(()=>n.loading?f.value:n.icon),y=G(()=>n.chevronIcon||s.ui.icons?.chevronDown);return(C,x)=>(v(),K(m(ec),{open:A.value,disabled:e.disabled,"unmount-on-hide":e.unmountOnHide,"data-slot":"root",class:O(a.value.root({class:[m(o)?.root,n.class]})),"onUpdate:open":u},{default:J(({open:p})=>[Ae(m($l),{"as-child":"",disabled:!d.value},{default:J(()=>[F("button",{type:"button","data-slot":"trigger",class:O(a.value.trigger({class:m(o)?.trigger}))},[h.value||d.value&&e.chevron==="leading"?(v(),M("span",{key:0,"data-slot":"leading",class:O(a.value.leading({class:m(o)?.leading}))},[h.value?(v(),K(Re,{key:0,name:h.value,"data-slot":"leadingIcon",class:O(a.value.leadingIcon({class:m(o)?.leadingIcon,alone:!(d.value&&e.chevron==="leading")}))},null,8,["name","class"])):L("",!0),d.value&&e.chevron==="leading"?(v(),K(Re,{key:1,name:y.value,"data-slot":"chevronIcon",class:O(a.value.chevronIcon({class:m(o)?.chevronIcon,alone:!h.value}))},null,8,["name","class"])):L("",!0)],2)):L("",!0),F("span",{"data-slot":"label",class:O(a.value.label({class:m(o)?.label}))},[e.streaming&&e.text?(v(),K(Js,de({key:0,text:e.text},n.shimmer),null,16,["text"])):(v(),M(Ce,{key:1},[ze(X(e.text),1)],64)),e.suffix?(v(),M("span",{key:2,"data-slot":"suffix",class:O(a.value.suffix({class:m(o)?.suffix}))},X(e.suffix),3)):L("",!0)],2),d.value&&e.chevron==="trailing"?(v(),K(Re,{key:1,name:y.value,"data-slot":"trailingIcon",class:O(a.value.trailingIcon({class:m(o)?.trailingIcon}))},null,8,["name","class"])):L("",!0)],2)]),_:1},8,["disabled"]),Ae(m(Xl),{"data-slot":"content",class:O(a.value.content({class:m(o)?.content}))},{default:J(()=>[F("div",{"data-slot":"body",class:O(a.value.body({class:m(o)?.body}))},[te(C.$slots,"default",{open:p})],2)]),_:2},1032,["class"])]),_:3},8,["open","disabled","unmount-on-hide","class"]))}},Uo=new Set(["inProgress","running","streaming"]),Rn=(e,t=!1)=>{const n=P(t),r=G(()=>Uo.has(String(e()??"")));return Ye(e,(i,s)=>{if(r.value||i==="failed"){n.value=!0;return}i==="completed"&&Uo.has(String(s??""))&&(n.value=!1)},{immediate:!0}),{open:n,isLoading:G(()=>r.value),isStreaming:G(()=>r.value)}},lf={class:"space-y-3"},cf={key:0,class:"overflow-x-auto rounded-xl border border-default/70 bg-elevated/40 px-3 py-3 text-xs leading-6 text-toned"},uf={key:1,class:"text-xs text-muted"},Af={key:2,class:"text-xs font-medium text-muted"},df=he({__name:"CommandExecution",props:{item:{}},setup(e){const t=e,n=G(()=>{switch(t.item.status){case"inProgress":return"Running..";case"failed":return"Run failed";default:return"Ran"}}),r=G(()=>t.item.aggregatedOutput?.trim()??""),i=G(()=>t.item.status==="failed"?"i-lucide-triangle-alert":"i-lucide-terminal"),{open:s,isLoading:o,isStreaming:a}=Rn(()=>t.item.status,t.item.status!=="completed");return(l,c)=>{const A=yr,u=Gn;return v(),K(u,{text:n.value,suffix:e.item.command,icon:i.value,loading:m(o),streaming:m(a),variant:"card",open:m(s),"default-open":e.item.status!=="completed","onUpdate:open":c[0]||(c[0]=d=>s.value=d)},{default:J(()=>[F("div",lf,[r.value?(v(),M("pre",cf,X(r.value),1)):(v(),M("p",uf," Waiting for output. ")),e.item.exitCode!==null?(v(),M("p",Af," Exit code "+X(e.item.exitCode),1)):L("",!0),e.item.status==="failed"&&e.item.exitCode!==null?(v(),K(A,{key:3,color:"error",variant:"soft",icon:"i-lucide-triangle-alert",title:`Command failed with exit code ${e.item.exitCode}`},null,8,["title"])):L("",!0)])]),_:1},8,["text","suffix","icon","loading","streaming","open","default-open"])}}}),hf=Object.assign(df,{__name:"MessageItemCommandExecution"}),ff={},pf={class:"flex items-center gap-2 rounded-full border border-default/70 bg-elevated/30 px-3 py-2 text-xs text-muted"};function gf(e,t){const n=Re;return v(),M("div",pf,[Ae(n,{name:"i-lucide-package-open",class:"size-3.5"}),t[0]||(t[0]=ze(" Thread context was compacted. ",-1))])}const mf=Object.assign(cd(ff,[["render",gf]]),{__name:"MessageItemContextCompaction"}),yf={class:"space-y-3"},Cf={key:0,class:"overflow-x-auto rounded-xl border border-default/70 bg-elevated/30 px-3 py-3 text-xs leading-6 text-toned"},bf={key:1,class:"overflow-x-auto rounded-xl border border-default/70 bg-elevated/30 px-3 py-3 text-xs leading-6 text-toned"},If=he({__name:"DynamicToolCall",props:{item:{}},setup(e){const t=e,n=G(()=>t.item.contentItems?.map(u=>u.type==="inputText"?u.text:`[image] ${u.imageUrl}`).join(`
|
|
3
|
-
|
|
4
|
-
`)??""),r=u=>u.trim().toLowerCase().split("/").filter(Boolean).at(-1)?.replace(/[_\-\s]/g,"")??"",i=G(()=>r(t.item.tool??"")),s=G(()=>{if(["sharedmemory","corazonsharedmemory"].includes(i.value))return"Memory";if(["manageworkflow","corazonmanageworkflow"].includes(i.value))return"Workflow";switch(t.item.status){case"inProgress":return"Running internal tool";case"failed":return"Internal tool failed";default:return"Internal tool"}}),o=G(()=>t.item.status==="failed"?"i-lucide-triangle-alert":["sharedmemory","corazonsharedmemory"].includes(i.value)?"i-lucide-database":["manageworkflow","corazonmanageworkflow"].includes(i.value)?"i-lucide-workflow":"i-lucide-wrench"),a=G(()=>["sharedmemory","corazonsharedmemory"].includes(i.value)?"Internal memory operation":["manageworkflow","corazonmanageworkflow"].includes(i.value)?"Internal workflow operation":t.item.tool),{open:l,isLoading:c,isStreaming:A}=Rn(()=>t.item.status,t.item.status==="failed");return(u,d)=>{const f=Gn;return v(),K(f,{text:s.value,suffix:a.value,icon:o.value,loading:m(c),streaming:m(A),variant:e.item.arguments!=null||n.value?"card":"inline",open:m(l),"default-open":e.item.status==="failed","onUpdate:open":d[0]||(d[0]=h=>l.value=h)},{default:J(()=>[F("div",yf,[n.value?(v(),M("pre",Cf,X(n.value),1)):L("",!0),e.item.arguments!=null?(v(),M("pre",bf,X(JSON.stringify(e.item.arguments,null,2)),1)):L("",!0),e.item.success!==null?(v(),M("p",{key:2,class:O(["text-xs font-medium",e.item.success?"text-success":"text-error"])},X(e.item.success?"Completed successfully.":"Reported failure."),3)):L("",!0)])]),_:1},8,["text","suffix","icon","loading","streaming","variant","open","default-open"])}}}),xf=Object.assign(If,{__name:"MessageItemDynamicToolCall"}),wf={class:"overflow-x-auto rounded-md border border-default/70 bg-elevated/20"},vf={class:"min-w-full border-collapse font-mono text-[11px] leading-5"},kf={class:"px-3 py-0.5 whitespace-pre"},Bf=he({__name:"UnifiedDiffViewer",props:{diff:{}},setup(e){const t=e,n=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,r=G(()=>{const a=t.diff.replace(/\r\n/g,`
|
|
5
|
-
`).trim();if(!a)return[];const l=[],c=a.split(`
|
|
6
|
-
`);let A=null,u=null;return c.forEach((d,f)=>{const h=`diff-row-${f}`;if(d.startsWith("@@")){const y=d.match(n);A=y?Number.parseInt(y[1]??"0",10):null,u=y?Number.parseInt(y[2]??"0",10):null,l.push({id:h,kind:"hunk",text:d,prefix:"@@",oldLineNumber:null,newLineNumber:null});return}if(d.startsWith("diff --git")||d.startsWith("index ")||d.startsWith("--- ")||d.startsWith("+++ ")){l.push({id:h,kind:"meta",text:d,prefix:d.slice(0,Math.min(4,d.length)),oldLineNumber:null,newLineNumber:null});return}if(d.startsWith("\\")){l.push({id:h,kind:"note",text:d,prefix:"\\",oldLineNumber:null,newLineNumber:null});return}if(d.startsWith("+")){l.push({id:h,kind:"add",text:d.slice(1),prefix:"+",oldLineNumber:null,newLineNumber:u}),u=u==null?null:u+1;return}if(d.startsWith("-")){l.push({id:h,kind:"delete",text:d.slice(1),prefix:"-",oldLineNumber:A,newLineNumber:null}),A=A==null?null:A+1;return}l.push({id:h,kind:"context",text:d.startsWith(" ")?d.slice(1):d,prefix:" ",oldLineNumber:A,newLineNumber:u}),A=A==null?null:A+1,u=u==null?null:u+1}),l}),i=a=>a==null?"":String(a),s=a=>{switch(a){case"meta":return"bg-muted/15 text-muted";case"hunk":return"bg-info/10 text-info";case"add":return"bg-success/10 text-success";case"delete":return"bg-error/10 text-error";case"note":return"bg-muted/10 text-muted italic";default:return"text-toned"}},o=a=>{switch(a){case"add":return"text-success";case"delete":return"text-error";case"hunk":return"text-info";case"meta":case"note":return"text-muted";default:return"text-dimmed"}};return(a,l)=>(v(),M("div",wf,[F("table",vf,[F("tbody",null,[(v(!0),M(Ce,null,Se(r.value,c=>(v(),M("tr",{key:c.id,class:O(s(c.kind))},[F("td",{class:O(["w-12 select-none border-r border-default/60 px-2 text-right align-top",o(c.kind)])},X(i(c.oldLineNumber)),3),F("td",{class:O(["w-12 select-none border-r border-default/60 px-2 text-right align-top",o(c.kind)])},X(i(c.newLineNumber)),3),F("td",{class:O(["w-6 select-none border-r border-default/60 px-2 text-center align-top",o(c.kind)])},X(c.prefix),3),F("td",kf,X(c.text),1)],2))),128))])])]))}}),_f=Object.assign(Bf,{__name:"MessageItemUnifiedDiffViewer"}),Sf={class:"space-y-3"},Ef={key:0,class:"overflow-x-auto rounded-xl border border-default/70 bg-elevated/40 px-3 py-3 text-xs leading-6 text-toned"},Df={class:"space-y-3"},Ff={class:"flex items-center gap-2 text-xs font-medium text-muted"},Nf={class:"font-mono text-toned"},Qf=he({__name:"FileChange",props:{item:{}},setup(e){const t=e,n=G(()=>t.item.changes??[]),r=d=>typeof d=="string"&&d.trim().length>0,i=G(()=>{const[d]=n.value;return d?.path?n.value.length===1?d.path:`${d.path} +${n.value.length-1} more`:"file changes"}),s=G(()=>{const f=n.value.length>0&&n.value.every(h=>h.kind==="delete");switch(t.item.status){case"inProgress":return"Editing..";case"failed":return"Edit failed";default:return f?"Deleted":"Edited"}}),o=G(()=>t.item.status==="failed"?"i-lucide-triangle-alert":"i-lucide-file-pen-line"),a=d=>{switch(d){case"add":return"i-lucide-plus";case"delete":return"i-lucide-minus";case"update":return"i-lucide-pencil";default:return"i-lucide-file"}},l=d=>{switch(d){case"add":return"text-success";case"delete":return"text-error";case"update":return"text-warning";default:return"text-muted"}},{open:c,isLoading:A,isStreaming:u}=Rn(()=>t.item.status,t.item.status!=="completed");return(d,f)=>{const h=Re,y=_f,C=Gn;return v(),K(C,{text:s.value,suffix:i.value,icon:o.value,loading:m(A),streaming:m(u),variant:"card",open:m(c),"default-open":e.item.status!=="completed","onUpdate:open":f[0]||(f[0]=x=>c.value=x)},{default:J(()=>[F("div",Sf,[e.item.liveOutput?(v(),M("pre",Ef,X(e.item.liveOutput),1)):L("",!0),F("ul",Df,[(v(!0),M(Ce,null,Se(n.value,(x,p)=>(v(),M("li",{key:`${e.item.id}-${x.path}-${p}`,class:"space-y-2 rounded-xl border border-default/70 bg-elevated/20 px-3 py-3"},[F("div",Ff,[Ae(h,{name:a(x.kind),class:O(["size-3.5",l(x.kind)])},null,8,["name","class"]),F("span",Nf,X(x.path),1)]),r(x.diff)?(v(),K(y,{key:0,diff:x.diff??""},null,8,["diff"])):L("",!0)]))),128))])])]),_:1},8,["text","suffix","icon","loading","streaming","open","default-open"])}}}),Gf=Object.assign(Qf,{__name:"MessageItemFileChange"}),Rf={class:"space-y-3"},Mf={key:0,class:"rounded-xl border border-default/70 bg-elevated/30 px-3 py-3"},Wf={class:"overflow-x-auto text-xs leading-6 text-toned"},Kf={key:1,class:"rounded-xl border border-default/70 bg-elevated/30 px-3 py-3"},Tf={class:"space-y-1"},Yf={key:2,class:"rounded-xl border border-default/70 bg-elevated/30 px-3 py-3"},Lf={class:"overflow-x-auto text-xs leading-6 text-toned"},Pf=he({__name:"McpToolCall",props:{item:{}},setup(e){const t=e,n=l=>{try{return JSON.stringify(l,null,2)}catch{return String(l)}},r=G(()=>"MCP"),i=G(()=>t.item.status==="failed"?"i-lucide-triangle-alert":"i-lucide-plug-zap"),{open:s,isLoading:o,isStreaming:a}=Rn(()=>t.item.status,t.item.status!=="completed");return(l,c)=>{const A=yr,u=Gn;return v(),K(u,{text:r.value,suffix:`${e.item.server} ${e.item.tool}`,icon:i.value,loading:m(o),streaming:m(a),variant:"card",open:m(s),"default-open":e.item.status!=="completed","onUpdate:open":c[0]||(c[0]=d=>s.value=d)},{default:J(()=>[F("div",Rf,[e.item.arguments!==void 0?(v(),M("div",Mf,[c[1]||(c[1]=F("p",{class:"mb-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted"}," Arguments ",-1)),F("pre",Wf,X(n(e.item.arguments)),1)])):L("",!0),e.item.progressMessages?.length?(v(),M("div",Kf,[c[2]||(c[2]=F("p",{class:"mb-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted"}," Progress ",-1)),F("ul",Tf,[(v(!0),M(Ce,null,Se(e.item.progressMessages,(d,f)=>(v(),M("li",{key:`${e.item.id}-progress-${f}`,class:"text-xs leading-6 text-toned"},X(d),1))),128))])])):L("",!0),e.item.result?(v(),M("div",Yf,[c[3]||(c[3]=F("p",{class:"mb-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted"}," Result ",-1)),F("pre",Lf,X(n(e.item.result)),1)])):L("",!0),e.item.error?.message?(v(),K(A,{key:3,color:"error",variant:"soft",icon:"i-lucide-triangle-alert",title:e.item.error.message},null,8,["title"])):L("",!0)])]),_:1},8,["text","suffix","icon","loading","streaming","open","default-open"])}}}),Of=Object.assign(Pf,{__name:"MessageItemMcpToolCall"}),Jf={class:"space-y-3"},Uf={class:"rounded-md border border-default/70 bg-elevated/20 px-3 py-2"},Zf={class:"flex flex-wrap items-center gap-2 text-xs text-muted"},Hf={class:"font-mono text-toned"},jf={class:"font-mono text-toned"},qf={key:0,class:"mt-2 flex flex-wrap items-center gap-3 text-xs text-muted"},zf={key:0},Vf={class:"font-mono text-toned"},$f={key:1},Xf={class:"font-mono text-toned"},ep={key:0,class:"rounded-md border border-default/70 bg-elevated/10 px-3 py-2"},tp={class:"whitespace-pre-wrap break-words text-xs leading-6 text-muted"},np={key:1,class:"rounded-md border border-default/70 bg-elevated/10 px-3 py-2"},rp={class:"space-y-2"},ip={class:"flex flex-wrap items-center gap-2 text-xs"},sp={class:"font-mono text-toned"},op={key:0,class:"text-xs text-muted"},ap=he({__name:"SubagentActivity",props:{item:{}},setup(e){const t=e,n=new Set(["wait","closeAgent"]),r=G(()=>n.has(t.item.tool)),i=G(()=>t.item.agentsStates??[]),s=h=>h.slice(0,8),o=G(()=>{switch(t.item.tool){case"spawnAgent":return t.item.status==="failed"?"Spawn failed":t.item.status==="inProgress"?"Spawning..":"Spawned";case"sendInput":return t.item.status==="failed"?"Send failed":t.item.status==="inProgress"?"Sending..":"Sent";case"resumeAgent":return t.item.status==="failed"?"Resume failed":t.item.status==="inProgress"?"Resuming..":"Resumed";case"wait":return"Waiting";case"closeAgent":return"Closed";default:return"Subagent"}}),a=G(()=>t.item.receiverThreadIds.length===0?"":t.item.receiverThreadIds.length===1?s(t.item.receiverThreadIds[0]??""):`${t.item.receiverThreadIds.length} agents`),l=h=>{switch(h){case"pendingInit":return"primary";case"running":return"info";case"completed":return"success";case"interrupted":return"warning";case"errored":return"error";case"shutdown":case"notFound":return"neutral";default:return"neutral"}},c=h=>{switch(h){case"pendingInit":return"pending";case"running":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"errored":return"errored";case"shutdown":return"shutdown";case"notFound":return"not found";default:return"active"}},A=G(()=>t.item.status==="failed"?"i-lucide-triangle-alert":"i-lucide-bot"),{open:u,isLoading:d,isStreaming:f}=Rn(()=>t.item.status,t.item.status!=="completed");return(h,y)=>{const C=Qd,x=Gn;return r.value?L("",!0):(v(),K(x,{key:0,text:o.value,suffix:a.value,icon:A.value,loading:m(d),streaming:m(f),variant:"card",open:m(u),"default-open":e.item.status==="failed","onUpdate:open":y[0]||(y[0]=p=>u.value=p)},{default:J(()=>[F("div",Jf,[F("div",Uf,[F("div",Zf,[y[1]||(y[1]=F("span",{class:"font-medium text-highlighted"},"from",-1)),F("span",Hf,X(s(e.item.senderThreadId)),1),y[2]||(y[2]=F("span",{class:"font-medium text-highlighted"},"to",-1)),F("span",jf,X(e.item.receiverThreadIds.map(s).join(", ")||"-"),1)]),e.item.model||e.item.reasoningEffort?(v(),M("div",qf,[e.item.model?(v(),M("span",zf,[y[3]||(y[3]=ze("model: ",-1)),F("span",Vf,X(e.item.model),1)])):L("",!0),e.item.reasoningEffort?(v(),M("span",$f,[y[4]||(y[4]=ze("reasoning: ",-1)),F("span",Xf,X(e.item.reasoningEffort),1)])):L("",!0)])):L("",!0)]),e.item.prompt?(v(),M("div",ep,[y[5]||(y[5]=F("p",{class:"mb-2 text-xs font-medium text-highlighted"}," Prompt ",-1)),F("pre",tp,X(e.item.prompt),1)])):L("",!0),i.value.length>0?(v(),M("div",np,[y[6]||(y[6]=F("p",{class:"mb-2 text-xs font-medium text-highlighted"}," Agent states ",-1)),F("ul",rp,[(v(!0),M(Ce,null,Se(i.value,p=>(v(),M("li",{key:`${e.item.id}-${p.threadId}`,class:"space-y-1"},[F("div",ip,[F("span",sp,X(s(p.threadId)),1),Ae(C,{color:l(p.status),variant:"soft",size:"xs"},{default:J(()=>[ze(X(c(p.status)),1)]),_:2},1032,["color"])]),p.message?(v(),M("p",op,X(p.message),1)):L("",!0)]))),128))])])):L("",!0)])]),_:1},8,["text","suffix","icon","loading","streaming","open","default-open"]))}}}),lp=Object.assign(ap,{__name:"MessageItemSubagentActivity"}),cp=he({__name:"WebSearch",props:{item:{}},setup(e){const t=e,{open:n,isLoading:r,isStreaming:i}=Rn(()=>t.item.status,t.item.status==="failed");return(s,o)=>{const a=Gn;return v(),K(a,{text:"Web search",suffix:e.item.query,icon:"i-lucide-search",loading:m(r),streaming:m(i),variant:"inline",open:m(n),"default-open":e.item.status==="failed","onUpdate:open":o[0]||(o[0]=l=>n.value=l)},null,8,["suffix","loading","streaming","open","default-open"])}}}),up=Object.assign(cp,{__name:"MessageItemWebSearch"}),Ap=he({name:"MessagePartItem",props:{part:{type:Object,default:null}},setup(e){return()=>{if(!e.part||e.part.type!==Ue)return null;const t=e.part.data;switch(t.kind){case"command_execution":return Ne(hf,{item:t.item});case"file_change":return Ne(Gf,{item:t.item});case"mcp_tool_call":return Ne(Of,{item:t.item});case"dynamic_tool_call":return Ne(xf,{item:t.item});case"subagent_activity":return Ne(lp,{item:t.item});case"web_search":return Ne(up,{item:t.item});case"context_compaction":return Ne(mf);default:return null}}}});function Zo(e){const t=[];let n="",r=!1;for(let i=0;i<e.length;i++){const s=e[i],o=s==="|"&&i>0&&e[i-1]==="\\";s==="|"&&!o?(r&&n&&(t.push(n.length),n=""),r=!0):r&&(n+=s)}return r&&n&&t.push(n.length),t}function Ho(e){const t=[];let n="",r=!1;for(let i=0;i<e.length;i++){const s=e[i],o=s==="|"&&i>0&&e[i-1]==="\\";s==="|"&&!o?(r&&(t.push(n.trim()),n=""),r=!0):r&&(n+=s)}return n.trim()&&t.push(n.trim()),t}function dp(e){const t=e.split(`
|
|
7
|
-
`),n=[];let r=-1;for(let f=0;f<t.length;f++)t[f].trim().startsWith("|")?r===-1&&(r=f):r!==-1&&(n.push({start:r,end:f-1}),r=-1);if(r!==-1&&n.push({start:r,end:t.length-1}),n.length===0)return e;const{start:i,end:s}=n[n.length-1];t[i].trim().endsWith("|")||(t[i]+=" |");const a=Zo(t[i].trim()).length,l=()=>"| "+Array(a).fill("---").join(" | ")+" |",c=s-i>=1?t[i+1].trim():"",A=c.startsWith("|")&&(c.includes("-")||c.includes(":")),u=t[s].trim();if(u.startsWith("|")&&(u.includes("-")||u.includes(":"))){const h=Ho(u).map(y=>{const C=y.startsWith(":"),x=y.endsWith(":")&&y.length>1;let p=y.replace(/^:/,"").replace(/:$/,"");if(C&&x)return p.length<1&&(p="-"),":"+p+":";if(C)return p.length<1&&(p="-"),":"+p;if(x)return p.length<1&&(p="-"),p+":";for(;p.length<3;)p+="-";return p});for(;h.length<a;)h.push("---");t[s]="| "+h.join(" | ")+" |"}else if(u.startsWith("|")&&!u.endsWith("|")){let f=t[i].trim();for(let C=i+(A?2:1);C<s;C++){const x=t[C].trim();if(x.startsWith("|")&&x.endsWith("|")&&!x.includes("-")){f=x;break}}const h=Zo(f),y=Ho(u);t[s]="| "+y.map((C,x)=>{const p=h[x]||C.length+2,b=" ".repeat(Math.max(0,p-C.length-2));return C+b}).join(" | ")+" |"}return A||t.splice(i+1,0,l()),t.join(`
|
|
8
|
-
`)}function hp(e){if(!e||e==="")return e;const t=e.split(`
|
|
9
|
-
`),n=t.length;let r=!1,i=!1,s=-1;const o=[];for(let c=0;c<n;c++){const A=t[c],u=A.trim();if(c===0&&u==="---"){r=!0;continue}if(r){u==="---"&&(r=!1);continue}if(u==="$$"){i=!i;continue}if(u==="---"&&o.length>0){o[o.length-1].hasYamlProps=!o[o.length-1].hasYamlProps;continue}if(u.startsWith("|")?s=s===-1?c:s:s!==-1&&(s=-1),c===n-1&&u[0]===":"&&o.length===0){let d=0;for(;d<u.length&&u[d]===":";)d++;u.slice(d).trim()===""&&(t[c]="")}if(u[0]===":"){let d=0;for(;d<u.length&&u[d]===":";)d++;if(d>=2){let f=0;for(;f<A.length&&(A[f]===" "||A[f]===" ");)f++;const h=A.slice(0,f),y=u[d]??"";if(y>="a"&&y<="z"||y>="A"&&y<="Z"||y==="$"){let x=d;for(;x<u.length;){const p=u[x];if(!(p>="a"&&p<="z"||p>="A"&&p<="Z"||p>="0"&&p<="9"||p==="$"||p==="."||p==="-"||p==="_"))break;x++}o.push({depth:d,name:u.slice(d,x),indent:h,hasYamlProps:!1})}else d===u.length&&o.length>0&&o[o.length-1].depth===d&&o.pop()}}}const a=n-1;!r&&!i&&t[a].trim()!=="$$"&&(t[a]=fp(t[a]));let l=t.join(`
|
|
10
|
-
`);if(s!==-1&&(l=dp(l)),r){const c=t[a].trim();c==="-"||c==="--"?l+="-".repeat(3-c.length):l+=l.endsWith(`
|
|
11
|
-
`)?"---":`
|
|
12
|
-
---`}if(i&&(l+=l.endsWith(`
|
|
13
|
-
`)?"$$":`
|
|
14
|
-
$$`),e.includes("::")){const c=l.lastIndexOf(`
|
|
15
|
-
`)+1,A=l.slice(c);let u=-1;for(let d=A.length-1;d>=0&&A[d]!=="}";d--)if(A[d]==="{"){u=d;break}if(u>=0){const d=A.slice(u+1);let f=0,h=0;for(let C=0;C<d.length;C++)d[C]==='"'&&f++,d[C]==="'"&&h++;let y="";f%2===1&&(y+='"'),h%2===1&&(y+="'"),l+=y+"}"}if(o.length>0){const d=o[o.length-1],f=l.lastIndexOf(`
|
|
16
|
-
`)+1,h=l.slice(f).trim();d.hasYamlProps&&(h==="-"||h==="--")&&(l+="-".repeat(3-h.length),d.hasYamlProps=!1);const y=[];for(;o.length>0;){const C=o.pop();C.hasYamlProps&&y.push(C.indent+"---"),y.push(C.indent+":".repeat(C.depth))}l+=`
|
|
17
|
-
`+y.join(`
|
|
18
|
-
`)}}return l}function fp(e){const t=e.length;if(t===0)return e;let n=0,r=0,i=0,s=0,o=0,a=0,l=0,c=0,A=-1,u=t;for(;u>0&&(e[u-1]===" "||e[u-1]===" ");)u--;const d=u<t,f=[],h=[];for(let p=0;p<t;p++){const b=e[p];b==="*"?(n++,p+1<t&&e[p+1]==="*"&&(p>0&&e[p-1]==="*"||p+2<t&&e[p+2]==="*"||f.push(p))):b==="_"?(r++,p+1<t&&e[p+1]==="_"&&h.push(p)):b==="~"?i++:b==="`"?s++:b==="$"?p+1<t&&e[p+1]==="$"?(a++,o+=2,p++):o++:b==="["?(l++,A=p):b==="]"?(l--,A=p):b==="("?A>=0&&p>A&&c++:b===")"&&A>=0&&p>A&&c--}const y=f.length>=2;let C="",x=!1;if(n>=3&&e[0]==="*"&&e[1]==="*"&&e[2]==="*"){const p=n%6;if(p===3)e[3]!=="*"&&(u>=3&&e[u-1]==="*"&&e[u-2]==="*"&&e[u-3]==="*"&&(u===3||e[u-4]===" ")||(C="***"));else if(p>3&&p<6){const b=6-p;C="*".repeat(b)}}if(!C&&n>=2){const p=n%4;if(p===2){if(f.length>0&&!(e[0]==="*"&&e[1]==="*"&&e[2]==="*")){const I=u>=2&&e[u-1]==="*"&&e[u-2]==="*";if(!(I&&(u===2||e[u-3]===" "))){const B=Math.floor(f.length/2)*4,D=n-B;if(!(y&&D%2===0)){const R=e[u-1],Y=R>="a"&&R<="z"||R>="A"&&R<="Z"||R>="0"&&R<="9";(!y||Y)&&(C="**",d&&!I&&(x=!0))}}}}else if(p>2&&p<4){const b=4-p;C="*".repeat(b)}}if(!C&&n%2===1&&(!(e[0]==="*"&&e[1]==="*")||y)){let b=!1;for(let I=0;I<t;I++)if(e[I]==="*"){const k=I+1<t?e[I+1]:"",B=I>0?e[I-1]:"";if(k!==" "||B===" "){b=!0;break}}if(b&&(!(u>=1&&e[u-1]==="*"&&(u===1||e[u-2]===" "))||n>1)){C="*";const k=e[u-1]==="*";d&&!k&&(x=!0)}}if(!C&&r>=2){const p=r%4;if(p===2){if(h.length>0){const b=h.length>=2,I=u>=2&&e[u-1]==="_"&&e[u-2]==="_";!(I&&(u===2||e[u-3]===" "))&&!b&&(C="__",d&&!I&&(x=!0))}}else if(p>2&&p<4){const b=4-p;C="_".repeat(b)}}if(!C&&r%2===1){let p=!1;for(let b=0;b<t;b++)if(e[b]==="_"){const I=b+1<t?e[b+1]:"",k=b>0?e[b-1]:"";if(I!==" "||k===" "){p=!0;break}}if(p&&!(u>=1&&e[u-1]==="_"&&(u===1||e[u-2]===" "))){C="_";const I=e[u-1]==="_";d&&!I&&(x=!0)}}if(!C&&i>=2){const p=i%4;if(p===2)C="~~",d&&(x=!0);else if(p>2&&p<4){const b=4-p;C="~".repeat(b),d&&(x=!0)}}if(!C&&s%2===1&&(C="`"),!C&&a%2===1&&e.trim()!=="$$"&&(C="$$"),!C&&o%2===1&&(C="$"),!C&&l>0&&(C="]"),!C&&c>0&&(C=")"),x&&C){let p=t;for(;p>0&&(e[p-1]===" "||e[p-1]===" ");)p--;return e.slice(0,p)+C}return e+C}function uc(e){if(typeof e=="string"||e.length<2)return e;const[t,n,...r]=e,i=r.filter(s=>typeof s!="string"||s&&s.trim());return i.length===0?e:i.length>1||typeof i[0]=="string"||i[0][0]!=="p"?[t,n,...r.map(s=>uc(s))]:[t,n,...i[0].slice(2)]}var pp=Object.defineProperty,gp=(e,t)=>{let n={};for(var r in e)pp(n,r,{get:e[r],enumerable:!0});return n},Ji;const mp=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),yp=(Ji=String.fromCodePoint)!==null&&Ji!==void 0?Ji:(e=>{let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function Cp(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=mp.get(e))!==null&&t!==void 0?t:e}function bp(e){const t=typeof atob=="function"?atob(e):typeof Buffer.from=="function"?Buffer.from(e,"base64").toString("binary"):new Buffer(e,"base64").toString("binary"),n=t.length&-2,r=new Uint16Array(n/2);for(let i=0,s=0;i<n;i+=2){const o=t.charCodeAt(i),a=t.charCodeAt(i+1);r[s++]=o|a<<8}return r}const Ip=bp("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/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guHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var Oe;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Oe||(Oe={}));var me;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(me||(me={}));const jo=32;function ms(e){return e>=me.ZERO&&e<=me.NINE}function xp(e){return e>=me.UPPER_A&&e<=me.UPPER_F||e>=me.LOWER_A&&e<=me.LOWER_F}function wp(e){return e>=me.UPPER_A&&e<=me.UPPER_Z||e>=me.LOWER_A&&e<=me.LOWER_Z||ms(e)}function vp(e){return e===me.EQUALS||wp(e)}var De;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(De||(De={}));var Pt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Pt||(Pt={}));let kp=class{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=De.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Pt.Strict,this.runConsumed=0}startEntity(t){this.decodeMode=t,this.state=De.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case De.EntityStart:return t.charCodeAt(n)===me.NUM?(this.state=De.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=De.NamedEntity,this.stateNamedEntity(t,n));case De.NumericStart:return this.stateNumericStart(t,n);case De.NumericDecimal:return this.stateNumericDecimal(t,n);case De.NumericHex:return this.stateNumericHex(t,n);case De.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|jo)===me.LOWER_X?(this.state=De.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=De.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(ms(r)||xp(r)){const i=r<=me.NINE?r-me.ZERO:(r|jo)-me.LOWER_A+10;this.result=this.result*16+i,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(ms(r))this.result=this.result*10+(r-me.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===me.SEMI)this.consumed+=1;else if(this.decodeMode===Pt.Strict)return 0;return this.emitCodePoint(Cp(this.result),this.consumed),this.errors&&(t!==me.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Oe.VALUE_LENGTH)>>14;for(;n<t.length;){if(s===0&&(i&Oe.FLAG13)!==0){const a=(i&Oe.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const l=i&Oe.JUMP_TABLE;if(t.charCodeAt(n)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const l=this.runConsumed-1,c=r[this.treeIndex+1+(l>>1)],A=l%2===0?c&255:c>>8&255;if(t.charCodeAt(n)!==A)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),i=r[this.treeIndex],s=(i&Oe.VALUE_LENGTH)>>14}if(n>=t.length)break;const o=t.charCodeAt(n);if(o===me.SEMI&&s!==0&&(i&Oe.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=_p(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Pt.Attribute&&(s===0||vp(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Oe.VALUE_LENGTH)>>14,s!==0){if(o===me.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Pt.Strict&&(i&Oe.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Oe.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~(Oe.VALUE_LENGTH|Oe.FLAG13):i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case De.NamedEntity:return this.result!==0&&(this.decodeMode!==Pt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case De.NumericDecimal:return this.emitNumericEntity(0,2);case De.NumericHex:return this.emitNumericEntity(0,3);case De.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case De.EntityStart:return 0}}};function Bp(e){let t="";const n=new kp(e,r=>t+=yp(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(o,a),n.startEntity(s);const c=n.write(i,a+1);if(c<0){o=a+n.end();break}o=a+c,a=c===0?o+1:o}const l=t+i.slice(o);return t="",l}}function _p(e,t,n,r){const i=(t&Oe.BRANCH_LENGTH)>>7,s=t&Oe.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const c=r-s;return c<0||c>=i?-1:e[n+c]-1}const o=i+1>>1;let a=0,l=i-1;for(;a<=l;){const c=a+l>>>1,A=c>>1,d=e[n+A]>>(c&1)*8&255;if(d<r)a=c+1;else if(d>r)l=c-1;else return e[n+o+c]}return-1}const Sp=Bp(Ip);function Ac(e,t=Pt.Legacy){return Sp(e,t)}const qo={};function Ep(e){let t=qo[e];if(t)return t;t=qo[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function En(e,t){typeof t!="string"&&(t=En.defaultChars);const n=Ep(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&s+3<o){const l=parseInt(r.slice(s+4,s+6),16);if((l&192)===128){const c=a<<6&1984|l&63;c<128?i+="��":i+=String.fromCharCode(c),s+=3;continue}}if((a&240)===224&&s+6<o){const l=parseInt(r.slice(s+4,s+6),16),c=parseInt(r.slice(s+7,s+9),16);if((l&192)===128&&(c&192)===128){const A=a<<12&61440|l<<6&4032|c&63;A<2048||A>=55296&&A<=57343?i+="���":i+=String.fromCharCode(A),s+=6;continue}}if((a&248)===240&&s+9<o){const l=parseInt(r.slice(s+4,s+6),16),c=parseInt(r.slice(s+7,s+9),16),A=parseInt(r.slice(s+10,s+12),16);if((l&192)===128&&(c&192)===128&&(A&192)===128){let u=a<<18&1835008|l<<12&258048|c<<6&4032|A&63;u<65536||u>1114111?i+="����":(u-=65536,i+=String.fromCharCode(55296+(u>>10),56320+(u&1023))),s+=9;continue}}i+="�"}return i})}En.defaultChars=";/?:@&=+$,#";En.componentChars="";const zo={};function Dp(e){let t=zo[e];if(t)return t;t=zo[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Cr(e,t,n){typeof t!="string"&&(n=t,t=Cr.defaultChars),typeof n>"u"&&(n=!0);const r=Dp(t);let i="";for(let s=0,o=e.length;s<o;s++){const a=e.charCodeAt(s);if(n&&a===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3))){i+=e.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o){const l=e.charCodeAt(s+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[s])}return i}Cr.defaultChars=";/?:@&=+$,-_.!~*'()#";Cr.componentChars="-_.!~*'()";function Zs(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Hr(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Fp=/^([a-z0-9.+-]+:)/i,Np=/:[0-9]*$/,Qp=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Gp=["<",">",'"',"`"," ","\r",`
|
|
19
|
-
`," "],Rp=["{","}","|","\\","^","`"].concat(Gp),Mp=["'"].concat(Rp),Vo=["%","/","?",";","#"].concat(Mp),$o=["/","?","#"],Wp=255,Xo=/^[+a-z0-9A-Z_-]{0,63}$/,Kp=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ea={javascript:!0,"javascript:":!0},ta={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Hs(e,t){if(e&&e instanceof Hr)return e;const n=new Hr;return n.parse(e,t),n}Hr.prototype.parse=function(e,t){let n,r,i,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const c=Qp.exec(s);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let o=Fp.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(t||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&ea[o])&&(s=s.substr(2),this.slashes=!0)),!ea[o]&&(i||o&&!ta[o])){let c=-1;for(let h=0;h<$o.length;h++)r=s.indexOf($o[h]),r!==-1&&(c===-1||r<c)&&(c=r);let A,u;c===-1?u=s.lastIndexOf("@"):u=s.lastIndexOf("@",c),u!==-1&&(A=s.slice(0,u),s=s.slice(u+1),this.auth=A),c=-1;for(let h=0;h<Vo.length;h++)r=s.indexOf(Vo[h]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=s.length),s[c-1]===":"&&c--;const d=s.slice(0,c);s=s.slice(c),this.parseHost(d),this.hostname=this.hostname||"";const f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){const h=this.hostname.split(/\./);for(let y=0,C=h.length;y<C;y++){const x=h[y];if(x&&!x.match(Xo)){let p="";for(let b=0,I=x.length;b<I;b++)x.charCodeAt(b)>127?p+="x":p+=x[b];if(!p.match(Xo)){const b=h.slice(0,y),I=h.slice(y+1),k=x.match(Kp);k&&(b.push(k[1]),I.unshift(k[2])),I.length&&(s=I.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>Wp&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),ta[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Hr.prototype.parseHost=function(e){let t=Np.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Tp=Object.freeze(Object.defineProperty({__proto__:null,decode:En,encode:Cr,format:Zs,parse:Hs},Symbol.toStringTag,{value:"Module"})),dc=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hc=/[\0-\x1F\x7F-\x9F]/,Yp=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,js=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u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5E\uDD5F]/,fc=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,pc=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Lp=Object.freeze(Object.defineProperty({__proto__:null,Any:dc,Cc:hc,Cf:Yp,P:js,S:fc,Z:pc},Symbol.toStringTag,{value:"Module"}));function Pp(e){const t={};e=e||{},t.src_Any=dc.source,t.src_Cc=hc.source,t.src_Z=pc.source,t.src_P=js.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function ys(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function gi(e){return Object.prototype.toString.call(e)}function Op(e){return gi(e)==="[object String]"}function Jp(e){return gi(e)==="[object Object]"}function Up(e){return gi(e)==="[object RegExp]"}function na(e){return gi(e)==="[object Function]"}function Zp(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const gc={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Hp(e){return Object.keys(e||{}).reduce(function(t,n){return t||gc.hasOwnProperty(n)},!1)}const jp={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},qp="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",zp="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Vp(e){e.__index__=-1,e.__text_cache__=""}function $p(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function ra(){return function(e,t){t.normalize(e)}}function jr(e){const t=e.re=Pp(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(qp),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(e.__schemas__).forEach(function(a){const l=e.__schemas__[a];if(l===null)return;const c={validate:null,link:null};if(e.__compiled__[a]=c,Jp(l)){Up(l.validate)?c.validate=$p(l.validate):na(l.validate)?c.validate=l.validate:s(a,l),na(l.normalize)?c.normalize=l.normalize:l.normalize?s(a,l):c.normalize=ra();return}if(Op(l)){i.push(a);return}s(a,l)}),i.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:ra()};const o=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(Zp).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Vp(e)}function Xp(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Cs(e,t){const n=new Xp(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function et(e,t){if(!(this instanceof et))return new et(e,t);t||Hp(e)&&(t=e,e={}),this.__opts__=ys({},gc,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ys({},jp,e),this.__compiled__={},this.__tlds__=zp,this.__tlds_replaced__=!1,this.re={},jr(this)}et.prototype.add=function(t,n){return this.__schemas__[t]=n,jr(this),this};et.prototype.set=function(t){return this.__opts__=ys(this.__opts__,t),this};et.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,s,o,a,l,c,A;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(t))!==null;)if(s=this.testSchemaAt(t,n[2],l.lastIndex),s){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(A=t.indexOf("@"),A>=0&&(i=t.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};et.prototype.pretest=function(t){return this.re.pretest.test(t)};et.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};et.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Cs(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(Cs(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};et.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Cs(this,0)):null};et.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),jr(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,jr(this),this)};et.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};et.prototype.onCompile=function(){};const _n=2147483647,mt=36,qs=1,sr=26,eg=38,tg=700,mc=72,yc=128,Cc="-",ng=/^xn--/,rg=/[^\0-\x7F]/,ig=/[\x2E\u3002\uFF0E\uFF61]/g,sg={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ui=mt-qs,yt=Math.floor,Zi=String.fromCharCode;function Lt(e){throw new RangeError(sg[e])}function og(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function bc(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(ig,".");const i=e.split("."),s=og(i,t).join(".");return r+s}function Ic(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((i&1023)<<10)+(s&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}const ag=e=>String.fromCodePoint(...e),lg=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:mt},ia=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},xc=function(e,t,n){let r=0;for(e=n?yt(e/tg):e>>1,e+=yt(e/t);e>Ui*sr>>1;r+=mt)e=yt(e/Ui);return yt(r+(Ui+1)*e/(e+eg))},wc=function(e){const t=[],n=e.length;let r=0,i=yc,s=mc,o=e.lastIndexOf(Cc);o<0&&(o=0);for(let a=0;a<o;++a)e.charCodeAt(a)>=128&&Lt("not-basic"),t.push(e.charCodeAt(a));for(let a=o>0?o+1:0;a<n;){const l=r;for(let A=1,u=mt;;u+=mt){a>=n&&Lt("invalid-input");const d=lg(e.charCodeAt(a++));d>=mt&&Lt("invalid-input"),d>yt((_n-r)/A)&&Lt("overflow"),r+=d*A;const f=u<=s?qs:u>=s+sr?sr:u-s;if(d<f)break;const h=mt-f;A>yt(_n/h)&&Lt("overflow"),A*=h}const c=t.length+1;s=xc(r-l,c,l==0),yt(r/c)>_n-i&&Lt("overflow"),i+=yt(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},vc=function(e){const t=[];e=Ic(e);const n=e.length;let r=yc,i=0,s=mc;for(const l of e)l<128&&t.push(Zi(l));const o=t.length;let a=o;for(o&&t.push(Cc);a<n;){let l=_n;for(const A of e)A>=r&&A<l&&(l=A);const c=a+1;l-r>yt((_n-i)/c)&&Lt("overflow"),i+=(l-r)*c,r=l;for(const A of e)if(A<r&&++i>_n&&Lt("overflow"),A===r){let u=i;for(let d=mt;;d+=mt){const f=d<=s?qs:d>=s+sr?sr:d-s;if(u<f)break;const h=u-f,y=mt-f;t.push(Zi(ia(f+h%y,0))),u=yt(h/y)}t.push(Zi(ia(u,0))),s=xc(i,c,a===o),i=0,++a}++i,++r}return t.join("")},cg=function(e){return bc(e,function(t){return ng.test(t)?wc(t.slice(4).toLowerCase()):t})},ug=function(e){return bc(e,function(t){return rg.test(t)?"xn--"+vc(t):t})},kc={version:"2.3.1",ucs2:{decode:Ic,encode:ag},decode:wc,encode:vc,toASCII:ug,toUnicode:cg};var Ag=gp({arrayReplaceAt:()=>pg,assign:()=>zs,escapeHtml:()=>Rt,escapeRE:()=>kg,fromCodePoint:()=>qr,has:()=>fg,isMdAsciiPunct:()=>lr,isPromiseLike:()=>cr,isPunctChar:()=>ar,isSpace:()=>pe,isString:()=>dg,isValidEntityCode:()=>Vs,isWhiteSpace:()=>or,lib:()=>Bg,normalizeReference:()=>mi,unescapeAll:()=>Dn,unescapeMd:()=>Cg});function dg(e){return typeof e=="string"}const hg=Object.prototype.hasOwnProperty;function fg(e,t){return hg.call(e,t)}function zs(e,...t){for(const n of t)if(n){if(typeof n!="object")throw new TypeError("source must be object");Object.assign(e,n)}return e}function pg(e,t,n){return e.slice(0,t).concat(n,e.slice(t+1))}function Vs(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function qr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Bc=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,gg=new RegExp(`${Bc.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),mg=/^#(x[a-f0-9]{1,8}|\d{1,8})$/i;function yg(e,t){if(t.charCodeAt(0)===35&&mg.test(t)){const r=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Vs(r)?qr(r):e}const n=Ac(e);return n!==e?n:e}function Cg(e){return e.includes("\\")?e.replace(Bc,"$1"):e}function Dn(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(gg,(t,n,r)=>n||yg(t,r))}const bg=/[&<>"]/,Ig=/[&<>"]/g,xg={"&":"&","<":"<",">":">",'"':"""};function wg(e){return xg[e]}function Rt(e){return bg.test(e)?e.replace(Ig,wg):e}const vg=/[.?*+^$[\]\\(){}|-]/g;function kg(e){return e.replace(vg,"\\$&")}function pe(e){switch(e){case 9:case 32:return!0}return!1}function or(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ar(e){return js.test(e)||fc.test(e)}function lr(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function mi(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function cr(e){return typeof e?.then=="function"}const Bg={mdurl:Tp,ucmicro:Lp};var Sn=class{type;tag;attrs=null;map=null;nesting;level=0;children=null;content="";markup="";info="";meta=null;block=!1;hidden=!1;constructor(t,n,r){this.type=t,this.tag=n,this.nesting=r}attrIndex(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===t)return r;return-1}attrPush(t){this.attrs?this.attrs.push(t):this.attrs=[t]}attrSet(t,n){const r=this.attrIndex(t),i=[t,n];r<0?this.attrPush(i):this.attrs[r]=i}attrGet(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r}attrJoin(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=`${this.attrs[r][1]} ${n}`}},_g=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;Token=Sn;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;const i=this.src,s=i.length;for(let o=0;o<s;){const a=i.indexOf(`
|
|
20
|
-
`,o),l=a===-1?s:a;let c=0,A=0,u=o;for(;u<l;){const d=i.charCodeAt(u);if(pe(d)){c++,A+=d===9?4-A%4:1,u++;continue}break}this.bMarks.push(o),this.eMarks.push(l),this.tShift.push(c),this.sCount.push(A),this.bsCount.push(0),o=l+1}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const r=new Sn(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n&&pe(t.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;)if(!pe(n.charCodeAt(--e)))return e+1;return e}skipChars(e,t){const n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";const i=new Array(t-e),s=this.src;for(let o=0,a=e;a<t;a++,o++){let l=0;const c=this.bMarks[a];let A=c,u;for(a+1<t||r?u=this.eMarks[a]+1:u=this.eMarks[a];A<u&&l<n;){const d=s.charCodeAt(A);if(pe(d))d===9?l+=4-(l+this.bsCount[a])%4:l++;else if(A-c<this.tShift[a])l++;else break;A++}l>n?i[o]=" ".repeat(l-n)+this.src.slice(A,u):i[o]=this.src.slice(A,u)}return i.join("")}},Sg=class{src;env;tokens=[];inlineMode=!1;md;constructor(e,t,n){this.src=e,this.env=n,this.md=t}Token=Sn},Eg=class{src;env;md;tokens;tokens_meta;pos=0;posMax;level=0;pending="";pendingLevel=0;cache={};delimiters=[];_prev_delimiters=[];backticks={};backticksScanned=!1;linkLevel=0;constructor(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=new Array(r.length),this.posMax=this.src.length}pushPending(){const e=new Sn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const r=new Sn(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()??[]),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){const n=this.src,r=this.posMax,i=n.charCodeAt(e),s=e>0?n.charCodeAt(e-1):32;let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;const a=o-e,l=o<r?n.charCodeAt(o):32,c=lr(s)||ar(String.fromCharCode(s)),A=lr(l)||ar(String.fromCharCode(l)),u=or(s),d=or(l),f=!d&&(!A||u||c),h=!u&&(!c||d||A);return{can_open:f&&(t||!h||c),can_close:h&&(t||!f||A),length:a}}Token=Sn},zr=class{__rules__=[];__cache__=null;__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set([""]);for(const t of this.__rules__)if(t.enabled)for(const n of t.alt)e.add(n);this.__cache__={};for(const t of e){const n=[];for(const r of this.__rules__)r.enabled&&(t&&!r.alt.includes(t)||n.push(r.fn));this.__cache__[t]=n}}at(e,t,n={}){const r=this.__find__(e),i=n||{};if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null}before(e,t,n,r){const i=this.__find__(e),s=r||{};if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null}after(e,t,n,r){const i=this.__find__(e),s=r||{};if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null}push(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}enable(e,t){Array.isArray(e)||(e=[e]);const n=[];for(const r of e){const i=this.__find__(r);if(i<0){if(t)continue;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[i].enabled=!0,n.push(r)}return this.__cache__=null,n}enableOnly(e,t){Array.isArray(e)||(e=[e]);for(const n of this.__rules__)n.enabled=!1;this.enable(e,t)}disable(e,t){Array.isArray(e)||(e=[e]);const n=[];for(const r of e){const i=this.__find__(r);if(i<0){if(t)continue;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[i].enabled=!1,n.push(r)}return this.__cache__=null,n}getRules(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]}};function Dg(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],c=[],A=[],u=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let f=!1,h;for(h=t;h<n;h++){const b=e.sCount[h]<e.blkIndent;if(i=e.bMarks[h]+e.tShift[h],s=e.eMarks[h],i>=s)break;if(e.src.charCodeAt(i++)===62&&!b){let k=e.sCount[h]+1,B,D;e.src.charCodeAt(i)===32?(i++,k++,D=!1,B=!0):e.src.charCodeAt(i)===9?(B=!0,(e.bsCount[h]+k)%4===3?(i++,k++,D=!1):D=!0):B=!1;let Q=k;for(a.push(e.bMarks[h]),e.bMarks[h]=i;i<s;){const R=e.src.charCodeAt(i);if(pe(R))R===9?Q+=4-(Q+e.bsCount[h]+(D?1:0))%4:Q++;else break;i++}f=i>=s,l.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(B?1:0),c.push(e.sCount[h]),e.sCount[h]=Q-k,A.push(e.tShift[h]),e.tShift[h]=i-e.bMarks[h];continue}if(f)break;let I=!1;for(let k=0,B=u.length;k<B;k++)if(u[k](e,h,n,!0)){I=!0;break}if(I){e.lineMax=h,e.blkIndent!==0&&(a.push(e.bMarks[h]),l.push(e.bsCount[h]),A.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}a.push(e.bMarks[h]),l.push(e.bsCount[h]),A.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]=-1}const y=e.blkIndent;e.blkIndent=0;const C=e.push("blockquote_open","blockquote",1);C.markup=">";const x=[t,0];C.map=x,e.md.block.tokenize(e,t,h);const p=e.push("blockquote_close","blockquote",-1);p.markup=">",e.lineMax=o,e.parentType=d,x[1]=e.line;for(let b=0;b<A.length;b++)e.bMarks[b+t]=a[b],e.tShift[b+t]=A[b],e.sCount[b+t]=c[b],e.bsCount[b+t]=l[b];return e.blkIndent=y,!0}function Fg(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,i,4+e.blkIndent,!1)}
|
|
21
|
-
`,s.map=[t,e.line],!0}function Ng(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>s)return!1;const o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let a=i;i=e.skipChars(i,o);let l=i-a;if(l<3)return!1;const c=e.src.slice(a,i),A=e.src.slice(i,s);if(o===96&&A.includes(String.fromCharCode(o)))return!1;if(r)return!0;let u=t,d=!1;for(;u++,!(u>=n||(i=a=e.bMarks[u]+e.tShift[u],s=e.eMarks[u],i<s&&e.sCount[u]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[u]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-a<l)&&(i=e.skipSpaces(i),!(i<s)))){d=!0;break}l=e.sCount[t],e.line=u+(d?1:0);const f=e.push("fence","code",0);return f.info=A,f.content=e.getLines(t+1,u,l,!0),f.markup=c,f.map=[t,e.line],!0}function Qg(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=s)return!1;let a=1;for(o=e.src.charCodeAt(++i);o===35&&i<s&&a<=6;)a++,o=e.src.charCodeAt(++i);if(a>6||i<s&&!pe(o))return!1;if(r)return!0;s=e.skipSpacesBack(s,i);const l=e.skipCharsBack(s,35,i);l>i&&pe(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;const c=e.push("heading_open",`h${String(a)}`,1);c.markup="########".slice(0,a),c.map=[t,e.line];const A=e.push("inline","",0);A.content=e.src.slice(i,s).trim(),A.map=[t,e.line],A.children=[];const u=e.push("heading_close",`h${String(a)}`,-1);return u.markup="########".slice(0,a),!0}function Gg(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;s<i;){const c=e.src.charCodeAt(s++);if(c!==o&&!pe(c))return!1;c===o&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=String.fromCharCode(o).repeat(a),!0}var Rg=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];const _c=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Sc="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Mg=new RegExp(`^(?:${_c}|${Sc}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Wg=new RegExp(`^(?:${_c}|${Sc})`),un=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${Rg.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Wg.source}\\s*$`),/^$/,!1]];function Kg(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,s),a=0;for(;a<un.length&&!un[a][0].test(o);a++);if(a===un.length)return!1;if(r)return un[a][2];let l=t+1;if(!un[a][1].test(o)){for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(i=e.bMarks[l]+e.tShift[l],s=e.eMarks[l],o=e.src.slice(i,s),un[a][1].test(o)){o.length!==0&&l++;break}}e.line=l;const c=e.push("html_block","",0);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0}function Tg(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let s=0,o,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let f=e.bMarks[a]+e.tShift[a];const h=e.eMarks[a];if(f<h&&(o=e.src.charCodeAt(f),(o===45||o===61)&&(f=e.skipChars(f,o),f=e.skipSpaces(f),f>=h))){s=o===61?1:2;break}}if(e.sCount[a]<0)continue;let d=!1;for(let f=0,h=r.length;f<h;f++)if(r[f](e,a,n,!0)){d=!0;break}if(d)break}if(!s||o===void 0)return!1;const l=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a+1;const c=e.push("heading_open",`h${String(s)}`,1);c.markup=String.fromCharCode(o),c.map=[t,e.line];const A=e.push("inline","",0);A.content=l,A.map=[t,e.line-1],A.children=[];const u=e.push("heading_close",`h${String(s)}`,-1);return u.markup=String.fromCharCode(o),e.parentType=i,!0}function sa(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!pe(e.src.charCodeAt(r))?-1:r}function oa(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let s=e.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=e.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=e.src.charCodeAt(i),!pe(s))?-1:i}function Yg(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Lg(e,t,n,r){let i,s,o,a,l=t,c=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let A=!1;r&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(A=!0);let u,d,f=oa(e,l);if(f>=0){if(u=!0,o=e.bMarks[l]+e.tShift[l],d=Number(e.src.slice(o,f-1)),A&&d!==1)return!1}else if(f=sa(e,l),f>=0)u=!1;else return!1;if(A&&e.skipSpaces(f)>=e.eMarks[l])return!1;if(r)return!0;const h=e.src.charCodeAt(f-1),y=e.tokens.length;u?(a=e.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d.toString()]])):a=e.push("bullet_list_open","ul",1);const C=[l,0];a.map=C,a.markup=String.fromCharCode(h);let x=!1;const p=e.md.block.ruler.getRules("list"),b=e.parentType;for(e.parentType="list";l<n;){s=f,i=e.eMarks[l];const I=e.sCount[l]+f-(e.bMarks[l]+e.tShift[l]);let k=I;for(;s<i;){const ee=e.src.charCodeAt(s);if(ee===9)k+=4-(k+e.bsCount[l])%4;else if(ee===32)k++;else break;s++}const B=s;let D;B>=i?D=1:D=k-I,D>4&&(D=1);const Q=I+D;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(h);const R=[l,0];a.map=R,u&&(a.info=e.src.slice(o,f-1));const Y=e.tight,U=e.tShift[l],V=e.sCount[l],ge=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=Q,e.tight=!0,e.tShift[l]=B-e.bMarks[l],e.sCount[l]=k,B>=i&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(c=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ge,e.tShift[l]=U,e.sCount[l]=V,e.tight=Y,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(h),l=e.line,R[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let q=!1;for(let ee=0,se=p.length;ee<se;ee++)if(p[ee](e,l,n,!0)){q=!0;break}if(q)break;if(u){if(f=oa(e,l),f<0)break;o=e.bMarks[l]+e.tShift[l]}else if(f=sa(e,l),f<0)break;if(h!==e.src.charCodeAt(f-1))break}return u?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(h),C[1]=l,e.line=l,e.parentType=b,c&&Yg(e,y),!0}function Pg(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let c=!1;for(let A=0,u=r.length;A<u;A++)if(r[A](e,s,n,!0)){c=!0;break}if(c)break}const o=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const l=e.push("inline","",0);return l.content=o,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}function Og(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function a(b){const I=e.lineMax;if(b>=I||e.isEmpty(b))return null;let k=!1;if(e.sCount[b]-e.blkIndent>3&&(k=!0),e.sCount[b]<0&&(k=!0),!k){const Q=e.md.block.ruler.getRules("reference"),R=e.parentType;e.parentType="reference";let Y=!1;for(let U=0,V=Q.length;U<V;U++)if(Q[U](e,b,I,!0)){Y=!0;break}if(e.parentType=R,Y)return null}const B=e.bMarks[b]+e.tShift[b],D=e.eMarks[b];return e.src.slice(B,D+1)}let l=e.src.slice(i,s+1);s=l.length;let c=-1;for(i=1;i<s;i++){const b=l.charCodeAt(i);if(b===91)return!1;if(b===93){c=i;break}else if(b===10){const I=a(o);I!==null&&(l+=I,s=l.length,o++)}else if(b===92&&(i++,i<s&&l.charCodeAt(i)===10)){const I=a(o);I!==null&&(l+=I,s=l.length,o++)}}if(c<0||l.charCodeAt(c+1)!==58)return!1;for(i=c+2;i<s;i++){const b=l.charCodeAt(i);if(b===10){const I=a(o);I!==null&&(l+=I,s=l.length,o++)}else if(!pe(b))break}const A=e.md.helpers.parseLinkDestination(l,i,s);if(!A.ok)return!1;const u=e.md.normalizeLink(A.str);if(!e.md.validateLink(u))return!1;i=A.pos;const d=i,f=o,h=i;for(;i<s;i++){const b=l.charCodeAt(i);if(b===10){const I=a(o);I!==null&&(l+=I,s=l.length,o++)}else if(!pe(b))break}let y=e.md.helpers.parseLinkTitle(l,i,s);for(;y.can_continue;){const b=a(o);if(b===null)break;l+=b,i=s,s=l.length,o++,y=e.md.helpers.parseLinkTitle(l,i,s,y)}let C;for(i<s&&h!==i&&y.ok?(C=y.str,i=y.pos):(C="",i=d,o=f);i<s&&pe(l.charCodeAt(i));)i++;if(i<s&&l.charCodeAt(i)!==10&&C)for(C="",i=d,o=f;i<s&&pe(l.charCodeAt(i));)i++;if(i<s&&l.charCodeAt(i)!==10)return!1;const x=mi(l.slice(1,c));if(!x)return!1;if(r)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[x]>"u"&&(e.env.references[x]={title:C,href:u}),e.line=o;const p=e.push("reference","",0);return p.map=[t,e.line],p.info=x,p.meta={title:C,href:u},!0}const Jg=65536;function Hi(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function aa(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),s=!1,o=0,a="";for(;r<n;)i===124&&(s?(a+=e.substring(o,r-1),o=r):(t.push(a+e.substring(o,r)),a="",o=r+1)),s=i===92,r++,i=e.charCodeAt(r);return t.push(a+e.substring(o)),t}function Ug(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let s=e.bMarks[i]+e.tShift[i];if(s>=e.eMarks[i])return!1;const o=e.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=e.eMarks[i])return!1;const a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!pe(a)||o===45&&pe(a))return!1;for(;s<e.eMarks[i];){const I=e.src.charCodeAt(s);if(I!==124&&I!==45&&I!==58&&!pe(I))return!1;s++}let l=Hi(e,t+1),c=l.split("|");const A=[];for(let I=0;I<c.length;I++){const k=c[I].trim();if(!k){if(I===0||I===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?A.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?A.push("left"):A.push("")}if(l=Hi(e,t).trim(),!l.includes("|")||e.sCount[t]-e.blkIndent>=4)return!1;c=aa(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const u=c.length;if(u===0||u!==A.length)return!1;if(r)return!0;const d=e.parentType;e.parentType="table";const f=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),y=[t,0];h.map=y;const C=e.push("thead_open","thead",1);C.map=[t,t+1];const x=e.push("tr_open","tr",1);x.map=[t,t+1];for(let I=0;I<c.length;I++){const k=e.push("th_open","th",1);A[I]&&(k.attrs=[["style",`text-align:${A[I]}`]]);const B=e.push("inline","",0);B.content=c[I].trim(),B.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let p,b=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let I=!1;for(let B=0,D=f.length;B<D;B++)if(f[B](e,i,n,!0)){I=!0;break}if(I||(l=Hi(e,i).trim(),!l)||e.sCount[i]-e.blkIndent>=4||(c=aa(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=u-c.length,b>Jg))break;if(i===t+2){const B=e.push("tbody_open","tbody",1);B.map=p=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[i,i+1];for(let B=0;B<u;B++){const D=e.push("td_open","td",1);A[B]&&(D.attrs=[["style",`text-align:${A[B]}`]]);const Q=e.push("inline","",0);Q.content=c[B]?c[B].trim():"",Q.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return p&&(e.push("tbody_close","tbody",-1),p[1]=i),e.push("table_close","table",-1),y[1]=i,e.parentType=d,e.line=i,!0}const Fr=[["table",Ug,["paragraph","reference"]],["code",Fg],["fence",Ng,["paragraph","reference","blockquote","list"]],["blockquote",Dg,["paragraph","reference","blockquote","list"]],["hr",Gg,["paragraph","reference","blockquote","list"]],["list",Lg,["paragraph","reference","blockquote"]],["reference",Og],["html_block",Kg,["paragraph","reference","blockquote"]],["heading",Qg,["paragraph","reference","blockquote"]],["lheading",Tg],["paragraph",Pg]];var Zg=class{ruler;constructor(){this.ruler=new zr;for(let e=0;e<Fr.length;e++)this.ruler.push(Fr[e][0],Fr[e][1],{alt:(Fr[e][2]||[]).slice()})}tokenize(e,t,n,r){const i=this.ruler.getRules(""),s=i.length,o=e.md.options.maxNesting;let a=t,l=!1;for(;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n||e.sCount[a]<e.blkIndent));){if(e.level>=o){e.line=n;break}const c=e.line;let A=!1;for(let u=0;u<s;u++)if(A=i[u](e,a,n,!1),A){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!A)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),a=e.line,a<n&&e.isEmpty(a)&&(l=!0,a++,e.line=a)}}parse(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}State=_g};function Hg(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function jg(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const i=t[n];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function qg(e){return/^<a[>\s]/i.test(e)}function zg(e){return/^<\/a\s*>/i.test(e)}function Vg(e){if(!e.md.options.linkify)return;const t=e.tokens,n=e.md.linkify;for(let r=0,i=t.length;r<i;r++){if(t[r].type!=="inline"||!n.pretest(t[r].content))continue;const s=t[r].children;let o=0;for(let a=s.length-1;a>=0;a--){const l=s[a];if(l.type==="link_close"){for(a--;s[a].level!==l.level&&s[a].type!=="link_open";)a--;continue}if(l.type==="html_inline"&&(qg(l.content)&&o>0&&o--,zg(l.content)&&o++),!(o>0)&&l.type==="text"){const c=l.content;if(!n.pretest(c))continue;const A=n.match(c);if(!A?.length)continue;const u=[];let d=l.level,f=0;const h=A[0].index===0&&a>0&&s[a-1].type==="text_special"?1:0;for(let y=h;y<A.length;y++){const C=A[y],x=e.md.normalizeLink(C.url);if(!e.md.validateLink(x))continue;let p=C.text;C.schema?C.schema==="mailto:"&&!/^mailto:/i.test(p)?p=e.md.normalizeLinkText(`mailto:${p}`).replace(/^mailto:/,""):p=e.md.normalizeLinkText(p):p=e.md.normalizeLinkText(`http://${p}`).replace(/^http:\/\//,"");const b=C.index;if(b>f){const D=new e.Token("text","",0);D.content=c.slice(f,b),D.level=d,u.push(D)}const I=new e.Token("link_open","a",1);I.attrs=[["href",x]],I.level=d++,I.markup="linkify",I.info="auto",u.push(I);const k=new e.Token("text","",0);k.content=p,k.level=d,u.push(k);const B=new e.Token("link_close","a",-1);B.level=--d,B.markup="linkify",B.info="auto",u.push(B),f=C.lastIndex}if(f<c.length){const y=new e.Token("text","",0);y.content=c.slice(f),y.level=d,u.push(y)}s.splice(a,1,...u)}}}}const $g=/\r\n?|\n/g,Xg=/\0/g;function em(e){let t=e.src;const n=t.includes("\r"),r=t.includes("\0");!n&&!r||(n&&(t=t.replace($g,`
|
|
22
|
-
`)),r&&(t=t.replace(Xg,"�")),e.src=t)}const Ec=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,tm=/\((?:c|tm|r)\)/i,nm=/\((c|tm|r)\)/gi,rm={c:"©",r:"®",tm:"™"};function im(e,t){return rm[t.toLowerCase()]}function sm(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(nm,im)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function om(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Ec.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function am(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(tm.test(e.tokens[t].content)&&sm(e.tokens[t].children),Ec.test(e.tokens[t].content)&&om(e.tokens[t].children))}const lm=/['"]/,la=/['"]/g,ca="’";function Nr(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function cm(e,t){let n;const r=[];for(let i=0;i<e.length;i++){const s=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,s.type!=="text")continue;let a=s.content,l=0,c=a.length;e:for(;l<c;){la.lastIndex=l;const A=la.exec(a);if(!A)break;let u=!0,d=!0;l=A.index+1;const f=A[0]==="'";let h=32;if(A.index-1>=0)h=a.charCodeAt(A.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){h=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(l<c)y=a.charCodeAt(l);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const C=lr(h)||ar(String.fromCharCode(h)),x=lr(y)||ar(String.fromCharCode(y)),p=or(h),b=or(y);if(b?u=!1:x&&(p||C||(u=!1)),p?d=!1:C&&(b||x||(d=!1)),y===34&&A[0]==='"'&&h>=48&&h<=57&&(d=u=!1),u&&d&&(u=C,d=x),!u&&!d){f&&(s.content=Nr(s.content,A.index,ca));continue}if(d)for(n=r.length-1;n>=0;n--){let I=r[n];if(r[n].level<o)break;if(I.single===f&&r[n].level===o){I=r[n];let k,B;f?(k=t.md.options.quotes[2],B=t.md.options.quotes[3]):(k=t.md.options.quotes[0],B=t.md.options.quotes[1]),s.content=Nr(s.content,A.index,B),e[I.token].content=Nr(e[I.token].content,I.pos,k),l+=B.length-1,I.token===i&&(l+=k.length-1),a=s.content,c=a.length,r.length=n;continue e}}u?r.push({token:i,pos:A.index,single:f,level:o}):d&&f&&(s.content=Nr(s.content,A.index,ca))}}}function um(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!lm.test(e.tokens[t].content)||cm(e.tokens[t].children,e)}function Am(e){let t,n;const r=e.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const o=r[s].children,a=o.length;for(t=0;t<a;t++)o[t].type==="text_special"&&(o[t].type="text");for(t=n=0;t<a;t++)o[t].type==="text"&&t+1<a&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}const ji=[["normalize",em],["block",Hg],["inline",jg],["linkify",Vg],["replacements",am],["smartquotes",um],["text_join",Am]];var dm=class{ruler;constructor(){this.ruler=new zr;for(let e=0;e<ji.length;e++)this.ruler.push(ji[e][0],ji[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}State=Sg};function hm(e,t,n){let r,i=t;const s={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Dn(e.slice(t+1,i)),s.ok=!0,s;if(r===92&&i+1<n){i+=2;continue}i++}return s}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0||(s.str=Dn(e.slice(t,i)),s.pos=i,s.ok=!0),s}function fm(e,t,n=!1){let r,i=!1,s,o;const a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),s===91){if(o===e.pos-1)r++;else if(n)return e.pos=l,-1}}let c=-1;return i&&(c=e.pos),e.pos=l,c}function pm(e,t,n,r){let i,s=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let a=e.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;t++,s++,a===40&&(a=41),o.marker=a}for(;s<n;){if(i=e.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=Dn(e.slice(t,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<n&&s++,s++}return o.can_continue=!0,o.str+=Dn(e.slice(t,s)),o}const gm={parseLinkDestination:hm,parseLinkLabel:fm,parseLinkTitle:pm},mm=/^([\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*)$/i,ym=/^([a-z][a-z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/i;function Cm(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const o=e.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const s=e.src.slice(r+1,n);if(ym.test(s)){const o=e.md.normalizeLink(s);if(!e.md.validateLink(o))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=s.length+2,!0}if(mm.test(s)){const o=e.md.normalizeLink(`mailto:${s}`);if(!e.md.validateLink(o))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=s.length+2,!0}return!1}function bm(e,t){let n=e.pos;const r=e.src;if(r.charCodeAt(n)!==96)return!1;const i=n;n++;const s=e.posMax;for(;n<s&&r.charCodeAt(n)===96;)n++;const o=r.slice(i,n),a=o.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=o),e.pos+=a,!0;let l=n,c;for(;c=r.indexOf("`",l),c!==-1;){for(l=c+1;l<s&&r.charCodeAt(l)===96;)l++;const A=l-c;if(A===a){if(!t){const u=e.push("code_inline","code",0);u.markup=o,u.content=r.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[A]=c}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=a,!0}function ua(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const s=[];for(let o=0;o<n;o++){const a=e[o];if(s.push(0),(e[r].marker!==a.marker||i!==a.token-1)&&(r=o),i=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[a.marker][(a.open?3:0)+a.length%3];let c=r-s[r]-1,A=c;for(;c>l;c-=s[c]+1){const u=e[c];if(u.marker===a.marker&&u.open&&u.end<0){let d=!1;if((u.close||a.open)&&(u.length+a.length)%3===0&&(u.length%3!==0||a.length%3!==0)&&(d=!0),!d){const f=c>0&&!e[c-1].open?s[c-1]+1:0;s[o]=o-c+f,s[c]=f,a.open=!1,u.end=o,u.close=!1,A=-1,i=-2;break}}}A!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=A)}}function Im(e){const t=e.tokens_meta,n=e.tokens_meta.length;ua(e.delimiters);for(let r=0;r<n;r++){const i=t[r]?.delimiters;i&&ua(i)}}function xm(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const i=e.scanDelims(e.pos,r===42);for(let s=0;s<i.length;s++){const o=e.push("text","",0);o.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Aa(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=t[i.end],o=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),l=e.tokens[i.token];l.type=o?"strong_open":"em_open",l.tag=o?"strong":"em",l.nesting=1,l.markup=o?a+a:a,l.content="";const c=e.tokens[s.token];c.type=o?"strong_close":"em_close",c.tag=o?"strong":"em",c.nesting=-1,c.markup=o?a+a:a,c.content="",o&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function wm(e){const t=e.tokens_meta,n=e.tokens_meta.length;Aa(e,e.delimiters);for(let r=0;r<n;r++){const i=t[r]?.delimiters;i&&Aa(e,i)}}var Dc={tokenize:xm,postProcess:wm};const vm=/^&#(x[a-f0-9]{1,6}|\d{1,7});/i,km=/^&([a-z][a-z0-9]{1,31});/i;function Bm(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const i=e.src.slice(n).match(vm);if(i){if(!t){const s=i[1][0].toLowerCase()==="x"?Number.parseInt(i[1].slice(1),16):Number.parseInt(i[1],10),o=e.push("text_special","",0);o.content=Vs(s)?qr(s):qr(65533),o.markup=i[0],o.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(n).match(km);if(i){const s=Ac(i[0]);if(s!==i[0]){if(!t){const o=e.push("text_special","",0);o.content=s,o.markup=i[0],o.info="entity"}return e.pos+=i[0].length,!0}}}return!1}const $s=[];for(let e=0;e<256;e++)$s.push(0);for(const e of"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split(""))$s[e.charCodeAt(0)]=1;function _m(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),!!pe(i));)n++;return e.pos=n,!0}let s=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=e.src[n+1],n++)}const o=`\\${s}`;if(!t){const a=e.push("text_special","",0);i<256&&$s[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"}return e.pos=n+1,!0}function Sm(e){let t,n,r=0;const i=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type==="text"&&t+1<s&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}function Em(e){return/^<a[>\s]/i.test(e)}function Dm(e){return/^<\/a\s*>/i.test(e)}function Fm(e){const t=e|32;return t>=97&&t<=122}function Nm(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Fm(i))return!1;const s=e.src.slice(r).match(Mg);if(!s)return!1;if(!t){const o=e.push("html_inline","",0);o.content=s[0],Em(o.content)&&e.linkLevel++,Dm(o.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}function Qm(e,t){let n,r,i,s,o,a,l,c,A="";const u=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const f=e.pos+2,h=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(h<0)return!1;if(s=h+1,s<d&&e.src.charCodeAt(s)===40){for(s++;s<d&&(n=e.src.charCodeAt(s),!(!pe(n)&&n!==10));s++);if(s>=d)return!1;for(c=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(A=e.md.normalizeLink(a.str),e.md.validateLink(A)?s=a.pos:A=""),c=s;s<d&&(n=e.src.charCodeAt(s),!(!pe(n)&&n!==10));s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<d&&c!==s&&a.ok)for(l=a.str,s=a.pos;s<d&&(n=e.src.charCodeAt(s),!(!pe(n)&&n!==10));s++);else l="";if(s>=d||e.src.charCodeAt(s)!==41)return e.pos=u,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s<d&&e.src.charCodeAt(s)===91?(c=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?i=e.src.slice(c,s++):s=h+1):s=h+1,i||(i=e.src.slice(f,h)),o=e.env.references[mi(i)],!o)return e.pos=u,!1;A=o.href,l=o.title}if(!t){r=e.src.slice(f,h);const y=[];e.md.inline.parse(r,e.md,e.env,y);const C=e.push("image","img",0),x=[["src",A],["alt",""]];C.attrs=x,C.children=y,C.content=r,l&&x.push(["title",l])}return e.pos=s,e.posMax=d,!0}function Gm(e,t){let n,r,i,s,o="",a="",l=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const A=e.pos,u=e.posMax,d=e.pos+1,f=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(f<0)return!1;let h=f+1;if(h<u&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<u&&(n=e.src.charCodeAt(h),!(!pe(n)&&n!==10));h++);if(h>=u)return!1;if(l=h,i=e.md.helpers.parseLinkDestination(e.src,h,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?h=i.pos:o="",l=h;h<u&&(n=e.src.charCodeAt(h),!(!pe(n)&&n!==10));h++);if(i=e.md.helpers.parseLinkTitle(e.src,h,e.posMax),h<u&&l!==h&&i.ok)for(a=i.str,h=i.pos;h<u&&(n=e.src.charCodeAt(h),!(!pe(n)&&n!==10));h++);}(h>=u||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<u&&e.src.charCodeAt(h)===91?(l=h+1,h=e.md.helpers.parseLinkLabel(e,h),h>=0?r=e.src.slice(l,h++):h=f+1):h=f+1,r||(r=e.src.slice(d,f)),s=e.env.references[mi(r)],!s)return e.pos=A,!1;o=s.href,a=s.title}if(!t){e.pos=d,e.posMax=f;const y=e.push("link_open","a",1),C=[["href",o]];y.attrs=C,a&&C.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=u,!0}const Rm=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Mm(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(Rm);if(!i)return!1;const s=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-s.length));if(!o)return!1;let a=o.url;if(a.length<=s.length)return!1;let l=a.length;for(;l>0&&a.charCodeAt(l-1)===42;)l--;l!==a.length&&(a=a.slice(0,l));const c=e.md.normalizeLink(a);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const A=e.push("link_open","a",1);A.attrs=[["href",c]],A.markup="linkify",A.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(a);const d=e.push("link_close","a",-1);d.markup="linkify",d.info="auto"}return e.pos+=a.length-s.length,!0}function Wm(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&pe(e.src.charCodeAt(n));)n++;return e.pos=n,!0}function Km(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);let s=i.length;const o=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=o,s--);for(let l=0;l<s;l+=2)a=e.push("text","",0),a.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function da(e,t){let n;const r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(o.marker!==126||o.end===-1)continue;const a=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let o=s+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,s!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[s],e.tokens[s]=n)}}function Tm(e){const t=e.tokens_meta,n=e.tokens_meta.length;da(e,e.delimiters);for(let r=0;r<n;r++){const i=t[r]?.delimiters;i&&da(e,i)}}var Fc={tokenize:Km,postProcess:Tm};function Ym(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Lm(e,t){let n=e.pos;const r=e.src;for(;n<e.posMax&&!Ym(r.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=r.slice(e.pos,n)),e.pos=n,!0)}const qi=[["text",Lm],["linkify",Mm],["newline",Wm],["escape",_m],["backticks",bm],["strikethrough",Fc.tokenize],["emphasis",Dc.tokenize],["link",Gm],["image",Qm],["autolink",Cm],["html_inline",Nm],["entity",Bm]],zi=[["balance_pairs",Im],["strikethrough",Fc.postProcess],["emphasis",Dc.postProcess],["fragments_join",Sm]];var Pm=class{ruler;ruler2;constructor(){this.ruler=new zr;for(let e=0;e<qi.length;e++)this.ruler.push(qi[e][0],qi[e][1]);this.ruler2=new zr;for(let e=0;e<zi.length;e++)this.ruler2.push(zi[e][0],zi[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,s=e.cache,o=s[t];if(o!==void 0){e.pos=o;return}let a=!1;if(e.level<i){for(let l=0;l<r;l++)if(e.level++,a=n[l](e,!0),e.level--,a){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,s[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let o=!1;if(e.level<i){for(let a=0;a<n;a++)if(o=t[a](e,!1),o){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a<o;a++)s[a](i)}State=Eg};const Om=/^(vbscript|javascript|file|data):/,Jm=/^data:image\/(gif|png|jpeg|webp);/;function Um(e){const t=e.trim().toLowerCase();return Om.test(t)?Jm.test(t):!0}const Nc=["http:","https:","mailto:"];function Zm(e){const t=Hs(e,!0);if(t.hostname&&(!t.protocol||Nc.includes(t.protocol)))try{t.hostname=kc.toASCII(t.hostname)}catch{}return Cr(Zs(t))}function Hm(e){const t=Hs(e,!0);if(t.hostname&&(!t.protocol||Nc.includes(t.protocol)))try{t.hostname=kc.toUnicode(t.hostname)}catch{}return En(Zs(t),`${En.defaultChars}%`)}const Qc={html:!1,linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100};var jm=class{inline=new Pm;block=new Zg;core=new dm;linkify=new et;validateLink=Um;normalizeLink=Zm;normalizeLinkText=Hm;helpers={...gm};options={...Qc};parse(t,n={}){if(typeof t!="string")throw new TypeError("Input data should be a String");const r=new this.core.State(t,this,n);return this.core.process(r),r.tokens}parseInline(t,n={}){const r=new this.core.State(t,this,n);return r.inlineMode=!0,this.core.process(r),r.tokens}};const qm={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}};var zm=qm;const Vm={options:{...Qc,xhtmlOut:!1,breaks:!1,langPrefix:"language-",highlight:null},components:{core:{},block:{},inline:{}}};var $m=Vm;const Xm={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}};var e0=Xm;const ut={};ut.code_inline=function(e,t,n,r,i){const s=e[t];return`<code${i.renderAttrs(s)}>${Rt(s.content)}</code>`};ut.code_block=function(e,t,n,r,i){const s=e[t];return`<pre${i.renderAttrs(s)}><code>${Rt(e[t].content)}</code></pre>
|
|
23
|
-
`};ut.fence=function(e,t,n,r,i){const s=e[t],o=s.info?Dn(s.info).trim():"";let a="",l="";if(o){const d=o.split(/(\s+)/g);a=d[0],l=d.slice(2).join("")}function c(d){if(d.indexOf("<pre")===0)return`${d}
|
|
24
|
-
`;if(o){const f=s.attrIndex("class"),h=s.attrs?s.attrs.slice():[];f<0?h.push(["class",n.langPrefix+a]):(h[f]=h[f].slice(),h[f][1]+=` ${n.langPrefix}${a}`);const y={attrs:h};return`<pre><code${i.renderAttrs(y)}>${d}</code></pre>
|
|
25
|
-
`}return`<pre><code${i.renderAttrs(s)}>${d}</code></pre>
|
|
26
|
-
`}const u=(()=>{if(!n.highlight)return Rt(s.content);const d=n.highlight(s.content,a,l,r);return cr(d)?d.then(f=>f||Rt(s.content)):d||Rt(s.content)})();return cr(u)?u.then(c):c(u)};ut.image=function(e,t,n,r,i){const s=e[t];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(e,t,n)};ut.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
27
|
-
`:`<br>
|
|
28
|
-
`};ut.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
29
|
-
`:`<br>
|
|
30
|
-
`:`
|
|
31
|
-
`};ut.text=function(e,t){return Rt(e[t].content)};ut.html_block=function(e,t){return e[t].content};ut.html_inline=function(e,t){return e[t].content};ut.reference=function(e,t){return e[t].content};var t0=class{rules=zs({},ut);constructor(){}renderAttrs(e){const t=e.attrs;if(!t)return"";const n=t.length;if(n===0)return"";let r="";for(let i=0;i<n;i++)r+=` ${Rt(t[i][0])}="${Rt(t[i][1])}"`;return r}renderToken(e,t,n,r={}){const i=e[t];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&t&&e[t-1].hidden&&(s+=`
|
|
32
|
-
`),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&n.xhtmlOut&&(s+=" /");let o=!1;if(i.block&&(o=!0,i.nesting===1&&t+1<e.length)){const a=e[t+1];(a.type==="inline"||a.type==="reference"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(o=!1)}return s+=o?`>
|
|
33
|
-
`:">",s}renderInline(e,t,n={}){let r="";const i=this.rules;for(let s=0,o=e.length;s<o;s++){const a=i[e[s].type];if(a){const l=a(e,s,t,n,this);if(cr(l))throw new Error("Renderer.renderInline: async rule detected, use renderInlineAsync()");r+=l}else r+=this.renderToken(e,s,t,n)}return r}renderInlineAsText(e,t,n={}){let r="";for(let i=0,s=e.length;i<s;i++){const o=e[i];switch(o.type){case"text":r+=o.content;break;case"image":r+=this.renderInlineAsText(o.children,t,n);break;case"html_inline":case"html_block":r+=o.content;break;case"softbreak":case"hardbreak":r+=`
|
|
34
|
-
`;break}}return r}render(e,t,n={}){let r="";const i=this.rules;for(let s=0,o=e.length;s<o;s++){const a=e[s].type;if(a==="inline")r+=this.renderInline(e[s].children,t,n);else{const l=i[a];if(l){const c=l(e,s,t,n,this);if(cr(c))throw new Error("Renderer.render: async rule detected, use renderAsync()");r+=c}else r+=this.renderToken(e,s,t,n)}}return r}async renderInlineAsync(e,t,n){const r=[],i=this.rules;for(let s=0,o=e.length;s<o;s++){const a=i[e[s].type];a?r.push(Promise.resolve(a(e,s,t,n,this))):r.push(Promise.resolve(this.renderToken(e,s,t,n)))}return(await Promise.all(r)).join("")}async renderAsync(e,t,n){const r=[],i=this.rules;for(let s=0,o=e.length;s<o;s++){const a=e[s],l=a.type;if(l==="inline")r.push(this.renderInlineAsync(a.children,t,n));else{const c=i[l];c?r.push(Promise.resolve(c(e,s,t,n,this))):r.push(Promise.resolve(this.renderToken(e,s,t,n)))}}return(await Promise.all(r)).join("")}};const ha={default:$m,zero:e0,commonmark:zm};var bs=class extends jm{renderer=new t0;utils=Ag;options={...ha.default.options};constructor(e,t){super();const[n,r]=typeof e=="string"?[e,t]:["default",e];this.configure(n),r&&this.set(r)}set(e){return zs(this.options,e),this}configure(e){if(typeof e=="string"){const t=e;if(e=ha[t],!e)throw new Error(`Wrong \`markdown-exit\` preset "${t}", check name`)}if(!e)throw new Error("Wrong `markdown-exit` preset, can't be empty");if(e.options&&this.set(e.options),e.components)for(const t of Object.keys(e.components)){const n=e.components[t];n.rules&&this[t].ruler.enableOnly(n.rules),n.rules2&&this[t].ruler2?.enableOnly(n.rules2)}return this}enable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(const i of["core","block","inline"])n=n.concat(this[i].ruler.enable(e,!0));n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(i=>!n.includes(i));if(r.length&&!t)throw new Error(`MarkdownExit. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(const i of["core","block","inline"])n=n.concat(this[i].ruler.disable(e,!0));n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(i=>!n.includes(i));if(r.length&&!t)throw new Error(`MarkdownExit. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}renderAsync(e,t={}){return this.renderer.renderAsync(this.parse(e,t),this.options,t)}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}renderInlineAsync(e,t={}){return this.renderer.renderAsync(this.parseInline(e,t),this.options,t)}};function n0(e){function t(...n){return new e(...n)}return Object.setPrototypeOf(t,bs),t.prototype=bs.prototype,t.prototype.constructor=t,t}const r0=n0(bs);var i0=r0;function Gc(e){return typeof e>"u"||e===null}function s0(e){return typeof e=="object"&&e!==null}function o0(e){return Array.isArray(e)?e:Gc(e)?[]:[e]}function a0(e,t){var n,r,i,s;if(t)for(s=Object.keys(t),n=0,r=s.length;n<r;n+=1)i=s[n],e[i]=t[i];return e}function l0(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function c0(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var u0=Gc,A0=s0,d0=o0,h0=l0,f0=c0,p0=a0,Ze={isNothing:u0,isObject:A0,toArray:d0,repeat:h0,isNegativeZero:f0,extend:p0};function Rc(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
|
35
|
-
|
|
36
|
-
`+e.mark.snippet),r+" "+n):r}function ur(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Rc(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ur.prototype=Object.create(Error.prototype);ur.prototype.constructor=ur;ur.prototype.toString=function(t){return this.name+": "+Rc(this,t)};var Ft=ur;function Vi(e,t,n,r,i){var s="",o="",a=Math.floor(i/2)-1;return r-t>a&&(s=" ... ",t=r-a+s.length),n-r>a&&(o=" ...",n=r+a-o.length),{str:s+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+s.length}}function $i(e,t){return Ze.repeat(" ",t-e.length)+e}function g0(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(e.buffer);)i.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,c,A=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+A+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=Vi(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),u),a=Ze.repeat(" ",t.indent)+$i((e.line-l+1).toString(),A)+" | "+c.str+`
|
|
37
|
-
`+a;for(c=Vi(e.buffer,r[o],i[o],e.position,u),a+=Ze.repeat(" ",t.indent)+$i((e.line+1).toString(),A)+" | "+c.str+`
|
|
38
|
-
`,a+=Ze.repeat("-",t.indent+A+3+c.pos)+`^
|
|
39
|
-
`,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)c=Vi(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),u),a+=Ze.repeat(" ",t.indent)+$i((e.line+l+1).toString(),A)+" | "+c.str+`
|
|
40
|
-
`;return a.replace(/\n$/,"")}var m0=g0,y0=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],C0=["scalar","sequence","mapping"];function b0(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function I0(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(y0.indexOf(n)===-1)throw new Ft('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=b0(t.styleAliases||null),C0.indexOf(this.kind)===-1)throw new Ft('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Pe=I0;function fa(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function x0(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Is(e){return this.extend(e)}Is.prototype.extend=function(t){var n=[],r=[];if(t instanceof Pe)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Ft("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Pe))throw new Ft("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Ft("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Ft("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof Pe))throw new Ft("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Is.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=fa(i,"implicit"),i.compiledExplicit=fa(i,"explicit"),i.compiledTypeMap=x0(i.compiledImplicit,i.compiledExplicit),i};var w0=Is,v0=new Pe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),k0=new Pe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),B0=new Pe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),_0=new w0({explicit:[v0,k0,B0]});function S0(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function E0(){return null}function D0(e){return e===null}var F0=new Pe("tag:yaml.org,2002:null",{kind:"scalar",resolve:S0,construct:E0,predicate:D0,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function N0(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Q0(e){return e==="true"||e==="True"||e==="TRUE"}function G0(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var R0=new Pe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:N0,construct:Q0,predicate:G0,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function M0(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function W0(e){return 48<=e&&e<=55}function K0(e){return 48<=e&&e<=57}function T0(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!M0(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!W0(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!K0(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function Y0(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function L0(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ze.isNegativeZero(e)}var P0=new Pe("tag:yaml.org,2002:int",{kind:"scalar",resolve:T0,construct:Y0,predicate:L0,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),O0=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J0(e){return!(e===null||!O0.test(e)||e[e.length-1]==="_")}function U0(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Z0=/^[-+]?[0-9]+e/;function H0(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ze.isNegativeZero(e))return"-0.0";return n=e.toString(10),Z0.test(n)?n.replace("e",".e"):n}function j0(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ze.isNegativeZero(e))}var q0=new Pe("tag:yaml.org,2002:float",{kind:"scalar",resolve:J0,construct:U0,predicate:j0,represent:H0,defaultStyle:"lowercase"}),Mc=_0.extend({implicit:[F0,R0,P0,q0]}),z0=Mc,Wc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Kc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function V0(e){return e===null?!1:Wc.exec(e)!==null||Kc.exec(e)!==null}function $0(e){var t,n,r,i,s,o,a,l=0,c=null,A,u,d;if(t=Wc.exec(e),t===null&&(t=Kc.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(A=+t[10],u=+(t[11]||0),c=(A*60+u)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,r,i,s,o,a,l)),c&&d.setTime(d.getTime()-c),d}function X0(e){return e.toISOString()}var ey=new Pe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:V0,construct:$0,instanceOf:Date,represent:X0});function ty(e){return e==="<<"||e===null}var ny=new Pe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ty}),Xs=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
41
|
-
\r`;function ry(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=Xs;for(n=0;n<i;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function iy(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Xs,o=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function sy(e){var t="",n=0,r,i,s=e.length,o=Xs;for(r=0;r<s;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=s%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function oy(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ay=new Pe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ry,construct:iy,predicate:oy,represent:sy}),ly=Object.prototype.hasOwnProperty,cy=Object.prototype.toString;function uy(e){if(e===null)return!0;var t=[],n,r,i,s,o,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],o=!1,cy.call(i)!=="[object Object]")return!1;for(s in i)if(ly.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function Ay(e){return e!==null?e:[]}var dy=new Pe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:uy,construct:Ay}),hy=Object.prototype.toString;function fy(e){if(e===null)return!0;var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],hy.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function py(e){if(e===null)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}var gy=new Pe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:fy,construct:py}),my=Object.prototype.hasOwnProperty;function yy(e){if(e===null)return!0;var t,n=e;for(t in n)if(my.call(n,t)&&n[t]!==null)return!1;return!0}function Cy(e){return e!==null?e:{}}var by=new Pe("tag:yaml.org,2002:set",{kind:"mapping",resolve:yy,construct:Cy}),Iy=z0.extend({implicit:[ey,ny],explicit:[ay,dy,gy,by]}),Ht=Object.prototype.hasOwnProperty,Vr=1,Tc=2,Yc=3,$r=4,Xi=1,xy=2,pa=3,wy=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,vy=/[\x85\u2028\u2029]/,ky=/[,\[\]\{\}]/,Lc=/^(?:!|!!|![a-z\-]+!)$/i,Pc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ga(e){return Object.prototype.toString.call(e)}function bt(e){return e===10||e===13}function nn(e){return e===9||e===32}function qe(e){return e===9||e===32||e===10||e===13}function vn(e){return e===44||e===91||e===93||e===123||e===125}function By(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function _y(e){return e===120?2:e===117?4:e===85?8:0}function Sy(e){return 48<=e&&e<=57?e-48:-1}function ma(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
42
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Ey(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Oc(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var Jc=new Array(256),Uc=new Array(256);for(var An=0;An<256;An++)Jc[An]=ma(An)?1:0,Uc[An]=ma(An);function Dy(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Iy,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Zc(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=m0(n),new Ft(t,n)}function z(e,t){throw Zc(e,t)}function Xr(e,t){e.onWarning&&e.onWarning.call(null,Zc(e,t))}var ya={YAML:function(t,n,r){var i,s,o;t.version!==null&&z(t,"duplication of %YAML directive"),r.length!==1&&z(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&z(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&z(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Xr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&z(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],Lc.test(i)||z(t,"ill-formed tag handle (first argument) of the TAG directive"),Ht.call(t.tagMap,i)&&z(t,'there is a previously declared suffix for "'+i+'" tag handle'),Pc.test(s)||z(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{z(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function Ut(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||z(e,"expected valid JSON character");else wy.test(a)&&z(e,"the stream contains non-printable characters");e.result+=a}}function Ca(e,t,n,r){var i,s,o,a;for(Ze.isObject(n)||z(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],Ht.call(t,s)||(Oc(t,s,n[s]),r[s]=!0)}function kn(e,t,n,r,i,s,o,a,l){var c,A;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,A=i.length;c<A;c+=1)Array.isArray(i[c])&&z(e,"nested arrays are not supported inside keys"),typeof i=="object"&&ga(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&ga(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,A=s.length;c<A;c+=1)Ca(e,t,s[c],n);else Ca(e,t,s,n);else!e.json&&!Ht.call(n,i)&&Ht.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,z(e,"duplicated mapping key")),Oc(t,i,s),delete n[i];return t}function eo(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):z(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ve(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;nn(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(bt(i))for(eo(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Xr(e,"deficient indentation"),r}function yi(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||qe(n)))}function to(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ze.repeat(`
|
|
43
|
-
`,t-1))}function Fy(e,t,n){var r,i,s,o,a,l,c,A,u=e.kind,d=e.result,f;if(f=e.input.charCodeAt(e.position),qe(f)||vn(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(i=e.input.charCodeAt(e.position+1),qe(i)||n&&vn(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;f!==0;){if(f===58){if(i=e.input.charCodeAt(e.position+1),qe(i)||n&&vn(i))break}else if(f===35){if(r=e.input.charCodeAt(e.position-1),qe(r))break}else{if(e.position===e.lineStart&&yi(e)||n&&vn(f))break;if(bt(f))if(l=e.line,c=e.lineStart,A=e.lineIndent,ve(e,!1,-1),e.lineIndent>=t){a=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=A;break}}a&&(Ut(e,s,o,!1),to(e,e.line-l),s=o=e.position,a=!1),nn(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}return Ut(e,s,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function Ny(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Ut(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else bt(n)?(Ut(e,r,i,!0),to(e,ve(e,!1,t)),r=i=e.position):e.position===e.lineStart&&yi(e)?z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);z(e,"unexpected end of the stream within a single quoted scalar")}function Qy(e,t){var n,r,i,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Ut(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ut(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),bt(a))ve(e,!1,t);else if(a<256&&Jc[a])e.result+=Uc[a],e.position++;else if((o=_y(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=By(a))>=0?s=(s<<4)+o:z(e,"expected hexadecimal character");e.result+=Ey(s),e.position++}else z(e,"unknown escape sequence");n=r=e.position}else bt(a)?(Ut(e,n,r,!0),to(e,ve(e,!1,t)),n=r=e.position):e.position===e.lineStart&&yi(e)?z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}z(e,"unexpected end of the stream within a double quoted scalar")}function Gy(e,t){var n=!0,r,i,s,o=e.tag,a,l=e.anchor,c,A,u,d,f,h=Object.create(null),y,C,x,p;if(p=e.input.charCodeAt(e.position),p===91)A=93,f=!1,a=[];else if(p===123)A=125,f=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),p=e.input.charCodeAt(++e.position);p!==0;){if(ve(e,!0,t),p=e.input.charCodeAt(e.position),p===A)return e.position++,e.tag=o,e.anchor=l,e.kind=f?"mapping":"sequence",e.result=a,!0;n?p===44&&z(e,"expected the node content, but found ','"):z(e,"missed comma between flow collection entries"),C=y=x=null,u=d=!1,p===63&&(c=e.input.charCodeAt(e.position+1),qe(c)&&(u=d=!0,e.position++,ve(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,Fn(e,t,Vr,!1,!0),C=e.tag,y=e.result,ve(e,!0,t),p=e.input.charCodeAt(e.position),(d||e.line===r)&&p===58&&(u=!0,p=e.input.charCodeAt(++e.position),ve(e,!0,t),Fn(e,t,Vr,!1,!0),x=e.result),f?kn(e,a,h,C,y,x,r,i,s):u?a.push(kn(e,null,h,C,y,x,r,i,s)):a.push(y),ve(e,!0,t),p=e.input.charCodeAt(e.position),p===44?(n=!0,p=e.input.charCodeAt(++e.position)):n=!1}z(e,"unexpected end of the stream within a flow collection")}function Ry(e,t){var n,r,i=Xi,s=!1,o=!1,a=t,l=0,c=!1,A,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Xi===i?i=u===43?pa:xy:z(e,"repeat of a chomping mode identifier");else if((A=Sy(u))>=0)A===0?z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?z(e,"repeat of an indentation width identifier"):(a=t+A-1,o=!0);else break;if(nn(u)){do u=e.input.charCodeAt(++e.position);while(nn(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!bt(u)&&u!==0)}for(;u!==0;){for(eo(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),bt(u)){l++;continue}if(e.lineIndent<a){i===pa?e.result+=Ze.repeat(`
|
|
44
|
-
`,s?1+l:l):i===Xi&&s&&(e.result+=`
|
|
45
|
-
`);break}for(r?nn(u)?(c=!0,e.result+=Ze.repeat(`
|
|
46
|
-
`,s?1+l:l)):c?(c=!1,e.result+=Ze.repeat(`
|
|
47
|
-
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Ze.repeat(`
|
|
48
|
-
`,l):e.result+=Ze.repeat(`
|
|
49
|
-
`,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!bt(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Ut(e,n,e.position,!1)}return!0}function ba(e,t){var n,r=e.tag,i=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!qe(o))));){if(a=!0,e.position++,ve(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Fn(e,t,Yc,!1,!0),s.push(e.result),ve(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)z(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function My(e,t,n){var r,i,s,o,a,l,c=e.tag,A=e.anchor,u={},d=Object.create(null),f=null,h=null,y=null,C=!1,x=!1,p;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),p=e.input.charCodeAt(e.position);p!==0;){if(!C&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(p===63||p===58)&&qe(r))p===63?(C&&(kn(e,u,d,f,h,null,o,a,l),f=h=y=null),x=!0,C=!0,i=!0):C?(C=!1,i=!0):z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,p=r;else{if(o=e.line,a=e.lineStart,l=e.position,!Fn(e,n,Tc,!1,!0))break;if(e.line===s){for(p=e.input.charCodeAt(e.position);nn(p);)p=e.input.charCodeAt(++e.position);if(p===58)p=e.input.charCodeAt(++e.position),qe(p)||z(e,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(kn(e,u,d,f,h,null,o,a,l),f=h=y=null),x=!0,C=!1,i=!1,f=e.tag,h=e.result;else if(x)z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=A,!0}else if(x)z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=A,!0}if((e.line===s||e.lineIndent>t)&&(C&&(o=e.line,a=e.lineStart,l=e.position),Fn(e,t,$r,!0,i)&&(C?h=e.result:y=e.result),C||(kn(e,u,d,f,h,y,o,a,l),f=h=y=null),ve(e,!0,-1),p=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&p!==0)z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return C&&kn(e,u,d,f,h,null,o,a,l),x&&(e.tag=c,e.anchor=A,e.kind="mapping",e.result=u),x}function Wy(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&z(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):z(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!qe(o);)o===33&&(r?z(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),Lc.test(i)||z(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),ky.test(s)&&z(e,"tag suffix cannot contain flow indicator characters")}s&&!Pc.test(s)&&z(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{z(e,"tag name is malformed: "+s)}return n?e.tag=s:Ht.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:z(e,'undeclared tag handle "'+i+'"'),!0}function Ky(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&z(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!qe(n)&&!vn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ty(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!qe(r)&&!vn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ht.call(e.anchorMap,n)||z(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ve(e,!0,-1),!0}function Fn(e,t,n,r,i){var s,o,a,l=1,c=!1,A=!1,u,d,f,h,y,C;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=$r===n||Yc===n,r&&ve(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Wy(e)||Ky(e);)ve(e,!0,-1)?(c=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||i),(l===1||$r===n)&&(Vr===n||Tc===n?y=t:y=t+1,C=e.position-e.lineStart,l===1?a&&(ba(e,C)||My(e,C,y))||Gy(e,y)?A=!0:(o&&Ry(e,y)||Ny(e,y)||Qy(e,y)?A=!0:Ty(e)?(A=!0,(e.tag!==null||e.anchor!==null)&&z(e,"alias node should not have any properties")):Fy(e,y,Vr===n)&&(A=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(A=a&&ba(e,C))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(h=e.implicitTypes[u],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Ht.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,f=e.typeMap.multi[e.kind||"fallback"],u=0,d=f.length;u<d;u+=1)if(e.tag.slice(0,f[u].tag.length)===f[u].tag){h=f[u];break}h||z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&z(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||A}function Yy(e){var t=e.position,n,r,i,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(ve(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!qe(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&z(e,"directive name must not be less than one character in length");o!==0;){for(;nn(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!bt(o));break}if(bt(o))break;for(n=e.position;o!==0&&!qe(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&eo(e),Ht.call(ya,r)?ya[r](e,r,i):Xr(e,'unknown document directive "'+r+'"')}if(ve(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ve(e,!0,-1)):s&&z(e,"directives end mark is expected"),Fn(e,e.lineIndent-1,$r,!1,!0),ve(e,!0,-1),e.checkLineBreaks&&vy.test(e.input.slice(t,e.position))&&Xr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&yi(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ve(e,!0,-1));return}if(e.position<e.length-1)z(e,"end of the stream or a document separator is expected");else return}function Ly(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
50
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Dy(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,z(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Yy(n);return n.documents}function Py(e,t){var n=Ly(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ft("expected a single document in the stream, but found more")}}var Oy=Py,Jy={load:Oy},Hc=Mc,jc=Jy.load;function sn(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}sn.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===t)return r;return-1};sn.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};sn.prototype.attrSet=function(t,n){const r=this.attrIndex(t),i=[t,n];r<0?this.attrPush(i):this.attrs[r]=i};sn.prototype.attrGet=function(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r};sn.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};const Uy=/\d/,Zy=["-","_","/","."];function Hy(e=""){if(!Uy.test(e))return e!==e.toLowerCase()}function jy(e,t){const n=Zy,r=[];if(!e||typeof e!="string")return r;let i="",s,o;for(const a of e){const l=n.includes(a);if(l===!0){r.push(i),i="",s=void 0;continue}const c=Hy(a);if(o===!1){if(s===!1&&c===!0){r.push(i),i=a,s=c;continue}if(s===!0&&c===!1&&i.length>1){const A=i.at(-1);r.push(i.slice(0,Math.max(0,i.length-1))),i=A+a,s=c;continue}}i+=a,s=c,o=l}return r.push(i),r}function qy(e,t){return e?(Array.isArray(e)?e:jy(e)).map(n=>n.toLowerCase()).join("-"):""}function qc(e,t){if(e[t]!=="[")return null;let n=t+1;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){n+=2;continue}if(e[n]==="]")return{content:e.slice(t+1,n),endIndex:n+1};n+=1}return null}const Qr={"[":"]","{":"}","(":")"},Gr={"'":"'",'"':'"',"`":"`"};function zc(e,t=0){if(e[t]!=="{")throw new Error(`Invalid props, expected \`{\` but got '${e[t]}'`);const n=[];if(e[t+1]==="{")return;for(t+=1;t<e.length;)if(e[t]==="\\")t+=2;else if(e[t]==="}"){t+=1;break}else if(e[t]===" ")t+=1;else if(e[t]===".")t+=1,n.push(["class",r(" #.}")]);else if(e[t]==="#")t+=1,n.push(["id",r(" #.}")]);else{const a=t;for(;t<e.length&&(t+=1,!" }=".includes(e[t])););const l=e[t];if(a!==t){const c=e.slice(a,t).trim();l==="="?(t+=1,n.push([c,i()])):n.push([c,"true"])}}function r(a){const l=t;for(;t<e.length&&(t+=1,e[t]==="\\"&&(t+=2),!a.includes(e[t])););return e.slice(l,t)}function i(){const a=t;return e[t]in Qr?(s(Qr[e[t]]),t+=1,e.slice(a,t)):e[t]in Gr?(o(Gr[e[t]]),t+=1,e.slice(a,t)):r(" }")}function s(a){for(;t<e.length;)if(t++,e[t]in Gr)o(Gr[e[t]]);else if(e[t]in Qr)s(Qr[e[t]]);else if(e[t]===a)return}function o(a){return r(a)}return n.forEach(a=>{a[1].match(/^(['"`]).*\1$/)&&(a[1]=a[1].slice(1,-1))}),{props:n,index:t}}const zy=/^[a-z$][$\w.-]*/i;function es(e){if(e=e.trim(),!e)return{name:""};const t=e.match(zy)?.[0];if(!t)throw new Error(`Invalid block params: ${e}`);let n=e.slice(t.length).trim(),r,i,s;if(n.startsWith("[")){const a=qc(n,0);a&&(r=a.content,n=n.slice(a.endIndex).trim())}if(n.startsWith("{")){const a=zc(n,0);if(a){i=a.props;const l=n.slice(a.index).trim();l&&(s=l)}}else n&&(s=n);const o={name:qy(t)};return r!==void 0&&(o.content=r),i!==void 0&&(o.props=i),s&&(o.remaining=s),o}const Vy=e=>{e.block.ruler.before("fence","mdc_block_shorthand",function(s,o,a,l){const c=s.src.slice(s.bMarks[o]+s.tShift[o],s.eMarks[o]);if(!c.match(/^:\w/))return!1;const A=es(c.slice(1)),{name:u,content:d,props:f,remaining:h}=A;if(h)return!1;if(s.lineMax=o+1,!l)if(d!==void 0){const y=s.push("mdc_block_shorthand",u,1);f?.forEach(([b,I])=>{b==="class"?y.attrJoin(b,I):y.attrSet(b,I)}),y.map=[o,o+1];const C=s.push("inline","",0);C.content="";const x=new s.Token("text","",0);x.content=d,C.children=[x];const p=s.push("mdc_block_shorthand",u,-1);p.map=[o,o+1]}else{const y=s.push("mdc_block_shorthand",u,0);y.map=[o,o+1],f?.forEach(([C,x])=>{C==="class"?y.attrJoin(C,x):y.attrSet(C,x)})}return s.line=o+1,!0}),e.block.ruler.before("fence","mdc_block",function(s,o,a,l){let c,A,u=!1,d=s.bMarks[o]+s.tShift[o],f=s.eMarks[o];const h=s.sCount[o];let y=!1,C=0,x=0,p=0;if(s.src[d]!==":")return!1;for(c=d+1;c<=f&&s.src[c]===":";c++);const b=Math.floor(c-d);if(b<2)return!1;const I=s.src.slice(d,c),k=es(s.src.slice(c,f));if(!k.name)return!1;if(l)return!0;for(A=o;A++,!(A>=a||(d=s.bMarks[A]+s.tShift[A],f=s.eMarks[A],d<f&&s.sCount[A]<s.blkIndent));){const U=s.src.charCodeAt(d);if(y){if(U===C){let V=d+1;for(;V<f&&s.src.charCodeAt(V)===C;)V++;V-d>=x&&s.skipSpaces(V)>=f&&(y=!1)}continue}if(U===96||U===126){let V=d+1;for(;V<f&&s.src.charCodeAt(V)===U;)V++;if(V-d>=3){y=!0,C=U,x=V-d;continue}}if(U===58){for(c=d+1;c<=f&&s.src[c]===":";c++);if(c-d===b){if(c=s.skipSpaces(c),c<f){p++;continue}if(p>0){p--;continue}u=!0;break}}}const B=s.parentType,D=s.lineMax;s.parentType="mdc_block",s.lineMax=A;const Q=s.push("mdc_block_open",k.name,1);Q.markup=I,Q.block=!0,Q.info=k.name,Q.map=[o,A],k.props&&k.props?.forEach(([U,V])=>{U==="class"?Q.attrJoin(U,V):Q.attrSet(U,V)});const R=s.blkIndent;s.blkIndent=h,s.env.mdcBlockTokens||=[],s.env.mdcBlockTokens.unshift(Q),s.md.block.tokenize(s,o+1,A),s.blkIndent=R,s.env.mdcBlockTokens.shift(Q);const Y=s.push("mdc_block_close",k.name,-1);return Y.map=[o,A],Y.markup=s.src.slice(d,c),Y.block=!0,s.tokens.slice(s.tokens.indexOf(Q)+1,s.tokens.indexOf(Y)).filter(U=>U.level===Q.level+1).forEach((U,V,ge)=>{ge.length<=2&&U.tag==="p"&&(U.hidden=!0)}),s.parentType=B,s.lineMax=D,s.line=A+(u?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.after("code","mdc_block_yaml",function(s,o,a,l){if(!s.env.mdcBlockTokens?.length)return!1;const c=s.bMarks[o]+s.tShift[o],A=s.eMarks[o];if(s.src.slice(c,A)!=="---")return!1;let u=o+1,d=!1;for(;u<a;){if(s.src.slice(s.bMarks[u]+s.tShift[o],s.eMarks[u])==="---"){d=!0;break}u+=1}if(!d)return!1;if(!l){const f=s.src.slice(s.bMarks[o+1],s.eMarks[u-1]),h=jc(f,{schema:Hc}),y=s.env.mdcBlockTokens[0];Object.entries(h||{}).forEach(([C,x])=>{C==="class"?y.attrJoin(C,x):y.attrSet(C,typeof x=="string"?x:JSON.stringify(x))})}return s.line=u+1,s.lineMax=u+1,!0}),e.block.ruler.after("code","mdc_block_slots",function(s,o,a,l){if(!s.env.mdcBlockTokens?.length)return!1;const c=s.bMarks[o]+s.tShift[o];if(!(s.src[c]==="#"&&s.src[c+1]!==" "&&s.src[c+1]!=="#"))return!1;const A=s.src.slice(c,s.eMarks[o]),{name:u,props:d}=es(A.slice(1));let f=o+1;for(;f<a;){const y=s.src.slice(s.bMarks[f]+s.tShift[o],s.eMarks[f]);if(y.match(/^#(\w)+/)||y.startsWith("::"))break;f+=1}if(l)return s.line=f,s.lineMax=f,!0;s.lineMax=o+1;const h=s.push("mdc_block_slot","template",1);return h.attrSet(`#${u}`,""),d?.forEach(([y,C])=>{y==="class"?h.attrJoin(y,C):h.attrSet(y,C)}),s.line=o+1,s.lineMax=f,s.md.block.tokenize(s,o+1,f),s.push("mdc_block_slot","template",-1),s.line=f,s.lineMax=f,!0})},$y=new Set([" "," ",`
|
|
51
|
-
`,"*","_","["]),Xy=e=>{e.inline.ruler.after("entity","mdc_inline_component",(t,n)=>{const r=t.pos;if(t.src[r]!==":")return!1;const s=t.src[r-1];if(r>0&&!$y.has(s))return!1;let o=r+1,a=-1,l;for(;o<t.src.length;){const A=t.src[o];if(A==="["){a=o;const u=qc(t.src,o);u&&(l=u.content,o=u.endIndex);break}if(!/[\w$\-]/.test(A))break;o+=1}if(a===-1&&(a=o),a<=r+1)return!1;if(t.pos=o,n)return!0;const c=t.src.slice(r+1,a);if(l!==void 0){t.push("mdc_inline_component",c,1);const A=t.push("text","",0);A.content=l,t.push("mdc_inline_component",c,-1)}else t.push("mdc_inline_component",c,0);return!0})},eC=e=>{e.inline.ruler.after("entity","mdc_inline_props",(r,i)=>{const s=r.pos;if(r.src[s]!=="{"||r.src[s+1]==="{"||r.src[s-1]==="{"||r.src[s-1]==="$")return!1;const a=zc(r.src,s);if(!a)return!1;const{props:l,index:c}=a;if(c===s)return!1;if(r.pos=c,i)return!0;const A=r.push("mdc_inline_props","span",0);return A.attrs=l,A.hidden=!0,!0}),e.renderer.rules.mdc_inline_props=()=>"";const t=e.parse;e.parse=function(r,i){const s=t.call(this,r,i);return s.forEach((o,a)=>{const l=s[a-1],c=s[a+1];if(!(!["heading_open","paragraph_open","list_item_open"].includes(l?.type)||l.hidden)&&(o.hidden&&c.type==="inline"&&(o=c),o.type==="inline"&&o.children?.length===2&&o.children[0].type==="text"&&o.children[1].type==="mdc_inline_props")){const A=o.children[1].attrs;o.children.splice(1,1),A?.forEach(([u,d])=>{u==="class"?l.attrJoin("class",d):l.attrSet(u,d)})}}),s.forEach((o,a)=>{if(o.type!=="bullet_list_open")return;const l=s[a-1];if(!l||l.type!=="mdc_block_open"||l.tag!=="ul")return;let c=a+1;for(;c<s.length;){const d=s[c];if(d.type==="bullet_list_close"&&d.level===o.level)break;c+=1}const A=s[c];if(A.type!=="bullet_list_close")return;const u=s[c+1];u.type==="mdc_block_close"&&u.tag==="ul"&&(o.hidden=!0,A.hidden=!0)}),s};const n=e.renderer.renderInline;e.renderer.renderInline=function(r,i,s){return r=[...r],r.forEach((o,a)=>{if(o.type==="mdc_inline_props"){let l=a-1,c=r[l];for(;l>=0&&(c.type==="text"&&!c.content.trim());)l--,c=r[l];if(!c.tag&&c.type==="text"){c=new sn("mdc_inline_span","span",1),r.splice(a-1,0,c);const A=new sn("mdc_inline_span","span",-1);r.splice(a+2,0,A)}else if(c.nesting===-1){let A=a-1;for(;A>=0;){const u=r[A];if(u.nesting===1&&u.tag===c.tag&&u.level===c.level){c=u;break}A--}}if(c.nesting===-1)throw new Error(`No matching opening tag found for ${JSON.stringify(c)}`);o.attrs?.forEach(([A,u])=>{A==="class"?c.attrJoin("class",u):c.attrSet(A,u)})}}),n.call(this,r,i,s)}},tC=e=>{e.inline.ruler.before("link","mdc_inline_span",(t,n)=>{const r=t.pos;if(t.src[r]!=="[")return!1;let s=r+1,o=0;for(;s<t.src.length;){if(t.src[s]==="\\"){s+=2;continue}if(t.src[s]==="[")o++;else if(t.src[s]==="]"){if(o===0)break;o--}s+=1}if(s===r)return!1;const a=t.src[s+1];if(a==="("||a==="[")return!1;if(n)return!0;t.push("mdc_inline_span","span",1);const l=t.pos,c=t.posMax;return t.pos=r+1,t.posMax=s,t.md.inline.tokenize(t),t.pos=l,t.posMax=c,t.push("mdc_inline_span","span",-1),t.pos=s+1,!0})},nC=(e,t={})=>{const{blockComponent:n=!0,inlineProps:r=!0,inlineSpan:i=!0,inlineComponent:s=!0}=t.syntax||{};n&&e.use(Vy),r&&e.use(eC),i&&e.use(tC),s&&e.use(Xy)};function rC(e){let t=Promise.resolve(null);return(...n)=>(t=t.then(()=>e(...n)).catch(()=>null),t)}function Ia(e,t,n){const r=e.attrIndex(t),i=[t,n];r<0?(e.attrs||(e.attrs=[]),e.attrs.push(i)):e.attrs[r]=i}function iC(e,t){for(let n=t-1;n>=0;n--){if(e[n].type==="list_item_open")return n;if(e[n].type==="list_item_close")return-1}return-1}function sC(e,t){const n=e[t].level-1;for(let r=t-1;r>=0;r--)if(e[r].level===n&&(e[r].type==="bullet_list_open"||e[r].type==="ordered_list_open"))return r;return-1}function oC(e,t){const n=!(t?.enabled??!1);e.core.ruler.before("inline","task-lists-mdc",r=>{const i=r.tokens;for(let s=0;s<i.length;s++){const o=i[s];if(o.type==="inline"&&o.content){const a=iC(i,s);if(a>=0){const l=o.content.match(/^(\[[ x]\])\s+/i);if(l){const c=l[1].toLowerCase()==="[x]";Ia(i[a],"class","task-list-item");const A=sC(i,a);A>=0&&Ia(i[A],"class","contains-task-list");const u=`{{TASK_CHECKBOX_${c?"CHECKED":"UNCHECKED"}}} `;o.content=o.content.replace(/^\[[ x]\]\s+/i,u)}}}}}),e.core.ruler.after("inline","task-lists-mdc-post",r=>{const i=r.tokens;for(let s=0;s<i.length;s++){const o=i[s];if(o.type==="inline"&&o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];if(l.type==="text"&&l.content){const c=l.content.match(/^\{\{TASK_CHECKBOX_CHECKED\}\}/),A=l.content.match(/^\{\{TASK_CHECKBOX_UNCHECKED\}\}/);if(c||A){const u=!!c,d=new r.Token("mdc_inline_component","input",0);d.attrs=[["class","task-list-item-checkbox"],["type","checkbox"]],n&&d.attrs.push([":disabled","true"]),u&&d.attrs.push([":checked","true"]),l.content=l.content.replace(/^\{\{TASK_CHECKBOX_(CHECKED|UNCHECKED)\}\}/,""),o.children.splice(a,0,d),a++}}}}})}const aC=()=>({name:"task-list",markdownItPlugins:[oC]}),lC=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function cC(e){return e>=55296&&e<=57343||e>1114111?65533:lC.get(e)??e}function Vc(e){const t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let i=0,s=0;i<n;i+=2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ye;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ye||(ye={}));const xa=32;function xs(e){return e>=ye.ZERO&&e<=ye.NINE}function dC(e){return e>=ye.UPPER_A&&e<=ye.UPPER_F||e>=ye.LOWER_A&&e<=ye.LOWER_F}function hC(e){return e>=ye.UPPER_A&&e<=ye.UPPER_Z||e>=ye.LOWER_A&&e<=ye.LOWER_Z||xs(e)}function fC(e){return e===ye.EQUALS||hC(e)}var Fe;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Fe||(Fe={}));var pt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(pt||(pt={}));class pC{decodeTree;emitCodePoint;errors;constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r}state=Fe.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=pt.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=Fe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case Fe.EntityStart:return t.charCodeAt(n)===ye.NUM?(this.state=Fe.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Fe.NamedEntity,this.stateNamedEntity(t,n));case Fe.NumericStart:return this.stateNumericStart(t,n);case Fe.NumericDecimal:return this.stateNumericDecimal(t,n);case Fe.NumericHex:return this.stateNumericHex(t,n);case Fe.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|xa)===ye.LOWER_X?(this.state=Fe.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Fe.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(xs(r)||dC(r)){const i=r<=ye.NINE?r-ye.ZERO:(r|xa)-ye.LOWER_A+10;this.result=this.result*16+i,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(xs(r))this.result=this.result*10+(r-ye.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){if(this.consumed<=n)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ye.SEMI)this.consumed+=1;else if(this.decodeMode===pt.Strict)return 0;return this.emitCodePoint(cC(this.result),this.consumed),this.errors&&(t!==ye.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Je.VALUE_LENGTH)>>14;for(;n<t.length;){if(s===0&&(i&Je.FLAG13)!==0){const a=(i&Je.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const l=i&Je.JUMP_TABLE;if(t.charCodeAt(n)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const l=this.runConsumed-1,c=r[this.treeIndex+1+(l>>1)],A=l%2===0?c&255:c>>8&255;if(t.charCodeAt(n)!==A)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),i=r[this.treeIndex],s=(i&Je.VALUE_LENGTH)>>14}if(n>=t.length)break;const o=t.charCodeAt(n);if(o===ye.SEMI&&s!==0&&(i&Je.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=gC(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===pt.Attribute&&(s===0||fC(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Je.VALUE_LENGTH)>>14,s!==0){if(o===ye.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==pt.Strict&&(i&Je.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:t,decodeTree:n}=this,r=(n[t]&Je.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~(Je.VALUE_LENGTH|Je.FLAG13):i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){switch(this.state){case Fe.NamedEntity:return this.result!==0&&(this.decodeMode!==pt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Fe.NumericDecimal:return this.emitNumericEntity(0,2);case Fe.NumericHex:return this.emitNumericEntity(0,3);case Fe.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Fe.EntityStart:return 0}}}function gC(e,t,n,r){const i=(t&Je.BRANCH_LENGTH)>>7,s=t&Je.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const c=r-s;return c<0||c>=i?-1:e[n+c]-1}const o=i+1>>1;let a=0,l=i-1;for(;a<=l;){const c=a+l>>>1,A=c>>1,d=e[n+A]>>(c&1)*8&255;if(d<r)a=c+1;else if(d>r)l=c-1;else return e[n+o+c]}return-1}function mC(e,t,n){function r(s,o,a){let l=s;if(t(s)){const c=n(s);if(c===!1)return o.splice(a,1),!0;c!==void 0&&(o[a]=c,l=c)}if(Array.isArray(l)&&l.length>2){let c=2;for(;c<l.length;)r(l[c],l,c)||(c+=1)}return!1}let i=0;for(;i<e.nodes.length;)r(e.nodes[i],e.nodes,i)||(i+=1)}const wa={"!TIP":{type:"tip",title:"Tip",color:"#238636"},"!NOTE":{type:"note",title:"Note",color:"#1f6feb"},"!IMPORTANT":{type:"important",title:"Important",color:"#8957e5"},"!WARNING":{type:"warning",title:"Warning",color:"#9e6a03"},"!CAUTION":{type:"caution",title:"Caution",color:"#da3633"}},yC=()=>({name:"alert",post(e){mC(e.tree,t=>Array.isArray(t)&&t[0]==="blockquote",t=>{const n=t;if(t[2]?.[0]==="span"){const r=String(t[2][2]).toUpperCase(),i=wa[r];i&&(typeof t[3]=="string"&&(n[3]=String(n[3]).trimStart()),n.splice(2,1),n[1].as=i.type)}else if(t[2]?.[0]==="p"){const r=t[2];if(r[2]?.[0]==="span"){const i=String(r[2][2]).toUpperCase(),s=wa[i];s&&(typeof r[3]=="string"&&(r[3]=String(r[3]).trimStart()),r.splice(2,1),n[1].as=s.type)}}})}});var j;(function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"})(j||(j={}));var E;(function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.DeclarationSequence=20]="DeclarationSequence",e[e.InSpecialComment=21]="InSpecialComment",e[e.InCommentLike=22]="InCommentLike",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.InPlainText=25]="InPlainText",e[e.InEntity=26]="InEntity"})(E||(E={}));function Vt(e){return e===j.Space||e===j.NewLine||e===j.Tab||e===j.FormFeed||e===j.CarriageReturn}function dn(e){return e===j.Slash||e===j.Gt||Vt(e)}function CC(e){return e>=j.LowerA&&e<=j.LowerZ||e>=j.UpperA&&e<=j.UpperZ}var gt;(function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"})(gt||(gt={}));const re={Empty:new Uint8Array(0),Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])},bC=new Map([[re.IframeEnd[2],re.IframeEnd],[re.NoembedEnd[2],re.NoembedEnd],[re.Plaintext[2],re.Plaintext],[re.ScriptEnd[2],re.ScriptEnd],[re.TitleEnd[2],re.TitleEnd],[re.XmpEnd[2],re.XmpEnd]]);class IC{cbs;state=E.Text;buffer="";sectionStart=0;index=0;entityStart=0;baseState=E.Text;isSpecial=!1;running=!0;offset=0;xmlMode;decodeEntities;recognizeSelfClosing;entityDecoder;constructor({xmlMode:t=!1,decodeEntities:n=!0,recognizeSelfClosing:r=t},i){this.cbs=i,this.xmlMode=t,this.decodeEntities=n,this.recognizeSelfClosing=r,this.entityDecoder=new pC(t?AC:uC,(s,o)=>this.emitCodePoint(s,o))}reset(){this.state=E.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=E.Text,this.isSpecial=!1,this.currentSequence=re.Empty,this.sequenceIndex=0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(t){t===j.Lt||!this.decodeEntities&&this.fastForwardTo(j.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=E.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===j.Amp&&this.startEntity()}currentSequence=re.Empty;sequenceIndex=0;enterTagBody(){this.currentSequence===re.Plaintext?(this.currentSequence=re.Empty,this.state=E.InPlainText):this.isSpecial?(this.state=E.InSpecialTag,this.sequenceIndex=0):this.state=E.Text}stateSpecialStartSequence(t){const n=t|32;if(this.sequenceIndex<this.currentSequence.length){if(n===this.currentSequence[this.sequenceIndex]){this.sequenceIndex++;return}if(this.sequenceIndex===3){if(this.currentSequence===re.ScriptEnd&&n===re.StyleEnd[3]){this.currentSequence=re.StyleEnd,this.sequenceIndex=4;return}if(this.currentSequence===re.TitleEnd&&n===re.TextareaEnd[3]){this.currentSequence=re.TextareaEnd,this.sequenceIndex=4;return}}else if(this.sequenceIndex===4&&this.currentSequence===re.NoembedEnd&&n===re.NoframesEnd[4]){this.currentSequence=re.NoframesEnd,this.sequenceIndex=5;return}}else if(dn(t)){this.sequenceIndex=0,this.state=E.InTagName,this.stateInTagName(t);return}this.isSpecial=!1,this.currentSequence=re.Empty,this.sequenceIndex=0,this.state=E.InTagName,this.stateInTagName(t)}stateCDATASequence(t){t===re.Cdata[this.sequenceIndex]?++this.sequenceIndex===re.Cdata.length&&(this.state=E.InCommentLike,this.currentSequence=re.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.xmlMode?(this.state=E.InDeclaration,this.stateInDeclaration(t)):(this.state=E.InSpecialComment,this.stateInSpecialComment(t)))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}emitComment(t){this.cbs.oncomment(this.sectionStart,this.index,t),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=E.Text}stateInCommentLike(t){!this.xmlMode&&this.currentSequence===re.CommentEnd&&this.sequenceIndex<=1&&this.index===this.sectionStart+this.sequenceIndex&&t===j.Gt?this.emitComment(this.sequenceIndex):this.currentSequence===re.CommentEnd&&this.sequenceIndex===2&&t===j.Gt?this.emitComment(2):this.currentSequence===re.CommentEnd&&this.sequenceIndex===this.currentSequence.length-1&&t!==j.Gt?this.sequenceIndex=+(t===j.Dash):t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===re.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,3),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=E.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!dn(t):CC(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(dn(t)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(t);return}this.sequenceIndex=0}(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===re.TitleEnd||this.currentSequence===re.TextareaEnd?this.decodeEntities&&t===j.Amp&&this.startEntity():this.fastForwardTo(j.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(t===j.Lt)}stateBeforeTagName(t){if(t===j.ExclamationMark)this.state=E.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===j.Questionmark)this.xmlMode?(this.state=E.InProcessingInstruction,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.state=E.InSpecialComment,this.sectionStart=this.index);else if(this.isTagStartChar(t)){this.sectionStart=this.index;const n=this.xmlMode||this.cbs.isInForeignContext?.()?void 0:bC.get(t|32);n===void 0?this.state=E.InTagName:(this.isSpecial=!0,this.currentSequence=n,this.sequenceIndex=3,this.state=E.SpecialStartSequence)}else t===j.Slash?this.state=E.BeforeClosingTagName:(this.state=E.Text,this.stateText(t))}stateInTagName(t){dn(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=E.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){Vt(t)?this.xmlMode||(this.state=E.InSpecialComment,this.sectionStart=this.index):t===j.Gt?(this.state=E.Text,this.xmlMode||(this.sectionStart=this.index+1)):(this.state=this.isTagStartChar(t)?E.InClosingTagName:E.InSpecialComment,this.sectionStart=this.index)}stateInClosingTagName(t){dn(t)&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=E.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===j.Gt||this.fastForwardTo(j.Gt))&&(this.state=E.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===j.Gt?(this.cbs.onopentagend(this.index),this.enterTagBody(),this.sectionStart=this.index+1):t===j.Slash?this.state=E.InSelfClosingTag:Vt(t)||(this.state=E.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){if(t===j.Gt){if(this.cbs.onselfclosingtag(this.index),this.sectionStart=this.index+1,!this.recognizeSelfClosing){this.enterTagBody();return}this.state=E.Text,this.isSpecial=!1,this.currentSequence=re.Empty}else Vt(t)||(this.state=E.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===j.Eq||dn(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=E.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===j.Eq?this.state=E.BeforeAttributeValue:t===j.Slash||t===j.Gt?(this.cbs.onattribend(gt.NoValue,this.sectionStart),this.sectionStart=-1,this.state=E.BeforeAttributeName,this.stateBeforeAttributeName(t)):Vt(t)||(this.cbs.onattribend(gt.NoValue,this.sectionStart),this.state=E.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===j.DoubleQuote?(this.state=E.InAttributeValueDq,this.sectionStart=this.index+1):t===j.SingleQuote?(this.state=E.InAttributeValueSq,this.sectionStart=this.index+1):Vt(t)||(this.sectionStart=this.index,this.state=E.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,n){t===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===j.DoubleQuote?gt.Double:gt.Single,this.index+1),this.state=E.BeforeAttributeName):this.decodeEntities&&t===j.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,j.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,j.SingleQuote)}stateInAttributeValueNoQuotes(t){Vt(t)||t===j.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(gt.Unquoted,this.index),this.state=E.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===j.Amp&&this.startEntity()}stateBeforeDeclaration(t){t===j.OpeningSquareBracket?(this.state=E.CDATASequence,this.sequenceIndex=0):this.xmlMode?this.state=t===j.Dash?E.BeforeComment:E.InDeclaration:(t|32)===re.Doctype[0]?(this.state=E.DeclarationSequence,this.currentSequence=re.Doctype,this.sequenceIndex=1):t===j.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=E.Text,this.sectionStart=this.index+1):t===j.Dash?this.state=E.BeforeComment:this.state=E.InSpecialComment}stateDeclarationSequence(t){this.sequenceIndex===this.currentSequence.length?(this.state=E.InDeclaration,this.stateInDeclaration(t)):(t|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:t===j.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=E.Text,this.sectionStart=this.index+1):this.state=E.InSpecialComment}stateInDeclaration(t){(t===j.Gt||this.fastForwardTo(j.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=E.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){t===j.Questionmark?this.sequenceIndex=1:t===j.Gt&&this.sequenceIndex===1?(this.cbs.onprocessinginstruction(this.sectionStart,this.index-1),this.sequenceIndex=0,this.state=E.Text,this.sectionStart=this.index+1):this.sequenceIndex=Number(this.fastForwardTo(j.Questionmark))}stateBeforeComment(t){t===j.Dash?(this.state=E.InCommentLike,this.currentSequence=re.CommentEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):this.xmlMode?this.state=E.InDeclaration:t===j.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=E.Text,this.sectionStart=this.index+1):this.state=E.InSpecialComment}stateInSpecialComment(t){(t===j.Gt||this.fastForwardTo(j.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=E.Text,this.sectionStart=this.index+1)}startEntity(){this.baseState=this.state,this.state=E.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?pt.Strict:this.baseState===E.Text||this.baseState===E.InSpecialTag?pt.Legacy:pt.Attribute)}stateInEntity(){const t=this.index-this.offset,n=this.entityDecoder.write(this.buffer,t);if(n>=0)this.state=this.baseState,n===0&&(this.index-=1);else{if(t<this.buffer.length&&this.buffer.charCodeAt(t)===j.Amp){this.state=this.baseState,this.index-=1;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===E.Text||this.state===E.InPlainText||this.state===E.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===E.InAttributeValueDq||this.state===E.InAttributeValueSq||this.state===E.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const t=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case E.Text:{this.stateText(t);break}case E.InPlainText:{this.index=this.buffer.length+this.offset-1;break}case E.SpecialStartSequence:{this.stateSpecialStartSequence(t);break}case E.InSpecialTag:{this.stateInSpecialTag(t);break}case E.CDATASequence:{this.stateCDATASequence(t);break}case E.DeclarationSequence:{this.stateDeclarationSequence(t);break}case E.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(t);break}case E.InAttributeName:{this.stateInAttributeName(t);break}case E.InCommentLike:{this.stateInCommentLike(t);break}case E.InSpecialComment:{this.stateInSpecialComment(t);break}case E.BeforeAttributeName:{this.stateBeforeAttributeName(t);break}case E.InTagName:{this.stateInTagName(t);break}case E.InClosingTagName:{this.stateInClosingTagName(t);break}case E.BeforeTagName:{this.stateBeforeTagName(t);break}case E.AfterAttributeName:{this.stateAfterAttributeName(t);break}case E.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(t);break}case E.BeforeAttributeValue:{this.stateBeforeAttributeValue(t);break}case E.BeforeClosingTagName:{this.stateBeforeClosingTagName(t);break}case E.AfterClosingTagName:{this.stateAfterClosingTagName(t);break}case E.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(t);break}case E.InSelfClosingTag:{this.stateInSelfClosingTag(t);break}case E.InDeclaration:{this.stateInDeclaration(t);break}case E.BeforeDeclaration:{this.stateBeforeDeclaration(t);break}case E.BeforeComment:{this.stateBeforeComment(t);break}case E.InProcessingInstruction:{this.stateInProcessingInstruction(t);break}case E.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===E.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingCommentLikeData(t){if(this.state!==E.InCommentLike)return!1;if(this.currentSequence===re.CdataEnd)if(this.xmlMode)this.sectionStart<t&&this.cbs.oncdata(this.sectionStart,t,0);else{const n=this.sectionStart-re.Cdata.length-1;this.cbs.oncomment(n,t,0)}else{const n=this.xmlMode?0:Math.min(this.sequenceIndex,re.CommentEnd.length-1);this.cbs.oncomment(this.sectionStart,t,n)}return!0}handleTrailingMarkupDeclaration(t){if(this.xmlMode)switch(this.state){case E.InSpecialComment:case E.BeforeComment:case E.CDATASequence:case E.DeclarationSequence:case E.InDeclaration:return this.cbs.ontext(this.sectionStart,t),!0;default:return!1}switch(this.state){case E.BeforeDeclaration:case E.InSpecialComment:case E.BeforeComment:case E.CDATASequence:return this.cbs.oncomment(this.sectionStart,t,0),!0;case E.DeclarationSequence:return this.sequenceIndex!==re.Doctype.length&&this.cbs.oncomment(this.sectionStart,t,0),!0;case E.InDeclaration:return!0;default:return!1}}handleTrailingData(){const t=this.buffer.length+this.offset;if(!(this.handleTrailingCommentLikeData(t)||this.handleTrailingMarkupDeclaration(t))&&!(this.sectionStart>=t))switch(this.state){case E.InTagName:case E.BeforeAttributeName:case E.BeforeAttributeValue:case E.AfterAttributeName:case E.InAttributeName:case E.InAttributeValueSq:case E.InAttributeValueDq:case E.InAttributeValueNq:case E.InClosingTagName:break;default:this.cbs.ontext(this.sectionStart,t)}}emitCodePoint(t,n){this.baseState!==E.Text&&this.baseState!==E.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(t)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(t,this.sectionStart))}}const{fromCodePoint:va}=String,hn=new Set(["input","option","optgroup","select","button","datalist","textarea"]),be=new Set(["p"]),fn=new Set(["h1","h2","h3","h4","h5","h6","p"]),ka=new Set(["thead","tbody"]),Ba=new Set(["dd","dt"]),_a=new Set(["rt","rp"]),xC=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["a",new Set(["a"])],["li",new Set(["li"])],["p",be],["h1",fn],["h2",fn],["h3",fn],["h4",fn],["h5",fn],["h6",fn],["select",hn],["input",hn],["output",hn],["button",hn],["datalist",hn],["textarea",hn],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Ba],["dt",Ba],["address",be],["article",be],["aside",be],["blockquote",be],["details",be],["div",be],["dl",be],["fieldset",be],["figcaption",be],["figure",be],["footer",be],["form",be],["header",be],["hr",be],["main",be],["nav",be],["ol",be],["pre",be],["section",be],["table",be],["ul",be],["rt",_a],["rp",_a],["tbody",ka],["tfoot",ka]]),Sa="doctype",wC=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),vC=new Set(["math","svg"]),Ea=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),Da=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);var Et;(function(e){e[e.None=0]="None",e[e.Svg=1]="Svg",e[e.MathML=2]="MathML"})(Et||(Et={}));const kC=/\s|\//;class $c{options;startIndex=0;endIndex=0;openTagStart=0;tagname="";attribname="";attribvalue="";attribs=null;stack=[];foreignContext;cbs;lowerCaseTagNames;lowerCaseAttributeNames;recognizeSelfClosing;htmlMode;tokenizer;buffers=[];bufferOffset=0;writeIndex=0;ended=!1;constructor(t,n={}){this.options=n,this.cbs=t??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=n.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=n.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=n.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(n.Tokenizer??IC)(this.options,this),this.foreignContext=[Et.None],this.cbs.onparserinit?.(this)}ontext(t,n){const r=this.getSlice(t,n);this.endIndex=n-1,this.cbs.ontext?.(r),this.startIndex=n}ontextentity(t,n){this.endIndex=n-1,this.cbs.ontext?.(va(t)),this.startIndex=n}isInForeignContext(){return this.foreignContext[0]!==Et.None}isVoidElement(t){return this.htmlMode&&wC.has(t)}readTagName(t,n){const r=this.lowerCaseTagNames?this.getSlice(t,n).toLowerCase():this.getSlice(t,n);if(!(this.lowerCaseTagNames&&this.htmlMode))return r;if(this.foreignContext[0]===Et.Svg)return Da.get(r)??r;if(this.foreignContext.length>1){const i=Da.get(r);if(i!==void 0&&this.stack.includes(i))return i}return this.isInForeignContext()?r:r==="image"?"img":r}onopentagname(t,n){this.endIndex=n,this.emitOpenTag(this.readTagName(t,n))}emitOpenTag(t){if(this.openTagStart=this.startIndex,this.tagname=t,this.htmlMode&&t==="form"&&this.stack.includes("form")){this.tagname="";return}const n=this.htmlMode&&xC.get(t);if(n)for(;this.stack.length>0&&n.has(this.stack[0]);)this.popElement(!0);this.isVoidElement(t)||(this.stack.unshift(t),this.htmlMode&&(t==="svg"?this.foreignContext.unshift(Et.Svg):t==="math"?this.foreignContext.unshift(Et.MathML):Ea.has(t)&&this.foreignContext.unshift(Et.None))),this.cbs.onopentagname?.(t),this.cbs.onopentag&&(this.attribs={})}endOpenTag(t){this.startIndex=this.openTagStart,this.attribs&&(this.cbs.onopentag?.(this.tagname,this.attribs,t),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(t){this.endIndex=t,this.endOpenTag(!1),this.startIndex=t+1}onclosetag(t,n){this.endIndex=n;const r=this.readTagName(t,n);if(this.isVoidElement(r))this.htmlMode&&r==="br"&&(this.cbs.onopentagname?.("br"),this.cbs.onopentag?.("br",{},!0),this.cbs.onclosetag?.("br",!1));else{const i=this.stack.indexOf(r);if(i!==-1){for(let s=0;s<i;s++)this.popElement(!0);this.popElement(!1)}else this.htmlMode&&r==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(t){this.endIndex=t,this.recognizeSelfClosing||this.isInForeignContext()?(this.closeCurrentTag(!1),this.startIndex=t+1):this.onopentagend(t)}popElement(t){const n=this.stack.shift();this.htmlMode&&(vC.has(n)||Ea.has(n))&&this.foreignContext.shift(),this.cbs.onclosetag?.(n,t)}closeCurrentTag(t){const n=this.tagname;this.endOpenTag(t),this.stack[0]===n&&this.popElement(!t)}onattribname(t,n){this.startIndex=t;const r=this.getSlice(t,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(t,n){this.attribvalue+=this.getSlice(t,n)}onattribentity(t){this.attribvalue+=va(t)}onattribend(t,n){this.endIndex=n,this.cbs.onattribute?.(this.attribname,this.attribvalue,t===gt.Double?'"':t===gt.Single?"'":t===gt.NoValue?void 0:null),this.attribs&&!Object.hasOwn(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(t){const n=t.search(kC);let r=n<0?t:t.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(t,n){this.endIndex=n;const r=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const i=this.htmlMode?this.lowerCaseTagNames?Sa:r.slice(0,Sa.length):this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(t,n){this.endIndex=n;const r=this.getSlice(t,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(t,n,r){this.endIndex=n,this.cbs.oncomment?.(this.getSlice(t,n-r)),this.cbs.oncommentend?.(),this.startIndex=n+1}oncdata(t,n,r){this.endIndex=n;const i=this.getSlice(t,n-r);!this.htmlMode||this.options.recognizeCDATA?(this.cbs.oncdatastart?.(),this.cbs.ontext?.(i),this.cbs.oncdataend?.()):this.isInForeignContext()?this.cbs.ontext?.(i):(this.cbs.oncomment?.(`[CDATA[${i}]]`),this.cbs.oncommentend?.()),this.startIndex=n+1}onend(){if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let t=0;t<this.stack.length;t++)this.cbs.onclosetag(this.stack[t],!0)}this.cbs.onend?.()}reset(){this.cbs.onreset?.(),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,this.cbs.onparserinit?.(this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(Et.None),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(t){this.reset(),this.end(t)}getSlice(t,n){if(t===n)return"";for(;t-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(t-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(t){if(this.ended){this.cbs.onerror?.(new Error(".write() after done!"));return}this.buffers.push(t),this.tokenizer.running&&(this.tokenizer.write(t),this.writeIndex++)}end(t){if(this.ended){this.cbs.onerror?.(new Error(".end() after done!"));return}t&&this.write(t),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}}const ws=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Xc(e,t=!1){const n={$:{html:1,block:t?0:1}};for(const r in e){const i=e[r];i===""?n[`:${r}`]="true":n[r]=i}return n}function Fa(e){const t=e.trim();if(!t.startsWith("<"))return null;const n=t.match(/^<\/([a-z][a-z0-9]*)\s*>/i);if(n)return{tag:n[1].toLowerCase(),attrs:{},isVoid:!1,isClose:!0};let r=null;const i=new $c({onopentag(s,o){r={tag:s,attrs:Xc(o,!0),isVoid:ws.has(s),isClose:!1}}},{decodeEntities:!1});return i.write(t),i.end(),r}function no(e){const t=[],n=[],r=new $c({onopentag(i,s){const o=Xc(s);if(ws.has(i)){const a=[i,o];n.length>0?n[n.length-1].children.push(a):t.push(a);return}n.push({tag:i,attrs:o,children:[]})},ontext(i){const s=i.trim();s&&(n.length>0?n[n.length-1].children.push(s):t.push(s))},onclosetag(i){if(ws.has(i))return;let s=n.length-1;for(;s>=0&&n[s].tag!==i;)s--;if(s>=0)for(;n.length>s;){const o=n.pop(),a=o.children.length>0?[o.tag,o.attrs,...o.children]:[o.tag,o.attrs];n.length>0?n[n.length-1].children.push(a):t.push(a)}},oncomment(i){const s=[null,{},i];n.length>0?n[n.length-1].children.push(s):t.push(s)}},{decodeEntities:!0});return r.write(e.trim()),r.end(),t}const BC={blockquote_open:"blockquote",ordered_list_open:"ol",bullet_list_open:"ul",list_item_open:"li",paragraph_open:"p",table_open:"table",thead_open:"thead",tbody_open:"tbody",tr_open:"tr",th_open:"th",td_open:"td"},_C={strong_open:"strong",em_open:"em",s_open:"del",sub_open:"del"};function SC(e,t={startLine:0,preservePositions:!1}){const n={headingSlugCounts:new Map,preservePositions:t.preservePositions},r=[];let i=0,s=t.startLine;for(;i<e.length;){const o=ro(e,i,!1,n);if(o.node){if(t.preservePositions){for(let a=i;a<o.nextIndex;a++)e[a].map&&e[a].map[1]&&(s=e[a].map[1]+t.startLine+(e[a].type?.endsWith("_close")?1:0));o.node[1].$||(o.node[1].$={}),o.node[1].$.line=s}r.push(o.node)}i=o.nextIndex}return r}function Nt(e,t={}){const{handleBoolean:n=!0,handleJSON:r=!0,filterEmpty:i=!1}=t,s={};if(!e||!Array.isArray(e))return s;for(const o of e)if(Array.isArray(o)&&o.length>=2){const[a]=o;let l=o[1];if(i&&(l===""||l===null||l===void 0))continue;if(n&&!a.startsWith(":")&&!a.startsWith("#")&&!a.startsWith(".")&&(!l||l==="true"||l==="")){s[`:${a}`]="true";continue}if(r&&typeof l=="string"){if(l.startsWith("{")&&l.endsWith("}"))try{l=JSON.parse(l)}catch{}else if(l.startsWith("[")&&l.endsWith("]"))try{l=JSON.parse(l)}catch{}}a==="class"&&typeof s[a]=="string"?s[a]=`${s[a]} ${l}`:s[a]=l}return s}function EC(e){if(!e)return{language:""};const t={language:""};let n=e.trim();const r=n.match(/^([^\s[{]+)/);for(r&&(t.language=r[1],n=n.slice(r[1].length).trim());n&&(n.startsWith("{")||n.startsWith("["));)if(n.startsWith("{")){const i=n.match(/^\{([^}]+)\}/);if(i){const s=i[1];n=n.slice(i[0].length).trim();const o=[],a=s.split(",");for(const l of a){const c=l.trim();if(c.includes("-")){const[A,u]=c.split("-").map(d=>Number.parseInt(d.trim(),10));if(!Number.isNaN(A)&&!Number.isNaN(u))for(let d=A;d<=u;d++)o.push(d)}else{const A=Number.parseInt(c,10);Number.isNaN(A)||o.push(A)}}o.length>0&&(t.highlights=o)}else break}else if(n.startsWith("[")){let i=0,s=0;for(;s<n.length;s++)if(n[s]==="[")i++;else if(n[s]==="]"&&(i--,i===0)){const o=n.slice(1,s);t.filename=o.replace(/\\\\/g,""),n=n.slice(s+1).trim();break}if(i!==0)break}return n&&(t.meta=n),t}function Kt(e,t,n=!0){let r=t;if(n)for(;r<e.length&&e[r].type==="text"&&!e[r].content?.trim();)r++;if(r<e.length&&e[r].type==="mdc_inline_props"){const i=e[r];return{attrs:Nt(i.attrs),nextIndex:r+1}}return{attrs:{},nextIndex:t}}function ro(e,t,n=!1,r){const i=e[t];if(i.type==="hr")return{node:["hr",{}],nextIndex:t+1};if(i.type==="html_block"){const l=i.content?.trim()||"";if(l.startsWith("<!--")){const d=l.endsWith("-->")?l.slice(4,-3):l.slice(4);return{node:[null,{},d],nextIndex:t+1}}const c=Rr(e,t+1,"html_block_close",!1,!1,!1,r),[A]=no(l);return A?{node:[A[0],A[1],...c.nodes],nextIndex:c.nextIndex+1}:{node:null,nextIndex:t+1}}if(i.type==="mdc_block_open"){const l=i.tag||"component",c=Nt(i.attrs),A=DC(e,t+1,"mdc_block_close",r);return{node:[l,c,...A.nodes],nextIndex:A.nextIndex+1}}if(i.type==="mdc_block_shorthand"){let l=t+1;const c=i.tag||"component",A=Nt(i.attrs,{handleJSON:!1}),u=[];if(i.nesting===1)for(;l<e.length;){const d=e[l];if(l++,d.type==="mdc_block_shorthand"&&d.nesting===-1)break;if(d.type==="inline"){const f=so(d.children||[],!1);u.push(...f)}}return{node:[c,A,...u],nextIndex:l}}if(i.type==="math_block")return{node:["math",{class:"math block",content:i.content},i.content],nextIndex:t+1};if(i.type==="fence"||i.type==="fenced_code_block"||i.type==="code_block"){const l=i.content||"",c=i.info||i.params||"",A=EC(c),u={};A.language&&A.language.trim()&&(u.language=A.language),A.filename&&(u.filename=A.filename),A.highlights&&(u.highlights=A.highlights),A.meta&&(u.meta=A.meta);const d={};A.language&&A.language.trim()&&(d.class=`language-${A.language}`);const f=l.endsWith(`
|
|
52
|
-
`)?l.slice(0,-1):l;return{node:["pre",u,["code",d,f]],nextIndex:t+1}}if(i.type==="heading_open"){const c=`h${i.tag.replace("h","")}`,A=Rr(e,t+1,"heading_close",!0,!0,n,r);if(A.nodes.length>0){const u=eu(A.nodes),d=NC(FC(u),r);return{node:[c,{id:d},...A.nodes],nextIndex:A.nextIndex+1}}return{node:null,nextIndex:A.nextIndex+1}}if(i.type==="list_item_open"){const l=Nt(i.attrs,{handleBoolean:!1,handleJSON:!1}),c=Rr(e,t+1,"list_item_close",!1,!1,!0,r),A=[];for(const u of c.nodes)Array.isArray(u)&&u[0]==="p"?A.push(...u.slice(2)):A.push(u);return A.length>0?{node:["li",l,...A],nextIndex:c.nextIndex+1}:{node:null,nextIndex:c.nextIndex+1}}const s=BC[i.type];if(s){const l=Nt(i.attrs,{handleBoolean:!1,handleJSON:!1}),c=i.type.replace("_open","_close"),A=["td","th"].includes(s),u=Rr(e,t+1,c,!1,!1,A,r);return{node:[s,l,...u.nodes],nextIndex:u.nextIndex+1}}const o=i.tag||"component",a=Nt(i.attrs,{handleBoolean:!1,handleJSON:!1});return{node:[o,a],nextIndex:t+1}}function DC(e,t,n,r){const i=[];let s=t,o=null,a=[];for(;s<e.length&&e[s].type!==n;){const l=e[s];if(l.type==="html_block"){const A=no(l.content);o!==null?a.push(...A):i.push(...A),s++;continue}if(l.type==="mdc_block_slot"){if(l.attrs&&Array.isArray(l.attrs)&&l.attrs.length>0){const A=l.attrs[0];if(Array.isArray(A)&&A.length>0){const u=A[0];if(u.startsWith("#")){const d=u.substring(1);o!==null&&a.length>0&&(i.push(["template",{name:o},...a]),a=[]),o=d,s++;continue}}}s++;continue}const c=ro(e,s,!1,r);s=c.nextIndex,c.node&&(o!==null?a.push(c.node):i.push(c.node))}return o!==null&&a.length>0&&i.push(["template",{name:o},...a]),{nodes:i,nextIndex:s}}function Rr(e,t,n,r,i=!1,s=!1,o){const a=[];let l=t;for(;l<e.length&&e[l].type!==n;){const c=e[l];if(c.type==="html_block"){a.push(...no(c.content)),l++;continue}if(c.type==="inline"){const A=so(c.children||[],i);a.push(...A),l++}else if(c.type==="hardbreak"||c.type==="hard_break")a.push(["br",{}]),l++;else if(c.type==="softbreak")a.push(`
|
|
53
|
-
`),l++;else if(r&&(c.type==="text"||c.type==="code_inline"))c.content&&a.push(c.content),l++;else{const A=ro(e,l,s,o);l=A.nextIndex,A.node&&a.push(A.node)}}return{nodes:io(a),nextIndex:l}}function io(e){const t=[];for(const n of e){const r=t[t.length-1];typeof n=="string"&&typeof r=="string"?t[t.length-1]=r+n:t.push(n)}return t}function eu(e){let t="";for(const n of e)if(typeof n=="string")t+=n;else if(Array.isArray(n)){const r=n[0],i=n.slice(2);if(r==="br"||r==="html_inline")continue;t+=" "+r+" ",i.length>0&&(t+=eu(i))}return t}function FC(e){let t=e.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return/^\d/.test(t)&&(t="_"+t),t}function NC(e,t){if(!t)return e;const n=t.headingSlugCounts.get(e)??0;return t.headingSlugCounts.set(e,n+1),n===0?e:`${e}-${n}`}function so(e,t=!1){const n=[];let r=0;for(;r<e.length;){const i=e[r];if(i.type==="mdc_inline_props"&&i.hidden){r++;continue}const s=er(e,r,t);r=s.nextIndex,s.node&&n.push(s.node)}return io(n)}function er(e,t,n=!1){const r=e[t];if(r.type==="text")return{node:r.content||null,nextIndex:t+1};if(r.type==="emoji")return{node:r.content||null,nextIndex:t+1};if(r.type==="html_inline"){const s=r.content||"",o=Fa(s);if(!o)return{node:s||null,nextIndex:t+1};if(o.isClose)return{node:null,nextIndex:t+1};if(o.isVoid)return{node:[o.tag,o.attrs],nextIndex:t+1};const a=[];let l=t+1;for(;l<e.length;){const A=e[l];if(A.type==="html_inline"){const d=Fa(A.content||"");if(d?.isClose&&d.tag===o.tag){l++;break}}const u=er(e,l,n);l=u.nextIndex,u.node&&a.push(u.node)}return{node:a.length>0?[o.tag,o.attrs,...a]:[o.tag,o.attrs],nextIndex:l}}if(r.type==="mdc_inline_span"&&r.nesting===1){const s={};let o=t+1;const a=[];for(;o<e.length;){const A=e[o];if(A.type==="mdc_inline_span"&&A.nesting===-1)break;if(A.type==="text"&&!A.content?.trim()){o++;continue}const u=er(e,o,n);o=u.nextIndex,u.node&&a.push(u.node)}const{attrs:l,nextIndex:c}=Kt(e,o+1);return Object.assign(s,l),a.length>0||Object.keys(s).length>0?{node:["span",s,...a],nextIndex:c}:{node:null,nextIndex:c}}if(r.type==="mdc_inline_span"&&r.nesting===-1)return{node:null,nextIndex:t+1};if(r.type==="code_inline"){const{attrs:s,nextIndex:o}=Kt(e,t+1);return r.content?{node:["code",s,r.content],nextIndex:o}:{node:null,nextIndex:o}}if(r.type==="hardbreak"||r.type==="hard_break")return{node:["br",{}],nextIndex:t+1};if(r.type==="softbreak")return{node:`
|
|
54
|
-
`,nextIndex:t+1};if(r.type==="mdc_inline_component"){const s=r.tag||"component";if(r.nesting===1){const o=[];let a=t+1;for(;a<e.length;){const l=e[a];if(l.type==="mdc_inline_component"&&l.nesting===-1){const{attrs:A,nextIndex:u}=Kt(e,a+1,!1);return{node:[s,A,...o],nextIndex:u}}const c=er(e,a,n);a=c.nextIndex,c.node&&o.push(c.node)}return{node:[s,{},...o],nextIndex:a}}else{if(r.nesting===-1)return{node:null,nextIndex:t+1};{const o={},{attrs:a,nextIndex:l}=Kt(e,t+1,!1);Object.assign(o,a);const c=Nt(r.attrs,{handleBoolean:!1});Object.assign(o,c);const A=Object.keys(a).length>0?l:t+1;return{node:[s,o],nextIndex:A}}}}if(r.type==="image"){const s=Nt(r.attrs,{handleBoolean:!1,handleJSON:!1,filterEmpty:!0});r.content&&(s.alt=r.content);const{attrs:o,nextIndex:a}=Kt(e,t+1);return Object.assign(s,o),{node:["img",s],nextIndex:a}}if(r.type==="link_open"){const s=Nt(r.attrs,{handleBoolean:!1,handleJSON:!1}),o=Na(e,t+1,"link_close",n),{attrs:a,nextIndex:l}=Kt(e,o.nextIndex+1);return Object.assign(s,a),o.nodes.length>0?{node:["a",s,...o.nodes],nextIndex:l}:{node:null,nextIndex:l}}if(r.type==="math_inline")return{node:["math",{class:"math inline",content:r.content},r.content],nextIndex:t+1};const i=_C[r.type];if(i){const s=r.type.replace("_open","_close"),o=Na(e,t+1,s,n),{attrs:a,nextIndex:l}=Kt(e,o.nextIndex+1);return o.nodes.length>0?{node:[i,a,...o.nodes],nextIndex:l}:{node:null,nextIndex:l}}if(r.children){const s=so(r.children,n);return{node:s.length===1?s[0]:null,nextIndex:t+1}}return{node:null,nextIndex:t+1}}function Na(e,t,n,r=!1){const i=[];let s=t;for(;s<e.length;){const o=e[s];if(o.type===n){if(n==="mdc_inline_span"&&o.nesting===-1)break;if(n!=="mdc_inline_span")break}if(o.type==="mdc_inline_props"&&o.hidden){s++;continue}if(o.type==="mdc_inline_component"&&r){const l=o.tag||"component",c={},{attrs:A,nextIndex:u}=Kt(e,s+1,!1);Object.assign(c,A),Object.keys(A).length>0?s=u:s++,i.push([l,c]);continue}const a=er(e,s,r);s=a.nextIndex,a.node&&i.push(a.node)}return{nodes:io(i),nextIndex:s}}function QC(e){return jc(e,{schema:Hc})}const Qa="---",GC=`
|
|
55
|
-
`,RC="\r";function MC(e){let t={};if(e.startsWith(Qa)){const n=e.indexOf(GC+Qa);if(n!==-1){const r=e[n-1]===RC,i=e.slice(4,n-(r?1:0));i&&(t=QC(i),e=e.slice(n+4+(r?1:0)))}}return{content:e,data:t}}function WC(e,t){let n=-1,r=t.nodes.length-1,i=!1;for(;r>=0;){const o=t.nodes[r];if(o[1]&&o[1].$?.line)if(i){n=r;break}else i=!0;r--}const s=n!==-1?t.nodes[n]:null;if(s){const o=s[1].$?.line??0;return{remainingMarkdownStartLine:o,reusedNodes:t.nodes.slice(0,n+1),remainingMarkdown:e.split(`
|
|
56
|
-
`).slice(o).join(`
|
|
57
|
-
`)||""}}return{remainingMarkdownStartLine:0,remainingMarkdown:e,reusedNodes:[]}}const KC=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],TC="[a-zA-Z_:][a-zA-Z0-9:._-]*",YC="[^\"'=<>`\\x00-\\x20]+",LC="'[^']*'",PC='"[^"]*"',OC=`(?:${YC}|${LC}|${PC})`,JC=`(?:\\s+${TC}(?:\\s*=\\s*${OC})?)`,tu=`<[A-Za-z][A-Za-z0-9\\-]*${JC}*\\s*\\/?>`,nu="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",UC="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",ZC="<\\?[\\s\\S]*?\\?>",HC="<![A-Za-z][^>]*>",jC="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",qC=new RegExp(`^(?:${tu}|${nu}|${UC}|${ZC}|${HC}|${jC})`),Ga=new RegExp(`^(?:${tu}|${nu})`),pn=[[new RegExp(`${Ga.source}\\s*$`),/^<\/[^>]+>$/,!0],[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${KC.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Ga.source}\\s*$`),/^$/,!1]];function zC(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,s),a=0;for(;a<pn.length&&!pn[a][0].test(o);a++);if(a===pn.length)return!1;if(r)return pn[a][2];let l=t+1;if(a!==0&&!pn[a][1].test(o)){for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(i=e.bMarks[l]+e.tShift[l],s=e.eMarks[l],o=e.src.slice(i,s),pn[a][1].test(o)){o.length!==0&&l++;break}}e.line=l;const c=o.startsWith("</")?e.push("html_block_close","",-1):e.push("html_block","",1);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0}function VC(e){return/^<a[>\s]/i.test(e)}function $C(e){return/^<\/a\s*>/i.test(e)}function XC(e){const t=e|32;return t>=97&&t<=122}function eb(e,t){const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!XC(i))return!1;const s=e.src.slice(r).match(qC);if(!s)return!1;if(!t){const o=e.push("html_inline","",0);o.content=s[0],VC(o.content)&&e.linkLevel++,$C(o.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}function tb(e={}){const{autoUnwrap:t=!0,autoClose:n=!0,plugins:r=[]}=e;r.unshift(aC()),r.unshift(yC());const i=new i0({html:!1,linkify:!0}).enable(["table","strikethrough"]).use(nC);e.html!==!1&&(i.inline.ruler.before("text","comark_html_inline",eb),i.block.ruler.before("html_block","comark_html_block",zC,{alt:["paragraph","reference","blockquote"]}));for(const a of r)for(const l of a.markdownItPlugins||[])i.use(l);let s=null,o=null;return async(a,l={})=>{const c={options:e,tokens:[],markdown:a,tree:null,parsedLines:0,reusableNodes:[]},A=s;if(l.streaming&&A&&a.startsWith(o??"")){const{remainingMarkdownStartLine:h,reusedNodes:y,remainingMarkdown:C}=WC(a,A);if(!C)return A;c.parsedLines=h,c.markdown=C,c.reusableNodes=y}n&&(c.markdown=hp(c.markdown));for(const h of e.plugins||[])await h.pre?.(c);const{content:u,data:d}=await MC(c.markdown);c.tokens=i.parse(u,{});let f=SC(c.tokens,{startLine:c.parsedLines,preservePositions:l.streaming??!1});t&&(f=f.map(h=>uc(h))),l.streaming?(c.tree={frontmatter:c.parsedLines>0?A?.frontmatter??d:d,meta:{},nodes:[...c.reusableNodes,...f]},s=c.tree,o=a):(c.tree={frontmatter:d,meta:{},nodes:f},s=null,o=null);for(const h of r||[])await h.post?.(c);return c.tree}}function nb(e={}){return rC(tb(e))}const Ra=" ",Ma="background-color: currentColor; display: inline-block; margin-left: 0.25rem; margin-right: 0.25rem; animation: pulse 0.75s cubic-bezier(0.4,0,0.6,1) infinite;";function rb(e){if(e===!0)return["span",{key:"stream-caret",style:Ma},Ra];if(typeof e=="object"){const t=e?.class||"";return["span",{key:"stream-caret",style:Ma,...t?{class:t}:{}},Ra]}return null}function ru(e,t){for(let n=e.length-1;n>=2;n--){const r=e[n];if(typeof r=="string"&&e[1]?.key!=="stream-caret")return e.push(t),!0;if(Array.isArray(r)&&ru(r,t))return!0}return!1}const ts=new Map,ib=e=>e.replace(/-(\w)/g,(t,n)=>n?n.toUpperCase():""),sb=e=>e.charAt(0).toUpperCase()+e.slice(1),ob=e=>sb(ib(e));function Wa(e){return Array.isArray(e)&&e.length>=1?e[0]:null}function Ka(e){return Array.isArray(e)&&e.length>=2?e[1]||{}:{}}function ab(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;try{return JSON.parse(e)}catch{}return e}function Ta(e){return Array.isArray(e)&&e.length>2?e.slice(2):[]}function Ya(e,t,n){const r=hd()?.appContext?.components,i=ob(e),s=`Prose${i}`;let o=t[s]||t[e]||t[i]||r?.[s]||r?.[i];if(!o&&n){const a=e;if(!ts.has(a)){const l=n(e);l&&ts.set(a,fd(()=>l))}o=ts.get(a)}return o}function vs(e,t={},n,r,i){if(typeof e=="string")return e;if(Array.isArray(e)){const s=Wa(e);if(!s)return null;const o=Ka(e),a=Ta(e);let l;i?.[0]!=="pre"&&(o.as&&(l=Ya(o.as,t,r)),l||(l=Ya(s,t,r)));const c=l||s,A={};for(const f in o)f!=="$"&&(f==="className"?A.class=o[f]:f.charCodeAt(0)===58?A[f.substring(1)]=ab(o[f]):A[f]=o[f]);if((c?.props?.__node||c?.__asyncResolved?.props?.__node)&&(A.__node=e),n!==void 0&&(A.key=n),e.length===2)return Ne(c,A);const u={},d=[];for(let f=0;f<a.length;f++){const h=a[f];if(h==null)continue;const y=Wa(h),C=Ka(h);if(y==="template"&&C){let p;if(C.name)p=C.name;else for(const b in C)if(b.startsWith("v-slot:")){p=b.substring(7);break}if(p){const b=Ta(h);u[p]=()=>b.map((I,k)=>vs(I,t,k,r,e)).filter(I=>I!==null);continue}}const x=vs(h,t,f,r,e);x!==null&&d.push(x)}return l?(d.length>0&&(u.default=()=>d),Ne(c,A,u)):Ne(c,A,d)}return null}const lb=he({name:"ComarkRenderer",props:{tree:{type:Object,required:!0},components:{type:Object,default:()=>({})},componentsManifest:{type:Function,default:void 0},streaming:{type:Boolean,default:!1},caret:{type:[Boolean,Object],default:!1}},async setup(e){const t=P(new Set);ud((o,a,l)=>{const c=a?.$?.type?.name||a?.type?.name||"unknown";return t.value.add(c),!1});const n=Ad("comark",{components:{},componentManifest:()=>null}),r=G(()=>({...n?.components,...e.components})),i=o=>{let a=e.componentsManifest?.(o);return a||(a=n?.componentManifest(o)),a||null},s=G(()=>rb(e.caret||!1));return()=>{const o=dd(e.tree.nodes||[])||[];e.streaming&&s.value&&o.length>0&&(ru(o[o.length-1],s.value)||o.push(s.value));const a=o.map((l,c)=>vs(l,r.value,c,i)).filter(l=>l!==null);return Ne("div",{class:"comark-content"},a)}}}),cb=he({name:"Comark",props:{markdown:{type:String,default:void 0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},components:{type:Object,default:()=>({})},componentsManifest:{type:Function,default:void 0},streaming:{type:Boolean,default:!1},summary:{type:Boolean,default:!1},caret:{type:[Boolean,Object],default:!1}},async setup(e,t){const n=G(()=>{let s=e.markdown;const o=t.slots.default?.();return o&&o.length>0&&typeof o[0].children=="string"&&(s=o[0].children),e.summary&&(s=s?.split("<!-- more -->")[0]),(s||"").trim()}),r=pd(null),i=nb({...e.options,plugins:e.plugins});return Ye(()=>[n.value,e.streaming],()=>i(n.value,{streaming:e.streaming}).then(s=>r.value=s)),await i(n.value,{streaming:e.streaming}).then(s=>r.value=s),()=>Ne(lb,{tree:r.value||{nodes:[],frontmatter:{},meta:{}},components:e.components,streaming:e.streaming,componentsManifest:e.componentsManifest,class:e.streaming?"comark-stream":"",caret:e.caret})}});let Te=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function ub(e){return oo(e)}function oo(e){return Array.isArray(e)?Ab(e):e instanceof RegExp?e:typeof e=="object"?db(e):e}function Ab(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=oo(e[n]);return t}function db(e){let t={};for(let n in e)t[n]=oo(e[n]);return t}function iu(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function su(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?su(e.substring(0,e.length-1)):e.substr(~t+1)}var ns=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Mr=class{static hasCaptures(e){return e===null?!1:(ns.lastIndex=0,ns.test(e))}static replaceCaptures(e,t,n){return e.replace(ns,(r,i,s,o)=>{let a=n[parseInt(i||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function ou(e,t){return e<t?-1:e>t?1:0}function au(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let s=ou(e[i],t[i]);if(s!==0)return s}return 0}return n-r}function La(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function lu(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var cu=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},ei=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(pb(e),t)}static createFromParsedTheme(e,t){return mb(e,t)}_cachedMatchRoot=new cu(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>hb(e.parent,i.parentScopes));return r?new uu(r.fontStyle,r.foreground,r.background):null}},rs=class Pr{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Pr(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Pr(n,t[r]);return n}push(t){return new Pr(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function hb(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!fb(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function fb(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var uu=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function pb(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,s=t.length;i<s;i++){let o=t[i];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let u=o.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),a=u.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let u=o.settings.fontStyle.split(" ");for(let d=0,f=u.length;d<f;d++)switch(u[d]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof o.settings.foreground=="string"&&La(o.settings.foreground)&&(c=o.settings.foreground);let A=null;typeof o.settings.background=="string"&&La(o.settings.background)&&(A=o.settings.background);for(let u=0,d=a.length;u<d;u++){let h=a[u].trim().split(" "),y=h[h.length-1],C=null;h.length>1&&(C=h.slice(0,h.length-1),C.reverse()),n[r++]=new gb(y,C,i,l,c,A)}}return n}var gb=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Le=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Le||{});function mb(e,t){e.sort((l,c)=>{let A=ou(l.scope,c.scope);return A!==0||(A=au(l.parentScopes,c.parentScopes),A!==0)?A:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new yb(t),o=new uu(n,s.getId(r),s.getId(i)),a=new bb(new ks(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let A=e[l];a.insert(0,A.scope,A.parentScopes,A.fontStyle,s.getId(A.foreground),s.getId(A.background))}return new ei(s,o,a)}var yb=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Cb=Object.freeze([]),ks=class Au{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,i,s){this.scopeDepth=t,this.parentScopes=n||Cb,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new Au(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},bb=class Bs{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-t.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,s;if(r===-1?(i=t,s=""):(i=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Bs._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(n===""){this._doInsertHere(t,r,i,s,o);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let A;this._children.hasOwnProperty(l)?A=this._children[l]:(A=new Bs(this._mainRule.clone(),ks.cloneArr(this._rulesWithParentScopes)),this._children[l]=A),A.insert(t+1,c,r,i,s,o)}_doInsertHere(t,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(t,r,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let l=this._rulesWithParentScopes[o];if(au(l.parentScopes,n)===0){l.acceptOverwrite(t,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new ks(t,n,r,i,s))}},Nn=class it{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=it.getLanguageId(t),r=it.getTokenType(t),i=it.getFontStyle(t),s=it.getForeground(t),o=it.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,s,o,a){let l=it.getLanguageId(t),c=it.getTokenType(t),A=it.containsBalancedBrackets(t)?1:0,u=it.getFontStyle(t),d=it.getForeground(t),f=it.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(A=i?1:0),s!==-1&&(u=s),o!==0&&(d=o),a!==0&&(f=a),(l<<0|c<<8|A<<10|u<<11|d<<15|f<<24)>>>0}};function ti(e,t){const n=[],r=Ib(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Pa(i)){const l=[];do l.push(i),i=r.next();while(Pa(i));return c=>t(l,c)}return null}function o(){const l=[];let c=s();for(;c;)l.push(c),c=s();return A=>l.every(u=>u(A))}function a(){const l=[];let c=o();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return A=>l.some(u=>u(A))}}function Pa(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ib(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function du(e){typeof e.dispose=="function"&&e.dispose()}var Ar=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},xb=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},wb=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},vb=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ar(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new wb;for(const n of e)kb(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ar){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function kb(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Ar?Or({baseGrammar:s,selfGrammar:i},r):_s(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const a of o)r.add(new Ar(a))}function _s(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];ni([r],t,n)}}function Or(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ni(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ni(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ni(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?iu({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ni(r.patterns,{...t,repository:i},n);const s=r.include;if(!s)continue;const o=hu(s);switch(o.kind){case 0:Or({...t,selfGrammar:t.baseGrammar},n);break;case 1:Or(t,n);break;case 2:_s(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};o.kind===4?_s(o.ruleName,l,n):Or(l,n)}else o.kind===4?n.add(new xb(o.scopeName,o.ruleName)):n.add(new Ar(o.scopeName));break}}}var Bb=class{kind=0},_b=class{kind=1},Sb=class{constructor(e){this.ruleName=e}kind=2},Eb=class{constructor(e){this.scopeName=e}kind=3},Db=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function hu(e){if(e==="$base")return new Bb;if(e==="$self")return new _b;const t=e.indexOf("#");if(t===-1)return new Eb(e);if(t===0)return new Sb(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new Db(n,r)}}var Fb=/\\(\d+)/,Oa=/\\(\d+)/g,Nb=-1,fu=-2;var br=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Mr.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Mr.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${su(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Mr.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Mr.replaceCaptures(this._contentName,e,t)}},Qb=class extends br{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Gb=class extends br{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new dr(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ja=class extends br{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ss=class extends br{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new dr(i,this.id),this.beginCaptures=s,this._end=new dr(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hr;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},ri=class extends br{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new dr(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new dr(o,fu),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hr;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new hr,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},pu=class Ke{static createCaptureRule(t,n,r,i,s){return t.registerRule(o=>new Qb(n,o,r,i,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Gb(t.$vscodeTextmateLocation,t.id,t.name,t.match,Ke._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=iu({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Ja(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Ke._compilePatterns(s,n,r))}return t.while?new ri(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Ke._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Ke._compileCaptures(t.whileCaptures||t.captures,n,r),Ke._compilePatterns(t.patterns,n,r)):new Ss(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Ke._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Ke._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Ke._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;t[o].patterns&&(l=Ke.getCompiledRuleId(t[o],n,r)),i[a]=Ke.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s];let l=-1;if(a.include){const c=hu(a.include);switch(c.kind){case 0:case 1:l=Ke.getCompiledRuleId(r[a.include],n,r);break;case 2:let A=r[c.ruleName];A&&(l=Ke.getCompiledRuleId(A,n,r));break;case 3:case 4:const u=c.scopeName,d=c.kind===4?c.ruleName:null,f=n.getExternalGrammar(u,r);if(f)if(d){let h=f.repository[d];h&&(l=Ke.getCompiledRuleId(h,n,f.repository))}else l=Ke.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=Ke.getCompiledRuleId(a,n,r);if(l!==-1){const c=n.getRule(l);let A=!1;if((c instanceof Ja||c instanceof Ss||c instanceof ri)&&c.hasMissingPatterns&&c.patterns.length===0&&(A=!0),A)continue;i.push(l)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},dr=class gu{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let i=0,s=[],o=!1;for(let a=0;a<r;a++)if(t.charAt(a)==="\\"&&a+1<r){const c=t.charAt(a+1);c==="z"?(s.push(t.substring(i,a)),s.push("$(?!\\n)(?<!\\n)"),i=a+2):(c==="A"||c==="G")&&(o=!0),a++}this.hasAnchor=o,i===0?this.source=t:(s.push(t.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Fb.test(this.source):this.hasBackReferences=!1}clone(){return new gu(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return Oa.lastIndex=0,this.source.replace(Oa,(i,s)=>lu(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],s,o,a,l;for(s=0,o=this.source.length;s<o;s++)a=this.source.charAt(s),t[s]=a,n[s]=a,r[s]=a,i[s]=a,a==="\\"&&s+1<o&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="",n[s+1]="",r[s+1]="A",i[s+1]="A"):l==="G"?(t[s+1]="",n[s+1]="G",r[s+1]="",i[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,i[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},hr=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Ua(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new Ua(e,r,this._items.map(i=>i.ruleId))}},Ua=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
58
|
-
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},is=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Rb=class Es{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new is(t,8),this._embeddedLanguagesMatcher=new Mb(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Es._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new is(0,0);_getBasicScopeAttributes=new cu(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new is(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Es.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Mb=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>lu(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Za=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function mu(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,A=-1;if(o){const f=Wb(e,t,n,r,i,s);i=f.stack,r=f.linePos,n=f.isFirstLine,A=f.anchorPosition}const u=Date.now();for(;!c;){if(a!==0&&Date.now()-u>a)return new Za(i,!0);d()}return new Za(i,!1);function d(){const f=Kb(e,t,n,r,i,A);if(!f){s.produce(i,l),c=!0;return}const h=f.captureIndices,y=f.matchedRuleId,C=h&&h.length>0?h[0].end>r:!1;if(y===Nb){const x=i.getRule(e);s.produce(i,h[0].start),i=i.withContentNameScopesList(i.nameScopesList),$n(e,t,n,i,s,x.endCaptures,h),s.produce(i,h[0].end);const p=i;if(i=i.parent,A=p.getAnchorPos(),!C&&p.getEnterPos()===r){i=p,s.produce(i,l),c=!0;return}}else{const x=e.getRule(y);s.produce(i,h[0].start);const p=i,b=x.getName(t.content,h),I=i.contentNameScopesList.pushAttributed(b,e);if(i=i.push(y,r,A,h[0].end===l,null,I,I),x instanceof Ss){const k=x;$n(e,t,n,i,s,k.beginCaptures,h),s.produce(i,h[0].end),A=h[0].end;const B=k.getContentName(t.content,h),D=I.pushAttributed(B,e);if(i=i.withContentNameScopesList(D),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,h))),!C&&p.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(x instanceof ri){const k=x;$n(e,t,n,i,s,k.beginCaptures,h),s.produce(i,h[0].end),A=h[0].end;const B=k.getContentName(t.content,h),D=I.pushAttributed(B,e);if(i=i.withContentNameScopesList(D),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,h))),!C&&p.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if($n(e,t,n,i,s,x.captures,h),s.produce(i,h[0].end),i=i.pop(),!C){i=i.safePop(),s.produce(i,l),c=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function Wb(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const c=l.getRule(e);c instanceof ri&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:A}=Lb(l.rule,e,l.stack.endRule,n,r===o),u=c.findNextMatchSync(t,r,A);if(u){if(u.ruleId!==fu){i=l.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(s.produce(l.stack,u.captureIndices[0].start),$n(e,t,n,l.stack,s,l.rule.whileCaptures,u.captureIndices),s.produce(l.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Kb(e,t,n,r,i,s){const o=Tb(e,t,n,r,i,s),a=e.getInjections();if(a.length===0)return o;const l=Yb(a,e,t,n,r,i,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,A=l.captureIndices[0].start;return A<c||l.priorityMatch&&A===c?l:o}function Tb(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=yu(o,e,i.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Yb(e,t,n,r,i,s,o){let a=Number.MAX_VALUE,l=null,c,A=0;const u=s.contentNameScopesList.getScopeNames();for(let d=0,f=e.length;d<f;d++){const h=e[d];if(!h.matcher(u))continue;const y=t.getRule(h.ruleId),{ruleScanner:C,findOptions:x}=yu(y,t,null,r,i===o),p=C.findNextMatchSync(n,i,x);if(!p)continue;const b=p.captureIndices[0].start;if(!(b>=a)&&(a=b,l=p.captureIndices,c=p.ruleId,A=h.priority,a===i))break}return l?{priorityMatch:A===-1,captureIndices:l,matchedRuleId:c}:null}function yu(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Lb(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function $n(e,t,n,r,i,s,o){if(s.length===0)return;const a=t.content,l=Math.min(s.length,o.length),c=[],A=o[0].end;for(let u=0;u<l;u++){const d=s[u];if(d===null)continue;const f=o[u];if(f.length===0)continue;if(f.start>A)break;for(;c.length>0&&c[c.length-1].endPos<=f.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,f.start):i.produce(r,f.start),d.retokenizeCapturedWithRuleId){const y=d.getName(a,o),C=r.contentNameScopesList.pushAttributed(y,e),x=d.getContentName(a,o),p=C.pushAttributed(x,e),b=r.push(d.retokenizeCapturedWithRuleId,f.start,-1,!1,null,C,p),I=e.createOnigString(a.substring(0,f.end));mu(e,I,n&&f.start===0,f.start,b,i,!1,0),du(I);continue}const h=d.getName(a,o);if(h!==null){const C=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new Pb(C,f.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Pb=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Ob(e,t,n,r,i,s,o,a){return new Ub(e,t,n,r,i,s,o,a)}function Ha(e,t,n,r,i){const s=ti(t,ii),o=pu.getCompiledRuleId(n,r,i.repository);for(const a of s)e.push({debugSelector:t,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function ii(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(Jb(t[i],r))return n=i+1,!0;return!1})}function Jb(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Ub=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Rb(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ja(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=ti(l,ii);for(const A of c)this._tokenTypeMatchers.push({matcher:A.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)Ha(t,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&Ha(t,l,a,this,a)}})}return t.sort((i,s)=>i.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ja(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=pu.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Ds.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),A=this.themeProvider.getDefaults(),u=Nn.set(0,c.languageId,c.tokenType,null,A.fontStyle,A.foregroundId,A.backgroundId),d=this.getRule(this._rootId).getName(null,null);let f;d?f=tr.createRootAndLookUpScopeName(d,u,this):f=tr.createRoot("unknown",u),t=new Ds(null,this._rootId,-1,-1,!1,null,f,f)}else i=!1,t.reset();e=e+`
|
|
59
|
-
`;const s=this.createOnigString(e),o=s.content.length,a=new Hb(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=mu(this,s,i,0,t,a,!0,r);return du(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function ja(e,t){return e=ub(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var tr=class ht{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const s of n)i=rs.push(i,s.scopeNames),r=new ht(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new ht(null,new rs(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new rs(null,t),o=r.themeProvider.themeMatch(s),a=ht.mergeAttributes(n,i,o);return new ht(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ht.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Nn.set(t,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ht._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=ht._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=ht.mergeAttributes(t.tokenAttributes,i,o);return new ht(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Ds=class $t{constructor(t,n,r,i,s,o,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new $t(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:$t._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?tr.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){$t._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,a){return new $t(this,t,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new $t(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=tr.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new $t(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,tr.fromExtension(r,n.contentNameScopesList))}},Zb=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ti(n,ii).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>ti(n,ii).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Hb=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(r=Nn.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=Nn.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},jb=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,Ob(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},qb=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new jb(ei.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(ei.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new Zb(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,s){const o=new vb(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},Fs=Ds.NULL;function si(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Zt(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function zb(e){return Array.isArray(e)?e:[e]}async function Cu(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function bu(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Vb(e){return e==="ansi"||bu(e)}function Iu(e){return e==="none"}function $b(e){return Iu(e)}function xu(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function Ci(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let s=0;s<n.length;s+=2){const o=t?n[s]+(n[s+1]||""):n[s];i.push([o,r]),r+=n[s].length,r+=n[s+1]?.length||0}return i}function Xb(e){const t=Ci(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let s=i,o=0;for(const a of t){if(s<a.length)break;s-=a.length,o++}return{line:o,character:s}}function r(i,s){let o=0;for(let a=0;a<i;a++)o+=t[a].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:r}}const ao="light-dark()",eI=["color","background-color"];function tI(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function nI(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,a)=>o-a);return s.length?tI(i,s):i})):e}function rI(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(A=>oi(e.variants[A])),a=new Set(o.flatMap(A=>Object.keys(A))),l={},c=(A,u)=>{const d=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[A]+(u==="color"?"":d)};return o.forEach((A,u)=>{for(const d of a){const f=A[d]||"inherit";if(u===0&&r&&eI.includes(d))if(r===ao&&o.length>1){const h=t.findIndex(p=>p==="light"),y=t.findIndex(p=>p==="dark");if(h===-1||y===-1)throw new Te('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[h][d]||"inherit",x=o[y][d]||"inherit";l[d]=`light-dark(${C}, ${x})`,i==="css-vars"&&(l[c(u,d)]=f)}else l[d]=f;else i==="css-vars"&&(l[c(u,d)]=f)}}),s.htmlStyle=l,s}function oi(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Le.Italic&&(t["font-style"]="italic"),e.fontStyle&Le.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Le.Underline&&n.push("underline"),e.fontStyle&Le.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Ns(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const wu=new WeakMap;function bi(e,t){wu.set(e,t)}function ai(e){return wu.get(e)}class Ir{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Ir(Object.fromEntries(zb(n).map(r=>[r,Fs])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return iI(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function iI(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const s=i?.nameScopesList?.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function sI(e,t){if(!(e instanceof Ir))throw new Te("Invalid grammar state");return e.getInternalStack(t)}function oI(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Te(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const a=i.lines[o.line];if(a===void 0)throw new Te(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new Te(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:i.posToIndex(o.line,l)}}};const i=Xb(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));aI(s),e.set(n.meta,{decorations:s,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const i=t(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return nI(n,i)},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=Array.from(n.children).filter(A=>A.type==="element"&&A.tagName==="span");if(i.length!==r.converter.lines.length)throw new Te(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(A,u,d,f){const h=i[A];let y="",C=-1,x=-1;if(u===0&&(C=0),d===0&&(x=0),d===Number.POSITIVE_INFINITY&&(x=h.children.length),C===-1||x===-1)for(let b=0;b<h.children.length;b++)y+=vu(h.children[b]),C===-1&&y.length===u&&(C=b+1),x===-1&&y.length===d&&(x=b+1);if(C===-1)throw new Te(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(x===-1)throw new Te(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const p=h.children.slice(C,x);if(!f.alwaysWrap&&p.length===h.children.length)a(h,f,"line");else if(!f.alwaysWrap&&p.length===1&&p[0].type==="element")a(p[0],f,"token");else{const b={type:"element",tagName:"span",properties:{},children:p};a(b,f,"wrapper"),h.children.splice(C,p.length,b)}}function o(A,u){i[A]=a(i[A],u,"line")}function a(A,u,d){const f=u.properties||{},h=u.transform||(y=>y);return A.tagName=u.tagName||"span",A.properties={...A.properties,...f,class:A.properties.class},u.properties?.class&&xu(A,u.properties.class),A=h(A,d)||A,A}const l=[],c=r.decorations.sort((A,u)=>u.start.offset-A.start.offset||A.end.offset-u.end.offset);for(const A of c){const{start:u,end:d}=A;if(u.line===d.line)s(u.line,u.character,d.character,A);else if(u.line<d.line){s(u.line,u.character,Number.POSITIVE_INFINITY,A);for(let f=u.line+1;f<d.line;f++)l.unshift(()=>o(f,A));s(d.line,0,d.character,A)}}l.forEach(A=>A())}}}function aI(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Te(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],s=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,a=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,l=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(s||o||a||l){if(s&&o||a&&l||a&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new Te(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function vu(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(vu).join(""):""}const lI=[oI()];function Qs(e){const t=cI(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...lI]}function cI(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var en=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ss={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function uI(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function qa(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function AI(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)ss[r]&&t.push({type:"setDecoration",value:ss[r]});else if(r<=29){const i=ss[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:en[r-30]}});else if(r===38){const i=qa(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:en[r-40]}});else if(r===48){const i=qa(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:en[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:en[r-100+8]}})}return t}function dI(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=uI(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const l=AI(o.sequence);for(const c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(s<r.length);return i}}}var hI={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function fI(e=hI){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c<en.length;c++)r.push(t(en[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let A=0;A<6;A++)for(let u=0;u<6;u++)r.push(n([a[c],a[A],a[u]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function s(a){return i()[a]}function o(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return s(a.index)}}return{value:o}}const pI={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function gI(e,t,n){const r=si(e,n),i=Ci(t),s=Object.fromEntries(en.map(l=>{const c=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,A=e.colors?.[c];return[l,A||pI[l]]})),o=fI(s),a=dI();return i.map(l=>a.parse(l[0]).map(c=>{let A,u;c.decorations.has("reverse")?(A=c.background?o.value(c.background):e.bg,u=c.foreground?o.value(c.foreground):e.fg):(A=c.foreground?o.value(c.foreground):e.fg,u=c.background?o.value(c.background):void 0),A=Zt(A,r),u=Zt(u,r),c.decorations.has("dim")&&(A=mI(A));let d=Le.None;return c.decorations.has("bold")&&(d|=Le.Bold),c.decorations.has("italic")&&(d|=Le.Italic),c.decorations.has("underline")&&(d|=Le.Underline),c.decorations.has("strikethrough")&&(d|=Le.Strikethrough),{content:c.value,offset:l[1],color:A,bgColor:u,fontStyle:d}}))}function mI(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],a=r[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${s}${s}${o}${o}${l}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function ku(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(bu(i)||Iu(r))return Ci(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:o}=e.setTheme(r);if(i==="ansi")return gI(s,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Te(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Te(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return yI(t,a,s,o,n)}function yI(e,t,n,r,i){const s=Bu(e,t,n,r,i),o=new Ir(s.stateStack,t.name,n.name);return bi(s.tokens,o),s.tokens}function Bu(e,t,n,r,i){const s=si(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=Ci(e);let c=i.grammarState?sI(i.grammarState,n.name)??Fs:i.grammarContextCode!=null?Bu(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Fs,A=[];const u=[];for(let d=0,f=l.length;d<f;d++){const[h,y]=l[d];if(h===""){A=[],u.push([]);continue}if(o>0&&h.length>=o){A=[],u.push([{content:h,offset:y,color:"",fontStyle:0}]);continue}let C,x,p;i.includeExplanation&&(C=t.tokenizeLine(h,c,a),x=C.tokens,p=0);const b=t.tokenizeLine2(h,c,a),I=b.tokens.length/2;for(let k=0;k<I;k++){const B=b.tokens[2*k],D=k+1<I?b.tokens[2*k+2]:h.length;if(B===D)continue;const Q=b.tokens[2*k+1],R=Zt(r[Nn.getForeground(Q)],s),Y=Nn.getFontStyle(Q),U={content:h.substring(B,D),offset:y+B,color:R,fontStyle:Y};if(i.includeExplanation){const V=[];if(i.includeExplanation!=="scopeName")for(const q of n.settings){let ee;switch(typeof q.scope){case"string":ee=q.scope.split(/,/).map(se=>se.trim());break;case"object":ee=q.scope;break;default:continue}V.push({settings:q,selectors:ee.map(se=>se.split(/ /))})}U.explanation=[];let ge=0;for(;B+ge<D;){const q=x[p],ee=h.substring(q.startIndex,q.endIndex);ge+=ee.length,U.explanation.push({content:ee,scopes:i.includeExplanation==="scopeName"?CI(q.scopes):bI(V,q.scopes)}),p+=1}}A.push(U)}u.push(A),A=[],c=b.ruleStack}return{tokens:u,stateStack:c}}function CI(e){return e.map(t=>({scopeName:t}))}function bI(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];n[r]={scopeName:s,themeMatches:xI(e,s,t.slice(0,r))}}return n}function za(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function II(e,t,n){if(!za(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)za(e[r],n[i])&&(r-=1),i-=1;return r===-1}function xI(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(II(o,t,n)){r.push(s);break}return r}function wI(e,t,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const c=ku(e,t,{...n,theme:l.theme}),A=ai(c),u=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:A,theme:u}}),s=vI(...i.map(l=>l.tokens)),o=s[0].map((l,c)=>l.map((A,u)=>{const d={content:A.content,variants:{},offset:A.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=A.explanation),s.forEach((f,h)=>{const{content:y,explanation:C,offset:x,...p}=f[c][u];d.variants[r[h].color]=p}),d})),a=i[0].state?new Ir(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return a&&bi(o,a),o}function vI(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(l=>l[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){const A=a[c];A.content.length===l?(s[c].push(A),o[c]+=1,a[c]=i[c][o[c]]):(s[c].push({...A,content:A.content.slice(0,l)}),a[c]={...A,content:A.content.slice(l),offset:A.offset+l})}}}return t}function Va(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:A="--shiki-",colorsRendering:u="css-vars"}=n,d=Object.entries(n.themes).filter(x=>x[1]).map(x=>({color:x[0],theme:x[1]})).sort((x,p)=>x.color===c?-1:p.color===c?1:0);if(d.length===0)throw new Te("`themes` option must not be empty");const f=wI(e,t,n);if(l=ai(f),c&&ao!==c&&!d.find(x=>x.color===c))throw new Te(`\`themes\` option must contain the defaultColor key \`${c}\``);const h=d.map(x=>e.getTheme(x.theme)),y=d.map(x=>x.color);s=f.map(x=>x.map(p=>rI(p,y,A,c,u))),l&&bi(s,l);const C=d.map(x=>si(x.theme,n));i=$a(d,h,C,A,c,"fg",u),r=$a(d,h,C,A,c,"bg",u),o=`shiki-themes ${h.map(x=>x.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else if("theme"in n){const c=si(n.theme,n);s=ku(e,t,n);const A=e.getTheme(n.theme);r=Zt(A.bg,c),i=Zt(A.fg,c),o=A.name,l=ai(s)}else throw new Te("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function $a(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=Zt(t[l][s],n[l])||"inherit",A=`${r+a.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&i){if(i===ao&&e.length>1){const u=e.findIndex(y=>y.color==="light"),d=e.findIndex(y=>y.color==="dark");if(u===-1||d===-1)throw new Te('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=Zt(t[u][s],n[u])||"inherit",h=Zt(t[d][s],n[d])||"inherit";return`light-dark(${f}, ${h});${A}`}return c}return o==="css-vars"?A:null}).filter(a=>!!a).join(";")}function _u(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>_u(e,i,s),codeToTokens:(i,s)=>Va(e,i,s)}){let i=t;for(const h of Qs(n))i=h.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:A}=Va(e,i,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:d=!1}=n;u===!0?s=BI(s):u==="never"&&(s=_I(s)),d&&(s=SI(s));const f={...r,get source(){return i}};for(const h of Qs(n))s=h.tokens?.call(f,s)||s;return kI(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},f,A)}function kI(e,t,n,r=ai(e)){const i=Qs(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[y,C]of Object.entries(t.meta||{}))y.startsWith("_")||(c[y]=C);let A={type:"element",tagName:"pre",properties:c,children:[],data:t.data},u={type:"element",tagName:"code",properties:{},children:s};const d=[],f={...n,structure:a,addClassToHast:xu,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return A},get code(){return u},get lines(){return d}};if(e.forEach((y,C)=>{C&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:`
|
|
60
|
-
`}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},p=0;for(const b of y){let I={type:"element",tagName:"span",properties:{...b.htmlAttrs},children:[{type:"text",value:b.content}]};const k=Ns(b.htmlStyle||oi(b));k&&(I.properties.style=k);for(const B of i)I=B?.span?.call(f,I,C+1,p,x,b)||I;a==="inline"?o.children.push(I):a==="classic"&&x.children.push(I),p+=b.content.length}if(a==="classic"){for(const b of i)x=b?.line?.call(f,x,C+1)||x;d.push(x),s.push(x)}else a==="inline"&&d.push(x)}),a==="classic"){for(const y of i)u=y?.code?.call(f,u)||u;A.children.push(u);for(const y of i)A=y?.pre?.call(f,A)||A;o.children.push(A)}else if(a==="inline"){const y=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const b of o.children)b.type==="element"&&b.tagName==="br"?(y.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&C.children.push(b);y.push(C);let p={type:"element",tagName:"code",properties:{},children:y};for(const b of i)p=b?.code?.call(f,p)||p;o.children=[];for(let b=0;b<p.children.length;b++){b>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const I=p.children[b];I.type==="element"&&o.children.push(...I.children)}}let h=o;for(const y of i)h=y?.root?.call(f,h)||h;return r&&bi(h,r),h}function BI(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((s,o)=>{const l=!(s.fontStyle&&(s.fontStyle&Le.Underline||s.fontStyle&Le.Strikethrough));l&&s.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(l?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function _I(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const a=[{...n,offset:n.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:n.offset}),o&&a.push({content:o,offset:n.offset+i.length+s.length}),a}))}function SI(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],s=Ns(i.htmlStyle||oi(i)),o=Ns(r.htmlStyle||oi(r)),a=i.fontStyle&&(i.fontStyle&Le.Underline||i.fontStyle&Le.Strikethrough),l=r.fontStyle&&(r.fontStyle&Le.Underline||r.fontStyle&Le.Strikethrough);!a&&!l&&s===o?i.content+=r.content:n.push({...r})}return n})}const Xa={light:"#333333",dark:"#bbbbbb"},el={light:"#fffffe",dark:"#1e1e1e"},tl="__shiki_resolved";function lo(e){if(e?.[tl])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Xa.light:Xa.dark),n||(n=t.type==="light"?el.light:el.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const A={...a,settings:{...a.settings}};if(l){const u=o(a.settings.foreground);t.colorReplacements[u]=a.settings.foreground,A.settings.foreground=u}if(c){const u=o(a.settings.background);t.colorReplacements[u]=a.settings.background,A.settings.background=u}return A});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=o(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,tl,{enumerable:!1,writable:!1,value:!0}),t}async function Su(e){return Array.from(new Set((await Promise.all(e.filter(t=>!Vb(t)).map(async t=>await Cu(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Eu(e){return(await Promise.all(e.map(async n=>$b(n)?null:lo(await Cu(n))))).filter(n=>!!n)}let EI=3;function DI(e,t=3){t>EI||console.trace(`[SHIKI DEPRECATE]: ${e}`)}class Bn extends Error{constructor(t){super(t),this.name="ShikiError"}}function Du(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Bn(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class FI extends qb{constructor(t,n,r,i={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=lo(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=ei.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Du(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const n=Array.from(this._langGraph.entries()),r=n.filter(([i,s])=>!s);if(r.length){const i=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(l=>r.map(([c])=>c).includes(l)):!1).filter(s=>!r.includes(s));throw new Bn(`Missing languages ${r.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of n)this._resolver.addLanguage(s);for(const[i,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class NI{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let zn=0;function QI(e){zn+=1,e.warnings!==!1&&zn>=10&&zn%10===0&&console.warn(`[Shiki] ${zn} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Bn("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(lo),i=new NI(e.engine,n),s=new FI(i,r,n,e.langAlias);let o;function a(b){return Du(b,e.langAlias)}function l(b){x();const I=s.getGrammar(typeof b=="string"?b:b.name);if(!I)throw new Bn(`Language \`${b}\` not found, you may need to load it first`);return I}function c(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};x();const I=s.getTheme(b);if(!I)throw new Bn(`Theme \`${b}\` not found, you may need to load it first`);return I}function A(b){x();const I=c(b);o!==b&&(s.setTheme(I),o=b);const k=s.getColorMap();return{theme:I,colorMap:k}}function u(){return x(),s.getLoadedThemes()}function d(){return x(),s.getLoadedLanguages()}function f(...b){x(),s.loadLanguages(b.flat(1))}async function h(...b){return f(await Su(b))}function y(...b){x();for(const I of b.flat(1))s.loadTheme(I)}async function C(...b){return x(),y(await Eu(b))}function x(){if(t)throw new Bn("Shiki instance has been disposed")}function p(){t||(t=!0,s.dispose(),zn-=1)}return{setTheme:A,getTheme:c,getLanguage:l,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:a,loadLanguage:h,loadLanguageSync:f,loadTheme:C,loadThemeSync:y,dispose:p,[Symbol.dispose]:p}}async function GI(e){e.engine||DI("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Eu(e.themes||[]),Su(e.langs||[]),e.engine]);return QI({...e,themes:t,langs:n,engine:r})}function Mn(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function RI(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const co=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Qe=String.raw;function Wn(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Fu=Qe`\[\^?`,Nu=`c.? | C(?:-.?)?|${Qe`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Qe`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Qe`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Qe`o\{[^\}]*\}?`}|${Qe`\d{1,3}`}`,uo=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Wr=new RegExp(Qe`
|
|
61
|
-
\\ (?:
|
|
62
|
-
${Nu}
|
|
63
|
-
| [gk]<[^>]*>?
|
|
64
|
-
| [gk]'[^']*'?
|
|
65
|
-
| .
|
|
66
|
-
)
|
|
67
|
-
| \( (?:
|
|
68
|
-
\? (?:
|
|
69
|
-
[:=!>({]
|
|
70
|
-
| <[=!]
|
|
71
|
-
| <[^>]*>
|
|
72
|
-
| '[^']*'
|
|
73
|
-
| ~\|?
|
|
74
|
-
| #(?:[^)\\]|\\.?)*
|
|
75
|
-
| [^:)]*[:)]
|
|
76
|
-
)?
|
|
77
|
-
| \*[^\)]*\)?
|
|
78
|
-
)?
|
|
79
|
-
| (?:${uo.source})+
|
|
80
|
-
| ${Fu}
|
|
81
|
-
| .
|
|
82
|
-
`.replace(/\s+/g,""),"gsu"),os=new RegExp(Qe`
|
|
83
|
-
\\ (?:
|
|
84
|
-
${Nu}
|
|
85
|
-
| .
|
|
86
|
-
)
|
|
87
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
88
|
-
| ${Fu}
|
|
89
|
-
| &&
|
|
90
|
-
| .
|
|
91
|
-
`.replace(/\s+/g,""),"gsu");function MI(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=tx(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(u){i.push(u)},replaceCurrentModX(u){i[i.length-1]=u},singleline:n.rules.singleline};let o=[],a;for(Wr.lastIndex=0;a=Wr.exec(e);){const u=WI(s,e,a[0],Wr.lastIndex);u.tokens?o.push(...u.tokens):u.token&&o.push(u.token),u.lastIndex!==void 0&&(Wr.lastIndex=u.lastIndex)}const l=[];let c=0;o.filter(u=>u.type==="GroupOpen").forEach(u=>{u.kind==="capturing"?u.number=++c:u.raw==="("&&l.push(u)}),c||l.forEach((u,d)=>{u.kind="capturing",u.number=d+1});const A=c||l.length;return{tokens:o.map(u=>u.type==="EscapedNumber"?rx(u,A):u).flat(),flags:r}}function WI(e,t,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=KI(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:nl(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:jI(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Gu(n)}}if(s==="K")return{token:Ru("keep",n)};if(s==="N"||s==="R")return{token:tn("newline",n,{negate:s==="N"})};if(s==="O")return{token:tn("any",n)};if(s==="X")return{token:tn("text_segment",n)};const o=Qu(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:$I(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:VI(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:xn("group",n)};if(n==="(?>")return{token:xn("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:xn(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:xn("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:xn("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:UI(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
92
|
-
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:tn("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Qe`\A`,$:Qe`\Z`}[n]:n;return{token:nl(o,n)}}return n==="|"?{token:YI(n)}:uo.test(n)?{tokens:ix(n)}:{token:Qt(Mn(n),n)}}function KI(e,t,n){const r=[rl(t[1]==="^",t)];let i=1,s;for(os.lastIndex=n;s=os.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(rl(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Qt(93,o));else if(i--,r.push(LI(o)),!i)break}else{const a=TI(o);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:os.lastIndex||e.length}}function TI(e){if(e[0]==="\\")return Qu(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!co.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return tn("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?PI(e):e==="&&"?OI(e):Qt(Mn(e),e)}function Qu(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return zI(e);if("dDhHsSwW".includes(n))return XI(e);if(e.startsWith(Qe`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return ex(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const a=[...s.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return Qt(Mn(o),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Qt(nx(e),e);if(il.has(n))return Qt(il.get(n),e);if(/\d/.test(n))return JI(t,e);if(e==="\\")throw new Error(Qe`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Qt(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function YI(e){return{type:"Alternator",raw:e}}function nl(e,t){return{type:"Assertion",kind:e,raw:t}}function Gu(e){return{type:"Backreference",raw:e}}function Qt(e,t){return{type:"Character",value:e,raw:t}}function LI(e){return{type:"CharacterClassClose",raw:e}}function PI(e){return{type:"CharacterClassHyphen",raw:e}}function OI(e){return{type:"CharacterClassIntersector",raw:e}}function rl(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function tn(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Ru(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Wn(n.flags),raw:t}}function JI(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function UI(e){return{type:"GroupClose",raw:e}}function xn(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function ZI(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function HI(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function jI(e){return{type:"Subroutine",raw:e}}const qI=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),il=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function zI(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Qt(Mn(t.toUpperCase())-64,e)}function VI(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=ol(n),o=ol(r),a={};if(s&&(a.enable=s),o&&(a.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),Ru("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,xn("group",e,{...(s||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function $I(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(A=>A!=="").map(A=>/^[+-]?\d+$/.test(A)?+A:A):[],[o,a,l]=s,c=qI.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return ZI(c,r??null,i?.split(",")??null,e)}function sl(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return HI(t,n,r,e)}function XI(e){const t=e[1].toLowerCase();return tn({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function ex(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return tn("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function ol(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function tx(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function nx(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function rx(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Gu(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let a=0;a<o.length;a++){const l=o[a];let c;if(a===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(Qe`Octal encoded byte above 177 unsupported "${n}"`)}else c=Mn(l);s.push(Qt(c,(a===0?"\\":"")+l))}return s}function ix(e){const t=[],n=new RegExp(uo,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:a}=s.groups;if(+o>+a&&i.endsWith("?")){n.lastIndex--,t.push(sl(i.slice(0,-1)));continue}}}t.push(sl(i))}return t}function Mu(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function sx(e){return ox.has(e.type)}const ox=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Wu(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=MI(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(d,f)=>{const h=r.tokens[s.nextIndex];switch(s.parent=d,s.nextIndex++,h.type){case"Alternator":return on();case"Assertion":return ax(h);case"Backreference":return lx(h,s);case"Character":return Ii(h.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return cx(h,s,f);case"CharacterClassOpen":return ux(h,s,f);case"CharacterSet":return Ax(h,s);case"Directive":return mx(h.kind,{flags:h.flags});case"GroupOpen":return dx(h,s,f);case"NamedCallout":return Cx(h.kind,h.tag,h.arguments);case"Quantifier":return hx(h,s);case"Subroutine":return fx(h,s);default:throw new Error(`Unexpected token type "${h.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Ix(yx(r.flags));let a=o.body[0];for(;s.nextIndex<r.tokens.length;){const d=i(a,{});d.type==="Alternative"?(o.body.push(d),a=d):a.body.push(d)}const{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:A,subroutines:u}=s;if(c&&A.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of u)if(typeof d=="number"){if(d>l.length)throw new Error("Subroutine uses a group number that's not defined");d&&(l[d-1].isSubroutined=!0)}else if(A.has(d)){if(A.get(d).length>1)throw new Error(Qe`Subroutine uses a duplicate group name "\g<${d}>"`);A.get(d)[0].isSubroutined=!0}else throw new Error(Qe`Subroutine uses a group name that's not defined "\g<${d}>"`);return o}function ax({kind:e}){return Gs(Wn({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Qe`\B`||e===Qe`\Y`})}function lx({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const a=t.capturingGroups.length;let l=!1;if(s>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Rs(o?a+1-s:s,{orphan:l})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Rs(r)}return i(+r)}function cx(e,t,n){const{tokens:r,walk:i}=t,s=t.parent,o=s.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return s.body.pop(),gx(o,l);throw new Error("Invalid character class range")}return Ii(Mn("-"))}function ux({negate:e},t,n){const{tokens:r,walk:i}=t,s=r[t.nextIndex],o=[Jr()];let a=cl(s);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(Jr()),t.nextIndex++;else{const c=o.at(-1);c.body.push(i(c,n))}a=cl(r[t.nextIndex],s)}const l=Jr({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function Ax({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(e==="property"){const a=xi(n);if(co.has(a)&&!o?.has(a))e="posix",n=a;else return wn(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?bx(n,{negate:t}):Ms(e,{negate:t})}function dx(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:a}=t,l=xx(e),c=l.type==="AbsenceFunction",A=ll(l),u=A&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&RI(s,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=ul(r[t.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")l.body.push(on()),t.nextIndex++;else{const f=l.body.at(-1),h=a(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||A,isInNegLookbehind:n.isInNegLookbehind||u});if(f.body.push(h),(A||n.isInLookbehind)&&!o){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(u||n.isInNegLookbehind){if(al(h)||h.type==="CapturingGroup")throw new Error(y)}else if(al(h)||ll(h)&&h.negate)throw new Error(y)}}d=ul(r[t.nextIndex])}return t.nextIndex++,l}function hx({kind:e,min:t,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!sx(s))throw new Error("Quantifier requires a repeatable token");const o=Tu(e,t,n,s);return i.body.pop(),o}function fx({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const a=+s.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Yu(i);return r.push(o),o}function px(e,t){return{type:"AbsenceFunction",kind:e,body:xr(t?.body)}}function on(e){return{type:"Alternative",body:Lu(e?.body)}}function Gs(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Rs(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Ku(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!wx(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:xr(t?.body)}}function Ii(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function Jr(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Lu(e?.body)}}function gx(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ms(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function mx(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Wn(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function yx(e){return{type:"Flags",...e}}function at(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:xr(e?.body)}}function Xt(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:xr(e?.body)}}function Cx(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function bx(e,t){const n=!!t?.negate;if(!co.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Tu(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function Ix(e,t){return{type:"Regex",body:xr(t?.body),flags:e}}function Yu(e){return{type:"Subroutine",ref:e}}function wn(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(xi(e));if(!r){if(n.normalizeUnknownPropertyNames)r=vx(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Qe`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function xx({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return px("repeater");case"atomic":return at({atomic:!0});case"capturing":return Ku(i,{name:n});case"group":return at({flags:e});case"lookahead":case"lookbehind":return Xt({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function xr(e){if(e===void 0)e=[on()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function Lu(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function al(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function ll(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function wx(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function vx(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function xi(e){return e.replace(/[- _]+/g,"").toLowerCase()}function cl(e,t){return Wn(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function ul(e){return Wn(e,"Unclosed group")}function nr(e,t,n=null){function r(s,o){for(let a=0;a<s.length;a++){const l=i(s[a],o,a,s);a=Math.max(-1,a+l)}}function i(s,o=null,a=null,l=null){let c=0,A=!1;const u={node:s,parent:o,key:a,container:l,root:e,remove(){Kr(l).splice(Math.max(0,gn(a)+c),1),c--,A=!0},removeAllNextSiblings(){return Kr(l).splice(gn(a)+1)},removeAllPrevSiblings(){const x=gn(a)+c;return c-=x,Kr(l).splice(0,Math.max(0,x))},replaceWith(x,p={}){const b=!!p.traverse;l?l[Math.max(0,gn(a)+c)]=x:Wn(o,"Can't replace root node")[a]=x,b&&i(x,o,a,l),A=!0},replaceWithMultiple(x,p={}){const b=!!p.traverse;if(Kr(l).splice(Math.max(0,gn(a)+c),1,...x),c+=x.length-1,b){let I=0;for(let k=0;k<x.length;k++)I+=i(x[k],o,gn(a)+k+I,l)}A=!0},skip(){A=!0}},{type:d}=s,f=t["*"],h=t[d],y=typeof f=="function"?f:f?.enter,C=typeof h=="function"?h:h?.enter;if(y?.(u,n),C?.(u,n),!A)switch(d){case"AbsenceFunction":case"CapturingGroup":case"Group":r(s.body,s);break;case"Alternative":case"CharacterClass":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"LookaroundAssertion":r(s.body,s);break;case"Quantifier":i(s.body,s,"body");break;case"Regex":r(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return h?.exit?.(u,n),f?.exit?.(u,n),c}return i(e),e}function Kr(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function gn(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const kx=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Bx(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function _x(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const ot=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Ao(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of e.matchAll(i)){const{0:c,groups:{$skip:A}}=l;if(!A&&(!r||r===ot.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?ot.CHAR_CLASS:ot.DEFAULT,negated:s[s.length-1]}):a+=n;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),a+=c}return a}function Pu(e,t,n,r){Ao(e,t,n,r)}function Sx(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(e);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!r||r===ot.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Tr(e,t,n){return!!Sx(e,t,0,n)}function Ex(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,s=1,o;for(;o=n.exec(e);){const[a]=o;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){r=o.index;break}}return e.slice(t,r)}const Al=new RegExp(String.raw`(?<noncapturingStart>${kx})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Dx(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],a=[];let l=0,c=0,A=NaN,u;do{u=!1;let d=0,f=0,h=!1,y;for(Al.lastIndex=Number.isNaN(A)?0:A+s.length;y=Al.exec(e);){const{0:C,index:x,groups:{capturingStart:p,noncapturingStart:b}}=y;if(C==="[")d++;else if(d)C==="]"&&d--;else if(C===i&&!h)A=x,h=!0;else if(h&&b)f++;else if(p)h?f++:(l++,o.push(l+c));else if(C===")"&&h){if(!f){c++;const I=l+c;if(e=`${e.slice(0,A)}${s}${e.slice(A+i.length,x)}))<$$${I}>)${e.slice(x+1)}`,u=!0,a.push(I),Bx(n,I),r.size){const k=new Map;r.forEach((B,D)=>{k.set(D>=I?D+1:D,B.map(Q=>Q>=I?Q+1:Q))}),r=k}break}f--}}}while(u);return n.push(...a),e=Ao(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:f,wrappedBackrefNum:h}})=>{if(f){const y=+f;if(y>o.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${o[y]}`}return`\\${h}`},ot.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Ou=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,as=new RegExp(String.raw`
|
|
93
|
-
\\(?: \d+
|
|
94
|
-
| c[A-Za-z]
|
|
95
|
-
| [gk]<[^>]+>
|
|
96
|
-
| [pPu]\{[^\}]+\}
|
|
97
|
-
| u[A-Fa-f\d]{4}
|
|
98
|
-
| x[A-Fa-f\d]{2}
|
|
99
|
-
)
|
|
100
|
-
| \((?: \? (?: [:=!>]
|
|
101
|
-
| <(?:[=!]|[^>]+>)
|
|
102
|
-
| [A-Za-z\-]+:
|
|
103
|
-
| \(DEFINE\)
|
|
104
|
-
))?
|
|
105
|
-
| (?<qBase>${Ou})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
106
|
-
| \\?.
|
|
107
|
-
`.replace(/\s+/g,""),"gsu");function Fx(e){if(!new RegExp(`${Ou}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",s=0,o;for(as.lastIndex=0;o=as.exec(e);){const{0:a,index:l,groups:{qBase:c,qMod:A,invalidQ:u}}=o;if(a==="[")s||(r=l),s++;else if(a==="]")s?s--:r=null;else if(!s)if(A==="+"&&i&&!i.startsWith("(")){if(u)throw new Error(`Invalid quantifier "${a}"`);let d=-1;if(/^\{\d+\}$/.test(c))e=_x(e,l+c.length,A,"");else{if(i===")"||i==="]"){const f=i===")"?n:r;if(f===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,f)}(?>${e.slice(f,l)}${c})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${c})${e.slice(l+a.length)}`;d+=4}as.lastIndex+=d}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const st=String.raw,Nx=st`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Ws=st`\(\?R=(?<rDepth>[^\)]+)\)|${Nx}`,wi=st`\(\?<(?![=!])(?<captureName>[^>]+)>`,Ju=st`${wi}|(?<unnamed>\()(?!\?)`,zt=new RegExp(st`${wi}|${Ws}|\(\?|\\?.`,"gsu"),ls="Cannot use multiple overlapping recursions";function Qx(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(Ws,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Tr(e,st`\(\?\(DEFINE\)`,ot.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=Tr(e,st`\\[1-9]`,ot.DEFAULT),a=new Map,l=[];let c=!1,A=0,u=0,d;for(zt.lastIndex=0;d=zt.exec(e);){const{0:f,groups:{captureName:h,rDepth:y,gRNameOrNum:C,gRDepth:x}}=d;if(f==="[")A++;else if(A)f==="]"&&A--;else if(y){if(dl(y),c)throw new Error(ls);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const p=e.slice(0,d.index),b=e.slice(zt.lastIndex);if(Tr(b,Ws,ot.DEFAULT))throw new Error(ls);const I=+y-1;e=hl(p,b,I,!1,n,s,u),i=pl(i,p,I,s.length,0,u);break}else if(C){dl(x);let p=!1;for(const V of l)if(V.name===C||V.num===+C){if(p=!0,V.hasRecursedWithin)throw new Error(ls);break}if(!p)throw new Error(st`Recursive \g cannot be used outside the referenced group "${r==="external"?C:st`\g<${C}&R=${x}>`}"`);const b=a.get(C),I=Ex(e,b);if(o&&Tr(I,st`${wi}|\((?!\?)`,ot.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const k=e.slice(b,d.index),B=I.slice(k.length+f.length),D=s.length,Q=+x-1,R=hl(k,B,Q,!0,n,s,u);i=pl(i,k,Q,s.length-D,D,u);const Y=e.slice(0,b),U=e.slice(b+I.length);e=`${Y}${R}${U}`,zt.lastIndex+=R.length-f.length-k.length-B.length,l.forEach(V=>V.hasRecursedWithin=!0),c=!0}else if(h)u++,a.set(String(u),zt.lastIndex),a.set(h,zt.lastIndex),l.push({num:u,name:h});else if(f[0]==="("){const p=f==="(";p&&(u++,a.set(String(u),zt.lastIndex)),l.push(p?{num:u}:{})}else f===")"&&l.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function dl(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function hl(e,t,n,r,i,s,o){const a=new Set;r&&Pu(e+t,wi,({groups:{captureName:c}})=>{a.add(c)},ot.DEFAULT);const l=[n,r?a:null,i,s,o];return`${e}${fl(`(?:${e}`,"forward",...l)}(?:)${fl(`${t})`,"backward",...l)}${t}`}function fl(e,t,n,r,i,s,o){const l=A=>t==="forward"?A+2:n-A+2-1;let c="";for(let A=0;A<n;A++){const u=l(A);c+=Ao(e,st`${Ju}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:f,unnamed:h,backref:y}})=>{if(y&&r&&!r.has(y))return d;const C=`_$${u}`;if(h||f){const x=o+s.length+1;return s.push(x),Gx(i,x),h?d:`(?<${f}${C}>`}return st`\k<${y}${C}>`},ot.DEFAULT)}return c}function Gx(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function pl(e,t,n,r,i,s){if(e.size&&r){let o=0;Pu(t,Ju,()=>o++,ot.DEFAULT);const a=s-o+i,l=new Map;return e.forEach((c,A)=>{const u=(r-o*n)/n,d=o*n,f=A>a+o?A+r:A,h=[];for(const y of c)if(y<=a)h.push(y);else if(y>a+o+u)h.push(y+r);else if(y<=a+o)for(let C=0;C<=n;C++)h.push(y+o*C);else for(let C=0;C<=n;C++)h.push(y+d+u*C);l.set(f,h)}),l}return e}var _e=String.fromCodePoint,ie=String.raw,lt={},vi=globalThis.RegExp;lt.flagGroups=(()=>{try{new vi("(?i:)")}catch{return!1}return!0})();lt.unicodeSets=(()=>{try{new vi("[[]]","v")}catch{return!1}return!0})();lt.bugFlagVLiteralHyphenIsRange=lt.unicodeSets?(()=>{try{new vi(ie`[\d\-a]`,"v")}catch{return!0}return!1})():!1;lt.bugNestedClassIgnoresNegation=lt.unicodeSets&&new vi("[[^a]]","v").test("a");function li(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function fr(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ks(e,t){return gl[e]>=gl[t]}function Rx(e,t){if(e==null)throw new Error(t??"Value expected");return e}var gl={ES2025:2025,ES2024:2024,ES2018:2018},Mx={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Uu(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Mx[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=lt.flagGroups?"ES2025":lt.unicodeSets?"ES2024":"ES2018"),t}var Wx="[ -\r ]",Kx=new Set([_e(304),_e(305)]),Bt=ie`[\p{L}\p{M}\p{N}\p{Pc}]`;function Zu(e){if(Kx.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Lx.get(n),s=Tx.get(n),o=Yx.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),s&&t.add(s),[...t]}var ho=new Map(`C Other
|
|
108
|
-
Cc Control cntrl
|
|
109
|
-
Cf Format
|
|
110
|
-
Cn Unassigned
|
|
111
|
-
Co Private_Use
|
|
112
|
-
Cs Surrogate
|
|
113
|
-
L Letter
|
|
114
|
-
LC Cased_Letter
|
|
115
|
-
Ll Lowercase_Letter
|
|
116
|
-
Lm Modifier_Letter
|
|
117
|
-
Lo Other_Letter
|
|
118
|
-
Lt Titlecase_Letter
|
|
119
|
-
Lu Uppercase_Letter
|
|
120
|
-
M Mark Combining_Mark
|
|
121
|
-
Mc Spacing_Mark
|
|
122
|
-
Me Enclosing_Mark
|
|
123
|
-
Mn Nonspacing_Mark
|
|
124
|
-
N Number
|
|
125
|
-
Nd Decimal_Number digit
|
|
126
|
-
Nl Letter_Number
|
|
127
|
-
No Other_Number
|
|
128
|
-
P Punctuation punct
|
|
129
|
-
Pc Connector_Punctuation
|
|
130
|
-
Pd Dash_Punctuation
|
|
131
|
-
Pe Close_Punctuation
|
|
132
|
-
Pf Final_Punctuation
|
|
133
|
-
Pi Initial_Punctuation
|
|
134
|
-
Po Other_Punctuation
|
|
135
|
-
Ps Open_Punctuation
|
|
136
|
-
S Symbol
|
|
137
|
-
Sc Currency_Symbol
|
|
138
|
-
Sk Modifier_Symbol
|
|
139
|
-
Sm Math_Symbol
|
|
140
|
-
So Other_Symbol
|
|
141
|
-
Z Separator
|
|
142
|
-
Zl Line_Separator
|
|
143
|
-
Zp Paragraph_Separator
|
|
144
|
-
Zs Space_Separator
|
|
145
|
-
ASCII
|
|
146
|
-
ASCII_Hex_Digit AHex
|
|
147
|
-
Alphabetic Alpha
|
|
148
|
-
Any
|
|
149
|
-
Assigned
|
|
150
|
-
Bidi_Control Bidi_C
|
|
151
|
-
Bidi_Mirrored Bidi_M
|
|
152
|
-
Case_Ignorable CI
|
|
153
|
-
Cased
|
|
154
|
-
Changes_When_Casefolded CWCF
|
|
155
|
-
Changes_When_Casemapped CWCM
|
|
156
|
-
Changes_When_Lowercased CWL
|
|
157
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
158
|
-
Changes_When_Titlecased CWT
|
|
159
|
-
Changes_When_Uppercased CWU
|
|
160
|
-
Dash
|
|
161
|
-
Default_Ignorable_Code_Point DI
|
|
162
|
-
Deprecated Dep
|
|
163
|
-
Diacritic Dia
|
|
164
|
-
Emoji
|
|
165
|
-
Emoji_Component EComp
|
|
166
|
-
Emoji_Modifier EMod
|
|
167
|
-
Emoji_Modifier_Base EBase
|
|
168
|
-
Emoji_Presentation EPres
|
|
169
|
-
Extended_Pictographic ExtPict
|
|
170
|
-
Extender Ext
|
|
171
|
-
Grapheme_Base Gr_Base
|
|
172
|
-
Grapheme_Extend Gr_Ext
|
|
173
|
-
Hex_Digit Hex
|
|
174
|
-
IDS_Binary_Operator IDSB
|
|
175
|
-
IDS_Trinary_Operator IDST
|
|
176
|
-
ID_Continue IDC
|
|
177
|
-
ID_Start IDS
|
|
178
|
-
Ideographic Ideo
|
|
179
|
-
Join_Control Join_C
|
|
180
|
-
Logical_Order_Exception LOE
|
|
181
|
-
Lowercase Lower
|
|
182
|
-
Math
|
|
183
|
-
Noncharacter_Code_Point NChar
|
|
184
|
-
Pattern_Syntax Pat_Syn
|
|
185
|
-
Pattern_White_Space Pat_WS
|
|
186
|
-
Quotation_Mark QMark
|
|
187
|
-
Radical
|
|
188
|
-
Regional_Indicator RI
|
|
189
|
-
Sentence_Terminal STerm
|
|
190
|
-
Soft_Dotted SD
|
|
191
|
-
Terminal_Punctuation Term
|
|
192
|
-
Unified_Ideograph UIdeo
|
|
193
|
-
Uppercase Upper
|
|
194
|
-
Variation_Selector VS
|
|
195
|
-
White_Space space
|
|
196
|
-
XID_Continue XIDC
|
|
197
|
-
XID_Start XIDS`.split(/\s/).map(e=>[xi(e),e])),Tx=new Map([["s",_e(383)],[_e(383),"s"]]),Yx=new Map([[_e(223),_e(7838)],[_e(107),_e(8490)],[_e(229),_e(8491)],[_e(969),_e(8486)]]),Lx=new Map([Tt(453),Tt(456),Tt(459),Tt(498),...cs(8072,8079),...cs(8088,8095),...cs(8104,8111),Tt(8124),Tt(8140),Tt(8188)]),Px=new Map([["alnum",ie`[\p{Alpha}\p{Nd}]`],["alpha",ie`\p{Alpha}`],["ascii",ie`\p{ASCII}`],["blank",ie`[\p{Zs}\t]`],["cntrl",ie`\p{Cc}`],["digit",ie`\p{Nd}`],["graph",ie`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",ie`\p{Lower}`],["print",ie`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",ie`[\p{P}\p{S}]`],["space",ie`\p{space}`],["upper",ie`\p{Upper}`],["word",ie`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",ie`\p{AHex}`]]);function Ox(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Tt(e){const t=_e(e);return[t.toLowerCase(),t]}function cs(e,t){return Ox(e,t).map(n=>Tt(n))}var Hu=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Jx(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};ju(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ks(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};nr(e,Ux,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};nr(e,Zx,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return nr(e,Hx,o),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var Ux={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const s=at();s.body[0].body.push(Xt({negate:!0,body:r}),wn("Any"));const o=at();o.body[0].body.push(Tu("greedy",0,1/0,s)),n(Ie(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const o=t.body[s];fr(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=zu(t.get(e));if(n){const r=at({flags:n});r.body[0].body=e.body,e.body=[Ie(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:s,replaceWith:o},a){const{kind:l,negate:c}=e,{asciiWordBoundaries:A,avoidSubclass:u,supportedGNodes:d,wordIsAscii:f}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")o(Ie(Xt({body:[on({body:[Gs("string_end")]}),on({body:[Ii(10)]})]}),t));else if(l==="line_start")o(Ie(_t(ie`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(d.has(e))i.flags.sticky=!0,s();else{const h=r[n-1];if(h&&Xx(h))o(Ie(Xt({negate:!0}),t));else{if(u)throw new Error(ie`Uses "\G" in a way that requires a subclass`);o(Yt(Gs("string_start"),t)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")o(Ie(_t(ie`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!A){const h=`(?:(?<=${Bt})(?!${Bt})|(?<!${Bt})(?=${Bt}))`,y=`(?:(?<=${Bt})(?=${Bt})|(?<!${Bt})(?!${Bt}))`;o(Ie(_t(c?y:h),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!As(n)&&(n=us(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!As(r)&&(r=us(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=Jr({body:[e]});n(Ie(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:a}){const{kind:l,negate:c,value:A}=e;if(s&&(l==="digit"||A==="digit")){n(Yt(Ms("digit",{negate:c}),t));return}if(o&&(l==="space"||A==="space")){n(Ie(ds(_t(Wx),c),t));return}if(a&&(l==="word"||A==="word")){n(Yt(Ms("word",{negate:c}),t));return}if(l==="any")n(Yt(wn("Any"),t));else if(l==="digit")n(Yt(wn("Nd",{negate:c}),t));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(ie`Use of "\X" requires non-strict accuracy`);const u="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=ie`\p{RI}{2}|${u}(?:\u200D${u})*`;n(Ie(_t(ie`(?>\r\n|${i?ie`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(Yt(wn("AHex",{negate:c}),t));else if(l==="newline")n(Ie(_t(c?`[^
|
|
198
|
-
]`:`(?>\r
|
|
199
|
-
?|[
|
|
200
|
-
\v\f
\u2028\u2029])`),t));else if(l==="posix")if(!i&&(A==="graph"||A==="print")){if(r==="strict")throw new Error(`POSIX class "${A}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[A];c&&(u=`\0-${_e(u.codePointAt(0)-1)}${_e(u.codePointAt(2)+1)}-`),n(Ie(_t(`[${u}]`),t))}else n(Ie(ds(_t(Px.get(A)),c),t));else if(l==="property")ho.has(xi(A))||(e.key="sc");else if(l==="space")n(Yt(wn("space",{negate:c}),t));else if(l==="word")n(Ie(ds(_t(Bt),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=at({flags:l});c.body[0].body=o(),i(Ie(c,t),{traverse:!0})}else if(a==="keep"){const c=n.body[0],u=n.body.length===1&&Mu(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==u||u.body.length>1)throw new Error(ie`Uses "\K" in a way that's unsupported`);const d=Xt({behind:!0});d.body[0].body=s(),i(Ie(d,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(Ie(Xt({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=at();t.body[0].body.push(e.body),e.body=Ie(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=$u(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(ie`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!As(n)&&(n=us(n,t),e.ref=n)}},Zx={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){const c=i.get(e);if(c&&a.has(e.number)){const u=Yt(ml(e.number),t);l.set(u,a.get(e.number)),n(u);return}a.set(e.number,e),o.set(e.number,[]),e.name&&fr(o,e.name,[]);const A=o.get(e.name??e.number);for(let u=0;u<A.length;u++){const d=A[u];if(c===d.node||c&&c===d.origin||e===d.origin){A.splice(u,1);break}}if(o.get(e.number).push({node:e,origin:c}),e.name&&o.get(e.name).push({node:e,origin:c}),e.name){const u=fr(s,e.name,new Map);let d=!1;if(c)d=!0;else for(const f of u.values())if(!f.hasDuplicateNameToRemove){d=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:d})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=li(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:s}=e;if(i){let A=t;for(;(A=A.parent)&&!(A.type==="CapturingGroup"&&(A.name===s||A.number===s)););r.reffedNodesByReferencer.set(e,A);return}const o=r.subroutineRefMap.get(s),a=s===0,l=a?ml(0):qu(o,r.groupOriginByCopy,null);let c=l;if(!a){const A=zu(zx(o,d=>d.type==="Group"&&!!d.flags)),u=A?li(r.globalFlags,A):r.globalFlags;jx(u,r.currentFlags)||(c=at({flags:Vx(u)}),c.body[0].body.push(l))}n(Ie(c,t),{traverse:!a})}},Hx={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(o=>qx(o,e));if(!s.length)n(Ie(Xt({negate:!0}),t));else if(s.length>1){const o=at({atomic:!0,body:s.reverse().map(a=>on({body:[Rs(a.number)]}))});n(Ie(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=Ku();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function ju(e){nr(e,{"*"({node:t,parent:n}){t.parent=n}})}function jx(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function qx(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Vu(n.parent);for(const i of r){if(i===n)break;if(i===e||Xu(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function qu(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[s]=qu(o,t,i,n):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function ml(e){const t=Yu(e);return t.isRecursive=!0,t}function zx(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function us(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function zu(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Vx({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Vu(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function $u(e){const t=e.find(n=>n.kind==="search_start"||ew(n,{negate:!1})||!$x(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=$u(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function Xu(e,t){const n=Vu(e)??[];for(const r of n)if(r===t||Xu(r,t))return!0;return!1}function $x({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Xx(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function ew(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Mu(e.body[0],{type:"Assertion",kind:"search_start"})}function As(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function _t(e,t){const r=Wu(e,{...t,unicodePropertyMap:ho}).body;return r.length>1||r[0].body.length>1?at({body:r}):r[0].body[0]}function ds(e,t){return e.negate=t,e}function Yt(e,t){return e.parent=t,e}function Ie(e,t){return ju(e),e.parent=t,e}function tw(e,t){const n=Uu(t),r=Ks(n.target,"ES2024"),i=Ks(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!i){const f=[e.flags.ignoreCase];nr(e,nw,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(h){f.push(h)},setHasCasedChar(){f.at(-1)?o=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!a)};let c=e;const A={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function u(f){return A.lastNode=c,c=f,Rx(rw[f.type],`Unexpected node type "${f.type}"`)(f,A,u)}const d={pattern:e.body.map(u).join("|"),flags:u(e.flags),options:{...e.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],A.captureMap.forEach((f,h)=>{f.hidden&&d._hiddenCaptures.push(h),f.transferTo&&fr(d._captureTransfers,f.transferTo,[]).push(h)}),d}var nw={"*":{enter({node:e},t){if(Cl(e)){const n=t.getCurrentModI();t.pushModI(e.flags?li({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Cl(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){fo(_e(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),eA(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Hu.has(e.value)&&t.setHasCasedChar()}},rw={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?ie`\B`:ie`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(o.hidden=!0,s>a.number&&(o.transferTo=a.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=_e(e),r=mn(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&fo(n)){const i=Zu(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:s}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");lt.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(bl)&&(o=[Ii(45),...o.filter(c=>!bl(c))]);const a=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||lt.bugNestedClassIgnoresNegation)&&!i){const A=o.filter(u=>u.type==="CharacterClass"&&u.kind==="union"&&u.negate);if(A.length){const u=at(),d=u.body[0];return u.parent=s,d.parent=u,o=o.filter(f=>!A.includes(f)),e.body=o,o.length?(e.parent=d,d.body.push(e)):u.body.pop(),A.forEach(f=>{const h=on({body:[f]});f.parent=h,h.parent=u,u.body.push(h)}),n(u)}}t.inCharClass=!0;const c=a();return t.inCharClass=!1,c}const l=o[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(lt.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=mn(n,i),o=mn(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=eA(e);lw(l).forEach(A=>{a.add(Array.isArray(A)?`${mn(A[0],i)}-${mn(A[1],i)}`:mn(A,i))})}return`${s}-${o}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":ie`[^\n]`;if(e==="digit")return t?ie`\D`:ie`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Hu.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?ie`\P`:ie`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?ie`\W`:ie`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,s){const o=i.currentFlags;n&&(i.currentFlags=li(o,n));const a=t.map(s).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${cw(e,n,i.useFlagMods)}${a})`;return i.currentFlags=o,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+uw(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:ie`\g<${t}&R=${r}>`}},iw=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),sw=new Set(["-","\\","]","^","["]),ow=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),yl=new Map([[9,ie`\t`],[10,ie`\n`],[11,ie`\v`],[12,ie`\f`],[13,ie`\r`],[8232,ie`\u2028`],[8233,ie`\u2029`],[65279,ie`\uFEFF`]]),aw=new RegExp("^\\p{Cased}$","u");function fo(e){return aw.test(e)}function eA(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const a=_e(o);if(!fo(a))continue;const l=Zu(a).filter(c=>{const A=c.codePointAt(0);return A<r||A>i});if(l.length&&(s.push(...l),n))break}return s}function mn(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(yl.has(e))return yl.get(e);if(e<32||e>126&&e<160||e>262143||t&&Aw(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?ow:sw:iw,s=_e(e);return(i.has(s)?"\\":"")+s}function lw(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??=t[i]:r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function cw(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:s}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function uw({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Cl({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Aw(e){return e>47&&e<58}function bl({type:e,value:t}){return e==="Character"&&t===45}var dw=class Ts extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#r=s.source,s instanceof Ts&&(this.#t=s.#t,this.#n=s.#n,this.#i=s.#i,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#r=t,this.#t=fw(s.hiddenCaptures,s.transfers),this.#i=s.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:i,...s}=this.rawOptions;this.#e=new Ts(this.#r,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#i==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#s(t.slice(r));return i&&(hw(i,r,t,this.hasIndices),this.lastIndex+=r),i}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let o=1;o<r.length;o++){const{hidden:a,transferTo:l}=this.#t.get(o)??{};if(a?s.push(null):(s.push(n.length),n.push(r[o]),this.hasIndices&&n.indices.push(i[o])),l&&r[o]!==void 0){const c=s[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[o],this.hasIndices&&(n.indices[c]=i[o]),n.groups){this.#n||(this.#n=pw(this.source));const A=this.#n.get(l);A&&(n.groups[A]=r[o],this.hasIndices&&(n.indices.groups[A]=i[o]))}}}return n}};function hw(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const a=i[o];a&&(i[o]=[a[0]+t,a[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const a=s[o];a&&(s[o]=[a[0]+t,a[1]+t])})}}function fw(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const s of i)fr(n,s,{}).transferTo=r;return n}function pw(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:a,name:l}}=s;o==="["?r++:r?o==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function gw(e,t){const n=mw(e,t);return n.options?new dw(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function mw(e,t){const n=Uu(t),r=Wu(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:ho}),i=Jx(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=tw(i,n),o=Qx(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=Fx(o.pattern),l=Dx(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const A=l.hiddenCaptures.sort((h,y)=>h-y),u=Array.from(l.captureTransfers),d=i._strategy,f=c.pattern.length>=n.lazyCompileLength;(A.length||u.length||d||f)&&(c.options={...A.length&&{hiddenCaptures:A},...u.length&&{transfers:u},...d&&{strategy:d},...f&&{lazyCompile:f}})}return c}const Il=4294967295;class yw{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:s}=n;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const a=i?.get(o);if(a){if(a instanceof RegExp)return a;if(r)return null;throw a}try{const l=s(o);return i?.set(o,l),l}catch(l){if(i?.set(o,l),r)return null;throw l}})}regexps;findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,s=[];function o(a,l,c=0){return{index:a,captureIndices:l.indices.map(A=>A==null?{start:Il,end:Il,length:0}:{start:A[0]+c,end:A[1]+c,length:A[1]-A[0]})}}for(let a=0;a<this.regexps.length;a++){const l=this.regexps[a];if(l)try{l.lastIndex=n;const c=l.exec(i);if(!c)continue;if(c.index===n)return o(a,c,0);s.push([a,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(s.length){const a=Math.min(...s.map(l=>l[1].index));for(const[l,c,A]of s)if(c.index===a)return o(l,c,A)}return null}}function Cw(e,t){return gw(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function bw(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>Cw(n,{target:t.target}),{createScanner(n){return new yw(n,t)},createString(n){return{content:n}}}}let yn=null,Vn=null;const xl=new Set,wl=new Set;async function Iw(e={}){if(yn){const{themes:t,languages:n}=await vl(e);return await Promise.all(t.map(r=>kl(yn,r))),await Promise.all(n.map(r=>Bl(yn,r))),yn}if(Vn)return Vn;try{return Vn=(async()=>{const{themes:t,languages:n}=await vl(e),r=await GI({themes:t,langs:n,langAlias:{md:"mdc",markdown:"mdc",comark:"mdc"},engine:bw({forgiving:!0})});return await Promise.all(t.map(i=>kl(r,i))),await Promise.all(n.map(i=>Bl(r,i))),r})(),yn=await Vn,Vn=null,yn}catch(t){throw console.error("Failed to create highlighter: make sure `shiki` is installed",t),t}}async function vl(e){const t=Object.values(e.themes||{}),n=e.languages||[],r=[];e.registerDefaultThemes!==!1&&r.push(rt(()=>import("./B0m2ddpp.js"),[],import.meta.url).then(s=>({type:"theme",value:s.default})),rt(()=>import("./Csfq5Kiy.js"),[],import.meta.url).then(s=>({type:"theme",value:s.default}))),e.registerDefaultLanguages!==!1&&r.push(rt(()=>import("./CkyjGvrk.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./COt5Ahok.js"),[],import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./FeFRdv_D.js"),__vite__mapDeps([6,2,3,1,7]),import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./BPQ3VLAy.js"),[],import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./wDzz0qaB.js"),[],import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./DBQR3AJH.js"),__vite__mapDeps([8,9,5,2,1]),import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./Yzrsuije.js"),[],import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./Cp-IABpG.js"),[],import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./Buea-lGh.js"),[],import.meta.url).then(s=>({type:"lang",value:s.default})),rt(()=>import("./CV1c1Dy6.js"),__vite__mapDeps([10,4,2,3,1,7,11]),import.meta.url).then(s=>({type:"lang",value:s.default})));const i=await Promise.all(r);for(const s of i)s.type==="theme"?t.push(s.value):n.push(s.value);return{themes:t,languages:n}}async function kl(e,t){xl.has(t.name||"")||(await e.loadTheme(t),xl.add(t.name||""))}async function Bl(e,t){wl.has(Array.isArray(t)?t.map(n=>n.name||"").join(","):t.name||"")||(await e.loadLanguage(t),wl.add(Array.isArray(t)?t.map(n=>n.name||"").join(","):t.name||""))}async function xw(e,t,n={}){const r=t?.language;try{const s=await Iw(n),{themes:o={light:"material-theme-lighter",dark:"material-theme-palenight"}}=n,a=o.light||o.dark||"material-theme-lighter",l=o.dark||o.light||"material-theme-palenight";return{nodes:(await _u(s,e,{lang:r,transformers:n.transformers,themes:{light:a,dark:a!==l?l:void 0},meta:{__raw:t.meta}})).children.map(i),language:r}}catch(s){return console.error("Shiki highlighting error:",s),{nodes:[e],language:r}}function i(s){const o=s.properties||{};return s.type==="comment"?[null,{},s.value]:s.type==="text"?s.value:(s.tag==="code"&&o?.className&&o.className.length===0&&delete o.className,[s.tagName,o,...(s.children||[]).map(i)])}}async function ww(e,t={}){const n=[],r=(o,a)=>{for(let l=0;l<o.length;l++){const c=o[l];typeof c!="string"&&(!Array.isArray(c)||c.length<3||(c[0]==="pre"&&Array.isArray(c[2])&&c[2][0]==="code"&&typeof c[2][2]=="string"&&n.push({node:c,path:[...a,l]}),r(c.slice(2),[...a,l])))}};if(r(e.nodes,[]),n.length===0)return e;const i=await Promise.all(n.map(({node:o})=>xw(o[2][2],o[1],t))),s=JSON.parse(JSON.stringify(e.nodes));for(let o=0;o<n.length;o++){const{node:a,path:l}=n[o],c=a[1],u=i[o].nodes[0],d=typeof u=="string"?["shiki",t.themes?.light?.name]:Array.isArray(u[1].class)?u[1].class:String(u[1].class).split(" "),f=u[2].slice(2),h=typeof u=="string"?u:f;if(Array.isArray(h)){let b=1;for(const I of h)Array.isArray(I)&&(Array.isArray(c.highlights)&&c.highlights.includes(b)?(I[1].class=`${I[1].class??""} highlight`.trim(),I[1].style="display: inline-block"):I[1].style="display: inline",b+=1)}const y={...c,class:[...d,t.themes?.dark?.name?`dark:${t.themes?.dark?.name}`:""].filter(Boolean).join(" "),tabindex:"0"};if(t.preStyles){const b=t.themes?.light,I=t.themes?.dark,k=[];b?.colors?.["editor.background"]&&k.push(`background-color:${b.colors["editor.background"]}`),b?.colors?.["editor.foreground"]&&k.push(`color:${b.colors["editor.foreground"]}`),b?.name!==I?.name&&(I?.colors?.["editor.background"]&&k.push(`--shiki-dark-bg:${I.colors["editor.background"]}`),I?.colors?.["editor.foreground"]&&k.push(`--shiki-dark:${I.colors["editor.foreground"]}`)),y.style=k.join(";")}const x=a[2][1]||{},p=["pre",y,["code",x,...h]];if(l.length===1)s[l[0]]=p;else{let b=s[l[0]];for(let k=1;k<l.length-1;k++)b=b[l[k]+2];const I=l[l.length-1]+2;b[I]=p}}return{...e,nodes:s}}const vw=(e={})=>({name:"highlight",async post(t){t.tree=await ww(t.tree,e)}}),kw={key:0,class:"whitespace-pre-wrap text-[15px] leading-7 text-highlighted"},Bw=he({__name:"Text",props:{role:{},part:{}},setup(e){const t=e,n=[vw({preStyles:!1})],r=G(()=>t.part?.state==="streaming");return(i,s)=>e.role==="user"?(v(),M("p",kw,X(e.part?.text??""),1)):(v(),K(gd,{key:1},{default:J(()=>[Ae(m(cb),{class:"cd-markdown",markdown:e.part?.text??"",streaming:r.value,plugins:n,caret:""},null,8,["markdown","streaming"])]),_:1}))}}),_w=Object.assign(Bw,{__name:"MessagePartText"});function Sw(e,t={}){const{arrivedState:n}=md(e),r=G(()=>{const s=bn(e),o=bn(t.orientation)??"vertical",[a,l]=o==="horizontal"?["left","right"]:["top","bottom"],c=!n[a],A=!n[l];if(!c&&!A||!(s?o==="horizontal"?s.scrollWidth>s.clientWidth:s.scrollHeight>s.clientHeight:!1))return;const d=`${bn(t.size)??24}px`,f=o==="horizontal"?"90deg":"180deg";return c&&A?{maskImage:`linear-gradient(${f}, transparent, #000 ${d}, #000 calc(100% - ${d}), transparent)`}:c?{maskImage:`linear-gradient(${f}, transparent, #000 ${d})`}:{maskImage:`linear-gradient(${f}, #000, #000 calc(100% - ${d}), transparent)`}}),i=G(()=>{n.top,n.bottom,n.left,n.right;const s=bn(e);return s?(bn(t.orientation)??"vertical")==="horizontal"?s.scrollWidth>s.clientWidth:s.scrollHeight>s.clientHeight:!1});return{style:r,isOverflowing:i,arrivedState:n}}const Ew={slots:{root:"",trigger:["group flex w-full items-center gap-1.5 text-muted text-sm disabled:cursor-default disabled:hover:text-muted hover:text-default focus-visible:outline-offset-2 focus-visible:outline-primary min-w-0","transition-colors"],leading:"relative size-4 shrink-0",leadingIcon:"size-4 shrink-0",chevronIcon:"size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",label:"truncate",trailingIcon:"size-4 shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",content:"data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden",body:"max-h-[200px] pt-2 overflow-y-auto text-sm text-dimmed whitespace-pre-wrap"},variants:{chevron:{leading:{leadingIcon:"group-hover:opacity-0"},trailing:""},alone:{false:{leadingIcon:["absolute inset-0 group-data-[state=open]:opacity-0","transition-opacity duration-200"],chevronIcon:["absolute inset-0 opacity-0 group-hover:opacity-100 group-data-[state=open]:opacity-100","transition-[rotate,opacity] duration-200"]}}}},Dw={__name:"UChatReasoning",props:{text:{type:String,required:!1},streaming:{type:Boolean,required:!1,default:!1},duration:{type:Number,required:!1},icon:{type:null,required:!1},chevron:{type:String,required:!1,default:"trailing"},chevronIcon:{type:null,required:!1},autoCloseDelay:{type:Number,required:!1,default:500},shimmer:{type:Object,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=t,{t:i,code:s}=fi(),o=It(),a=xt("chatReasoning",n),l=G(()=>ke({extend:ke(Ew),...o.ui?.chatReasoning||{}})({chevron:n.chevron})),c=G(()=>n.open!==void 0),A=P(n.defaultOpen??n.streaming),u=P(n.streaming?Date.now():null),d=P(void 0),f=P(null);Ye(()=>n.streaming,(B,D)=>{B?(f.value&&(clearTimeout(f.value),f.value=null),D||(x(!0),u.value=Date.now())):D&&(u.value!==null&&(d.value=Math.ceil((Date.now()-u.value)/1e3),u.value=null),n.autoCloseDelay>0&&(f.value=setTimeout(()=>{x(!1)},n.autoCloseDelay)))},{immediate:!0});const h=G(()=>n.duration??d.value),y=G(()=>{if(n.streaming||h.value===0)return i("chatReasoning.thinking");if(h.value===void 0)return i("chatReasoning.thought");const B=h.value,D=B<60?"second":"minute",Q=B<60?B:Math.floor(B/60),R=new Intl.NumberFormat(s.value,{style:"unit",unit:D,unitDisplay:"long"}).format(Q);return i("chatReasoning.thoughtFor",{duration:R})}),C=G(()=>c.value?n.open:A.value);function x(B){f.value&&(clearTimeout(f.value),f.value=null),A.value=B,r("update:open",B)}Jl(()=>{f.value&&clearTimeout(f.value)});const p=G(()=>!!n.text||n.streaming),b=G(()=>n.chevronIcon||o.ui.icons?.chevronDown),I=ir("bodyRef"),{style:k}=Sw(I);return Ye(()=>n.text,()=>{if(!n.streaming||!I.value)return;const B=I.value;B.scrollHeight-B.scrollTop-B.clientHeight<50&&Xe(()=>{B.scrollTop=B.scrollHeight})}),(B,D)=>p.value?(v(),K(m(ec),{key:0,open:C.value,disabled:e.disabled,"unmount-on-hide":e.unmountOnHide,"data-slot":"root",class:O(l.value.root({class:[m(a)?.root,n.class]})),"onUpdate:open":x},{default:J(({open:Q})=>[Ae(m($l),{"as-child":"",disabled:!p.value},{default:J(()=>[F("button",{type:"button","data-slot":"trigger",class:O(l.value.trigger({class:m(a)?.trigger}))},[e.icon||p.value&&e.chevron==="leading"?(v(),M("span",{key:0,"data-slot":"leading",class:O(l.value.leading({class:m(a)?.leading}))},[e.icon?(v(),K(Re,{key:0,name:e.icon,"data-slot":"leadingIcon",class:O(l.value.leadingIcon({class:m(a)?.leadingIcon,alone:!(p.value&&e.chevron==="leading")}))},null,8,["name","class"])):L("",!0),p.value&&e.chevron==="leading"?(v(),K(Re,{key:1,name:b.value,"data-slot":"chevronIcon",class:O(l.value.chevronIcon({class:m(a)?.chevronIcon,alone:!e.icon}))},null,8,["name","class"])):L("",!0)],2)):L("",!0),e.streaming?(v(),K(Js,de({key:1,text:y.value},n.shimmer,{"data-slot":"label",class:l.value.label({class:m(a)?.label})}),null,16,["text","class"])):(v(),M("span",{key:2,"data-slot":"label",class:O(l.value.label({class:m(a)?.label}))},X(y.value),3)),p.value&&e.chevron==="trailing"?(v(),K(Re,{key:3,name:b.value,"data-slot":"trailingIcon",class:O(l.value.trailingIcon({class:m(a)?.trailingIcon}))},null,8,["name","class"])):L("",!0)],2)]),_:1},8,["disabled"]),Ae(m(Xl),{"data-slot":"content",class:O(l.value.content({class:m(a)?.content}))},{default:J(()=>[F("div",{ref_key:"bodyRef",ref:I,"data-slot":"body",class:O(l.value.body({class:m(a)?.body})),style:hi(m(k))},[te(B.$slots,"default",{open:Q},()=>[ze(X(e.text),1)])],6)]),_:2},1032,["class"])]),_:3},8,["open","disabled","unmount-on-hide","class"])):L("",!0)}},Fw=he({name:"MessagePartRenderer",props:{message:{type:Object,default:null},projectId:{type:String,default:void 0},part:{type:Object,default:null}},setup(e){return()=>{if(!e.part)return null;switch(e.part.type){case"text":return Ne(_w,{role:e.message?.role,part:e.part});case"reasoning":return Ne(Dw,{icon:"i-lucide-brain",text:[...e.part.summary,...e.part.content].join(`
|
|
201
|
-
|
|
202
|
-
`).trim(),streaming:e.part.state==="streaming",defaultOpen:e.part.state==="streaming",autoCloseDelay:600});case"attachment":return Ne(nf,{projectId:e.projectId,part:e.part});case Us:return Ne(of,{part:e.part});case Ue:return Ne(Ap,{part:e.part});default:return Ne("pre",{class:"overflow-x-auto rounded-lg border border-dashed border-default bg-elevated/40 p-3 text-xs text-muted"},JSON.stringify(e.part,null,2))}}}}),Nw={class:"space-y-3"},Qw=he({__name:"MessageContent",props:{message:{},projectId:{}},setup(e){const t=(n,r,i)=>"data"in r&&r.data&&"item"in r.data&&typeof r.data.item.id=="string"?r.data.item.id:`${n??"message"}-${r.type}-${i}`;return(n,r)=>(v(),M("div",Nw,[(v(!0),M(Ce,null,Se(e.message?.parts??[],(i,s)=>(v(),K(m(Fw),{key:t(e.message?.id,i,s),message:e.message,"project-id":e.projectId,part:i},null,8,["message","project-id","part"]))),128))]))}}),Gw=Object.assign(Qw,{__name:"MessageContent"}),Rw=new Set(["item/started","item/agentMessage/delta","item/plan/delta","item/reasoning/textDelta","item/reasoning/summaryTextDelta","item/commandExecution/outputDelta","item/fileChange/outputDelta","item/mcpToolCall/progress"]),Mw=e=>e?"turn/steer":"turn/start",Ww=e=>e.activeThreadId!==null&&e.liveStreamThreadId===e.activeThreadId&&e.liveStreamTurnId!==null,Kw=e=>e.activeThreadId!==null&&e.liveStreamThreadId===e.activeThreadId&&e.status==="submitted"||Ww(e),Tw=e=>e.routeThreadId!==null,Yw=e=>/no active turn to steer|active turn is no longer available/i.test(e),_l=e=>e.liveStreamTurnId===null||e.notificationTurnId===null||e.notificationTurnId===e.liveStreamTurnId||e.notificationMethod==="turn/started",Lw=e=>e.hasDraftContent?"ready":e.status,Pw=e=>Rw.has(e),Sl=(e,t)=>e.filter(n=>n.id!==t),Ow=(e,t)=>e.filter(n=>n!==t),Jw=(e,t)=>e.type==="text"&&t.type==="text"?e.text===t.text:e.type==="attachment"&&t.type==="attachment"?e.attachment.kind===t.attachment.kind&&e.attachment.name===t.attachment.name:!1,Uw=(e,t,n)=>{const r=e.findIndex(i=>i.id===t);return r!==-1?r:n.role!=="user"?-1:e.findIndex(i=>i.role==="user"&&i.pending===!0&&i.parts.length===n.parts.length&&i.parts.every((s,o)=>Jw(s,n.parts[o])))},Zw=(e,t,n)=>{const r=Uw(e,t,n);return r===-1?St(e,n):e.map((i,s)=>s===r?n:i)},Hw=()=>typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,jw=e=>{const t=Ls(),n=P([]),r=P(!1),i=P(!1),s=P(null),o=P(null),a=P(0),l=B=>{URL.revokeObjectURL(B.previewUrl)},c=B=>{const D=Array.from(B??[]);if(!D.length)return;const{accepted:Q,issues:R}=jh(D,n.value.length);s.value=R[0]?.message??null,Q.length&&(n.value=[...n.value,...Q.map(Y=>({id:Hw(),file:Y,name:Y.name,size:Y.size,mediaType:Y.type||"application/octet-stream",previewUrl:URL.createObjectURL(Y)}))])};return{attachments:n,isDragging:r,isUploading:i,error:s,fileInput:o,addFiles:c,removeAttachment:B=>{const D=n.value.find(Q=>Q.id===B);D&&l(D),n.value=n.value.filter(Q=>Q.id!==B),n.value.length||(s.value=null)},replaceAttachments:B=>{n.value=B},clearAttachments:(B={})=>{if(B.revoke!==!1)for(const D of n.value)l(D);n.value=[],s.value=null},discardSnapshot:B=>{for(const D of B)l(D)},openFilePicker:()=>{o.value?.click()},onFileInputChange:B=>{const D=B.target;c(D?.files??null),D&&(D.value="")},onPaste:B=>{const D=Array.from(B.clipboardData?.items??[]).filter(Q=>Q.kind==="file").map(Q=>Q.getAsFile()).filter(Q=>!!Q);D.length&&(B.preventDefault(),c(D))},onDragEnter:B=>{B.dataTransfer?.types.includes("Files")&&(B.preventDefault(),a.value+=1,r.value=!0)},onDragLeave:()=>{a.value=Math.max(0,a.value-1),a.value===0&&(r.value=!1)},onDragOver:B=>{B.dataTransfer?.types.includes("Files")&&B.preventDefault()},onDrop:B=>{B.preventDefault(),c(B.dataTransfer?.files??null),a.value=0,r.value=!1},uploadAttachments:async(B,D)=>{if(!D.length)return[];const Q=new FormData;Q.append("threadId",B);for(const R of D)Q.append("file",R.file,R.name);i.value=!0;try{return(await yd(zh({projectId:e,configuredBase:String(t.public.serverBase??"")}),{method:"POST",body:Q})).files}finally{i.value=!1}}}},rn=["none","minimal","low","medium","high","xhigh"],Ct=[{id:"gpt-5.4",model:"gpt-5.4",displayName:"GPT-5.4",hidden:!1,isDefault:!0,defaultReasoningEffort:"medium",supportedReasoningEfforts:[...rn]},{id:"gpt-5.4-mini",model:"gpt-5.4-mini",displayName:"GPT-5.4 Mini",hidden:!1,isDefault:!1,defaultReasoningEffort:"medium",supportedReasoningEfforts:[...rn]},{id:"gpt-5.3-codex",model:"gpt-5.3-codex",displayName:"GPT-5.3 Codex",hidden:!1,isDefault:!1,defaultReasoningEffort:"medium",supportedReasoningEfforts:[...rn]}],Gt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ci=e=>typeof e=="string"&&rn.includes(e),ft=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string"&&e.trim()){const t=Number(e);if(Number.isFinite(t))return t}return null},qw=e=>Array.isArray(e)?e.flatMap(t=>{if(ci(t))return[t];const n=Gt(t)?t:null;return ci(n?.reasoningEffort)?[n.reasoningEffort]:[]}):[],zw=e=>{const t=Gt(e)?e:null;if(!t||typeof t.model!="string")return null;const n=qw(t.supportedReasoningEfforts),r=ci(t.defaultReasoningEffort)?t.defaultReasoningEffort:n[0]??"medium";return{id:typeof t.id=="string"?t.id:t.model,model:t.model,displayName:typeof t.displayName=="string"&&t.displayName.trim()?t.displayName.trim():t.model,hidden:!!t.hidden,isDefault:!!t.isDefault,defaultReasoningEffort:r,supportedReasoningEfforts:n.length>0?n:[...rn]}},Vw=e=>{const n=(Gt(e)&&Array.isArray(e.data)?e.data:Array.isArray(e)?e:[]).map(zw).filter(r=>r!==null);return n.length>0?n:Ct},El=(e,t,n)=>!t||e.some(r=>r.model===t)?e:[{id:t,model:t,displayName:t,hidden:!1,isDefault:!1,defaultReasoningEffort:n??"medium",supportedReasoningEfforts:[...rn]},...e],Yr=e=>{const t=e.filter(n=>!n.hidden);return t.length>0?t:Ct},$w=(e,t)=>t&&e.some(r=>r.model===t)?t:e.find(r=>r.isDefault)?.model??e[0]?.model??Ct[0].model,tA=(e,t)=>{const n=e.find(r=>r.model===t);return n?.supportedReasoningEfforts.length?n.supportedReasoningEfforts:[...rn]},Xw=(e,t,n)=>{const r=tA(e,t);if(n&&r.includes(n))return n;const i=e.find(s=>s.model===t);return i&&r.includes(i.defaultReasoningEffort)?i.defaultReasoningEffort:r[0]??"medium"},Dl=(e,t,n)=>{const r=$w(e,t);return{model:r,effort:Xw(e,r,n)}},ev=e=>{const t=Gt(e)&&Gt(e.config)?e.config:null;return{model:typeof t?.model=="string"?t.model:null,effort:ci(t?.model_reasoning_effort)?t.model_reasoning_effort:null,contextWindow:ft(t?.model_context_window)}},tv=e=>{const t=Gt(e)?e:null,n=Gt(t?.tokenUsage)?t.tokenUsage:null;if(!n)return null;const r=Gt(n.total)?n.total:{},i=Gt(n.last)?n.last:null;return{totalTokens:ft(r.totalTokens),totalInputTokens:ft(r.inputTokens)??0,totalCachedInputTokens:ft(r.cachedInputTokens)??0,totalOutputTokens:ft(r.outputTokens)??0,lastUsageKnown:i!==null,lastTotalTokens:ft(i?.totalTokens),lastInputTokens:ft(i?.inputTokens)??0,lastCachedInputTokens:ft(i?.cachedInputTokens)??0,lastOutputTokens:ft(i?.outputTokens)??0,modelContextWindow:ft(n.modelContextWindow)}},Fl=(e,t)=>{const n={};return e&&(n.model=e),t&&(n.effort=t),n},Nl=e=>{switch(e){case"xhigh":return"Very high";case"none":return"None";default:return e.charAt(0).toUpperCase()+e.slice(1)}},Cn=e=>{if(e<1e3)return String(e);const t=e/1e3;return`${(t>=10?t.toFixed(0):t.toFixed(1)).replace(/\\.0$/,"")}k`},nv=(e,t)=>{const n=e?.modelContextWindow??t,r=e?e.lastTotalTokens??(e.lastUsageKnown?e.lastInputTokens+e.lastOutputTokens:null):null;if(!n||r==null)return{contextWindow:n,usedTokens:r,remainingTokens:null,usedPercent:null,remainingPercent:null};const i=Math.max(0,Math.min(n,r)),s=Math.max(0,Math.min(100,i/n*100));return{contextWindow:n,usedTokens:i,remainingTokens:Math.max(0,n-i),usedPercent:s,remainingPercent:Math.max(0,100-s)}},rv=e=>e.contextWindow!==null&&e.usedTokens!==null,Ql=new Map,iv=()=>({messages:P([]),subagentPanels:P([]),status:P("ready"),error:P(null),activeThreadId:P(null),threadTitle:P(null),pendingThreadId:P(null),autoRedirectThreadId:P(null),loadVersion:P(0),promptControlsLoaded:P(!1),promptControlsLoading:P(!1),availableModels:P(Ct),selectedModel:P(Ct[0].model),selectedEffort:P(Ct[0].defaultReasoningEffort),modelContextWindow:P(null),tokenUsage:P(null),pendingLiveStream:null,liveStream:null}),sv=e=>{const t=Ql.get(e);if(t)return t;const n=iv();return Ql.set(e,n),n},Mt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Gl=e=>e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown RPC error."),ov=async e=>{switch(e.method){case"item/commandExecution/requestApproval":case"item/fileChange/requestApproval":return{decision:"decline"};case"item/permissions/requestApproval":return{permissions:{},scope:"turn"};case"item/tool/requestUserInput":return{answers:{}};case"mcpServer/elicitation/request":return{action:"decline",content:null,_meta:null};case"applyPatchApproval":case"execCommandApproval":return{decision:"denied"};default:return null}},Lr=e=>{const t=Mt(e.params)?e.params:null,n=t?.threadId;if(typeof n=="string")return n;const r=Mt(t?.thread)?t.thread:null;return typeof r?.id=="string"?r.id:null},Wt=e=>{const t=Mt(e.params)?e.params:null,n=t?.turnId;if(typeof n=="string")return n;const r=Mt(t?.turn)?t?.turn:null;return typeof r?.id=="string"?r.id:null},av=e=>{const t=Mt(e.params)?e.params:null,r=(Mt(t?.thread)?t.thread:null)?.name??t?.name??t?.title;return typeof r=="string"?r:null},lv=e=>{const t=Mt(e.params)?e.params:null,r=(Mt(t?.thread)?t.thread:null)?.updatedAt??t?.updatedAt;return typeof r=="number"?r:void 0};class cv{url;socket=null;connectPromise=null;initialized=!1;nextRequestId=1;pending=new Map;listeners=new Set;constructor(t){this.url=t}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}async connect(){if(!(this.initialized&&this.socket?.readyState===WebSocket.OPEN))return this.connectPromise?await this.connectPromise:(this.connectPromise=new Promise((t,n)=>{const r=new WebSocket(this.url);this.socket=r;const i=()=>{r.removeEventListener("open",o),r.removeEventListener("error",s)},s=()=>{i(),n(new Error(`Failed to connect to ${this.url}`))},o=async()=>{i();try{await this.sendRequestNow("initialize",{clientInfo:{name:"@codori/client",title:"Codori Client",version:"0.1.0"},capabilities:{experimentalApi:!0,optOutNotificationMethods:null}}),this.sendNotificationNow("initialized"),this.initialized=!0,t()}catch(a){n(Gl(a))}};r.addEventListener("open",o,{once:!0}),r.addEventListener("error",s,{once:!0}),r.addEventListener("message",a=>{this.handleMessage(a.data)}),r.addEventListener("close",()=>{this.initialized=!1,this.socket=null,this.connectPromise=null;const a=new Error("Codex RPC connection closed.");for(const[l,c]of this.pending.entries())c.reject(a),this.pending.delete(l)},{once:!0})}).finally(()=>{this.initialized||(this.connectPromise=null)}),await this.connectPromise)}async request(t,n){return await this.connect(),await this.sendRequestNow(t,n)}close(){(this.socket?.readyState===WebSocket.OPEN||this.socket?.readyState===WebSocket.CONNECTING)&&this.socket.close()}async handleMessage(t){const n=await this.parsePayload(t);if(n){if("id"in n&&"method"in n){const r=await ov(n);this.sendRaw({id:n.id,result:r});return}if("id"in n){const r=this.pending.get(n.id);if(!r)return;if(this.pending.delete(n.id),n.error){r.reject(new Error(n.error.message));return}r.resolve(n.result);return}for(const r of this.listeners)r(n)}}async parsePayload(t){const n=typeof t=="string"?t:t instanceof ArrayBuffer?new TextDecoder().decode(t):t instanceof Blob?await t.text():null;if(!n)return null;try{const r=JSON.parse(n);return Mt(r)&&(typeof r.id=="number"&&typeof r.method=="string"||typeof r.id=="number"||typeof r.method=="string")?r:null}catch{return null}}async sendRequestNow(t,n){const r=this.nextRequestId;this.nextRequestId+=1;const i={id:r,method:t};return n!==void 0&&(i.params=n),await new Promise((s,o)=>{this.pending.set(r,{resolve:a=>s(a),reject:o});try{this.sendRaw(i)}catch(a){this.pending.delete(r),o(Gl(a))}})}sendNotificationNow(t,n){const r={method:t};n!==void 0&&(r.params=n),this.sendRaw(r)}sendRaw(t){if(!this.socket||this.socket.readyState!==WebSocket.OPEN)throw new Error("Codex RPC socket is not open.");this.socket.send(JSON.stringify(t))}}const Rl=new Map,nA=()=>{const e=Ls();return{getClient:n=>{const r=n,i=Rl.get(r);if(i)return i;const s=Gd(String(e.public.serverWsBase??""),String(e.public.serverBase??"")),o=new URL(`/api/projects/${Os(n)}/rpc`,s).toString(),a=new cv(o);return Rl.set(r,a),a}}},uv=()=>{const e=P(!1);return{composing:e,onCompositionStart:()=>{e.value=!0},onCompositionEnd:()=>{e.value=!1},shouldSubmit:i=>i.shiftKey?!1:!e.value}},Ml=new Map,ui=e=>e.name?.trim()||e.preview.trim()||`Thread ${e.id}`,rA=(e,t)=>[...e.filter(r=>r.id!==t.id),t].sort((r,i)=>i.updatedAt-r.updatedAt),Av=(e,t)=>{const n=t.title.trim();if(!n)return e;const r=e.find(i=>i.id===t.threadId);return rA(e,{id:t.threadId,title:n,updatedAt:t.updatedAt??r?.updatedAt??Date.now()})},dv=()=>({threads:P([]),loading:P(!1),error:P(null)}),Wl=e=>({...e,setThreads:t=>{e.threads.value=[...t].sort((n,r)=>r.updatedAt-n.updatedAt)},setLoading:t=>{e.loading.value=t},setError:t=>{e.error.value=t},syncThreadSummary:t=>{e.threads.value=rA(e.threads.value,{id:t.id,title:ui(t),updatedAt:t.updatedAt})},updateThreadSummaryTitle:(t,n,r)=>{e.threads.value=Av(e.threads.value,{threadId:t,title:n,updatedAt:r})}}),iA=e=>{const t=Ml.get(e);if(t)return Wl(t);const n=dv();return Ml.set(e,n),Wl(n)},hv=e=>e==="turn/start",fv=(e,t)=>e==="ready"||e==="error"?e:t?"submitted":"streaming",pv={class:"flex h-full min-h-0 flex-col bg-default"},gv={key:0,class:"flex min-h-full items-center justify-center px-6 py-10"},mv={class:"flex w-full max-w-4xl flex-col items-center gap-10 text-center"},yv={class:"space-y-4"},Cv={class:"space-y-2"},bv={class:"text-balance text-3xl font-medium tracking-tight text-toned md:text-4xl"},Iv={class:"grid w-full gap-3 md:grid-cols-3"},xv=["onClick"],wv={class:"text-sm font-semibold text-highlighted"},vv={class:"mt-3 text-sm leading-6 text-muted"},kv={class:"sticky bottom-0 shrink-0 border-t border-default bg-default/95 px-4 py-3 backdrop-blur md:px-6"},Bv={class:"mx-auto w-full max-w-5xl"},_v={key:0,class:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-3xl border border-dashed border-primary/50 bg-primary/10 text-sm font-medium text-primary backdrop-blur-sm"},Sv={key:0,class:"flex flex-wrap gap-2 pb-2"},Ev=["src","alt"],Dv={class:"min-w-0"},Fv={class:"max-w-40 truncate text-xs font-medium text-highlighted"},Nv={class:"text-[11px] text-muted"},Qv=["disabled"],Gv={class:"flex w-full flex-wrap items-center gap-2 pt-1"},Rv={class:"flex min-w-0 flex-1 flex-wrap items-center gap-2"},Mv={class:"ml-auto flex shrink-0 items-center"},Wv={type:"button",class:"flex h-8 shrink-0 items-center gap-2 px-0 text-left text-muted"},Kv={class:"relative flex size-7 items-center justify-center"},Tv={viewBox:"0 0 36 36",class:"size-7 -rotate-90","aria-hidden":"true"},Yv=["stroke-dasharray"],Lv={class:"absolute text-[9px] font-semibold text-highlighted"},Pv={class:"w-72 space-y-3 p-4"},Ov={class:"space-y-1"},Jv={class:"text-sm font-medium text-highlighted"},Uv={class:"grid grid-cols-2 gap-3 text-sm"},Zv={class:"rounded-2xl border border-default bg-elevated/35 px-3 py-2"},Hv={class:"mt-1 font-semibold text-highlighted"},jv={class:"text-xs text-muted"},qv={class:"rounded-2xl border border-default bg-elevated/35 px-3 py-2"},zv={class:"mt-1 font-semibold text-highlighted"},Vv={class:"text-xs text-muted"},$v={class:"grid grid-cols-2 gap-3 text-sm"},Xv={class:"rounded-2xl border border-default bg-elevated/35 px-3 py-2"},ek={class:"mt-1 font-semibold text-highlighted"},tk={class:"text-xs text-muted"},nk={class:"rounded-2xl border border-default bg-elevated/35 px-3 py-2"},rk={class:"mt-1 font-semibold text-highlighted"},ik={class:"text-xs text-muted"},sk=he({__name:"ChatWorkspace",props:{projectId:{},threadId:{}},setup(e){const t=e,n=Cd(),{getClient:r}=nA(),{loaded:i,refreshProjects:s,getProject:o,startProject:a}=tc(),{onCompositionStart:l,onCompositionEnd:c,shouldSubmit:A}=uv(),{attachments:u,isDragging:d,isUploading:f,error:h,fileInput:y,removeAttachment:C,replaceAttachments:x,clearAttachments:p,discardSnapshot:b,openFilePicker:I,onFileInputChange:k,onPaste:B,onDragEnter:D,onDragLeave:Q,onDragOver:R,onDrop:Y,uploadAttachments:U}=jw(t.projectId),V=P(""),ge=P(null),q=P(!0),ee=sv(t.projectId),{syncThreadSummary:se,updateThreadSummaryTitle:Me}=iA(t.projectId),{messages:ce,subagentPanels:He,status:le,error:xe,activeThreadId:ue,threadTitle:Ve,pendingThreadId:ne,autoRedirectThreadId:Ge,loadVersion:je,promptControlsLoaded:We,promptControlsLoading:Be,availableModels:we,selectedModel:W,selectedEffort:fe,modelContextWindow:wt,tokenUsage:$e}=ee,Kn=G(()=>o(t.projectId)),wr=G(()=>h.value??xe.value),oA=G(()=>wr.value?new Error(wr.value):void 0),vr=P(!1),ki=P(!1),Tn=P(!1),Yn=G(()=>le.value==="submitted"||le.value==="streaming"||f.value),aA=G(()=>V.value.trim().length>0||u.value.length>0),ln=G(()=>f.value||vr.value),lA=G(()=>Lw({status:le.value,hasDraftContent:aA.value})),kr=G(()=>t.threadId??null),po=G(()=>Kn.value?.projectId??t.projectId),cA=G(()=>fv(le.value,ki.value)),uA=G(()=>!kr.value&&!ue.value&&ce.value.length===0&&!Yn.value),AA=G(()=>{const g=po.value;return[{title:"Map the codebase",text:`Summarize the structure of ${g} and identify the main entry points.`},{title:"Find the next task",text:`Inspect ${g} and suggest the highest-impact improvement to make next.`},{title:"Build a plan",text:`Read ${g} and propose a concrete implementation plan for the next feature.`}]}),Ln=G(()=>{const g=El(we.value.length>0?we.value:Ct,W.value,fe.value);return Yr(g)}),dA=G(()=>Ln.value.find(g=>g.model===W.value)??Ln.value[0]??Ct[0]),hA=G(()=>Ln.value.map(g=>({label:g.displayName,value:g.model}))),fA=G(()=>tA(Ln.value,W.value)),pA=G(()=>fA.value.map(g=>({label:Nl(g),value:g}))),qt=G(()=>nv($e.value,wt.value)),gA=G(()=>rv(qt.value)),mA=G(()=>qt.value.usedPercent??0),yA=G(()=>{const g=qt.value.remainingPercent;return g==null?"ctx":`${Math.round(g)}%`}),go=(g,w)=>{const _=El(we.value.length>0?we.value:Ct,g??W.value,w??fe.value),N=Yr(_),S=Dl(N,g??W.value,w??fe.value);we.value=N,W.value!==S.model&&(W.value=S.model),fe.value!==S.effort&&(fe.value=S.effort)},CA=(g,w)=>{go(g??null,w??null)},mo=async()=>{if(!We.value)return Pn?await Pn:(Pn=(async()=>{Be.value=!0;try{await Hn();const g=r(t.projectId),w=W.value,_=fe.value;let N=we.value.length>0?we.value:Ct,S=null,T=null;const[Z,$]=await Promise.allSettled([g.request("model/list"),g.request("config/read")]);if(Z.status==="fulfilled"?N=Yr(Vw(Z.value)):N=Yr(N),$.status==="fulfilled"){const H=ev($.value);H.contextWindow!=null&&(wt.value=H.contextWindow),S=H.model,T=H.effort}we.value=N;const ae=W.value!==w?W.value:S??w,oe=fe.value!==_?fe.value:T??_;go(ae,oe),We.value=!0}finally{Be.value=!1,Pn=null}})(),await Pn)},Bi=new Map,cn=new Map;let Pn=null,On=null;const yo=g=>g?!/(completed|failed|error|cancelled|canceled|interrupted|stopped)/i.test(g):!1,Jn=()=>ee.liveStream?.threadId===ue.value?ee.liveStream:null,bA=()=>!!(Jn()||ee.pendingLiveStream),IA=()=>Kw({activeThreadId:ue.value,liveStreamThreadId:ee.liveStream?.threadId??null,liveStreamTurnId:ee.liveStream?.turnId??null,status:le.value}),xA=(g,w)=>{const _=g.turnIdWaiters.splice(0,g.turnIdWaiters.length);for(const N of _)N.reject(w)},Co=(g,w=[])=>({threadId:g,turnId:null,bufferedNotifications:w,observedSubagentThreadIds:new Set,pendingUserMessageIds:[],turnIdWaiters:[],interruptRequested:!1,interruptAcknowledged:!1,unsubscribe:null}),_i=g=>{ee.liveStream=g,vr.value=g?.interruptRequested===!0},Br=(g,w)=>{g.interruptRequested=w,ee.liveStream===g&&(vr.value=w)},_r=(g,w)=>{if(g.turnId=w,!w)return;g.interruptAcknowledged=!1;const _=g.turnIdWaiters.splice(0,g.turnIdWaiters.length);for(const N of _)N.resolve(w)},bo=async g=>g.turnId?g.turnId:await new Promise((w,_)=>{g.turnIdWaiters.push({resolve:w,reject:_})}),Io=(g,w)=>{g.pendingUserMessageIds.includes(w)||g.pendingUserMessageIds.push(w)},wA=g=>{for(const w of g.bufferedNotifications.splice(0,g.bufferedNotifications.length)){const _=Wt(w);_&&_!==g.turnId||Er(w)}},At=g=>{const w=ee.liveStream;return w?(w.unsubscribe?.(),xA(w,g??new Error("The active turn is no longer available.")),_i(null),w):(vr.value=!1,null)},Si=async()=>{const g=Jn();if(g)return g;if(ee.pendingLiveStream)return await ee.pendingLiveStream;const w=(async()=>{await Hn();const{threadId:_,created:N}=await MA(),S=r(t.projectId),T=[];At();const Z=Co(_,T);return Z.unsubscribe=S.subscribe($=>{const ae=Lr($);if(!ae)return;if(ae!==_){Z.observedSubagentThreadIds.has(ae)&&Li(ae,$);return}if(!Z.turnId){T.push($);return}const oe=Wt($);_l({liveStreamTurnId:Z.turnId,notificationMethod:$.method,notificationTurnId:oe})&&Er($)}),_i(Z),N&&!kr.value&&(ne.value=_),Z})();ee.pendingLiveStream=w;try{return await w}finally{ee.pendingLiveStream===w&&(ee.pendingLiveStream=null)}},vA=()=>typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`local-user-${crypto.randomUUID()}`:`local-user-${Date.now()}-${Math.random().toString(16).slice(2)}`,kA=(g,w)=>({id:vA(),role:"user",parts:[...g.trim()?[{type:"text",text:g,state:"done"}]:[],...w.map(_=>({type:"attachment",attachment:{kind:"image",name:_.name,mediaType:_.mediaType,url:_.previewUrl}}))]}),BA=(g,w)=>{w.length!==0&&cn.set(g,w)},_A=g=>g>=1024*1024?`${(g/(1024*1024)).toFixed(1)} MB`:g>=1024?`${Math.round(g/1024)} KB`:`${g} B`,SA=g=>{ce.value=Sl(ce.value,g),cn.delete(g)},nt=g=>{ki.value=g},xo=g=>{g.type!=="userMessage"&&nt(!1)},Ei=(g,w)=>{V.value.trim()||(V.value=g),u.value.length===0&&w.length>0&&x(w)},EA=g=>{const w=Jn();w&&(w.pendingUserMessageIds=Ow(w.pendingUserMessageIds,g))},wo=g=>{const _=Jn()?.pendingUserMessageIds.shift()??null;if(!_){ce.value=St(ce.value,g);return}const N=cn.get(_);N&&(b(N),cn.delete(_)),ce.value=Zw(ce.value,_,g)},Un=(g,w)=>{if(g){for(const _ of g.pendingUserMessageIds){ce.value=Sl(ce.value,_);const N=cn.get(_);w?.discardSnapshots&&N&&b(N),cn.delete(_)}g.pendingUserMessageIds=[]}},vo=async g=>{const{client:w,liveStream:_,text:N,submittedAttachments:S,uploadedAttachments:T,optimisticMessageId:Z,queueOptimisticMessage:$=!0}=g;$&&Io(_,Z);const ae=T??await U(_.threadId,S),oe=await w.request("turn/start",{threadId:_.threadId,input:Jo(N,ae),cwd:Kn.value?.projectPath??null,approvalPolicy:"never",...Fl(W.value,fe.value)});$e.value=null,_r(_,oe.turn.id),wA(_)},DA=g=>g.slice(0,8),ko=(g,w)=>{const _=w?.agentNickname?.trim()||w?.name?.trim()||w?.preview?.trim();return _||`Agent ${DA(g)}`},Di=g=>He.value.find(w=>w.threadId===g),vt=g=>({threadId:g,name:ko(g),status:null,messages:[],firstSeenAt:Date.now(),lastSeenAt:Date.now(),turnId:null,bootstrapped:!1,bufferedNotifications:[]}),kt=(g,w)=>{const _=Di(g),N=w(_),S=He.value.findIndex(T=>T.threadId===g);return S===-1?(He.value=[...He.value,N],N):(He.value=He.value.map((T,Z)=>Z===S?N:T),N)},FA=g=>{ee.liveStream?.observedSubagentThreadIds.add(g)},Bo=g=>g.type==="text",Fi=g=>g.type===Ue,Zn=g=>{const w=g.parts.find(Fi);if(!w)throw new Error("Expected fallback item part.");return w.data},NA=()=>{const g=ge.value;g&&(q.value=g.scrollHeight-g.scrollTop-g.clientHeight<80)},QA=(g="auto")=>{const w=ge.value;w&&w.scrollTo({top:w.scrollHeight,behavior:g})},Ni=async(g="auto")=>{await Xe(),requestAnimationFrame(()=>{(q.value||Yn.value)&&QA(g)})},Hn=async()=>{i.value||await s(),Kn.value?.status!=="running"&&await a(t.projectId)},GA=async g=>{const w=(async()=>{const _=je.value+1;je.value=_,xe.value=null,$e.value=null;try{await Hn();const N=r(t.projectId);ue.value=g;const S=ee.liveStream;if(S&&S.threadId!==g&&At(),!ee.liveStream){const oe=Co(g);oe.unsubscribe=N.subscribe(H=>{const Ee=Lr(H);if(!Ee)return;if(Ee!==g){oe.observedSubagentThreadIds.has(Ee)&&Li(Ee,H);return}if(!oe.turnId){oe.bufferedNotifications.push(H);return}const Dr=Wt(H);_l({liveStreamTurnId:oe.turnId,notificationMethod:H.method,notificationTurnId:Dr})&&Er(H)}),_i(oe)}const T=await N.request("thread/resume",{threadId:g,cwd:Kn.value?.projectPath??null,approvalPolicy:"never",persistExtendedHistory:!0}),Z=await N.request("thread/read",{threadId:g,includeTurns:!0});if(je.value!==_)return;CA(T.model??null,T.reasoningEffort??null),ue.value=Z.thread.id,Ve.value=ui(Z.thread),se(Z.thread),ce.value=Yo(Z.thread),LA(Z.thread),nt(!1);const $=[...Z.thread.turns].reverse().find(oe=>yo(oe.status));if(!$){At(),le.value="ready";return}if(!ee.liveStream){le.value="streaming";return}_r(ee.liveStream,$.id),le.value="streaming";const ae=ee.liveStream.bufferedNotifications.splice(0,ee.liveStream.bufferedNotifications.length);for(const oe of ae){const H=Wt(oe);H&&H!==$.id||Er(oe)}}catch(N){At(),xe.value=N instanceof Error?N.message:String(N),le.value="error"}})();On=w;try{await w}finally{On===w&&(On=null)}},RA=()=>{At(),ee.pendingLiveStream=null,ue.value=null,Ve.value=null,ne.value=null,Ge.value=null,ce.value=[],He.value=[],xe.value=null,$e.value=null,nt(!1),le.value="ready"},MA=async()=>{if(ue.value)return{threadId:ue.value,created:!1};await Hn();const w=await r(t.projectId).request("thread/start",{cwd:Kn.value?.projectPath??null,approvalPolicy:"never",experimentalRawEvents:!1,persistExtendedHistory:!0});return ue.value=w.thread.id,Ve.value=ui(w.thread),se(w.thread),{threadId:w.thread.id,created:!0}},WA=g=>{const[w]=In(g);w&&(ce.value=St(ce.value,{...w,pending:!0}))},Qi=(g,w,_)=>{const N=ce.value.find(S=>S.id===g);ce.value=St(ce.value,_(N??w))},_o=(g,w,_)=>{Qi(g,_,N=>{const S=N.parts.findIndex(Bo),T=S===-1?null:N.parts[S],$={type:"text",text:T?`${T.text}${w}`:w,state:"streaming"},ae=S===-1?[...N.parts,$]:N.parts.map((oe,H)=>H===S?$:oe);return{...N,pending:!0,parts:ae}})},Gi=(g,w,_)=>{Qi(g,w,N=>{const S=N.parts.findIndex(Fi),T=S===-1?null:N.parts[S].data,Z=_(T??Zn(w)),$={type:Ue,data:Z},ae=S===-1?[...N.parts,$]:N.parts.map((oe,H)=>H===S?$:oe);return{...N,pending:!0,parts:ae}})},Ri=g=>({id:g,role:"system",pending:!0,parts:[{type:Ue,data:{kind:"command_execution",item:{type:"commandExecution",id:g,command:"Command",aggregatedOutput:"",exitCode:null,status:"inProgress"}}}]}),Mi=g=>({id:g,role:"system",pending:!0,parts:[{type:Ue,data:{kind:"file_change",item:{type:"fileChange",id:g,changes:[],status:"inProgress",liveOutput:""}}}]}),Wi=g=>({id:g,role:"system",pending:!0,parts:[{type:Ue,data:{kind:"mcp_tool_call",item:{type:"mcpToolCall",id:g,server:"mcp",tool:"tool",arguments:null,result:null,error:null,status:"inProgress",progressMessages:[]}}}]}),So=g=>Zn(Ri(g)),Eo=g=>Zn(Mi(g)),Do=g=>Zn(Wi(g)),Ki=(g,w)=>{ce.value=St(ce.value,Oi(`event-${g}-${Date.now()}`,g==="turn.failed"?{kind:g,error:{message:w}}:{kind:g,message:w}))},Sr=(g,w)=>{kt(g,_=>{const N=_??vt(g);return{...N,messages:w(N.messages),lastSeenAt:Date.now()}})},Ti=(g,w,_,N)=>{Sr(g,S=>{const T=S.find(Z=>Z.id===w);return St(S,N(T??_))})},KA=(g,w,_,N)=>{Ti(g,w,N,S=>{const T=S.parts.findIndex(Bo),Z=T===-1?null:S.parts[T],ae={type:"text",text:Z?`${Z.text}${_}`:_,state:"streaming"},oe=T===-1?[...S.parts,ae]:S.parts.map((H,Ee)=>Ee===T?ae:H);return{...S,pending:!0,parts:oe}})},Yi=(g,w,_,N)=>{Ti(g,w,_,S=>{const T=S.parts.findIndex(Fi),Z=T===-1?null:S.parts[T].data,$=N(Z??Zn(_)),ae={type:Ue,data:$},oe=T===-1?[...S.parts,ae]:S.parts.map((H,Ee)=>Ee===T?ae:H);return{...S,pending:!0,parts:oe}})},Fo=(g,w,_)=>{Sr(g,N=>St(N,Oi(`subagent-event-${g}-${w}-${Date.now()}`,w==="turn.failed"?{kind:w,error:{message:_}}:{kind:w,message:_})))},TA=(g,w)=>{const[_]=In(w);_&&Sr(g,N=>St(N,{..._,pending:!0}))},YA=async g=>{if(!g)return;const w=Bi.get(g);if(w){await w;return}const _=(async()=>{try{await Hn();const S=await r(t.projectId).request("thread/read",{threadId:g,includeTurns:!0}),T=[...S.thread.turns].reverse().find($=>yo($.status)),Z=Di(g)?.bufferedNotifications.slice()??[];kt(g,$=>{const ae=$??vt(g);return{...ae,name:ko(g,S.thread),messages:Yo(S.thread),turnId:T?.id??null,bootstrapped:!0,bufferedNotifications:[],status:$?.status??(T?"running":ae.status)??null,lastSeenAt:Date.now()}});for(const $ of Z)Li(g,$)}catch{kt(g,N=>({...N??vt(g),lastSeenAt:Date.now()}))}finally{Bi.delete(g)}})();Bi.set(g,_),await _},jn=g=>{const w=[...g.receiverThreadIds,...Object.keys(g.agentsStates).filter(_=>!g.receiverThreadIds.includes(_))];for(const _ of w){const N=g.agentsStates[_];FA(_),kt(_,S=>{const T=S??vt(_);return{...T,status:N?.status??T.status,lastSeenAt:Date.now()}})}for(const _ of w)YA(_)},LA=g=>{He.value=[];for(const w of g.turns)for(const _ of w.items)_.type==="collabAgentToolCall"&&jn(_)},Li=(g,w)=>{const _=Di(g);if(!_)return;if(!_.bootstrapped){kt(g,S=>({...S??vt(g),bufferedNotifications:[...S?.bufferedNotifications??[],w],lastSeenAt:Date.now()}));return}const N=Wt(w);if(!(_.turnId&&N&&N!==_.turnId&&w.method!=="turn/started"))switch(w.method){case"turn/started":{kt(g,S=>({...S??vt(g),turnId:Wt(w),status:S?.status==="completed"?S.status:"running",lastSeenAt:Date.now()}));return}case"item/started":{const S=w.params;S.item.type==="collabAgentToolCall"&&jn(S.item),TA(g,S.item);return}case"item/completed":{const S=w.params;S.item.type==="collabAgentToolCall"&&jn(S.item);for(const T of In(S.item))Sr(g,Z=>Lo(Z,{...T,pending:!1}));return}case"item/agentMessage/delta":case"item/plan/delta":{const S=w.params;KA(g,S.itemId,S.delta,{id:S.itemId,role:"assistant",pending:!0,parts:[{type:"text",text:"",state:"streaming"}]});return}case"item/reasoning/textDelta":case"item/reasoning/summaryTextDelta":{const S=w.params;Ti(g,S.itemId,{id:S.itemId,role:"assistant",pending:!0,parts:[{type:"reasoning",summary:[],content:[],state:"streaming"}]},T=>{const Z=T.parts.findIndex(H=>H.type==="reasoning"),$=Z===-1?{summary:[],content:[]}:T.parts[Z],ae={type:"reasoning",summary:w.method==="item/reasoning/summaryTextDelta"?[...$.summary,S.delta]:$.summary,content:w.method==="item/reasoning/textDelta"?[...$.content,S.delta]:$.content,state:"streaming"},oe=Z===-1?[...T.parts,ae]:T.parts.map((H,Ee)=>Ee===Z?ae:H);return{...T,pending:!0,parts:oe}});return}case"item/commandExecution/outputDelta":{const S=w.params,T=So(S.itemId);Yi(g,S.itemId,Ri(S.itemId),Z=>({kind:"command_execution",item:{...Z.kind==="command_execution"?Z.item:T.item,aggregatedOutput:`${(Z.kind==="command_execution"?Z.item.aggregatedOutput:"")??""}${S.delta}`,status:"inProgress"}}));return}case"item/fileChange/outputDelta":{const S=w.params,T=Eo(S.itemId);Yi(g,S.itemId,Mi(S.itemId),Z=>{const $=Z.kind==="file_change"?Z.item:T.item;return{kind:"file_change",item:{...$,liveOutput:`${$.liveOutput??""}${S.delta}`,status:"inProgress"}}});return}case"item/mcpToolCall/progress":{const S=w.params,T=Do(S.itemId);Yi(g,S.itemId,Wi(S.itemId),Z=>{const $=Z.kind==="mcp_tool_call"?Z.item:T.item;return{kind:"mcp_tool_call",item:{...$,progressMessages:[...$.progressMessages??[],S.message],status:"inProgress"}}});return}case"turn/completed":{kt(g,S=>({...S??vt(g),turnId:null,status:Uh(S?.status??null)?"completed":S?.status??null,lastSeenAt:Date.now()}));return}case"turn/failed":{const T=w.params.error?.message??"The turn failed.";Fo(g,"turn.failed",T),kt(g,Z=>({...Z??vt(g),status:"errored",turnId:null,lastSeenAt:Date.now()}));return}case"stream/error":{const T=w.params.message??"The stream failed.";Fo(g,"stream.error",T),kt(g,Z=>({...Z??vt(g),status:"errored",turnId:null,lastSeenAt:Date.now()}));return}default:return}},Er=g=>{const w=Jn();if(!(w?.interruptAcknowledged&&Pw(g.method)))switch(g.method){case"thread/started":{const _=Lr(g);if(!_)return;ue.value=_,ne.value=ne.value??_;return}case"thread/name/updated":{const _=Lr(g),N=av(g);if(!_||!N)return;const S=N.trim();if(!S)return;ue.value===_&&(Ve.value=S),Me(_,S,lv(g));return}case"turn/started":{w&&(_r(w,Wt(g)),Br(w,!1)),ce.value=St(ce.value,Oi(`event-turn-started-${Wt(g)??Date.now()}`,{kind:"turn.started"})),le.value="streaming";return}case"item/started":{const _=g.params;if(_.item.type==="collabAgentToolCall"&&jn(_.item),_.item.type==="userMessage"){for(const N of In(_.item))wo({...N,pending:!1});le.value="streaming";return}xo(_.item),WA(_.item),le.value="streaming";return}case"item/completed":{const _=g.params;_.item.type==="collabAgentToolCall"&&jn(_.item),xo(_.item);for(const N of In(_.item)){const S={...N,pending:!1};if(_.item.type==="userMessage"){wo(S);continue}ce.value=Lo(ce.value,S)}return}case"item/agentMessage/delta":{const _=g.params;nt(!1),_o(_.itemId,_.delta,{id:_.itemId,role:"assistant",pending:!0,parts:[{type:"text",text:"",state:"streaming"}]}),le.value="streaming";return}case"item/plan/delta":{const _=g.params;nt(!1),_o(_.itemId,_.delta,{id:_.itemId,role:"assistant",pending:!0,parts:[{type:"text",text:"",state:"streaming"}]}),le.value="streaming";return}case"item/reasoning/textDelta":case"item/reasoning/summaryTextDelta":{const _=g.params;nt(!1),Qi(_.itemId,{id:_.itemId,role:"assistant",pending:!0,parts:[{type:"reasoning",summary:[],content:[],state:"streaming"}]},N=>{const S=N.parts.findIndex(ae=>ae.type==="reasoning"),T=S===-1?{summary:[],content:[]}:N.parts[S],Z={type:"reasoning",summary:g.method==="item/reasoning/summaryTextDelta"?[...T.summary,_.delta]:T.summary,content:g.method==="item/reasoning/textDelta"?[...T.content,_.delta]:T.content,state:"streaming"},$=S===-1?[...N.parts,Z]:N.parts.map((ae,oe)=>oe===S?Z:ae);return{...N,pending:!0,parts:$}}),le.value="streaming";return}case"item/commandExecution/outputDelta":{const _=g.params,N=So(_.itemId);Gi(_.itemId,Ri(_.itemId),S=>({kind:"command_execution",item:{...S.kind==="command_execution"?S.item:N.item,aggregatedOutput:`${(S.kind==="command_execution"?S.item.aggregatedOutput:"")??""}${_.delta}`,status:"inProgress"}})),le.value="streaming";return}case"item/fileChange/outputDelta":{const _=g.params,N=Eo(_.itemId);Gi(_.itemId,Mi(_.itemId),S=>{const T=S.kind==="file_change"?S.item:N.item;return{kind:"file_change",item:{...T,liveOutput:`${T.liveOutput??""}${_.delta}`,status:"inProgress"}}}),le.value="streaming";return}case"item/mcpToolCall/progress":{const _=g.params,N=Do(_.itemId);Gi(_.itemId,Wi(_.itemId),S=>{const T=S.kind==="mcp_tool_call"?S.item:N.item;return{kind:"mcp_tool_call",item:{...T,progressMessages:[...T.progressMessages??[],_.message],status:"inProgress"}}}),le.value="streaming";return}case"thread/tokenUsage/updated":{const _=tv(g.params);_&&($e.value=_,_.modelContextWindow!=null&&(wt.value=_.modelContextWindow));return}case"error":{const N=g.params.error?.message??"The stream failed.";nt(!1),Ki("stream.error",N),Un(w,{discardSnapshots:!0}),At(new Error(N)),xe.value=N,le.value="error";return}case"turn/failed":{const N=g.params.error?.message??"The turn failed.";nt(!1),Ki("turn.failed",N),Un(w,{discardSnapshots:!0}),At(new Error(N)),xe.value=N,le.value="error";return}case"stream/error":{const N=g.params.message??"The stream failed.";nt(!1),Ki("stream.error",N),Un(w,{discardSnapshots:!0}),At(new Error(N)),xe.value=N,le.value="error";return}case"turn/completed":{nt(!1),Un(w,{discardSnapshots:!0}),xe.value=null,le.value="ready",At();return}default:return}},Pi=async()=>{if(Tn.value)return;Tn.value=!0;const g=V.value.trim(),w=u.value.slice();if(!g&&w.length===0){Tn.value=!1;return}V.value="",p({revoke:!1});try{await mo()}catch(_){Ei(g,w),xe.value=_ instanceof Error?_.message:String(_),le.value="error",Tn.value=!1;return}try{On&&Tw({hasPendingThreadHydration:!0,routeThreadId:kr.value})&&await On,q.value=!0,xe.value=null,h.value=null;const _=Mw(IA());_==="turn/start"&&(le.value="submitted");const N=kA(g,w),S=N.id;BA(S,w),ce.value=[...ce.value,N],nt(hv(_));let T=null,Z=_;try{const $=r(t.projectId);if(_==="turn/steer"){const oe=await Si();Io(oe,S);let H;try{H=await U(oe.threadId,w);const Ee=await bo(oe);await $.request("turn/steer",{threadId:oe.threadId,expectedTurnId:Ee,input:Jo(g,H),...Fl(W.value,fe.value)}),$e.value=null}catch(Ee){const Dr=Ee instanceof Error?Ee:new Error(String(Ee));if(!Yw(Dr.message))throw Dr;Z="turn/start",T=oe,le.value="submitted",_r(oe,null),Br(oe,!1),await vo({client:$,liveStream:oe,text:g,submittedAttachments:w,uploadedAttachments:H,optimisticMessageId:S,queueOptimisticMessage:!1})}return}const ae=await Si();T=ae,await vo({client:$,liveStream:ae,text:g,submittedAttachments:w,optimisticMessageId:S})}catch($){const ae=$ instanceof Error?$.message:String($);if(nt(!1),EA(S),SA(S),Z==="turn/start"){T&&ee.liveStream===T&&Un(At(new Error(ae))),ee.pendingLiveStream=null,Ei(g,w),xe.value=ae,le.value="error";return}Ei(g,w),xe.value=ae}}finally{Tn.value=!1}},PA=async()=>{if(!bA())return;let g=null;try{if(g=await Si(),g.interruptRequested)return;Br(g,!0),xe.value=null;const w=r(t.projectId),_=await bo(g);await w.request("turn/interrupt",{threadId:g.threadId,turnId:_}),g.interruptAcknowledged=!0}catch(w){g&&Br(g,!1),xe.value=w instanceof Error?w.message:String(w)}},OA=async g=>{Yn.value||(V.value=g,await Pi())},JA=g=>{A(g)&&(g.preventDefault(),Pi())};return ct(()=>{i.value||s(),mo(),Ni("auto")}),Ye(()=>t.threadId??null,g=>{if(!g){if(Yn.value||ne.value)return;RA();return}if(Ge.value===g&&ue.value===g&&Yn.value){Ge.value=null,ne.value=null;return}GA(g)},{immediate:!0}),Ye(ne,async g=>{if(g){if(kr.value===g){ne.value=null,Ge.value=null;return}Ge.value=g,await n.push(nc(t.projectId,g)),ne.value=null}}),Ye(ce,()=>{Ni(le.value==="streaming"?"auto":"smooth")},{flush:"post"}),Ye(le,(g,w)=>{g!==w&&Ni(g==="streaming"?"auto":"smooth")},{flush:"post"}),Ye([W,we],()=>{const g=Dl(Ln.value,W.value,fe.value);if(W.value!==g.model){W.value=g.model;return}fe.value!==g.effort&&(fe.value=g.effort)},{flush:"sync"}),(g,w)=>{const _=Js,N=Qh,S=yr,T=Jt,Z=Mh,$=Kh,ae=Rd,oe=Jh;return v(),M("section",pv,[F("div",{ref_key:"scrollViewport",ref:ge,class:"min-h-0 flex-1 overflow-y-auto",onScroll:NA},[uA.value?(v(),M("div",gv,[F("div",mv,[F("div",yv,[w[9]||(w[9]=F("div",{class:"text-xs font-medium uppercase tracking-[0.28em] text-primary"}," Ready To Code ",-1)),F("div",Cv,[w[8]||(w[8]=F("h1",{class:"text-balance text-4xl font-semibold tracking-tight text-highlighted md:text-5xl"}," Let's build ",-1)),F("p",bv,X(po.value),1)]),w[10]||(w[10]=F("p",{class:"mx-auto max-w-2xl text-base leading-7 text-muted md:text-lg"}," Start with a goal, a bug, or a question. Codori will start the runtime when needed and keep the thread ready to continue. ",-1))]),F("div",Iv,[(v(!0),M(Ce,null,Se(AA.value,H=>(v(),M("button",{key:H.title,type:"button",class:"rounded-3xl border border-default/70 bg-elevated/25 px-5 py-5 text-left transition hover:border-primary/30 hover:bg-elevated/45",onClick:Ee=>OA(H.text)},[F("div",wv,X(H.title),1),F("p",vv,X(H.text),1)],8,xv))),128))])])])):(v(),K(N,{key:1,messages:m(ce),status:cA.value,"should-auto-scroll":!1,"should-scroll-to-bottom":!1,"auto-scroll":!1,"spacing-offset":140,user:{ui:{root:"scroll-mt-4",container:"gap-3 pb-8",content:"px-4 py-3 rounded-2xl min-h-12"}},ui:{root:"min-h-full px-4 py-5 md:px-6",message:"max-w-none",content:"w-full max-w-5xl"},compact:""},{content:J(({message:H})=>[Ae(Gw,{message:H,"project-id":e.projectId},null,8,["message","project-id"])]),indicator:J(()=>[ki.value?(v(),K(_,{key:0,text:"Thinking...",class:"px-1 py-2"})):L("",!0)]),_:1},8,["messages","status"]))],544),F("div",kv,[F("div",Bv,[wr.value?(v(),K(S,{key:0,color:"error",variant:"soft",icon:"i-lucide-circle-alert",title:wr.value,class:"mb-3"},null,8,["title"])):L("",!0),F("div",{class:"relative",onDragenter:w[4]||(w[4]=(...H)=>m(D)&&m(D)(...H)),onDragleave:w[5]||(w[5]=(...H)=>m(Q)&&m(Q)(...H)),onDragover:w[6]||(w[6]=(...H)=>m(R)&&m(R)(...H)),onDrop:w[7]||(w[7]=(...H)=>m(Y)&&m(Y)(...H))},[m(d)?(v(),M("div",_v," Drop images to attach them ")):L("",!0),Ae(oe,{modelValue:V.value,"onUpdate:modelValue":w[3]||(w[3]=H=>V.value=H),placeholder:"Describe the change you want Codex to make",error:oA.value,disabled:ln.value,autoresize:"",onSubmit:Ot(Pi,["prevent"]),onKeydown:fs(JA,["enter"]),onCompositionstart:m(l),onCompositionend:m(c),onPaste:m(B)},{header:J(()=>[m(u).length?(v(),M("div",Sv,[(v(!0),M(Ce,null,Se(m(u),H=>(v(),M("div",{key:H.id,class:"flex max-w-full items-center gap-2 rounded-2xl border border-default bg-elevated/35 px-2 py-1.5"},[F("img",{src:H.previewUrl,alt:H.name,class:"size-10 rounded-xl object-cover"},null,8,Ev),F("div",Dv,[F("div",Fv,X(H.name),1),F("div",Nv,X(_A(H.size)),1)]),Ae(T,{type:"button",color:"neutral",variant:"ghost",size:"xs",icon:"i-lucide-x",disabled:ln.value,class:"rounded-full","aria-label":`Remove ${H.name}`,onClick:Ee=>m(C)(H.id)},null,8,["disabled","aria-label","onClick"])]))),128))])):L("",!0)]),footer:J(()=>[F("input",{ref_key:"fileInput",ref:y,type:"file",accept:"image/*",class:"hidden",disabled:ln.value,onChange:w[0]||(w[0]=(...H)=>m(k)&&m(k)(...H))},null,40,Qv),F("div",Gv,[F("div",Rv,[Ae(T,{type:"button",color:"neutral",variant:"ghost",size:"sm",icon:"i-lucide-plus",disabled:ln.value,class:"size-8 shrink-0 justify-center rounded-full border border-default/70",ui:{leadingIcon:"size-4",base:"px-0"},"aria-label":"Attach image",onClick:m(I)},null,8,["disabled","onClick"]),Ae($,{modelValue:m(W),"onUpdate:modelValue":w[1]||(w[1]=H=>ps(W)?W.value=H:null),items:hA.value,color:"neutral",variant:"ghost",size:"sm",loading:m(Be),disabled:ln.value,class:"min-w-0 flex-1 sm:max-w-52 sm:flex-none",ui:{base:"rounded-full border border-default/70 bg-default/70",value:"truncate",content:"min-w-56"}},null,8,["modelValue","items","loading","disabled"]),Ae($,{modelValue:m(fe),"onUpdate:modelValue":w[2]||(w[2]=H=>ps(fe)?fe.value=H:null),items:pA.value,color:"neutral",variant:"ghost",size:"sm",disabled:ln.value,class:"min-w-0 flex-1 sm:max-w-36 sm:flex-none",ui:{base:"rounded-full border border-default/70 bg-default/70",value:"truncate"}},null,8,["modelValue","items","disabled"])]),F("div",Mv,[gA.value?(v(),K(ae,{key:0,content:{side:"top",align:"end"},arrow:""},{content:J(()=>[F("div",Pv,[F("div",Ov,[w[12]||(w[12]=F("div",{class:"text-xs font-semibold uppercase tracking-[0.22em] text-primary"}," Context Window ",-1)),F("div",Jv,X(dA.value?.displayName??"Selected model"),1)]),F("div",Uv,[F("div",Zv,[w[13]||(w[13]=F("div",{class:"text-[11px] uppercase tracking-[0.18em] text-muted"}," Remaining ",-1)),F("div",Hv,X(Math.round(qt.value.remainingPercent??0))+"% ",1),F("div",jv,X(m(Cn)(qt.value.remainingTokens??0))+" tokens ",1)]),F("div",qv,[w[14]||(w[14]=F("div",{class:"text-[11px] uppercase tracking-[0.18em] text-muted"}," Used ",-1)),F("div",zv,X(m(Cn)(qt.value.usedTokens??0)),1),F("div",Vv," of "+X(m(Cn)(qt.value.contextWindow??0)),1)])]),F("div",$v,[F("div",Xv,[w[15]||(w[15]=F("div",{class:"text-[11px] uppercase tracking-[0.18em] text-muted"}," Input ",-1)),F("div",ek,X(m(Cn)(m($e)?.totalInputTokens??0)),1),F("div",tk," cached "+X(m(Cn)(m($e)?.totalCachedInputTokens??0)),1)]),F("div",nk,[w[16]||(w[16]=F("div",{class:"text-[11px] uppercase tracking-[0.18em] text-muted"}," Output ",-1)),F("div",rk,X(m(Cn)(m($e)?.totalOutputTokens??0)),1),F("div",ik," effort "+X(m(Nl)(m(fe))),1)])])])]),default:J(()=>[F("button",Wv,[F("span",Kv,[(v(),M("svg",Tv,[w[11]||(w[11]=F("circle",{cx:"18",cy:"18",r:"15.5",fill:"none","stroke-width":"3",pathLength:"100",class:"stroke-current text-muted/20","stroke-dasharray":"100 100"},null,-1)),F("circle",{cx:"18",cy:"18",r:"15.5",fill:"none","stroke-width":"3",pathLength:"100",class:"stroke-current text-primary","stroke-linecap":"round","stroke-dasharray":`${mA.value} 100`},null,8,Yv)])),F("span",Lv,X(yA.value),1)])])]),_:1})):L("",!0)])])]),default:J(()=>[Ae(Z,{status:lA.value,onStop:PA},null,8,["status"])]),_:1},8,["modelValue","error","disabled","onCompositionstart","onCompositionend","onPaste"])],32)])])])}}}),kk=Object.assign(sk,{__name:"ChatWorkspace"}),sA=()=>{const e=bd("codori-thread-panel-open",()=>!1);return{open:e,openPanel:()=>{e.value=!0},closePanel:()=>{e.value=!1},togglePanel:()=>{e.value=!e.value}}},ok={class:"flex h-full min-h-0 flex-col"},ak={key:0,class:"px-3 py-3"},lk={key:1,class:"px-3 py-3 text-sm text-muted"},ck={class:"min-h-0 flex-1 overflow-y-auto px-2 py-2"},uk={class:"truncate font-medium text-highlighted"},Ak=he({__name:"ThreadList",props:{projectId:{},autoCloseOnSelect:{type:Boolean}},setup(e){const t=e,n=Id(),{loaded:r,refreshProjects:i,startProject:s,getProject:o}=tc(),{getClient:a}=nA(),{closePanel:l}=sA(),c=()=>iA(t.projectId??"__missing-project__"),A=G(()=>c().threads.value),u=G(()=>c().loading.value),d=G(()=>c().error.value),f=G(()=>o(t.projectId)),h=async()=>{const p=c();if(!(!t.projectId||p.loading.value)){p.setLoading(!0),p.setError(null);try{r.value||await i(),f.value?.status!=="running"&&await s(t.projectId);const I=await a(t.projectId).request("thread/list",{limit:50,cwd:f.value?.projectPath??null});p.setThreads(I.data.map(k=>({id:k.id,title:ui(k),updatedAt:k.updatedAt})))}catch(b){p.setError(b instanceof Error?b.message:String(b))}finally{p.setLoading(!1)}}},y=G(()=>{const p=n.params.threadId;return typeof p=="string"?p:null}),C=G(()=>t.projectId?[A.value.map(p=>({label:p.title,icon:"i-lucide-message-square-text",to:nc(t.projectId,p.id),active:y.value===p.id,onSelect:()=>{t.autoCloseOnSelect&&l()},tooltip:{text:p.title},updatedAt:p.updatedAt}))]:[[]]),x=p=>p;return ct(()=>{h()}),Ye(()=>t.projectId,()=>{c().setThreads([]),h()},{immediate:!0}),Ye(()=>n.fullPath,()=>{h()}),(p,b)=>{const I=yr,k=Md;return v(),M("div",ok,[d.value?(v(),M("div",ak,[Ae(I,{color:"error",variant:"soft",icon:"i-lucide-circle-alert",title:d.value},null,8,["title"])])):L("",!0),!A.value.length&&!u.value&&!d.value?(v(),M("div",lk," No previous threads were found for this project. ")):L("",!0),F("div",ck,[A.value.length?(v(),K(k,{key:0,items:C.value,orientation:"vertical",highlight:"",color:"primary",variant:"link",popover:!1,class:"w-full",ui:{root:"w-full",list:"gap-1",item:"w-full",link:"w-full rounded-lg px-3 py-2.5 text-sm",linkLeadingIcon:"size-4 text-dimmed",linkLabel:"min-w-0 flex-1",linkTrailing:"hidden"}},{"item-label":J(({item:B})=>[F("div",uk,X(x(B).label),1)]),_:1},8,["items"])):L("",!0)])])}}}),Kl=Object.assign(Ak,{__name:"ThreadList"}),dk={key:0,class:"hidden h-full min-h-0 w-[22rem] shrink-0 flex-col border-l border-default bg-default xl:flex"},hk={class:"flex items-center justify-between gap-2 border-b border-default px-3 py-2"},fk={class:"flex items-center gap-1"},pk={class:"min-h-0 flex-1 overflow-hidden"},gk=he({__name:"ThreadPanel",props:{projectId:{}},setup(e){const t=()=>window.matchMedia("(min-width: 1280px)").matches,{open:n,closePanel:r}=sA(),i=P(0),s=P(t());let o=null,a=null;const l=()=>{i.value+=1};return ct(()=>{o=window.matchMedia("(min-width: 1280px)"),s.value=o.matches;const c=A=>{s.value=A.matches};o.addEventListener("change",c),a=()=>{o?.removeEventListener("change",c)}}),xd(()=>{a?.()}),(c,A)=>{const u=Jt,d=Wd;return v(),M(Ce,null,[e.projectId&&m(n)&&s.value?(v(),M("aside",dk,[F("div",hk,[A[1]||(A[1]=F("div",{class:"text-sm font-medium text-highlighted"}," Resume Threads ",-1)),F("div",fk,[Ae(u,{icon:"i-lucide-refresh-cw",color:"neutral",variant:"ghost",size:"xs",square:"",onClick:l}),Ae(u,{icon:"i-lucide-panel-right-close",color:"neutral",variant:"ghost",size:"xs",square:"",onClick:m(r)},null,8,["onClick"])])]),F("div",pk,[(v(),K(Kl,{key:i.value,"project-id":e.projectId},null,8,["project-id"]))])])):L("",!0),e.projectId&&!s.value?(v(),K(d,{key:1,open:m(n),"onUpdate:open":A[0]||(A[0]=f=>ps(n)?n.value=f:null),title:"Resume Threads",side:"right",dismissible:"",ui:{content:"w-[80vw] max-w-[80vw] sm:w-80 sm:max-w-80",header:"px-3 py-2",body:"!p-0 sm:!p-0"}},{actions:J(()=>[Ae(u,{icon:"i-lucide-refresh-cw",color:"neutral",variant:"ghost",size:"xs",square:"",onClick:l})]),body:J(()=>[(v(),K(Kl,{key:`mobile-${i.value}`,"project-id":e.projectId,"auto-close-on-select":""},null,8,["project-id"]))]),_:1},8,["open"])):L("",!0)],64)}}}),Bk=Object.assign(gk,{__name:"ThreadPanel"});export{kk as _,Bk as a,Qh as b,Gw as c,sv as d,Uh as i,sA as u};
|