codesesh 1.0.5 → 1.0.7

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.
Files changed (54) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-PAP2Q3WV.js → chunk-DE6UJMOY.js} +2 -2
  3. package/dist/{chunk-YQFEGFWD.js → chunk-EYZ73CYP.js} +2 -2
  4. package/dist/{chunk-NBJJGH5P.js → chunk-QHWSZFRM.js} +118 -74
  5. package/dist/chunk-QHWSZFRM.js.map +1 -0
  6. package/dist/{chunk-WUYSZAYR.js → chunk-SII3M66U.js} +13 -6
  7. package/dist/chunk-SII3M66U.js.map +1 -0
  8. package/dist/{chunk-TS3IWH5U.js → chunk-VVCSQU5B.js} +120 -20
  9. package/dist/chunk-VVCSQU5B.js.map +1 -0
  10. package/dist/{chunk-FCYCBGEL.js → chunk-WIWK7BXS.js} +3 -3
  11. package/dist/{chunk-XKZSX5BM.js → chunk-YEQTRALH.js} +3 -3
  12. package/dist/{discovery-D23RV7FY.js → discovery-4WAEYSTR.js} +7 -5
  13. package/dist/index.js +217 -150
  14. package/dist/index.js.map +1 -1
  15. package/dist/project-identity-worker.js +4 -4
  16. package/dist/scan-refresh-worker.js +6 -6
  17. package/dist/search-index-worker.js +6 -6
  18. package/dist/session-detail-worker.js +6 -6
  19. package/dist/smart-tag-worker.js +3 -3
  20. package/dist/web/assets/CustomTimeWindowDialog-CVURkiVO.js +1 -0
  21. package/dist/web/assets/InteractiveReceipt-DGC-xV7U.js +1 -0
  22. package/dist/web/assets/OverviewScreen-DoXrZ5qp.js +1 -0
  23. package/dist/web/assets/{PrismHighlighter-LWITDffT.js → PrismHighlighter-02695Lmx.js} +1 -1
  24. package/dist/web/assets/Projects-DZiYh6hp.js +1 -0
  25. package/dist/web/assets/SearchResultsPanel-CAQe8Di0.js +1 -0
  26. package/dist/web/assets/SessionDetail-Da8EBygt.js +53 -0
  27. package/dist/web/assets/api-ToidoNW6.js +1 -0
  28. package/dist/web/assets/index-Bl8pbRFj.js +1423 -0
  29. package/dist/web/assets/index-CRI1m3xN.css +1 -0
  30. package/dist/web/assets/session-indexes-D5gps7K8.js +4 -0
  31. package/dist/web/assets/translate-BDFu3ZiK.js +2 -0
  32. package/dist/web/assets/utils-BIZi2up3.js +1 -0
  33. package/dist/web/index.html +7 -7
  34. package/package.json +3 -3
  35. package/dist/chunk-NBJJGH5P.js.map +0 -1
  36. package/dist/chunk-TS3IWH5U.js.map +0 -1
  37. package/dist/chunk-WUYSZAYR.js.map +0 -1
  38. package/dist/web/assets/CustomTimeWindowDialog-C9XTZRm0.js +0 -1
  39. package/dist/web/assets/InteractiveReceipt-Sca1smpv.js +0 -1
  40. package/dist/web/assets/OverviewScreen-Vq6BQR9_.js +0 -1
  41. package/dist/web/assets/Projects-CwicV3Dk.js +0 -1
  42. package/dist/web/assets/SearchResultsPanel-DCO0Ak0c.js +0 -1
  43. package/dist/web/assets/SessionDetail-mdmTQgo1.js +0 -53
  44. package/dist/web/assets/api-CXVT9XcZ.js +0 -1
  45. package/dist/web/assets/contract-BS78VBCV.js +0 -2
  46. package/dist/web/assets/index-C5cyw58A.css +0 -1
  47. package/dist/web/assets/index-H2cT-6c6.js +0 -1423
  48. package/dist/web/assets/session-indexes-yyyWpKLf.js +0 -4
  49. package/dist/web/assets/utils-C7BqyxxV.js +0 -1
  50. /package/dist/{chunk-PAP2Q3WV.js.map → chunk-DE6UJMOY.js.map} +0 -0
  51. /package/dist/{chunk-YQFEGFWD.js.map → chunk-EYZ73CYP.js.map} +0 -0
  52. /package/dist/{chunk-FCYCBGEL.js.map → chunk-WIWK7BXS.js.map} +0 -0
  53. /package/dist/{chunk-XKZSX5BM.js.map → chunk-YEQTRALH.js.map} +0 -0
  54. /package/dist/{discovery-D23RV7FY.js.map → discovery-4WAEYSTR.js.map} +0 -0
