@codeyam/codeyam-cli 0.1.0-staging.eb21b2f → 0.1.0-staging.fef152f

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 (71) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +13 -13
  4. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +232 -5
  5. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
  6. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
  7. package/analyzer-template/packages/aws/package.json +10 -10
  8. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  9. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +6 -2
  10. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  11. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +14 -2
  12. package/analyzer-template/project/constructMockCode.ts +32 -5
  13. package/analyzer-template/project/orchestrateCapture.ts +4 -1
  14. package/analyzer-template/project/writeScenarioComponents.ts +62 -12
  15. package/background/src/lib/virtualized/project/constructMockCode.js +28 -5
  16. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  17. package/background/src/lib/virtualized/project/orchestrateCapture.js +4 -1
  18. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  19. package/background/src/lib/virtualized/project/writeScenarioComponents.js +46 -7
  20. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  21. package/codeyam-cli/src/cli.js +31 -20
  22. package/codeyam-cli/src/cli.js.map +1 -1
  23. package/codeyam-cli/src/commands/memory.js +3 -56
  24. package/codeyam-cli/src/commands/memory.js.map +1 -1
  25. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +6 -0
  26. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -1
  27. package/codeyam-cli/src/utils/npmVersionCheck.js +2 -2
  28. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -1
  29. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +1 -1
  30. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -1
  31. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +0 -1
  32. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -1
  33. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +2 -4
  34. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -1
  35. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +84 -0
  36. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
  37. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +83 -0
  38. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
  39. package/codeyam-cli/src/utils/rules/index.js +1 -0
  40. package/codeyam-cli/src/utils/rules/index.js.map +1 -1
  41. package/codeyam-cli/src/utils/rules/pathMatcher.js +10 -0
  42. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -1
  43. package/codeyam-cli/src/utils/rules/sourceFiles.js +47 -0
  44. package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
  45. package/codeyam-cli/src/utils/simulationGateMiddleware.js +138 -0
  46. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
  47. package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
  48. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  49. package/codeyam-cli/src/utils/versionInfo.js +21 -0
  50. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  51. package/codeyam-cli/src/webserver/build/client/assets/globals-Dzl-jeq-.css +1 -0
  52. package/codeyam-cli/src/webserver/build/client/assets/labs-DAvt-sy-.js +1 -0
  53. package/codeyam-cli/src/webserver/build/client/assets/{manifest-390cb8fa.js → manifest-2d0e2ebb.js} +1 -1
  54. package/codeyam-cli/src/webserver/build/client/assets/memory-DVGtTawo.js +92 -0
  55. package/codeyam-cli/src/webserver/build/client/assets/root-Bg3WICdl.js +62 -0
  56. package/codeyam-cli/src/webserver/build/server/assets/{index-CXfuiwt3.js → index-CpreP2n8.js} +1 -1
  57. package/codeyam-cli/src/webserver/build/server/assets/server-build-DyvoFrHR.js +273 -0
  58. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  59. package/codeyam-cli/src/webserver/build-info.json +5 -5
  60. package/package.json +5 -5
  61. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +213 -3
  62. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  63. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
  64. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  65. package/packages/utils/src/lib/fs/rsyncCopy.js +6 -2
  66. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  67. package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.css +0 -1
  68. package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +0 -1
  69. package/codeyam-cli/src/webserver/build/client/assets/memory-CzZySbBE.js +0 -78
  70. package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +0 -62
  71. package/codeyam-cli/src/webserver/build/server/assets/server-build-BSvme_Ao.js +0 -259