@@ -1,53 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismHighlighter-LWITDffT.js","assets/jsx-runtime-B-hcVAMW.js","assets/InteractiveReceipt-Sca1smpv.js","assets/contract-BS78VBCV.js","assets/index-H2cT-6c6.js","assets/utils-C7BqyxxV.js","assets/CustomTimeWindowDialog-C9XTZRm0.js","assets/api-CXVT9XcZ.js","assets/session-indexes-yyyWpKLf.js","assets/index-C5cyw58A.css"])))=>i.map(i=>d[i]);
2
- import{a as e,i as t,n,r,t as i}from"./jsx-runtime-B-hcVAMW.js";import{Bn as a,c as o,h as s,n as c,t as l}from"./utils-C7BqyxxV.js";import{C as u,a as d,b as f,c as p}from"./contract-BS78VBCV.js";import{g as m,o as h}from"./session-indexes-yyyWpKLf.js";import{A as g,B as _,C as v,D as y,E as b,F as x,I as S,J as C,K as ee,L as w,M as T,N as te,O as E,P as D,R as ne,S as re,T as O,W as k,_ as ie,a as ae,b as A,c as oe,d as se,f as ce,g as le,h as ue,i as de,j as fe,k as pe,l as me,m as he,n as ge,o as _e,p as ve,q as ye,r as be,s as xe,t as Se,u as Ce,v as we,w as Te,x as Ee,y as De,z as Oe}from"./index-H2cT-6c6.js";function ke(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Ae(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var je=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Me=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ne={};function Pe(e,t){return((t||Ne).jsx?Me:je).test(e)}var Fe=/[ \t\n\f\r]/g;function Ie(e){return typeof e==`object`?e.type===`text`&&Le(e.value):Le(e)}function Le(e){return e.replace(Fe,``)===``}var Re=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Re.prototype.normal={},Re.prototype.property={},Re.prototype.space=void 0;function ze(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Re(n,r,t)}function Be(e){return e.toLowerCase()}var j=class{constructor(e,t){this.attribute=t,this.property=e}};j.prototype.attribute=``,j.prototype.booleanish=!1,j.prototype.boolean=!1,j.prototype.commaOrSpaceSeparated=!1,j.prototype.commaSeparated=!1,j.prototype.defined=!1,j.prototype.mustUseProperty=!1,j.prototype.number=!1,j.prototype.overloadedBoolean=!1,j.prototype.property=``,j.prototype.spaceSeparated=!1,j.prototype.space=void 0;var Ve=t({boolean:()=>M,booleanish:()=>N,commaOrSpaceSeparated:()=>I,commaSeparated:()=>We,number:()=>P,overloadedBoolean:()=>Ue,spaceSeparated:()=>F}),He=0,M=Ge(),N=Ge(),Ue=Ge(),P=Ge(),F=Ge(),We=Ge(),I=Ge();function Ge(){return 2**++He}var Ke=Object.keys(Ve),qe=class extends j{constructor(e,t,n,r){let i=-1;if(super(e,t),Je(this,`space`,r),typeof n==`number`)for(;++i<Ke.length;){let e=Ke[i];Je(this,Ke[i],(n&Ve[e])===Ve[e])}}};qe.prototype.defined=!0;function Je(e,t,n){n&&(e[t]=n)}function Ye(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new qe(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Be(r)]=r,n[Be(a.attribute)]=r}return new Re(t,n,e.space)}var Xe=Ye({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:F,ariaCurrent:null,ariaDescribedBy:F,ariaDetails:null,ariaDisabled:N,ariaDropEffect:F,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:F,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:F,ariaLevel:P,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:F,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:F,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:N,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ze(e,t){return t in e?e[t]:t}function Qe(e,t){return Ze(e,t.toLowerCase())}var $e=Ye({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:We,acceptCharset:F,accessKey:F,action:null,allow:null,allowFullScreen:M,allowPaymentRequest:M,allowUserMedia:M,alpha:M,alt:null,as:null,async:M,autoCapitalize:null,autoComplete:F,autoFocus:M,autoPlay:M,blocking:F,capture:null,charSet:null,checked:M,cite:null,className:F,closedBy:null,colorSpace:null,cols:P,colSpan:P,command:null,commandFor:null,content:null,contentEditable:N,controls:M,controlsList:F,coords:P|We,crossOrigin:null,data:null,dateTime:null,decoding:null,default:M,defer:M,dir:null,dirName:null,disabled:M,download:Ue,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:M,formTarget:null,headers:F,height:P,hidden:Ue,high:P,href:null,hrefLang:null,htmlFor:F,httpEquiv:F,id:null,imageSizes:null,imageSrcSet:null,inert:M,inputMode:null,integrity:null,is:null,isMap:M,itemId:null,itemProp:F,itemRef:F,itemScope:M,itemType:F,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:M,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:M,muted:M,name:null,nonce:null,noModule:M,noValidate:M,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:M,optimum:P,pattern:null,ping:F,placeholder:null,playsInline:M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:M,referrerPolicy:null,rel:F,required:M,reversed:M,rows:P,rowSpan:P,sandbox:F,scope:null,scoped:M,seamless:M,selected:M,shadowRootClonable:M,shadowRootCustomElementRegistry:M,shadowRootDelegatesFocus:M,shadowRootMode:null,shadowRootSerializable:M,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:M,useMap:null,value:N,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:F,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:M,declare:M,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:M,noHref:M,noShade:M,noWrap:M,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:M,disablePictureInPicture:M,disableRemotePlayback:M,exportParts:We,part:F,prefix:null,property:null,results:P,security:null,unselectable:null},space:`html`,transform:Qe}),et=Ye({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:I,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,className:F,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:M,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:We,g2:We,glyphName:We,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:I,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:P,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:F,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:I,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:I,rev:I,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:I,requiredFeatures:I,requiredFonts:I,requiredFormats:I,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:I,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:I,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:I,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ze}),tt=Ye({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),nt=Ye({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Qe}),rt=Ye({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),it={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},at=/[A-Z]/g,ot=/-[a-z]/g,st=/^data[-\w.:]+$/i;function ct(e,t){let n=Be(t),r=t,i=j;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&st.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ot,ut);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ot.test(e)){let n=e.replace(at,lt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=qe}return new i(r,t)}function lt(e){return`-`+e.toLowerCase()}function ut(e){return e.charAt(1).toUpperCase()}var dt=ze([Xe,$e,tt,nt,rt],`html`),ft=ze([Xe,et,tt,nt,rt],`svg`);function pt(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function mt(e){return e.join(` `).trim()}var ht=r(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),gt=r((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ht());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),_t=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),vt=r(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(gt()),r=_t();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),yt=xt(`end`),bt=xt(`start`);function xt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function St(e){let t=bt(e),n=yt(e);if(t&&n)return{start:t,end:n}}function Ct(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Tt(e.position):`start`in e||`end`in e?Tt(e):`line`in e||`column`in e?wt(e):``}function wt(e){return Et(e&&e.line)+`:`+Et(e&&e.column)}function Tt(e){return wt(e&&e.start)+`-`+wt(e&&e.end)}function Et(e){return e&&typeof e==`number`?e:1}var L=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ct(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};L.prototype.file=``,L.prototype.name=``,L.prototype.reason=``,L.prototype.message=``,L.prototype.stack=``,L.prototype.column=void 0,L.prototype.line=void 0,L.prototype.ancestors=void 0,L.prototype.cause=void 0,L.prototype.fatal=void 0,L.prototype.place=void 0,L.prototype.ruleId=void 0,L.prototype.source=void 0;var Dt=e(vt(),1),Ot={}.hasOwnProperty,kt=new Map,At=/[A-Z]/g,jt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Mt=new Set([`td`,`th`]),Nt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Pt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Gt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Wt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?ft:dt,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ft(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ft(e,t,n){if(t.type===`element`)return It(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Lt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return zt(e,t,n);if(t.type===`mdxjsEsm`)return Rt(e,t);if(t.type===`root`)return Bt(e,t,n);if(t.type===`text`)return Vt(e,t)}function It(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ft,e.schema=i),e.ancestors.push(t);let a=Zt(e,t.tagName,!1),o=Kt(e,t),s=Jt(e,t);return jt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ie(e)})),Ht(e,o,a,t),Ut(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Lt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Qt(e,t.position)}function Rt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qt(e,t.position)}function zt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ft,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Zt(e,t.name,!0),o=qt(e,t),s=Jt(e,t);return Ht(e,o,a,t),Ut(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Bt(e,t,n){let r={};return Ut(r,Jt(e,t)),e.create(t,e.Fragment,r,n)}function Vt(e,t){return t.value}function Ht(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ut(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Wt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Gt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=bt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Kt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ot.call(t.properties,i)){let a=Yt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Mt.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function qt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Qt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Qt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Jt(e,t){let n=[],r=-1,i=e.passKeys?new Map:kt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ft(e,a,o);s!==void 0&&n.push(s)}return n}function Yt(e,t,n){let r=ct(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ae(n):mt(n)),r.property===`style`){let t=typeof n==`object`?n:Xt(e,String(n));return e.stylePropertyNameCase===`css`&&(t=$t(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?it[r.property]||r.property:r.attribute,n]}}function Xt(e,t){try{return(0,Dt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new L("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Nt+`#cannot-parse-style-attribute`,r}}function Zt(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Pe(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Pe(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ot.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qt(e)}function Qt(e,t){let n=new L("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Nt+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function $t(e){let t={},n;for(n in e)Ot.call(e,n)&&(t[en(n)]=e[n]);return t}function en(e){let t=e.replace(At,tn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function tn(e){return`-`+e.toLowerCase()}var nn={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},rn={};function an(e,t){let n=t||rn;return on(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function on(e,t,n){if(cn(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return sn(e.children,t,n)}return Array.isArray(e)?sn(e,t,n):``}function sn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=on(e[i],t,n);return r.join(``)}function cn(e){return!!(e&&typeof e==`object`)}var ln=document.createElement(`i`);function un(e){let t=`&`+e+`;`;ln.innerHTML=t;let n=ln.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function dn(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function R(e,t){return e.length>0?(dn(e,e.length,0,t),e):t}var fn={}.hasOwnProperty;function pn(e){let t={},n=-1;for(;++n<e.length;)mn(t,e[n]);return t}function mn(e,t){let n;for(n in t){let r=(fn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){fn.call(r,a)||(r[a]=[]);let e=i[a];hn(r[a],Array.isArray(e)?e:e?[e]:[])}}}function hn(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);dn(e,0,0,r)}function gn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function _n(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var vn=En(/[A-Za-z]/),z=En(/[\dA-Za-z]/),yn=En(/[#-'*+\--9=?A-Z^-~]/);function bn(e){return e!==null&&(e<32||e===127)}var xn=En(/\d/),Sn=En(/[\dA-Fa-f]/),Cn=En(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}var wn=En(/\p{P}|\p{S}/u),Tn=En(/\s/);function En(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Dn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&z(e.charCodeAt(n+1))&&z(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function U(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return H(r)?(e.enter(n),s(r)):t(r)}function s(r){return H(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var On={tokenize:kn};function kn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return B(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var An={tokenize:Mn},jn={tokenize:Nn};function Mn(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return dn(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(jn,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(jn,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return B(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;dn(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Nn(e,t,n){return U(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Pn(e){if(e===null||V(e)||Tn(e))return 1;if(wn(e))return 2}function Fn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var In={name:`attention`,resolveAll:Ln,tokenize:Rn};function Ln(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};zn(d,-c),zn(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=R(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=R(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=R(l,Fn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=R(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=R(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,dn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Rn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Pn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Pn(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function zn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Bn={name:`autolink`,tokenize:Vn};function Vn(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return vn(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||z(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||z(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||bn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):yn(t)?(e.consume(t),l):n(t)}function u(e){return z(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||z(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Hn={partial:!0,tokenize:Un};function Un(e,t,n){return r;function r(t){return H(t)?U(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||B(e)?t(e):n(e)}}var Wn={continuation:{tokenize:Kn},exit:qn,name:`blockQuote`,tokenize:Gn};function Gn(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return H(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Kn(e,t,n){let r=this;return i;function i(t){return H(t)?U(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Wn,t,n)(r)}}function qn(e){e.exit(`blockQuote`)}var Jn={name:`characterEscape`,tokenize:Yn};function Yn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Cn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Xn={name:`characterReference`,tokenize:Zn};function Zn(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=z,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Sn,u):(e.enter(`characterReferenceValue`),a=7,o=xn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===z&&!un(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Qn={partial:!0,tokenize:tr},$n={concrete:!0,name:`codeFenced`,tokenize:er};function er(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||B(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Qn,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),U(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||B(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&H(t)?U(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||B(t)?e.check(Qn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||B(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),H(t)?U(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||B(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function tr(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var nr={name:`codeIndented`,tokenize:ir},rr={partial:!0,tokenize:ar};function ir(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),U(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):B(t)?e.attempt(rr,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||B(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ar(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):U(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):B(e)?i(e):n(e)}}var or={name:`codeText`,previous:cr,resolve:sr,tokenize:lr};function sr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function cr(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function lr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||B(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ur=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&dr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),dr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),dr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);dr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);dr(this.left,t.reverse())}}}};function dr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function fr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ur(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,pr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return dn(e,0,1/0,u.slice(0)),!l}function pr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var mr={resolve:gr,tokenize:_r},hr={partial:!0,tokenize:vr};function gr(e){return fr(e),e}function _r(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):B(t)?e.check(hr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function vr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,a,`linePrefix`)}function a(i){if(i===null||B(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function yr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||bn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||B(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||V(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||bn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function br(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):B(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||B(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!H(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function xr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||B(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Sr(e,t){let n;return r;function r(i){return B(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):H(i)?U(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Cr={name:`definition`,tokenize:Tr},wr={partial:!0,tokenize:Er};function Tr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return br.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=_n(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return V(t)?Sr(e,l)(t):l(t)}function l(t){return yr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(wr,d,d)(t)}function d(t){return H(t)?U(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||B(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Er(e,t,n){return r;function r(t){return V(t)?Sr(e,i)(t):n(t)}function i(t){return xr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return H(t)?U(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||B(e)?t(e):n(e)}}var Dr={name:`hardBreakEscape`,tokenize:Or};function Or(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return B(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var kr={name:`headingAtx`,resolve:Ar,tokenize:jr};function Ar(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},dn(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function jr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||V(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||B(n)?(e.exit(`atxHeading`),t(n)):H(n)?U(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||V(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Mr=`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`.split(`.`),Nr=[`pre`,`script`,`style`,`textarea`],Pr={concrete:!0,name:`htmlFlow`,resolveTo:Lr,tokenize:Rr},Fr={partial:!0,tokenize:Br},Ir={partial:!0,tokenize:zr};function Lr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Rr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:A):vn(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):vn(a)?(e.consume(a),i=4,r.interrupt?t:A):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:A):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:E:m):n(i)}function h(t){return vn(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||V(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Nr.includes(l)?(i=1,r.interrupt?t(s):E(s)):Mr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):E(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||z(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:E):n(i)}function v(t){return H(t)?(e.consume(t),v):T(t)}function y(t){return t===47?(e.consume(t),T):t===58||t===95||vn(t)?(e.consume(t),b):H(t)?(e.consume(t),y):T(t)}function b(t){return t===45||t===46||t===58||t===95||z(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):H(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):H(t)?(e.consume(t),S):ee(t)}function C(t){return t===c?(e.consume(t),c=null,w):t===null||B(t)?n(t):(e.consume(t),C)}function ee(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||V(t)?x(t):(e.consume(t),ee)}function w(e){return e===47||e===62||H(e)?y(e):n(e)}function T(t){return t===62?(e.consume(t),te):n(t)}function te(t){return t===null||B(t)?E(t):H(t)?(e.consume(t),te):n(t)}function E(t){return t===45&&i===2?(e.consume(t),O):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),oe):t===63&&i===3?(e.consume(t),A):t===93&&i===5?(e.consume(t),ae):B(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Fr,se,D)(t)):t===null||B(t)?(e.exit(`htmlFlowData`),D(t)):(e.consume(t),E)}function D(t){return e.check(Ir,ne,se)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||B(t)?D(t):(e.enter(`htmlFlowData`),E(t))}function O(t){return t===45?(e.consume(t),A):E(t)}function k(t){return t===47?(e.consume(t),o=``,ie):E(t)}function ie(t){if(t===62){let n=o.toLowerCase();return Nr.includes(n)?(e.consume(t),oe):E(t)}return vn(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):E(t)}function ae(t){return t===93?(e.consume(t),A):E(t)}function A(t){return t===62?(e.consume(t),oe):t===45&&i===2?(e.consume(t),A):E(t)}function oe(t){return t===null||B(t)?(e.exit(`htmlFlowData`),se(t)):(e.consume(t),oe)}function se(n){return e.exit(`htmlFlow`),t(n)}}function zr(e,t,n){let r=this;return i;function i(t){return B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Br(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Hn,t,n)}}var Vr={name:`htmlText`,tokenize:Hr};function Hr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):vn(t)?(e.consume(t),ee):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):vn(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):B(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?O(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):B(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?O(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?O(t):B(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):B(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?O(e):y(e)}function x(t){return vn(t)?(e.consume(t),S):n(t)}function S(t){return t===45||z(t)?(e.consume(t),S):C(t)}function C(t){return B(t)?(o=C,k(t)):H(t)?(e.consume(t),C):O(t)}function ee(t){return t===45||z(t)?(e.consume(t),ee):t===47||t===62||V(t)?w(t):n(t)}function w(t){return t===47?(e.consume(t),O):t===58||t===95||vn(t)?(e.consume(t),T):B(t)?(o=w,k(t)):H(t)?(e.consume(t),w):O(t)}function T(t){return t===45||t===46||t===58||t===95||z(t)?(e.consume(t),T):te(t)}function te(t){return t===61?(e.consume(t),E):B(t)?(o=te,k(t)):H(t)?(e.consume(t),te):w(t)}function E(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,D):B(t)?(o=E,k(t)):H(t)?(e.consume(t),E):(e.consume(t),ne)}function D(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):B(t)?(o=D,k(t)):(e.consume(t),D)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||V(t)?w(t):(e.consume(t),ne)}function re(e){return e===47||e===62||V(e)?w(e):n(e)}function O(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return H(t)?U(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var Ur={name:`labelEnd`,resolveAll:qr,resolveTo:Jr,tokenize:Yr},Wr={tokenize:Xr},Gr={tokenize:Zr},Kr={tokenize:Qr};function qr(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&dn(e,0,e.length,n),e}function Jr(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=R(s,e.slice(a+1,a+r+3)),s=R(s,[[`enter`,u,t]]),s=R(s,Fn(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=R(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=R(s,e.slice(o+1)),s=R(s,[[`exit`,c,t]]),dn(e,a,e.length,s),e}function Yr(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(_n(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Wr,u,o?u:d)(t):t===91?e.attempt(Gr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Kr,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Xr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return V(t)?Sr(e,a)(t):a(t)}function a(t){return t===41?u(t):yr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return V(t)?Sr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?xr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return V(t)?Sr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Zr(e,t,n){let r=this;return i;function i(t){return br.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(_n(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Qr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var $r={name:`labelStartImage`,resolveAll:Ur.resolveAll,tokenize:ei};function ei(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ti={name:`labelStartLink`,resolveAll:Ur.resolveAll,tokenize:ni};function ni(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ri={name:`lineEnding`,tokenize:ii};function ii(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}}var ai={name:`thematicBreak`,tokenize:oi};function oi(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||B(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),H(t)?U(e,s,`whitespace`)(t):s(t))}}var W={continuation:{tokenize:ui},exit:fi,name:`list`,tokenize:li},si={partial:!0,tokenize:pi},ci={partial:!0,tokenize:di};function li(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:xn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ai,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return xn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Hn,r.interrupt?n:u,e.attempt(si,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return H(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ui(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Hn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!H(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ci,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(W,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function di(e,t,n){let r=this;return U(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function fi(e){e.exit(this.containerState.type)}function pi(e,t,n){let r=this;return U(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!H(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var mi={name:`setextUnderline`,resolveTo:hi,tokenize:gi};function hi(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function gi(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),H(t)?U(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||B(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var _i={tokenize:vi};function vi(e){let t=this,n=e.attempt(Hn,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(mr,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var yi={resolveAll:Ci()},bi=Si(`string`),xi=Si(`text`);function Si(e){return{resolveAll:Ci(e===`text`?wi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ci(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function wi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ti=t({attentionMarkers:()=>Ni,contentInitial:()=>Di,disable:()=>Pi,document:()=>Ei,flow:()=>ki,flowInitial:()=>Oi,insideSpan:()=>Mi,string:()=>Ai,text:()=>ji}),Ei={42:W,43:W,45:W,48:W,49:W,50:W,51:W,52:W,53:W,54:W,55:W,56:W,57:W,62:Wn},Di={91:Cr},Oi={[-2]:nr,[-1]:nr,32:nr},ki={35:kr,42:ai,45:[mi,ai],60:Pr,61:mi,95:ai,96:$n,126:$n},Ai={38:Xn,92:Jn},ji={[-5]:ri,[-4]:ri,[-3]:ri,33:$r,38:Xn,42:In,60:[Bn,Vr],91:ti,92:[Dr,Jn],93:Ur,95:In,96:or},Mi={null:[In,yi]},Ni={null:[42,95]},Pi={null:[]};function Fi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=R(o,e),g(),o[o.length-1]===null?(ee(t,0),l.events=Fn(a,l.events,l),l.events):[]}function f(e,t){return Li(p(e),t)}function p(e){return Ii(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,T()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){B(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,T()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){ee(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=w(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function ee(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&dn(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function w(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ii(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Li(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
- `;break;case-3:o=`\r
5
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Ri(e){let t={constructs:pn([Ti,...(e||{}).extensions||[]]),content:n(On),defined:[],document:n(An),flow:n(_i),lazy:{},string:n(bi),text:n(xi)};return t;function n(e){return n;function n(n){return Fi(t,e,n)}}}function zi(e){for(;!fr(e););return e}var Bi=/[\0\t\n\r]/g;function Vi(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Bi.lastIndex=u,c=Bi.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Hi=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ui(e){return e.replace(Hi,Wi)}function Wi(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return gn(n.slice(t?2:1),t?16:10)}return un(n)||e}var Gi={}.hasOwnProperty;function Ki(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),qi(n)(zi(Ri(n).document().write(Vi()(e,t,!0))))}function qi(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(we),autolinkProtocol:w,autolinkEmail:w,atxHeading:a(be),blockQuote:a(he),characterEscape:w,characterReference:w,codeFenced:a(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ge,o),codeText:a(_e,o),codeTextData:w,data:w,codeFlowValue:w,definition:a(ve),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ye),hardBreakEscape:a(xe),hardBreakTrailing:a(xe),htmlFlow:a(Se,o),htmlFlowData:w,htmlText:a(Se,o),htmlTextData:w,image:a(Ce),label:o,link:a(we),listItem:a(Ee),listItemValue:f,listOrdered:a(Te,d),listUnordered:a(Te),paragraph:a(De),reference:ce,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(be),strong:a(Oe),thematicBreak:a(Ae)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:me,autolinkProtocol:pe,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:de,characterReference:fe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:c(_),codeText:c(re),codeTextData:T,data:T,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(E),hardBreakTrailing:c(E),htmlFlow:c(D),htmlFlowData:T,htmlText:c(ne),htmlTextData:T,image:c(k),label:ae,labelText:ie,lineEnding:te,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:le,resourceDestinationString:A,resourceTitleString:oe,resource:se,setextHeading:c(ee),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Yi(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Gi.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Zi).call(a,void 0,e[0])}for(r.position={start:Ji(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ji(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Ji(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Zi).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ct({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Ji(e.end)}function u(){return an(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=_n(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function w(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ke(),n.position={start:Ji(e.start),end:void 0},t.push(n)),this.stack.push(n)}function T(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Ji(e.end)}function te(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Ji(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(w.call(this,e),T.call(this,e))}function E(){this.data.atHardBreak=!0}function D(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ui(t),n.identifier=_n(t).toLowerCase()}function ae(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function se(){this.data.inReference=void 0}function ce(){this.data.referenceType=`collapsed`}function le(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=_n(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ue(e){this.data.characterReferenceType=e.type}function de(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=gn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=un(t);let i=this.stack[this.stack.length-1];i.value+=r}function fe(e){let t=this.stack.pop();t.position.end=Ji(e.end)}function pe(e){T.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function me(e){T.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function he(){return{type:`blockquote`,children:[]}}function ge(){return{type:`code`,lang:null,meta:null,value:``}}function _e(){return{type:`inlineCode`,value:``}}function ve(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ye(){return{type:`emphasis`,children:[]}}function be(){return{type:`heading`,depth:0,children:[]}}function xe(){return{type:`break`}}function Se(){return{type:`html`,value:``}}function Ce(){return{type:`image`,title:null,url:``,alt:null}}function we(){return{type:`link`,title:null,url:``,children:[]}}function Te(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ee(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function De(){return{type:`paragraph`,children:[]}}function Oe(){return{type:`strong`,children:[]}}function ke(){return{type:`text`,value:``}}function Ae(){return{type:`thematicBreak`}}}function Ji(e){return{line:e.line,column:e.column,offset:e.offset}}function Yi(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Yi(e,r):Xi(e,r)}}function Xi(e,t){let n;for(n in t)if(Gi.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Zi(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ct({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ct({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ct({start:t.start,end:t.end})+`) is still open`)}function Qi(e){let t=this;t.parser=n;function n(n){return Ki(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function $i(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ea(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
6
- `}]}function ta(e,t){let n=t.value?t.value+`
7
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function na(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ra(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ia(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Dn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function aa(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oa(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sa(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function ca(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sa(e,t);let i={src:Dn(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function la(e,t){let n={src:Dn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ua(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function da(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sa(e,t);let i={href:Dn(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function fa(e,t){let n={href:Dn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pa(e,t,n){let r=e.all(t),i=n?ma(n):ha(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
8
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
9
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function ma(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=ha(n[r])}return t}function ha(e){return e.spread??e.children.length>1}function ga(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function _a(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function va(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ya(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ba(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=bt(t.children[1]),o=yt(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function xa(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Sa(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Ca=9,wa=32;function Ta(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Ea(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ea(t.slice(i),i>0,!1)),a.join(``)}function Ea(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Ca||t===wa;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Ca||t===wa;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Da(e,t){let n={type:`text`,value:Ta(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Oa(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var ka={blockquote:$i,break:ea,code:ta,delete:na,emphasis:ra,footnoteReference:ia,heading:aa,html:oa,imageReference:ca,image:la,inlineCode:ua,linkReference:da,link:fa,listItem:pa,list:ga,paragraph:_a,root:va,strong:ya,table:ba,tableCell:Sa,tableRow:xa,text:Da,thematicBreak:Oa,toml:Aa,yaml:Aa,definition:Aa,footnoteDefinition:Aa};function Aa(){}var ja=typeof self==`object`?self:globalThis,Ma=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ja[e](t)},Na=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof ja[e]==`function`?Ma(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Ma(a,o),i)};return r},Pa=e=>Na(new Map,e)(0),Fa=``,{toString:Ia}={},{keys:La}=Object,Ra=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ia.call(e).slice(8,-1);switch(n){case`Array`:return[1,Fa];case`Object`:return[2,Fa];case`Date`:return[3,Fa];case`RegExp`:return[4,Fa];case`Map`:return[5,Fa];case`Set`:return[6,Fa];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},za=([e,t])=>e===0&&(t===`function`||t===`symbol`),Ba=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Ra(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of La(r))(e||!za(Ra(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Fa:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(za(Ra(n))||za(Ra(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!za(Ra(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Va=(e,{json:t,lossy:n}={})=>{let r=[];return Ba(!(t||n),!!t,new Map,r)(e),r},Ha=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Pa(Va(e,t)):structuredClone(e):(e,t)=>Pa(Va(e,t));function Ua(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Wa(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Ga(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Ua,r=e.options.footnoteBackLabel||Wa,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Dn(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Ha(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
10
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
11
- `}]}}var Ka=(function(e){if(e==null)return Za;if(typeof e==`function`)return Xa(e);if(typeof e==`object`)return Array.isArray(e)?qa(e):Ja(e);if(typeof e==`string`)return Ya(e);throw Error(`Expected function, string, or object as test`)});function qa(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ka(e[n]);return Xa(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ja(e){let t=e;return Xa(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ya(e){return Xa(t);function t(t){return t&&t.type===e}}function Xa(e){return t;function t(t,n,r){return!!(Qa(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Za(){return!0}function Qa(e){return typeof e==`object`&&!!e&&`type`in e}function $a(e){return e}var eo=[];function to(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ka(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+$a(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=eo,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=no(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function no(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?eo:[e]}function ro(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),to(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var io={}.hasOwnProperty,ao={};function oo(e,t){let n=t||ao,r=new Map,i=new Map,a={all:s,applyData:co,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ka,...n.handlers},one:o,options:n,patch:so,wrap:uo};return ro(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(io.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Ha(n);return r.children=a.all(e),r}return Ha(e)}return(a.options.unknownHandler||lo)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=fo(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=fo(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function so(e,t){e.position&&(t.position=St(e))}function co(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Ha(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function lo(e,t){let n=t.data||{},r=`value`in t&&!(io.call(n,`hProperties`)||io.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function uo(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
12
- `});++r<e.length;)r&&n.push({type:`text`,value:`
13
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
14
- `}),n}function fo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function po(e,t){let n=oo(e,t),r=n.one(e,void 0),i=Ga(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
15
- `},i)),a}function mo(e,t){return e&&`run`in e?async function(n,r){let i=po(n,{file:r,...t});await e.run(i,r)}:function(n,r){return po(n,{file:r,...e||t})}}function ho(e){if(e)throw e}var go=r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function _o(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vo(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?yo(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function yo(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var bo={basename:xo,dirname:So,extname:Co,join:wo,sep:`/`};function xo(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Do(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function So(e){if(Do(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Co(e){Do(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function wo(...e){let t=-1,n;for(;++t<e.length;)Do(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:To(n)}function To(e){Do(e);let t=e.codePointAt(0)===47,n=Eo(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Eo(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Do(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Oo={cwd:ko};function ko(){return`/`}function Ao(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function jo(e){if(typeof e==`string`)e=new URL(e);else if(!Ao(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Mo(e)}function Mo(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var No=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Po=class{constructor(e){let t;t=e?Ao(e)?{path:e}:typeof e==`string`||Ro(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Oo.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<No.length;){let e=No[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)No.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?bo.basename(this.path):void 0}set basename(e){Io(e,`basename`),Fo(e,`basename`),this.path=bo.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?bo.dirname(this.path):void 0}set dirname(e){Lo(this.basename,`dirname`),this.path=bo.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?bo.extname(this.path):void 0}set extname(e){if(Fo(e,`extname`),Lo(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=bo.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ao(e)&&(e=jo(e)),Io(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?bo.basename(this.path,this.extname):void 0}set stem(e){Io(e,`stem`),Fo(e,`stem`),this.path=bo.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new L(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Fo(e,t){if(e&&e.includes(bo.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+bo.sep+"`")}function Io(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Lo(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ro(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var zo=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Bo=e(go(),1),Vo={}.hasOwnProperty,Ho=new class e extends zo{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vo()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Bo.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Go(`data`,this.frozen),this.namespace[e]=t,this):Vo.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Go(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Jo(e),n=this.parser||this.Parser;return Uo(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Uo(`process`,this.parser||this.Parser),Wo(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Jo(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Xo(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Uo(`processSync`,this.parser||this.Parser),Wo(`processSync`,this.compiler||this.Compiler),this.process(e,r),qo(`processSync`,`process`,t),n;function r(e,r){t=!0,ho(e),n=r}}run(e,t,n){Ko(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Jo(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),qo(`runSync`,`run`,n),r;function i(e,t){ho(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Jo(t),r=this.compiler||this.Compiler;return Wo(`stringify`,r),Ko(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Go(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Bo.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];_o(o)&&_o(r)&&(r=(0,Bo.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Uo(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Wo(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Go(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ko(e){if(!_o(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function qo(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jo(e){return Yo(e)?e:new Po(e)}function Yo(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Xo(e){return typeof e==`string`||Zo(e)}function Zo(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var G=i(),K=e(n(),1),Qo=[],$o={allowDangerousHtml:!0},es=/^(https?|ircs?|mailto|xmpp)$/i,ts=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function ns(e){let t=rs(e),n=is(e);return as(t.runSync(t.parse(n),n),e)}function rs(e){let t=e.rehypePlugins||Qo,n=e.remarkPlugins||Qo,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$o}:$o;return Ho().use(Qi).use(n).use(mo,r).use(t)}function is(e){let t=e.children||``,n=new Po;return typeof t==`string`?n.value=t:``+t,n}function as(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||os;for(let e of ts)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return ro(e,l),Pt(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in nn)if(Object.hasOwn(nn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=nn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function os(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||es.test(e.slice(0,t))?e:``}var ss=12582912,cs=/^data:image\/[a-z0-9.+-]+(?:;[a-z0-9-]+=[^,;]*)*(?:;base64)?,/i;function ls(){return typeof window>`u`?null:window.location.origin}function us(e){let t=ls();try{return t?new URL(e,t):new URL(e)}catch{return null}}function ds(e){return cs.test(e)?e.length<=ss:!1}function fs(e){let t=e?.trim();if(!t)return null;if(ds(t))return t;let n=us(t);if(!n||n.protocol!==`http:`&&n.protocol!==`https:`)return null;let r=ls();return r&&n.origin===r?n.href:null}function ps(e,t){return!e.startsWith(`image/`)||!t?null:fs(`data:${e};base64,${t}`)}function ms(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function hs(e){let t=e?.trim();if(!t)return null;let n=Array.from(new Set((t.match(/"[^"]+"|\S+/g)??[]).map(e=>e.replace(/^"|"$/g,``).trim()).filter(Boolean).filter(e=>!/^OR$/i.test(e))));return n.length===0?null:RegExp(`(${n.map(ms).join(`|`)})`,`gi`)}var gs={markdown:{maxCharacters:24e3,maxLines:400},code:{maxCharacters:32e3,maxLines:600},diff:{maxCharacters:64e3,maxLines:800},plain:{maxCharacters:64e3,maxLines:1e3}};function _s(e,t){if(!e)return{text:e,renderedCharacters:0,renderedLines:0,truncated:!1};let n=Math.max(1,Math.min(e.length,Math.trunc(t.maxCharacters))),r=Math.max(1,Math.min(e.length+1,Math.trunc(t.maxLines))),i=n,a=1;for(let t=0;t<i;t+=1)if(e.charCodeAt(t)===10){if(a===r){i=t;break}a+=1}return i>0&&i<e.length&&e.charCodeAt(i-1)===13&&--i,i>0&&i<e.length&&e.charCodeAt(i-1)>=55296&&e.charCodeAt(i-1)<=56319&&--i,{text:e.slice(0,i),renderedCharacters:i,renderedLines:a,truncated:i<e.length}}function vs(e,t,n=t+1){let r=(e,t)=>e>=Math.ceil(t/2)?t:e*2;return{maxCharacters:r(e.maxCharacters,Math.max(1,t)),maxLines:r(e.maxLines,Math.max(1,n))}}function ys({copySource:e,onRenderMore:t,rendered:n,total:r,unit:i}){let[a,o]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{if(!a)return;let e=window.setTimeout(()=>o(!1),1500);return()=>window.clearTimeout(e)},[a]),(0,G.jsxs)(`div`,{className:`console-mono mt-2 flex flex-wrap items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2.5 py-2 text-[11px] text-[var(--console-muted)]`,children:[(0,G.jsxs)(`span`,{children:[`Showing `,n.toLocaleString(),` of `,r.toLocaleString(),` `,i]}),(0,G.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Render more content`,className:`motion-hover motion-press rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 font-semibold text-[var(--console-text)] hover:border-[var(--console-border-strong)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)]`,children:`Render more`}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{let t=typeof e==`function`?e():e;Se(t).then(e=>{e&&o(!0)})},"aria-label":a?`Full content copied`:`Copy full content`,className:`motion-hover motion-press inline-flex items-center gap-1 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-2 py-1 font-semibold text-[var(--console-text)] hover:border-[var(--console-border-strong)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand)]`,children:[a?(0,G.jsx)(xe,{className:`size-3`}):(0,G.jsx)(ie,{className:`size-3`}),a?`Copied`:`Copy full`]}),(0,G.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:a?`Full content copied`:``})]})}function bs(e,t,n){let[r,i]=(0,K.useState)(null),a=r&&Object.is(r.source,e)?r.budget:t;return{budget:a,renderMore:()=>i({source:e,budget:vs(a,n.characters??2**53-1,n.lines??2**53-1)})}}function xs({text:e,initialBudget:t,children:n}){let{budget:r,renderMore:i}=bs(e,t,{characters:e.length,lines:e.length+1}),a=(0,K.useMemo)(()=>_s(e,r),[r,e]);return(0,G.jsxs)(G.Fragment,{children:[n(a.text),a.truncated?(0,G.jsx)(ys,{copySource:e,onRenderMore:i,rendered:a.renderedCharacters,total:e.length,unit:`characters`}):null]})}var Ss={a:({children:e})=>(0,G.jsx)(`span`,{className:`console-markdown-link`,children:e}),img:({src:e,alt:t,title:n})=>{let r=fs(typeof e==`string`?e:void 0);return r?(0,G.jsx)(`img`,{src:r,alt:t??``,title:n,loading:`lazy`,className:`max-h-[520px] max-w-full rounded-md object-contain`}):(0,G.jsxs)(`span`,{className:`console-mono inline-block rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`Remote image not loaded`,t?`: ${t}`:``]})}};function Cs(e){return fs(e)??``}var ws=new Set([`code`,`pre`,`mark`]);function Ts(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i.index??0,a=i[0]??``;a&&(t>r&&n.push({type:`text`,value:e.slice(r,t)}),n.push({type:`element`,tagName:`mark`,properties:{},children:[{type:`text`,value:a}]}),r=t+a.length)}return n.length===0?null:(r<e.length&&n.push({type:`text`,value:e.slice(r)}),n)}function Es(e,t){if(!e.children)return;let n=[],r=!1;for(let i of e.children){if(i.type===`text`){let e=Ts(i.value??``,t);if(e){n.push(...e),r=!0;continue}}else i.tagName&&ws.has(i.tagName)||Es(i,t);n.push(i)}r&&(e.children=n)}function Ds(e){return t=>Es(t,e)}var Os=(0,K.memo)(function({text:e,highlightQuery:t}){let n=(0,K.useMemo)(()=>{let e=hs(t);return e?[[Ds,e]]:void 0},[t]);return(0,G.jsx)(xs,{text:e,initialBudget:gs.markdown,children:e=>(0,G.jsx)(`div`,{children:(0,G.jsx)(ns,{components:Ss,rehypePlugins:n,urlTransform:Cs,children:e})})})});function ks(e){let t=[];for(let n of e){if(n.type===`image`)continue;if(n.type===`plan`){t.push({type:`plan`,parts:[n]});continue}if(n.type!==`tool`&&!n.text.trim())continue;let e=t.at(-1);if(n.type===`text`){e?.type===`text`?e.parts.push(n):t.push({type:`text`,parts:[n]});continue}if(n.type===`reasoning`){e?.type===`reasoning`?e.parts.push(n):t.push({type:`reasoning`,parts:[n]});continue}e?.type===`tool`?e.parts.push(n):t.push({type:`tool`,parts:[n]})}return t}function As(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function js(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function Ms(e){return typeof e==`string`?e.trim():``}function q(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function J(e){return typeof e==`string`?e.trim():``}function Y(e){return typeof e==`string`?e:``}function Ns(e){try{return JSON.parse(e)}catch{return null}}function X(e){return e.replaceAll(/\\n/g,`
16
- `)}function Ps(e){return ps(J(e.mime_type),J(e.data))||(fs(J(e.url))??``)}function Fs(e){return Array.isArray(e)?e.flatMap((e,t)=>{let n=q(e);if(n.type!==`image`)return[];let r=Ps(n);return r?[{src:r,alt:`Tool output image ${t+1}`}]:[]}):[]}function Is(e){let t=Fs(e);if(t.length>0)return{kind:`media`,items:t,text:Bs(e,!1)||void 0};let n=typeof e==`string`&&e.trim()?js(e.trim()):e;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=Object.entries(n).map(([e,t])=>({label:e,value:t}));return e.length>0?{kind:`property-list`,items:e}:null}return null}function Ls(e){if(e==null)return``;if(typeof e==`string`){let t=e.trim();if(!t)return``;try{let e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return e}}try{return JSON.stringify(e,null,2)}catch{return typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?`${e}`:typeof e==`symbol`?e.description?`Symbol(${e.description})`:`Symbol`:typeof e==`function`?`[Function]`:`[Unserializable value]`}}function Rs(e){if(typeof e==`string`)return[e];if(Array.isArray(e))return e.flatMap(e=>Rs(e));if(e&&typeof e==`object`){let t=e;if(typeof t.text==`string`)return[t.text];if(t.content!==void 0)return Rs(t.content)}return[]}function zs(e){return e.replace(/^<system>/i,``).replace(/<\/system>$/i,``).trim()}function Bs(e,t=!0){let n=Rs(e).map(e=>e.trim()).filter(e=>t?!!e:!!e&&!/^<system>[\s\S]*<\/system>$/i.test(e));return n.length===0?``:n.map(e=>t&&/^<system>[\s\S]*<\/system>$/i.test(e)?zs(e):e).join(`
17
- `)}function Vs(e){let t=js(e);if(t&&typeof t==`object`){let e=t;if(typeof e.cmd==`string`)return e.cmd;if(typeof e.command==`string`)return e.command}return``}function Hs(e){let t=e.trim();return t?t.replace(/^tool:\s*/i,``).replace(/^\.+(?=\w)/,``):``}function Us(e){return e.title?.trim()?Hs(e.title):e.tool.trim()?Hs(e.tool):`tool`}function Ws(e){return Us(e).trim().toLowerCase()}function Gs(e,t=`Tool`){return Hs(J(e.title))||J(e.tool)||t}function Ks(e){return X(Bs(e)||Ls(e))||`No output captured.`}function Z(e){let t=Ks(e.outputValue);if(t!==`No output captured.`)return t;let n=Ks(e.errorValue);return n===`No output captured.`?`No output captured.`:n}function qs(e){let{status:t,input:n,output:r,error:i,metadata:a}=e.state,o=r??``,s=i??``,c=js(n??{}),l=a??{};return{status:t,command:Vs(c),inputValue:c,outputValue:o,errorValue:s,metadataValue:l,inputText:Ls(c)}}function Js(e){let t=Ms(e.nickname);return e.role===`assistant`&&t?`AGENT (${t})`:e.role===`user`?`USER`:e.role===`tool`?`TOOL`:`AGENT`}function Ys(e,t){if(t.toLowerCase()!==`cursor`)return e;let n=[];for(let t of e){if(t.role!==`tool`){n.push({...t,parts:[...t.parts]});continue}let e=n.at(-1);if(e?.role===`assistant`){e.parts.push(...t.parts);continue}n.push({...t,parts:[...t.parts]})}return n}function Xs(e,t){return`tool-${e}-${t}`}function Zs(e){return d(e)}function Qs(e){let t=Zs(e);return t===`read`?`read`:t?`write`:`execute`}function $s(e){let t=new Map;for(let n of e){let e=t.get(n.path);if(e){e.count+=1,e.anchors.push({anchorId:n.anchorId,time:n.time,toolLabel:n.toolLabel}),n.time>=e.latestTime&&(e.latestTime=n.time,e.latestAnchorId=n.anchorId,e.toolLabel=n.toolLabel);continue}t.set(n.path,{path:n.path,count:1,latestTime:n.time,latestAnchorId:n.anchorId,toolLabel:n.toolLabel,anchors:[{anchorId:n.anchorId,time:n.time,toolLabel:n.toolLabel}]})}return[...t.values()].map(e=>({...e,anchors:e.anchors.toSorted((e,t)=>e.time-t.time)})).toSorted((e,t)=>t.latestTime===e.latestTime?e.path.localeCompare(t.path):t.latestTime-e.latestTime)}function ec(e){let t=new Map,n={read:[],edit:[],write:[],delete:[]};return e.forEach(({msg:e,blocks:r,index:i})=>{let a=0;for(let o of r)if(o.type===`tool`)for(let[r,s]of o.parts.entries()){let c=o.anchorIds?.[r]??Xs(i,a);a+=1,t.set(c,i);let l=Us(s),u=s.time_created??e.time_created;for(let{kind:e,path:t}of p(s))n[e].push({kind:e,path:t,anchorId:c,time:u,toolLabel:l})}}),{anchorMessageIndexes:t,summary:{read:$s(n.read),edit:$s(n.edit),write:$s(n.write),delete:$s(n.delete)}}}function tc(e,t){if(!e)return t;let n={read:[],edit:[],write:[],delete:[]},r=new Map;for(let e of[`read`,`edit`,`write`,`delete`])for(let n of t[e])r.set(`${e}\0${n.path}`,n);for(let t of e){let e=r.get(`${t.kind}\0${t.path}`);n[t.kind].push({path:t.path,count:t.count,latestTime:t.latestTime,latestAnchorId:e?.latestAnchorId??``,toolLabel:e?.toolLabel??t.kind,anchors:e?.anchors??[]})}for(let e of[`read`,`edit`,`write`,`delete`])n[e].sort((e,t)=>t.latestTime===e.latestTime?e.path.localeCompare(t.path):t.latestTime-e.latestTime);return n}var nc=48,rc=1;function ic(e){return`session-message-${e}`}function ac(e,t){return`${ic(e)}-block-${t}`}function oc(e){let t=e.replace(/<!--[\s\S]*?-->/g,` `).replace(/(^|\s)#{1,6}\s+/g,`$1`).replace(/(\*\*|__)(.*?)\1/g,`$2`).replace(/([*_])(.*?)\1/g,`$2`).replace(/`([^`]+)`/g,`$1`).replace(/\s+/g,` `).trim(),n=Array.from(t);return n.length<=nc?t:`${n.slice(0,nc).join(``)}…`}function sc(e){return oc(e.map(e=>e.type===`text`||e.type===`reasoning`||e.type===`plan`?e.text:``).filter(Boolean).join(` `))}function cc(e){return`tool-${Qs(e)}`}var lc={"tool-read":`Read`,"tool-write":`Write`,"tool-execute":`Execute`};function uc(e){let t=[];for(let{msg:n,blocks:r,index:i}of e){if(n.role===`user`){let e=ic(i),n=sc(r.flatMap(e=>e.parts));t.push({id:e,kind:`user`,anchorId:e,messageIndex:i,tooltip:`User · ${n||`Message`}`});continue}r.forEach((e,n)=>{if(e.type===`tool`){e.parts.forEach((n,r)=>{let a=e.anchorIds?.[r];if(!a)return;let o=cc(n);t.push({id:a,kind:o,anchorId:a,messageIndex:i,tooltip:`${lc[o]} · ${Us(n)}`})});return}let r=ac(i,n),a=sc(e.parts);t.push({id:r,kind:`agent`,anchorId:r,messageIndex:i,tooltip:`Agent · ${a||`Response`}`})})}return t}function dc(e,t){if(e.length===0)return null;let n=e.toSorted((e,t)=>e.top-t.top),r=n[0].index;for(let e of n){if(e.top>t)break;r=e.index}return r}function fc(e,t,n,r){return r<=0?null:e<=rc?0:e>=Math.max(0,n-t)-rc?r-1:null}function pc(e,t,n,r){if(r<=0||n<=0)return null;let i=Math.min(1,Math.max(0,(e-t)/n));return Math.min(r-1,Math.floor(i*r))}var mc=[`user`,`agent_message`,`thinking`,`plan`];function hc(e){return bc(e)?`Browser`:e.title?.trim()?_c(e.title):e.tool.trim()?_c(e.tool):`tool`}function gc(e){return bc(e)?`browser`:_c(e.tool.trim()?e.tool:hc(e)).toLowerCase()}function _c(e){return e.trim().replace(/^tool:\s*/i,``).replace(/^\.+(?=\w)/,``)}function vc(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function yc(e){return typeof e==`string`?e.trim():``}function bc(e){let t=yc(vc(e.state.metadata).namespace);return _c(yc(e.tool)).toLowerCase()===`js`&&(t===`mcp__node_repl__`||t===`mcp__node_repl__.js`)}function xc(e,t){let n=gc(t),r=`tool:${n}`,i=e.get(n);if(i){i.count+=1;return}e.set(n,{id:r,toolKey:n,label:hc(t),count:1,kind:Qs(t)})}function Sc(e,t){return t.role===`user`?`user`:e.type===`reasoning`?`thinking`:e.type===`plan`?`plan`:`agent_message`}function Cc(e){let t={user:0,agent_message:0,thinking:0,plan:0,tools_all:0},n=new Set,r=new Map;for(let{msg:i,blocks:a}of e)for(let e of a){if(e.type===`tool`){t.tools_all+=e.parts.length;for(let t of e.parts)xc(r,t),n.add(`tool:${gc(t)}`);continue}let a=Sc(e,i);t[a]+=1,n.add(a)}let i=[...r.values()].toSorted((e,t)=>e.label.localeCompare(t.label));return{filterIds:n,counts:t,tools:i,maxToolCount:i.reduce((e,t)=>Math.max(e,t.count),0),totalUnitCount:t.user+t.agent_message+t.thinking+t.plan+t.tools_all}}function wc(e,t){return t.has(`tool:${gc(e)}`)}function Tc(e,t,n){return e.type===`tool`?e.parts.some(e=>wc(e,n)):n.has(Sc(e,t))}function Ec(e,t){let n=e.parts.map((e,n)=>wc(e,t)?n:-1).filter(e=>e>=0),r=n.map(t=>e.parts[t]);return r.length===0?null:{...e,parts:r,anchorIds:e.anchorIds?n.map(t=>e.anchorIds[t]):void 0}}function Dc(e,t){let n=[],r=0;for(let i of e){let e=i.blocks.filter(e=>Tc(e,i.msg,t)).map(e=>e.type===`tool`?Ec(e,t):e).filter(e=>e!=null);if(e.length!==0){for(let t of e)r+=t.type===`tool`?t.parts.length:1;n.push({msg:i.msg,blocks:e,index:i.index})}}return{messages:n,visibleUnitCount:r}}var Oc=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends Oc{};function kc(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Ac(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function jc(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Mc(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Nc(e,t){return jc(e,t,``)}function Pc(e,t){return Mc(e,t,``)}function Fc(e,t){return t.slice(0,Ic(e,t))}function Ic(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Lc(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Rc(e,t){if(t)return Bc(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function zc(e,t){if(t)return Bc(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Bc(e,t){if(!t)return[zc(e),Rc(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Lc(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Vc=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Hc=RegExp(`[${Vc}]+|\\s+|[^${Vc}]`,`ug`);new class extends Oc{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Lc(e,r)}else n=e.match(Hc)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Uc(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Uc(n,i,r,null,t.intlSegmenter),e}};function Uc(e,t,n,r,i){if(t&&n){let[a,o]=Bc(t.value,i),[s,c]=Bc(n.value,i);if(e){let r=kc(a,s);e.value=Mc(e.value,s,r),t.value=Nc(t.value,r),n.value=Nc(n.value,r)}if(r){let e=Ac(o,c);r.value=jc(r.value,c,e),t.value=Pc(t.value,e),n.value=Pc(n.value,e)}}else if(n){if(e){let e=zc(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=zc(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=zc(r.value,i),[a,o]=Bc(t.value,i),s=kc(n,a);t.value=Nc(t.value,s);let c=Ac(Nc(n,s),o);t.value=Pc(t.value,c),r.value=jc(r.value,n,c),e.value=Mc(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=zc(r.value,i),n=Fc(Rc(t.value,i),e);t.value=Pc(t.value,n)}else if(e){let n=Fc(Rc(e.value,i),zc(t.value,i));t.value=Nc(t.value,n)}}new class extends Oc{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Vc}]+|[^\\S\\n\\r]+|[^${Vc}]`,`ug`);return e.match(t)||[]}};var Wc=new class extends Oc{constructor(){super(...arguments),this.tokenize=Kc}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
18
- `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
19
- `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
20
- `)&&(e=e.slice(0,-1)),t.endsWith(`
21
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Gc(e,t,n){return Wc.diff(e,t,n)}function Kc(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
22
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function qc(e){return e==`.`||e==`!`||e==`?`}new class extends Oc{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(qc(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Oc{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Oc{constructor(){super(...arguments),this.tokenize=Kc}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Jc(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Jc(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Jc(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Jc(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Oc{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Yc(e,t,n){return!t.trim()&&!n.trim()?[]:[{label:el(e),lines:Qc(Gc(X(t),X(n)))}]}function Xc(e,t){let n=X(e).split(`
23
- `),r=X(t).split(`
24
- `);return[`@@`,...n.map(e=>`- ${e}`),...r.map(e=>`+ ${e}`)].join(`
25
- `)}function Zc(e){let t=X(e),n=t.split(`
26
- `);return t.endsWith(`
27
- `)&&n.pop(),n}function Qc(e){return e.flatMap(e=>{let t=e.added?`add`:e.removed?`remove`:`context`;return Zc(e.value).map(e=>({type:t,text:e}))})}function $c(e){let t=q(e).edit;return Array.isArray(t)?t:t&&typeof t==`object`?[t]:[]}function el(e){let t=e.trim();if(!t)return`edit`;let n=t.split(`/`).pop()||t;return n===t?n:`${n} · ${t}`}function tl(e,t){let n=$c(e.inputValue),r=el(t);return n.map(e=>{let t=q(e),n=Y(t.old),i=Y(t.new);return!n.trim()&&!i.trim()?null:{label:r,lines:Qc(Gc(X(n),X(i)))}}).filter(e=>e!=null&&e.lines.length>0)}function nl(e,t){let n=q(e.inputValue),r=Array.isArray(n.edits)?n.edits:[],i=el(t),a=r.map(e=>{let t=q(e),n=Y(t.oldText)||Y(t.old),r=Y(t.newText)||Y(t.new);return!n.trim()&&!r.trim()?null:{label:i,lines:Qc(Gc(X(n),X(r)))}}).filter(e=>e!=null&&e.lines.length>0);if(a.length>0)return a;let o=q(e.metadataValue),s=Y(o.patch)||Y(o.diff);return s.trim()?[{label:i,lines:s.split(`
28
- `).map(e=>({type:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`,text:e}))}]:[]}function rl(e,t){let n=q(e.metadataValue),r=(Array.isArray(n.diffs)?n.diffs:[]).flatMap(e=>{let n=q(e);return Yc(Y(n.path)||t,Y(n.oldText),Y(n.newText))});if(r.length>0)return r;let i=q(e.inputValue);return Yc(t,Y(i.old_string),Y(i.new_string))}function il(e){return e.startsWith(`@@`)?{type:`context`,text:e}:e.startsWith(`+`)?{type:`add`,text:e.slice(1)}:e.startsWith(`-`)?{type:`remove`,text:e.slice(1)}:e.startsWith(` `)?{type:`context`,text:e.slice(1)}:{type:`context`,text:e}}function al(e,t){let n=q(q(e.metadataValue).display),r=Array.isArray(n.structuredPatch)?n.structuredPatch:[],i=Y(n.filePath)||t;return r.map(e=>{let t=q(e),n=(Array.isArray(t.lines)?t.lines:[]).map(e=>typeof e==`string`?il(e):null).filter(e=>e!=null);return n.length===0?null:{label:el(i),lines:n}}).filter(e=>e!=null)}function ol(e){let t=Y(q(e.metadataValue).diff);if(t.trim())return X(t);let n=$c(e.inputValue).map(e=>{let t=q(e),n=Y(t.old),r=Y(t.new);return!n.trim()&&!r.trim()?``:Xc(n,r)}).filter(Boolean).join(`
29
-
30
- `);return n.trim()?n:Z(e)}function sl(e){let t=q(e);return J(t.filePath)||J(t.file_path)||J(t.path)||J(t.targetFile)||J(t.effectiveUri)||J(t.relativeWorkspacePath)||``}function Q(e,t){let n=e.trim(),r=(t??``).replace(/\/+$/,``);return!n||!r?n:n===r?`.`:n.startsWith(`${r}/`)?n.slice(r.length+1):n}var cl=null;function ll(e){return cl?.base!==e&&(cl={base:e,pattern:RegExp(`${As(e)}(?=$|/|[\\s"'\\)\\]}:;,])`,`g`)}),cl.pattern.lastIndex=0,cl.pattern}function ul(e,t){let n=(t??``).replace(/\/+$/,``);return!e||!n?e:e.replace(ll(n),`.`)}function dl(e,t){return e.startsWith(`${t}/`)?e.slice(t.length+1):e}var fl={".bashrc":`bash`,".zshrc":`bash`,".profile":`bash`,dockerfile:`docker`,".env":`ini`},pl={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,py:`python`,sql:`sql`,rs:`rust`,go:`go`,java:`java`,c:`c`,h:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,hpp:`cpp`,cs:`csharp`,sh:`bash`,bash:`bash`,zsh:`bash`,html:`html`,css:`css`,yaml:`yaml`,yml:`yaml`,json:`json`,md:`markdown`,toml:`toml`,conf:`ini`,xml:`markup`,svg:`markup`,properties:`ini`,dockerfile:`docker`};function ml(e){let t=e.split(`/`).pop()?.toLowerCase()??``;if(!t)return`text`;let n=fl[t];if(n)return n;if(t.startsWith(`.env.`))return`ini`;let r=t.includes(`.`)?t.split(`.`).pop()??``:``;return r&&pl[r]||`text`}function hl(e){return e.replace(/\n*<system-reminder>[\s\S]*$/i,``).trimEnd()}function gl(e){let t=Bs(e,!1)||Ks(e);return t===`No output captured.`?t:hl(t.replace(/^<file>\s*/i,``).replace(/\s*<\/file>\s*$/i,``)).split(`
31
- `).filter(e=>!/^\(End of file - total \d+ lines\)$/.test(e.trim())).map(e=>e.replace(/^\d+\|\s?/,``).replace(/^\s*\d+\t/,``)).join(`
32
- `).trimEnd()||`No output captured.`}function _l(e){let t=q(e.inputValue);if(e.status===`completed`){let e=Y(t.content);if(e.trim())return X(e)}return Z(e)}function vl(e){return{...e.defaultStrategy,Icon:e.Icon,title:e.title,secondaryText:e.displayPath||void 0,details:e.details??e.defaultStrategy.details,showInputPreview:!1,outputContent:e.outputContent}}function yl(e){return vl({...e,Icon:de,title:`read`,outputContent:e.outputContent??{kind:`plain`,text:e.text??gl(e.state.outputValue),language:ml(e.filePath),isCode:e.isCode??!0}})}function bl(e){return vl({...e,Icon:e.Icon??g,title:`write`,outputContent:{kind:`plain`,text:_l(e.state),language:ml(e.filePath),isCode:e.isCode??e.state.status===`completed`}})}function xl(e){return vl({...e,Icon:we,title:`edit`})}function Sl(e){let t=[Q(e.path??``,e.baseDirectory),e.pattern].filter(Boolean).join(` · `);return{...e.defaultStrategy,Icon:A,title:e.title,secondaryText:t||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:Z(e.state),language:`text`,isCode:!1}}}function Cl(e){let t=ul(e.command,e.baseDirectory),n=e.description?`${e.description}${t?` (${t})`:``}`:t?`(${t})`:void 0,r=Z(e.state);return{...e.defaultStrategy,Icon:D,title:e.title,secondaryText:n,details:e.includeCommandDetail&&e.command?[{label:`Command`,value:t||e.command}]:e.defaultStrategy.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.emptyOutputMarker===r?`No output captured.`:r,language:`text`,isCode:!1}}}function wl(e,t,n){let r=ul(t.command||t.inputText||`{}`,n).replace(/\s+/g,` `).trim(),i=r.length>72?`${r.slice(0,72)}...`:r,a=Is(t.outputValue);return{Icon:D,title:Gs(e),secondaryText:i?`(${i})`:void 0,details:[],expandable:!0,showInputPreview:!0,outputContent:a??{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}function Tl(e,t,n,r){let i=ul(J(q(t.inputValue).name),r);return{...n,Icon:ne,title:J(e.tool)||`skill`,secondaryText:i||void 0,expandable:!1,showInputPreview:!1}}function El(e){let t=new Map;return{tasks:e.map(e=>{let n=q(e),r=Y(n.status),i=r===`completed`||r===`in_progress`||r===`error`?r:`pending`;return t.set(i,(t.get(i)??0)+1),{label:Y(n.content)||Y(n.subject)||`Untitled task`,status:i,detail:Y(n.activeForm)||Y(n.description)||void 0}}),summary:[...t.entries()].map(([e,t])=>`${t} ${e}`).join(` · `)}}function Dl(e,t){let n=[...t.matchAll(/"([^"]+)"="([^"]+)"/g)],r=new Map(n.map(e=>[e[1],[e[2]]]));return(Array.isArray(e.questions)?e.questions:[]).flatMap(e=>{let t=q(e),n=Y(t.question);if(!n)return[];let i=(Array.isArray(t.options)?t.options:[]).flatMap(e=>{let t=q(e),n=Y(t.label);if(!n)return[];let r=n.replace(/\s*\(Recommended\)\s*$/i,``);return[{label:r,description:Y(t.description)||void 0,recommended:r!==n||void 0}]});return[{header:Y(t.header)||void 0,question:n,options:i,answers:r.get(n)??[]}]})}function Ol(e){return e.tool.trim().toLowerCase()}function kl(e){return typeof e==`string`?e.trim():typeof e==`number`||typeof e==`boolean`?String(e):``}function Al(e,t){let n=Z(t),r=Y(q(js(n)).message)||n;return[{label:`Recipient`,value:Y(e.recipient)||Y(e.to)},{label:`Summary`,value:Y(e.summary)},{label:`Message`,value:Y(e.message)||Y(e.content)},{label:`Delivery`,value:r}].filter(e=>e.value&&e.value!==`No output captured.`)}function jl(e,t,n){let r=wl(e,t,n),i=Ol(e),a=q(t.inputValue),o=sl(t.inputValue),s=Q(o,n);if(i===`read`)return yl({defaultStrategy:r,state:t,filePath:o,displayPath:s,outputContent:Is(t.outputValue)});if(i===`edit`){let e=Y(a.old_string),n=Y(a.new_string),i=Yc(s||o,e,n);return xl({defaultStrategy:r,displayPath:s,outputContent:i.length>0?{kind:`structured-diff`,blocks:i}:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}})}if(i===`write`)return bl({defaultStrategy:r,state:t,filePath:o,displayPath:s,isCode:!0});if(i===`bash`||i===`workflow`){let e=Y(a.command)||Y(a.script),o=Y(a.description),s=ul(e,n);return{...r,Icon:D,title:i===`workflow`?`workflow`:`bash`,secondaryText:o||Ms(s).slice(0,120)||void 0,details:e?[{label:i===`workflow`?`Script`:`Command`,value:s}]:[],showInputPreview:!1,contentLabel:t.status===`error`?`Error`:`Terminal output`,outputContent:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}if(i===`todowrite`||i===`taskcreate`){let e=El(i===`todowrite`?Array.isArray(a.todos)?a.todos:[]:[a]);return{...r,Icon:O,title:i===`todowrite`?`tasks`:`create task`,secondaryText:e.summary||void 0,details:[],showInputPreview:!1,contentLabel:`Task state`,outputContent:{kind:`task-list`,items:e.tasks}}}if(i===`taskupdate`||i===`tasklist`){let e=Is(i===`taskupdate`?a:t.outputValue);return{...r,Icon:O,title:i===`taskupdate`?`update task`:`list tasks`,secondaryText:Y(a.taskId)||Y(a.status)||void 0,details:[],showInputPreview:!1,contentLabel:`Task state`,outputContent:e??{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}if(i===`agent`){let e=Y(a.subagent_type)||Y(a.name),n=Y(a.description);return{...r,Icon:ae,title:e?`agent · ${e}`:`agent`,secondaryText:n||void 0,details:[Y(a.model)?{label:`Model`,value:Y(a.model)}:null,a.run_in_background===!0?{label:`Mode`,value:`Background`}:null].filter(e=>e!=null),showInputPreview:!1,contentLabel:`Agent result`,outputContent:{kind:`plain`,text:Z(t),language:`markdown`,isCode:!1}}}if(i===`askuserquestion`){let e=Dl(a,Z(t));return{...r,Icon:ue,title:`ask`,secondaryText:e.length?`${e.length} question${e.length===1?``:`s`}`:void 0,details:[],showInputPreview:!1,contentLabel:`Questions`,outputContent:e.length?{kind:`question-list`,questions:e}:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}if(i===`websearch`||i===`webfetch`){let e=Y(a.query),n=Y(a.url);return{...r,Icon:A,title:i===`websearch`?`web search`:`web fetch`,secondaryText:e||n||void 0,details:[],showInputPreview:!1,contentLabel:`Results`,outputContent:{kind:`plain`,text:Z(t),language:`markdown`,isCode:!1}}}if(i===`toolsearch`)return{...r,Icon:te,title:`find tools`,secondaryText:Y(a.query)||void 0,details:[],showInputPreview:!1,contentLabel:`Matches`};if(i===`skill`)return{...r,Icon:ne,title:`skill`,secondaryText:Y(a.skill)||void 0,details:[],showInputPreview:!1,contentLabel:`Result`};if(i===`structuredoutput`||i===`reportfindings`)return{...r,Icon:O,title:i===`reportfindings`?`report findings`:`structured output`,secondaryText:`${Object.keys(a).length} fields`,details:[],showInputPreview:!1,contentLabel:`Submitted fields`,outputContent:{kind:`property-list`,items:Object.entries(a).map(([e,t])=>({label:e,value:t}))}};if(i.startsWith(`mcp__claude-in-chrome__`)){let e=i.replace(`mcp__claude-in-chrome__`,``).replaceAll(`_`,` `),t=Y(a.url),n=Y(a.action)||Y(a.query),o=kl(a.tabId);return{...r,Icon:fe,title:`browser · ${e}`,secondaryText:t||n||void 0,details:o?[{label:`Tab`,value:o}]:[],showInputPreview:!1,contentLabel:`Browser result`}}if(i===`sendmessage`){let e=Y(a.recipient)||Y(a.to);return{...r,Icon:E,title:`send message`,secondaryText:e||void 0,details:[],showInputPreview:!1,contentLabel:`Message details`,outputContent:{kind:`property-list`,items:Al(a,t)}}}return{...r,title:Gs(e)}}function Ml(e,t,n){let r=wl(e,t,n),i=e.tool.toLowerCase(),a=q(t.inputValue),o=sl(t.inputValue),s=Q(o,n);return i===`glob`?Sl({defaultStrategy:r,state:t,title:e.tool||`glob`,pattern:J(a.pattern),baseDirectory:n}):i===`grep`?Sl({defaultStrategy:r,state:t,title:e.tool||`grep`,path:J(a.path),pattern:J(a.pattern),baseDirectory:n}):i===`bash`?Cl({defaultStrategy:r,state:t,title:e.tool||`bash`,command:J(a.command),description:J(a.description),baseDirectory:n}):i===`read`?yl({defaultStrategy:r,state:t,filePath:o,displayPath:s}):i===`edit`?xl({defaultStrategy:r,displayPath:s,outputContent:{kind:`plain`,text:ol(t),language:`diff`,isCode:!0}}):i===`write`?bl({defaultStrategy:r,state:t,filePath:o,displayPath:s}):i===`skill`?Tl(e,t,r,n):r}function Nl(e,t,n){let r=wl(e,t,n),i=e.tool.toLowerCase(),a=q(t.inputValue),o=sl(t.inputValue),s=Q(o,n);if(i===`glob`)return Sl({defaultStrategy:r,state:t,title:e.title||`glob`,pattern:J(a.pattern),baseDirectory:n});if(i===`grep`)return Sl({defaultStrategy:r,state:t,title:e.title||`grep`,path:J(a.path),pattern:J(a.pattern),baseDirectory:n});if(i===`shell`)return Cl({defaultStrategy:r,state:t,title:e.title||`bash`,command:J(a.command),baseDirectory:n});if(i===`readfile`)return yl({defaultStrategy:r,state:t,filePath:o,displayPath:s});if(i===`strreplacefile`){let e=tl(t,s||o);return xl({defaultStrategy:r,displayPath:s,outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:ol(t),language:`diff`,isCode:!0}})}return i===`writefile`?bl({defaultStrategy:r,state:t,filePath:o,displayPath:s}):r}function Pl(e){return e.replace(/\s*[((](?:Recommended|推荐)[))]\s*$/i,``).trim()}function Fl(e){let t=new Map;return{text:e.map(e=>{let n=q(e),r=J(n.status)||`pending`,i=J(n.priority),a=J(n.content)||J(n.title);t.set(r,(t.get(r)??0)+1);let o=r===`completed`?`x`:r===`in_progress`?`~`:` `,s=i?` _${i}_`:``;return`- [${o}] ${a||`(empty todo)`}${s}`}).join(`
33
- `)||`No todos captured.`,summary:[...t.entries()].map(([e,t])=>`${t} ${e}`).join(` · `),details:[...t.entries()].map(([e,t])=>({label:e,value:String(t)}))}}function Il(e){let t=new Map;try{let n=q(q(JSON.parse(e)).answers);if(n)for(let[e,r]of Object.entries(n)){let n=J(r);e.trim()&&n&&t.set(e.trim(),[Pl(n)])}}catch{}for(let n of e.matchAll(/"([^"]+)"="([^"]+)"/g)){let e=n[1]?.trim(),r=n[2]?.trim();!e||!r||t.set(e,[Pl(r)])}return t}function Ll(e,t){let n=q(e),r=Array.isArray(n.questions)?n.questions:[],i=Il(t),a=r.map(e=>{let t=q(e),n=J(t.question);if(!n)return null;let r=Array.isArray(t.options)?t.options.map(e=>{let t=q(e),n=J(t.label),r=Pl(n);return r?{label:r,description:J(t.description)||void 0,recommended:r!==n.trim()||void 0}:null}).filter(e=>e!=null):[];return{header:J(t.header)||void 0,question:n,options:r,answers:i.get(n)??[]}}).filter(e=>e!=null);return a.length===0?{secondaryText:void 0,outputContent:{kind:`plain`,text:t,language:`text`,isCode:!1}}:{secondaryText:`${a.length} question${a.length===1?``:`s`}`,outputContent:{kind:`question-list`,questions:a}}}function Rl(e,t,n){let r=wl(e,t,n),i=Ws(e),a=q(t.inputValue),o=q(t.metadataValue),s=sl(t.inputValue),c=Q(s,n),l=Z(t);if(i===`bash`||i===`shell`){let e=J(a.description);return Cl({defaultStrategy:r,state:t,title:`bash`,command:J(a.command),description:e,baseDirectory:n,includeCommandDetail:!0,emptyOutputMarker:`(Bash completed with no output)`})}if(i===`read`||i===`readfile`)return yl({defaultStrategy:r,state:t,filePath:s,displayPath:c});if(i===`edit`||i===`strreplacefile`){let e=al(t,c||s),n=Y(a.old_string),i=Y(a.new_string),u=Yc(c||s,n,i),d=e.length>0?e:u,f=q(o.display);return xl({defaultStrategy:r,displayPath:c,details:[typeof f.additions==`number`?{label:`Additions`,value:String(f.additions)}:null,typeof f.deletions==`number`?{label:`Deletions`,value:String(f.deletions)}:null].filter(e=>e!=null),outputContent:d.length>0?{kind:`structured-diff`,blocks:d}:{kind:`plain`,text:l,language:`text`,isCode:!1}})}if(i===`write`||i===`writefile`)return bl({defaultStrategy:r,state:t,filePath:s,displayPath:c,Icon:De});if(i===`glob`||i===`grep`)return Sl({defaultStrategy:r,state:t,title:i,path:J(a.path),pattern:J(a.pattern),baseDirectory:n});if(i===`todowrite`||i===`todolist`){let e=Fl(Array.isArray(a.todos)?a.todos:[]);return{...r,Icon:O,title:`todo`,secondaryText:e.summary||void 0,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.text,language:`markdown`,isCode:!1}}}if(i===`agent`){let e=J(a.subagent_type),t=J(a.description);return{...r,Icon:ae,title:e?`agent · ${e}`:`agent`,secondaryText:t||void 0,details:e?[{label:`Type`,value:e}]:[],showInputPreview:!1,outputContent:{kind:`plain`,text:l,language:`markdown`,isCode:!1}}}if(i===`askuserquestion`){let e=Ll(t.inputValue,l);return{...r,Icon:ue,title:`ask`,secondaryText:e.secondaryText,details:[],showInputPreview:!1,outputContent:e.outputContent}}if(i===`enterplanmode`||i===`exitplanmode`){let e=Y(a.plan);return{...r,Icon:O,title:i===`enterplanmode`?`plan mode`:`plan approved`,secondaryText:e.split(`
34
- `).find(e=>e.trim())?.replace(/^#+\s*/,``)||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:e||l,language:`markdown`,isCode:!1}}}if(i===`websearch`){let e=J(a.query);return{...r,Icon:A,title:`web search`,secondaryText:e||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:l,language:`markdown`,isCode:!1}}}if(i===`skill`){let e=J(a.skill);return{...r,Icon:ne,title:`skill`,secondaryText:e||void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:l,language:`markdown`,isCode:!1}}}return r}function zl(e,t,n){return Rl({...e,title:``},t,n)}function Bl(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function $(e){return typeof e==`string`?e.trim():``}function Vl(e){return typeof e==`string`?e:``}function Hl(e){return typeof e==`string`?e.trim():typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?`${e}`:``}function Ul(e){return e.replace(/\\n/g,`
35
- `)}function Wl(e){return e.replace(/\s*\(Recommended\)\s*$/i,``).trim()}function Gl(e){let t=e.trim();return{label:Wl(t),recommended:/\(Recommended\)\s*$/i.test(t)}}function Kl(e){return e.replace(/\s+/g,` `).trim()}function ql(e,t=88){let n=Kl(e);return n?n.length>t?`${n.slice(0,t)}...`:n:``}function Jl(e,t){return ql([`${t} questions`,...e.filter(Boolean).slice(0,2)].join(` · `),96)}function Yl(e){try{return JSON.parse(e)}catch{return null}}function Xl(e){let t=Ul(e).split(`
36
- `);if(t.length<5||!(/^Chunk ID:\s+\S+/.test(t[0]||``)&&/^Wall time:\s+/.test(t[1]||``)&&/^Process (?:exited with code \d+|running with session ID \d+)/.test(t[2]||``)&&/^Original token count:\s+\d+/.test(t[3]||``)&&/^Output:$/.test(t[4]||``)))return e;let n=5;for(;n<t.length&&t[n]?.trim()===``;)n+=1;let r=t.slice(n).join(`
37
- `);return r.trim()?r:e}function Zl(e,t,n){n.trim()&&e.push({label:t,value:n})}function Ql(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e}function $l(e){return e.trim()?!/[|&;<>()$`*?{}[\]\\]/.test(e):!1}function eu(e){let t=Ql(e.trim());return $l(t)?t:null}function tu(e){let t=e.trim();if(!t)return null;let n=t.match(/^nl\s+-ba\s+([^\s]+)\s*\|\s*sed\s+-n\s+['"][^'"]+['"]$/);if(n)return eu(n[1]||``);for(let e of[/^cat\s+([^\s]+)$/,/^sed\s+-n\s+['"][^'"]+['"]\s+([^\s]+)$/,/^head\s+-n\s+\d+\s+([^\s]+)$/,/^tail\s+-n\s+\d+\s+([^\s]+)$/]){let n=t.match(e);if(n)return eu(n[1]||``)}return null}function nu(e){let t=e.split(`
38
- `),n=t.filter(e=>e.trim());if(n.length===0)return e;let r=/^\s*\d+(?:\t|\|\s?)/;return n.filter(e=>r.test(e)).length/n.length<.6?e:t.map(e=>e.replace(/^\s*\d+(?:\t|\|\s?)/,``)).join(`
39
- `)}function ru(e){return/\b(Test Files|Tests|Coverage report|coverage: platform|Ran \d+ tests)\b/.test(e)||/^(PASS|FAIL|stdout\s+\|)/m.test(e)||/\bmodules transformed\b/.test(e)}function iu(e){let t=e.trim();return!t||ru(t)?null:(t.startsWith(`{`)||t.startsWith(`[`))&&Yl(t)!=null?`json`:/<(!DOCTYPE html|html\b|body\b|div\b|span\b|main\b|section\b|svg\b|\/[a-z])/i.test(t)?`markup`:[/^#{1,6}\s/m,/^[-*]\s/m,/^\d+\.\s/m,/^```/m].filter(e=>e.test(t)).length>=1&&!/[{};]\s*$/.test(t)?`markdown`:(t.match(/^[A-Za-z0-9_-]+:\s.+$/gm)||[]).length>=2&&!/\b(import|export|const|let|function|class)\b/.test(t)&&!/[{}()[\];]/.test(t)?`yaml`:[/^(from\s+\S+\s+import\s+.+|import\s+\S+)/m,/^def\s+\w+\(/m,/^class\s+\w+[:(]/m].filter(e=>e.test(t)).length>=2||/^(from\s+\S+\s+import\s+.+|import\s+\S+)/m.test(t)&&/^def\s+\w+\(/m.test(t)?`python`:[/\binterface\s+\w+/,/\btype\s+\w+\s*=/,/\bimplements\b/,/\bas const\b/,/:\s*[A-Z][A-Za-z0-9_<>,[\] |&?]+/].filter(e=>e.test(t)).length>=1&&/\b(import|export|const|let|function|class)\b/.test(t)?`typescript`:[/^\s*import\s.+from\s/m,/^\s*export\s/m,/\b(const|let|function|class)\b/].filter(e=>e.test(t)).length>=2?`javascript`:null}function au(e,t,n){let r=Xl(t),i=tu(e);if(i){let e=n(i);return{text:nu(r),language:e,isCode:e!==`text`,sourcePath:i,confidence:`path`}}let a=iu(r);return a?{text:r,language:a,isCode:!0,confidence:`content`}:{text:r,language:`text`,isCode:!1,confidence:`plain`}}function ou(e,t,n,r=e=>e,i=e=>e){let a=Bl(e),o=$(a.cmd),s=$(a.workdir),c=$(a.sandbox_permissions),l=$(a.justification),u=i(o),d=[];Zl(d,`Command`,u),Zl(d,`Workdir`,r(s)),Zl(d,`Escalation`,c),Zl(d,`Justification`,l);let f=ql(u);return{secondaryText:l?[l,f].filter(Boolean).join(`
40
- `):f||void 0,details:d,outputAnalysis:au(o,t,n)}}function su(e,t,n){let r=Bl(e),i=Hl(r.session_id),a=Vl(r.chars),o=a?`stdin`:`poll`,s=[];return Zl(s,`Session`,i),s.push({label:`Chars`,value:a||`(empty)`}),{secondaryText:i?`session #${i} · ${o}`:o,details:s,outputAnalysis:au(``,t,n)}}function cu(e,t){let n=Bl(e),r=Array.isArray(n.questions)?n.questions:null;if(!r||r.length===0)return{secondaryText:void 0,details:[],outputContent:{kind:`plain`,text:t,language:`text`,isCode:!1}};let i=Bl(Yl(t)?.answers),a=r.map(e=>{let t=Bl(e),n=$(t.id),r=Bl(i[n]),a=(Array.isArray(r.answers)?r.answers:[]).map(e=>typeof e==`string`?Wl(e):``).filter(Boolean),o=Array.isArray(t.options)?t.options.map(e=>{let t=Bl(e),n=Gl($(t.label));return n.label?{label:n.label,description:$(t.description)||void 0,recommended:n.recommended||void 0}:null}).filter(e=>e!=null):[],s=$(t.question);return s?{header:$(t.header)||void 0,question:s,options:o,answers:a}:null}).filter(e=>e!=null);return a.length===0?{secondaryText:void 0,details:[],outputContent:{kind:`plain`,text:t,language:`text`,isCode:!1}}:{secondaryText:Jl(a.map(e=>e.header||``),a.length),details:[],outputContent:{kind:`question-list`,questions:a}}}function lu(e){let t=Bl(e),n=$(t.explanation),r=Array.isArray(t.plan)?t.plan:[],i=new Map,a=r.map(e=>{let t=Bl(e),n=$(t.status)||`pending`,r=$(t.step)||$(t.content);return i.set(n,(i.get(n)??0)+1),{label:r||`(empty step)`,status:n===`completed`||n===`in_progress`||n===`error`?n:`pending`}}),o=[...i.entries()].map(([e,t])=>({label:e,value:String(t)}));return{secondaryText:n||[...i.entries()].map(([e,t])=>`${t} ${e}`).join(` · `)||void 0,details:o,items:a}}function uu(e,t){return e.map(e=>$(Bl(e)[t])).filter(Boolean).join(` · `)}function du(e){let t=Bl(e);return Array.isArray(t.search_query)?{title:`web search`,secondaryText:uu(t.search_query,`q`)||void 0}:Array.isArray(t.open)?{title:`web open`,secondaryText:uu(t.open,`ref_id`)||void 0}:{title:`web ${Object.keys(t)[0]||`run`}`,secondaryText:void 0}}function fu(e,t){let n=Bl(e),r=$(n.path),i=$(n.detail),a=r?t(r):``,o=[];return Zl(o,`Image`,a),Zl(o,`Detail`,i),{secondaryText:a||void 0,details:o}}function pu(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function mu(e){return typeof e==`string`?e:``}function hu(e){return e.replace(/\\n/g,`
41
- `)}function gu(e){let t=pu(e),n=mu(t.type);return n?{type:n,path:mu(t.path),oldPath:mu(t.old_path),targetPath:mu(t.targetPath),content:mu(t.content)||mu(pu(t.input).content)}:null}function _u(e){return(Array.isArray(e)?e:Array.isArray(pu(e).content)?pu(e).content:[]).map(e=>gu(e)).filter(e=>e!=null)}function vu(e,t,n){return`${e} ${e===1?t:n}`}function yu(e){let t=e.filter(e=>e.type===`write_file`).length,n=e.filter(e=>e.type===`edit_file`).length,r=e.filter(e=>e.type===`delete_file`).length,i=e.filter(e=>e.type===`move_file`).length,a=[];return t>0&&a.push(vu(t,`write`,`writes`)),n>0&&a.push(vu(n,`edit`,`edits`)),r>0&&a.push(vu(r,`delete`,`deletes`)),i>0&&a.push(vu(i,`move`,`moves`)),a.join(` · `)}function bu(e){return e.targetPath||e.path||e.oldPath||e.type}function xu(e,t,n){return e.reduce((e,r)=>r.type===`write_file`?(e.push({label:n(bu(r)),operation:`write`,language:t(r.path),isCode:!0,text:hu(r.content)}),e):r.type===`edit_file`?(e.push({label:n(bu(r)),operation:`edit`,language:`diff`,isCode:!0,text:hu(r.content)}),e):r.type===`delete_file`?(e.push({label:n(bu(r)),operation:`edit`,language:`text`,isCode:!1,text:`File deleted.`}),e):(r.type===`move_file`&&e.push({label:n(bu(r)),operation:`edit`,language:`text`,isCode:!1,text:r.targetPath&&r.path?`Moved from ${n(r.path)} to ${n(r.targetPath)}`:r.oldPath?`Moved from ${n(r.oldPath)}`:`File moved.`}),e),[])}function Su(e,t,n,r=e=>e){let i=xu(e,n,r);return i.length>0?{kind:`file-sections`,sections:i}:{kind:`plain`,text:t,language:`text`,isCode:!1}}function Cu(e){return e.replace(/^_+/,``).replaceAll(`_`,` `)}function wu(e){for(let t of[`title`,`summary`,`query`,`q`,`url`,`objective`,`target`,`threadId`]){let n=Ms(e[t]);if(n)return n.length>120?`${n.slice(0,120)}…`:n}return``}function Tu(e){let t=e.indexOf(`Output:
42
- `);if(t===-1)return e;let n=Ns(e.slice(t+8).trim());return Array.isArray(n)&&n.map(e=>J(q(e).text)).filter(Boolean).join(`
43
- `)||e}function Eu(e,t,n){let r=wl(e,t,n),i=Ws(e),a=J(q(t.metadataValue).namespace),o=e=>Q(e,n),s=e=>ul(e,n);if(i===`skill`)return Tl(e,t,r,n);if(i===`js`&&(a===`mcp__node_repl__`||a===`mcp__node_repl__.js`)){let e=J(q(t.inputValue).title);return{...r,Icon:D,title:`Browser`,secondaryText:e||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:Tu(Z(t)),language:`text`,isCode:!1}}}if(i===`exec_command`||i===`bash`){let e=ou(t.inputValue,Z(t),ml,o,s);return{...r,Icon:D,title:`bash`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.outputAnalysis.text,language:e.outputAnalysis.language,isCode:e.outputAnalysis.isCode}}}if(i===`write_stdin`){let e=su(t.inputValue,Z(t),ml);return{...r,Icon:D,title:`bash`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.outputAnalysis.text,language:e.outputAnalysis.language,isCode:e.outputAnalysis.isCode}}}if(i===`request_user_input`){let e=cu(t.inputValue,Z(t));return{...r,Icon:ue,title:`ask`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:e.outputContent}}if(i===`patch`){let n=_u(t.inputValue),i=yu(n);return{...r,Icon:we,title:Gs(e,`patch`),secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:Su(n,Z(t),ml,o)}}if(i===`update_plan`){let e=lu(t.inputValue);return{...r,Icon:O,title:`update plan`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,contentLabel:`Plan`,outputContent:{kind:`task-list`,items:e.items}}}if(i===`web__run`){let e=du(t.inputValue);return{...r,Icon:A,title:e.title,secondaryText:e.secondaryText,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:Z(t),language:`markdown`,isCode:!1}}}if(i===`view_image`){let e=fu(t.inputValue,o);return{...r,Icon:v,title:`view image`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}if(i===`subagent`){let n=q(t.inputValue),i=Ms(n.task_name),a=Ms(n.model),o=Ms(n.reasoning_effort),s=Ms(n.fork_turns),c=Ms(n.service_tier)===`priority`,l=Z(t);return{...r,Icon:ae,title:i||Gs(e,`subagent`),secondaryText:void 0,details:[a?{label:`Model`,value:c?`${a} · Fast`:a}:null,o?{label:`Effort`,value:o}:null,s?{label:`Fork`,value:s}:null].filter(e=>e!==null),showInputPreview:!1,outputContent:{kind:`plain`,text:l,language:`markdown`,isCode:!1}}}if(i===`collaboration.send_message`||i===`collaboration.followup_task`){let e=q(t.inputValue),n=J(e.target),a=J(e.message);return{...r,Icon:E,title:i.endsWith(`followup_task`)?`follow up with agent`:`message agent`,secondaryText:n||void 0,details:[],showInputPreview:!1,contentLabel:`Message`,outputContent:{kind:`property-list`,items:[n?{label:`Recipient`,value:n}:null,a?{label:`Message`,value:a}:null].filter(e=>e!=null)}}}if(i===`collaboration.wait_agent`||i===`wait`){let e=q(t.inputValue).timeout_ms;return{...r,Icon:le,title:`wait for agents`,secondaryText:typeof e==`number`?`${Math.round(e/1e3)}s timeout`:void 0,details:[],showInputPreview:!1,contentLabel:`Agent updates`}}if(i===`collaboration.list_agents`)return{...r,Icon:w,title:`list agents`,secondaryText:void 0,details:[],showInputPreview:!1,contentLabel:`Agent tree`};if(i===`collaboration.interrupt_agent`){let e=J(q(t.inputValue).target);return{...r,Icon:w,title:`interrupt agent`,secondaryText:e||void 0,details:[],showInputPreview:!1,contentLabel:`Result`}}if(i===`create_goal`||i===`get_goal`||i===`update_goal`){let e=q(t.inputValue);return{...r,Icon:x,title:Cu(i),secondaryText:J(e.objective)||J(e.status)||void 0,details:[],showInputPreview:!1,contentLabel:`Goal state`}}if(a.startsWith(`mcp__`)||i.includes(`._`)){let e=q(t.inputValue),[n,a=`tool`]=i.split(`.`,2),o=Object.entries(e).map(([e,t])=>({label:e,value:t})),s=Is(t.outputValue);return{...r,Icon:T,title:`${Cu(n??`integration`)} · ${Cu(a)}`,secondaryText:wu(e)||void 0,details:[],showInputPreview:!1,contentLabel:s?`Result`:`Request`,outputContent:s??(o.length>0?{kind:`property-list`,items:o}:r.outputContent)}}return r}function Du(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:typeof e==`string`&&Ns(e)||{}}function Ou(e){let t=Y(Du(e).contents);return t?X(t):`No output captured.`}function ku(e){let t=Du(e),n=Array.isArray(t.directories)?t.directories:[];if(n.length===0)return Ks(e);let r=n.flatMap(e=>{let t=q(e);return[J(t.absPath),...(Array.isArray(t.files)?t.files:[]).map(e=>{let t=q(e);return J(t.relPath)||J(t.absPath)}).filter(Boolean).map(e=>` ${e}`)].filter(Boolean)});return r.length>0?r.join(`
44
- `):`No output captured.`}function Au(e,t,n){let r=wl(e,t,n),i=e.tool.toLowerCase(),a=q(t.inputValue),o=sl(t.inputValue),s=Q(o,n);if(i===`read_file_v2`){let e=Ou(t.outputValue);return yl({defaultStrategy:r,state:t,filePath:o,displayPath:s,text:e,details:e===`No output captured.`?[{label:`Lines`,value:J(Du(t.outputValue).totalLinesInFile)}]:[],isCode:e!==`No output captured.`})}if(i===`edit_file_v2`){let e=X(Y(a.streamingContent));return xl({defaultStrategy:r,displayPath:s,outputContent:{kind:`plain`,text:e||Z(t),language:e?`diff`:`text`,isCode:!!e}})}if(i===`ripgrep_raw_search`){let e=J(a.pattern),i=[Q(J(a.path),n),e].filter(Boolean).join(` · `);return{...r,Icon:A,title:`grep`,secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}if(i===`glob_file_search`){let e=J(a.globPattern),i=[Q(J(a.targetDirectory),n),e].filter(Boolean).join(` · `);return{...r,Icon:A,title:`glob`,secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:ku(t.outputValue),language:`text`,isCode:!1}}}if(i===`run_terminal_command_v2`){let e=ul(J(a.command),n),i=J(a.commandDescription),o=i?`${i}${e?` (${e})`:``}`:e?`(${e})`:void 0;return{...r,Icon:D,title:`bash`,secondaryText:o,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}return{...r,title:Gs(e)}}var ju=[`FileNotFound`,`IsADirectory`,`PermissionDenied`,`FileTooLarge`,`FileReadError`,`ImageSizeError`];function Mu(e){return typeof e==`number`&&Number.isSafeInteger(e)?e:null}function Nu(e){let t=q(e.outputValue);return Object.keys(t).length>0?t:q(e.errorValue)}function Pu(e){let t=J(e.message)||J(e.content)||J(e.text);if(t)return t;for(let t of ju){let n=J(e[t]);if(n)return n}return J(q(e.Error).message)||J(e.error)}function Fu(e,t,n){let r=[],i=Mu(e.total_lines),a=Mu(e.offset),o=Mu(e.limit),s=J(t.mime_type),c=Mu(n.total_pages);return i!==null&&i>=0&&r.push({label:`Lines`,value:String(i)}),a!==null&&a>=0&&r.push({label:`Offset`,value:String(a)}),o!==null&&o>=0&&r.push({label:`Limit`,value:String(o)}),s&&r.push({label:`Format`,value:s}),c!==null&&c>=0&&r.push({label:`Pages`,value:String(c)}),r}function Iu(e,t){let n=[],r=Y(e.data),i=J(e.mime_type);r&&i&&n.push({type:`image`,data:r,mime_type:i});let a=Array.isArray(t.pages)?t.pages:[];for(let e of a){let t=q(e),r=Y(t.data),i=J(t.mime_type);r&&i&&n.push({type:`image`,data:r,mime_type:i})}return Is(n)}function Lu(e,t,n){let r=q(e.inputValue),i=Nu(e),a=q(i.FileContent),o=q(i.ImageContent),s=q(i.PdfPageImages),c=J(a.absolute_path)||J(r.target_file)||J(r.file_path),l=Q(c,n),u=Fu(a,o,s),d=Iu(o,s);return d?yl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,outputContent:d}):Object.keys(o).length>0||Object.keys(s).length>0?yl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,outputContent:{kind:`plain`,text:Object.keys(s).length>0?`PDF preview unavailable.`:`Image preview unavailable.`,language:`text`,isCode:!1}}):Object.keys(a).length>0?yl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,text:Y(a.raw_output)||Y(a.content)||`File is empty.`}):yl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,outputContent:{kind:`plain`,text:Pu(i)||Z(e),language:`text`,isCode:!1}})}function Ru(e){if(typeof e.output==`string`)return e.output;if(Array.isArray(e.output)){let t=e.output;return t.every(e=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=255)?new TextDecoder().decode(Uint8Array.from(t)):``}return Y(e.output_for_prompt)}function zu(e,t,n){let r=q(e.inputValue),i=Nu(e),a=Y(r.command)||Y(i.command),o=J(r.description)||J(i.description),s=ul(a,n),c=Q(J(i.current_dir),n),l=Q(J(i.output_file),n),u=Mu(i.exit_code),d=J(i.signal),f=[];s&&f.push({label:`Command`,value:s}),c&&f.push({label:`Workdir`,value:c}),u!==null&&f.push({label:`Exit code`,value:String(u)}),d&&f.push({label:`Signal`,value:d}),i.timed_out===!0&&f.push({label:`Timed out`,value:`Yes`}),i.truncated===!0&&(f.push({label:`Output`,value:`Truncated`}),l&&f.push({label:`Full output`,value:l}));let p=Ru(i)||Pu(i),m=e.status===`error`||u!==null&&u!==0;return{...t,Icon:D,title:`bash`,secondaryText:o||Ms(s).slice(0,120)||void 0,details:f,showInputPreview:!1,contentLabel:m?`Error`:`Terminal output`,outputContent:{kind:`plain`,text:p||`No output captured.`,language:`text`,isCode:!1}}}function Bu(e,t,n){let r=q(e.inputValue),i=Nu(e),a=q(i.Content),o=q(i.Error),s=q(i.CrossHostRedirect),c=q(a.outputLocation),l=J(r.url),u=J(a.url)||J(o.url)||l,d=Mu(a.status_code),f=Mu(a.bytes),p=J(a.content_type),m=J(i.error),h=[];d!==null&&d>=0&&h.push({label:`Status`,value:String(d)}),p&&h.push({label:`Content type`,value:p}),f!==null&&f>=0&&h.push({label:`Size`,value:`${f} bytes`}),m&&h.push({label:`Type`,value:m});let g=Q(J(c.filePath),n),_=J(s.redirect_url),v=J(s.original_host),y=J(i.DomainNotAllowed),b=Y(a.content),x=Pu(i)||(_?`Cross-host redirect from ${v||`the original host`} to ${_}.`:``)||(y?`Domain not allowed: ${y}`:``),S=b||x||(g?`Full content saved to ${g}`:``)||Z(e);return{...t,Icon:A,title:`web fetch`,secondaryText:u||void 0,details:h,showInputPreview:!1,contentLabel:e.status===`error`?`Error`:`Page content`,outputContent:{kind:`plain`,text:S,language:`markdown`,isCode:!1}}}function Vu(e,t,n){let r=wl(e,t,n),i=Ws(e),a=e.tool.trim().toLowerCase();return i===`read`||a===`read_file`?Lu(t,r,n):i===`bash`||a===`run_terminal_command`?zu(t,r,n):i===`web fetch`||a===`web_fetch`?Bu(t,r,n):r}function Hu(e){let t=q(e.inputValue),n=q(e.metadataValue),r=Array.isArray(n.tasks)?n.tasks:[],i=Number(t.id);return q(Number.isFinite(i)&&i>0?r.find(e=>Number(q(e).id)===i):r.at(-1))}function Uu(e){let t=Z(e).match(/\(([^()]+?)\s*→\s*([^()]+?)\)/);return t?`${t[1]} -> ${t[2]}`:``}function Wu(e){let t=(e.split(`
45
- `)[0]??``).match(/^Agent:\s*(.+)$/i),n=e.split(`
46
- `).find(e=>e.includes(`Status:`)),r=[];return t?.[1]&&r.push({label:`Agent`,value:t[1].trim()}),n&&r.push({label:`Summary`,value:n.trim()}),r}function Gu(e,t,n){let r=wl(e,t,n),i=e.tool.toLowerCase(),a=q(t.inputValue),o=q(t.metadataValue),s=sl(t.inputValue),c=Q(s,n);if(i===`todo`){let e=J(a.action)||J(o.action)||`todo`,n=Hu(t),i=Number(n.id)||Number(a.id),s=J(n.subject)||J(a.subject),c=J(n.description)||J(a.description),l=J(n.status)||J(a.status),u=Uu(t),d=[i?`#${i}`:``,s,e===`update`&&u?u:l].filter(Boolean);return{...r,Icon:O,title:e===`create`?`todo create`:e===`update`?`todo update`:`todo`,secondaryText:d.join(` · `)||void 0,details:[i?{label:`ID`,value:`#${i}`}:null,s?{label:`Subject`,value:s}:null,l?{label:`Status`,value:l}:null,u?{label:`Change`,value:u}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:c||Z(t),language:`markdown`,isCode:!1}}}if(i===`read`)return yl({defaultStrategy:r,state:t,filePath:s,displayPath:c});if(i===`write`)return bl({defaultStrategy:r,state:t,filePath:s,displayPath:c,Icon:De});if(i===`edit`){let e=nl(t,c||s),n=typeof o.firstChangedLine==`number`?String(o.firstChangedLine):Y(o.firstChangedLine);return xl({defaultStrategy:r,displayPath:c,details:n?[{label:`Line`,value:n}]:[],outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}})}if(i===`agent`){let e=J(a.description)||J(o.description),n=J(a.subagent_type)||J(o.subagentType),i=J(o.agentId),s=J(o.status);return{...r,Icon:ae,title:n?`agent · ${n}`:`agent`,secondaryText:[i?`#${i}`:``,e].filter(Boolean).join(` · `),details:[i?{label:`Agent`,value:i}:null,n?{label:`Type`,value:n}:null,s?{label:`Status`,value:s}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:Y(a.prompt)||Z(t),language:`markdown`,isCode:!1}}}if(i===`get_subagent_result`){let e=J(a.agent_id),n=Z(t);return{...r,Icon:ae,title:`subagent result`,secondaryText:e?`#${e}`:void 0,details:Wu(n),showInputPreview:!1,outputContent:{kind:`plain`,text:n,language:`markdown`,isCode:!1}}}if(i===`analyze_image`){let e=Array.isArray(a.images)?a.images.map(e=>Y(e)).filter(Boolean):[],i=Y(a.question);return{...r,Icon:v,title:`analyze image`,secondaryText:e.map(e=>Q(e,n)).join(`, `),details:[...e.map((e,t)=>({label:t===0?`Image`:`Image ${t+1}`,value:Q(e,n)})),i?{label:`Question`,value:i}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:Z(t),language:`markdown`,isCode:!1}}}if(i===`bash`||i===`batch`){let e=ul(J(a.command),n);return{...r,Icon:D,title:i===`batch`?`batch`:`bash`,secondaryText:e?`(${e})`:void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}}}return r}function Ku(e,t,n){let r=wl(e,t,n),i=q(t.inputValue),a=sl(t.inputValue),o=Q(a,n);switch(e.tool.toLowerCase()){case`bash`:{let e=Cl({defaultStrategy:r,state:t,title:`bash`,command:J(i.command),description:J(i.description),baseDirectory:n}),a=J(i.workdir);return a?{...e,details:[...e.details,{label:`Workdir`,value:Q(a,n)}]}:e}case`read`:return yl({defaultStrategy:r,state:t,filePath:a,displayPath:o});case`write`:return bl({defaultStrategy:r,state:t,filePath:a,displayPath:o});case`edit`:{let e=rl(t,o||a);return xl({defaultStrategy:r,displayPath:o,outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:Z(t),language:`text`,isCode:!1}})}case`glob`:case`grep`:return Sl({defaultStrategy:r,state:t,title:e.tool.toLowerCase(),path:J(i.path),pattern:J(i.pattern),baseDirectory:n});default:return r}}var qu={claudecode:jl,opencode:Ml,kimi:Nl,"kimi-code":zl,codex:Eu,cursor:Au,grok:Vu,pi:Gu,zcode:Rl,dsh:Ku};function Ju(e,t,n,r){return(qu[e.toLowerCase()]??wl)(t,n,r)}function Yu(e,t){let n=0;return e.map(e=>{if(e.type!==`tool`)return e;let r=e.parts.map(()=>Xs(t,n++));return{...e,anchorIds:r}})}function Xu(e){let t=[];for(let n of e){let e=ks(n.parts);if(e.length===0)continue;let r=t.length;t.push({msg:n,blocks:Yu(e,r),index:r})}return t}function Zu({messages:e,agentName:t,fileActivity:n}){let r=Xu(Ys(e,t)),i=Cc(r),a=ec(r);return{messages:r,toc:i,fileChangeSummary:tc(n,a.summary),select(e){let{messages:t,visibleUnitCount:n}=Dc(r,e),i=new Map(t.map((e,t)=>[e.index,t]));return{messages:t,visibleUnitCount:n,timelineEntries:uc(t),resolveListIndex(e){return i.get(e)}}},resolveMessageIndex(e){return a.anchorMessageIndexes.get(e)}}}function Qu({state:e,onToggle:t,size:n=14,label:r}){let i=(0,K.useRef)(null),a=e===`indeterminate`;return(0,K.useLayoutEffect)(()=>{i.current&&(i.current.indeterminate=a)},[a]),(0,G.jsxs)(`span`,{className:`relative inline-flex shrink-0`,style:{width:n,height:n},children:[(0,G.jsx)(`input`,{ref:i,type:`checkbox`,checked:e===`checked`,"aria-checked":a?`mixed`:e===`checked`,"aria-label":r,onChange:t,className:`absolute inset-0 z-10 size-full cursor-pointer opacity-0`}),(0,G.jsx)(`span`,{"aria-hidden":`true`,className:l(`flex size-full items-center justify-center rounded-[4px] border`,e===`unchecked`?`border-[var(--console-border-strong)] bg-transparent text-transparent`:`border-[var(--brand)] bg-[var(--brand)] text-[var(--brand-fg)]`),children:a?(0,G.jsx)(pe,{className:`size-2.5 stroke-[3]`}):e===`checked`?(0,G.jsx)(xe,{className:`size-2.5 stroke-[3]`}):null})]})}function $u({open:e,children:t,className:n}){return(0,G.jsx)(`div`,{className:l(`motion-collapsible`,n),"data-open":e||void 0,children:(0,G.jsx)(`div`,{className:`motion-collapsible-inner`,children:e?t():null})})}function ed(e){return e===0?`auto`:`smooth`}function td(e,t){return e===`smooth`&&t?`auto`:e}function nd(e){let t=e.parentElement;for(;t;){let{overflowY:e}=window.getComputedStyle(t);if(e===`auto`||e===`scroll`||e===`overlay`)return t;t=t.parentElement}return window}function rd(e){return e===window}function id(e){return rd(e)?window.scrollY||(document.scrollingElement??document.documentElement).scrollTop:e.scrollTop}function ad(e){return rd(e)?window.innerHeight||900:e.clientHeight}function od(e){return rd(e)?(document.scrollingElement??document.documentElement).scrollHeight:e.scrollHeight}function sd(e,t){if(rd(e))return t.getBoundingClientRect().top+id(e);let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return e.scrollTop+r.top-n.top}function cd(e,t){if(rd(e)){window.scrollTo({top:t,behavior:`auto`});return}e.scrollTo({top:t,behavior:`auto`})}function ld(e){return e.read.length+e.edit.length+e.write.length+e.delete.length}function ud({summary:e,baseDirectory:t,onJumpToAnchor:n}){let r=[{key:`read`,label:`Read`,Icon:A,items:e.read},{key:`edit`,label:`Edit`,Icon:we,items:e.edit},{key:`write`,label:`Write`,Icon:g,items:e.write},{key:`delete`,label:`Delete`,Icon:_,items:e.delete}].filter(e=>e.items.length>0);return r.length===0?null:(0,G.jsxs)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--console-border)] px-4 py-3`,children:[(0,G.jsx)(Ee,{className:`size-3.5 text-[var(--console-accent)]`}),(0,G.jsx)(`span`,{className:`console-mono text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:`File Tracker`})]}),(0,G.jsx)(`div`,{className:`space-y-3 p-3`,children:r.map(({key:e,label:r,Icon:i,items:a})=>(0,G.jsx)(dd,{label:r,Icon:i,items:a,baseDirectory:t,onJumpToAnchor:n},e))})]})}function dd({label:e,Icon:t,items:n,baseDirectory:r,onJumpToAnchor:i}){let[a,o]=(0,K.useState)(!1);return(0,G.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`motion-hover flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-[var(--console-surface-muted)]`,children:[(0,G.jsx)(t,{className:`size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,G.jsx)(`span`,{className:`console-mono min-w-0 flex-1 text-[11px] font-semibold uppercase tracking-[0.12em] text-[var(--console-muted)]`,children:e}),(0,G.jsx)(`span`,{className:`console-mono shrink-0 text-[10px] text-[var(--console-muted)]`,children:n.length}),(0,G.jsx)(me,{className:`motion-chevron size-3.5 shrink-0 text-[var(--console-muted)]`,"data-open":a||void 0})]}),(0,G.jsx)($u,{open:a,children:()=>(0,G.jsx)(`div`,{className:`space-y-1 border-t border-[var(--console-border)] p-2`,children:n.map(e=>(0,G.jsx)(fd,{item:e,baseDirectory:r,onJumpToAnchor:i},`${e.path}:${e.latestAnchorId||e.latestTime}`))})})]})}function fd({item:e,baseDirectory:t,onJumpToAnchor:n}){let[r,i]=(0,K.useState)(0);function a(t,r){let a=e.anchors.length;if(a===0)return;let o=(t%a+a)%a;i(o);let s=e.anchors[o];s&&n(s.anchorId,r)}return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm px-2 py-2 motion-hover hover:bg-[var(--console-surface-muted)]`,children:[(0,G.jsx)(`button`,{type:`button`,title:e.path,onClick:e=>a(r,ed(e.detail)),className:`min-w-0 flex-1 text-left`,children:(0,G.jsx)(`span`,{className:`console-mono block break-all text-xs text-[var(--console-text)]`,children:dl(e.path,t)})}),e.anchors.length>1?(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Previous ${e.path}`,onClick:e=>a(r-1,ed(e.detail)),className:`rounded-sm border border-[var(--console-border)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface)]`,children:(0,G.jsx)(ce,{className:`size-3`})}),(0,G.jsxs)(`span`,{className:`console-mono text-[10px] text-[var(--console-muted)]`,children:[r+1,`/`,e.anchors.length]}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`Next ${e.path}`,onClick:e=>a(r+1,ed(e.detail)),className:`rounded-sm border border-[var(--console-border)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface)]`,children:(0,G.jsx)(me,{className:`size-3`})})]}):(0,G.jsx)(`button`,{type:`button`,title:`Jump to tool call`,onClick:e=>a(0,ed(e.detail)),className:`console-mono shrink-0 text-[10px] text-[var(--console-muted)]`,children:e.count})]})}function pd(){return{excluded:new Set,toolQuery:``,toolsExpanded:!0}}function md(e,t){return new Set([...e.filterIds].filter(e=>!t.has(e)))}function hd(e,t){let n=new Set(e.excluded);return n.delete(t)||n.add(t),{...e,excluded:n}}function gd(e,t){return hd(e,t)}function _d(e,t){return hd(e,t)}function vd(e,t,n){let r=new Set(e.excluded);for(let i of Td(t,e))n?r.delete(i.id):r.add(i.id);return{...e,excluded:r}}function yd(e,t){let n=new Set(e.excluded);for(let e of t.tools)e.kind===`write`?n.delete(e.id):n.add(e.id);return{...e,excluded:n}}function bd(e,t){return{...e,toolQuery:t}}function xd(e){return{...e,toolsExpanded:!e.toolsExpanded}}function Sd(e){return{...e,excluded:new Set,toolQuery:``}}function Cd(e,t){return e.tools.reduce((e,n)=>e+ +!t.excluded.has(n.id),0)}function wd(e,t){let n=Cd(e,t);return n===0?`none`:n===e.tools.length?`all`:`partial`}function Td(e,t){let n=t.toolQuery.trim().toLowerCase();return n?e.tools.filter(e=>e.label.toLowerCase().includes(n)):e.tools}function Ed(e,t){return wd(e,t)===`all`?[]:e.tools.filter(e=>!t.excluded.has(e.id)).map(e=>({id:e.id,label:e.label}))}function Dd(e,t){return e.tools.filter(e=>t.excluded.has(e.id)).map(e=>({label:e.label,count:e.count}))}function Od(e,t){let n=0;for(let r of mc)t.excluded.has(r)&&(n+=e.counts[r]);for(let r of e.tools)t.excluded.has(r.id)&&(n+=r.count);return n}var kd={user:`Your messages`,agent_message:`Agent replies`,thinking:`Thinking`,plan:`Plans`},Ad={all:`checked`,none:`unchecked`,partial:`indeterminate`};function jd({toc:e,state:t,actions:n,visibleUnitCount:r}){let i=Dd(e,t);return(0,G.jsxs)(`section`,{"aria-label":`Content filters`,className:`flex flex-col rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[var(--console-border)] px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`console-eyebrow`,children:`Content filters`}),(0,G.jsx)(`button`,{type:`button`,onClick:n.resetAll,className:`console-mono motion-hover ml-auto rounded-sm px-1 text-[10.5px] text-[var(--brand)] hover:text-[var(--brand-hover)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Reset`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2.5 p-3`,children:[(0,G.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:mc.filter(t=>e.counts[t]>0).map(r=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-sm px-1 py-1`,children:[(0,G.jsx)(Qu,{size:15,label:kd[r],state:t.excluded.has(r)?`unchecked`:`checked`,onToggle:()=>n.toggleContentKind(r)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-[var(--console-text)]`,children:kd[r]}),(0,G.jsx)(`span`,{className:`console-mono shrink-0 text-[10.5px] text-[var(--console-muted)]`,children:e.counts[r]})]},r))}),e.tools.length>0?(0,G.jsx)(Md,{toc:e,state:t,actions:n}):null,(0,G.jsxs)(`div`,{className:`mt-auto rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-2.5`,children:[(0,G.jsx)(`span`,{className:`console-eyebrow`,children:`Current view`}),(0,G.jsxs)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-[var(--console-text-secondary)]`,children:[`Showing `,(0,G.jsx)(`b`,{className:`console-mono text-[var(--console-text)]`,children:r}),` /`,` `,(0,G.jsx)(`span`,{className:`console-mono`,children:e.totalUnitCount}),i.length>0?` · hiding ${i.map(e=>e.label).join(`, `)}`:null]})]})]})]})}function Md({toc:e,state:t,actions:n}){let r=wd(e,t),i=Td(e,t),a=t.toolsExpanded?me:se;return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-[var(--brand-line)]`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 bg-[var(--brand-soft)] px-2.5 py-2`,children:[(0,G.jsx)(Qu,{size:15,label:`All tools`,state:Ad[r],onToggle:()=>n.setAllTools(r!==`all`)}),(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":t.toolsExpanded,onClick:n.toggleToolsExpanded,className:`flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:[(0,G.jsx)(`span`,{className:`text-[13px] text-[var(--console-text)]`,children:`Tools`}),(0,G.jsxs)(`span`,{className:`console-mono ml-auto text-[10.5px] text-[var(--console-muted)]`,children:[Cd(e,t),` / `,e.tools.length,` selected`]}),(0,G.jsx)(a,{className:`size-3.5 shrink-0 text-[var(--console-muted)]`})]})]}),t.toolsExpanded?(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 bg-[var(--console-surface)] p-2.5`,children:[(0,G.jsx)(`input`,{type:`search`,value:t.toolQuery,"aria-label":`Filter tool names`,placeholder:`Filter tools…`,onChange:e=>n.setToolQuery(e.target.value),className:`console-mono w-full rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`}),i.map(r=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-0.5`,children:[(0,G.jsx)(Qu,{size:14,label:r.label,state:t.excluded.has(r.id)?`unchecked`:`checked`,onToggle:()=>n.toggleTool(r.id)}),(0,G.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs text-[var(--console-text)]`,children:r.label}),(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-1 w-[34px] shrink-0 overflow-hidden rounded-[2px] bg-[var(--console-surface-sunken)]`,children:(0,G.jsx)(`span`,{className:`block h-full rounded-[2px] bg-[var(--brand)]`,style:{width:`${r.count/e.maxToolCount*100}%`}})}),(0,G.jsx)(`span`,{className:`console-mono w-5 shrink-0 text-right text-[10px] text-[var(--console-muted)]`,children:r.count})]},r.id)),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 pt-0.5`,children:[(0,G.jsxs)(Nd,{onClick:()=>n.setAllTools(!0),children:[`Select all (`,i.length,`)`]}),(0,G.jsxs)(Nd,{onClick:()=>n.setAllTools(!1),children:[`Clear all (`,i.length,`)`]}),(0,G.jsx)(Nd,{onClick:n.selectWriteToolsOnly,children:`Writes only`})]})]}):null]})}function Nd({onClick:e,children:t}){return(0,G.jsx)(`button`,{type:`button`,onClick:e,className:`console-mono motion-hover rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-[3px] text-[10px] text-[var(--console-text-secondary)] hover:border-[var(--brand-line)] hover:text-[var(--brand)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:t})}function Pd({fileChangeSummary:e,baseDirectory:t,onJumpToAnchor:n,...r}){return(0,G.jsx)(`aside`,{className:`console-scrollbar hidden min-[1025px]:sticky min-[1025px]:top-4 min-[1025px]:block min-[1025px]:max-h-[calc(100dvh-14rem)] min-[1025px]:overflow-y-auto min-[1025px]:overscroll-contain`,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(jd,{...r}),(0,G.jsx)(ud,{summary:e,baseDirectory:t,onJumpToAnchor:n})]})})}var Fd={user:`You`,agent_message:`Reply`,thinking:`Thinking`,plan:`Plan`};function Id(e,t){return Ed(e,t).length}function Ld({toc:e,state:t,actions:n}){let r=Ed(e,t);if(r.length===0)return null;let i=mc.filter(n=>e.counts[n]>0&&!t.excluded.has(n)).map(e=>Fd[e]);return(0,G.jsxs)(`div`,{className:`hidden flex-wrap items-center gap-1.5 min-[1025px]:flex`,children:[r.map(e=>(0,G.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-full bg-[var(--brand)] px-2.5 py-[3px] text-[10.5px] text-[var(--brand-fg)]`,children:[`Tool · `,e.label,(0,G.jsx)(`button`,{type:`button`,"aria-label":`Remove filter ${e.label}`,onClick:()=>n.toggleTool(e.id),className:`motion-hover -mr-1 rounded-full p-0.5 opacity-80 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-[var(--brand-fg)] focus-visible:outline-none`,children:(0,G.jsx)(Oe,{className:`size-2.5 stroke-[3]`})})]},e.id)),i.length>0?(0,G.jsxs)(`span`,{className:`console-mono inline-flex items-center rounded-full border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2.5 py-[3px] text-[10.5px] text-[var(--console-muted)]`,children:[`+ `,i.join(` / `)]}):null]})}function Rd({hiddenCount:e,hiddenTools:t,onShowAll:n}){if(e<=0)return null;let r=t.map(e=>`${e.label} ${e.count}`).join(` · `);return(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-lg border border-dashed border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-[15px] py-[11px]`,children:[(0,G.jsxs)(`span`,{className:`console-mono min-w-0 flex-1 text-[11px] text-[var(--console-muted)]`,children:[e,` hidden by filters`,r?` (${r})`:``]}),(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`console-mono motion-hover shrink-0 rounded-sm border border-[var(--brand-line)] bg-[var(--brand-soft)] px-2.5 py-[3px] text-[10.5px] text-[var(--brand)] hover:text-[var(--brand-hover)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:`Show all`})]})}function zd(e,t){let[n,r]=(0,K.useState)(pd),[i,a]=(0,K.useState)(t);return i!==t&&(a(t),r(pd())),{state:n,actions:(0,K.useMemo)(()=>({toggleContentKind:e=>r(t=>gd(t,e)),toggleTool:e=>r(t=>_d(t,e)),setAllTools:t=>r(n=>vd(n,e,t)),selectWriteToolsOnly:()=>r(t=>yd(t,e)),setToolQuery:e=>r(t=>bd(t,e)),toggleToolsExpanded:()=>r(e=>xd(e)),resetAll:()=>r(Sd)}),[e])}}var Bd={fontSize:`0.75rem`,lineHeight:1.55},Vd=(0,K.lazy)(()=>m(()=>import(`./PrismHighlighter-LWITDffT.js`).then(e=>({default:e.PrismHighlighter})),__vite__mapDeps([0,1])));function Hd({text:e}){return(0,G.jsx)(`pre`,{className:`console-mono m-0 overflow-x-auto whitespace-pre-wrap break-words p-3 text-[var(--code-fg)]`,style:{background:`transparent`,...Bd},children:e})}function Ud({language:e,text:t}){return(0,G.jsx)(xs,{text:t,initialBudget:gs.code,children:t=>(0,G.jsx)(ge,{fallback:(0,G.jsx)(Hd,{text:t}),children:(0,G.jsx)(K.Suspense,{fallback:(0,G.jsx)(Hd,{text:t}),children:(0,G.jsx)(Vd,{language:e,text:t})})})})}var Wd={add:`text-[var(--diff-add-fg)] bg-[var(--diff-add-bg)]`,remove:`text-[var(--diff-remove-fg)] bg-[var(--diff-remove-bg)]`,hunk:`text-[var(--diff-hunk-fg)] bg-[var(--diff-hunk-bg)]`,meta:`text-[var(--diff-meta-fg)] bg-[var(--diff-meta-bg)]`,header:`text-[var(--console-text)] bg-[var(--diff-header-bg)]`,context:`text-[var(--console-text)]`};function Gd(e){return Wd[e]}function Kd(e,t){return`${e}:${t}`}function qd(e){return/^(Index:|diff\s|===)/.test(e)?`header`:e.startsWith(`@@`)?`hunk`:e.startsWith(`+++ `)||e.startsWith(`--- `)?`meta`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function Jd({text:e}){return(0,G.jsx)(xs,{text:e,initialBudget:gs.diff,children:e=>{let t=e.split(`
47
- `),n=new Map;return(0,G.jsx)(`pre`,{className:`console-mono max-h-[420px] overflow-auto whitespace-pre rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)] p-3 text-xs leading-relaxed`,children:t.map(e=>{let t=n.get(e)??0;return n.set(e,t+1),(0,G.jsx)(`span`,{className:`block rounded-[2px] px-1 ${Gd(qd(e))}`,children:e||` `},Kd(e,t))})})}})}function Yd(e){let t=e.text||`No output captured.`;return!e.isCode||e.language===`text`?(0,G.jsx)(xs,{text:t,initialBudget:gs.plain,children:e=>(0,G.jsx)(`pre`,{className:`console-mono max-h-[420px] overflow-auto whitespace-pre-wrap break-all p-3 text-xs leading-relaxed text-[var(--console-text)]`,children:e})}):e.language===`diff`?(0,G.jsx)(Jd,{text:t}):(0,G.jsx)(`div`,{className:`max-h-[420px] overflow-auto bg-[var(--console-surface-sunken)]`,children:(0,G.jsx)(Ud,{language:e.language,text:t})})}function Xd({sections:e}){return(0,G.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,G.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--console-muted)]`,children:e.operation}),(0,G.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-muted)]`,children:e.label})]})}),Yd(e)]},`${e.operation}:${e.label}:${e.language}`))})}function Zd({items:e,text:t}){return(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(`div`,{className:`grid gap-3 ${e.length>1?`sm:grid-cols-2`:``}`,children:e.map((e,t)=>(0,G.jsxs)(`figure`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:[(0,G.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] w-full object-contain`,loading:`lazy`}),e.caption?(0,G.jsx)(`figcaption`,{className:`console-mono border-t border-[var(--console-border)] px-3 py-2 text-[11px] text-[var(--console-muted)]`,children:e.caption}):null]},`${e.src.slice(0,80)}:${t}`))}),t?(0,G.jsx)(xs,{text:t,initialBudget:gs.plain,children:e=>(0,G.jsx)(`pre`,{className:`console-mono whitespace-pre-wrap break-words rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)] p-3 text-xs leading-relaxed text-[var(--console-text)]`,children:e})}):null]})}function Qd(e){return e==null||e===``?`—`:typeof e==`boolean`?e?`Yes`:`No`:typeof e==`string`||typeof e==`number`||typeof e==`bigint`?String(e):null}function $d({value:e,depth:t=0}){let n=Qd(e);return n==null?Array.isArray(e)?t>=2?(0,G.jsxs)(`span`,{children:[e.length,` items`]}):(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map((e,n)=>(0,G.jsx)(`span`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-0.5`,children:(0,G.jsx)($d,{value:e,depth:t+1})},n))}):typeof e==`object`?t>=2?(0,G.jsxs)(`span`,{children:[Object.keys(e).length,` fields`]}):(0,G.jsx)(`dl`,{className:`space-y-1.5`,children:Object.entries(e).map(([e,n])=>(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(80px,auto)_1fr] gap-2`,children:[(0,G.jsx)(`dt`,{className:`text-[var(--console-muted)]`,children:e}),(0,G.jsx)(`dd`,{className:`min-w-0`,children:(0,G.jsx)($d,{value:n,depth:t+1})})]},e))}):(0,G.jsx)(`span`,{children:String(e)}):(0,G.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:n})}function ef({items:e}){return(0,G.jsx)(`dl`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`grid gap-1 border-b border-[var(--console-border)] px-3 py-2.5 last:border-b-0 sm:grid-cols-[130px_1fr] sm:gap-3`,children:[(0,G.jsx)(`dt`,{className:`console-mono text-[10px] font-semibold uppercase tracking-wide text-[var(--console-muted)]`,children:e.label}),(0,G.jsx)(`dd`,{className:`console-mono min-w-0 text-xs leading-relaxed text-[var(--console-text)]`,children:(0,G.jsx)($d,{value:e.value})})]},e.label))})}function tf({questions:e}){return(0,G.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,G.jsxs)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.header?(0,G.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--console-muted)]`,children:e.header}):null,e.answers.length>0?(0,G.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-success)]`,children:`Answered`}):(0,G.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-muted)]`,children:`Pending`})]}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-[var(--console-text)]`,children:e.question})]}),(0,G.jsx)(`div`,{className:`space-y-2 p-3`,children:e.options.map(t=>{let n=e.answers.includes(t.label);return(0,G.jsxs)(`div`,{className:`rounded-sm border px-3 py-2 ${n?`border-[var(--console-success-border)] bg-[var(--console-success-bg)]`:`border-[var(--console-border)] bg-[var(--console-surface)]`}`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`console-mono text-xs font-semibold ${n?`text-[var(--console-success)]`:`text-[var(--console-text)]`}`,children:t.label}),t.recommended?(0,G.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:`Recommended`}):null,n?(0,G.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-success-border)] bg-[var(--console-surface)] px-1.5 py-0.5 text-[10px] text-[var(--console-success)]`,children:`Selected`}):null]}),t.description?(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-[var(--console-muted)]`,children:t.description}):null]},`${e.question}:${t.label}`)})})]},`${e.header??`question`}:${e.question}`))})}function nf(e){let t=0;for(let n of e)t+=n.lines.length+1;return t}function rf(e,t){let n=[],r=0,i=0,a=!1;for(let o of e){if(i>=t.maxLines||r>=t.maxCharacters){a=!0;break}let e=t.maxCharacters-r,s=o.label.slice(0,e);r+=s.length,i+=1;let c=[];for(let e of o.lines){if(i>=t.maxLines||r>=t.maxCharacters){a=!0;break}let n=t.maxCharacters-r-1;if(n<0){a=!0;break}let o=e.text.slice(0,n);if(c.push(o===e.text?e:{...e,text:o}),r+=o.length+1,i+=1,o!==e.text){a=!0;break}}if(n.push({...o,label:s,lines:c}),s!==o.label||c.length!==o.lines.length){a=!0;break}}return{blocks:n,renderedLines:i,truncated:a}}function af(e){let t=[];for(let n of e){t.push(`diff ${n.label}`);for(let e of n.lines){let n=e.type===`add`?`+`:e.type===`remove`?`-`:` `;t.push(`${n}${e.text}`)}}return t.join(`
48
- `)}function of({blocks:e}){let t=(0,K.useMemo)(()=>nf(e),[e]),{budget:n,renderMore:r}=bs(e,gs.diff,{lines:t}),i=(0,K.useMemo)(()=>rf(e,n),[e,n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`space-y-3`,children:i.blocks.map((e,t)=>(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,G.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,G.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-muted)]`,children:e.label})}),(0,G.jsx)(`pre`,{className:`console-mono max-h-[280px] overflow-auto whitespace-pre p-3 text-xs leading-relaxed`,children:e.lines.map((e,t)=>(0,G.jsxs)(`span`,{className:`block rounded-[2px] px-1 ${Gd(e.type)}`,children:[e.type===`add`?`+`:e.type===`remove`?`-`:` `,e.text||` `]},`${e.type}:${t}`))})]},`${e.label.slice(0,80)}:${t}`))}),i.truncated?(0,G.jsx)(ys,{copySource:()=>af(e),onRenderMore:r,rendered:i.renderedLines,total:t,unit:`lines`}):null]})}var sf={completed:{Icon:xe,label:`Done`,className:`text-[var(--console-success)]`},error:{Icon:Oe,label:`Failed`,className:`text-[var(--console-error)]`},in_progress:{Icon:he,label:`In progress`,className:`text-[var(--console-warning)]`},pending:{Icon:ve,label:`Pending`,className:`text-[var(--console-muted)]`}};function cf({items:e}){return(0,G.jsx)(`ol`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)]`,children:e.map((e,t)=>{let n=sf[e.status];return(0,G.jsxs)(`li`,{className:`flex gap-3 border-b border-[var(--console-border)] px-3 py-2.5 last:border-b-0`,children:[(0,G.jsx)(n.Icon,{className:`mt-0.5 size-3.5 shrink-0 ${n.className}`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium leading-relaxed text-[var(--console-text)]`,children:e.label}),(0,G.jsx)(`span`,{className:`console-mono text-[10px] uppercase tracking-wide ${n.className}`,children:n.label})]}),e.detail?(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-[var(--console-muted)]`,children:e.detail}):null]})]},`${e.label}:${t}`)})})}function lf({outputContent:e}){if(e.kind===`structured-diff`)return(0,G.jsx)(of,{blocks:e.blocks});if(e.kind===`file-sections`)return(0,G.jsx)(Xd,{sections:e.sections});if(e.kind===`question-list`)return(0,G.jsx)(tf,{questions:e.questions});if(e.kind===`task-list`)return(0,G.jsx)(cf,{items:e.items});if(e.kind===`media`)return(0,G.jsx)(Zd,{items:e.items,text:e.text});if(e.kind===`property-list`)return(0,G.jsx)(ef,{items:e.items});let t=e.text||`No output captured.`;return!e.isCode||e.language===`text`?(0,G.jsx)(xs,{text:t,initialBudget:gs.plain,children:e=>(0,G.jsx)(`pre`,{className:`console-mono max-h-[420px] overflow-auto whitespace-pre-wrap break-words rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)] p-3 text-xs leading-relaxed text-[var(--console-text)]`,children:e})}):e.language===`diff`?(0,G.jsx)(Jd,{text:t}):(0,G.jsx)(`div`,{className:`max-h-[420px] overflow-auto rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:(0,G.jsx)(Ud,{language:e.language,text:t})})}var uf=`<turn_aborted>
49
- The user interrupted the previous turn on purpose. Any running unified exec processes were terminated. If any tools/commands were aborted, they may have partially executed; verify current state before retrying.
50
- </turn_aborted>`;function df(e){return e.replace(/\r\n/g,`
51
- `).trim()}function ff(e,t){if(t.toLowerCase()!==`codex`||e.role!==`user`||e.parts.length!==1)return!1;let[n]=e.parts;return!n||n.type!==`text`?!1:df(n.text)===df(uf)}function pf(e){let t=e.approval_status===`fail`?`fail`:`success`,n=e.text.trim();return{title:`plan`,secondaryText:void 0,approvalStatus:t,expandable:!!n,contentLabel:t===`fail`?`Rejected`:`Plan`,contentMarkdown:n}}function mf(){let e=new Map,t=new Set;return{get:t=>e.get(t),entries:()=>e.entries(),register:(n,r)=>{let i=e.get(n);i===r||!i&&!r||(r?e.set(n,r):e.delete(n),t.forEach(e=>e(n,r,i)))},subscribe:e=>(t.add(e),()=>t.delete(e))}}var hf=(0,K.createContext)(null);function gf({registry:e,children:t}){return(0,G.jsx)(hf.Provider,{value:e,children:t})}function _f(e){let t=(0,K.useContext)(hf);return(0,K.useCallback)(n=>{e&&t?.register(e,n)},[e,t])}var vf={completed:{label:`Success`,className:`border-[var(--console-success-border)] bg-[var(--positive-soft)] text-[var(--positive)]`,icon:oe},error:{label:`Failed`,className:`border-[var(--console-error-border)] bg-[var(--console-error-bg)] text-[var(--console-error)]`,icon:_},running:{label:`Running`,className:`border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] text-[var(--console-warning)]`,icon:b}};function yf(e,t){let n=hs(t);return n?e.split(n).map((e,t)=>e.match(n)?(0,G.jsx)(`mark`,{children:e},`${e}-${t}`):(0,G.jsx)(`span`,{children:e},`${e}-${t}`)):e}function bf({text:e,highlightQuery:t}){return(0,G.jsx)(Os,{text:e,highlightQuery:t})}var xf=(0,K.memo)(function({messageIndex:e,msg:t,blocks:n,formatTokens:r,sessionAgentKey:i,agent:a,baseDirectory:s,highlightQuery:l,childSessionById:d}){let f=t.role===`user`,p=ff(t,i),m=f?ic(e):void 0,g=_f(m),_=()=>{let e=a?.displayName??i,t=a?.icon;return(0,G.jsx)(G.Fragment,{children:t?(0,G.jsx)(c,{icon:t,iconColored:a?.iconColored,alt:e,className:`size-4 rounded-sm object-cover`}):(0,G.jsx)(ae,{className:`size-4 text-[var(--console-muted)]`})})},v=t.mode?t.mode.toUpperCase():null,y=t.model||null,b=Js(t),x=o(t.time_created),C=t.subagent_id?d?.get(t.subagent_id):void 0;return(0,G.jsx)(`article`,{ref:g,id:m,className:`w-full scroll-mt-20 border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,G.jsxs)(`div`,{className:`flex gap-4`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,G.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:f?(0,G.jsx)(S,{className:`size-4 text-[var(--console-muted)]`}):_()})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,G.jsx)(`span`,{className:`console-mono text-sm font-bold tracking-wide text-[var(--console-text)]`,children:b}),x?(0,G.jsx)(`time`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:x}):null,v&&(0,G.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:v}),y&&(0,G.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:y}),C?(0,G.jsx)(h,{to:u(C),className:`console-mono rounded-full border border-[var(--brand-line)] px-1.5 py-0.5 text-[10px] text-[var(--brand)] hover:bg-[var(--brand-soft)] hover:text-[var(--brand-hover)]`,children:`Open sub-session ↗`}):null]}),p?(0,G.jsx)(Cf,{}):n.map((t,n)=>{let r=ac(e,n);return t.type===`reasoning`?(0,G.jsx)(wf,{anchorId:r,parts:t.parts,highlightQuery:l},n):t.type===`plan`?(0,G.jsx)(Ef,{anchorId:r,parts:t.parts,highlightQuery:l},n):t.type===`tool`?(0,G.jsx)(Tf,{parts:t.parts,anchorIds:t.anchorIds,sessionAgentKey:i,baseDirectory:s,highlightQuery:l},n):(0,G.jsx)(Sf,{anchorId:r,parts:t.parts,highlightQuery:l},n)}),!f&&(t.tokens||t.cost)&&(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.tokens?.input?(0,G.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`INPUT `,r(t.tokens.input)]}):null,t.tokens?.output?(0,G.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`OUTPUT `,r(t.tokens.output)]}):null,t.tokens?.reasoning?(0,G.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[`REASONING `,r(t.tokens.reasoning)]}):null,t.cost?(0,G.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[t.cost_source===`estimated`?`EST COST`:`COST`,` $`,t.cost.toFixed(4)]}):null]})]})]})})}),Sf=(0,K.memo)(function({anchorId:e,parts:t,highlightQuery:n}){let r=_f(e);return(0,G.jsx)(`div`,{ref:r,id:e,className:`scroll-mt-20 rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-4 shadow-[var(--shadow-raised)]`,children:(0,G.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:t.map((e,t)=>(0,G.jsx)(bf,{text:e.text,highlightQuery:n},t))})})});function Cf(){return(0,G.jsx)(`div`,{className:`space-y-2`,children:(0,G.jsx)(`div`,{className:`flex flex-wrap items-start gap-2`,children:(0,G.jsx)(`div`,{className:`w-full rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2 text-left shadow-[var(--shadow-raised)] md:w-[560px]`,children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:`abort`})})]})})})})}var wf=(0,K.memo)(function({anchorId:e,parts:t,highlightQuery:n}){let[r,i]=(0,K.useState)(!1),a=_f(e),o=(0,K.useMemo)(()=>t.map(e=>e.text).filter(Boolean).join(`
52
-
53
- `),[t]);return(0,G.jsxs)(`div`,{ref:a,id:e,className:`scroll-mt-20 overflow-hidden rounded-lg border border-[var(--console-thinking-border)] bg-[var(--console-thinking-bg)]`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between bg-[var(--console-surface-muted)] px-3 py-2 text-left motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--brand)]`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,G.jsxs)(`span`,{className:`console-mono flex items-center gap-2 text-xs font-medium text-[var(--console-muted)]`,children:[(0,G.jsx)(Te,{className:`size-3.5`}),`Thinking`]}),(0,G.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:(0,G.jsx)(me,{className:`motion-chevron w-4 h-4`,"data-open":r||void 0})})]}),(0,G.jsx)($u,{open:r,children:()=>(0,G.jsx)(`div`,{className:`border-t border-dashed border-[var(--console-thinking-border)] px-4 py-3`,children:(0,G.jsx)(xs,{text:o,initialBudget:gs.plain,children:e=>(0,G.jsx)(`div`,{className:`console-mono whitespace-pre-wrap text-xs leading-relaxed text-[var(--console-muted)]`,children:yf(e,n)})})})})]})}),Tf=(0,K.memo)(function({parts:e,anchorIds:t,sessionAgentKey:n,baseDirectory:r,highlightQuery:i}){return(0,G.jsx)(`div`,{className:`space-y-2`,children:(0,G.jsx)(`div`,{className:`space-y-2`,children:e.map((e,a)=>(0,G.jsx)(Of,{tool:e,anchorId:t?.[a],sessionAgentKey:n,baseDirectory:r,highlightQuery:i},a))})})}),Ef=(0,K.memo)(function({anchorId:e,parts:t,highlightQuery:n}){let r=_f(e);return(0,G.jsx)(`div`,{ref:r,id:e,className:`scroll-mt-20 space-y-2`,children:t.map((e,t)=>(0,G.jsx)(Df,{part:e,highlightQuery:n},t))})}),Df=(0,K.memo)(function({part:e,highlightQuery:t}){let[n,r]=(0,K.useState)(!1),i=(0,K.useMemo)(()=>pf(e),[e]),a=i.approvalStatus===`fail`?vf.error:vf.completed,o=a.icon;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,G.jsx)(`div`,{className:`w-full md:w-[560px] rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2 text-left shadow-[var(--shadow-raised)] ${i.expandable?`motion-hover hover:bg-[var(--console-surface-muted)]`:``}`,children:i.expandable?(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>r(e=>!e),"aria-expanded":n,children:[(0,G.jsx)(_e,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:i.title})}),(0,G.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:(0,G.jsx)(me,{className:`motion-chevron size-3.5`,"data-open":n||void 0})})]}):(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(_e,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:i.title})})]})}),(0,G.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${a.className}`,children:[(0,G.jsx)(o,{className:`size-3`}),a.label]})]}),(0,G.jsx)($u,{open:i.expandable&&n,children:()=>(0,G.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,G.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,G.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:i.contentLabel})}),(0,G.jsx)(`div`,{className:`bg-[var(--console-surface-sunken)] p-4`,children:(0,G.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,G.jsx)(bf,{text:i.contentMarkdown,highlightQuery:t})})})]})})]})}),Of=(0,K.memo)(function({tool:e,anchorId:t,sessionAgentKey:n,baseDirectory:r,highlightQuery:i}){let[a,o]=(0,K.useState)(!1),s=_f(t),c=(0,K.useMemo)(()=>qs(e),[e]),l=(0,K.useMemo)(()=>Ju(n,e,c,r),[r,n,c,e]),u=(0,K.useMemo)(()=>ul(c.inputText||`{}`,r),[r,c.inputText]),d=vf[c.status],f=d.icon,p=l.Icon;return(0,G.jsxs)(`div`,{ref:s,id:t,className:`scroll-mt-20`,children:[(0,G.jsx)(`div`,{className:`flex flex-wrap items-start gap-2`,children:(0,G.jsx)(`div`,{className:`w-full max-w-[720px] rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2.5 text-left shadow-[var(--shadow-raised)] ${l.expandable?`motion-hover hover:bg-[var(--console-surface-muted)]`:``}`,children:l.expandable?(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2.5 text-left active:scale-[0.995] motion-reduce:transform-none`,onClick:()=>o(!a),"aria-expanded":a,children:[(0,G.jsx)(p,{className:`size-4 shrink-0 text-[var(--console-accent)]`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:l.title}),l.secondaryText?(0,G.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:yf(l.secondaryText,i)}):null]}),(0,G.jsxs)(`span`,{className:`console-mono inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider ${d.className}`,children:[(0,G.jsx)(f,{className:`size-2.5 ${c.status===`running`?`animate-spin motion-reduce:animate-none`:``}`}),d.label]}),(0,G.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:(0,G.jsx)(me,{className:`motion-chevron size-3.5`,"data-open":a||void 0})})]}):(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,G.jsx)(p,{className:`size-4 shrink-0 text-[var(--console-accent)]`}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:l.title}),l.secondaryText?(0,G.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:yf(l.secondaryText,i)}):null]}),(0,G.jsxs)(`span`,{className:`console-mono inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider ${d.className}`,children:[(0,G.jsx)(f,{className:`size-2.5`}),d.label]})]})})}),(0,G.jsx)($u,{open:l.expandable&&a,children:()=>(0,G.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,G.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,G.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:l.contentLabel??`Output`})}),(0,G.jsxs)(`div`,{className:`space-y-3 bg-[var(--console-surface-sunken)] p-3`,children:[l.details.length>0?(0,G.jsx)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] px-3 py-2`,children:(0,G.jsx)(`div`,{className:`space-y-2`,children:l.details.map(e=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,G.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] font-semibold uppercase tracking-wide text-[var(--console-muted)] md:w-24`,children:e.label}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(xs,{text:e.value,initialBudget:gs.plain,children:e=>(0,G.jsx)(`span`,{className:`console-mono whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-text)]`,children:yf(e,i)})})})]},`${e.label}:${e.value}`))})}):null,(0,G.jsx)(lf,{outputContent:l.outputContent})]}),l.showInputPreview?(0,G.jsxs)(`div`,{className:`border-t border-[var(--console-border)] bg-[var(--console-surface-sunken)] px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:`Input Preview`}),(0,G.jsx)(xs,{text:u,initialBudget:gs.plain,children:e=>(0,G.jsx)(`pre`,{className:`console-mono mt-1 max-h-[200px] overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:yf(e,i)})})]}):null]})})]})}),kf=class{count;gap;sizes;measured;tree;constructor(e,t,n){this.count=e,this.gap=n,this.sizes=new Float64Array(e),this.measured=new Uint8Array(e),this.tree=new Float64Array(e+1);for(let n=0;n<e;n+=1)this.sizes[n]=this.extentOf(t,n);this.buildTree()}heightAt(e){return e<0||e>=this.count?0:this.sizes[e]-this.gapAfter(e)}setHeight(e,t){if(e<0||e>=this.count||!Number.isFinite(t)||t<=0)return!1;let n=Math.ceil(t);if(this.measured[e]===1&&Math.abs(this.heightAt(e)-n)<=1)return!1;let r=this.extentOf(n,e),i=r-this.sizes[e];return this.sizes[e]=r,this.measured[e]=1,i!==0&&this.addToTree(e,i),!0}startAt(e){return this.prefixSum(Math.max(0,Math.min(e,this.count)))}endAt(e){return this.startAt(e)+this.heightAt(e)}get totalSize(){return this.prefixSum(this.count)}firstEndAfter(e){let t=0,n=this.count;for(;t<n;){let r=t+n>>1;this.endAt(r)<e?t=r+1:n=r}return t}firstStartAfter(e){let t=0,n=this.count;for(;t<n;){let r=t+n>>1;this.startAt(r)<=e?t=r+1:n=r}return t}gapAfter(e){return e===this.count-1?0:this.gap}extentOf(e,t){return e+this.gapAfter(t)}buildTree(){for(let e=0;e<this.count;e+=1){let t=e+1;this.tree[t]+=this.sizes[e];let n=t+(t&-t);n<=this.count&&(this.tree[n]+=this.tree[t])}}addToTree(e,t){for(let n=e+1;n<=this.count;n+=n&-n)this.tree[n]+=t}prefixSum(e){let t=0;for(let n=e;n>0;n-=n&-n)t+=this.tree[n];return t}},Af=32,jf=280,Mf=6;function Nf({messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:c}){let l=e.length>80;return(0,K.useEffect)(()=>{l||(o.current=null)},[o,l]),l?(0,G.jsx)(Pf,{messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:c}):(0,G.jsx)(gf,{registry:c,children:(0,G.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:e.map(({msg:e,blocks:o,index:c})=>(0,G.jsx)(xf,{messageIndex:c,msg:e,blocks:o,formatTokens:s,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a},`${e.id}:${c}`))})})}function Pf({messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:c}){let l=(0,K.useRef)(null),u=(0,K.useRef)(null),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(0),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(()=>({scrollTop:0,height:900,listTop:0})),v=(0,K.useRef)(g);(0,K.useEffect)(()=>{v.current=g},[g]);let y=(0,K.useCallback)(()=>{if(typeof window>`u`)return null;let e=l.current,t=e?nd(e):window;u.current=t;let n=e?sd(t,e):0,r={scrollTop:id(t),height:ad(t),listTop:n},i=v.current;return Math.abs(i.scrollTop-r.scrollTop)<1&&Math.abs(i.height-r.height)<1&&Math.abs(i.listTop-r.listTop)<1?t:(v.current=r,_(r),t)},[]);(0,K.useEffect)(()=>{let e=0,t=null,n=null,r=e=>{t!==e&&(t&&(t.removeEventListener(`scroll`,a),n&&!rd(t)&&n.unobserve(t)),t=e,t.addEventListener(`scroll`,a,{passive:!0}),n&&!rd(t)&&n.observe(t))},i=()=>{let e=y();e&&r(e)},a=()=>{e||=requestAnimationFrame(()=>{e=0,i()})};window.addEventListener(`resize`,a),typeof ResizeObserver<`u`&&(n=new ResizeObserver(a),l.current&&n.observe(l.current),document.body&&n.observe(document.body));let o=new MutationObserver(a),s=l.current?.parentElement;for(;s;)o.observe(s,{attributes:!0,attributeFilter:[`class`,`style`]}),s=s.parentElement;return document.fonts?.addEventListener(`loadingdone`,a),i(),()=>{e&&cancelAnimationFrame(e),n?.disconnect(),o.disconnect(),document.fonts?.removeEventListener(`loadingdone`,a),t?.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[y]);let b=(0,K.useMemo)(()=>new kf(e.length,jf,Af),[e]);(0,K.useEffect)(()=>{y()},[e,y]),(0,K.useEffect)(()=>()=>{p.current&&cancelAnimationFrame(p.current),p.current=0},[]);let x=(0,K.useCallback)((e,t)=>{b.setHeight(e,t)&&(p.current||=requestAnimationFrame(()=>{p.current=0,f(e=>e+1)}))},[b]),S=(0,K.useMemo)(()=>{if(e.length===0)return[];let t=Math.max(0,g.scrollTop-g.listTop),n=t+g.height,r=Math.max(0,b.firstEndAfter(t)-Mf),i=Math.min(e.length,b.firstStartAfter(n)+Mf),a=[];for(let e=r;e<i;e+=1)a.push({index:e,start:b.startAt(e)});let o=m?.heightIndex===b?m.index:null;return o!=null&&o>=0&&o<e.length&&(a.some(e=>e.index===o)||(a.push({index:o,start:b.startAt(o)}),a.sort((e,t)=>e.start-t.start))),a},[m,b,d,e.length,g]),C=(0,K.useCallback)(t=>{if(typeof window>`u`||t<0||t>=e.length)return;h({heightIndex:b,index:t});let n=l.current,r=n?nd(n):u.current??window;u.current=r;let i=n?sd(r,n):0,a=Math.max(0,i+b.startAt(t)-24);cd(r,a);let o={scrollTop:a,height:ad(r),listTop:i};v.current=o,_(o)},[b,e.length]);return(0,K.useEffect)(()=>(o.current={scrollToIndex:C},()=>{o.current?.scrollToIndex===C&&(o.current=null)}),[o,C]),(0,G.jsx)(gf,{registry:c,children:(0,G.jsx)(`div`,{ref:l,className:`relative min-w-0`,style:{height:Math.max(1,b.totalSize)},children:S.map(({index:o,start:c})=>{let l=e[o];return l?(0,G.jsx)(Ff,{index:o,top:c,onMeasure:x,children:(0,G.jsx)(xf,{messageIndex:l.index,msg:l.msg,blocks:l.blocks,formatTokens:s,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a})},`${l.msg.id}:${l.index}`):null})})})}function Ff({index:e,top:t,onMeasure:n,children:r}){let i=(0,K.useRef)(null);return(0,K.useLayoutEffect)(()=>{let t=i.current;if(!t)return;let r=()=>n(e,t.getBoundingClientRect().height);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(t),()=>a.disconnect()},[e,n]),(0,G.jsx)(`div`,{ref:i,className:`absolute left-0 top-0 w-full`,style:{transform:`translateY(${t}px)`},children:r})}var If=(0,K.lazy)(()=>m(()=>import(`./InteractiveReceipt-Sca1smpv.js`).then(e=>({default:e.InteractiveReceipt})),__vite__mapDeps([2,1,3,4,5,6,7,8,9])));function Lf(){return(0,G.jsx)(`div`,{className:`h-[calc(100dvh-5.5rem)] min-h-[420px] rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)]`})}function Rf({session:e,toc:t}){let[n,r]=(0,K.useState)(!1),[i,a]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{if(!n)return;let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>a(!0))}),i=window.matchMedia(`(min-width: 1025px)`),o=()=>{i.matches||(r(!1),a(!1))};return i.addEventListener(`change`,o),()=>{cancelAnimationFrame(t),e&&cancelAnimationFrame(e),i.removeEventListener(`change`,o)}},[n]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,"aria-expanded":n,"aria-label":`Open session receipt`,onClick:()=>{a(!1),r(!0)},className:`console-mono fixed right-0 top-1/2 z-40 hidden h-32 w-10 -translate-y-1/2 items-center justify-center rounded-l-sm border border-r-0 border-[var(--console-border)] bg-[var(--console-surface)] text-[10px] font-semibold uppercase tracking-[0.14em] text-[var(--console-text)] shadow-[var(--shadow-overlay)] motion-hover hover:bg-[var(--console-surface-muted)] min-[1025px]:flex`,children:(0,G.jsx)(`span`,{className:`[writing-mode:vertical-rl]`,children:`Receipt`})}),(0,G.jsx)(be,{open:n,onOpenChange:e=>{r(e),e||a(!1)},title:`Session Receipt`,variant:`desktop`,children:i?(0,G.jsx)(ee,{id:`InteractiveReceipt`,children:(0,G.jsx)(ge,{children:(0,G.jsx)(K.Suspense,{fallback:(0,G.jsx)(Lf,{}),children:(0,G.jsx)(If,{session:e,toc:t},f(e.reference))})})}):(0,G.jsx)(Lf,{})})]})}var zf=`console-mono motion-hover inline-flex h-9 items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-3 text-xs font-semibold tracking-[0.12em] text-[var(--console-text)] uppercase shadow-[var(--shadow-raised)] hover:bg-[var(--console-surface-muted)]`;function Bf({toc:e,state:t,fileChangeSummary:n,onOpen:r}){let i=ld(n),a=Id(e,t);return(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2 min-[1025px]:hidden`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(`toc`),className:zf,children:[(0,G.jsx)(re,{className:`size-3.5 text-[var(--brand)]`}),a>0?`${a} filters`:`Content filters`]}),i>0?(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(`files`),className:zf,children:[(0,G.jsx)(Ee,{className:`size-3.5 text-[var(--console-accent)]`}),`Files`,(0,G.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:i})]}):null]})}function Vf({openPanel:e,fileChangeSummary:t,baseDirectory:n,onClose:r,onJumpToAnchor:i,...a}){return(0,K.useEffect)(()=>{if(!e)return;let t=window.matchMedia(`(min-width: 1025px)`),n=()=>{t.matches&&r()};return t.addEventListener(`change`,n),n(),()=>{t.removeEventListener(`change`,n)}},[r,e]),(0,G.jsx)(be,{open:e!==null,onOpenChange:e=>{e||r()},title:e===`files`?`File Tracker`:`Content filters`,variant:`mobile`,children:e?e===`toc`?(0,G.jsx)(jd,{...a}):(0,G.jsx)(ud,{summary:t,baseDirectory:n,onJumpToAnchor:i}):null})}var Hf=6;function Uf(e){return{start:0,end:Math.min(e,80)}}function Wf(e,t,n,r){if(e<=80)return{start:0,end:e};if(n<=0||r<=0)return Uf(e);if(n>=r)return{start:0,end:e};let i=Math.floor(Math.max(0,t)/r*e),a=Math.ceil(Math.min(r,t+n)/r*e);return{start:Math.max(0,i-Hf),end:Math.min(e,a+Hf)}}function Gf(e,t,n){let r=100/t;return{position:`absolute`,top:0,bottom:0,left:`calc(${e*r}% + ${e*n/t}px)`,width:`calc(${r}% - ${(t-1)*n/t}px)`}}function Kf(e){let t=e>80?{className:`gap-px`,width:1}:e>40?{className:`gap-0.5`,width:2}:{className:`gap-1`,width:4};return{gapClassName:t.className,gapWidth:t.width,minWidth:e*10+Math.max(0,e-1)*t.width}}function qf(e,t,n,r,i){if(r===0||e.clientWidth<=0)return;let a=Math.max(e.scrollWidth,t.scrollWidth,t.getBoundingClientRect().width);if(a<=0)return;let o=Math.max(0,(a-Math.max(0,r-1)*i)/r),s=n*(o+i),c=s+o,l=e.scrollLeft,u=l+e.clientWidth;s<l?e.scrollLeft=s:c>u&&(e.scrollLeft=c-e.clientWidth)}var Jf={user:`--timeline-user`,agent:`--timeline-agent`,"tool-read":`--timeline-tool-read`,"tool-write":`--timeline-tool-write`,"tool-execute":`--timeline-tool-execute`};function Yf({entries:e,viewportRef:t,visibleWindow:n}){let r=(0,K.useRef)(null),i=(0,K.useRef)(null);(0,K.useEffect)(()=>{let t=r.current;if(!t)return;let n=()=>{let n=t.getContext(`2d`),r=t.clientWidth,i=t.clientHeight;if(!n||!r||!i||e.length===0)return;let a=window.devicePixelRatio||1;t.width=Math.round(r*a),t.height=Math.round(i*a),n.scale(a,a),n.clearRect(0,0,r,i);let o=window.getComputedStyle(t),s=Object.fromEntries(Object.entries(Jf).map(([e,t])=>[e,o.getPropertyValue(t).trim()||o.color]));e.forEach((t,a)=>{let o=a/e.length*r,c=(a+1)/e.length*r;n.fillStyle=s[t.kind],n.fillRect(o,0,Math.max(c-o,.5),i)})};n();let i=new MutationObserver(n);if(i.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),typeof ResizeObserver>`u`)return()=>i.disconnect();let a=new ResizeObserver(n);return a.observe(t),()=>{i.disconnect(),a.disconnect()}},[e]);let a=(0,K.useCallback)((e,n)=>{let r=t.current;r&&(r.scrollLeft=(e-n)*r.scrollWidth)},[t]),o=(0,K.useCallback)(e=>{let n=t.current;if(!n)return;let r=Math.max(0,n.scrollWidth-n.clientWidth),i=Math.max(40,n.clientWidth*.1),a=Math.max(120,n.clientWidth*.75),o=null;e.key===`ArrowLeft`&&(o=n.scrollLeft-i),e.key===`ArrowRight`&&(o=n.scrollLeft+i),e.key===`PageUp`&&(o=n.scrollLeft-a),e.key===`PageDown`&&(o=n.scrollLeft+a),e.key===`Home`&&(o=0),e.key===`End`&&(o=r),o!=null&&(e.preventDefault(),n.scrollLeft=Math.min(r,Math.max(0,o)))},[t]);return(0,G.jsx)(`div`,{"data-testid":`session-timeline-minimap`,role:`scrollbar`,"aria-controls":`session-timeline-viewport`,"aria-orientation":`horizontal`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n.start/(1-n.size)*100),"aria-label":`Timeline scroll position`,tabIndex:0,className:`session-timeline-minimap relative mt-2 h-2.5 cursor-pointer touch-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)]`,onKeyDown:o,onPointerDown:e=>{if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();if(t.width<=0)return;let r=(e.clientX-t.left)/t.width,o=r>=n.start&&r<=n.start+n.size?r-n.start:n.size/2;i.current={pointerId:e.pointerId,grabOffset:o},e.currentTarget.setPointerCapture(e.pointerId),a(r,o)},onPointerMove:e=>{let t=i.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.currentTarget.getBoundingClientRect();n.width<=0||a((e.clientX-n.left)/n.width,t.grabOffset)},onPointerUp:e=>{i.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerCancel:()=>{i.current=null},children:(0,G.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden rounded-[2px]`,children:[(0,G.jsx)(`canvas`,{ref:r,"aria-hidden":`true`,className:`absolute inset-0 h-full w-full`}),(0,G.jsx)(`div`,{"data-testid":`session-timeline-minimap-window`,className:`session-timeline-minimap-window absolute inset-y-0`,style:{left:`${n.start*100}%`,width:`${n.size*100}%`}})]})})}var Xf=e(a(),1),Zf=8;function Qf(){let e=(0,K.useRef)(null),t=(0,K.useRef)(null),[n,r]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{let t=e.current;if(!t||!n)return;let r=t.offsetWidth/2,i=Math.min(window.innerWidth-Zf-r,Math.max(Zf+r,n.anchorX));t.style.left=`${i}px`},[n]),{tooltip:n,tooltipRef:e,show:(0,K.useCallback)((e,n,i)=>{let a=n.getBoundingClientRect();t.current=n,r({entryId:e.id,id:`timeline-tooltip-${e.id}`,text:e.tooltip,anchorX:a.left+a.width/2,top:a.bottom+8,source:i})},[]),hide:(0,K.useCallback)(e=>{r(n=>n?.entryId===e?(t.current=null,null):n)},[]),handleScroll:(0,K.useCallback)(()=>{r(e=>{let n=t.current;if(!e||e.source!==`focus`||!n||n!==document.activeElement)return t.current=null,null;let r=n.getBoundingClientRect();return{...e,anchorX:r.left+r.width/2,top:r.bottom+8}})},[])}}function $f({tooltip:e,tooltipRef:t}){return e?(0,Xf.createPortal)((0,G.jsx)(`span`,{ref:t,id:e.id,role:`tooltip`,className:`t-tt session-timeline-floating-tooltip console-mono text-[11px]`,style:{left:e.anchorX,top:e.top},children:e.text}),document.body):null}function ep(e){let t=ad(e);return{center:rd(e)?t/2:e.getBoundingClientRect().top+t/2,scrollTop:id(e),viewportHeight:t,scrollHeight:od(e)}}function tp({rootRef:e,entries:t,anchorRegistry:n}){let[r,i]=(0,K.useState)(null),a=(0,K.useMemo)(()=>new Map(t.map((e,t)=>[e.anchorId,t])),[t]);return(0,K.useEffect)(()=>{let r=e.current;if(!r||t.length===0)return;let o=nd(r),s=0,c=(e,t)=>{let n=a.get(e);return n==null?null:{index:n,top:t.getBoundingClientRect().top}},l=()=>Array.from(n.entries()).flatMap(([e,t])=>c(e,t)??[]),u=new Map,d=()=>Array.from(u).flatMap(([e,t])=>c(e,t)??[]),f=()=>{let e=ep(o),n=fc(e.scrollTop,e.viewportHeight,e.scrollHeight,t.length),r=g?d():l(),a=n??dc(r,e.center),s=a==null?null:t[a]?.anchorId;s!=null&&i(e=>e===s?e:s)},p=()=>{s||=requestAnimationFrame(()=>{s=0,f()})},m=typeof ResizeObserver>`u`?null:new ResizeObserver(p),h=new WeakMap,g=typeof IntersectionObserver>`u`?null:new IntersectionObserver(e=>{for(let t of e){let e=t.target,n=h.get(e);n&&(t.isIntersecting?u.set(n,e):u.delete(n))}p()},{root:rd(o)?null:o,threshold:0}),_=(e,t)=>{h.set(t,e),g?.observe(t),m?.observe(t)},v=(e,t)=>{g?.unobserve(t),m?.unobserve(t),h.delete(t),u.delete(e)};g&&Array.from(n.entries()).forEach(([e,t])=>_(e,t)),p(),o.addEventListener(`scroll`,p,{passive:!0}),window.addEventListener(`resize`,p);let y=n.subscribe((e,t,n)=>{n&&n!==t&&v(e,n),t&&_(e,t),p()});return()=>{s&&cancelAnimationFrame(s),g?.disconnect(),m?.disconnect(),y(),o.removeEventListener(`scroll`,p),window.removeEventListener(`resize`,p)}},[n,t,a,e]),r==null?0:a.get(r)??0}function np({entries:e,trackRef:t,focusIndex:n,onNavigate:r}){let i=(0,K.useRef)({active:!1,moved:!1,startX:0,lastIndex:-1}),a=(0,K.useRef)(!1),o=(0,K.useCallback)((n,a)=>{let o=t.current;if(!o)return;let s=o.getBoundingClientRect(),c=pc(n,s.left,s.width,e.length);if(c==null||c===i.current.lastIndex)return;let l=e[c];l&&(i.current.lastIndex=c,r(l,a))},[e,r,t]);return{handleKeyDown:(0,K.useCallback)(t=>{let r=t.target.closest(`[data-timeline-index]`)?.dataset.timelineIndex,i=r==null?null:Number(r);if(i==null||!Number.isInteger(i))return;let a=null;t.key===`ArrowLeft`&&(a=Math.max(0,i-1)),t.key===`ArrowRight`&&(a=Math.min(e.length-1,i+1)),t.key===`Home`&&(a=0),t.key===`End`&&(a=e.length-1),a!=null&&a!==i&&(t.preventDefault(),n(a))},[e.length,n]),handlePointerDown:(0,K.useCallback)(e=>{e.button===0&&(i.current={active:!0,moved:!1,startX:e.clientX,lastIndex:-1})},[]),handlePointerMove:(0,K.useCallback)(e=>{let t=i.current;if(t.active){if(!t.moved){if(Math.abs(e.clientX-t.startX)<3)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}a.current=!0,o(e.clientX,`auto`)}},[o]),handlePointerUp:(0,K.useCallback)(e=>{i.current.active=!1,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),window.setTimeout(()=>{a.current=!1},0)},[]),handlePointerCancel:(0,K.useCallback)(()=>{i.current.active=!1,a.current=!1},[]),handleClick:(0,K.useCallback)(t=>{if(a.current)return;let n=ed(t.detail),i=t.target.closest(`[data-timeline-index]`)?.dataset.timelineIndex,s=i==null?null:Number(i),c=s==null||!Number.isInteger(s)?void 0:e[s];if(c){r(c,n);return}o(t.clientX,n)},[e,o,r])}}var rp=1;function ip({activeIndex:e,entryCount:t,gapWidth:n}){let r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null),[o,s]=(0,K.useState)({left:!1,right:!1}),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(()=>Uf(t)),f=t>80,p=f?Math.min(u.start,t):0,m=f?Math.max(p,Math.min(u.end,t)):t,h=(0,K.useCallback)(()=>{let e=r.current;if(!e)return;let n=Wf(t,e.scrollLeft,e.clientWidth,e.scrollWidth);d(e=>e.start===n.start&&e.end===n.end?e:n);let i=Math.max(0,e.scrollWidth-e.clientWidth),a={left:e.scrollLeft>rp,right:e.scrollLeft<i-rp};if(s(e=>e.left===a.left&&e.right===a.right?e:a),i<=0){l(null);return}let o={start:e.scrollLeft/e.scrollWidth,size:e.clientWidth/e.scrollWidth};l(e=>e?.start===o.start&&e.size===o.size?e:o)},[t]);return(0,K.useLayoutEffect)(()=>{h();let e=r.current,t=i.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(h);return n.observe(e),n.observe(t),()=>n.disconnect()},[t,h]),(0,K.useEffect)(()=>{let a=r.current,o=i.current;!a||!o||(qf(a,o,e,t,n),h())},[e,t,n,h]),(0,K.useLayoutEffect)(()=>{let e=a.current;if(e==null)return;let t=i.current?.querySelector(`[data-timeline-index="${e}"]`);t&&(a.current=null,t.focus())},[m,p]),{scrollRef:r,trackRef:i,virtualized:f,renderStart:p,renderEnd:m,scrollAvailability:o,minimapWindow:c,update:h,scrollByPage:(0,K.useCallback)(e=>{let t=r.current;t&&(t.scrollLeft+=e*Math.max(120,t.clientWidth*.75))},[]),focusIndex:(0,K.useCallback)(e=>{let o=r.current,s=i.current;if(!o||!s)return;let c=s.querySelector(`[data-timeline-index="${e}"]`);if(c){c.focus();return}a.current=e,qf(o,s,e,t,n),h()},[t,n,h])}}var ap={user:`bg-[var(--timeline-user)]`,agent:`bg-[var(--timeline-agent)]`,"tool-read":`bg-[var(--timeline-tool-read)]`,"tool-write":`bg-[var(--timeline-tool-write)]`,"tool-execute":`bg-[var(--timeline-tool-execute)]`},op=(0,K.memo)(function({entry:e,index:t,isActive:n,isTooltipVisible:r,virtualized:i,entryCount:a,gapWidth:o,onShowTooltip:s,onHideTooltip:c}){let l=`timeline-tooltip-${e.id}`;return(0,G.jsx)(`span`,{className:`session-timeline-item min-w-0`,style:i?Gf(t,a,o):void 0,children:(0,G.jsx)(`button`,{type:`button`,"data-timeline-index":t,"data-timeline-kind":e.kind,"aria-current":n?`location`:void 0,"aria-describedby":r?l:void 0,"aria-label":`Go to ${e.tooltip}`,className:`t-tt-trigger session-timeline-segment h-full w-full rounded-[2px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)] ${ap[e.kind]}`,onPointerEnter:t=>s(e,t.currentTarget,`pointer`),onPointerLeave:()=>c(e.id),onFocus:t=>s(e,t.currentTarget,`focus`),onBlur:()=>c(e.id)})})});function sp({entries:e,anchorRegistry:t,onNavigate:n}){let r=(0,K.useRef)(null),i=tp({rootRef:r,entries:e,anchorRegistry:t}),a=Kf(e.length),{scrollRef:o,trackRef:s,virtualized:c,renderStart:l,renderEnd:u,scrollAvailability:d,minimapWindow:f,update:p,scrollByPage:m,focusIndex:h}=ip({activeIndex:i,entryCount:e.length,gapWidth:a.gapWidth}),{tooltip:g,tooltipRef:_,show:v,hide:y,handleScroll:b}=Qf(),{handleKeyDown:x,handlePointerDown:S,handlePointerMove:C,handlePointerUp:ee,handlePointerCancel:w,handleClick:T}=np({entries:e,trackRef:s,focusIndex:h,onNavigate:n}),te=(0,K.useMemo)(()=>e.slice(l,u).map((e,t)=>({entry:e,index:l+t})),[e,u,l]),E=(0,K.useCallback)(()=>{p(),b()},[b,p]);return(0,G.jsx)(`div`,{className:`sticky top-0 z-20 -mx-2 bg-[var(--console-bg)] px-2 py-3`,children:(0,G.jsxs)(`div`,{ref:r,className:`session-message-timeline relative rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] px-3 py-2.5 shadow-[var(--shadow-raised)]`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(`div`,{ref:o,id:`session-timeline-viewport`,role:`navigation`,"aria-label":`Session message timeline`,tabIndex:0,className:`session-timeline-viewport overflow-x-auto overflow-y-hidden overscroll-x-contain py-1`,onScroll:E,children:(0,G.jsx)(`div`,{ref:s,"data-testid":`session-timeline-track`,className:`${c?`relative`:`grid items-stretch ${a.gapClassName}`} h-5 w-full select-none`,style:c?{minWidth:`${a.minWidth}px`}:{gridTemplateColumns:`repeat(${e.length}, minmax(10px, 1fr))`,minWidth:`${a.minWidth}px`},onKeyDown:x,onPointerDown:S,onPointerMove:C,onPointerUp:ee,onPointerCancel:w,onClick:T,children:te.map(({entry:t,index:n})=>(0,G.jsx)(op,{entry:t,index:n,isActive:n===i,isTooltipVisible:g?.entryId===t.id,virtualized:c,entryCount:e.length,gapWidth:a.gapWidth,onShowTooltip:v,onHideTooltip:y},t.id))})}),d.left&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Scroll timeline left`,className:`absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-start bg-[linear-gradient(to_right,var(--console-surface)_55%,transparent)] pl-0.5 text-[var(--console-muted)] hover:text-[var(--console-text)] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--brand)]`,onClick:()=>m(-1),children:(0,G.jsx)(Ce,{size:14,"aria-hidden":`true`})}),d.right&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Scroll timeline right`,className:`absolute inset-y-0 right-0 z-10 flex w-8 items-center justify-end bg-[linear-gradient(to_left,var(--console-surface)_55%,transparent)] pr-0.5 text-[var(--console-muted)] hover:text-[var(--console-text)] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--brand)]`,onClick:()=>m(1),children:(0,G.jsx)(se,{size:14,"aria-hidden":`true`})})]}),f&&(0,G.jsx)(Yf,{entries:e,viewportRef:o,visibleWindow:f}),(0,G.jsx)($f,{tooltip:g,tooltipRef:_})]})})}function cp({anchorId:e,behavior:t,anchorRegistry:n,prepareAnchor:r,isCurrent:i}){if(typeof document>`u`)return;let a=td(t,window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),o=n.get(e);if(!o&&r){r();let t=0,s=()=>{if(i()){if(o=n.get(e),o){o.scrollIntoView({behavior:a,block:`center`});return}t+=1,t<8&&requestAnimationFrame(s)}};requestAnimationFrame(s);return}o&&o.scrollIntoView({behavior:a,block:`center`})}function lp(e,t){if(!ye())return t();let n=performance.now(),r=t(),i=performance.now();return C({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}function up({session:e,agentCatalog:t,highlightQuery:n,childSessions:r=[]}){let i=e.reference.agentName,a=k(t,i),o=(0,K.useMemo)(()=>lp(`SessionDetail:buildDisplayModel`,()=>Zu({messages:e.messages,agentName:i,fileActivity:e.file_activity})),[e.file_activity,e.messages,i]),{messages:s,toc:c,fileChangeSummary:l}=o,u=f(e.reference),{state:d,actions:p}=zd(c,u),[m,h]=(0,K.useState)(null),g=(0,K.useMemo)(()=>lp(`SessionDetail:selectDisplayModel`,()=>o.select(md(c,d.excluded))),[o,c,d.excluded]),{messages:_,timelineEntries:v,visibleUnitCount:y}=g,b=(0,K.useMemo)(()=>new Map(r.map(e=>[e.reference.sessionId,e])),[r]),[x]=(0,K.useState)(mf),S=(0,K.useRef)(null),C=(0,K.useRef)(0),w=(0,K.useCallback)((e,t,n)=>{let r=C.current+1;C.current=r;let i=t==null?void 0:g.resolveListIndex(t);cp({anchorId:e,behavior:n,anchorRegistry:x,prepareAnchor:i==null?void 0:()=>S.current?.scrollToIndex(i),isCurrent:()=>C.current===r})},[x,g]),T=(0,K.useCallback)((e,t)=>{w(e,o.resolveMessageIndex(e),t)},[o,w]);return s.length===0?(0,G.jsx)(`div`,{"data-testid":`session-detail`,className:`mx-auto max-w-4xl rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-6 text-sm text-[var(--console-muted)]`,children:`This session has no displayable messages.`}):(0,G.jsxs)(`div`,{"data-testid":`session-detail`,className:`mx-auto w-full max-w-[1440px] space-y-8 px-2 md:px-4`,children:[(0,G.jsx)(dp,{summary:typeof e.summary_files==`string`?e.summary_files:void 0}),(0,G.jsxs)(`div`,{className:`grid gap-6 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,G.jsx)(Bf,{toc:c,state:d,fileChangeSummary:l,onOpen:h}),(0,G.jsx)(Vf,{openPanel:m,toc:c,state:d,actions:p,visibleUnitCount:y,fileChangeSummary:l,baseDirectory:e.directory,onClose:()=>h(null),onJumpToAnchor:(e,t)=>{h(null),T(e,t)}}),(0,G.jsx)(Pd,{toc:c,state:d,actions:p,visibleUnitCount:y,fileChangeSummary:l,baseDirectory:e.directory,onJumpToAnchor:T}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:[(0,G.jsx)(Ld,{toc:c,state:d,actions:p}),_.length>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(sp,{entries:v,anchorRegistry:x,onNavigate:(e,t)=>w(e.anchorId,e.messageIndex,t)}),(0,G.jsx)(ee,{id:`MessageList`,detail:{messages:_.length,virtualized:_.length>80},children:(0,G.jsx)(Nf,{messages:_,sessionAgentKey:i,agent:a,baseDirectory:e.directory,highlightQuery:n,childSessionById:b,apiRef:S,anchorRegistry:x},u)})]}):(0,G.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-6 text-sm text-[var(--console-muted)]`,children:`No messages match the current filters.`}),(0,G.jsx)(Rd,{hiddenCount:Od(c,d),hiddenTools:Dd(c,d),onShowAll:p.resetAll})]})]}),(0,G.jsx)(Rf,{session:e,toc:c})]})}function dp({summary:e,defaultExpanded:t=!1}){let n=typeof e==`string`?e.trim():``,[r,i]=(0,K.useState)(t);return n?(0,G.jsxs)(`section`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-4 py-3 text-left`,onClick:()=>i(e=>!e),children:[(0,G.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:[(0,G.jsx)(Ee,{className:`size-3.5 text-[var(--console-accent)]`}),`Session Summary`]}),r?(0,G.jsx)(ce,{className:`size-3.5 text-[var(--console-muted)]`}):(0,G.jsx)(me,{className:`size-3.5 text-[var(--console-muted)]`})]}),r?(0,G.jsx)(`div`,{className:`border-t border-[var(--console-border)] px-4 py-4`,children:(0,G.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,G.jsx)(Os,{text:n})})}):null]}):null}export{up as SessionDetail,ft as a,ke as c,dt as i,un as n,ct as o,pt as r,Be as s,Bd as t};