@@ -1,78 +0,0 @@
1
- import{H as pr,j as u,r as D,w as Li,u as Di,c as Ri,f as Mi,L as zi}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as _i}from"./useReportContext-DZlYx2c4.js";import{c as Ne}from"./createLucideIcon-D1zB-pYc.js";import{T as dr,C as Xt}from"./terminal-DbEAHMbA.js";import{a as Rt,C as at}from"./copy-Coc4o_8c.js";import{C as Oi}from"./CopyButton-jNYXRRNI.js";import{S as mr}from"./search-DcAwD_Ln.js";import{F as Mt,P as Bi}from"./pause-hjzB7t2z.js";import{C as $i}from"./chevron-down-CG65viiV.js";import{B as Hi}from"./book-open-D4IPYH_y.js";/**
2
- * @license lucide-react v0.556.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Vi=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ui=Ne("eye",Vi);/**
7
- * @license lucide-react v0.556.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const qi=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Wi=Ne("folder-tree",qi);/**
12
- * @license lucide-react v0.556.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Yi=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],gr=Ne("folder",Yi);/**
17
- * @license lucide-react v0.556.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Qi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],zt=Ne("info",Qi);/**
22
- * @license lucide-react v0.556.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Xi=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ki=Ne("pencil",Xi);/**
27
- * @license lucide-react v0.556.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const Gi=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kt=Ne("plus",Gi);/**
32
- * @license lucide-react v0.556.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const Ji=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Zi=Ne("trash-2",Ji);/**
37
- * @license lucide-react v0.556.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const el=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gt=Ne("x",el);function tl(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const nl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,il={};function vn(e,n){return(il.jsx?rl:nl).test(e)}const ll=/[ \t\n\f\r]/g;function ol(e){return typeof e=="object"?e.type==="text"?jn(e.value):!1:jn(e)}function jn(e){return e.replace(ll,"")===""}class Je{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Je.prototype.normal={};Je.prototype.property={};Je.prototype.space=void 0;function xr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Je(t,r,n)}function _t(e){return e.toLowerCase()}class fe{constructor(n,t){this.attribute=t,this.property=n}}fe.prototype.attribute="";fe.prototype.booleanish=!1;fe.prototype.boolean=!1;fe.prototype.commaOrSpaceSeparated=!1;fe.prototype.commaSeparated=!1;fe.prototype.defined=!1;fe.prototype.mustUseProperty=!1;fe.prototype.number=!1;fe.prototype.overloadedBoolean=!1;fe.prototype.property="";fe.prototype.spaceSeparated=!1;fe.prototype.space=void 0;let al=0;const V=Ie(),ne=Ie(),Ot=Ie(),E=Ie(),J=Ie(),Me=Ie(),de=Ie();function Ie(){return 2**++al}const Bt=Object.freeze(Object.defineProperty({__proto__:null,boolean:V,booleanish:ne,commaOrSpaceSeparated:de,commaSeparated:Me,number:E,overloadedBoolean:Ot,spaceSeparated:J},Symbol.toStringTag,{value:"Module"})),yt=Object.keys(Bt);class Jt extends fe{constructor(n,t,r,i){let o=-1;if(super(n,t),Sn(this,"space",i),typeof r=="number")for(;++o<yt.length;){const l=yt[o];Sn(this,yt[o],(r&Bt[l])===Bt[l])}}}Jt.prototype.defined=!0;function Sn(e,n,t){t&&(e[n]=t)}function _e(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new Jt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[_t(r)]=r,t[_t(o.attribute)]=r}return new Je(n,t,e.space)}const yr=_e({properties:{ariaActiveDescendant:null,ariaAtomic:ne,ariaAutoComplete:null,ariaBusy:ne,ariaChecked:ne,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:J,ariaCurrent:null,ariaDescribedBy:J,ariaDetails:null,ariaDisabled:ne,ariaDropEffect:J,ariaErrorMessage:null,ariaExpanded:ne,ariaFlowTo:J,ariaGrabbed:ne,ariaHasPopup:null,ariaHidden:ne,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:J,ariaLevel:E,ariaLive:null,ariaModal:ne,ariaMultiLine:ne,ariaMultiSelectable:ne,ariaOrientation:null,ariaOwns:J,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:ne,ariaReadOnly:ne,ariaRelevant:null,ariaRequired:ne,ariaRoleDescription:J,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:ne,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function br(e,n){return n in e?e[n]:n}function kr(e,n){return br(e,n.toLowerCase())}const sl=_e({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Me,acceptCharset:J,accessKey:J,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:J,autoFocus:V,autoPlay:V,blocking:J,capture:null,charSet:null,checked:V,cite:null,className:J,cols:E,colSpan:null,content:null,contentEditable:ne,controls:V,controlsList:J,coords:E|Me,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:Ot,draggable:ne,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:J,height:E,hidden:Ot,high:E,href:null,hrefLang:null,htmlFor:J,httpEquiv:J,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:J,itemRef:J,itemScope:V,itemType:J,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,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:V,optimum:E,pattern:null,ping:J,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:J,required:V,reversed:V,rows:E,rowSpan:E,sandbox:J,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:ne,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:ne,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:J,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:ne,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:V,disableRemotePlayback:V,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:kr}),ul=_e({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",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:de,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:J,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:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,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:Me,g2:Me,glyphName:Me,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:de,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:E,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:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:J,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:de,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:de,rev:de,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:de,requiredFeatures:de,requiredFonts:de,requiredFormats:de,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:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:de,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:de,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:de,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:br}),wr=_e({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Cr=_e({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kr}),vr=_e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),cl={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"},hl=/[A-Z]/g,Nn=/-[a-z]/g,fl=/^data[-\w.:]+$/i;function pl(e,n){const t=_t(n);let r=n,i=fe;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&fl.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Nn,ml);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Nn.test(o)){let l=o.replace(hl,dl);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=Jt}return new i(r,n)}function dl(e){return"-"+e.toLowerCase()}function ml(e){return e.charAt(1).toUpperCase()}const gl=xr([yr,sl,wr,Cr,vr],"html"),Zt=xr([yr,ul,wr,Cr,vr],"svg");function xl(e){return e.join(" ").trim()}var Le={},bt,En;function yl(){if(En)return bt;En=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
42
- `,s="/",f="*",h="",d="comment",p="declaration";function g(C,y){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];y=y||{};var v=1,S=1;function R(A){var N=A.match(n);N&&(v+=N.length);var O=A.lastIndexOf(c);S=~O?A.length-O:S+A.length}function I(){var A={line:v,column:S};return function(N){return N.position=new w(A),$(),N}}function w(A){this.start=A,this.end={line:v,column:S},this.source=y.source}w.prototype.content=C;function _(A){var N=new Error(y.source+":"+v+":"+S+": "+A);if(N.reason=A,N.filename=y.source,N.line=v,N.column=S,N.source=C,!y.silent)throw N}function U(A){var N=A.exec(C);if(N){var O=N[0];return R(O),C=C.slice(O.length),N}}function $(){U(t)}function k(A){var N;for(A=A||[];N=F();)N!==!1&&A.push(N);return A}function F(){var A=I();if(!(s!=C.charAt(0)||f!=C.charAt(1))){for(var N=2;h!=C.charAt(N)&&(f!=C.charAt(N)||s!=C.charAt(N+1));)++N;if(N+=2,h===C.charAt(N-1))return _("End of comment missing");var O=C.slice(2,N-2);return S+=2,R(O),C=C.slice(N),S+=2,A({type:d,comment:O})}}function L(){var A=I(),N=U(r);if(N){if(F(),!U(i))return _("property missing ':'");var O=U(o),W=A({type:p,property:b(N[0].replace(e,h)),value:O?b(O[0].replace(e,h)):h});return U(l),W}}function P(){var A=[];k(A);for(var N;N=L();)N!==!1&&(A.push(N),k(A));return A}return $(),P()}function b(C){return C?C.replace(a,h):h}return bt=g,bt}var Pn;function bl(){if(Pn)return Le;Pn=1;var e=Le&&Le.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Le,"__esModule",{value:!0}),Le.default=t;const n=e(yl());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(c=>{if(c.type!=="declaration")return;const{property:s,value:f}=c;a?i(s,f,c):f&&(o=o||{},o[s]=f)}),o}return Le}var He={},An;function kl(){if(An)return He;An=1,Object.defineProperty(He,"__esModule",{value:!0}),He.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||t.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},c=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,l))};return He.camelCase=c,He}var Ve,Tn;function wl(){if(Tn)return Ve;Tn=1;var e=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(bl()),t=kl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,c){a&&c&&(l[(0,t.camelCase)(a,o)]=c)}),l}return r.default=r,Ve=r,Ve}var Cl=wl();const vl=pr(Cl),jr=Sr("end"),en=Sr("start");function Sr(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jl(e){const n=en(e),t=jr(e);if(n&&t)return{start:n,end:t}}function We(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?In(e.position):"start"in e||"end"in e?In(e):"line"in e||"column"in e?$t(e):""}function $t(e){return Fn(e&&e.line)+":"+Fn(e&&e.column)}function In(e){return $t(e&&e.start)+"-"+$t(e&&e.end)}function Fn(e){return e&&typeof e=="number"?e:1}class ae extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=We(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ae.prototype.file="";ae.prototype.name="";ae.prototype.reason="";ae.prototype.message="";ae.prototype.stack="";ae.prototype.column=void 0;ae.prototype.line=void 0;ae.prototype.ancestors=void 0;ae.prototype.cause=void 0;ae.prototype.fatal=void 0;ae.prototype.place=void 0;ae.prototype.ruleId=void 0;ae.prototype.source=void 0;const tn={}.hasOwnProperty,Sl=new Map,Nl=/[A-Z]/g,El=new Set(["table","tbody","thead","tfoot","tr"]),Pl=new Set(["td","th"]),Nr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Al(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zl(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ml(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Zt:gl,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Er(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Er(e,n,t){if(n.type==="element")return Tl(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Il(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ll(e,n,t);if(n.type==="mdxjsEsm")return Fl(e,n);if(n.type==="root")return Dl(e,n,t);if(n.type==="text")return Rl(e,n)}function Tl(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Zt,e.schema=i),e.ancestors.push(n);const o=Ar(e,n.tagName,!1),l=_l(e,n);let a=rn(e,n);return El.has(n.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!ol(c):!0})),Pr(e,l,o,n),nn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Il(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ke(e,n.position)}function Fl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ke(e,n.position)}function Ll(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Zt,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Ar(e,n.name,!0),l=Ol(e,n),a=rn(e,n);return Pr(e,l,o,n),nn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Dl(e,n,t){const r={};return nn(r,rn(e,n)),e.create(n,e.Fragment,r,t)}function Rl(e,n){return n.value}function Pr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function nn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Ml(e,n,t){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?t:n;return a?s(o,l,a):s(o,l)}}function zl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),c=en(r);return n(i,o,l,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function _l(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&tn.call(n.properties,i)){const o=Bl(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Pl.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Ol(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Ke(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Ke(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function rn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Sl;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const s=i.get(c)||0;l=c+"-"+s,i.set(c,s+1)}}const a=Er(e,o,l);a!==void 0&&t.push(a)}return t}function Bl(e,n,t){const r=pl(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?tl(t):xl(t)),r.property==="style"){let i=typeof t=="object"?t:$l(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Hl(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?cl[r.property]||r.property:r.attribute,t]}}function $l(e,n){try{return vl(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ae("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Nr+"#cannot-parse-style-attribute",i}}function Ar(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=vn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=vn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return tn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ke(e)}function Ke(e,n){const t=new ae("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Nr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Hl(e){const n={};let t;for(t in e)tn.call(e,t)&&(n[Vl(t)]=e[t]);return n}function Vl(e){let n=e.replace(Nl,Ul);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Ul(e){return"-"+e.toLowerCase()}const kt={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"]},ql={};function ln(e,n){const t=ql,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Tr(e,r,i)}function Tr(e,n,t){if(Wl(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ln(e.children,n,t)}return Array.isArray(e)?Ln(e,n,t):""}function Ln(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Tr(e[i],n,t);return r.join("")}function Wl(e){return!!(e&&typeof e=="object")}const Dn=document.createElement("i");function on(e){const n="&"+e+";";Dn.innerHTML=n;const t=Dn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function me(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function ge(e,n){return e.length>0?(me(e,e.length,0,n),e):n}const Rn={}.hasOwnProperty;function Ir(e){const n={};let t=-1;for(;++t<e.length;)Yl(n,e[t]);return n}function Yl(e,n){let t;for(t in n){const i=(Rn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){Rn.call(i,l)||(i[l]=[]);const a=o[l];Ql(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Ql(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);me(e,0,0,r)}function Fr(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=Ee(/[A-Za-z]/),oe=Ee(/[\dA-Za-z]/),Xl=Ee(/[#-'*+\--9=?A-Z^-~]/);function st(e){return e!==null&&(e<32||e===127)}const Ht=Ee(/\d/),Kl=Ee(/[\dA-Fa-f]/),Gl=Ee(/[!-/:-@[-`{-~]/);function M(e){return e!==null&&e<-2}function K(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const ft=Ee(new RegExp("\\p{P}|\\p{S}","u")),Te=Ee(/\s/);function Ee(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Oe(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&oe(e.charCodeAt(t+1))&&oe(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function Q(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(c){return q(c)?(e.enter(t),a(c)):n(c)}function a(c){return q(c)&&o++<i?(e.consume(c),a):(e.exit(t),n(c))}}const Jl={tokenize:Zl};function Zl(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Q(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const c=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=c),t=c,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return M(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const eo={tokenize:to},Mn={tokenize:no};function to(e){const n=this,t=[];let r=0,i,o,l;return a;function a(S){if(r<t.length){const R=t[r];return n.containerState=R[1],e.attempt(R[0].continuation,c,s)(S)}return s(S)}function c(S){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const R=n.events.length;let I=R,w;for(;I--;)if(n.events[I][0]==="exit"&&n.events[I][1].type==="chunkFlow"){w=n.events[I][1].end;break}y(r);let _=R;for(;_<n.events.length;)n.events[_][1].end={...w},_++;return me(n.events,I+1,0,n.events.slice(R)),n.events.length=_,s(S)}return a(S)}function s(S){if(r===t.length){if(!i)return d(S);if(i.currentConstruct&&i.currentConstruct.concrete)return g(S);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Mn,f,h)(S)}function f(S){return i&&v(),y(r),d(S)}function h(S){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(S)}function d(S){return n.containerState={},e.attempt(Mn,p,g)(S)}function p(S){return r++,t.push([n.currentConstruct,n.containerState]),d(S)}function g(S){if(S===null){i&&v(),y(0),e.consume(S);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(S)}function b(S){if(S===null){C(e.exit("chunkFlow"),!0),y(0),e.consume(S);return}return M(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(S),b)}function C(S,R){const I=n.sliceStream(S);if(R&&I.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(I),n.parser.lazy[S.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const _=n.events.length;let U=_,$,k;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if($){k=n.events[U][1].end;break}$=!0}for(y(r),w=_;w<n.events.length;)n.events[w][1].end={...k},w++;me(n.events,U+1,0,n.events.slice(_)),n.events.length=w}}function y(S){let R=t.length;for(;R-- >S;){const I=t[R];n.containerState=I[1],I[0].exit.call(n,e)}t.length=S}function v(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function no(e,n,t){return Q(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ze(e){if(e===null||K(e)||Te(e))return 1;if(ft(e))return 2}function pt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const Vt={name:"attention",resolveAll:ro,tokenize:io};function ro(e,n){let t=-1,r,i,o,l,a,c,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const h={...e[r][1].end},d={...e[t][1].start};zn(h,-c),zn(d,c),l={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:c>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ge(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=ge(s,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),s=ge(s,pt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=ge(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=ge(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,me(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function io(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ze(r);let o;return l;function l(c){return o=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===o)return e.consume(c),a;const s=e.exit("attentionSequence"),f=ze(c),h=!f||f===2&&i||t.includes(c),d=!i||i===2&&f||t.includes(r);return s._open=!!(o===42?h:h&&(i||!d)),s._close=!!(o===42?d:d&&(f||!h)),n(c)}}function zn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const lo={name:"autolink",tokenize:oo};function oo(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return ue(p)?(e.consume(p),l):p===64?t(p):s(p)}function l(p){return p===43||p===45||p===46||oe(p)?(r=1,a(p)):s(p)}function a(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||oe(p))&&r++<32?(e.consume(p),a):(r=0,s(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||st(p)?t(p):(e.consume(p),c)}function s(p){return p===64?(e.consume(p),f):Xl(p)?(e.consume(p),s):t(p)}function f(p){return oe(p)?h(p):t(p)}function h(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):d(p)}function d(p){if((p===45||oe(p))&&r++<63){const g=p===45?d:h;return e.consume(p),g}return t(p)}}const Ze={partial:!0,tokenize:ao};function ao(e,n,t){return r;function r(o){return q(o)?Q(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||M(o)?n(o):t(o)}}const Lr={continuation:{tokenize:uo},exit:co,name:"blockQuote",tokenize:so};function so(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return q(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function uo(e,n,t){const r=this;return i;function i(l){return q(l)?Q(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Lr,n,t)(l)}}function co(e){e.exit("blockQuote")}const Dr={name:"characterEscape",tokenize:ho};function ho(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Gl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const Rr={name:"characterReference",tokenize:fo};function fo(e,n,t){const r=this;let i=0,o,l;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=oe,f(h))}function s(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Kl,f):(e.enter("characterReferenceValue"),o=7,l=Ht,f(h))}function f(h){if(h===59&&i){const d=e.exit("characterReferenceValue");return l===oe&&!on(r.sliceSerialize(d))?t(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(h)&&i++<o?(e.consume(h),f):t(h)}}const _n={partial:!0,tokenize:mo},On={concrete:!0,name:"codeFenced",tokenize:po};function po(e,n,t){const r=this,i={partial:!0,tokenize:I};let o=0,l=0,a;return c;function c(w){return s(w)}function s(w){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(l++,e.consume(w),f):l<3?t(w):(e.exit("codeFencedFenceSequence"),q(w)?Q(e,h,"whitespace")(w):h(w))}function h(w){return w===null||M(w)?(e.exit("codeFencedFence"),r.interrupt?n(w):e.check(_n,b,R)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||M(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(w)):q(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Q(e,p,"whitespace")(w)):w===96&&w===a?t(w):(e.consume(w),d)}function p(w){return w===null||M(w)?h(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||M(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(w)):w===96&&w===a?t(w):(e.consume(w),g)}function b(w){return e.attempt(i,R,C)(w)}function C(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return o>0&&q(w)?Q(e,v,"linePrefix",o+1)(w):v(w)}function v(w){return w===null||M(w)?e.check(_n,b,R)(w):(e.enter("codeFlowValue"),S(w))}function S(w){return w===null||M(w)?(e.exit("codeFlowValue"),v(w)):(e.consume(w),S)}function R(w){return e.exit("codeFenced"),n(w)}function I(w,_,U){let $=0;return k;function k(N){return w.enter("lineEnding"),w.consume(N),w.exit("lineEnding"),F}function F(N){return w.enter("codeFencedFence"),q(N)?Q(w,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):L(N)}function L(N){return N===a?(w.enter("codeFencedFenceSequence"),P(N)):U(N)}function P(N){return N===a?($++,w.consume(N),P):$>=l?(w.exit("codeFencedFenceSequence"),q(N)?Q(w,A,"whitespace")(N):A(N)):U(N)}function A(N){return N===null||M(N)?(w.exit("codeFencedFence"),_(N)):U(N)}}}function mo(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const wt={name:"codeIndented",tokenize:xo},go={partial:!0,tokenize:yo};function xo(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),Q(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?c(s):M(s)?e.attempt(go,l,c)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||M(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function c(s){return e.exit("codeIndented"),n(s)}}function yo(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):M(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Q(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):M(l)?i(l):t(l)}}const bo={name:"codeText",previous:wo,resolve:ko,tokenize:Co};function ko(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||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),n-=r-i-2,r=i+2),i=void 0);return e}function wo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Co(e,n,t){let r=0,i,o;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?t(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(o=e.enter("codeTextSequence"),i=0,f(h)):M(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),s(h))}function s(h){return h===null||h===32||h===96||M(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),s)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(h)):(o.type="codeTextData",s(h))}}class vo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ue(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Ue(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ue(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Ue(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ue(this.left,t.reverse())}}}function Ue(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Mr(e){const n={};let t=-1,r,i,o,l,a,c,s;const f=new vo(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,jo(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return me(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function jo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,c=[],s={};let f,h,d=-1,p=t,g=0,b=0;const C=[b];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),h&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(b=d+1,C.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),d=C.length;d--;){const y=a.slice(C[d],C[d+1]),v=o.pop();c.push([v,v+y.length-1]),e.splice(v,2,y)}for(c.reverse(),d=-1;++d<c.length;)s[g+c[d][0]]=g+c[d][1],g+=c[d][1]-c[d][0]-1;return s}const So={resolve:Eo,tokenize:Po},No={partial:!0,tokenize:Ao};function Eo(e){return Mr(e),e}function Po(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):M(a)?e.check(No,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Ao(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Q(e,o,"linePrefix")}function o(l){if(l===null||M(l))return t(l);const 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?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function zr(e,n,t,r,i,o,l,a,c){const s=c||Number.POSITIVE_INFINITY;let f=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),d):y===null||y===32||y===41||st(y)?t(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(y))}function d(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),d(y)):y===null||y===60||M(y)?t(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!f&&(y===null||y===41||K(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(y)):f<s&&y===40?(e.consume(y),f++,b):y===41?(e.consume(y),f--,b):y===null||y===32||y===40||st(y)?t(y):(e.consume(y),y===92?C:b)}function C(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function _r(e,n,t,r,i,o){const l=this;let a=0,c;return s;function s(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),f}function f(p){return a>999||p===null||p===91||p===93&&!c||p===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):M(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||M(p)||a++>999?(e.exit("chunkString"),f(p)):(e.consume(p),c||(c=!q(p)),p===92?d:h)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function Or(e,n,t,r,i,o){let l;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),l=d===40?41:d,c):t(d)}function c(d){return d===l?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(o),s(d))}function s(d){return d===l?(e.exit(o),c(l)):d===null?t(d):M(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Q(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===l||d===null||M(d)?(e.exit("chunkString"),s(d)):(e.consume(d),d===92?h:f)}function h(d){return d===l||d===92?(e.consume(d),f):f(d)}}function Ye(e,n){let t;return r;function r(i){return M(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):q(i)?Q(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const To={name:"definition",tokenize:Fo},Io={partial:!0,tokenize:Lo};function Fo(e,n,t){const r=this;let i;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return _r.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):t(p)}function c(p){return K(p)?Ye(e,s)(p):s(p)}function s(p){return zr(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Io,h,h)(p)}function h(p){return q(p)?Q(e,d,"whitespace")(p):d(p)}function d(p){return p===null||M(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Lo(e,n,t){return r;function r(a){return K(a)?Ye(e,i)(a):t(a)}function i(a){return Or(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return q(a)?Q(e,l,"whitespace")(a):l(a)}function l(a){return a===null||M(a)?n(a):t(a)}}const Do={name:"hardBreakEscape",tokenize:Ro};function Ro(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return M(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Mo={name:"headingAtx",resolve:zo,tokenize:_o};function zo(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},me(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function _o(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||K(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||M(f)?(e.exit("atxHeading"),n(f)):q(f)?Q(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||K(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Oo=["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"],Bn=["pre","script","style","textarea"],Bo={concrete:!0,name:"htmlFlow",resolveTo:Vo,tokenize:Uo},$o={partial:!0,tokenize:Wo},Ho={partial:!0,tokenize:qo};function Vo(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Uo(e,n,t){const r=this;let i,o,l,a,c;return s;function s(m){return f(m)}function f(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),h}function h(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),o=!0,b):m===63?(e.consume(m),i=3,r.interrupt?n:x):ue(m)?(e.consume(m),l=String.fromCharCode(m),C):t(m)}function d(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,g):ue(m)?(e.consume(m),i=4,r.interrupt?n:x):t(m)}function p(m){return m===45?(e.consume(m),r.interrupt?n:x):t(m)}function g(m){const re="CDATA[";return m===re.charCodeAt(a++)?(e.consume(m),a===re.length?r.interrupt?n:L:g):t(m)}function b(m){return ue(m)?(e.consume(m),l=String.fromCharCode(m),C):t(m)}function C(m){if(m===null||m===47||m===62||K(m)){const re=m===47,ce=l.toLowerCase();return!re&&!o&&Bn.includes(ce)?(i=1,r.interrupt?n(m):L(m)):Oo.includes(l.toLowerCase())?(i=6,re?(e.consume(m),y):r.interrupt?n(m):L(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):o?v(m):S(m))}return m===45||oe(m)?(e.consume(m),l+=String.fromCharCode(m),C):t(m)}function y(m){return m===62?(e.consume(m),r.interrupt?n:L):t(m)}function v(m){return q(m)?(e.consume(m),v):k(m)}function S(m){return m===47?(e.consume(m),k):m===58||m===95||ue(m)?(e.consume(m),R):q(m)?(e.consume(m),S):k(m)}function R(m){return m===45||m===46||m===58||m===95||oe(m)?(e.consume(m),R):I(m)}function I(m){return m===61?(e.consume(m),w):q(m)?(e.consume(m),I):S(m)}function w(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),c=m,_):q(m)?(e.consume(m),w):U(m)}function _(m){return m===c?(e.consume(m),c=null,$):m===null||M(m)?t(m):(e.consume(m),_)}function U(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||K(m)?I(m):(e.consume(m),U)}function $(m){return m===47||m===62||q(m)?S(m):t(m)}function k(m){return m===62?(e.consume(m),F):t(m)}function F(m){return m===null||M(m)?L(m):q(m)?(e.consume(m),F):t(m)}function L(m){return m===45&&i===2?(e.consume(m),O):m===60&&i===1?(e.consume(m),W):m===62&&i===4?(e.consume(m),le):m===63&&i===3?(e.consume(m),x):m===93&&i===5?(e.consume(m),ee):M(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check($o,te,P)(m)):m===null||M(m)?(e.exit("htmlFlowData"),P(m)):(e.consume(m),L)}function P(m){return e.check(Ho,A,te)(m)}function A(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),N}function N(m){return m===null||M(m)?P(m):(e.enter("htmlFlowData"),L(m))}function O(m){return m===45?(e.consume(m),x):L(m)}function W(m){return m===47?(e.consume(m),l="",Z):L(m)}function Z(m){if(m===62){const re=l.toLowerCase();return Bn.includes(re)?(e.consume(m),le):L(m)}return ue(m)&&l.length<8?(e.consume(m),l+=String.fromCharCode(m),Z):L(m)}function ee(m){return m===93?(e.consume(m),x):L(m)}function x(m){return m===62?(e.consume(m),le):m===45&&i===2?(e.consume(m),x):L(m)}function le(m){return m===null||M(m)?(e.exit("htmlFlowData"),te(m)):(e.consume(m),le)}function te(m){return e.exit("htmlFlow"),n(m)}}function qo(e,n,t){const r=this;return i;function i(l){return M(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Wo(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Yo={name:"htmlText",tokenize:Qo};function Qo(e,n,t){const r=this;let i,o,l;return a;function a(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),s):x===47?(e.consume(x),I):x===63?(e.consume(x),S):ue(x)?(e.consume(x),U):t(x)}function s(x){return x===45?(e.consume(x),f):x===91?(e.consume(x),o=0,g):ue(x)?(e.consume(x),v):t(x)}function f(x){return x===45?(e.consume(x),p):t(x)}function h(x){return x===null?t(x):x===45?(e.consume(x),d):M(x)?(l=h,W(x)):(e.consume(x),h)}function d(x){return x===45?(e.consume(x),p):h(x)}function p(x){return x===62?O(x):x===45?d(x):h(x)}function g(x){const le="CDATA[";return x===le.charCodeAt(o++)?(e.consume(x),o===le.length?b:g):t(x)}function b(x){return x===null?t(x):x===93?(e.consume(x),C):M(x)?(l=b,W(x)):(e.consume(x),b)}function C(x){return x===93?(e.consume(x),y):b(x)}function y(x){return x===62?O(x):x===93?(e.consume(x),y):b(x)}function v(x){return x===null||x===62?O(x):M(x)?(l=v,W(x)):(e.consume(x),v)}function S(x){return x===null?t(x):x===63?(e.consume(x),R):M(x)?(l=S,W(x)):(e.consume(x),S)}function R(x){return x===62?O(x):S(x)}function I(x){return ue(x)?(e.consume(x),w):t(x)}function w(x){return x===45||oe(x)?(e.consume(x),w):_(x)}function _(x){return M(x)?(l=_,W(x)):q(x)?(e.consume(x),_):O(x)}function U(x){return x===45||oe(x)?(e.consume(x),U):x===47||x===62||K(x)?$(x):t(x)}function $(x){return x===47?(e.consume(x),O):x===58||x===95||ue(x)?(e.consume(x),k):M(x)?(l=$,W(x)):q(x)?(e.consume(x),$):O(x)}function k(x){return x===45||x===46||x===58||x===95||oe(x)?(e.consume(x),k):F(x)}function F(x){return x===61?(e.consume(x),L):M(x)?(l=F,W(x)):q(x)?(e.consume(x),F):$(x)}function L(x){return x===null||x===60||x===61||x===62||x===96?t(x):x===34||x===39?(e.consume(x),i=x,P):M(x)?(l=L,W(x)):q(x)?(e.consume(x),L):(e.consume(x),A)}function P(x){return x===i?(e.consume(x),i=void 0,N):x===null?t(x):M(x)?(l=P,W(x)):(e.consume(x),P)}function A(x){return x===null||x===34||x===39||x===60||x===61||x===96?t(x):x===47||x===62||K(x)?$(x):(e.consume(x),A)}function N(x){return x===47||x===62||K(x)?$(x):t(x)}function O(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),n):t(x)}function W(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Z}function Z(x){return q(x)?Q(e,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):ee(x)}function ee(x){return e.enter("htmlTextData"),l(x)}}const an={name:"labelEnd",resolveAll:Jo,resolveTo:Zo,tokenize:ea},Xo={tokenize:ta},Ko={tokenize:na},Go={tokenize:ra};function Jo(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&me(e,0,e.length,t),e}function Zo(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const c={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",c,n],["enter",s,n]],a=ge(a,e.slice(o+1,o+r+3)),a=ge(a,[["enter",f,n]]),a=ge(a,pt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=ge(a,[["exit",f,n],e[l-2],e[l-1],["exit",s,n]]),a=ge(a,e.slice(l+1)),a=ge(a,[["exit",c,n]]),me(e,o,e.length,a),e}function ea(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(d){return o?o._inactive?h(d):(l=r.parser.defined.includes(ye(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),c):t(d)}function c(d){return d===40?e.attempt(Xo,f,l?f:h)(d):d===91?e.attempt(Ko,f,l?s:h)(d):l?f(d):h(d)}function s(d){return e.attempt(Go,f,h)(d)}function f(d){return n(d)}function h(d){return o._balanced=!0,t(d)}}function ta(e,n,t){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return K(h)?Ye(e,o)(h):o(h)}function o(h){return h===41?f(h):zr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return K(h)?Ye(e,c)(h):f(h)}function a(h){return t(h)}function c(h){return h===34||h===39||h===40?Or(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function s(h){return K(h)?Ye(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),n):t(h)}}function na(e,n,t){const r=this;return i;function i(a){return _r.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function ra(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ia={name:"labelStartImage",resolveAll:an.resolveAll,tokenize:la};function la(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const oa={name:"labelStartLink",resolveAll:an.resolveAll,tokenize:aa};function aa(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Ct={name:"lineEnding",tokenize:sa};function sa(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Q(e,n,"linePrefix")}}const ot={name:"thematicBreak",tokenize:ua};function ua(e,n,t){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),c(s)):r>=3&&(s===null||M(s))?(e.exit("thematicBreak"),n(s)):t(s)}function c(s){return s===i?(e.consume(s),r++,c):(e.exit("thematicBreakSequence"),q(s)?Q(e,a,"whitespace")(s):a(s))}}const he={continuation:{tokenize:pa},exit:ma,name:"list",tokenize:fa},ca={partial:!0,tokenize:ga},ha={partial:!0,tokenize:da};function fa(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ht(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ot,t,s)(p):s(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return t(p)}function c(p){return Ht(p)&&++l<10?(e.consume(p),c):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),s(p)):t(p)}function s(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ze,r.interrupt?t:f,e.attempt(ca,d,h))}function f(p){return r.containerState.initialBlankLine=!0,o++,d(p)}function h(p){return q(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function pa(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ha,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(he,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function da(e,n,t){const r=this;return Q(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function ma(e){e.exit(this.containerState.type)}function ga(e,n,t){const r=this;return Q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const $n={name:"setextUnderline",resolveTo:xa,tokenize:ya};function xa(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function ya(e,n,t){const r=this;let i;return o;function o(s){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=s,l(s)):t(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),q(s)?Q(e,c,"lineSuffix")(s):c(s))}function c(s){return s===null||M(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const ba={tokenize:ka};function ka(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(So,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const wa={resolveAll:$r()},Ca=Br("string"),va=Br("text");function Br(e){return{resolveAll:$r(e==="text"?ja:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),c}function c(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),c)}function s(f){if(f===null)return!0;const h=i[f];let d=-1;if(h)for(;++d<h.length;){const p=h[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function $r(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function ja(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,c;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)c=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Sa={42:he,43:he,45:he,48:he,49:he,50:he,51:he,52:he,53:he,54:he,55:he,56:he,57:he,62:Lr},Na={91:To},Ea={[-2]:wt,[-1]:wt,32:wt},Pa={35:Mo,42:ot,45:[$n,ot],60:Bo,61:$n,95:ot,96:On,126:On},Aa={38:Rr,92:Dr},Ta={[-5]:Ct,[-4]:Ct,[-3]:Ct,33:ia,38:Rr,42:Vt,60:[lo,Yo],91:oa,92:[Do,Dr],93:an,95:Vt,96:bo},Ia={null:[Vt,wa]},Fa={null:[42,95]},La={null:[]},Da=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Fa,contentInitial:Na,disable:La,document:Sa,flow:Pa,flowInitial:Ea,insideSpan:Ia,string:Aa,text:Ta},Symbol.toStringTag,{value:"Module"}));function Ra(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const c={attempt:_(I),check:_(w),consume:v,enter:S,exit:R,interrupt:_(w,{interrupt:!0})},s={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:e,previous:null,sliceSerialize:d,sliceStream:p,write:h};let f=n.tokenize.call(s,c);return n.resolveAll&&o.push(n),s;function h(F){return l=ge(l,F),C(),l[l.length-1]!==null?[]:(U(n,0),s.events=pt(o,s.events,s),s.events)}function d(F,L){return za(p(F),L)}function p(F){return Ma(l,F)}function g(){const{_bufferIndex:F,_index:L,line:P,column:A,offset:N}=r;return{_bufferIndex:F,_index:L,line:P,column:A,offset:N}}function b(F){i[F.line]=F.column,k()}function C(){let F;for(;r._index<l.length;){const L=l[r._index];if(typeof L=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<L.length;)y(L.charCodeAt(r._bufferIndex));else y(L)}}function y(F){f=f(F)}function v(F){M(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,k()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=F}function S(F,L){const P=L||{};return P.type=F,P.start=g(),s.events.push(["enter",P,s]),a.push(P),P}function R(F){const L=a.pop();return L.end=g(),s.events.push(["exit",L,s]),L}function I(F,L){U(F,L.from)}function w(F,L){L.restore()}function _(F,L){return P;function P(A,N,O){let W,Z,ee,x;return Array.isArray(A)?te(A):"tokenize"in A?te([A]):le(A);function le(ie){return z;function z(H){const G=H!==null&&ie[H],se=H!==null&&ie.null,be=[...Array.isArray(G)?G:G?[G]:[],...Array.isArray(se)?se:se?[se]:[]];return te(be)(H)}}function te(ie){return W=ie,Z=0,ie.length===0?O:m(ie[Z])}function m(ie){return z;function z(H){return x=$(),ee=ie,ie.partial||(s.currentConstruct=ie),ie.name&&s.parser.constructs.disable.null.includes(ie.name)?ce():ie.tokenize.call(L?Object.assign(Object.create(s),L):s,c,re,ce)(H)}}function re(ie){return F(ee,x),N}function ce(ie){return x.restore(),++Z<W.length?m(W[Z]):O}}}function U(F,L){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&me(s.events,L,s.events.length-L,F.resolve(s.events.slice(L),s)),F.resolveTo&&(s.events=F.resolveTo(s.events,s))}function $(){const F=g(),L=s.previous,P=s.currentConstruct,A=s.events.length,N=Array.from(a);return{from:A,restore:O};function O(){r=F,s.previous=L,s.currentConstruct=P,s.events.length=A,a=N,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ma(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function za(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
43
- `;break}case-3:{l=`\r
44
- `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function _a(e){const r={constructs:Ir([Da,...(e||{}).extensions||[]]),content:i(Jl),defined:[],document:i(eo),flow:i(ba),lazy:{},string:i(Ca),text:i(va)};return r;function i(o){return l;function l(a){return Ra(r,o,a)}}}function Oa(e){for(;!Mr(e););return e}const Hn=/[\0\t\n\r]/g;function Ba(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const c=[];let s,f,h,d,p;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),h=0,n="",t&&(o.charCodeAt(0)===65279&&h++,t=void 0);h<o.length;){if(Hn.lastIndex=h,s=Hn.exec(o),d=s&&s.index!==void 0?s.index:o.length,p=o.charCodeAt(d),!s){n=o.slice(h);break}if(p===10&&h===d&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<d&&(c.push(o.slice(h,d)),e+=d-h),p){case 0:{c.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,c.push(-2);e++<f;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=d+1}return a&&(r&&c.push(-5),n&&c.push(n),c.push(null)),c}}const $a=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ha(e){return e.replace($a,Va)}function Va(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return Fr(t.slice(o?2:1),o?16:10)}return on(t)||e}const Hr={}.hasOwnProperty;function Ua(e,n,t){return typeof n!="string"&&(t=n,n=void 0),qa(t)(Oa(_a(t).document().write(Ba()(e,n,!0))))}function qa(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(wn),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(yn),blockQuote:o(se),characterEscape:$,characterReference:$,codeFenced:o(be),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(be,l),codeText:o(ji,l),codeTextData:$,data:$,codeFlowValue:$,definition:o(Si),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Ni),hardBreakEscape:o(bn),hardBreakTrailing:o(bn),htmlFlow:o(kn,l),htmlFlowData:$,htmlText:o(kn,l),htmlTextData:$,image:o(Ei),label:l,link:o(wn),listItem:o(Pi),listItemValue:d,listOrdered:o(Cn,h),listUnordered:o(Cn),paragraph:o(Ai),reference:m,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(yn),strong:o(Ti),thematicBreak:o(Fi)},exit:{atxHeading:c(),atxHeadingSequence:I,autolink:c(),autolinkEmail:G,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:ie,characterReference:z,codeFenced:c(C),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:k,codeIndented:c(y),codeText:c(N),codeTextData:k,data:k,definition:c(),definitionDestinationString:R,definitionLabelString:v,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(L),hardBreakTrailing:c(L),htmlFlow:c(P),htmlFlowData:k,htmlText:c(A),htmlTextData:k,image:c(W),label:ee,labelText:Z,lineEnding:F,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:x,resourceTitleString:le,resource:te,setextHeading:c(U),setextHeadingLineSequence:_,setextHeadingText:w,strong:c(),thematicBreak:c()}};Vr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(j){let T={type:"root",children:[]};const B={stack:[T],tokenStack:[],config:n,enter:a,exit:s,buffer:l,resume:f,data:t},Y=[];let X=-1;for(;++X<j.length;)if(j[X][1].type==="listOrdered"||j[X][1].type==="listUnordered")if(j[X][0]==="enter")Y.push(X);else{const xe=Y.pop();X=i(j,xe,X)}for(X=-1;++X<j.length;){const xe=n[j[X][0]];Hr.call(xe,j[X][1].type)&&xe[j[X][1].type].call(Object.assign({sliceSerialize:j[X][2].sliceSerialize},B),j[X][1])}if(B.tokenStack.length>0){const xe=B.tokenStack[B.tokenStack.length-1];(xe[1]||Vn).call(B,void 0,xe[0])}for(T.position={start:Se(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:Se(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},X=-1;++X<n.transforms.length;)T=n.transforms[X](T)||T;return T}function i(j,T,B){let Y=T-1,X=-1,xe=!1,Pe,Ce,Be,$e;for(;++Y<=B;){const pe=j[Y];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?X++:X--,$e=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(Pe&&!$e&&!X&&!Be&&(Be=Y),$e=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$e=void 0}if(!X&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||X===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(Pe){let Fe=Y;for(Ce=void 0;Fe--;){const ve=j[Fe];if(ve[1].type==="lineEnding"||ve[1].type==="lineEndingBlank"){if(ve[0]==="exit")continue;Ce&&(j[Ce][1].type="lineEndingBlank",xe=!0),ve[1].type="lineEnding",Ce=Fe}else if(!(ve[1].type==="linePrefix"||ve[1].type==="blockQuotePrefix"||ve[1].type==="blockQuotePrefixWhitespace"||ve[1].type==="blockQuoteMarker"||ve[1].type==="listItemIndent"))break}Be&&(!Ce||Be<Ce)&&(Pe._spread=!0),Pe.end=Object.assign({},Ce?j[Ce][1].start:pe[1].end),j.splice(Ce||Y,0,["exit",Pe,pe[2]]),Y++,B++}if(pe[1].type==="listItemPrefix"){const Fe={type:"listItem",_spread:!1,start:Object.assign({},pe[1].start),end:void 0};Pe=Fe,j.splice(Y,0,["enter",Fe,pe[2]]),Y++,B++,Be=void 0,$e=!0}}}return j[T][1]._spread=xe,B}function o(j,T){return B;function B(Y){a.call(this,j(Y),Y),T&&T.call(this,Y)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(j,T,B){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([T,B||void 0]),j.position={start:Se(T.start),end:void 0}}function c(j){return T;function T(B){j&&j.call(this,B),s.call(this,B)}}function s(j,T){const B=this.stack.pop(),Y=this.tokenStack.pop();if(Y)Y[0].type!==j.type&&(T?T.call(this,j,Y[0]):(Y[1]||Vn).call(this,j,Y[0]));else throw new Error("Cannot close `"+j.type+"` ("+We({start:j.start,end:j.end})+"): it’s not open");B.position.end=Se(j.end)}function f(){return ln(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function d(j){if(this.data.expectingFirstListItemValue){const T=this.stack[this.stack.length-2];T.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function p(){const j=this.resume(),T=this.stack[this.stack.length-1];T.lang=j}function g(){const j=this.resume(),T=this.stack[this.stack.length-1];T.meta=j}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const j=this.resume(),T=this.stack[this.stack.length-1];T.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const j=this.resume(),T=this.stack[this.stack.length-1];T.value=j.replace(/(\r?\n|\r)$/g,"")}function v(j){const T=this.resume(),B=this.stack[this.stack.length-1];B.label=T,B.identifier=ye(this.sliceSerialize(j)).toLowerCase()}function S(){const j=this.resume(),T=this.stack[this.stack.length-1];T.title=j}function R(){const j=this.resume(),T=this.stack[this.stack.length-1];T.url=j}function I(j){const T=this.stack[this.stack.length-1];if(!T.depth){const B=this.sliceSerialize(j).length;T.depth=B}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(j){const T=this.stack[this.stack.length-1];T.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function $(j){const B=this.stack[this.stack.length-1].children;let Y=B[B.length-1];(!Y||Y.type!=="text")&&(Y=Ii(),Y.position={start:Se(j.start),end:void 0},B.push(Y)),this.stack.push(Y)}function k(j){const T=this.stack.pop();T.value+=this.sliceSerialize(j),T.position.end=Se(j.end)}function F(j){const T=this.stack[this.stack.length-1];if(this.data.atHardBreak){const B=T.children[T.children.length-1];B.position.end=Se(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(T.type)&&($.call(this,j),k.call(this,j))}function L(){this.data.atHardBreak=!0}function P(){const j=this.resume(),T=this.stack[this.stack.length-1];T.value=j}function A(){const j=this.resume(),T=this.stack[this.stack.length-1];T.value=j}function N(){const j=this.resume(),T=this.stack[this.stack.length-1];T.value=j}function O(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=T,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function W(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const T=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=T,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function Z(j){const T=this.sliceSerialize(j),B=this.stack[this.stack.length-2];B.label=Ha(T),B.identifier=ye(T).toLowerCase()}function ee(){const j=this.stack[this.stack.length-1],T=this.resume(),B=this.stack[this.stack.length-1];if(this.data.inReference=!0,B.type==="link"){const Y=j.children;B.children=Y}else B.alt=T}function x(){const j=this.resume(),T=this.stack[this.stack.length-1];T.url=j}function le(){const j=this.resume(),T=this.stack[this.stack.length-1];T.title=j}function te(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function re(j){const T=this.resume(),B=this.stack[this.stack.length-1];B.label=T,B.identifier=ye(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function ce(j){this.data.characterReferenceType=j.type}function ie(j){const T=this.sliceSerialize(j),B=this.data.characterReferenceType;let Y;B?(Y=Fr(T,B==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Y=on(T);const X=this.stack[this.stack.length-1];X.value+=Y}function z(j){const T=this.stack.pop();T.position.end=Se(j.end)}function H(j){k.call(this,j);const T=this.stack[this.stack.length-1];T.url=this.sliceSerialize(j)}function G(j){k.call(this,j);const T=this.stack[this.stack.length-1];T.url="mailto:"+this.sliceSerialize(j)}function se(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function ji(){return{type:"inlineCode",value:""}}function Si(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ni(){return{type:"emphasis",children:[]}}function yn(){return{type:"heading",depth:0,children:[]}}function bn(){return{type:"break"}}function kn(){return{type:"html",value:""}}function Ei(){return{type:"image",title:null,url:"",alt:null}}function wn(){return{type:"link",title:null,url:"",children:[]}}function Cn(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function Pi(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function Ai(){return{type:"paragraph",children:[]}}function Ti(){return{type:"strong",children:[]}}function Ii(){return{type:"text",value:""}}function Fi(){return{type:"thematicBreak"}}}function Se(e){return{line:e.line,column:e.column,offset:e.offset}}function Vr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Vr(e,r):Wa(e,r)}}function Wa(e,n){let t;for(t in n)if(Hr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function Vn(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+We({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is still open")}function Ya(e){const n=this;n.parser=t;function t(r){return Ua(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Qa(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Xa(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
45
- `}]}function Ka(e,n){const t=n.value?n.value+`
46
- `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function Ga(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ja(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Za(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Oe(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,c);const s={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,s),e.applyData(n,s)}function es(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ts(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Ur(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function ns(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Ur(e,n);const i={src:Oe(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function rs(e,n){const t={src:Oe(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function is(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function ls(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Ur(e,n);const i={href:Oe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function os(e,n){const t={href:Oe(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function as(e,n,t){const r=e.all(n),i=t?ss(t):qr(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
47
- `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value:`
48
- `});const s={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,s),e.applyData(n,s)}function ss(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=qr(t[r])}return n}function qr(e){const n=e.spread;return n??e.children.length>1}function us(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function cs(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function hs(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function fs(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ps(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=en(n.children[1]),c=jr(n.children[n.children.length-1]);a&&c&&(l.position={start:a,end:c}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function ds(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let c=-1;const s=[];for(;++c<a;){const h=n.children[c],d={},p=l?l[c]:void 0;p&&(d.align=p);let g={type:"element",tagName:o,properties:d,children:[]};h&&(g.children=e.all(h),e.patch(h,g),g=e.applyData(h,g)),s.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(n,f),e.applyData(n,f)}function ms(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Un=9,qn=32;function gs(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(Wn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(Wn(n.slice(i),i>0,!1)),o.join("")}function Wn(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===Un||o===qn;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===Un||o===qn;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function xs(e,n){const t={type:"text",value:gs(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function ys(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const bs={blockquote:Qa,break:Xa,code:Ka,delete:Ga,emphasis:Ja,footnoteReference:Za,heading:es,html:ts,imageReference:ns,image:rs,inlineCode:is,linkReference:ls,link:os,listItem:as,list:us,paragraph:cs,root:hs,strong:fs,table:ps,tableCell:ms,tableRow:ds,text:xs,thematicBreak:ys,toml:tt,yaml:tt,definition:tt,footnoteDefinition:tt};function tt(){}const Wr=-1,dt=0,Qe=1,ut=2,sn=3,un=4,cn=5,hn=6,Yr=7,Qr=8,Yn=typeof self=="object"?self:globalThis,ks=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case dt:case Wr:return t(l,i);case Qe:{const a=t([],i);for(const c of l)a.push(r(c));return a}case ut:{const a=t({},i);for(const[c,s]of l)a[r(c)]=r(s);return a}case sn:return t(new Date(l),i);case un:{const{source:a,flags:c}=l;return t(new RegExp(a,c),i)}case cn:{const a=t(new Map,i);for(const[c,s]of l)a.set(r(c),r(s));return a}case hn:{const a=t(new Set,i);for(const c of l)a.add(r(c));return a}case Yr:{const{name:a,message:c}=l;return t(new Yn[a](c),i)}case Qr:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new Yn[o](l),i)};return r},Qn=e=>ks(new Map,e)(0),De="",{toString:ws}={},{keys:Cs}=Object,qe=e=>{const n=typeof e;if(n!=="object"||!e)return[dt,n];const t=ws.call(e).slice(8,-1);switch(t){case"Array":return[Qe,De];case"Object":return[ut,De];case"Date":return[sn,De];case"RegExp":return[un,De];case"Map":return[cn,De];case"Set":return[hn,De];case"DataView":return[Qe,t]}return t.includes("Array")?[Qe,t]:t.includes("Error")?[Yr,t]:[ut,t]},nt=([e,n])=>e===dt&&(n==="function"||n==="symbol"),vs=(e,n,t,r)=>{const i=(l,a)=>{const c=r.push(l)-1;return t.set(a,c),c},o=l=>{if(t.has(l))return t.get(l);let[a,c]=qe(l);switch(a){case dt:{let f=l;switch(c){case"bigint":a=Qr,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return i([Wr],l)}return i([a,f],l)}case Qe:{if(c){let d=l;return c==="DataView"?d=new Uint8Array(l.buffer):c==="ArrayBuffer"&&(d=new Uint8Array(l)),i([c,[...d]],l)}const f=[],h=i([a,f],l);for(const d of l)f.push(o(d));return h}case ut:{if(c)switch(c){case"BigInt":return i([c,l.toString()],l);case"Boolean":case"Number":case"String":return i([c,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],h=i([a,f],l);for(const d of Cs(l))(e||!nt(qe(l[d])))&&f.push([o(d),o(l[d])]);return h}case sn:return i([a,l.toISOString()],l);case un:{const{source:f,flags:h}=l;return i([a,{source:f,flags:h}],l)}case cn:{const f=[],h=i([a,f],l);for(const[d,p]of l)(e||!(nt(qe(d))||nt(qe(p))))&&f.push([o(d),o(p)]);return h}case hn:{const f=[],h=i([a,f],l);for(const d of l)(e||!nt(qe(d)))&&f.push(o(d));return h}}const{message:s}=l;return i([a,{name:c,message:s}],l)};return o},Xn=(e,{json:n,lossy:t}={})=>{const r=[];return vs(!(n||t),!!n,new Map,r)(e),r},ct=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Qn(Xn(e,n)):structuredClone(e):(e,n)=>Qn(Xn(e,n));function js(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Ss(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Ns(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||js,r=e.options.footnoteBackLabel||Ss,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[c]);if(!s)continue;const f=e.all(s),h=String(s.identifier).toUpperCase(),d=Oe(h.toLowerCase());let p=0;const g=[],b=e.footnoteCounts.get(h);for(;b!==void 0&&++p<=b;){g.length>0&&g.push({type:"text",value:" "});let v=typeof t=="string"?t:t(c,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const v=C.children[C.children.length-1];v&&v.type==="text"?v.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else f.push(...g);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(f,!0)};e.patch(s,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ct(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
49
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
50
- `}]}}const mt=(function(e){if(e==null)return Ts;if(typeof e=="function")return gt(e);if(typeof e=="object")return Array.isArray(e)?Es(e):Ps(e);if(typeof e=="string")return As(e);throw new Error("Expected function, string, or object as test")});function Es(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=mt(e[t]);return gt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function Ps(e){const n=e;return gt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function As(e){return gt(n);function n(t){return t&&t.type===e}}function gt(e){return n;function n(t,r,i){return!!(Is(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Ts(){return!0}function Is(e){return e!==null&&typeof e=="object"&&"type"in e}const Xr=[],Fs=!0,Ut=!1,Ls="skip";function Kr(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=mt(i),l=r?-1:1;a(e,void 0,[])();function a(c,s,f){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return d;function d(){let p=Xr,g,b,C;if((!n||o(c,s,f[f.length-1]||void 0))&&(p=Ds(t(c,f)),p[0]===Ut))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==Ls)for(b=(r?y.children.length:-1)+l,C=f.concat(y);b>-1&&b<y.children.length;){const v=y.children[b];if(g=a(v,b,C)(),g[0]===Ut)return g;b=typeof g[1]=="number"?g[1]:b+l}}return p}}}function Ds(e){return Array.isArray(e)?e:typeof e=="number"?[Fs,e]:e==null?Xr:[e]}function fn(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),Kr(e,o,a,i);function a(c,s){const f=s[s.length-1],h=f?f.children.indexOf(c):void 0;return l(c,h,f)}}const qt={}.hasOwnProperty,Rs={};function Ms(e,n){const t=n||Rs,r=new Map,i=new Map,o=new Map,l={...bs,...t.handlers},a={all:s,applyData:_s,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:c,options:t,patch:zs,wrap:Bs};return fn(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:i,d=String(f.identifier).toUpperCase();h.has(d)||h.set(d,f)}}),a;function c(f,h){const d=f.type,p=a.handlers[d];if(qt.call(a.handlers,d)&&p)return p(a,f,h);if(a.options.passThrough&&a.options.passThrough.includes(d)){if("children"in f){const{children:b,...C}=f,y=ct(C);return y.children=a.all(f),y}return ct(f)}return(a.options.unknownHandler||Os)(a,f,h)}function s(f){const h=[];if("children"in f){const d=f.children;let p=-1;for(;++p<d.length;){const g=a.one(d[p],f);if(g){if(p&&d[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Kn(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=Kn(b.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function zs(e,n){e.position&&(n.position=jl(e))}function _s(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,ct(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Os(e,n){const t=n.data||{},r="value"in n&&!(qt.call(t,"hProperties")||qt.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Bs(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
51
- `});++r<e.length;)r&&t.push({type:"text",value:`
52
- `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
53
- `}),t}function Kn(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Gn(e,n){const t=Ms(e,n),r=t.one(e,void 0),i=Ns(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
54
- `},i),o}function $s(e,n){return e&&"run"in e?async function(t,r){const i=Gn(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Gn(t,{file:r,...e||n})}}function Jn(e){if(e)throw e}var vt,Zn;function Hs(){if(Zn)return vt;Zn=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},o=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var f=e.call(s,"constructor"),h=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!f&&!h)return!1;var d;for(d in s);return typeof d>"u"||e.call(s,d)},l=function(s,f){t&&f.name==="__proto__"?t(s,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):s[f.name]=f.newValue},a=function(s,f){if(f==="__proto__")if(e.call(s,f)){if(r)return r(s,f).value}else return;return s[f]};return vt=function c(){var s,f,h,d,p,g,b=arguments[0],C=1,y=arguments.length,v=!1;for(typeof b=="boolean"&&(v=b,b=arguments[1]||{},C=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});C<y;++C)if(s=arguments[C],s!=null)for(f in s)h=a(b,f),d=a(s,f),b!==d&&(v&&d&&(o(d)||(p=i(d)))?(p?(p=!1,g=h&&i(h)?h:[]):g=h&&o(h)?h:{},l(b,{name:f,newValue:c(v,g,d)})):typeof d<"u"&&l(b,{name:f,newValue:d}));return b},vt}var Vs=Hs();const jt=pr(Vs);function Wt(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Us(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(c,...s){const f=e[++o];let h=-1;if(c){l(c);return}for(;++h<i.length;)(s[h]===null||s[h]===void 0)&&(s[h]=i[h]);i=s,f?qs(f,a)(...s):l(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function qs(e,n){let t;return r;function r(...l){const a=e.length>l.length;let c;a&&l.push(i);try{c=e.apply(this,l)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(c&&c.then&&typeof c.then=="function"?c.then(o,i):c instanceof Error?i(c):o(c))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const ke={basename:Ws,dirname:Ys,extname:Qs,join:Xs,sep:"/"};function Ws(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');et(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function Ys(e){if(et(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Qs(e){et(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Xs(...e){let n=-1,t;for(;++n<e.length;)et(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Ks(t)}function Ks(e){et(e);const n=e.codePointAt(0)===47;let t=Gs(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Gs(e,n){let t="",r=0,i=-1,o=0,l=-1,a,c;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function et(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Js={cwd:Zs};function Zs(){return"/"}function Yt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function eu(e){if(typeof e=="string")e=new URL(e);else if(!Yt(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return tu(e)}function tu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const St=["history","path","basename","stem","extname","dirname"];class Gr{constructor(n){let t;n?Yt(n)?t={path:n}:typeof n=="string"||nu(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Js.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<St.length;){const o=St[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)St.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ke.basename(this.path):void 0}set basename(n){Et(n,"basename"),Nt(n,"basename"),this.path=ke.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ke.dirname(this.path):void 0}set dirname(n){er(this.basename,"dirname"),this.path=ke.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ke.extname(this.path):void 0}set extname(n){if(Nt(n,"extname"),er(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ke.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Yt(n)&&(n=eu(n)),Et(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ke.basename(this.path,this.extname):void 0}set stem(n){Et(n,"stem"),Nt(n,"stem"),this.path=ke.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new ae(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Nt(e,n){if(e&&e.includes(ke.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ke.sep+"`")}function Et(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function er(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function nu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ru=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),iu={}.hasOwnProperty;class pn extends ru{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=Us()}copy(){const n=new pn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(jt(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Tt("data",this.frozen),this.namespace[n]=t,this):iu.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Tt("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=rt(n),r=this.parser||this.Parser;return Pt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Pt("process",this.parser||this.Parser),At("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=rt(n),c=r.parse(a);r.run(c,a,function(f,h,d){if(f||!h||!d)return s(f);const p=h,g=r.stringify(p,d);au(g)?d.value=g:d.result=g,s(f,d)});function s(f,h){f||!h?l(f):o?o(h):t(void 0,h)}}}processSync(n){let t=!1,r;return this.freeze(),Pt("processSync",this.parser||this.Parser),At("processSync",this.compiler||this.Compiler),this.process(n,i),nr("processSync","process",t),r;function i(o,l){t=!0,Jn(o),r=l}}run(n,t,r){tr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const c=rt(t);i.run(n,c,s);function s(f,h,d){const p=h||n;f?a(f):l?l(p):r(void 0,p,d)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),nr("runSync","run",r),i;function o(l,a){Jn(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=rt(t),i=this.compiler||this.Compiler;return At("stringify",i),tr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Tt("use",this.frozen),n!=null)if(typeof n=="function")c(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(s){if(typeof s=="function")c(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...h]=s;c(f,h)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new 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");a(s.plugins),s.settings&&(i.settings=jt(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const h=s[f];o(h)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function c(s,f){let h=-1,d=-1;for(;++h<r.length;)if(r[h][0]===s){d=h;break}if(d===-1)r.push([s,...f]);else if(f.length>0){let[p,...g]=f;const b=r[d][1];Wt(b)&&Wt(p)&&(p=jt(!0,b,p)),r[d]=[s,p,...g]}}}}const lu=new pn().freeze();function Pt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function At(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tt(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tr(e){if(!Wt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function rt(e){return ou(e)?e:new Gr(e)}function ou(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function au(e){return typeof e=="string"||su(e)}function su(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rr=[],ir={allowDangerousHtml:!0},cu=/^(https?|ircs?|mailto|xmpp)$/i,hu=[{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 fu(e){const n=pu(e),t=du(e);return mu(n.runSync(n.parse(t),t),e)}function pu(e){const n=e.rehypePlugins||rr,t=e.remarkPlugins||rr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ir}:ir;return lu().use(Ya).use(t).use($s,r).use(n)}function du(e){const n=e.children||"",t=new Gr;return typeof n=="string"&&(t.value=n),t}function mu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,c=n.urlTransform||gu;for(const f of hu)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+uu+f.id,void 0);return fn(e,s),Al(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function s(f,h,d){if(f.type==="raw"&&d&&typeof h=="number")return l?d.children.splice(h,1):d.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let p;for(p in kt)if(Object.hasOwn(kt,p)&&Object.hasOwn(f.properties,p)){const g=f.properties[p],b=kt[p];(b===null||b.includes(f.tagName))&&(f.properties[p]=c(String(g||""),p,f))}}if(f.type==="element"){let p=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(f,h,d)),p&&d&&typeof h=="number")return a&&f.children?d.children.splice(h,1,...f.children):d.children.splice(h,1),h}}}function gu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||cu.test(e.slice(0,n))?e:""}function lr(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function xu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yu(e,n,t){const i=mt((t||{}).ignore||[]),o=bu(n);let l=-1;for(;++l<o.length;)Kr(e,"text",a);function a(s,f){let h=-1,d;for(;++h<f.length;){const p=f[h],g=d?d.children:void 0;if(i(p,g?g.indexOf(p):void 0,d))return;d=p}if(d)return c(s,f)}function c(s,f){const h=f[f.length-1],d=o[l][0],p=o[l][1];let g=0;const C=h.children.indexOf(s);let y=!1,v=[];d.lastIndex=0;let S=d.exec(s.value);for(;S;){const R=S.index,I={index:S.index,input:S.input,stack:[...f,s]};let w=p(...S,I);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?d.lastIndex=R+1:(g!==R&&v.push({type:"text",value:s.value.slice(g,R)}),Array.isArray(w)?v.push(...w):w&&v.push(w),g=R+S[0].length,y=!0),!d.global)break;S=d.exec(s.value)}return y?(g<s.value.length&&v.push({type:"text",value:s.value.slice(g)}),h.children.splice(C,1,...v)):v=[s],C+v.length}}function bu(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([ku(i[0]),wu(i[1])])}return n}function ku(e){return typeof e=="string"?new RegExp(xu(e),"g"):e}function wu(e){return typeof e=="function"?e:function(){return e}}const It="phrasing",Ft=["autolink","link","image","label"];function Cu(){return{transforms:[Au],enter:{literalAutolink:ju,literalAutolinkEmail:Lt,literalAutolinkHttp:Lt,literalAutolinkWww:Lt},exit:{literalAutolink:Pu,literalAutolinkEmail:Eu,literalAutolinkHttp:Su,literalAutolinkWww:Nu}}}function vu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:It,notInConstruct:Ft},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:It,notInConstruct:Ft},{character:":",before:"[ps]",after:"\\/",inConstruct:It,notInConstruct:Ft}]}}function ju(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lt(e){this.config.enter.autolinkProtocol.call(this,e)}function Su(e){this.config.exit.autolinkProtocol.call(this,e)}function Nu(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function Eu(e){this.config.exit.autolinkEmail.call(this,e)}function Pu(e){this.exit(e)}function Au(e){yu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Tu],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Iu]],{ignore:["link","linkReference"]})}function Tu(e,n,t,r,i){let o="";if(!Jr(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!Fu(t)))return!1;const l=Lu(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function Iu(e,n,t,r){return!Jr(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Fu(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Lu(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=lr(e,"(");let o=lr(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function Jr(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Te(t)||ft(t))&&(!n||t!==47)}Zr.peek=Hu;function Du(){this.buffer()}function Ru(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Mu(){this.buffer()}function zu(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _u(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ye(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Ou(e){this.exit(e)}function Bu(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ye(this.sliceSerialize(e)).toLowerCase(),t.label=n}function $u(e){this.exit(e)}function Hu(){return"["}function Zr(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Vu(){return{enter:{gfmFootnoteCallString:Du,gfmFootnoteCall:Ru,gfmFootnoteDefinitionLabelString:Mu,gfmFootnoteDefinition:zu},exit:{gfmFootnoteCallString:_u,gfmFootnoteCall:Ou,gfmFootnoteDefinitionLabelString:Bu,gfmFootnoteDefinition:$u}}}function Uu(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Zr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let c=a.move("[^");const s=o.enter("footnoteDefinition"),f=o.enter("label");return c+=a.move(o.safe(o.associationId(r),{before:c,after:"]"})),f(),c+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),c+=a.move((n?`
55
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),n?ei:qu))),s(),c}}function qu(e,n,t){return n===0?e:ei(e,n,t)}function ei(e,n,t){return(t?"":" ")+e}const Wu=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ti.peek=Gu;function Yu(){return{canContainEols:["delete"],enter:{strikethrough:Xu},exit:{strikethrough:Ku}}}function Qu(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Wu}],handlers:{delete:ti}}}function Xu(e){this.enter({type:"delete",children:[]},e)}function Ku(e){this.exit(e)}function ti(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Gu(){return"~"}function Ju(e){return e.length}function Zu(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Ju,o=[],l=[],a=[],c=[];let s=0,f=-1;for(;++f<e.length;){const b=[],C=[];let y=-1;for(e[f].length>s&&(s=e[f].length);++y<e[f].length;){const v=ec(e[f][y]);if(t.alignDelimiters!==!1){const S=i(v);C[y]=S,(c[y]===void 0||S>c[y])&&(c[y]=S)}b.push(v)}l[f]=b,a[f]=C}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<s;)o[h]=or(r[h]);else{const b=or(r);for(;++h<s;)o[h]=b}h=-1;const d=[],p=[];for(;++h<s;){const b=o[h];let C="",y="";b===99?(C=":",y=":"):b===108?C=":":b===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,c[h]-C.length-y.length);const S=C+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=C.length+v+y.length,v>c[h]&&(c[h]=v),p[h]=v),d[h]=S}l.splice(1,0,d),a.splice(1,0,p),f=-1;const g=[];for(;++f<l.length;){const b=l[f],C=a[f];h=-1;const y=[];for(;++h<s;){const v=b[h]||"";let S="",R="";if(t.alignDelimiters!==!1){const I=c[h]-(C[h]||0),w=o[h];w===114?S=" ".repeat(I):w===99?I%2?(S=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(S=" ".repeat(I/2),R=S):R=" ".repeat(I)}t.delimiterStart!==!1&&!h&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||h)&&y.push(" "),t.alignDelimiters!==!1&&y.push(S),y.push(v),t.alignDelimiters!==!1&&y.push(R),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||h!==s-1)&&y.push("|")}g.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
56
- `)}function ec(e){return e==null?"":String(e)}function or(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function tc(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),nc);return i(),l}function nc(e,n,t){return">"+(t?"":" ")+e}function rc(e,n){return ar(e,n.inConstruct,!0)&&!ar(e,n.notInConstruct,!1)}function ar(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function sr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
57
- `&&rc(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
58
- `}function ic(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function lc(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function oc(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function ac(e,n,t,r){const i=oc(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(lc(e,t)){const h=t.enter("codeIndented"),d=t.indentLines(o,sc);return h(),d}const a=t.createTracker(r),c=i.repeat(Math.max(ic(o,i)+1,3)),s=t.enter("codeFenced");let f=a.move(c);if(e.lang){const h=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),h()}if(e.lang&&e.meta){const h=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
59
- `,encode:["`"],...a.current()})),h()}return f+=a.move(`
60
- `),o&&(f+=a.move(o+`
61
- `)),f+=a.move(c),s(),f}function sc(e,n,t){return(t?"":" ")+e}function dn(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function uc(e,n,t,r){const i=dn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let a=t.enter("label");const c=t.createTracker(r);let s=c.move("[");return s+=c.move(t.safe(t.associationId(e),{before:s,after:"]",...c.current()})),s+=c.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=c.move("<"),s+=c.move(t.safe(e.url,{before:s,after:">",...c.current()})),s+=c.move(">")):(a=t.enter("destinationRaw"),s+=c.move(t.safe(e.url,{before:s,after:e.title?" ":`
62
- `,...c.current()}))),a(),e.title&&(a=t.enter(`title${o}`),s+=c.move(" "+i),s+=c.move(t.safe(e.title,{before:s,after:i,...c.current()})),s+=c.move(i),a()),l(),s}function cc(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Ge(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ht(e,n,t){const r=ze(e),i=ze(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ni.peek=hc;function ni(e,n,t,r){const i=cc(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let c=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=c.charCodeAt(0),f=ht(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(c=Ge(s)+c.slice(1));const h=c.charCodeAt(c.length-1),d=ht(r.after.charCodeAt(0),h,i);d.inside&&(c=c.slice(0,-1)+Ge(h));const p=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},a+c+p}function hc(e,n,t){return t.options.emphasis||"*"}function fc(e,n){let t=!1;return fn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Ut}),!!((!e.depth||e.depth<3)&&ln(e)&&(n.options.setext||t))}function pc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(fc(e,t)){const f=t.enter("headingSetext"),h=t.enter("phrasing"),d=t.containerPhrasing(e,{...o.current(),before:`
63
- `,after:`
64
- `});return h(),f(),d+`
65
- `+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
66
- `))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),c=t.enter("phrasing");o.move(l+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
67
- `,...o.current()});return/^[\t ]/.test(s)&&(s=Ge(s.charCodeAt(0))+s.slice(1)),s=s?l+" "+s:l,t.options.closeAtx&&(s+=" "+l),c(),a(),s}ri.peek=dc;function ri(e){return e.value||""}function dc(){return"<"}ii.peek=mc;function ii(e,n,t,r){const i=dn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=t.enter("label");const c=t.createTracker(r);let s=c.move("![");return s+=c.move(t.safe(e.alt,{before:s,after:"]",...c.current()})),s+=c.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=c.move("<"),s+=c.move(t.safe(e.url,{before:s,after:">",...c.current()})),s+=c.move(">")):(a=t.enter("destinationRaw"),s+=c.move(t.safe(e.url,{before:s,after:e.title?" ":")",...c.current()}))),a(),e.title&&(a=t.enter(`title${o}`),s+=c.move(" "+i),s+=c.move(t.safe(e.title,{before:s,after:i,...c.current()})),s+=c.move(i),a()),s+=c.move(")"),l(),s}function mc(){return"!"}li.peek=gc;function li(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let c=a.move("![");const s=t.safe(e.alt,{before:c,after:"]",...a.current()});c+=a.move(s+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const h=t.safe(t.associationId(e),{before:c,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!s||s!==h?c+=a.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function gc(){return"!"}oi.peek=xc;function oi(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let c;if(l.atBreak)for(;c=a.exec(r);){let s=c.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(c.index+1)}}return i+r+i}function xc(){return"`"}function ai(e,n){const t=ln(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}si.peek=yc;function si(e,n,t,r){const i=dn(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,c;if(ai(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let h=l.move("<");return h+=l.move(t.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),a(),t.stack=f,h}a=t.enter("link"),c=t.enter("label");let s=l.move("[");return s+=l.move(t.containerPhrasing(e,{before:s,after:"](",...l.current()})),s+=l.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),s+=l.move("<"),s+=l.move(t.safe(e.url,{before:s,after:">",...l.current()})),s+=l.move(">")):(c=t.enter("destinationRaw"),s+=l.move(t.safe(e.url,{before:s,after:e.title?" ":")",...l.current()}))),c(),e.title&&(c=t.enter(`title${o}`),s+=l.move(" "+i),s+=l.move(t.safe(e.title,{before:s,after:i,...l.current()})),s+=l.move(i),c()),s+=l.move(")"),a(),s}function yc(e,n,t){return ai(e,t)?"<":"["}ui.peek=bc;function ui(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let c=a.move("[");const s=t.containerPhrasing(e,{before:c,after:"]",...a.current()});c+=a.move(s+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const h=t.safe(t.associationId(e),{before:c,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!s||s!==h?c+=a.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function bc(){return"["}function mn(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function kc(e){const n=mn(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function wc(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function ci(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Cc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?wc(t):mn(t);const a=e.ordered?l==="."?")":".":kc(t);let c=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),ci(t)===l&&f){let h=-1;for(;++h<e.children.length;){const d=e.children[h];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(l=a),t.bulletCurrent=l;const s=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),s}function vc(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function jc(e,n,t,r){const i=vc(t);let o=t.bulletCurrent||mn(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=t.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const c=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,a.current()),f);return c(),s;function f(h,d,p){return d?(p?"":" ".repeat(l))+h:(p?o:o+" ".repeat(l-o.length))+h}}function Sc(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const Nc=mt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ec(e,n,t,r){return(e.children.some(function(l){return Nc(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Pc(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}hi.peek=Ac;function hi(e,n,t,r){const i=Pc(t),o=t.enter("strong"),l=t.createTracker(r),a=l.move(i+i);let c=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=c.charCodeAt(0),f=ht(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(c=Ge(s)+c.slice(1));const h=c.charCodeAt(c.length-1),d=ht(r.after.charCodeAt(0),h,i);d.inside&&(c=c.slice(0,-1)+Ge(h));const p=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},a+c+p}function Ac(e,n,t){return t.options.strong||"*"}function Tc(e,n,t,r){return t.safe(e.value,r)}function Ic(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Fc(e,n,t){const r=(ci(t)+(t.options.ruleSpaces?" ":"")).repeat(Ic(t));return t.options.ruleSpaces?r.slice(0,-1):r}const fi={blockquote:tc,break:sr,code:ac,definition:uc,emphasis:ni,hardBreak:sr,heading:pc,html:ri,image:ii,imageReference:li,inlineCode:oi,link:si,linkReference:ui,list:Cc,listItem:jc,paragraph:Sc,root:Ec,strong:hi,text:Tc,thematicBreak:Fc};function Lc(){return{enter:{table:Dc,tableData:ur,tableHeader:ur,tableRow:Mc},exit:{codeText:zc,table:Rc,tableData:Dt,tableHeader:Dt,tableRow:Dt}}}function Dc(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Rc(e){this.exit(e),this.data.inTable=void 0}function Mc(e){this.enter({type:"tableRow",children:[]},e)}function Dt(e){this.exit(e)}function ur(e){this.enter({type:"tableCell",children:[]},e)}function zc(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,_c));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function _c(e,n){return n==="|"?n:e}function Oc(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
68
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:l,tableCell:c,tableRow:a}};function l(p,g,b,C){return s(f(p,b,C),p.align)}function a(p,g,b,C){const y=h(p,b,C),v=s([y]);return v.slice(0,v.indexOf(`
69
- `))}function c(p,g,b,C){const y=b.enter("tableCell"),v=b.enter("phrasing"),S=b.containerPhrasing(p,{...C,before:o,after:o});return v(),y(),S}function s(p,g){return Zu(p,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(p,g,b){const C=p.children;let y=-1;const v=[],S=g.enter("table");for(;++y<C.length;)v[y]=h(C[y],g,b);return S(),v}function h(p,g,b){const C=p.children;let y=-1;const v=[],S=g.enter("tableRow");for(;++y<C.length;)v[y]=c(C[y],p,g,b);return S(),v}function d(p,g,b){let C=fi.inlineCode(p,g,b);return b.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Bc(){return{exit:{taskListCheckValueChecked:cr,taskListCheckValueUnchecked:cr,paragraph:Hc}}}function $c(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Vc}}}function cr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Hc(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Vc(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let c=fi.listItem(e,n,t,{...r,...a.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),c;function s(f){return f+l}}function Uc(){return[Cu(),Vu(),Yu(),Lc(),Bc()]}function qc(e){return{extensions:[vu(),Uu(e),Qu(),Oc(e),$c()]}}const Wc={tokenize:Jc,partial:!0},pi={tokenize:Zc,partial:!0},di={tokenize:eh,partial:!0},mi={tokenize:th,partial:!0},Yc={tokenize:nh,partial:!0},gi={name:"wwwAutolink",tokenize:Kc,previous:yi},xi={name:"protocolAutolink",tokenize:Gc,previous:bi},je={name:"emailAutolink",tokenize:Xc,previous:ki},we={};function Qc(){return{text:we}}let Ae=48;for(;Ae<123;)we[Ae]=je,Ae++,Ae===58?Ae=65:Ae===91&&(Ae=97);we[43]=je;we[45]=je;we[46]=je;we[95]=je;we[72]=[je,xi];we[104]=[je,xi];we[87]=[je,gi];we[119]=[je,gi];function Xc(e,n,t){const r=this;let i,o;return l;function l(h){return!Qt(h)||!ki.call(r,r.previous)||gn(r.events)?t(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return Qt(h)?(e.consume(h),a):h===64?(e.consume(h),c):t(h)}function c(h){return h===46?e.check(Yc,f,s)(h):h===45||h===95||oe(h)?(o=!0,e.consume(h),c):f(h)}function s(h){return e.consume(h),i=!0,c}function f(h){return o&&i&&ue(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(h)):t(h)}}function Kc(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!yi.call(r,r.previous)||gn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Wc,e.attempt(pi,e.attempt(di,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Gc(e,n,t){const r=this;let i="",o=!1;return l;function l(h){return(h===72||h===104)&&bi.call(r,r.previous)&&!gn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):t(h)}function a(h){if(ue(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(h),c}return t(h)}function c(h){return h===47?(e.consume(h),o?s:(o=!0,c)):t(h)}function s(h){return h===null||st(h)||K(h)||Te(h)||ft(h)?t(h):e.attempt(pi,e.attempt(di,f),t)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(h)}}function Jc(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function Zc(e,n,t){let r,i,o;return l;function l(s){return s===46||s===95?e.check(mi,c,a)(s):s===null||K(s)||Te(s)||s!==45&&ft(s)?c(s):(o=!0,e.consume(s),l)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),l}function c(s){return i||r||!o?t(s):n(s)}}function eh(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(mi,n,o)(l):l===null||K(l)||Te(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function th(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||K(a)||Te(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||K(a)||Te(a)?n(a):r(a)}function o(a){return ue(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):ue(a)?(e.consume(a),l):t(a)}}function nh(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return oe(o)?t(o):n(o)}}function yi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||K(e)}function bi(e){return!ue(e)}function ki(e){return!(e===47||Qt(e))}function Qt(e){return e===43||e===45||e===46||e===95||oe(e)}function gn(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const rh={tokenize:hh,partial:!0};function ih(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sh,continuation:{tokenize:uh},exit:ch}},text:{91:{name:"gfmFootnoteCall",tokenize:ah},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lh,resolveTo:oh}}}}function lh(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){l=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!l||!l._balanced)return t(c);const s=ye(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function oh(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function ah(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?t(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(h){if(o>999||h===93&&!l||h===null||h===91||K(h))return t(h);if(h===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(ye(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(h)}return K(h)||(l=!0),o++,e.consume(h),h===92?f:s}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,s):s(h)}}function sh(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||K(g))return t(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=ye(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return K(g)||(a=!0),l++,e.consume(g),g===92?h:f}function h(g){return g===91||g===92||g===93?(e.consume(g),l++,f):f(g)}function d(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),Q(e,p,"gfmFootnoteDefinitionWhitespace")):t(g)}function p(g){return n(g)}}function uh(e,n,t){return e.check(Ze,n,e.attempt(rh,n,t))}function ch(e){e.exit("gfmFootnoteDefinition")}function hh(e,n,t){const r=this;return Q(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function fh(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let c=-1;for(;++c<l.length;)if(l[c][0]==="enter"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._close){let s=c;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[c][1].end.offset-l[c][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[c][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[c][1].end)},h={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[c][1].start)},d=[["enter",f,a],["enter",l[s][1],a],["exit",l[s][1],a],["enter",h,a]],p=a.parser.constructs.insideSpan.null;p&&me(d,d.length,0,pt(p,l.slice(s+1,c),a)),me(d,d.length,0,[["exit",h,a],["enter",l[c][1],a],["exit",l[c][1],a],["exit",f,a]]),me(l,s-1,c-s+3,d),c=s+d.length-2;break}}for(c=-1;++c<l.length;)l[c][1].type==="strikethroughSequenceTemporary"&&(l[c][1].type="data");return l}function o(l,a,c){const s=this.previous,f=this.events;let h=0;return d;function d(g){return s===126&&f[f.length-1][1].type!=="characterEscape"?c(g):(l.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const b=ze(s);if(g===126)return h>1?c(g):(l.consume(g),h++,p);if(h<2&&!t)return c(g);const C=l.exit("strikethroughSequenceTemporary"),y=ze(g);return C._open=!y||y===2&&!!b,C._close=!b||b===2&&!!y,a(g)}}}class ph{constructor(){this.map=[]}add(n,t,r){dh(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function dh(e,n,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===n){e.map[i][1]+=t,e.map[i][2].push(...r);return}i+=1}e.map.push([n,t,r])}}function mh(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function gh(){return{flow:{null:{name:"table",tokenize:xh,resolveAll:yh}}}}function xh(e,n,t){const r=this;let i=0,o=0,l;return a;function a(k){let F=r.events.length-1;for(;F>-1;){const A=r.events[F][1].type;if(A==="lineEnding"||A==="linePrefix")F--;else break}const L=F>-1?r.events[F][1].type:null,P=L==="tableHead"||L==="tableRow"?w:c;return P===w&&r.parser.lazy[r.now().line]?t(k):P(k)}function c(k){return e.enter("tableHead"),e.enter("tableRow"),s(k)}function s(k){return k===124||(l=!0,o+=1),f(k)}function f(k){return k===null?t(k):M(k)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):t(k):q(k)?Q(e,f,"whitespace")(k):(o+=1,l&&(l=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),h(k)))}function h(k){return k===null||k===124||K(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?d:h)}function d(k){return k===92||k===124?(e.consume(k),h):h(k)}function p(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(k):(e.enter("tableDelimiterRow"),l=!1,q(k)?Q(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):g(k))}function g(k){return k===45||k===58?C(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),b):I(k)}function b(k){return q(k)?Q(e,C,"whitespace")(k):C(k)}function C(k){return k===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||M(k)?R(k):I(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),v(k)):I(k)}function v(k){return k===45?(e.consume(k),v):k===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(k))}function S(k){return q(k)?Q(e,R,"whitespace")(k):R(k)}function R(k){return k===124?g(k):k===null||M(k)?!l||i!==o?I(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(k)):I(k)}function I(k){return t(k)}function w(k){return e.enter("tableRow"),_(k)}function _(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),_):k===null||M(k)?(e.exit("tableRow"),n(k)):q(k)?Q(e,_,"whitespace")(k):(e.enter("data"),U(k))}function U(k){return k===null||k===124||K(k)?(e.exit("data"),_(k)):(e.consume(k),k===92?$:U)}function $(k){return k===92||k===124?(e.consume(k),U):U(k)}}function yh(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,c=0,s,f,h;const d=new ph;for(;++t<e.length;){const p=e[t],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,c!==0&&(hr(d,n,c,s,f),f=void 0,c=0),s={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},d.add(t,0,[["enter",s,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},d.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],h=it(d,n,o,i,void 0,h),o=[0,0,0,0]),l[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],h=it(d,n,o,i,void 0,h)),o=l,l=[o[1],t,0,0])):g.type==="tableHead"?(a=!0,c=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=t,o[1]!==0?(l[0]=l[1],h=it(d,n,o,i,t,h)):l[1]!==0&&(h=it(d,n,l,i,t,h)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=t)}for(c!==0&&hr(d,n,c,s,f),d.consume(n.events),t=-1;++t<n.events.length;){const p=n.events[t];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=mh(n.events,t))}return e}function it(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},Re(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const c=Re(n.events,t[1]);if(o={type:l,start:Object.assign({},c),end:Object.assign({},c)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const s=Re(n.events,t[2]),f=Re(n.events,t[3]),h={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",h,n]]),r!==2){const d=n.events[t[2]],p=n.events[t[3]];if(d[1].end=Object.assign({},p[1].end),d[1].type="chunkText",d[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,b=t[3]-t[2]-1;e.add(g,b,[])}}e.add(t[3]+1,0,[["exit",h,n]])}return i!==void 0&&(o.end=Object.assign({},Re(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function hr(e,n,t,r,i){const o=[],l=Re(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function Re(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const bh={name:"tasklistCheck",tokenize:wh};function kh(){return{text:{91:bh}}}function wh(e,n,t){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return K(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),l):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),l):t(c)}function l(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(c)}function a(c){return M(c)?n(c):q(c)?e.check({tokenize:Ch},n,t)(c):t(c)}}function Ch(e,n,t){return Q(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function vh(e){return Ir([Qc(),ih(),fh(e),gh(),kh()])}const jh={};function Sh(e){const n=this,t=e||jh,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(vh(t)),o.push(Uc()),l.push(qc(t))}function wi({content:e,className:n}){const t=e.trim().replace(/^#+ .+$/m,"").trim();return u.jsx(fu,{remarkPlugins:[Sh],components:{h1:({children:r})=>u.jsx("h1",{className:"text-lg font-bold text-gray-900 mb-3 mt-6 first:mt-0 pb-1 border-b border-gray-200",children:r}),h2:({children:r})=>u.jsx("h2",{className:"text-base font-semibold text-gray-900 mb-2 mt-5 first:mt-0",children:r}),h3:({children:r})=>u.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-2 mt-4 first:mt-0",children:r}),p:({children:r})=>u.jsx("p",{className:"text-sm text-gray-700 mb-3 leading-relaxed",children:r}),ul:({children:r})=>u.jsx("ul",{className:"list-disc ml-5 text-sm text-gray-700 mb-3 space-y-1.5",children:r}),ol:({children:r})=>u.jsx("ol",{className:"list-decimal ml-5 text-sm text-gray-700 mb-3 space-y-1.5",children:r}),li:({children:r})=>u.jsx("li",{className:"leading-relaxed",children:r}),code:({children:r,className:i})=>(i==null?void 0:i.includes("language-"))?u.jsx("pre",{className:"bg-gray-100 rounded p-3 text-xs font-mono overflow-x-auto mb-3",children:u.jsx("code",{children:r})}):u.jsx("code",{className:"bg-gray-100 px-1.5 py-0.5 rounded text-xs font-mono text-gray-800",children:r}),pre:({children:r})=>u.jsx(u.Fragment,{children:r}),strong:({children:r})=>u.jsx("strong",{className:"font-semibold text-gray-900",children:r}),blockquote:({children:r})=>u.jsx("blockquote",{className:"border-l-4 border-gray-300 pl-4 italic text-gray-600 mb-3",children:r}),table:({children:r})=>u.jsx("div",{className:"overflow-x-auto mb-3",children:u.jsx("table",{className:"min-w-full text-sm border-collapse border border-gray-200",children:r})}),thead:({children:r})=>u.jsx("thead",{className:"bg-gray-50",children:r}),th:({children:r})=>u.jsx("th",{className:"border border-gray-200 px-3 py-2 text-left font-semibold text-gray-900",children:r}),td:({children:r})=>u.jsx("td",{className:"border border-gray-200 px-3 py-2 text-gray-700",children:r}),a:({children:r,href:i})=>u.jsx("a",{href:i,className:"text-[#005C75] hover:underline",target:"_blank",rel:"noopener noreferrer",children:r})},children:t})}function Ci(e){const n={name:"root",path:"",memories:[],children:new Map};for(const t of e){const r=t.filePath.split("/");r.pop();let i=n,o="";for(const l of r)o=o?`${o}/${l}`:l,i.children.has(l)||i.children.set(l,{name:l,path:o,memories:[],children:new Map}),i=i.children.get(l);r.length===0?n.memories.push(t):i.memories.push(t)}return n}function vi(e){let n=e.memories.length;for(const t of e.children.values())n+=vi(t);return n}function xt(e,n){var r;const t=e.match(/^#+ (.+)$/m);return t?t[1]:((r=n.split("/").pop())==null?void 0:r.replace(".md",""))||n}function Xe(e){return Math.round(e/3.5)}function xn(e){const n=new Date(e),t=new Date;if(n.toDateString()===t.toDateString()){const c=t.getTime()-n.getTime(),s=Math.floor(c/(1e3*60*60));return s<1?"Just now":s===1?"1h ago":`${s}h ago`}const i=n.toLocaleDateString("en-US",{month:"short"}),o=n.getDate(),l=n.getFullYear(),a=t.getFullYear();return l===a?`${i} ${o}`:`${i} ${o}, ${l}`}function Nh({rule:e,onEdit:n,onDelete:t,onView:r,isReviewed:i,onToggleReviewed:o,changeType:l,isUncommitted:a,changeDate:c,diff:s,isFadingOut:f,showLeftBorder:h}){const[d,p]=D.useState(!1),[g,b]=D.useState(!1),C=D.useMemo(()=>xt(e.body,e.filePath),[e.body,e.filePath]),y=Xe(e.body.length),v=d?"#3e3e3e":a?"#d97706":"#c7c7c7",S=`rounded-lg border overflow-hidden transition-all ease-in-out ${a?"bg-amber-50 border-amber-300":"bg-white border-gray-200"}`,R={...f&&{opacity:0,maxHeight:0,paddingTop:0,paddingBottom:0,marginBottom:0,borderWidth:0,transitionDuration:"600ms"}};return u.jsxs("div",{className:S,style:R,children:[u.jsx("div",{className:`p-4 cursor-pointer ${a?"hover:bg-amber-100":"hover:bg-gray-50"}`,onClick:()=>r?r(e):p(!d),children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"w-4 inline-flex items-center justify-center shrink-0",style:{transform:d?"rotate(90deg)":"none",transition:"transform 0.2s"},children:u.jsx("svg",{width:"10",height:"12",viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M1.5 1.268L8.5 6L1.5 10.732V1.268Z",fill:v})})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("h3",{style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:a?"#78350f":"#000"},children:C}),l&&u.jsx("span",{className:`px-2 py-0.5 rounded uppercase font-medium tracking-wider ${l==="deleted"?"bg-red-100 text-red-700":""}`,style:{fontSize:"10px",...l==="added"&&{backgroundColor:"#CBF3FA",color:"#005C75"},...l==="modified"&&{backgroundColor:"#FFE8C1",color:"#C67E06"}},children:l}),a&&u.jsx("span",{className:"px-2 py-0.5 bg-amber-200 text-amber-800 rounded font-medium uppercase tracking-wider",style:{fontSize:"10px"},children:"Uncommitted"}),u.jsxs("span",{className:"text-xs text-gray-400",children:["~",y.toLocaleString()," tokens"]})]}),u.jsx("div",{className:"flex items-center gap-2 text-xs text-gray-500 flex-wrap",children:e.frontmatter.paths&&e.frontmatter.paths.length>0&&u.jsxs(u.Fragment,{children:[e.frontmatter.paths.slice(0,2).map((I,w)=>u.jsx("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded font-mono",children:I},w)),e.frontmatter.paths.length>2&&u.jsxs("span",{className:"text-gray-400 whitespace-nowrap",children:["+",e.frontmatter.paths.length-2," more"]})]})})]})]}),u.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[c&&u.jsx("span",{className:"text-xs text-gray-400",children:xn(c)}),o&&u.jsx("button",{onClick:I=>{I.stopPropagation(),o(e.filePath,e.lastModified,i??!1)},className:`w-5 h-5 rounded-full border-2 flex items-center justify-center cursor-pointer transition-colors ${i?"bg-[#005C75] border-[#005C75]":"bg-white border-gray-300"}`,title:i?"Mark as unreviewed":"Mark as reviewed",children:i&&u.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:u.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})}),d&&u.jsxs("div",{className:`border-t ${a?"border-amber-200":"border-gray-100"}`,children:[u.jsxs("div",{className:`px-4 py-3 flex items-center justify-between ${a?"bg-amber-50":"bg-white"}`,children:[u.jsx("div",{className:"flex items-center gap-2",children:l==="modified"&&s&&u.jsxs("button",{onClick:I=>{I.stopPropagation(),b(!g)},className:`flex items-center gap-1 px-2 py-1 text-sm rounded cursor-pointer ${g?a?"bg-amber-200 text-amber-900":"bg-gray-200 text-gray-900":a?"text-amber-700 hover:text-amber-900 hover:bg-amber-100":"text-gray-600 hover:text-gray-900 hover:bg-gray-100"}`,children:[u.jsx(dr,{className:"w-3 h-3"}),g?"Hide Diff":"Show Diff"]})}),l!=="deleted"&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:I=>{I.stopPropagation(),n(e)},className:`flex items-center gap-1 px-2 py-1 text-sm rounded cursor-pointer ${a?"text-amber-700 hover:text-amber-900 hover:bg-amber-100":"text-gray-600 hover:text-gray-900 hover:bg-gray-100"}`,children:[u.jsx(Ki,{className:"w-3 h-3"}),"Edit"]}),u.jsxs("button",{onClick:I=>{I.stopPropagation(),t(e)},className:"flex items-center gap-1 px-2 py-1 text-sm rounded cursor-pointer text-red-600 hover:text-red-800 hover:bg-red-100",children:[u.jsx(Zi,{className:"w-3 h-3"}),"Delete"]})]})]}),g&&s&&u.jsx("pre",{className:"mx-4 mb-4 p-4 text-xs font-mono overflow-x-auto bg-gray-900 text-gray-100 max-h-64 overflow-y-auto rounded-md",children:s.split(`
70
- `).map((I,w)=>{let _="";return I.startsWith("+")&&!I.startsWith("+++")?_="text-green-400":I.startsWith("-")&&!I.startsWith("---")?_="text-red-400":I.startsWith("@@")&&(_="text-cyan-400"),u.jsx("div",{className:_,children:I},w)})}),u.jsxs("div",{className:"mx-4 mb-3",children:[u.jsx("div",{className:"text-xs text-gray-500 mb-1.5 font-medium",children:"Edit with Claude:"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 rounded font-mono text-xs",children:["Claude, can you help me edit this rule: `",e.filePath,"`"]}),u.jsx(Oi,{content:`Claude, can you help me edit this rule: \`${e.filePath}\``,icon:!0,iconSize:14,className:"p-1 text-gray-400 hover:text-gray-600 rounded transition-colors"})]})]}),e.frontmatter.paths&&e.frontmatter.paths.length>0&&u.jsxs("div",{className:"mx-4 mb-3",children:[u.jsx("div",{className:"text-xs text-gray-500 mb-1.5 font-medium",children:"Applies to paths:"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.frontmatter.paths.map((I,w)=>u.jsx("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 rounded font-mono text-xs",children:I},w))})]}),!g&&u.jsx("div",{className:"mx-4 mb-4 p-4 rounded border max-h-[500px] overflow-auto bg-white border-gray-200",children:u.jsx(wi,{content:e.body})})]})]})}function Eh(){return new Date().toISOString().split(".")[0]+"",`---
71
- paths:
72
- - '**/*.ts'
73
- ---
74
-
75
- ## Title
76
-
77
- Description here.
78
- `}function Ph({rule:e,onSave:n,onCancel:t}){const[r,i]=D.useState(e?`.claude/rules/${e.filePath}`:""),[o,l]=D.useState((e==null?void 0:e.content)||Eh()),[a,c]=D.useState(!!e),s=!e;return u.jsxs("div",{className:"p-6",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h3",{className:"text-lg font-semibold",style:{fontFamily:"Sora"},children:e?"Edit Rule":"Create New Rule"}),u.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 cursor-pointer",children:u.jsx(Gt,{className:"w-5 h-5"})})]}),s&&u.jsxs("div",{className:"mb-6",children:[u.jsx("div",{className:"bg-[#f0f9ff] border border-[#bae6fd] rounded-lg p-4 mb-4",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(dr,{className:"w-5 h-5 text-[#0284c7] mt-0.5 flex-shrink-0"}),u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium text-[#0c4a6e] mb-1",children:"Recommended: Use Claude Code"}),u.jsx("p",{className:"text-sm text-[#0369a1] mb-2",children:"Run this command in Claude Code to create a properly formatted rule with the right file location and paths:"}),u.jsx("code",{className:"block bg-white px-3 py-2 rounded border border-[#bae6fd] font-mono text-sm text-[#0c4a6e]",children:"/codeyam-new-rule"})]})]})}),u.jsxs("button",{onClick:()=>c(!a),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900 cursor-pointer",children:[u.jsx("span",{className:"w-4 inline-flex items-center justify-center shrink-0",style:{transform:a?"rotate(90deg)":"none",transition:"transform 0.2s"},children:u.jsx("svg",{width:"10",height:"12",viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M1.5 1.268L8.5 6L1.5 10.732V1.268Z",fill:a?"#3e3e3e":"#c7c7c7"})})}),"Or create manually"]})]}),(a||!s)&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"File Path (relative to .claude/rules/)"}),u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"e.g., src/webserver/architecture.md",className:"w-full px-3 py-2 pr-10 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent font-mono text-sm",disabled:!!e}),u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(r)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-gray-400 hover:text-gray-600 cursor-pointer",title:"Copy path",children:u.jsx(Rt,{className:"w-4 h-4"})})]})]}),e&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Ask Claude for help editing:"}),u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"text",value:`Claude, can you help me edit the rule: \`${r}\``,readOnly:!0,className:"w-full px-3 py-2 pr-10 border border-gray-300 rounded-md bg-gray-50 font-mono text-sm text-gray-600"}),u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(`Claude, can you help me edit the rule: \`${r}\``)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-gray-400 hover:text-gray-600 cursor-pointer",title:"Copy prompt",children:u.jsx(Rt,{className:"w-4 h-4"})})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content"}),u.jsx("textarea",{value:o,onChange:f=>l(f.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent font-mono text-sm bg-gray-900 text-gray-100 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-gray-800 [&::-webkit-scrollbar-thumb]:bg-gray-600 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:hover:bg-gray-500 [&::-webkit-resizer]:bg-gray-700"})]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 text-[#001f3f] hover:text-[#001530] rounded-md cursor-pointer font-mono uppercase text-xs font-semibold",children:"Cancel"}),u.jsx("button",{onClick:()=>n(r.replace(/^\.claude\/rules\//,""),o),disabled:!r.trim()||!o.trim(),className:"px-4 py-2 bg-[#005C75] text-white rounded-md hover:bg-[#004a5e] disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer font-mono uppercase text-xs font-semibold",children:"Save"})]})]})]})}function Ah({memories:e,selectedPath:n,onSelectPath:t,expandedFolders:r,onToggleFolder:i}){const o=D.useMemo(()=>Ci(e),[e]),l=(s,f,h)=>{if(s.target.closest(".chevron-toggle")){h&&i(f||"root");return}const p=f||null;t(n===p?null:p),h&&!r.has(f||"root")&&i(f||"root")},a=s=>{t(n===s?null:s)},c=(s,f=0)=>{const h=r.has(s.path||"root"),d=vi(s),p=s.children.size>0,g=s.name==="root"?"(root)":s.name,b=s.memories.length>0||p,C=s.path||"",y=n===C||n===null&&C==="";return u.jsxs("div",{children:[u.jsxs("div",{className:`flex items-center gap-2 py-2.5 cursor-pointer rounded px-2 relative ${y?"bg-[#E0E9EC]":"hover:bg-gray-100"}`,style:{paddingLeft:`${f*12+8}px`},onClick:v=>l(v,s.path,b),children:[b&&u.jsx("span",{className:"chevron-toggle p-0.5 -m-0.5 hover:bg-gray-200 rounded",onClick:v=>{v.stopPropagation(),i(s.path||"root")},children:u.jsx(Xt,{className:`w-3 h-3 text-gray-500 transition-transform ${h?"rotate-90":""}`})}),!b&&u.jsx("div",{className:"w-3"}),u.jsx(gr,{className:"w-3.5 h-3.5 text-[#005C75]"}),u.jsx("span",{className:`text-xs font-mono font-semibold ${y?"text-[#005C75]":""}`,style:{color:"#005C75"},children:g}),u.jsxs("span",{className:"text-xs ml-auto",style:{color:"#005C75"},children:[d," rules"]})]}),h&&u.jsxs("div",{className:"relative",children:[(s.memories.length>0||p)&&u.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-gray-300",style:{left:`${f*12+8+6}px`}}),s.memories.length>0&&u.jsx("div",{style:{paddingLeft:`${(f+1)*12+8}px`},children:s.memories.map(v=>{var R;const S=n===v.filePath;return u.jsx("div",{className:`flex items-center gap-2 py-1 px-2 text-sm rounded cursor-pointer relative ${S?"bg-[#E0E9EC] text-[#005C75]":"text-gray-600 hover:bg-gray-50"}`,onClick:()=>a(v.filePath),children:u.jsx("span",{className:"text-xs",children:(R=v.filePath.split("/").pop())==null?void 0:R.replace(".md","")})},v.filePath)})}),p&&u.jsx("div",{children:Array.from(s.children.values()).sort((v,S)=>v.name.localeCompare(S.name)).map(v=>c(v,f+1))})]})]},s.path||"root")};return u.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4 mb-8",children:c(o)})}function Th({memories:e,onEdit:n,onDelete:t,expandedFolders:r,onToggleFolder:i,reviewedStatus:o,onMarkReviewed:l,onMarkUnreviewed:a,onViewRule:c}){const[s,f]=D.useState({});D.useEffect(()=>{f({})},[o]);const h=D.useMemo(()=>({...o,...s}),[o,s]),d=D.useMemo(()=>Ci(e),[e]),p=(b,C,y)=>{f(v=>({...v,[b]:!y})),y?a(b):l(b,C)},g=(b,C=0)=>{const y=r.has(b.path||"root"),v=b.children.size>0,S=b.name==="root"?"root":b.name,R=b.memories.length>0||v;return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2 py-2 cursor-pointer hover:bg-gray-50 rounded px-2 mb-2",style:{backgroundColor:"rgba(224, 233, 236, 0.5)"},onClick:()=>R&&i(b.path||"root"),children:[R&&u.jsx(Xt,{className:`w-4 h-4 text-gray-500 transition-transform ${y?"rotate-90":""}`}),!R&&u.jsx("div",{className:"w-4"}),u.jsx(gr,{className:"w-4 h-4 text-[#005C75]"}),u.jsx("span",{className:"text-sm font-mono font-semibold",style:{color:"#001f3f"},children:S})]}),y&&u.jsxs("div",{className:"ml-10 space-y-4 relative",children:[(b.memories.length>0||v)&&u.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-gray-300",style:{left:"-24px"}}),b.memories.length>0&&u.jsx("div",{className:"space-y-2",children:b.memories.map(I=>u.jsx(Nh,{rule:I,onEdit:n,onDelete:t,onView:c,isReviewed:h[I.filePath]??!1,onToggleReviewed:p},I.filePath))}),v&&u.jsx("div",{className:"space-y-4",children:Array.from(b.children.values()).sort((I,w)=>I.name.localeCompare(w.name)).map(I=>g(I,C+1))})]})]},b.path||"root")};return u.jsx("div",{children:g(d)})}function Ih({memories:e,reviewedStatus:n,onViewRule:t}){const[r,i]=D.useState("unreviewed"),[o,l]=D.useState(new Map),a=D.useRef(n),c=D.useRef([]);D.useEffect(()=>()=>{c.current.forEach(clearTimeout)},[]),D.useEffect(()=>{const d=a.current,p=[];for(const[g,b]of Object.entries(n))b&&!d[g]&&p.push(g);a.current=n,p.length!==0&&(l(g=>{const b=new Map(g);return p.forEach(C=>b.set(C,"approved")),b}),c.current.push(setTimeout(()=>{l(g=>{const b=new Map(g);return p.forEach(C=>b.set(C,"fading")),b})},1500)),c.current.push(setTimeout(()=>{l(g=>{const b=new Map(g);return p.forEach(C=>b.delete(C)),b})},2500)))},[n]);const s=D.useMemo(()=>[...e].sort((d,p)=>new Date(p.lastModified).getTime()-new Date(d.lastModified).getTime()),[e]),f=D.useMemo(()=>s.filter(d=>!n[d.filePath]).length,[s,n]),h=D.useMemo(()=>r==="unreviewed"?s.filter(d=>!n[d.filePath]||o.has(d.filePath)):s,[s,r,n,o]);return u.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden flex flex-col",children:[u.jsxs("div",{className:"flex items-center gap-4 border-b border-[#e1e1e1] px-5",children:[u.jsx("button",{className:"py-3 border-b-2 border-[#232323] text-[#232323] bg-transparent cursor-pointer",children:u.jsx("span",{className:"text-[14px] leading-6",style:{fontFamily:"Sora",fontWeight:600},children:"Recently Changed Rules"})}),u.jsx("div",{className:"flex-1"}),u.jsxs("button",{onClick:()=>i("unreviewed"),className:"flex items-center gap-1.5 bg-transparent cursor-pointer py-3",children:[u.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:r==="unreviewed"?"#005C75":"#d1d5db"}}),u.jsxs("span",{className:"text-[12px] leading-5",style:{fontFamily:"Sora",fontWeight:r==="unreviewed"?600:400,color:r==="unreviewed"?"#005C75":"#626262"},children:["Unreviewed Rules (",f,")"]})]}),u.jsxs("button",{onClick:()=>i("all"),className:"flex items-center gap-1.5 bg-transparent cursor-pointer py-3",children:[u.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:r==="all"?"#005C75":"#d1d5db"}}),u.jsxs("span",{className:"text-[12px] leading-5",style:{fontFamily:"Sora",fontWeight:r==="all"?600:400,color:r==="all"?"#005C75":"#626262"},children:["All (",s.length,")"]})]})]}),u.jsxs("div",{className:"grid grid-cols-[1fr_80px_100px] px-5 py-2 border-b border-gray-100",children:[u.jsx("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium",children:"Rule"}),u.jsx("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium text-center",children:"Changed At"}),u.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium text-center flex items-center justify-center gap-1 whitespace-nowrap",children:["✓ Reviewed",u.jsxs("span",{className:"relative group",children:[u.jsx(zt,{className:"w-3 h-3 text-gray-300 cursor-help"}),u.jsx("span",{className:"absolute top-full right-0 mt-1.5 px-3 py-2 bg-gray-800 text-white text-[10px] leading-relaxed rounded shadow-lg w-52 text-center whitespace-normal opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-20",children:"Showing which rules have been reviewed and approved. Click a rule to view it and approve it"})]})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:h.slice(0,8).map(d=>{const p=n[d.filePath]??!1,g=o.get(d.filePath),b=xt(d.body,d.filePath);return u.jsx("div",{className:`border-b border-gray-50 transition-all ${g==="fading"?"duration-1000":"duration-300"}`,style:{opacity:g==="fading"?0:1},children:u.jsxs("div",{className:`grid grid-cols-[1fr_80px_100px] px-5 py-2.5 items-center cursor-pointer transition-colors duration-300 ${g==="approved"?"bg-[#f0fdf4]":"hover:bg-gray-50"}`,onClick:()=>t(d),children:[u.jsx("div",{className:"flex items-center gap-2 min-w-0",children:u.jsx("span",{className:"text-sm text-gray-900 truncate",children:b})}),u.jsx("span",{className:"text-xs text-gray-500 text-center",children:xn(d.lastModified)}),u.jsx("div",{className:"flex justify-center",children:u.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors duration-300 ${p?"bg-[#005C75] border-[#005C75]":"bg-white border-gray-300"}`,children:p&&u.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:u.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})})]})},d.filePath)})}),h.length===0&&r==="unreviewed"&&u.jsx("div",{className:"px-5 py-8 text-center text-sm text-gray-500",children:"All rules have been reviewed"}),h.length>0&&h.length<6&&u.jsx("div",{className:"h-[60px] flex-shrink-0",style:{backgroundColor:"#F0F0F0"}})]})}function Fh({refreshKey:e,reviewedStatus:n,memories:t,onViewRule:r}){const[i,o]=D.useState("unreviewed"),[l,a]=D.useState(null),[c,s]=D.useState(""),[f,h]=D.useState(0),[d,p]=D.useState(!1),[g,b]=D.useState(null),C=D.useRef(null),y=D.useRef(null),[v,S]=D.useState({topPaths:[],totalFilesWithCoverage:0,allSourceFiles:[]}),[R,I]=D.useState(!0);D.useEffect(()=>{(async()=>{I(!0);try{const N=await(await fetch("/api/memory?action=audit")).json();S({topPaths:N.topPaths||[],totalFilesWithCoverage:N.totalFilesWithCoverage||0,allSourceFiles:N.allSourceFiles||[]})}catch(A){console.error("Failed to load audit data:",A)}finally{I(!1)}})()},[e]);const w=D.useMemo(()=>i==="all"?v.topPaths:v.topPaths.filter(P=>P.matchingRules.some(A=>!n[A.filePath])),[v.topPaths,i,n]);D.useMemo(()=>v.topPaths.filter(P=>P.matchingRules.some(A=>!n[A.filePath])).length,[v.topPaths,n]);const _=P=>P.split("/").pop()||P,U=D.useMemo(()=>{const P=new Map;for(const A of v.topPaths)P.set(A.filePath,A);return P},[v.topPaths]),$=D.useMemo(()=>{if(!c.trim())return[];const P=c.toLowerCase(),A=[],N=[];for(const O of v.allSourceFiles){const W=O.toLowerCase();if(!W.includes(P))continue;const Z=U.get(O)||{filePath:O,matchingRules:[],totalTextLength:0};W.startsWith(P)?A.push(Z):N.push(Z)}return A.sort((O,W)=>O.filePath.localeCompare(W.filePath)),N.sort((O,W)=>O.filePath.localeCompare(W.filePath)),[...A,...N].slice(0,8)},[c,v.allSourceFiles,U]),k=D.useCallback(P=>{var A;b(P),a(P.filePath),s(P.filePath),p(!1),(A=C.current)==null||A.blur()},[]),F=D.useCallback(()=>{var P;s(""),b(null),a(null),(P=C.current)==null||P.focus()},[]),L=D.useCallback(P=>{var A;!d||$.length===0||(P.key==="ArrowDown"?(P.preventDefault(),h(N=>Math.min(N+1,$.length-1))):P.key==="ArrowUp"?(P.preventDefault(),h(N=>Math.max(N-1,0))):P.key==="Enter"?(P.preventDefault(),k($[f])):P.key==="Escape"&&(p(!1),(A=C.current)==null||A.blur()))},[d,$,f,k]);return D.useEffect(()=>{h(0)},[$]),u.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 flex flex-col",children:[u.jsxs("div",{className:"flex items-center gap-4 border-b border-[#e1e1e1] px-5",children:[u.jsx("button",{className:"py-3 border-b-2 border-[#232323] text-[#232323] bg-transparent cursor-pointer",children:u.jsx("span",{className:"text-[14px] leading-6",style:{fontFamily:"Sora",fontWeight:600},children:"Rule Audit"})}),u.jsxs("div",{className:"relative flex-1 max-w-[300px]",children:[u.jsx(mr,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),u.jsx("input",{ref:C,type:"text",value:c,onChange:P=>{s(P.target.value),p(!0)},onFocus:()=>{c.trim()&&p(!0)},onBlur:()=>{setTimeout(()=>p(!1),200)},onKeyDown:L,placeholder:"Search files...",className:`w-full pl-8 ${c?"pr-7":"pr-3"} py-1 text-xs border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-[#005C75] focus:border-[#005C75] bg-gray-50`}),c&&u.jsx("button",{type:"button",onMouseDown:P=>{P.preventDefault(),F()},className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 flex items-center justify-center text-gray-400 hover:text-gray-600 cursor-pointer",children:u.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:u.jsx("path",{d:"M1 1l12 12M13 1L1 13"})})}),d&&$.length>0&&u.jsx("div",{ref:y,className:"absolute left-0 top-full mt-0.5 bg-white border border-gray-200 rounded-md shadow-lg z-10 max-h-75 overflow-y-auto min-w-75 max-w-120",children:$.map((P,A)=>u.jsxs("div",{onMouseDown:N=>{N.preventDefault(),k(P)},onMouseEnter:()=>h(A),className:`flex items-center gap-2 px-3 py-2 cursor-pointer text-sm ${A===f?"bg-[#f0f9ff]":"hover:bg-gray-50"}`,children:[u.jsx(Mt,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),u.jsx("span",{className:"text-gray-700 truncate",title:P.filePath,children:(()=>{const N=P.filePath.toLowerCase().indexOf(c.toLowerCase());if(N===-1)return P.filePath;const O=P.filePath.slice(0,N),W=P.filePath.slice(N,N+c.length),Z=P.filePath.slice(N+c.length);return u.jsxs(u.Fragment,{children:[O,u.jsx("span",{className:"font-semibold text-[#005C75]",children:W}),Z]})})()}),u.jsxs("span",{className:"text-xs text-gray-400 ml-auto flex-shrink-0",children:[P.matchingRules.length," rule",P.matchingRules.length!==1?"s":""]})]},P.filePath))})]}),u.jsx("div",{className:"flex-1"}),u.jsxs("button",{onClick:()=>o("unreviewed"),className:"flex items-center gap-1.5 bg-transparent cursor-pointer py-3",children:[u.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:i==="unreviewed"?"#005C75":"#d1d5db"}}),u.jsx("span",{className:"text-[12px] leading-5",style:{fontFamily:"Sora",fontWeight:i==="unreviewed"?600:400,color:i==="unreviewed"?"#005C75":"#626262"},children:"Unreviewed Rules"})]}),u.jsxs("button",{onClick:()=>o("all"),className:"flex items-center gap-1.5 bg-transparent cursor-pointer py-3",children:[u.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:i==="all"?"#005C75":"#d1d5db"}}),u.jsx("span",{className:"text-[12px] leading-5",style:{fontFamily:"Sora",fontWeight:i==="all"?600:400,color:i==="all"?"#005C75":"#626262"},children:"All"})]})]}),u.jsxs("div",{className:"grid grid-cols-[1fr_140px_150px] px-5 py-2 border-b border-gray-100",children:[u.jsx("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium",children:"Source file"}),u.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium flex items-center justify-center gap-1 whitespace-nowrap",children:["Unreviewed Rules",u.jsxs("span",{className:"relative group",children:[u.jsx(zt,{className:"w-3 h-3 text-gray-300 flex-shrink-0 cursor-help"}),u.jsx("span",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-3 py-2 bg-gray-800 text-white text-[10px] leading-relaxed rounded shadow-lg w-48 text-center whitespace-normal opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-20",children:"Number of rules not yet reviewed for this file / Total number of rules that apply to this file"})]})]}),u.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-gray-400 font-medium flex items-center justify-center gap-1 whitespace-nowrap",children:["Unreviewed Tokens",u.jsxs("span",{className:"relative group",children:[u.jsx(zt,{className:"w-3 h-3 text-gray-300 flex-shrink-0 cursor-help"}),u.jsx("span",{className:"absolute top-full right-0 mt-1.5 px-3 py-2 bg-gray-800 text-white text-[10px] leading-relaxed rounded shadow-lg w-52 text-center whitespace-normal opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity z-20",children:"Estimated tokens from unreviewed rules / Total number of tokens from all rules that apply to this file"})]})]})]}),R&&u.jsx("div",{className:"px-5 py-6",children:u.jsxs("div",{className:"animate-pulse space-y-3",children:[u.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),u.jsx("div",{className:"h-3 bg-gray-100 rounded w-1/2"}),u.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3 mt-4"})]})}),!R&&(w.length>0||g)&&u.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:(g?[g,...w.filter(A=>A.filePath!==g.filePath)].slice(0,8):w.slice(0,8)).map((P,A)=>{const N=P.matchingRules.length,O=P.matchingRules.filter(te=>!n[te.filePath]),W=O.length,Z=O.reduce((te,m)=>te+m.bodyLength,0),ee=W>0,x=l===P.filePath,le=(g==null?void 0:g.filePath)===P.filePath;return u.jsxs("div",{children:[u.jsxs("div",{onClick:()=>a(x?null:P.filePath),className:`grid grid-cols-[1fr_140px_150px] px-5 py-2.5 items-center border-b border-gray-50 cursor-pointer ${le?"bg-[#f0f9ff] hover:bg-[#e0f2fe]":"hover:bg-gray-50"}`,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x?u.jsx($i,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}):u.jsx(Xt,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),u.jsx(Mt,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),u.jsx("span",{className:"text-sm text-gray-900 truncate",title:P.filePath,children:le?P.filePath:_(P.filePath)})]}),u.jsxs("span",{className:"text-sm text-center",children:[u.jsx("span",{className:ee?"font-semibold text-[#1A5276]":"text-gray-400",children:W}),u.jsx("span",{className:"text-gray-300",children:" / "}),u.jsx("span",{className:"text-gray-500",children:N})]}),u.jsxs("span",{className:"text-sm text-center",children:[u.jsx("span",{className:ee?"font-semibold text-[#1A5276]":"text-gray-400",children:Xe(Z).toLocaleString()}),u.jsx("span",{className:"text-gray-300",children:" / "}),u.jsx("span",{className:"text-gray-500",children:Xe(P.totalTextLength).toLocaleString()})]})]}),x&&u.jsx("div",{className:"bg-gray-50 border-b border-gray-100",children:P.matchingRules.map(te=>{const m=t.find(ce=>ce.filePath===te.filePath),re=n[te.filePath]??!1;return u.jsxs("div",{onClick:ce=>{ce.stopPropagation(),m&&r(m)},className:"flex items-center gap-2 px-5 pl-12 py-2 hover:bg-gray-100 cursor-pointer",children:[u.jsx(Hi,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),u.jsx("span",{className:"text-sm text-gray-700 truncate flex-1",children:m?xt(m.body,m.filePath):te.filePath}),u.jsxs("span",{className:"text-xs text-gray-400 flex-shrink-0",children:[Xe(te.bodyLength).toLocaleString()," ","tokens"]}),u.jsx("div",{className:`w-4 h-4 rounded-full border-2 flex items-center justify-center flex-shrink-0 ${re?"bg-[#005C75] border-[#005C75]":"bg-white border-gray-300"}`,children:re&&u.jsx("svg",{width:"8",height:"6",viewBox:"0 0 10 8",fill:"none",children:u.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},te.filePath)})})]},P.filePath)})}),!R&&w.length===0&&u.jsx("div",{className:"px-5 py-8 text-center text-sm text-gray-500",children:i==="unreviewed"?"No files have unreviewed rules":"No files have rule coverage yet"})]})}function Lh({rule:e,changeInfo:n,isReviewed:t,onApprove:r,onEdit:i,onDelete:o,onClose:l}){const a=xt(e.body,e.filePath),c=Xe(e.body.length),s=e.frontmatter.category,f=`.claude/rules/${e.filePath}`,[h,d]=D.useState(!1);return D.useEffect(()=>{const p=g=>{g.key==="Escape"&&l()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[l]),u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:l,children:u.jsxs("div",{className:"rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-auto",style:{backgroundColor:"#F8F7F6"},onClick:p=>p.stopPropagation(),children:[u.jsx("div",{className:"px-6 pt-5 pb-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[u.jsx("h2",{className:"text-[16px] font-bold text-gray-900",children:a}),n&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-xs text-gray-400 flex-shrink-0",children:xn(n.date)}),u.jsx("span",{className:`flex-shrink-0 text-[11px] uppercase font-semibold tracking-wider ${n.changeType==="added"?"text-green-600":n.changeType==="modified"?"text-orange-600":"text-red-600"}`,children:n.changeType})]})]}),s&&u.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[u.jsx("span",{className:"text-[11px] text-gray-400 uppercase tracking-wider font-medium",children:"TYPE:"}),u.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] uppercase font-semibold tracking-wider bg-[#E0F2F1] text-[#00796B]",children:s})]}),u.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[u.jsx("span",{className:"text-[11px] text-gray-400 uppercase tracking-wider font-medium",children:"FILE:"}),u.jsx("code",{className:"text-[11px] text-gray-600 font-mono",children:f}),u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(f),d(!0),setTimeout(()=>d(!1),2e3)},className:"p-0.5 rounded text-gray-400 hover:text-gray-600 cursor-pointer transition-colors",title:"Copy file path",children:h?u.jsx(at,{className:"w-3 h-3 text-green-500"}):u.jsx(Rt,{className:"w-3 h-3"})})]}),u.jsxs("div",{className:"text-[11px] text-gray-400 uppercase tracking-wider font-medium",children:["TOKENS: ~",c.toLocaleString()]})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-4",children:[u.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium uppercase tracking-wider cursor-pointer transition-colors ${t?"bg-green-600 text-white":"border border-green-600 text-green-700 hover:bg-green-50"}`,children:[u.jsx(at,{className:"w-3.5 h-3.5"}),t?"Approved":"Approve"]}),u.jsx("button",{onClick:i,className:"px-3 py-1.5 rounded text-xs font-medium uppercase tracking-wider cursor-pointer border border-gray-300 text-gray-600 hover:bg-gray-50 transition-colors",children:"Edit"}),u.jsx("button",{onClick:o,className:"px-3 py-1.5 rounded text-xs font-medium uppercase tracking-wider cursor-pointer border border-red-300 text-red-600 hover:bg-red-50 transition-colors",children:"Delete"}),u.jsx("button",{onClick:l,className:"p-1.5 rounded text-gray-400 hover:text-gray-600 hover:bg-gray-200 cursor-pointer transition-colors ml-1",children:u.jsx(Gt,{className:"w-5 h-5"})})]})]})}),e.frontmatter.paths&&e.frontmatter.paths.length>0&&u.jsxs("div",{className:"px-6 pb-4",children:[u.jsx("div",{className:"text-[13px] text-gray-700 font-semibold mb-2",children:"Applies to paths:"}),u.jsx("div",{className:"bg-white rounded-lg p-4 space-y-2.5",style:{border:"1px solid #E6E6E6"},children:e.frontmatter.paths.map((p,g)=>{const b=p.split("/"),C=b.pop()||p,y=b.length>0?b.join("/")+"/":"";return u.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-mono",children:[u.jsx(Mt,{className:"w-4 h-4 text-[#005C75] flex-shrink-0"}),u.jsxs("span",{children:[y&&u.jsx("span",{className:"text-gray-500",children:y}),u.jsx("span",{className:"font-bold text-gray-900",children:C})]})]},g)})})]}),u.jsxs("div",{className:"px-6 pb-6",children:[u.jsx("div",{className:"text-[13px] text-gray-700 font-semibold mb-2",children:"Rule Text:"}),u.jsx("div",{className:"bg-white rounded-lg p-6",style:{border:"1px solid #E6E6E6"},children:u.jsx(wi,{content:e.body})})]})]})})}function Dh(){return u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("rect",{x:"12",y:"24",width:"3",height:"3",fill:"#232323"}),u.jsx("rect",{x:"12",width:"3",height:"3",fill:"#232323"}),u.jsx("rect",{x:"12",y:"3",width:"3",height:"3",fill:"#232323"}),u.jsx("rect",{x:"12",y:"6",width:"3",height:"3",fill:"#232323"}),u.jsx("rect",{x:"12",y:"18",width:"3",height:"3",fill:"#232323"}),u.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(90 3 12)",fill:"#232323"}),u.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(90 27 12)",fill:"#232323"}),u.jsx("rect",{x:"18",y:"24",width:"3",height:"3",transform:"rotate(90 18 24)",fill:"#232323"}),u.jsx("rect",{x:"18",width:"3",height:"3",transform:"rotate(90 18 0)",fill:"#232323"}),u.jsx("rect",{x:"3",y:"18",width:"3",height:"3",transform:"rotate(-180 3 18)",fill:"#232323"}),u.jsx("rect",{x:"27",y:"18",width:"3",height:"3",transform:"rotate(-180 27 18)",fill:"#232323"}),u.jsx("rect",{x:"21",y:"24",width:"3",height:"3",transform:"rotate(90 21 24)",fill:"#232323"}),u.jsx("rect",{x:"3",y:"21",width:"3",height:"3",transform:"rotate(-180 3 21)",fill:"#232323"}),u.jsx("rect",{x:"27",y:"21",width:"3",height:"3",transform:"rotate(-180 27 21)",fill:"#232323"}),u.jsx("rect",{x:"6",y:"24",width:"3",height:"3",transform:"rotate(90 6 24)",fill:"#232323"}),u.jsx("rect",{x:"6",width:"3",height:"3",transform:"rotate(90 6 0)",fill:"#232323"}),u.jsx("rect",{x:"3",y:"6",width:"3",height:"3",transform:"rotate(-180 3 6)",fill:"#232323"}),u.jsx("rect",{x:"21",y:"6",width:"3",height:"3",transform:"rotate(-180 21 6)",fill:"#232323"}),u.jsx("rect",{x:"24",y:"24",width:"3",height:"3",transform:"rotate(90 24 24)",fill:"#232323"}),u.jsx("rect",{x:"3",y:"24",width:"3",height:"3",transform:"rotate(-180 3 24)",fill:"#232323"}),u.jsx("rect",{x:"27",y:"24",width:"3",height:"3",transform:"rotate(-180 27 24)",fill:"#232323"}),u.jsx("rect",{x:"9",y:"24",width:"3",height:"3",transform:"rotate(90 9 24)",fill:"#232323"}),u.jsx("rect",{x:"9",width:"3",height:"3",transform:"rotate(90 9 0)",fill:"#232323"}),u.jsx("rect",{x:"9",y:"3",width:"3",height:"3",transform:"rotate(90 9 3)",fill:"#232323"}),u.jsx("rect",{x:"9",y:"6",width:"3",height:"3",transform:"rotate(90 9 6)",fill:"#232323"}),u.jsx("rect",{x:"9",y:"18",width:"3",height:"3",transform:"rotate(90 9 18)",fill:"#232323"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"3",transform:"rotate(-180 3 9)",fill:"#232323"}),u.jsx("rect",{x:"24",y:"9",width:"3",height:"3",transform:"rotate(-180 24 9)",fill:"#232323"}),u.jsx("rect",{x:"12",y:"24",width:"3",height:"3",transform:"rotate(90 12 24)",fill:"#232323"}),u.jsx("rect",{x:"12",width:"3",height:"3",transform:"rotate(90 12 0)",fill:"#232323"}),u.jsx("rect",{x:"12",y:"6",width:"3",height:"3",transform:"rotate(90 12 6)",fill:"#232323"}),u.jsx("rect",{x:"12",y:"18",width:"3",height:"3",transform:"rotate(90 12 18)",fill:"#232323"}),u.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(-180 3 12)",fill:"#232323"}),u.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(-180 27 12)",fill:"#232323"})]})}function Rh(){return u.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("rect",{x:"12",y:"24",width:"3",height:"3",fill:"#005C75"}),u.jsx("rect",{x:"12",width:"3",height:"3",fill:"#005C75"}),u.jsx("rect",{x:"12",y:"3",width:"3",height:"3",fill:"#005C75"}),u.jsx("rect",{x:"12",y:"6",width:"3",height:"3",fill:"#005C75"}),u.jsx("rect",{x:"12",y:"18",width:"3",height:"3",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(90 3 12)",fill:"#005C75"}),u.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(90 27 12)",fill:"#005C75"}),u.jsx("rect",{x:"18",y:"24",width:"3",height:"3",transform:"rotate(90 18 24)",fill:"#005C75"}),u.jsx("rect",{x:"18",width:"3",height:"3",transform:"rotate(90 18 0)",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"18",width:"3",height:"3",transform:"rotate(-180 3 18)",fill:"#005C75"}),u.jsx("rect",{x:"27",y:"18",width:"3",height:"3",transform:"rotate(-180 27 18)",fill:"#005C75"}),u.jsx("rect",{x:"21",y:"24",width:"3",height:"3",transform:"rotate(90 21 24)",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"21",width:"3",height:"3",transform:"rotate(-180 3 21)",fill:"#005C75"}),u.jsx("rect",{x:"27",y:"21",width:"3",height:"3",transform:"rotate(-180 27 21)",fill:"#005C75"}),u.jsx("rect",{x:"6",y:"24",width:"3",height:"3",transform:"rotate(90 6 24)",fill:"#005C75"}),u.jsx("rect",{x:"6",width:"3",height:"3",transform:"rotate(90 6 0)",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"6",width:"3",height:"3",transform:"rotate(-180 3 6)",fill:"#005C75"}),u.jsx("rect",{x:"21",y:"6",width:"3",height:"3",transform:"rotate(-180 21 6)",fill:"#005C75"}),u.jsx("rect",{x:"24",y:"24",width:"3",height:"3",transform:"rotate(90 24 24)",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"24",width:"3",height:"3",transform:"rotate(-180 3 24)",fill:"#005C75"}),u.jsx("rect",{x:"27",y:"24",width:"3",height:"3",transform:"rotate(-180 27 24)",fill:"#005C75"}),u.jsx("rect",{x:"9",y:"24",width:"3",height:"3",transform:"rotate(90 9 24)",fill:"#005C75"}),u.jsx("rect",{x:"9",width:"3",height:"3",transform:"rotate(90 9 0)",fill:"#005C75"}),u.jsx("rect",{x:"9",y:"3",width:"3",height:"3",transform:"rotate(90 9 3)",fill:"#005C75"}),u.jsx("rect",{x:"9",y:"6",width:"3",height:"3",transform:"rotate(90 9 6)",fill:"#005C75"}),u.jsx("rect",{x:"9",y:"18",width:"3",height:"3",transform:"rotate(90 9 18)",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"3",transform:"rotate(-180 3 9)",fill:"#005C75"}),u.jsx("rect",{x:"24",y:"9",width:"3",height:"3",transform:"rotate(-180 24 9)",fill:"#005C75"}),u.jsx("rect",{x:"12",y:"24",width:"3",height:"3",transform:"rotate(90 12 24)",fill:"#005C75"}),u.jsx("rect",{x:"12",width:"3",height:"3",transform:"rotate(90 12 0)",fill:"#005C75"}),u.jsx("rect",{x:"12",y:"6",width:"3",height:"3",transform:"rotate(90 12 6)",fill:"#005C75"}),u.jsx("rect",{x:"12",y:"18",width:"3",height:"3",transform:"rotate(90 12 18)",fill:"#005C75"}),u.jsx("rect",{x:"3",y:"12",width:"3",height:"3",transform:"rotate(-180 3 12)",fill:"#005C75"}),u.jsx("rect",{x:"27",y:"12",width:"3",height:"3",transform:"rotate(-180 27 12)",fill:"#005C75"})]})}function Mh(){return u.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:u.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 py-8 lg:py-12 font-sans max-w-3xl mx-auto",children:[u.jsxs("div",{className:"text-center mb-10",children:[u.jsx("h1",{className:"text-[22px] font-semibold mb-4",style:{fontFamily:"Sora",color:"#232323"},children:"Get Started with CodeYam Memory"}),u.jsx("p",{className:"text-[15px] text-gray-500 leading-relaxed max-w-2xl mx-auto",children:"CodeYam Memory generates path-scoped Claude Rules that load automatically when Claude works on matching files. These rules capture any confusion, architectural decisions, and tribal knowledge from your as you work with Claude, ensuring sessions become more efficient and aligned with your codebase over time."})]}),u.jsxs("div",{className:"rounded-lg p-8 mb-6",style:{backgroundColor:"#EDF8FA",border:"1px solid #C8E6EC"},children:[u.jsx("h2",{className:"text-[18px] font-semibold mb-6",style:{fontFamily:"Sora",color:"#232323"},children:"Setup Steps"}),u.jsxs("ol",{className:"space-y-5",children:[u.jsxs("li",{className:"flex gap-3 items-start",children:[u.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"1"}),u.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Open Claude Code in your project terminal"})]}),u.jsxs("li",{className:"flex gap-3 items-start",children:[u.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"2"}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[u.jsx("span",{className:"text-[14px] font-medium text-gray-900",children:"Run"}),u.jsx(fr,{value:"/codeyam-memory"})]}),u.jsx("p",{className:"text-[13px] text-gray-600 mt-1",children:"This kicks off analysis of your git history to find confusion patterns."})]})]}),u.jsxs("li",{className:"flex gap-3 items-start",children:[u.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"3"}),u.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Confirm or refine the confusion patterns Claude discovers in your git history"})]}),u.jsxs("li",{className:"flex gap-3 items-start",children:[u.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-sm font-semibold",style:{backgroundColor:"#005C75",color:"#fff"},children:"4"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-[14px] font-medium text-gray-900 pt-0.5",children:"Review generated rules here, in the dashboard"}),u.jsx("p",{className:"text-[13px] text-gray-600 mt-1",children:"Come back to this page to review, edit, and approve the rules Claude creates."})]})]})]})]}),u.jsxs("div",{className:"rounded-lg p-8 mb-6",style:{backgroundColor:"#EDF8FA",border:"1px solid #C8E6EC"},children:[u.jsx("h2",{className:"text-[18px] font-semibold mb-6",style:{fontFamily:"Sora",color:"#232323"},children:"What Gets Created"}),u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute left-[15px] top-8 bottom-4",style:{borderLeft:"2px dotted #B0BEC5"}}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-start gap-4 relative",children:[u.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:u.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),u.jsxs("div",{children:[u.jsxs("p",{className:"text-[14px] font-medium text-gray-900",children:[u.jsx("code",{className:"bg-gray-200/60 px-1.5 py-0.5 rounded text-[13px]",children:".claude/rules/*.md"}),u.jsx("span",{className:"text-gray-400 mx-1.5",children:"—"}),"path-scoped guidance files"]}),u.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"Markdown files with frontmatter specifying which file paths they apply to."})]})]}),u.jsxs("div",{className:"flex items-start gap-4 relative",children:[u.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:u.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),u.jsxs("div",{children:[u.jsx("p",{className:"text-[14px] font-medium text-gray-900",children:"Rules load automatically when Claude works on matching files"}),u.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"No manual steps needed — Claude picks up relevant rules based on the files it touches."})]})]}),u.jsxs("div",{className:"flex items-start gap-4 relative",children:[u.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded flex items-center justify-center",style:{backgroundColor:"#2C3E50"},children:u.jsx("div",{className:"w-3 h-3 rounded-sm bg-white/30"})}),u.jsxs("div",{children:[u.jsx("p",{className:"text-[14px] font-medium text-gray-900",children:"Pre-commit hook to keep rules fresh and capture new patterns"}),u.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"A git hook runs automatically to update rules when related code changes and looks for any new patterns of confusion in work sessions."})]})]})]})]})]}),u.jsxs("div",{className:"rounded-lg px-8 py-5 flex items-center justify-center gap-3",style:{backgroundColor:"#1A2332"},children:[u.jsx("span",{className:"text-white text-[15px] font-medium",children:"Run"}),u.jsx(fr,{value:"/codeyam-memory"}),u.jsx("span",{className:"text-white text-[15px] font-medium",children:"in your terminal to get started"})]})]})})}function fr({value:e}){const[n,t]=D.useState(!1),r=()=>{navigator.clipboard.writeText(e),t(!0),setTimeout(()=>t(!1),2e3)};return u.jsxs("button",{onClick:r,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-[13px] font-mono cursor-pointer border-0",style:{backgroundColor:"#2C3E50",color:"#E0E0E0"},title:"Copy to clipboard",children:[e,n?u.jsx(at,{className:"w-3.5 h-3.5 text-green-400"}):u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-400",children:[u.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),u.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function lt({label:e,count:n,icon:t,bgColor:r,iconBgColor:i,textColor:o}){return u.jsx("div",{className:"rounded-lg p-4",style:{backgroundColor:r,border:"1px solid #EFEFEF"},children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:i},children:t}),u.jsxs("div",{className:"flex-1",children:[u.jsx("div",{className:"text-[32px] font-semibold leading-none mb-1",style:{color:o},children:n}),u.jsx("div",{className:"text-[11px] uppercase tracking-wider font-medium",style:{color:o},children:e})]})]})})}function zh({searchFilter:e,onSearchChange:n,onCreateNew:t,onLearnMore:r,reviewCounts:i}){return u.jsxs("div",{className:"mb-8",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 mb-6",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx(Dh,{}),u.jsx("h1",{className:"text-[24px] font-semibold mb-0",style:{fontFamily:"Sora",color:"#232323"},children:"Memory"})]}),u.jsxs("p",{className:"text-[15px] text-gray-500",children:["Rules help Claude understand your codebase patterns and conventions."," ",u.jsx("button",{onClick:r,className:"text-[#005C75] underline cursor-pointer",children:"Learn more about rules."})]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:"relative",children:[u.jsx(mr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),u.jsx("input",{type:"text",value:e,onChange:o=>n(o.target.value),placeholder:"Search rules...",className:"w-64 pl-10 pr-4 py-2 border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent text-sm"})]}),u.jsxs("button",{onClick:t,className:"flex items-center gap-2 px-4 py-2 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:[u.jsx(Kt,{className:"w-4 h-4"}),"New Rule"]})]})]}),u.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[u.jsx(lt,{label:"Total Rules",count:i.total,icon:u.jsx(Rh,{}),bgColor:"#EDF1F3",iconBgColor:"#E0E9EC",textColor:"#005C75"}),u.jsx(lt,{label:"Unreviewed",count:i.unreviewed,icon:u.jsx(Ui,{className:"w-5 h-5 text-[#1A5276]"}),bgColor:"#E9F0FB",iconBgColor:"#DBE9FF",textColor:"#1A5276"}),u.jsx(lt,{label:"Reviewed",count:i.reviewed,icon:u.jsx(at,{className:"w-5 h-5 text-[#1B7A4A]"}),bgColor:"#EAFBEF",iconBgColor:"#D4EDDB",textColor:"#1B7A4A"}),u.jsx(lt,{label:"Stale",count:i.stale,icon:u.jsx(Bi,{className:"w-5 h-5 text-[#5B21B6]"}),bgColor:"#EDE9FB",iconBgColor:"#DDD6FE",textColor:"#5B21B6"})]})]})}function _h({onClose:e,onCreateNew:n}){return u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:u.jsxs("div",{className:"bg-white rounded-lg p-8 max-w-xl w-full mx-4 relative",onClick:t=>t.stopPropagation(),children:[u.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 cursor-pointer",children:u.jsx(Gt,{className:"w-6 h-6"})}),u.jsx("h2",{className:"text-xl font-bold mb-4",children:"What are Claude Rules?"}),u.jsx("h3",{className:"mb-4 font-semibold",children:"And how does CodeYam Memory work with Claude Rules?"}),u.jsxs("div",{className:"text-gray-600 text-[15px] space-y-3 mb-6",children:[u.jsxs("p",{children:["Claude Rules are a component of"," ",u.jsx("a",{href:"https://code.claude.com/docs/en/memory#modular-rules-with-claude%2Frules%2F",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"Memory Management in Claude Code"}),'. The text of each rule is passed into the context window when working on the specific files described in the "paths" frontmatter field of the rule.']}),u.jsx("p",{children:"This allows you to provide context that is surgically specific to certain files in your codebase. They are a powerful tool but are harder to write and maintain than CLAUDE.md files."}),u.jsx("p",{children:"CodeYam Memory helps write and maintain Claude Rules. Hooks ensure that rules are reviewed and added during Claude Code working sessions. The CodeYam CLI Dashboard provides a page dedicated to Memory where you can view, edit, create, delete, and review Claude Rules."})]}),u.jsx("div",{className:"flex justify-center",children:u.jsxs("button",{onClick:n,className:"flex items-center gap-2 px-5 py-2.5 rounded-md hover:opacity-90 cursor-pointer font-mono uppercase text-xs font-semibold text-white",style:{backgroundColor:"#1A2332"},children:[u.jsx(Kt,{className:"w-4 h-4"}),"New Rule"]})})]})})}function Oh({rule:e,onConfirm:n,onCancel:t}){return u.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:u.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Delete Memory?"}),u.jsxs("p",{className:"text-gray-600 mb-4",children:["Are you sure you want to delete"," ",u.jsx("span",{className:"font-mono text-sm",children:e.filePath}),"? This cannot be undone."]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-md cursor-pointer",children:"Cancel"}),u.jsx("button",{onClick:()=>n(e),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 cursor-pointer",children:"Delete"})]})]})})}const Kh=()=>[{title:"Memory - CodeYam"},{name:"description",content:"Manage Claude Memory documentation"}],Gh=Li(function(){const{memories:n,reviewedStatus:t,memoryInitialized:r,error:i}=Di(),o=Ri(),l=Mi(),[a,c]=D.useState(""),[s,f]=D.useState(null),[h,d]=D.useState(new Set(["root"])),[p,g]=D.useState(null),[b,C]=D.useState(!1),[y,v]=D.useState(null),[S,R]=D.useState(0),[I,w]=D.useState(!1),[_,U]=D.useState(null),[$,k]=D.useState(null),[F,L]=D.useState({}),P=z=>{d(H=>{const G=new Set(H);return G.has(z)?G.delete(z):G.add(z),G})};_i({source:"memory-page"});const A=D.useMemo(()=>({...t,...F}),[t,F]),N=D.useRef(o.state);D.useEffect(()=>{const z=N.current==="loading"||N.current==="submitting",H=o.state==="idle";z&&H&&o.data&&(l.revalidate(),g(null),C(!1),R(G=>G+1)),N.current=o.state},[o.state,o.data,l]),D.useEffect(()=>{L(z=>{const H={};for(const[G,se]of Object.entries(z))t[G]!==se&&(H[G]=se);return Object.keys(H).length===Object.keys(z).length?z:H})},[t]);const O=(z,H)=>{L(G=>({...G,[z]:!0})),o.submit({action:"mark-reviewed",filePath:z,lastModified:H},{method:"POST",action:"/api/memory",encType:"application/json"})},W=z=>{L(H=>({...H,[z]:!1})),o.submit({action:"mark-unreviewed",filePath:z},{method:"POST",action:"/api/memory",encType:"application/json"})},Z=(z,H)=>{U(z),k(H??null)},ee=D.useMemo(()=>{let z=n;if(a.trim()){const H=a.toLowerCase();z=z.filter(G=>{var be;return(((be=G.filePath.split("/").pop())==null?void 0:be.replace(".md",""))||"").toLowerCase().includes(H)||G.body.toLowerCase().includes(H)})}return z},[n,a]),x=D.useMemo(()=>s?ee.some(H=>H.filePath===s)?ee.filter(H=>H.filePath===s):ee.filter(H=>H.filePath.startsWith(s+"/")||H.filePath===s):ee,[ee,s]),le=(z,H)=>{const G=p?"update":"create";o.submit({action:G,filePath:z,content:H},{method:"POST",action:"/api/memory",encType:"application/json"})},te=z=>{o.submit({action:"delete",filePath:z.filePath},{method:"POST",action:"/api/memory",encType:"application/json"}),v(null)},m=D.useMemo(()=>{const z=n.filter(H=>A[H.filePath]).length;return{total:n.length,reviewed:z,unreviewed:n.length-z,stale:0}},[n,A]),re=D.useMemo(()=>{const z=new Set(["root"]);for(const H of ee){const G=H.filePath.split("/");G.pop();let se="";for(const be of G)se=se?`${se}/${be}`:be,z.add(se)}return z},[ee]),ce=re.size===h.size&&[...re].every(z=>h.has(z)),ie=()=>{d(ce?new Set(["root"]):new Set(re))};return i?u.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:u.jsxs("div",{className:"px-12 py-6 font-sans",children:[u.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),u.jsx("p",{className:"text-base text-gray-500",children:i})]})}):r?u.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:u.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 py-8 lg:py-12 font-sans",children:[u.jsx(zh,{searchFilter:a,onSearchChange:c,onCreateNew:()=>C(!0),onLearnMore:()=>w(!0),reviewCounts:m}),(b||p)&&u.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:()=>{C(!1),g(null)},children:u.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-auto",onClick:z=>z.stopPropagation(),children:u.jsx(Ph,{rule:p,onSave:le,onCancel:()=>{C(!1),g(null)}})})}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-8 mb-8",children:[u.jsx(Ih,{memories:ee,reviewedStatus:A,onViewRule:Z}),u.jsx(Fh,{onEditRule:g,onDeleteRule:v,refreshKey:S,reviewedStatus:A,onMarkReviewed:O,onMarkUnreviewed:W,memories:n,onViewRule:Z})]}),u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsx("h2",{className:"text-xl leading-6 text-[#232323]",style:{fontFamily:"Sora",fontWeight:600},children:"All Rules"}),u.jsx("div",{className:"flex items-center gap-4",children:re.size>1&&u.jsx("button",{onClick:ie,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:ce?"Collapse All":"Expand All"})})]}),u.jsxs("div",{className:"flex gap-6",children:[u.jsx("div",{className:"hidden lg:block w-80 flex-shrink-0",children:u.jsx(Ah,{memories:ee,selectedPath:s,onSelectPath:f,expandedFolders:h,onToggleFolder:P})}),u.jsx("div",{className:"flex-1 min-w-0",children:n.length===0?u.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[u.jsx(Wi,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),u.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Rules Yet"}),u.jsxs("p",{className:"text-gray-500 mb-4",children:["Run"," ",u.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"/codeyam-memory"})," ","to generate initial memories for your codebase."]}),u.jsxs("button",{onClick:()=>C(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-[#005C75] text-white rounded-md hover:bg-[#004a5e] cursor-pointer",children:[u.jsx(Kt,{className:"w-4 h-4"}),"Create Your First Memory"]})]}):u.jsxs("div",{children:[s&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 mb-4",children:["Showing rules in"," ",u.jsx("span",{className:"font-mono bg-gray-100 px-1.5 py-0.5 rounded",children:s||"(root)"}),u.jsx("button",{onClick:()=>f(null),className:"text-[#005C75] hover:underline cursor-pointer",children:"Clear filter"})]}),u.jsx(Th,{memories:x,onEdit:g,onDelete:v,expandedFolders:h,onToggleFolder:P,reviewedStatus:A,onMarkReviewed:O,onMarkUnreviewed:W,onViewRule:Z})]})})]}),u.jsx("div",{className:"mt-8 mb-8",children:u.jsx(zi,{to:"/agent-transcripts",className:"block bg-white border border-gray-200 rounded-lg p-5 hover:border-[#005C75] hover:shadow-sm transition-all group",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#EDF1F3] flex items-center justify-center",children:u.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#005C75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("polyline",{points:"4 17 10 11 4 5"}),u.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold text-[#232323] group-hover:text-[#005C75]",style:{fontFamily:"Sora"},children:"Agent Transcripts"}),u.jsx("p",{className:"text-xs text-gray-500",children:"View background agent transcripts and tool call history"})]})]})})}),_&&!p&&(()=>{const z=n.find(H=>H.filePath===_.filePath)??_;return u.jsx(Lh,{rule:z,changeInfo:$??void 0,isReviewed:A[z.filePath]??!1,onApprove:()=>{A[z.filePath]??!1?W(z.filePath):O(z.filePath,z.lastModified),U(null)},onEdit:()=>{g(z)},onDelete:()=>{v(z),U(null)},onClose:()=>U(null)})})(),I&&u.jsx(_h,{onClose:()=>w(!1),onCreateNew:()=>{w(!1),C(!0)}}),y&&u.jsx(Oh,{rule:y,onConfirm:te,onCancel:()=>v(null)})]})}):u.jsx(Mh,{})});export{Gh as default,Kh as meta};