@minimalcorp/tsunagi 0.1.8 → 0.1.10

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 (64) hide show
  1. package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
  3. package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
  13. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  16. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
  20. package/.next/standalone/apps/web/.next/server/app/index.rsc +2 -2
  21. package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  22. package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
  23. package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  24. package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  25. package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  26. package/.next/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  27. package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
  29. package/.next/standalone/apps/web/.next/server/app/settings.rsc +1 -1
  30. package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  31. package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  32. package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  33. package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  34. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  35. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  36. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page.js.nft.json +1 -1
  37. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0_p.e.m._.js → [root-of-the-server]__05isylw._.js} +3 -3
  39. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__092mq4r._.js → [root-of-the-server]__0a0hk7u._.js} +2 -2
  40. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__12vhk8e._.js → [root-of-the-server]__0ro8-ey._.js} +4 -4
  41. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_tasks_[id]_page_tsx_0jshsm2._.js +2 -2
  42. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_08zu-qy._.js → node_modules_0--8gmr._.js} +1 -1
  43. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0f5l4h2._.js → node_modules_05c~np0._.js} +1 -1
  44. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0o0.qfb._.js → node_modules_07l1hvz._.js} +1 -1
  45. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_00je7te._.js → node_modules_0al2sy~._.js} +1 -1
  46. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0yo5dp5._.js → node_modules_0j0v234._.js} +1 -1
  47. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0zdgon0._.js → node_modules_0jnk_y1._.js} +1 -1
  48. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0-31hvv._.js → node_modules_0o-eb.1._.js} +1 -1
  49. package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0m9gy6q._.js → node_modules_11h4-ta._.js} +1 -1
  50. package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
  51. package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
  52. package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
  53. package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
  54. package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  55. package/.next/standalone/apps/web/.next/static/chunks/{0zi97fcrx3u_8.js → 0.x8varnp-h_t.js} +3 -3
  56. package/.next/standalone/apps/web/.next/static/chunks/{06h0.7cz1a2pw.js → 06_62n-hhlvr-.js} +2 -2
  57. package/.next/standalone/apps/web/.next/static/chunks/0kpkmh5umvk_l.js +3 -0
  58. package/dist/server/routes/editor.js +4 -18
  59. package/package.json +1 -1
  60. package/scripts/monaco-editor.sh +4 -8
  61. package/.next/standalone/apps/web/.next/static/chunks/0wd663tqvi2ts.js +0 -3
  62. /package/.next/standalone/apps/web/.next/static/{haxinjoLVmLKqf8KiMFfd → V_tDJMo16s0PvbVL8oDEq}/_buildManifest.js +0 -0
  63. /package/.next/standalone/apps/web/.next/static/{haxinjoLVmLKqf8KiMFfd → V_tDJMo16s0PvbVL8oDEq}/_clientMiddlewareManifest.js +0 -0
  64. /package/.next/standalone/apps/web/.next/static/{haxinjoLVmLKqf8KiMFfd → V_tDJMo16s0PvbVL8oDEq}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26568,(e,i,r)=>{"use strict";var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,s=/\n/g,o=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}i.exports=function(e,i){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];i=i||{};var r=1,u=1;function f(e){var i=e.match(s);i&&(r+=i.length);var n=e.lastIndexOf("\n");u=~n?e.length-n:u+e.length}function p(){var e={line:r,column:u};return function(i){return i.position=new g(e),_(o),i}}function g(e){this.start=e,this.end={line:r,column:u},this.source=i.source}function m(n){var s=Error(i.source+":"+r+":"+u+": "+n);if(s.reason=n,s.filename=i.source,s.line=r,s.column=u,s.source=e,i.silent);else throw s}function _(i){var r=i.exec(e);if(r){var n=r[0];return f(n),e=e.slice(n.length),r}}function v(e){var i;for(e=e||[];i=y();)!1!==i&&e.push(i);return e}function y(){var i=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return m("End of comment missing");var n=e.slice(2,r-2);return u+=2,f(n),e=e.slice(r),u+=2,i({type:"comment",comment:n})}}g.prototype.content=e,_(o);var b,S=[];for(v(S);b=function(){var e=p(),i=_(a);if(i){if(y(),!_(l))return m("property missing ':'");var r=_(c),s=e({type:"declaration",property:d(i[0].replace(n,"")),value:r?d(r[0].replace(n,"")):""});return _(h),s}}();)!1!==b&&(S.push(b),v(S));return S}},70454,(e,i,r)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,i){let r=null;if(!e||"string"!=typeof e)return r;let n=(0,s.default)(e),o="function"==typeof i;return n.forEach(e=>{if("declaration"!==e.type)return;let{property:n,value:s}=e;o?i(n,s,e):s&&((r=r||{})[n]=s)}),r};let s=n(e.r(26568))},65185,(e,i,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,s=/-([a-z])/g,o=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,c=function(e,i){return i.toUpperCase()},h=function(e,i){return"".concat(i,"-")};r.camelCase=function(e,i){var r;return(void 0===i&&(i={}),!(r=e)||o.test(r)||n.test(r))?e:(e=e.toLowerCase(),(e=i.reactCompat?e.replace(l,h):e.replace(a,h)).replace(s,c))}},15511,(e,i,r)=>{"use strict";var n=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),s=e.r(65185);function o(e,i){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,s.camelCase)(e,i)]=n)}),r}o.default=o,i.exports=o},4100,(e,i,r)=>{"use strict";var n=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===s.call(e)},c=function(e){if(!e||"[object Object]"!==s.call(e))return!1;var i,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||n.call(e,i)},h=function(e,i){o&&"__proto__"===i.name?o(e,i.name,{enumerable:!0,configurable:!0,value:i.newValue,writable:!0}):e[i.name]=i.newValue},u=function(e,i){if("__proto__"===i){if(!n.call(e,i))return;else if(a)return a(e,i).value}return e[i]};i.exports=function e(){var i,r,n,s,o,a,d=arguments[0],f=1,p=arguments.length,g=!1;for("boolean"==typeof d&&(g=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(i=arguments[f],null!=i)for(r in i)n=u(d,r),d!==(s=u(i,r))&&(g&&s&&(c(s)||(o=l(s)))?(o?(o=!1,a=n&&l(n)?n:[]):a=n&&c(n)?n:{},h(d,{name:r,newValue:e(g,a,s)})):void 0!==s&&h(d,{name:r,newValue:s}));return d}},10483,74886,76165,37287,97254,79144,67569,56590,18847,61896,60752,12666,54943,78784,e=>{"use strict";let i,r,n;var s,o,a,l,c,h,u,d,f,p,g=e.i(18050),m=e.i(71645),_=e.i(88784);function v(){}function y(){}let b=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w={};function x(e,i){return((i||w).jsx?S:b).test(e)}let C=/[ \t\n\f\r]/g;function k(e){return""===e.replace(C,"")}class E{constructor(e,i){this.attribute=i,this.property=e}}E.prototype.attribute="",E.prototype.booleanish=!1,E.prototype.boolean=!1,E.prototype.commaOrSpaceSeparated=!1,E.prototype.commaSeparated=!1,E.prototype.defined=!1,E.prototype.mustUseProperty=!1,E.prototype.number=!1,E.prototype.overloadedBoolean=!1,E.prototype.property="",E.prototype.spaceSeparated=!1,E.prototype.space=void 0;let R=0,T=B(),D=B(),L=B(),A=B(),M=B(),P=B(),O=B();function B(){return 2**++R}e.s(["boolean",0,T,"booleanish",0,D,"commaOrSpaceSeparated",0,O,"commaSeparated",0,P,"number",0,A,"overloadedBoolean",0,L,"spaceSeparated",0,M],744);var N=e.i(744);let I=Object.keys(N);class F extends E{constructor(e,i,r,n){let s=-1;if(super(e,i),function(e,i,r){r&&(e[i]=r)}(this,"space",n),"number"==typeof r)for(;++s<I.length;){const e=I[s];!function(e,i,r){r&&(e[i]=r)}(this,I[s],(r&N[e])===N[e])}}}function z(e){return e.toLowerCase()}F.prototype.defined=!0;let H=/[A-Z]/g,j=/-[a-z]/g,W=/^data[-\w.:]+$/i;function $(e){return"-"+e.toLowerCase()}function U(e){return e.charAt(1).toUpperCase()}let q={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"};class V{constructor(e,i,r){this.normal=i,this.property=e,r&&(this.space=r)}}function K(e,i){let r={},n={};for(let i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new V(r,n,i)}function Y(e){let i={},r={};for(let[n,s]of Object.entries(e.properties)){let o=new F(n,e.transform(e.attributes||{},n),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),i[n]=o,r[z(n)]=n,r[z(o.attribute)]=n}return new V(i,r,e.space)}V.prototype.normal={},V.prototype.property={},V.prototype.space=void 0;let X=Y({properties:{ariaActiveDescendant:null,ariaAtomic:D,ariaAutoComplete:null,ariaBusy:D,ariaChecked:D,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:M,ariaCurrent:null,ariaDescribedBy:M,ariaDetails:null,ariaDisabled:D,ariaDropEffect:M,ariaErrorMessage:null,ariaExpanded:D,ariaFlowTo:M,ariaGrabbed:D,ariaHasPopup:null,ariaHidden:D,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:M,ariaLevel:A,ariaLive:null,ariaModal:D,ariaMultiLine:D,ariaMultiSelectable:D,ariaOrientation:null,ariaOwns:M,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:D,ariaReadOnly:D,ariaRelevant:null,ariaRequired:D,ariaRoleDescription:M,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:D,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform:(e,i)=>"role"===i?i:"aria-"+i.slice(4).toLowerCase()});function G(e,i){return i in e?e[i]:i}function J(e,i){return G(e,i.toLowerCase())}let Z=Y({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:P,acceptCharset:M,accessKey:M,action:null,allow:null,allowFullScreen:T,allowPaymentRequest:T,allowUserMedia:T,alt:null,as:null,async:T,autoCapitalize:null,autoComplete:M,autoFocus:T,autoPlay:T,blocking:M,capture:null,charSet:null,checked:T,cite:null,className:M,cols:A,colSpan:null,content:null,contentEditable:D,controls:T,controlsList:M,coords:A|P,crossOrigin:null,data:null,dateTime:null,decoding:null,default:T,defer:T,dir:null,dirName:null,disabled:T,download:L,draggable:D,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:T,formTarget:null,headers:M,height:A,hidden:L,high:A,href:null,hrefLang:null,htmlFor:M,httpEquiv:M,id:null,imageSizes:null,imageSrcSet:null,inert:T,inputMode:null,integrity:null,is:null,isMap:T,itemId:null,itemProp:M,itemRef:M,itemScope:T,itemType:M,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:T,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:T,muted:T,name:null,nonce:null,noModule:T,noValidate:T,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:T,optimum:A,pattern:null,ping:M,placeholder:null,playsInline:T,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:T,referrerPolicy:null,rel:M,required:T,reversed:T,rows:A,rowSpan:A,sandbox:M,scope:null,scoped:T,seamless:T,selected:T,shadowRootClonable:T,shadowRootDelegatesFocus:T,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:D,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:T,useMap:null,value:D,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:M,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:T,declare:T,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:T,noHref:T,noShade:T,noWrap:T,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:D,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:T,disableRemotePlayback:T,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:J}),Q=Y({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:O,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:M,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:T,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:P,g2:P,glyphName:P,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:O,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,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:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:M,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:O,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:O,rev:O,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:O,requiredFeatures:O,requiredFonts:O,requiredFormats:O,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:O,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:O,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:O,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:G}),ee=Y({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,i)=>"xlink:"+i.slice(5).toLowerCase()}),et=Y({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:J}),ei=Y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,i)=>"xml:"+i.slice(3).toLowerCase()}),er=K([X,Z,ee,et,ei],"html"),en=K([X,Q,ee,et,ei],"svg");var es=e.i(15511);let eo=el("end"),ea=el("start");function el(e){return function(i){let r=i&&i.position&&i.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function ec(e){return e&&"object"==typeof e?"position"in e||"type"in e?eu(e.position):"start"in e||"end"in e?eu(e):"line"in e||"column"in e?eh(e):"":""}function eh(e){return ed(e&&e.line)+":"+ed(e&&e.column)}function eu(e){return eh(e&&e.start)+"-"+eh(e&&e.end)}function ed(e){return e&&"number"==typeof e?e:1}class ef extends Error{constructor(e,i,r){super(),"string"==typeof i&&(r=i,i=void 0);let n="",s={},o=!1;if(i&&(s="line"in i&&"column"in i||"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof e?n=e:!s.cause&&e&&(o=!0,n=e.message,s.cause=e),!s.ruleId&&!s.source&&"string"==typeof r){const e=r.indexOf(":");-1===e?s.ruleId=r:(s.source=r.slice(0,e),s.ruleId=r.slice(e+1))}if(!s.place&&s.ancestors&&s.ancestors){const e=s.ancestors[s.ancestors.length-1];e&&(s.place=e.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=a?a.line:void 0,this.name=ec(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&"string"==typeof s.cause.stack?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ef.prototype.file="",ef.prototype.name="",ef.prototype.reason="",ef.prototype.message="",ef.prototype.stack="",ef.prototype.column=void 0,ef.prototype.line=void 0,ef.prototype.ancestors=void 0,ef.prototype.cause=void 0,ef.prototype.fatal=void 0,ef.prototype.place=void 0,ef.prototype.ruleId=void 0,ef.prototype.source=void 0;let ep={}.hasOwnProperty,eg=new Map,em=/[A-Z]/g,e_=new Set(["table","tbody","thead","tfoot","tr"]),ev=new Set(["td","th"]),ey="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eb(e,i,r){var n,s,o,a,l,c,h,u,d;let f,p,g,m,_,y,b,S,w,x,C;return"element"===i.type?(n=e,s=i,o=r,p=f=n.schema,"svg"===s.tagName.toLowerCase()&&"html"===f.space&&(n.schema=en),n.ancestors.push(s),g=eC(n,s.tagName,!1),m=function(e,i){let r,n,s={};for(n in i.properties)if("children"!==n&&ep.call(i.properties,n)){let o=function(e,i,r){let n=function(e,i){let r=z(i),n=i,s=E;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&W.test(i)){if("-"===i.charAt(4)){let e=i.slice(5).replace(j,U);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=i.slice(4);if(!j.test(e)){let r=e.replace(H,$);"-"!==r.charAt(0)&&(r="-"+r),i="data"+r}}s=F}return new s(n,i)}(e.schema,i);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){var s;let i;if(Array.isArray(r)&&(r=n.commaSeparated?(i={},(""===(s=r)[s.length-1]?[...s,""]:s).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()):r.join(" ").trim()),"style"===n.property){let i="object"==typeof r?r:function(e,i){try{return(0,es.default)(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let i=new ef("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=ey+"#cannot-parse-style-attribute",i}}(e,String(r));return"css"===e.stylePropertyNameCase&&(i=function(e){let i,r={};for(i in e)ep.call(e,i)&&(r[function(e){let i=e.replace(em,eE);return"ms-"===i.slice(0,3)&&(i="-"+i),i}(i)]=e[i]);return r}(i)),["style",i]}return["react"===e.elementAttributeNameCase&&n.space?q[n.property]||n.property:n.attribute,r]}}(e,n,i.properties[n]);if(o){let[n,a]=o;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof a&&ev.has(i.tagName)?r=a:s[n]=a}}return r&&((s.style||(s.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),s}(n,s),_=ex(n,s),e_.has(s.tagName)&&(_=_.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&k(e.value):k(e))})),eS(n,m,g,s),ew(m,_),n.ancestors.pop(),n.schema=f,n.create(s,g,m,o)):"mdxFlowExpression"===i.type||"mdxTextExpression"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater){let r=i.data.estree.body[0];return v("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}ek(e,i.position)}(e,i):"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?(a=e,l=i,c=r,b=y=a.schema,"svg"===l.name&&"html"===y.space&&(a.schema=en),a.ancestors.push(l),S=null===l.name?a.Fragment:eC(a,l.name,!0),w=function(e,i){let r={};for(let n of i.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let i=n.data.estree.body[0];v("ExpressionStatement"===i.type);let s=i.expression;v("ObjectExpression"===s.type);let o=s.properties[0];v("SpreadElement"===o.type),Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else ek(e,i.position);else{let s,o=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let i=n.value.data.estree.body[0];v("ExpressionStatement"===i.type),s=e.evaluater.evaluateExpression(i.expression)}else ek(e,i.position);else s=null===n.value||n.value;r[o]=s}return r}(a,l),x=ex(a,l),eS(a,w,S,l),ew(w,x),a.ancestors.pop(),a.schema=y,a.create(l,S,w,c)):"mdxjsEsm"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);ek(e,i.position)}(e,i):"root"===i.type?(h=e,u=i,d=r,ew(C={},ex(h,u)),h.create(u,h.Fragment,C,d)):"text"===i.type?i.value:void 0}function eS(e,i,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(i.node=n)}function ew(e,i){if(i.length>0){let r=i.length>1?i:i[0];r&&(e.children=r)}}function ex(e,i){let r=[],n=-1,s=e.passKeys?new Map:eg;for(;++n<i.children.length;){let o,a=i.children[n];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let i=s.get(e)||0;o=e+"-"+i,s.set(e,i+1)}}let l=eb(e,a,o);void 0!==l&&r.push(l)}return r}function eC(e,i,r){let n;if(r)if(i.includes(".")){let e,r=i.split("."),s=-1;for(;++s<r.length;){let i=x(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};e=e?{type:"MemberExpression",object:e,property:i,computed:!!(s&&"Literal"===i.type),optional:!1}:i}v(e,"always a result"),n=e}else n=x(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};else n={type:"Literal",value:i};if("Literal"===n.type){let i=n.value;return ep.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);ek(e)}function ek(e,i){let r=new ef("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=ey+"#cannot-handle-mdx-estrees-without-createevaluater",r}function eE(e){return"-"+e.toLowerCase()}let eR={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"]},eT={};function eD(e,i){let r=i||eT;return eL(e,"boolean"!=typeof r.includeImageAlt||r.includeImageAlt,"boolean"!=typeof r.includeHtml||r.includeHtml)}function eL(e,i,r){var n;if((n=e)&&"object"==typeof n){if("value"in e)return"html"!==e.type||r?e.value:"";if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eA(e.children,i,r)}return Array.isArray(e)?eA(e,i,r):""}function eA(e,i,r){let n=[],s=-1;for(;++s<e.length;)n[s]=eL(e[s],i,r);return n.join("")}function eM(e,i,r,n){let s,o=e.length,a=0;if(i=i<0?-i>o?0:o+i:i>o?o:i,r=r>0?r:0,n.length<1e4)(s=Array.from(n)).unshift(i,r),e.splice(...s);else for(r&&e.splice(i,r);a<n.length;)(s=n.slice(a,a+1e4)).unshift(i,0),e.splice(...s),a+=1e4,i+=1e4}function eP(e,i){return e.length>0?(eM(e,e.length,0,i),e):i}let eO={}.hasOwnProperty;function eB(e){let i={},r=-1;for(;++r<e.length;)!function(e,i){let r;for(r in i){let n,s=(eO.call(e,r)?e[r]:void 0)||(e[r]={}),o=i[r];if(o)for(n in o){eO.call(s,n)||(s[n]=[]);let e=o[n];!function(e,i){let r=-1,n=[];for(;++r<i.length;)("after"===i[r].add?e:n).push(i[r]);eM(e,0,0,n)}(s[n],Array.isArray(e)?e:e?[e]:[])}}}(i,e[r]);return i}let eN=eY(/[A-Za-z]/),eI=eY(/[\dA-Za-z]/),eF=eY(/[#-'*+\--9=?A-Z^-~]/);function ez(e){return null!==e&&(e<32||127===e)}let eH=eY(/\d/),ej=eY(/[\dA-Fa-f]/),eW=eY(/[!-/:-@[-`{-~]/);function e$(e){return null!==e&&e<-2}function eU(e){return null!==e&&(e<0||32===e)}function eq(e){return -2===e||-1===e||32===e}let eV=eY(/\p{P}|\p{S}/u),eK=eY(/\s/);function eY(e){return function(i){return null!==i&&i>-1&&e.test(String.fromCharCode(i))}}function eX(e,i,r,n){let s=n?n-1:1/0,o=0;return function(n){return eq(n)?(e.enter(r),function n(a){return eq(a)&&o++<s?(e.consume(a),n):(e.exit(r),i(a))}(n)):i(n)}}let eG={tokenize:function(e){let i,r=e.attempt(this.parser.constructs.contentInitial,function(i){return null===i?void e.consume(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,r,"linePrefix"))},function(r){return e.enter("paragraph"),function r(n){let s=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=s),i=s,function i(n){if(null===n){e.exit("chunkText"),e.exit("paragraph"),e.consume(n);return}return e$(n)?(e.consume(n),e.exit("chunkText"),r):(e.consume(n),i)}(n)}(r)});return r}},eJ={tokenize:function(e){let i,r,n,s=this,o=[],a=0;return l;function l(i){if(a<o.length){let r=o[a];return s.containerState=r[1],e.attempt(r[0].continuation,c,h)(i)}return h(i)}function c(e){if(a++,s.containerState._closeFlow){let r;s.containerState._closeFlow=void 0,i&&v();let n=s.events.length,o=n;for(;o--;)if("exit"===s.events[o][0]&&"chunkFlow"===s.events[o][1].type){r=s.events[o][1].end;break}_(a);let l=n;for(;l<s.events.length;)s.events[l][1].end={...r},l++;return eM(s.events,o+1,0,s.events.slice(n)),s.events.length=l,h(e)}return l(e)}function h(r){if(a===o.length){if(!i)return f(r);if(i.currentConstruct&&i.currentConstruct.concrete)return g(r);s.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return s.containerState={},e.check(eZ,u,d)(r)}function u(e){return i&&v(),_(a),f(e)}function d(e){return s.parser.lazy[s.now().line]=a!==o.length,n=s.now().offset,g(e)}function f(i){return s.containerState={},e.attempt(eZ,p,g)(i)}function p(e){return a++,o.push([s.currentConstruct,s.containerState]),f(e)}function g(n){if(null===n){i&&v(),_(0),e.consume(n);return}return i=i||s.parser.flow(s.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),function i(r){if(null===r){m(e.exit("chunkFlow"),!0),_(0),e.consume(r);return}return e$(r)?(e.consume(r),m(e.exit("chunkFlow")),a=0,s.interrupt=void 0,l):(e.consume(r),i)}(n)}function m(e,o){let l=s.sliceStream(e);if(o&&l.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(l),s.parser.lazy[e.start.line]){let e,r,o=i.events.length;for(;o--;)if(i.events[o][1].start.offset<n&&(!i.events[o][1].end||i.events[o][1].end.offset>n))return;let l=s.events.length,c=l;for(;c--;)if("exit"===s.events[c][0]&&"chunkFlow"===s.events[c][1].type){if(e){r=s.events[c][1].end;break}e=!0}for(_(a),o=l;o<s.events.length;)s.events[o][1].end={...r},o++;eM(s.events,c+1,0,s.events.slice(l)),s.events.length=o}}function _(i){let r=o.length;for(;r-- >i;){let i=o[r];s.containerState=i[1],i[0].exit.call(s,e)}o.length=i}function v(){i.write([null]),r=void 0,i=void 0,s.containerState._closeFlow=void 0}}},eZ={tokenize:function(e,i,r){return eX(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},eQ={partial:!0,tokenize:function(e,i,r){return function(i){return eq(i)?eX(e,n,"linePrefix")(i):n(i)};function n(e){return null===e||e$(e)?i(e):r(e)}}};class e0{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){let r=null==i?1/0:i;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,i,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(i||0),1/0);return r&&e1(this.left,r),n.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),e1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),e1(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let i=this.left.splice(e,1/0);e1(this.right,i.reverse())}else{let i=this.right.splice(this.left.length+this.right.length-e,1/0);e1(this.left,i.reverse())}}}function e1(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function e2(e){let i,r,n,s,o,a,l,c={},h=-1,u=new e0(e);for(;++h<u.length;){for(;h in c;)h=c[h];if(i=u.get(h),h&&"chunkFlow"===i[1].type&&"listItemPrefix"===u.get(h-1)[1].type&&((n=0)<(a=i[1]._tokenizer.events).length&&"lineEndingBlank"===a[n][1].type&&(n+=2),n<a.length&&"content"===a[n][1].type))for(;++n<a.length&&"content"!==a[n][1].type;)"chunkText"===a[n][1].type&&(a[n][1]._isInFirstContentOfListItem=!0,n++);if("enter"===i[0])i[1].contentType&&(Object.assign(c,function(e,i){let r,n,s=e.get(i)[1],o=e.get(i)[2],a=i-1,l=[],c=s._tokenizer;!c&&(c=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));let h=c.events,u=[],d={},f=-1,p=s,g=0,m=0,_=[0];for(;p;){for(;e.get(++a)[1]!==p;);l.push(a),!p._tokenizer&&(r=o.sliceStream(p),p.next||r.push(null),n&&c.defineSkip(p.start),p._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(r),p._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),n=p,p=p.next}for(p=s;++f<h.length;)"exit"===h[f][0]&&"enter"===h[f-1][0]&&h[f][1].type===h[f-1][1].type&&h[f][1].start.line!==h[f][1].end.line&&(m=f+1,_.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(c.events=[],p?(p._tokenizer=void 0,p.previous=void 0):_.pop(),f=_.length;f--;){let i=h.slice(_[f],_[f+1]),r=l.pop();u.push([r,r+i.length-1]),e.splice(r,2,i)}for(u.reverse(),f=-1;++f<u.length;)d[g+u[f][0]]=g+u[f][1],g+=u[f][1]-u[f][0]-1;return d}(u,h)),h=c[h],l=!0);else if(i[1]._container){for(n=h,r=void 0;n--;)if("lineEnding"===(s=u.get(n))[1].type||"lineEndingBlank"===s[1].type)"enter"===s[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=n);else if("linePrefix"===s[1].type||"listItemIndent"===s[1].type);else break;r&&(i[1].end={...u.get(r)[1].start},(o=u.slice(r,h)).unshift(i),u.splice(r,h-r+1,o))}}return eM(e,0,1/0,u.slice(0)),!l}let e5={resolve:function(e){return e2(e),e},tokenize:function(e,i){let r;return function(i){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(i)};function n(i){return null===i?s(i):e$(i)?e.check(e3,o,s)(i):(e.consume(i),n)}function s(r){return e.exit("chunkContent"),e.exit("content"),i(r)}function o(i){return e.consume(i),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},e3={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,s,"linePrefix")};function s(s){if(null===s||e$(s))return r(s);let o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(s):e.interrupt(n.parser.constructs.flow,r,i)(s)}}},e4={tokenize:function(e){let i=this,r=e.attempt(eQ,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,eX(e,e.attempt(this.parser.constructs.flow,n,e.attempt(e5,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i.currentConstruct=void 0,r)}}},e6={resolveAll:te()},e9=e7("string"),e8=e7("text");function e7(e){return{resolveAll:te("text"===e?tt:void 0),tokenize:function(i){let r=this,n=this.parser.constructs[e],s=i.attempt(n,o,a);return o;function o(e){return c(e)?s(e):a(e)}function a(e){return null===e?void i.consume(e):(i.enter("data"),i.consume(e),l)}function l(e){return c(e)?(i.exit("data"),s(e)):(i.consume(e),l)}function c(e){if(null===e)return!0;let i=n[e],s=-1;if(i)for(;++s<i.length;){let e=i[s];if(!e.previous||e.previous.call(r,r.previous))return!0}return!1}}}}function te(e){return function(i,r){let n,s=-1;for(;++s<=i.length;)void 0===n?i[s]&&"data"===i[s][1].type&&(n=s,s++):i[s]&&"data"===i[s][1].type||(s!==n+2&&(i[n][1].end=i[s-1][1].end,i.splice(n+2,s-n-2),s=n+2),n=void 0);return e?e(i,r):i}}function tt(e,i){let r=0;for(;++r<=e.length;)if((r===e.length||"lineEnding"===e[r][1].type)&&"data"===e[r-1][1].type){let n,s=e[r-1][1],o=i.sliceStream(s),a=o.length,l=-1,c=0;for(;a--;){let e=o[a];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)c++,l--;if(l)break;l=-1}else if(-2===e)n=!0,c++;else if(-1===e);else{a++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(c=0),c){let o={type:r===e.length||n||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:s.start._bufferIndex+l,_index:s.start._index+a,line:s.end.line,column:s.end.column-c,offset:s.end.offset-c},end:{...s.end}};s.end={...o.start},s.start.offset===s.end.offset?Object.assign(s,o):(e.splice(r,0,["enter",o,i],["exit",o,i]),r+=2)}r++}return e}function ti(e){return null===e||eU(e)||eK(e)?1:eV(e)?2:void 0}function tr(e,i,r){let n=[],s=-1;for(;++s<e.length;){let o=e[s].resolveAll;o&&!n.includes(o)&&(i=o(i,r),n.push(o))}return i}let tn={name:"attention",resolveAll:function(e,i){let r,n,s,o,a,l,c,h,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(r=u;r--;)if("exit"===e[r][0]&&"attentionSequence"===e[r][1].type&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[r][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[u][1].start};ts(d,-l),ts(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[u][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=eP(c,[["enter",e[r][1],i],["exit",e[r][1],i]])),c=eP(c,[["enter",n,i],["enter",o,i],["exit",o,i],["enter",s,i]]),c=eP(c,tr(i.parser.constructs.insideSpan.null,e.slice(r+1,u),i)),c=eP(c,[["exit",s,i],["enter",a,i],["exit",a,i],["exit",n,i]]),e[u][1].end.offset-e[u][1].start.offset?(h=2,c=eP(c,[["enter",e[u][1],i],["exit",e[u][1],i]])):h=0,eM(e,r-1,u-r+3,c),u=r+c.length-h-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,i){let r,n=this.parser.constructs.attentionMarkers.null,s=this.previous,o=ti(s);return function(a){return r=a,e.enter("attentionSequence"),function a(l){if(l===r)return e.consume(l),a;let c=e.exit("attentionSequence"),h=ti(l),u=!h||2===h&&o||n.includes(l),d=!o||2===o&&h||n.includes(s);return c._open=!!(42===r?u:u&&(o||!d)),c._close=!!(42===r?d:d&&(h||!u)),i(l)}(a)}}};function ts(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}let to={continuation:{tokenize:function(e,i,r){let n=this;return function(i){return eq(i)?eX(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):s(i)};function s(n){return e.attempt(to,i,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,i,r){let n=this;return function(i){if(62===i){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),s}return r(i)};function s(r){return eq(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(r))}}},ta={name:"characterEscape",tokenize:function(e,i,r){return function(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),n};function n(n){return eW(n)?(e.enter("characterEscapeValue"),e.consume(n),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(n)}}},tl=document.createElement("i");function tc(e){let i="&"+e+";";tl.innerHTML=i;let r=tl.textContent;return(59!==r.charCodeAt(r.length-1)||"semi"===e)&&r!==i&&r}let th={name:"characterReference",tokenize:function(e,i,r){let n,s,o=this,a=0;return function(i){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),l};function l(i){return 35===i?(e.enter("characterReferenceMarkerNumeric"),e.consume(i),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),n=31,s=eI,h(i))}function c(i){return 88===i||120===i?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(i),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,s=ej,h):(e.enter("characterReferenceValue"),n=7,s=eH,h(i))}function h(l){if(59===l&&a){let n=e.exit("characterReferenceValue");return s!==eI||tc(o.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),i):r(l)}return s(l)&&a++<n?(e.consume(l),h):r(l)}}},tu={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return null===i?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s)};function s(e){return n.parser.lazy[n.now().line]?r(e):i(e)}}},td={concrete:!0,name:"codeFenced",tokenize:function(e,i,r){let n,s=this,o={partial:!0,tokenize:function(e,i,r){let o=0;return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a};function a(i){return e.enter("codeFencedFence"),eq(i)?eX(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):c(i)}function c(i){return i===n?(e.enter("codeFencedFenceSequence"),function i(s){return s===n?(o++,e.consume(s),i):o>=l?(e.exit("codeFencedFenceSequence"),eq(s)?eX(e,h,"whitespace")(s):h(s)):r(s)}(i)):r(i)}function h(n){return null===n||e$(n)?(e.exit("codeFencedFence"),i(n)):r(n)}}},a=0,l=0;return function(i){var o;let h;return o=i,a=(h=s.events[s.events.length-1])&&"linePrefix"===h[1].type?h[2].sliceSerialize(h[1],!0).length:0,n=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function i(s){return s===n?(l++,e.consume(s),i):l<3?r(s):(e.exit("codeFencedFenceSequence"),eq(s)?eX(e,c,"whitespace")(s):c(s))}(o)};function c(o){return null===o||e$(o)?(e.exit("codeFencedFence"),s.interrupt?i(o):e.check(tu,u,g)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function i(s){return null===s||e$(s)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(s)):eq(s)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eX(e,h,"whitespace")(s)):96===s&&s===n?r(s):(e.consume(s),i)}(o))}function h(i){return null===i||e$(i)?c(i):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function i(s){return null===s||e$(s)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(s)):96===s&&s===n?r(s):(e.consume(s),i)}(i))}function u(i){return e.attempt(o,g,d)(i)}function d(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),f}function f(i){return a>0&&eq(i)?eX(e,p,"linePrefix",a+1)(i):p(i)}function p(i){return null===i||e$(i)?e.check(tu,u,g)(i):(e.enter("codeFlowValue"),function i(r){return null===r||e$(r)?(e.exit("codeFlowValue"),p(r)):(e.consume(r),i)}(i))}function g(r){return e.exit("codeFenced"),i(r)}}},tf={name:"codeIndented",tokenize:function(e,i,r){let n=this;return function(i){return e.enter("codeIndented"),eX(e,s,"linePrefix",5)(i)};function s(i){let s=n.events[n.events.length-1];return s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?function i(r){return null===r?o(r):e$(r)?e.attempt(tp,i,o)(r):(e.enter("codeFlowValue"),function r(n){return null===n||e$(n)?(e.exit("codeFlowValue"),i(n)):(e.consume(n),r)}(r))}(i):r(i)}function o(r){return e.exit("codeIndented"),i(r)}}},tp={partial:!0,tokenize:function(e,i,r){let n=this;return s;function s(i){return n.parser.lazy[n.now().line]?r(i):e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):eX(e,o,"linePrefix",5)(i)}function o(e){let o=n.events[n.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(e):e$(e)?s(e):r(e)}}};function tg(e,i,r,n,s,o,a,l,c){let h=c||1/0,u=0;return function(i){return 60===i?(e.enter(n),e.enter(s),e.enter(o),e.consume(i),e.exit(o),d):null===i||32===i||41===i||ez(i)?r(i):(e.enter(n),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(i))};function d(r){return 62===r?(e.enter(o),e.consume(r),e.exit(o),e.exit(s),e.exit(n),i):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(r))}function f(i){return 62===i?(e.exit("chunkString"),e.exit(l),d(i)):null===i||60===i||e$(i)?r(i):(e.consume(i),92===i?p:f)}function p(i){return 60===i||62===i||92===i?(e.consume(i),f):f(i)}function g(s){return!u&&(null===s||41===s||eU(s))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(n),i(s)):u<h&&40===s?(e.consume(s),u++,g):41===s?(e.consume(s),u--,g):null===s||32===s||40===s||ez(s)?r(s):(e.consume(s),92===s?m:g)}function m(i){return 40===i||41===i||92===i?(e.consume(i),g):g(i)}}function tm(e,i,r,n,s,o){let a,l=this,c=0;return function(i){return e.enter(n),e.enter(s),e.consume(i),e.exit(s),e.enter(o),h};function h(d){return c>999||null===d||91===d||93===d&&!a||94===d&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):93===d?(e.exit(o),e.enter(s),e.consume(d),e.exit(s),e.exit(n),i):e$(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(i){return null===i||91===i||93===i||e$(i)||c++>999?(e.exit("chunkString"),h(i)):(e.consume(i),a||(a=!eq(i)),92===i?d:u)}function d(i){return 91===i||92===i||93===i?(e.consume(i),c++,u):u(i)}}function t_(e,i,r,n,s,o){let a;return function(i){return 34===i||39===i||40===i?(e.enter(n),e.enter(s),e.consume(i),e.exit(s),a=40===i?41:i,l):r(i)};function l(r){return r===a?(e.enter(s),e.consume(r),e.exit(s),e.exit(n),i):(e.enter(o),c(r))}function c(i){return i===a?(e.exit(o),l(a)):null===i?r(i):e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(i))}function h(i){return i===a||null===i||e$(i)?(e.exit("chunkString"),c(i)):(e.consume(i),92===i?u:h)}function u(i){return i===a||92===i?(e.consume(i),h):h(i)}}function tv(e,i){let r;return function n(s){return e$(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,n):eq(s)?eX(e,n,r?"linePrefix":"lineSuffix")(s):i(s)}}function ty(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tb={partial:!0,tokenize:function(e,i,r){return function(i){return eU(i)?tv(e,n)(i):r(i)};function n(i){return t_(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function s(i){return eq(i)?eX(e,o,"whitespace")(i):o(i)}function o(e){return null===e||e$(e)?i(e):r(e)}}},tS=["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"],tw=["pre","script","style","textarea"],tx={partial:!0,tokenize:function(e,i,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(eQ,i,r)}}},tC={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):r(i)};function s(e){return n.parser.lazy[n.now().line]?r(e):i(e)}}},tk={name:"labelEnd",resolveAll:function(e){let i=-1,r=[];for(;++i<e.length;){let n=e[i][1];if(r.push(e[i]),"labelImage"===n.type||"labelLink"===n.type||"labelEnd"===n.type){let e="labelImage"===n.type?4:2;n.type="data",i+=e}}return e.length!==r.length&&eM(e,0,e.length,r),e},resolveTo:function(e,i){let r,n,s,o,a=e.length,l=0;for(;a--;)if(r=e[a][1],n){if("link"===r.type||"labelLink"===r.type&&r._inactive)break;"enter"===e[a][0]&&"labelLink"===r.type&&(r._inactive=!0)}else if(s){if("enter"===e[a][0]&&("labelImage"===r.type||"labelLink"===r.type)&&!r._balanced&&(n=a,"labelLink"!==r.type)){l=2;break}}else"labelEnd"===r.type&&(s=a);let c={type:"labelLink"===e[n][1].type?"link":"image",start:{...e[n][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[n][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[n+l+2][1].end},end:{...e[s-2][1].start}};return o=eP(o=[["enter",c,i],["enter",h,i]],e.slice(n+1,n+l+3)),o=eP(o,[["enter",u,i]]),o=eP(o,tr(i.parser.constructs.insideSpan.null,e.slice(n+l+4,s-3),i)),o=eP(o,[["exit",u,i],e[s-2],e[s-1],["exit",h,i]]),o=eP(o,e.slice(s+1)),o=eP(o,[["exit",c,i]]),eM(e,n,e.length,o),e},tokenize:function(e,i,r){let n,s,o=this,a=o.events.length;for(;a--;)if(("labelImage"===o.events[a][1].type||"labelLink"===o.events[a][1].type)&&!o.events[a][1]._balanced){n=o.events[a][1];break}return function(i){return n?n._inactive?u(i):(s=o.parser.defined.includes(ty(o.sliceSerialize({start:n.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelEnd"),l):r(i)};function l(i){return 40===i?e.attempt(tE,h,s?h:u)(i):91===i?e.attempt(tR,h,s?c:u)(i):s?h(i):u(i)}function c(i){return e.attempt(tT,h,u)(i)}function h(e){return i(e)}function u(e){return n._balanced=!0,r(e)}}},tE={tokenize:function(e,i,r){return function(i){return e.enter("resource"),e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),n};function n(i){return eU(i)?tv(e,s)(i):s(i)}function s(i){return 41===i?h(i):tg(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(i)}function o(i){return eU(i)?tv(e,l)(i):h(i)}function a(e){return r(e)}function l(i){return 34===i||39===i||40===i?t_(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(i):h(i)}function c(i){return eU(i)?tv(e,h)(i):h(i)}function h(n){return 41===n?(e.enter("resourceMarker"),e.consume(n),e.exit("resourceMarker"),e.exit("resource"),i):r(n)}}},tR={tokenize:function(e,i,r){let n=this;return function(i){return tm.call(n,e,s,o,"reference","referenceMarker","referenceString")(i)};function s(e){return n.parser.defined.includes(ty(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?i(e):r(e)}function o(e){return r(e)}}},tT={tokenize:function(e,i,r){return function(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),n};function n(n){return 93===n?(e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),e.exit("reference"),i):r(n)}}},tD={name:"labelStartImage",resolveAll:tk.resolveAll,tokenize:function(e,i,r){let n=this;return function(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),s};function s(i){return 91===i?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),o):r(i)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):i(e)}}},tL={name:"labelStartLink",resolveAll:tk.resolveAll,tokenize:function(e,i,r){let n=this;return function(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),s};function s(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):i(e)}}},tA={name:"lineEnding",tokenize:function(e,i){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),eX(e,i,"linePrefix")}}},tM={name:"thematicBreak",tokenize:function(e,i,r){let n,s=0;return function(o){var a;return e.enter("thematicBreak"),n=a=o,function o(a){return a===n?(e.enter("thematicBreakSequence"),function i(r){return r===n?(e.consume(r),s++,i):(e.exit("thematicBreakSequence"),eq(r)?eX(e,o,"whitespace")(r):o(r))}(a)):s>=3&&(null===a||e$(a))?(e.exit("thematicBreak"),i(a)):r(a)}(a)}}},tP={continuation:{tokenize:function(e,i,r){let n=this;return n.containerState._closeFlow=void 0,e.check(eQ,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,eX(e,i,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!eq(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(tB,i,s)(r))});function s(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,eX(e,e.attempt(tP,i,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,i,r){let n=this,s=n.events[n.events.length-1],o=s&&"linePrefix"===s[1].type?s[2].sliceSerialize(s[1],!0).length:0,a=0;return function(i){let s=n.containerState.type||(42===i||43===i||45===i?"listUnordered":"listOrdered");if("listUnordered"===s?!n.containerState.marker||i===n.containerState.marker:eH(i)){if(n.containerState.type||(n.containerState.type=s,e.enter(s,{_container:!0})),"listUnordered"===s)return e.enter("listItemPrefix"),42===i||45===i?e.check(tM,r,l)(i):l(i);if(!n.interrupt||49===i)return e.enter("listItemPrefix"),e.enter("listItemValue"),function i(s){return eH(s)&&++a<10?(e.consume(s),i):(!n.interrupt||a<2)&&(n.containerState.marker?s===n.containerState.marker:41===s||46===s)?(e.exit("listItemValue"),l(s)):r(s)}(i)}return r(i)};function l(i){return e.enter("listItemMarker"),e.consume(i),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||i,e.check(eQ,n.interrupt?r:c,e.attempt(tO,u,h))}function c(e){return n.containerState.initialBlankLine=!0,o++,u(e)}function h(i){return eq(i)?(e.enter("listItemPrefixWhitespace"),e.consume(i),e.exit("listItemPrefixWhitespace"),u):r(i)}function u(r){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(r)}}},tO={partial:!0,tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return!eq(e)&&s&&"listItemPrefixWhitespace"===s[1].type?i(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tB={partial:!0,tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return s&&"listItemIndent"===s[1].type&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?i(e):r(e)},"listItemIndent",n.containerState.size+1)}},tN={name:"setextUnderline",resolveTo:function(e,i){let r,n,s,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(n=o)}else"content"===e[o][1].type&&e.splice(o,1),s||"definition"!==e[o][1].type||(s=o);let a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",s?(e.splice(n,0,["enter",a,i]),e.splice(s+1,0,["exit",e[r][1],i]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,i]),e},tokenize:function(e,i,r){let n,s=this;return function(i){var a;let l,c=s.events.length;for(;c--;)if("lineEnding"!==s.events[c][1].type&&"linePrefix"!==s.events[c][1].type&&"content"!==s.events[c][1].type){l="paragraph"===s.events[c][1].type;break}return!s.parser.lazy[s.now().line]&&(s.interrupt||l)?(e.enter("setextHeadingLine"),n=i,a=i,e.enter("setextHeadingLineSequence"),function i(r){return r===n?(e.consume(r),i):(e.exit("setextHeadingLineSequence"),eq(r)?eX(e,o,"lineSuffix")(r):o(r))}(a)):r(i)};function o(n){return null===n||e$(n)?(e.exit("setextHeadingLine"),i(n)):r(n)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,i,r){let n,s=this;return function(i){var n;return e.enter("definition"),n=i,tm.call(s,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(n)};function o(i){return(n=ty(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),58===i)?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),a):r(i)}function a(i){return eU(i)?tv(e,l)(i):l(i)}function l(i){return tg(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(i)}function c(i){return e.attempt(tb,h,h)(i)}function h(i){return eq(i)?eX(e,u,"whitespace")(i):u(i)}function u(o){return null===o||e$(o)?(e.exit("definition"),s.parser.defined.push(n),i(o)):r(o)}}}},"disable",0,{null:[]},"document",0,{42:tP,43:tP,45:tP,48:tP,49:tP,50:tP,51:tP,52:tP,53:tP,54:tP,55:tP,56:tP,57:tP,62:to},"flow",0,{35:{name:"headingAtx",resolve:function(e,i){let r,n,s=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),s-2>o&&"whitespace"===e[s][1].type&&(s-=2),"atxHeadingSequence"===e[s][1].type&&(o===s-1||s-4>o&&"whitespace"===e[s-2][1].type)&&(s-=o+1===s?2:4),s>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[s][1].end},n={type:"chunkText",start:e[o][1].start,end:e[s][1].end,contentType:"text"},eM(e,o,s-o+1,[["enter",r,i],["enter",n,i],["exit",n,i],["exit",r,i]])),e},tokenize:function(e,i,r){let n=0;return function(s){var o;return e.enter("atxHeading"),o=s,e.enter("atxHeadingSequence"),function s(o){return 35===o&&n++<6?(e.consume(o),s):null===o||eU(o)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function i(n){return 35===n?(e.consume(n),i):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||e$(n)?(e.exit("atxHeading"),i(n)):eq(n)?eX(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function i(n){return null===n||35===n||eU(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),i)}(n))}(o)):r(o)}(o)}}},42:tM,45:[tN,tM],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let i=e.length;for(;i--&&("enter"!==e[i][0]||"htmlFlow"!==e[i][1].type););return i>1&&"linePrefix"===e[i-2][1].type&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e},tokenize:function(e,i,r){let n,s,o,a,l,c=this;return function(i){var r;return r=i,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),h};function h(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),s=!0,p):63===a?(e.consume(a),n=3,c.interrupt?i:P):eN(a)?(e.consume(a),o=String.fromCharCode(a),g):r(a)}function u(s){return 45===s?(e.consume(s),n=2,d):91===s?(e.consume(s),n=5,a=0,f):eN(s)?(e.consume(s),n=4,c.interrupt?i:P):r(s)}function d(n){return 45===n?(e.consume(n),c.interrupt?i:P):r(n)}function f(n){let s="CDATA[";return n===s.charCodeAt(a++)?(e.consume(n),a===s.length)?c.interrupt?i:k:f:r(n)}function p(i){return eN(i)?(e.consume(i),o=String.fromCharCode(i),g):r(i)}function g(a){if(null===a||47===a||62===a||eU(a)){let l=47===a,h=o.toLowerCase();return!l&&!s&&tw.includes(h)?(n=1,c.interrupt?i(a):k(a)):tS.includes(o.toLowerCase())?(n=6,l)?(e.consume(a),m):c.interrupt?i(a):k(a):(n=7,c.interrupt&&!c.parser.lazy[c.now().line]?r(a):s?function i(r){return eq(r)?(e.consume(r),i):x(r)}(a):_(a))}return 45===a||eI(a)?(e.consume(a),o+=String.fromCharCode(a),g):r(a)}function m(n){return 62===n?(e.consume(n),c.interrupt?i:k):r(n)}function _(i){return 47===i?(e.consume(i),x):58===i||95===i||eN(i)?(e.consume(i),v):eq(i)?(e.consume(i),_):x(i)}function v(i){return 45===i||46===i||58===i||95===i||eI(i)?(e.consume(i),v):y(i)}function y(i){return 61===i?(e.consume(i),b):eq(i)?(e.consume(i),y):_(i)}function b(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),l=i,S):eq(i)?(e.consume(i),b):function i(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||eU(r)?y(r):(e.consume(r),i)}(i)}function S(i){return i===l?(e.consume(i),l=null,w):null===i||e$(i)?r(i):(e.consume(i),S)}function w(e){return 47===e||62===e||eq(e)?_(e):r(e)}function x(i){return 62===i?(e.consume(i),C):r(i)}function C(i){return null===i||e$(i)?k(i):eq(i)?(e.consume(i),C):r(i)}function k(i){return 45===i&&2===n?(e.consume(i),D):60===i&&1===n?(e.consume(i),L):62===i&&4===n?(e.consume(i),O):63===i&&3===n?(e.consume(i),P):93===i&&5===n?(e.consume(i),M):e$(i)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(tx,B,E)(i)):null===i||e$(i)?(e.exit("htmlFlowData"),E(i)):(e.consume(i),k)}function E(i){return e.check(tC,R,B)(i)}function R(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),T}function T(i){return null===i||e$(i)?E(i):(e.enter("htmlFlowData"),k(i))}function D(i){return 45===i?(e.consume(i),P):k(i)}function L(i){return 47===i?(e.consume(i),o="",A):k(i)}function A(i){if(62===i){let r=o.toLowerCase();return tw.includes(r)?(e.consume(i),O):k(i)}return eN(i)&&o.length<8?(e.consume(i),o+=String.fromCharCode(i),A):k(i)}function M(i){return 93===i?(e.consume(i),P):k(i)}function P(i){return 62===i?(e.consume(i),O):45===i&&2===n?(e.consume(i),P):k(i)}function O(i){return null===i||e$(i)?(e.exit("htmlFlowData"),B(i)):(e.consume(i),O)}function B(r){return e.exit("htmlFlow"),i(r)}}},61:tN,95:tM,96:td,126:td},"flowInitial",0,{[-2]:tf,[-1]:tf,32:tf},"insideSpan",0,{null:[tn,e6]},"string",0,{38:th,92:ta},"text",0,{[-5]:tA,[-4]:tA,[-3]:tA,33:tD,38:th,42:tn,60:[{name:"autolink",tokenize:function(e,i,r){let n=0;return function(i){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s};function s(i){return eN(i)?(e.consume(i),o):64===i?r(i):l(i)}function o(i){return 43===i||45===i||46===i||eI(i)?(n=1,function i(r){return 58===r?(e.consume(r),n=0,a):(43===r||45===r||46===r||eI(r))&&n++<32?(e.consume(r),i):(n=0,l(r))}(i)):l(i)}function a(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),i):null===n||32===n||60===n||ez(n)?r(n):(e.consume(n),a)}function l(i){return 64===i?(e.consume(i),c):eF(i)?(e.consume(i),l):r(i)}function c(s){return eI(s)?function s(o){return 46===o?(e.consume(o),n=0,c):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),i):function i(o){if((45===o||eI(o))&&n++<63){let r=45===o?i:s;return e.consume(o),r}return r(o)}(o)}(s):r(s)}}},{name:"htmlText",tokenize:function(e,i,r){let n,s,o,a=this;return function(i){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(i),l};function l(i){return 33===i?(e.consume(i),c):47===i?(e.consume(i),S):63===i?(e.consume(i),y):eN(i)?(e.consume(i),x):r(i)}function c(i){return 45===i?(e.consume(i),h):91===i?(e.consume(i),s=0,p):eN(i)?(e.consume(i),v):r(i)}function h(i){return 45===i?(e.consume(i),f):r(i)}function u(i){return null===i?r(i):45===i?(e.consume(i),d):e$(i)?(o=u,A(i)):(e.consume(i),u)}function d(i){return 45===i?(e.consume(i),f):u(i)}function f(e){return 62===e?L(e):45===e?d(e):u(e)}function p(i){let n="CDATA[";return i===n.charCodeAt(s++)?(e.consume(i),s===n.length?g:p):r(i)}function g(i){return null===i?r(i):93===i?(e.consume(i),m):e$(i)?(o=g,A(i)):(e.consume(i),g)}function m(i){return 93===i?(e.consume(i),_):g(i)}function _(i){return 62===i?L(i):93===i?(e.consume(i),_):g(i)}function v(i){return null===i||62===i?L(i):e$(i)?(o=v,A(i)):(e.consume(i),v)}function y(i){return null===i?r(i):63===i?(e.consume(i),b):e$(i)?(o=y,A(i)):(e.consume(i),y)}function b(e){return 62===e?L(e):y(e)}function S(i){return eN(i)?(e.consume(i),w):r(i)}function w(i){return 45===i||eI(i)?(e.consume(i),w):function i(r){return e$(r)?(o=i,A(r)):eq(r)?(e.consume(r),i):L(r)}(i)}function x(i){return 45===i||eI(i)?(e.consume(i),x):47===i||62===i||eU(i)?C(i):r(i)}function C(i){return 47===i?(e.consume(i),L):58===i||95===i||eN(i)?(e.consume(i),k):e$(i)?(o=C,A(i)):eq(i)?(e.consume(i),C):L(i)}function k(i){return 45===i||46===i||58===i||95===i||eI(i)?(e.consume(i),k):function i(r){return 61===r?(e.consume(r),E):e$(r)?(o=i,A(r)):eq(r)?(e.consume(r),i):C(r)}(i)}function E(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),n=i,R):e$(i)?(o=E,A(i)):eq(i)?(e.consume(i),E):(e.consume(i),T)}function R(i){return i===n?(e.consume(i),n=void 0,D):null===i?r(i):e$(i)?(o=R,A(i)):(e.consume(i),R)}function T(i){return null===i||34===i||39===i||60===i||61===i||96===i?r(i):47===i||62===i||eU(i)?C(i):(e.consume(i),T)}function D(e){return 47===e||62===e||eU(e)?C(e):r(e)}function L(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),i):r(n)}function A(i){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),M}function M(i){return eq(i)?eX(e,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):P(i)}function P(i){return e.enter("htmlTextData"),o(i)}}}],91:tL,92:[{name:"hardBreakEscape",tokenize:function(e,i,r){return function(i){return e.enter("hardBreakEscape"),e.consume(i),n};function n(n){return e$(n)?(e.exit("hardBreakEscape"),i(n)):r(n)}}},ta],93:tk,95:tn,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let i,r,n=e.length-4,s=3;if(("lineEnding"===e[3][1].type||"space"===e[s][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(i=s;++i<n;)if("codeTextData"===e[i][1].type){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(i=s-1,n++;++i<=n;)void 0===r?i!==n&&"lineEnding"!==e[i][1].type&&(r=i):(i===n||"lineEnding"===e[i][1].type)&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),n-=i-r-2,i=r+2),r=void 0);return e},tokenize:function(e,i,r){let n,s,o=0;return function(i){return e.enter("codeText"),e.enter("codeTextSequence"),function i(r){return 96===r?(e.consume(r),o++,i):(e.exit("codeTextSequence"),a(r))}(i)};function a(c){return null===c?r(c):32===c?(e.enter("space"),e.consume(c),e.exit("space"),a):96===c?(s=e.enter("codeTextSequence"),n=0,function r(a){return 96===a?(e.consume(a),n++,r):n===o?(e.exit("codeTextSequence"),e.exit("codeText"),i(a)):(s.type="codeTextData",l(a))}(c)):e$(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(c))}function l(i){return null===i||32===i||96===i||e$(i)?(e.exit("codeTextData"),a(i)):(e.consume(i),l)}}}}],4127);var tI=e.i(4127);let tF=/[\0\t\n\r]/g;function tz(e,i){let r=Number.parseInt(e,i);return r<9||11===r||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let tH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tj(e,i,r){if(i)return i;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),i=120===e||88===e;return tz(r.slice(i?2:1),i?16:10)}return tc(r)||e}let tW={}.hasOwnProperty;function t$(e){return{line:e.line,column:e.column,offset:e.offset}}function tU(e,i){if(e)throw Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+ec({start:i.start,end:i.end})+") is open");throw Error("Cannot close document, a token (`"+i.type+"`, "+ec({start:i.start,end:i.end})+") is still open")}function tq(e){let i=this;i.parser=function(r){var n,s;let o,a,l,c;return"object"==typeof(n={...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})&&(s=n,n=void 0),(function(e){let i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:h,autolinkEmail:h,atxHeading:n(g),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:h,characterReference:h,codeFenced:n(p),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:n(p,s),codeText:n(function(){return{type:"inlineCode",value:""}},s),codeTextData:h,data:h,codeFlowValue:h,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(m),hardBreakTrailing:n(m),htmlFlow:n(_,s),htmlFlowData:h,htmlText:n(_,s),htmlTextData:h,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:s,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(y),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:n(g),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let i=this.stack[this.stack.length-1];i.depth||(i.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let i,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(i=tz(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=tc(r);let s=this.stack[this.stack.length-1];s.value+=i},characterReference:function(e){this.stack.pop().position.end=t$(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=ty(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],i=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=i},labelText:function(e){let i=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=i.replace(tH,tj),r.identifier=ty(i).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=t$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(r.type)&&(h.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(i,r){let n=-1;for(;++n<r.length;){let s=r[n];Array.isArray(s)?e(i,s):function(e,i){let r;for(r in i)if(tW.call(i,r))switch(r){case"canContainEols":{let n=i[r];n&&e[r].push(...n);break}case"transforms":{let n=i[r];n&&e[r].push(...n);break}case"enter":case"exit":{let n=i[r];n&&Object.assign(e[r],n)}}}(i,s)}}(i,(e||{}).mdastExtensions||[]);let r={};return function(e){let n={type:"root",children:[]},a={stack:[n],tokenStack:[],config:i,enter:o,exit:l,buffer:s,resume:c,data:r},h=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?h.push(u):u=function(e,i,r){let n,s,o,a,l=i-1,c=-1,h=!1;for(;++l<=r;){let i=e[l];switch(i[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===i[0]?c++:c--,a=void 0;break;case"lineEndingBlank":"enter"===i[0]&&(!n||a||c||o||(o=l),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!c&&"enter"===i[0]&&"listItemPrefix"===i[1].type||-1===c&&"exit"===i[0]&&("listUnordered"===i[1].type||"listOrdered"===i[1].type)){if(n){let a=l;for(s=void 0;a--;){let i=e[a];if("lineEnding"===i[1].type||"lineEndingBlank"===i[1].type){if("exit"===i[0])continue;s&&(e[s][1].type="lineEndingBlank",h=!0),i[1].type="lineEnding",s=a}else if("linePrefix"===i[1].type||"blockQuotePrefix"===i[1].type||"blockQuotePrefixWhitespace"===i[1].type||"blockQuoteMarker"===i[1].type||"listItemIndent"===i[1].type);else break}o&&(!s||o<s)&&(n._spread=!0),n.end=Object.assign({},s?e[s][1].start:i[1].end),e.splice(s||l,0,["exit",n,i[2]]),l++,r++}if("listItemPrefix"===i[1].type){let s={type:"listItem",_spread:!1,start:Object.assign({},i[1].start),end:void 0};n=s,e.splice(l,0,["enter",s,i[2]]),l++,r++,o=void 0,a=!0}}}return e[i][1]._spread=h,r}(e,h.pop(),u));for(u=-1;++u<e.length;){let r=i[e[u][0]];tW.call(r,e[u][1].type)&&r[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tU).call(a,void 0,e[0])}for(n.position={start:t$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:t$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<i.transforms.length;)n=i.transforms[u](n)||n;return n};function n(e,i){return function(r){o.call(this,e(r),r),i&&i.call(this,r)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(e,i,r){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([i,r||void 0]),e.position={start:t$(i.start),end:void 0}}function a(e){return function(i){e&&e.call(this,i),l.call(this,i)}}function l(e,i){let r=this.stack.pop(),n=this.tokenStack.pop();if(n)n[0].type!==e.type&&(i?i.call(this,e,n[0]):(n[1]||tU).call(this,e,n[0]));else throw Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): it’s not open");r.position.end=t$(e.end)}function c(){return eD(this.stack.pop())}function h(e){let i=this.stack[this.stack.length-1].children,r=i[i.length-1];r&&"text"===r.type||((r={type:"text",value:""}).position={start:t$(e.start),end:void 0},i.push(r)),this.stack.push(r)}function u(e){let i=this.stack.pop();i.value+=this.sliceSerialize(e),i.position.end=t$(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function g(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function _(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(s)(function(e){for(;!e2(e););return e}((function(e){let i={constructs:eB([tI,...(e||{}).extensions||[]]),content:r(eG),defined:[],document:r(eJ),flow:r(e4),lazy:{},string:r(e9),text:r(e8)};return i;function r(e){return function(r){return function(e,i,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},s={},o=[],a=[],l=[],c={attempt:g(function(e,i){m(e,i.from)}),check:g(p),consume:function(e){e$(e)?(n.line++,n.column=1,n.offset+=-3===e?2:1,_()):-1!==e&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===a[n._index].length&&(n._bufferIndex=-1,n._index++)),h.previous=e},enter:function(e,i){let r=i||{};return r.type=e,r.start=f(),h.events.push(["enter",r,h]),l.push(r),r},exit:function(e){let i=l.pop();return i.end=f(),h.events.push(["exit",i,h]),i},interrupt:g(p,{interrupt:!0})},h={code:null,containerState:{},defineSkip:function(e){s[e.line]=e.column,_()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,i){return function(e,i){let r,n=-1,s=[];for(;++n<e.length;){let o,a=e[n];if("string"==typeof a)o=a;else switch(a){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=i?" ":" ";break;case -1:if(!i&&r)continue;o=" ";break;default:o=String.fromCharCode(a)}r=-2===a,s.push(o)}return s.join("")}(d(e),i)},sliceStream:d,write:function(e){return(a=eP(a,e),function(){let e;for(;n._index<a.length;){let r=a[n._index];if("string"==typeof r)for(e=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===e&&n._bufferIndex<r.length;){var i;i=r.charCodeAt(n._bufferIndex),u=u(i)}else u=u(r)}}(),null!==a[a.length-1])?[]:(m(i,0),h.events=tr(o,h.events,h),h.events)}},u=i.tokenize.call(h,c);return i.resolveAll&&o.push(i),h;function d(e){return function(e,i){let r,n=i.start._index,s=i.start._bufferIndex,o=i.end._index,a=i.end._bufferIndex;if(n===o)r=[e[n].slice(s,a)];else{if(r=e.slice(n,o),s>-1){let e=r[0];"string"==typeof e?r[0]=e.slice(s):r.shift()}a>0&&r.push(e[o].slice(0,a))}return r}(a,e)}function f(){let{_bufferIndex:e,_index:i,line:r,column:s,offset:o}=n;return{_bufferIndex:e,_index:i,line:r,column:s,offset:o}}function p(e,i){i.restore()}function g(e,i){return function(r,s,o){var a;let u,d,p,g;return Array.isArray(r)?m(r):"tokenize"in r?m([r]):(a=r,function(e){let i=null!==e&&a[e],r=null!==e&&a.null;return m([...Array.isArray(i)?i:i?[i]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?o:v(e[d])}function v(e){return function(r){let s,o,a,u,d;return(s=f(),o=h.previous,a=h.currentConstruct,u=h.events.length,d=Array.from(l),g={from:u,restore:function(){n=s,h.previous=o,h.currentConstruct=a,h.events.length=u,l=d,_()}},p=e,e.partial||(h.currentConstruct=e),e.name&&h.parser.constructs.disable.null.includes(e.name))?b(r):e.tokenize.call(i?Object.assign(Object.create(h),i):h,c,y,b)(r)}}function y(i){return e(p,g),s}function b(e){return(g.restore(),++d<u.length)?v(u[d]):o}}}function m(e,i){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&eM(h.events,i,h.events.length-i,e.resolve(h.events.slice(i),h)),e.resolveTo&&(h.events=e.resolveTo(h.events,h))}function _(){n.line in s&&n.column<2&&(n.column=s[n.line],n.offset+=s[n.line]-1)}}(i,e,r)}}})(s).document().write((a=1,l="",c=!0,function(e,i,r){let n,s,h,u,d,f=[];for(e=l+("string"==typeof e?e.toString():new TextDecoder(i||void 0).decode(e)),h=0,l="",c&&(65279===e.charCodeAt(0)&&h++,c=void 0);h<e.length;){if(tF.lastIndex=h,u=(n=tF.exec(e))&&void 0!==n.index?n.index:e.length,d=e.charCodeAt(u),!n){l=e.slice(h);break}if(10===d&&h===u&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),h<u&&(f.push(e.slice(h,u)),a+=u-h),d){case 0:f.push(65533),a++;break;case 9:for(s=4*Math.ceil(a/4),f.push(-2);a++<s;)f.push(-1);break;case 10:f.push(-4),a=1;break;default:o=!0,a=1}h=u+1}return r&&(o&&f.push(-5),l&&f.push(l),f.push(null)),f})(r,n,!0))))}}let tV="object"==typeof self?self:globalThis,tK=e=>{var i;let r,n;return(i=new Map,r=(e,r)=>(i.set(r,e),e),n=s=>{if(i.has(s))return i.get(s);let[o,a]=e[s];switch(o){case 0:case -1:return r(a,s);case 1:{let e=r([],s);for(let i of a)e.push(n(i));return e}case 2:{let e=r({},s);for(let[i,r]of a)e[n(i)]=n(r);return e}case 3:return r(new Date(a),s);case 4:{let{source:e,flags:i}=a;return r(new RegExp(e,i),s)}case 5:{let e=r(new Map,s);for(let[i,r]of a)e.set(n(i),n(r));return e}case 6:{let e=r(new Set,s);for(let i of a)e.add(n(i));return e}case 7:{let{name:e,message:i}=a;return r(new tV[e](i),s)}case 8:return r(BigInt(a),s);case"BigInt":return r(Object(BigInt(a)),s);case"ArrayBuffer":return r(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return r(new DataView(e),a)}}return r(new tV[o](a),s)})(0)},{toString:tY}={},{keys:tX}=Object,tG=e=>{let i=typeof e;if("object"!==i||!e)return[0,i];let r=tY.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},tJ=([e,i])=>0===e&&("function"===i||"symbol"===i),tZ=(e,{json:i,lossy:r}={})=>{var n,s,o;let a,l,c=[];return(n=!(i||r),s=!!i,o=new Map,a=(e,i)=>{let r=c.push(e)-1;return o.set(i,r),r},l=e=>{if(o.has(e))return o.get(e);let[i,r]=tG(e);switch(i){case 0:{let s=e;switch(r){case"bigint":i=8,s=e.toString();break;case"function":case"symbol":if(n)throw TypeError("unable to serialize "+r);s=null;break;case"undefined":return a([-1],e)}return a([i,s],e)}case 1:{if(r){let i=e;return"DataView"===r?i=new Uint8Array(e.buffer):"ArrayBuffer"===r&&(i=new Uint8Array(e)),a([r,[...i]],e)}let n=[],s=a([i,n],e);for(let i of e)n.push(l(i));return s}case 2:{if(r)switch(r){case"BigInt":return a([r,e.toString()],e);case"Boolean":case"Number":case"String":return a([r,e.valueOf()],e)}if(s&&"toJSON"in e)return l(e.toJSON());let o=[],c=a([i,o],e);for(let i of tX(e))(n||!tJ(tG(e[i])))&&o.push([l(i),l(e[i])]);return c}case 3:return a([i,e.toISOString()],e);case 4:{let{source:r,flags:n}=e;return a([i,{source:r,flags:n}],e)}case 5:{let r=[],s=a([i,r],e);for(let[i,s]of e)(n||!(tJ(tG(i))||tJ(tG(s))))&&r.push([l(i),l(s)]);return s}case 6:{let r=[],s=a([i,r],e);for(let i of e)(n||!tJ(tG(i)))&&r.push(l(i));return s}}let{message:c}=e;return a([i,{name:r,message:c}],e)})(e),c},tQ="function"==typeof structuredClone?(e,i)=>i&&("json"in i||"lossy"in i)?tK(tZ(e,i)):structuredClone(e):(e,i)=>tK(tZ(e,i));function t0(e){let i=[],r=-1,n=0,s=0;for(;++r<e.length;){let o=e.charCodeAt(r),a="";if(37===o&&eI(e.charCodeAt(r+1))&&eI(e.charCodeAt(r+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){let i=e.charCodeAt(r+1);o<56320&&i>56319&&i<57344?(a=String.fromCharCode(o,i),s=1):a="�"}else a=String.fromCharCode(o);a&&(i.push(e.slice(n,r),encodeURIComponent(a)),n=r+s+1,a=""),s&&(r+=s,s=0)}return i.join("")+e.slice(n)}function t1(e,i){let r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function t2(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}let t5=function(e){var i,r;if(null==e)return t4;if("function"==typeof e)return t3(e);if("object"==typeof e){return Array.isArray(e)?function(e){let i=[],r=-1;for(;++r<e.length;)i[r]=t5(e[r]);return t3(function(...e){let r=-1;for(;++r<i.length;)if(i[r].apply(this,e))return!0;return!1})}(e):(i=e,t3(function(e){let r;for(r in i)if(e[r]!==i[r])return!1;return!0}))}if("string"==typeof e){return r=e,t3(function(e){return e&&e.type===r})}throw Error("Expected function, string, or object as test")};function t3(e){return function(i,r,n){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(i)&&e.call(this,i,"number"==typeof r?r:void 0,n||void 0))}}function t4(){return!0}let t6=[];function t9(e,i,r,n){let s;"function"==typeof i&&"function"!=typeof r?(n=r,r=i):s=i;let o=t5(s),a=n?-1:1;(function e(s,l,c){let h=s&&"object"==typeof s?s:{};if("string"==typeof h.type){let e="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(u,"name",{value:"node ("+s.type+(e?"<"+e+">":"")+")"})}return u;function u(){var h;let u,d,f,p=t6;if((!i||o(s,l,c[c.length-1]||void 0))&&!1===(p=Array.isArray(h=r(s,c))?h:"number"==typeof h?[!0,h]:null==h?t6:[h])[0])return p;if("children"in s&&s.children&&s.children&&"skip"!==p[0])for(d=(n?s.children.length:-1)+a,f=c.concat(s);d>-1&&d<s.children.length;){if(!1===(u=e(s.children[d],d,f)())[0])return u;d="number"==typeof u[1]?u[1]:d+a}return p}})(e,void 0,[])()}function t8(e,i,r,n){let s,o,a;"function"==typeof i&&"function"!=typeof r?(o=void 0,a=i,s=r):(o=i,a=r,s=n),t9(e,o,function(e,i){let r=i[i.length-1],n=r?r.children.indexOf(e):void 0;return a(e,n,r)},s)}function t7(e,i){let r=i.referenceType,n="]";if("collapsed"===r?n+="[]":"full"===r&&(n+="["+(i.label||i.identifier)+"]"),"imageReference"===i.type)return[{type:"text",value:"!["+i.alt+n}];let s=e.all(i),o=s[0];o&&"text"===o.type?o.value="["+o.value:s.unshift({type:"text",value:"["});let a=s[s.length-1];return a&&"text"===a.type?a.value+=n:s.push({type:"text",value:n}),s}function ie(e){let i=e.spread;return null==i?e.children.length>1:i}function it(e,i,r){let n=0,s=e.length;if(i){let i=e.codePointAt(n);for(;9===i||32===i;)n++,i=e.codePointAt(n)}if(r){let i=e.codePointAt(s-1);for(;9===i||32===i;)s--,i=e.codePointAt(s-1)}return s>n?e.slice(n,s):""}let ii={blockquote:function(e,i){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)},break:function(e,i){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:"\n"}]},code:function(e,i){let r=i.value?i.value+"\n":"",n={},s=i.lang?i.lang.split(/\s+/):[];s.length>0&&(n.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return i.meta&&(o.data={meta:i.meta}),e.patch(i,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(i,o)]},e.patch(i,o),o},delete:function(e,i){let r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},emphasis:function(e,i){let r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},footnoteReference:function(e,i){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",s=String(i.identifier).toUpperCase(),o=t0(s.toLowerCase()),a=e.footnoteOrder.indexOf(s),l=e.footnoteCounts.get(s);void 0===l?(l=0,e.footnoteOrder.push(s),r=e.footnoteOrder.length):r=a+1,l+=1,e.footnoteCounts.set(s,l);let c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(i,c);let h={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(i,h),e.applyData(i,h)},heading:function(e,i){let r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},html:function(e,i){if(e.options.allowDangerousHtml){let r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}},imageReference:function(e,i){let r=String(i.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return t7(e,i);let s={src:t0(n.url||""),alt:i.alt};null!==n.title&&void 0!==n.title&&(s.title=n.title);let o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(i,o),e.applyData(i,o)},image:function(e,i){let r={src:t0(i.url)};null!==i.alt&&void 0!==i.alt&&(r.alt=i.alt),null!==i.title&&void 0!==i.title&&(r.title=i.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,n),e.applyData(i,n)},inlineCode:function(e,i){let r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,n),e.applyData(i,n)},linkReference:function(e,i){let r=String(i.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return t7(e,i);let s={href:t0(n.url||"")};null!==n.title&&void 0!==n.title&&(s.title=n.title);let o={type:"element",tagName:"a",properties:s,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)},link:function(e,i){let r={href:t0(i.url)};null!==i.title&&void 0!==i.title&&(r.title=i.title);let n={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,n),e.applyData(i,n)},listItem:function(e,i,r){let n=e.all(i),s=r?function(e){let i=!1;if("list"===e.type){i=e.spread||!1;let r=e.children,n=-1;for(;!i&&++n<r.length;)i=ie(r[n])}return i}(r):ie(i),o={},a=[];if("boolean"==typeof i.checked){let e,r=n[0];r&&"element"===r.type&&"p"===r.tagName?e=r:(e={type:"element",tagName:"p",properties:{},children:[]},n.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<n.length;){let e=n[l];(s||0!==l||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||s?a.push(e):a.push(...e.children)}let c=n[n.length-1];c&&(s||"element"!==c.type||"p"!==c.tagName)&&a.push({type:"text",value:"\n"});let h={type:"element",tagName:"li",properties:o,children:a};return e.patch(i,h),e.applyData(i,h)},list:function(e,i){let r={},n=e.all(i),s=-1;for("number"==typeof i.start&&1!==i.start&&(r.start=i.start);++s<n.length;){let e=n[s];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let o={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(i,o),e.applyData(i,o)},paragraph:function(e,i){let r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},root:function(e,i){let r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)},strong:function(e,i){let r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},table:function(e,i){let r=e.all(i),n=r.shift(),s=[];if(n){let r={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(i.children[0],r),s.push(r)}if(r.length>0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=ea(i.children[1]),a=eo(i.children[i.children.length-1]);o&&a&&(n.position={start:o,end:a}),s.push(n)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(i,o),e.applyData(i,o)},tableCell:function(e,i){let r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},tableRow:function(e,i,r){let n=r?r.children:void 0,s=0===(n?n.indexOf(i):1)?"th":"td",o=r&&"table"===r.type?r.align:void 0,a=o?o.length:i.children.length,l=-1,c=[];for(;++l<a;){let r=i.children[l],n={},a=o?o[l]:void 0;a&&(n.align=a);let h={type:"element",tagName:s,properties:n,children:[]};r&&(h.children=e.all(r),e.patch(r,h),h=e.applyData(r,h)),c.push(h)}let h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(i,h),e.applyData(i,h)},text:function(e,i){let r={type:"text",value:function(e){let i=String(e),r=/\r?\n|\r/g,n=r.exec(i),s=0,o=[];for(;n;)o.push(it(i.slice(s,n.index),s>0,!0),n[0]),s=n.index+n[0].length,n=r.exec(i);return o.push(it(i.slice(s),s>0,!1)),o.join("")}(String(i.value))};return e.patch(i,r),e.applyData(i,r)},thematicBreak:function(e,i){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)},toml:ir,yaml:ir,definition:ir,footnoteDefinition:ir};function ir(){}let is={}.hasOwnProperty,io={};function ia(e,i){e.position&&(i.position=function(e){let i=ea(e),r=eo(e);if(i&&r)return{start:i,end:r}}(e))}function il(e,i){let r=i;if(e&&e.data){let i=e.data.hName,n=e.data.hChildren,s=e.data.hProperties;"string"==typeof i&&("element"===r.type?r.tagName=i:r={type:"element",tagName:i,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&s&&Object.assign(r.properties,tQ(s)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function ic(e,i){let r=[],n=-1;for(i&&r.push({type:"text",value:"\n"});++n<e.length;)n&&r.push({type:"text",value:"\n"}),r.push(e[n]);return i&&e.length>0&&r.push({type:"text",value:"\n"}),r}function ih(e){let i=0,r=e.charCodeAt(i);for(;9===r||32===r;)i++,r=e.charCodeAt(i);return e.slice(i)}function iu(e,i){let r,n,s,o,a=(r=i||io,n=new Map,s=new Map,o={all:function(e){let i=[];if("children"in e){let r=e.children,n=-1;for(;++n<r.length;){let s=o.one(r[n],e);if(s){if(n&&"break"===r[n-1].type&&(Array.isArray(s)||"text"!==s.type||(s.value=ih(s.value)),!Array.isArray(s)&&"element"===s.type)){let e=s.children[0];e&&"text"===e.type&&(e.value=ih(e.value))}Array.isArray(s)?i.push(...s):i.push(s)}}}return i},applyData:il,definitionById:n,footnoteById:s,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ii,...r.handlers},one:function(e,i){let r=e.type,n=o.handlers[r];if(is.call(o.handlers,r)&&n)return n(o,e,i);if(o.options.passThrough&&o.options.passThrough.includes(r)){if("children"in e){let{children:i,...r}=e,n=tQ(r);return n.children=o.all(e),n}return tQ(e)}return(o.options.unknownHandler||function(e,i){let r=i.data||{},n="value"in i&&!(is.call(r,"hProperties")||is.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,n),e.applyData(i,n)})(o,e,i)},options:r,patch:ia,wrap:ic},t8(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let i="definition"===e.type?n:s,r=String(e.identifier).toUpperCase();i.has(r)||i.set(r,e)}}),o),l=a.one(e,void 0),c=function(e){let i="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||t1,n=e.options.footnoteBackLabel||t2,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],c=-1;for(;++c<e.footnoteOrder.length;){let s=e.footnoteById.get(e.footnoteOrder[c]);if(!s)continue;let o=e.all(s),a=String(s.identifier).toUpperCase(),h=t0(a.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(c,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+h+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(c,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);let g={type:"element",tagName:"li",properties:{id:i+"fn-"+h},children:e.wrap(o,!0)};e.patch(s,g),l.push(g)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...tQ(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(a),h=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return c&&(v("children"in h),h.children.push({type:"text",value:"\n"},c)),h}function id(e,i){return e&&"run"in e?async function(r,n){let s=iu(r,{file:n,...i});await e.run(s,n)}:function(r,n){return iu(r,{file:n,...e||i})}}function ip(e){if(e)throw e}var ig=e.i(4100);function im(e){if("object"!=typeof e||null===e)return!1;let i=Object.getPrototypeOf(e);return(null===i||i===Object.prototype||null===Object.getPrototypeOf(i))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let i_=function(e,i){let r;if(void 0!==i&&"string"!=typeof i)throw TypeError('"ext" argument must be a string');iS(e);let n=0,s=-1,o=e.length;if(void 0===i||0===i.length||i.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else s<0&&(r=!0,s=o+1);return s<0?"":e.slice(n,s)}if(i===e)return"";let a=-1,l=i.length-1;for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else a<0&&(r=!0,a=o+1),l>-1&&(e.codePointAt(o)===i.codePointAt(l--)?l<0&&(s=o):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)},iv=function(e){let i;if(iS(e),0===e.length)return".";let r=-1,n=e.length;for(;--n;)if(47===e.codePointAt(n)){if(i){r=n;break}}else i||(i=!0);return r<0?47===e.codePointAt(0)?"/":".":1===r&&47===e.codePointAt(0)?"//":e.slice(0,r)},iy=function(e){let i;iS(e);let r=e.length,n=-1,s=0,o=-1,a=0;for(;r--;){let l=e.codePointAt(r);if(47===l){if(i){s=r+1;break}continue}n<0&&(i=!0,n=r+1),46===l?o<0?o=r:1!==a&&(a=1):o>-1&&(a=-1)}return o<0||n<0||0===a||1===a&&o===n-1&&o===s+1?"":e.slice(o,n)},ib=function(...e){var i;let r,n,s,o=-1;for(;++o<e.length;)iS(e[o]),e[o]&&(s=void 0===s?e[o]:s+"/"+e[o]);return void 0===s?".":(iS(i=s),r=47===i.codePointAt(0),0!==(n=function(e,i){let r,n,s="",o=0,a=-1,l=0,c=-1;for(;++c<=e.length;){if(c<e.length)r=e.codePointAt(c);else if(47===r)break;else r=47;if(47===r){if(a===c-1||1===l);else if(a!==c-1&&2===l){if(s.length<2||2!==o||46!==s.codePointAt(s.length-1)||46!==s.codePointAt(s.length-2)){if(s.length>2){if((n=s.lastIndexOf("/"))!==s.length-1){n<0?(s="",o=0):o=(s=s.slice(0,n)).length-1-s.lastIndexOf("/"),a=c,l=0;continue}}else if(s.length>0){s="",o=0,a=c,l=0;continue}}i&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+e.slice(a+1,c):s=e.slice(a+1,c),o=c-a-1;a=c,l=0}else 46===r&&l>-1?l++:l=-1}return s}(i,!r)).length||r||(n="."),n.length>0&&47===i.codePointAt(i.length-1)&&(n+="/"),r?"/"+n:n)};function iS(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function iw(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let ix=["history","path","basename","stem","extname","dirname"];class iC{constructor(e){let i,r;i=e?iw(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in i?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ix.length;){const e=ix[n];e in i&&void 0!==i[e]&&null!==i[e]&&(this[e]="history"===e?[...i[e]]:i[e])}for(r in i)ix.includes(r)||(this[r]=i[r])}get basename(){return"string"==typeof this.path?i_(this.path):void 0}set basename(e){iE(e,"basename"),ik(e,"basename"),this.path=ib(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?iv(this.path):void 0}set dirname(e){iR(this.basename,"dirname"),this.path=ib(e||"",this.basename)}get extname(){return"string"==typeof this.path?iy(this.path):void 0}set extname(e){if(ik(e,"extname"),iR(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=ib(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){iw(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!iw(e)){let i=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let i=e.pathname,r=-1;for(;++r<i.length;)if(37===i.codePointAt(r)&&50===i.codePointAt(r+1)){let e=i.codePointAt(r+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(i)}(e)}(e)),iE(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?i_(this.path,this.extname):void 0}set stem(e){iE(e,"stem"),ik(e,"stem"),this.path=ib(this.dirname||"",e+(this.extname||""))}fail(e,i,r){let n=this.message(e,i,r);throw n.fatal=!0,n}info(e,i,r){let n=this.message(e,i,r);return n.fatal=void 0,n}message(e,i,r){let n=new ef(e,i,r);return this.path&&(n.name=this.path+":"+n.name,n.file=this.path),n.fatal=!1,this.messages.push(n),n}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ik(e,i){if(e&&e.includes("/"))throw Error("`"+i+"` cannot be a path: did not expect `/`")}function iE(e,i){if(!e)throw Error("`"+i+"` cannot be empty")}function iR(e,i){if(!e)throw Error("Setting `"+i+"` requires `path` to be set too")}let iT=function(e){let i=this.constructor.prototype,r=i[e],n=function(){return r.apply(n,arguments)};return Object.setPrototypeOf(n,i),n},iD={}.hasOwnProperty;class iL extends iT{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=function(){let e=[],i={run:function(...i){let r=-1,n=i.pop();if("function"!=typeof n)throw TypeError("Expected function as last argument, not "+n);!function s(o,...a){let l=e[++r],c=-1;if(o)return void n(o);for(;++c<i.length;)(null===a[c]||void 0===a[c])&&(a[c]=i[c]);i=a,l?(function(e,i){let r;return function(...i){let o,a=e.length>i.length;a&&i.push(n);try{o=e.apply(this,i)}catch(e){if(a&&r)throw e;return n(e)}a||(o&&o.then&&"function"==typeof o.then?o.then(s,n):o instanceof Error?n(o):s(o))};function n(e,...s){r||(r=!0,i(e,...s))}function s(e){n(null,e)}})(l,s)(...a):n(null,...a)}(null,...i)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),i}};return i}()}copy(){let e=new iL,i=-1;for(;++i<this.attachers.length;){let r=this.attachers[i];e.use(...r)}return e.data((0,ig.default)(!0,{},this.namespace)),e}data(e,i){return"string"==typeof e?2==arguments.length?(iO("data",this.frozen),this.namespace[e]=i,this):iD.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iO("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...i]=this.attachers[this.freezeIndex];if(!1===i[0])continue;!0===i[0]&&(i[0]=void 0);let r=e.call(this,...i);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let i=iI(e),r=this.parser||this.Parser;return iM("parse",r),r(String(i),i)}process(e,i){let r=this;return this.freeze(),iM("process",this.parser||this.Parser),iP("process",this.compiler||this.Compiler),i?n(void 0,i):new Promise(n);function n(n,s){let o=iI(e),a=r.parse(o);function l(e,r){e||!r?s(e):n?n(r):(v(i,"`done` is defined if `resolve` is not"),i(void 0,r))}r.run(a,o,function(e,i,n){var s,o;if(e||!i||!n)return l(e);let a=r.stringify(i,n);"string"==typeof(s=a)||(o=s)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?n.value=a:n.result=a,l(e,n)})}}processSync(e){let i,r=!1;return this.freeze(),iM("processSync",this.parser||this.Parser),iP("processSync",this.compiler||this.Compiler),this.process(e,function(e,n){r=!0,ip(e),i=n}),iN("processSync","process",r),v(i,"we either bailed on an error or have a tree"),i}run(e,i,r){iB(e),this.freeze();let n=this.transformers;return r||"function"!=typeof i||(r=i,i=void 0),r?s(void 0,r):new Promise(s);function s(s,o){v("function"!=typeof i,"`file` can’t be a `done` anymore, we checked");let a=iI(i);n.run(e,a,function(i,n,a){let l=n||e;i?o(i):s?s(l):(v(r,"`done` is defined if `resolve` is not"),r(void 0,l,a))})}}runSync(e,i){let r,n=!1;return this.run(e,i,function(e,i){ip(e),r=i,n=!0}),iN("runSync","run",n),v(r,"we either bailed on an error or have a tree"),r}stringify(e,i){this.freeze();let r=iI(i),n=this.compiler||this.Compiler;return iP("stringify",n),iB(e),n(e,r)}use(e,...i){let r=this.attachers,n=this.namespace;if(iO("use",this.frozen),null==e);else if("function"==typeof e)a(e,i);else if("object"==typeof e)Array.isArray(e)?o(e):s(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function s(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(n.settings=(0,ig.default)(!0,n.settings,e.settings))}function o(e){let i=-1;if(null==e);else if(Array.isArray(e))for(;++i<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[i,...r]=e;a(i,r)}else s(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[i]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,i){let n=-1,s=-1;for(;++n<r.length;)if(r[n][0]===e){s=n;break}if(-1===s)r.push([e,...i]);else if(i.length>0){let[n,...o]=i,a=r[s][1];im(a)&&im(n)&&(n=(0,ig.default)(!0,a,n)),r[s]=[e,n,...o]}}}}let iA=new iL().freeze();function iM(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `parser`")}function iP(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `compiler`")}function iO(e,i){if(i)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iB(e){if(!im(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function iN(e,i,r){if(!r)throw Error("`"+e+"` finished async. Use `"+i+"` instead")}function iI(e){var i;return(i=e)&&"object"==typeof i&&"message"in i&&"messages"in i?e:new iC(e)}let iF=[],iz={allowDangerousHtml:!0},iH=/^(https?|ircs?|mailto|xmpp)$/i,ij=[{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 iW(e){var i;let r,n,s,o,a,l=(r=(i=e).rehypePlugins||iF,n=i.remarkPlugins||iF,s=i.remarkRehypeOptions?{...i.remarkRehypeOptions,...iz}:iz,iA().use(tq).use(n).use(id,s).use(r)),c=(o=e.children||"",a=new iC,"string"==typeof o?a.value=o:y("Unexpected value `"+o+"` for `children` prop, expected `string`"),a);return function(e,i){let r=i.allowedElements,n=i.allowElement,s=i.components,o=i.disallowedElements,a=i.skipHtml,l=i.unwrapDisallowed,c=i.urlTransform||i$;for(let e of ij)Object.hasOwn(i,e.from)&&y("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&o&&y("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),t8(e,function(e,i,s){if("raw"===e.type&&s&&"number"==typeof i)return a?s.children.splice(i,1):s.children[i]={type:"text",value:e.value},i;if("element"===e.type){let i;for(i in eR)if(Object.hasOwn(eR,i)&&Object.hasOwn(e.properties,i)){let r=e.properties[i],n=eR[i];(null===n||n.includes(e.tagName))&&(e.properties[i]=c(String(r||""),i,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!a&&n&&"number"==typeof i&&(a=!n(e,i,s)),a&&s&&"number"==typeof i)return l&&e.children?s.children.splice(i,1,...e.children):s.children.splice(i,1),i}}),function(e,i){var r,n,s,o;let a;if(!i||void 0===i.Fragment)throw TypeError("Expected `Fragment` in options");let l=i.filePath||void 0;if(i.development){if("function"!=typeof i.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=i.jsxDEV,a=function(e,i,s,o){let a=Array.isArray(s.children),l=ea(e);return n(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:r,lineNumber:l?l.line:void 0},void 0)}}else{if("function"!=typeof i.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof i.jsxs)throw TypeError("Expected `jsxs` in production options");s=i.jsx,o=i.jsxs,a=function(e,i,r,n){let a=Array.isArray(r.children)?o:s;return n?a(i,r,n):a(i,r)}}let c={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:a,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:!1!==i.passKeys,passNode:i.passNode||!1,schema:"svg"===i.space?en:er,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==i.tableCellAlignToStyle},h=eb(c,e,void 0);return h&&"string"!=typeof h?h:c.create(e,c.Fragment,{children:h||void 0},void 0)}(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0})}(l.runSync(l.parse(c),c),e)}function i$(e){let i=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),s=e.indexOf("/");return -1===i||-1!==s&&i>s||-1!==r&&i>r||-1!==n&&i>n||iH.test(e.slice(0,i))?e:""}function iU(e,i){let r=String(e);if("string"!=typeof i)throw TypeError("Expected character");let n=0,s=r.indexOf(i);for(;-1!==s;)n++,s=r.indexOf(i,s+i.length);return n}let iq="phrasing",iV=["autolink","link","image","label"];function iK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function iY(e){this.config.enter.autolinkProtocol.call(this,e)}function iX(e){this.config.exit.autolinkProtocol.call(this,e)}function iG(e){this.config.exit.data.call(this,e);let i=this.stack[this.stack.length-1];v("link"===i.type),i.url="http://"+this.sliceSerialize(e)}function iJ(e){this.config.exit.autolinkEmail.call(this,e)}function iZ(e){this.exit(e)}function iQ(e){!function(e,i,r){let n=t5((r||{}).ignore||[]),s=function(e){let i=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let r=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<r.length;){var s;let e=r[n];i.push(["string"==typeof(s=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(s),"g"):s,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return i}(i),o=-1;for(;++o<s.length;)t9(e,"text",a);function a(e,i){let r,a=-1;for(;++a<i.length;){let e=i[a],s=r?r.children:void 0;if(n(e,s?s.indexOf(e):void 0,r))return;r=e}if(r)return function(e,i){let r=i[i.length-1],n=s[o][0],a=s[o][1],l=0,c=r.children.indexOf(e),h=!1,u=[];n.lastIndex=0;let d=n.exec(e.value);for(;d;){let r=d.index,s={index:d.index,input:d.input,stack:[...i,e]},o=a(...d,s);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?n.lastIndex=r+1:(l!==r&&u.push({type:"text",value:e.value.slice(l,r)}),Array.isArray(o)?u.push(...o):o&&u.push(o),l=r+d[0].length,h=!0),!n.global)break;d=n.exec(e.value)}return h?(l<e.value.length&&u.push({type:"text",value:e.value.slice(l)}),r.children.splice(c,1,...u)):u=[e],c+u.length}(e,i)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,i0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,i1]],{ignore:["link","linkReference"]})}function i0(e,i,r,n,s){let o,a="";if(!i2(s))return!1;if(/^w/i.test(i)&&(r=i+r,i="",a="http://"),(o=r.split(".")).length<2||o[o.length-1]&&(/_/.test(o[o.length-1])||!/[a-zA-Z\d]/.test(o[o.length-1]))||o[o.length-2]&&(/_/.test(o[o.length-2])||!/[a-zA-Z\d]/.test(o[o.length-2])))return!1;let l=function(e){let i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],n=r.indexOf(")"),s=iU(e,"("),o=iU(e,")");for(;-1!==n&&s>o;)e+=r.slice(0,n+1),n=(r=r.slice(n+1)).indexOf(")"),o++;return[e,r]}(r+n);if(!l[0])return!1;let c={type:"link",title:null,url:a+i+l[0],children:[{type:"text",value:i+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function i1(e,i,r,n){return!(!i2(n,!0)||/[-\d_]$/.test(r))&&{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function i2(e,i){let r=e.input.charCodeAt(e.index-1);return(0===e.index||eK(r)||eV(r))&&(!i||47!==r)}function i5(){this.buffer()}function i3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function i4(){this.buffer()}function i6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function i9(e){let i=this.resume(),r=this.stack[this.stack.length-1];v("footnoteReference"===r.type),r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),r.label=i}function i8(e){this.exit(e)}function i7(e){let i=this.resume(),r=this.stack[this.stack.length-1];v("footnoteDefinition"===r.type),r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),r.label=i}function re(e){this.exit(e)}function rt(e,i,r,n){let s=r.createTracker(n),o=s.move("[^"),a=r.enter("footnoteReference"),l=r.enter("reference");return o+=s.move(r.safe(r.associationId(e),{after:"]",before:o})),l(),a(),o+=s.move("]")}function ri(e,i,r){return 0===i?e:rr(e,i,r)}function rr(e,i,r){return(r?"":" ")+e}rt.peek=function(){return"["};let rn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function rs(e){this.enter({type:"delete",children:[]},e)}function ro(e){this.exit(e)}function ra(e,i,r,n){let s=r.createTracker(n),o=r.enter("strikethrough"),a=s.move("~~");return a+=r.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function rl(e){return e.length}function rc(e){let i="string"==typeof e?e.codePointAt(0):0;return 67===i||99===i?99:76===i||108===i?108:114*(82===i||114===i)}ra.peek=function(){return"~"};function rh(e,i,r){let n=e.value||"",s="`",o=-1;for(;RegExp("(^|[^`])"+s+"([^`]|$)").test(n);)s+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let e,i=r.unsafe[o],s=r.compilePattern(i);if(i.atBreak)for(;e=s.exec(n);){let i=e.index;10===n.charCodeAt(i)&&13===n.charCodeAt(i-1)&&i--,n=n.slice(0,i)+" "+n.slice(e.index+1)}}return s+n+s}rh.peek=function(){return"`"};t5(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let ru=function(e,i,r,n){let s=function(e){let i=e.options.listItemIndent||"one";if("tab"!==i&&"one"!==i&&"mixed"!==i)throw Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}(r),o=r.bulletCurrent||function(e){let i=e.options.bullet||"*";if("*"!==i&&"+"!==i&&"-"!==i)throw Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}(r);i&&"list"===i.type&&i.ordered&&(o=("number"==typeof i.start&&i.start>-1?i.start:1)+(!1===r.options.incrementListMarker?0:i.children.indexOf(e))+o);let a=o.length+1;("tab"===s||"mixed"===s&&(i&&"list"===i.type&&i.spread||e.spread))&&(a=4*Math.ceil(a/4));let l=r.createTracker(n);l.move(o+" ".repeat(a-o.length)),l.shift(a);let c=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,l.current()),function(e,i,r){return i?(r?"":" ".repeat(a))+e:(r?o:o+" ".repeat(a-o.length))+e});return c(),h};function rd(e){let i=e._align;v(i,"expected `_align` on table"),this.enter({type:"table",align:i.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function rf(e){this.exit(e),this.data.inTable=void 0}function rp(e){this.enter({type:"tableRow",children:[]},e)}function rg(e){this.exit(e)}function rm(e){this.enter({type:"tableCell",children:[]},e)}function r_(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,rv));let r=this.stack[this.stack.length-1];v("inlineCode"===r.type),r.value=i,this.exit(e)}function rv(e,i){return"|"===i?i:e}function ry(e){let i=this.stack[this.stack.length-2];v("listItem"===i.type),i.checked="taskListCheckValueChecked"===e.type}function rb(e){let i=this.stack[this.stack.length-2];if(i&&"listItem"===i.type&&"boolean"==typeof i.checked){let e=this.stack[this.stack.length-1];v("paragraph"===e.type);let r=e.children[0];if(r&&"text"===r.type){let n,s=i.children,o=-1;for(;++o<s.length;){let e=s[o];if("paragraph"===e.type){n=e;break}}n===e&&(r.value=r.value.slice(1),0===r.value.length?e.children.shift():e.position&&r.position&&"number"==typeof r.position.start.offset&&(r.position.start.column++,r.position.start.offset++,e.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function rS(e,i,r,n){let s=e.children[0],o="boolean"==typeof e.checked&&s&&"paragraph"===s.type,a="["+(e.checked?"x":" ")+"] ",l=r.createTracker(n);o&&l.move(a);let c=ru(e,i,r,{...n,...l.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),c}let rw={tokenize:function(e,i,r){let n=0;return function i(o){return(87===o||119===o)&&n<3?(n++,e.consume(o),i):46===o&&3===n?(e.consume(o),s):r(o)};function s(e){return null===e?r(e):i(e)}},partial:!0},rx={tokenize:function(e,i,r){let n,s,o;return a;function a(i){return 46===i||95===i?e.check(rk,c,l)(i):null===i||eU(i)||eK(i)||45!==i&&eV(i)?c(i):(o=!0,e.consume(i),a)}function l(i){return 95===i?n=!0:(s=n,n=void 0),e.consume(i),a}function c(e){return s||n||!o?r(e):i(e)}},partial:!0},rC={tokenize:function(e,i){let r=0,n=0;return s;function s(a){return 40===a?(r++,e.consume(a),s):41===a&&n<r?o(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(rk,i,o)(a):null===a||eU(a)||eK(a)?i(a):(e.consume(a),s)}function o(i){return 41===i&&n++,e.consume(i),s}},partial:!0},rk={tokenize:function(e,i,r){return n;function n(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),n):38===a?(e.consume(a),o):93===a?(e.consume(a),s):60===a||null===a||eU(a)||eK(a)?i(a):r(a)}function s(e){return null===e||40===e||91===e||eU(e)||eK(e)?i(e):n(e)}function o(i){return eN(i)?function i(s){return 59===s?(e.consume(s),n):eN(s)?(e.consume(s),i):r(s)}(i):r(i)}},partial:!0},rE={tokenize:function(e,i,r){return function(i){return e.consume(i),n};function n(e){return eI(e)?r(e):i(e)}},partial:!0},rR={name:"wwwAutolink",tokenize:function(e,i,r){let n=this;return function(i){return 87!==i&&119!==i||!rM.call(n,n.previous)||rN(n.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rw,e.attempt(rx,e.attempt(rC,s),r),r)(i))};function s(r){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(r)}},previous:rM},rT={name:"protocolAutolink",tokenize:function(e,i,r){let n=this,s="",o=!1;return function(i){return(72===i||104===i)&&rP.call(n,n.previous)&&!rN(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(i),e.consume(i),a):r(i)};function a(i){if(eN(i)&&s.length<5)return s+=String.fromCodePoint(i),e.consume(i),a;if(58===i){let r=s.toLowerCase();if("http"===r||"https"===r)return e.consume(i),l}return r(i)}function l(i){return 47===i?(e.consume(i),o)?c:(o=!0,l):r(i)}function c(i){return null===i||ez(i)||eU(i)||eK(i)||eV(i)?r(i):e.attempt(rx,e.attempt(rC,h),r)(i)}function h(r){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(r)}},previous:rP},rD={name:"emailAutolink",tokenize:function(e,i,r){let n,s,o=this;return function(i){return!rB(i)||!rO.call(o,o.previous)||rN(o.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function i(n){return rB(n)?(e.consume(n),i):64===n?(e.consume(n),a):r(n)}(i))};function a(i){return 46===i?e.check(rE,c,l)(i):45===i||95===i||eI(i)?(s=!0,e.consume(i),a):c(i)}function l(i){return e.consume(i),n=!0,a}function c(a){return s&&n&&eN(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(a)):r(a)}},previous:rO},rL={},rA=48;for(;rA<123;)rL[rA]=rD,58==++rA?rA=65:91===rA&&(rA=97);function rM(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||eU(e)}function rP(e){return!eN(e)}function rO(e){return!(47===e||rB(e))}function rB(e){return 43===e||45===e||46===e||95===e||eI(e)}function rN(e){let i=e.length,r=!1;for(;i--;){let n=e[i][1];if(("labelLink"===n.type||"labelImage"===n.type)&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}rL[43]=rD,rL[45]=rD,rL[46]=rD,rL[95]=rD,rL[72]=[rD,rT],rL[104]=[rD,rT],rL[87]=[rD,rR],rL[119]=[rD,rR];let rI={tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return s&&"gfmFootnoteDefinitionIndent"===s[1].type&&4===s[2].sliceSerialize(s[1],!0).length?i(e):r(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function rF(e,i,r){let n,s=this,o=s.events.length,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);for(;o--;){let e=s.events[o][1];if("labelImage"===e.type){n=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!n||!n._balanced)return r(o);let l=ty(s.sliceSerialize({start:n.end,end:s.now()}));return 94===l.codePointAt(0)&&a.includes(l.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),i(o)):r(o)}}function rz(e,i){let r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[r+1],e[r+2],["enter",n,i],e[r+3],e[r+4],["enter",s,i],["exit",s,i],["enter",o,i],["enter",a,i],["exit",a,i],["exit",o,i],e[e.length-2],e[e.length-1],["exit",n,i]];return e.splice(r,e.length-r+1,...l),e}function rH(e,i,r){let n,s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),a=0;return function(i){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),l};function l(i){return 94!==i?r(i):(e.enter("gfmFootnoteCallMarker"),e.consume(i),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(l){if(a>999||93===l&&!n||null===l||91===l||eU(l))return r(l);if(93===l){e.exit("chunkString");let n=e.exit("gfmFootnoteCallString");return o.includes(ty(s.sliceSerialize(n)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(l)}return eU(l)||(n=!0),a++,e.consume(l),92===l?h:c}function h(i){return 91===i||92===i||93===i?(e.consume(i),a++,c):c(i)}}function rj(e,i,r){let n,s,o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),l=0;return function(i){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionLabelMarker"),c};function c(i){return 94===i?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):r(i)}function h(i){if(l>999||93===i&&!s||null===i||91===i||eU(i))return r(i);if(93===i){e.exit("chunkString");let r=e.exit("gfmFootnoteDefinitionLabelString");return n=ty(o.sliceSerialize(r)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return eU(i)||(s=!0),l++,e.consume(i),92===i?u:h}function u(i){return 91===i||92===i||93===i?(e.consume(i),l++,h):h(i)}function d(i){return 58===i?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),a.includes(n)||a.push(n),eX(e,f,"gfmFootnoteDefinitionWhitespace")):r(i)}function f(e){return i(e)}}function rW(e,i,r){return e.check(eQ,i,e.attempt(rI,i,r))}function r$(e){e.exit("gfmFootnoteDefinition")}class rU{constructor(){this.map=[]}add(e,i,r){!function(e,i,r,n){let s=0;if(0!==r||0!==n.length){for(;s<e.map.length;){if(e.map[s][0]===i){e.map[s][1]+=r,e.map[s][2].push(...n);return}s+=1}e.map.push([i,r,n])}}(this,e,i,r)}consume(e){if(this.map.sort(function(e,i){return e[0]-i[0]}),0===this.map.length)return;let i=this.map.length,r=[];for(;i>0;)i-=1,r.push(e.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),e.length=this.map[i][0];r.push(e.slice()),e.length=0;let n=r.pop();for(;n;){for(let i of n)e.push(i);n=r.pop()}this.map.length=0}}function rq(e,i,r){let n,s=this,o=0,a=0;return function(e){let i=s.events.length-1;for(;i>-1;){let e=s.events[i][1].type;if("lineEnding"===e||"linePrefix"===e)i--;else break}let n=i>-1?s.events[i][1].type:null,o="tableHead"===n||"tableRow"===n?y:l;return o===y&&s.parser.lazy[s.now().line]?r(e):o(e)};function l(i){var r;return e.enter("tableHead"),e.enter("tableRow"),124===(r=i)||(n=!0,a+=1),c(r)}function c(i){return null===i?r(i):e$(i)?a>1?(a=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),d):r(i):eq(i)?eX(e,c,"whitespace")(i):(a+=1,n&&(n=!1,o+=1),124===i)?(e.enter("tableCellDivider"),e.consume(i),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),h(i))}function h(i){return null===i||124===i||eU(i)?(e.exit("data"),c(i)):(e.consume(i),92===i?u:h)}function u(i){return 92===i||124===i?(e.consume(i),h):h(i)}function d(i){return(s.interrupt=!1,s.parser.lazy[s.now().line])?r(i):(e.enter("tableDelimiterRow"),n=!1,eq(i))?eX(e,f,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):f(i)}function f(i){return 45===i||58===i?g(i):124===i?(n=!0,e.enter("tableCellDivider"),e.consume(i),e.exit("tableCellDivider"),p):r(i)}function p(i){return eq(i)?eX(e,g,"whitespace")(i):g(i)}function g(i){return 58===i?(a+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(i),e.exit("tableDelimiterMarker"),m):45===i?(a+=1,m(i)):null===i||e$(i)?v(i):r(i)}function m(i){return 45===i?(e.enter("tableDelimiterFiller"),function i(r){return 45===r?(e.consume(r),i):58===r?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(r),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(r))}(i)):r(i)}function _(i){return eq(i)?eX(e,v,"whitespace")(i):v(i)}function v(s){if(124===s)return f(s);if(null===s||e$(s))return n&&o===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(s)):r(s);return r(s)}function y(i){return e.enter("tableRow"),b(i)}function b(r){return 124===r?(e.enter("tableCellDivider"),e.consume(r),e.exit("tableCellDivider"),b):null===r||e$(r)?(e.exit("tableRow"),i(r)):eq(r)?eX(e,b,"whitespace")(r):(e.enter("data"),S(r))}function S(i){return null===i||124===i||eU(i)?(e.exit("data"),b(i)):(e.consume(i),92===i?w:S)}function w(i){return 92===i||124===i?(e.consume(i),S):S(i)}}function rV(e,i){let r,n,s,o=-1,a=!0,l=0,c=[0,0,0,0],h=[0,0,0,0],u=!1,d=0,f=new rU;for(;++o<e.length;){let p=e[o],g=p[1];"enter"===p[0]?"tableHead"===g.type?(u=!1,0!==d&&(rY(f,i,d,r,n),n=void 0,d=0),r={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",r,i]])):"tableRow"===g.type||"tableDelimiterRow"===g.type?(a=!0,s=void 0,c=[0,0,0,0],h=[0,o+1,0,0],u&&(u=!1,n={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",n,i]])),l="tableDelimiterRow"===g.type?2:n?3:1):l&&("data"===g.type||"tableDelimiterMarker"===g.type||"tableDelimiterFiller"===g.type)?(a=!1,0===h[2]&&(0!==c[1]&&(h[0]=h[1],s=rK(f,i,c,l,void 0,s),c=[0,0,0,0]),h[2]=o)):"tableCellDivider"===g.type&&(a?a=!1:(0!==c[1]&&(h[0]=h[1],s=rK(f,i,c,l,void 0,s)),h=[(c=h)[1],o,0,0])):"tableHead"===g.type?(u=!0,d=o):"tableRow"===g.type||"tableDelimiterRow"===g.type?(d=o,0!==c[1]?(h[0]=h[1],s=rK(f,i,c,l,o,s)):0!==h[1]&&(s=rK(f,i,h,l,o,s)),l=0):l&&("data"===g.type||"tableDelimiterMarker"===g.type||"tableDelimiterFiller"===g.type)&&(h[3]=o)}for(0!==d&&rY(f,i,d,r,n),f.consume(i.events),o=-1;++o<i.events.length;){let e=i.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,i){let r=!1,n=[];for(;i<e.length;){let s=e[i];if(r){if("enter"===s[0])"tableContent"===s[1].type&&n.push("tableDelimiterMarker"===e[i+1][1].type?"left":"none");else if("tableContent"===s[1].type){if("tableDelimiterMarker"===e[i-1][1].type){let e=n.length-1;n[e]="left"===n[e]?"center":"right"}}else if("tableDelimiterRow"===s[1].type)break}else"enter"===s[0]&&"tableDelimiterRow"===s[1].type&&(r=!0);i+=1}return n}(i.events,o))}return e}function rK(e,i,r,n,s,o){0!==r[0]&&(o.end=Object.assign({},rX(i.events,r[0])),e.add(r[0],0,[["exit",o,i]]));let a=rX(i.events,r[1]);if(o={type:1===n?"tableHeader":2===n?"tableDelimiter":"tableData",start:Object.assign({},a),end:Object.assign({},a)},e.add(r[1],0,[["enter",o,i]]),0!==r[2]){let s=rX(i.events,r[2]),o=rX(i.events,r[3]),a={type:"tableContent",start:Object.assign({},s),end:Object.assign({},o)};if(e.add(r[2],0,[["enter",a,i]]),2!==n){let n=i.events[r[2]],s=i.events[r[3]];if(n[1].end=Object.assign({},s[1].end),n[1].type="chunkText",n[1].contentType="text",r[3]>r[2]+1){let i=r[2]+1,n=r[3]-r[2]-1;e.add(i,n,[])}}e.add(r[3]+1,0,[["exit",a,i]])}return void 0!==s&&(o.end=Object.assign({},rX(i.events,s)),e.add(s,0,[["exit",o,i]]),o=void 0),o}function rY(e,i,r,n,s){let o=[],a=rX(i.events,r);s&&(s.end=Object.assign({},a),o.push(["exit",s,i])),n.end=Object.assign({},a),o.push(["exit",n,i]),e.add(r+1,0,o)}function rX(e,i){let r=e[i],n="enter"===r[0]?"start":"end";return r[1][n]}let rG={name:"tasklistCheck",tokenize:function(e,i,r){let n=this;return function(i){return null===n.previous&&n._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),s):r(i)};function s(i){return eU(i)?(e.enter("taskListCheckValueUnchecked"),e.consume(i),e.exit("taskListCheckValueUnchecked"),o):88===i||120===i?(e.enter("taskListCheckValueChecked"),e.consume(i),e.exit("taskListCheckValueChecked"),o):r(i)}function o(i){return 93===i?(e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(i)}function a(n){return e$(n)?i(n):eq(n)?e.check({tokenize:rJ},i,r)(n):r(n)}}};function rJ(e,i,r){return eX(e,function(e){return null===e?r(e):i(e)},"whitespace")}let rZ={};function rQ(e){let i,r,n,s=e||rZ,o=this.data(),a=o.micromarkExtensions||(o.micromarkExtensions=[]),l=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),c=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);a.push(eB([{text:rL},{document:{91:{name:"gfmFootnoteDefinition",tokenize:rj,continuation:{tokenize:rW},exit:r$}},text:{91:{name:"gfmFootnoteCall",tokenize:rH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rF,resolveTo:rz}}},(i=(s||{}).singleTilde,r={name:"strikethrough",tokenize:function(e,r,n){let s=this.previous,o=this.events,a=0;return function(l){return 126===s&&"characterEscape"!==o[o.length-1][1].type?n(l):(e.enter("strikethroughSequenceTemporary"),function o(l){let c=ti(s);if(126===l)return a>1?n(l):(e.consume(l),a++,o);if(a<2&&!i)return n(l);let h=e.exit("strikethroughSequenceTemporary"),u=ti(l);return h._open=!u||2===u&&!!c,h._close=!c||2===c&&!!u,r(l)}(l))}},resolveAll:function(e,i){let r=-1;for(;++r<e.length;)if("enter"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._close){let n=r;for(;n--;)if("exit"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._open&&e[r][1].end.offset-e[r][1].start.offset==e[n][1].end.offset-e[n][1].start.offset){e[r][1].type="strikethroughSequence",e[n][1].type="strikethroughSequence";let s={type:"strikethrough",start:Object.assign({},e[n][1].start),end:Object.assign({},e[r][1].end)},o={type:"strikethroughText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[r][1].start)},a=[["enter",s,i],["enter",e[n][1],i],["exit",e[n][1],i],["enter",o,i]],l=i.parser.constructs.insideSpan.null;l&&eM(a,a.length,0,tr(l,e.slice(n+1,r),i)),eM(a,a.length,0,[["exit",o,i],["enter",e[r][1],i],["exit",e[r][1],i],["exit",s,i]]),eM(e,n-1,r-n+3,a),r=n+a.length-2;break}}for(r=-1;++r<e.length;)"strikethroughSequenceTemporary"===e[r][1].type&&(e[r][1].type="data");return e}},null==i&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:rq,resolveAll:rV}}},{text:{91:rG}}])),l.push([{transforms:[iQ],enter:{literalAutolink:iK,literalAutolinkEmail:iY,literalAutolinkHttp:iY,literalAutolinkWww:iY},exit:{literalAutolink:iZ,literalAutolinkEmail:iJ,literalAutolinkHttp:iX,literalAutolinkWww:iG}},{enter:{gfmFootnoteCallString:i5,gfmFootnoteCall:i3,gfmFootnoteDefinitionLabelString:i4,gfmFootnoteDefinition:i6},exit:{gfmFootnoteCallString:i9,gfmFootnoteCall:i8,gfmFootnoteDefinitionLabelString:i7,gfmFootnoteDefinition:re}},{canContainEols:["delete"],enter:{strikethrough:rs},exit:{strikethrough:ro}},{enter:{table:rd,tableData:rm,tableHeader:rm,tableRow:rp},exit:{codeText:r_,table:rf,tableData:rg,tableHeader:rg,tableRow:rg}},{exit:{taskListCheckValueChecked:ry,taskListCheckValueUnchecked:ry,paragraph:rb}}]),c.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:iq,notInConstruct:iV},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:iq,notInConstruct:iV},{character:":",before:"[ps]",after:"\\/",inConstruct:iq,notInConstruct:iV}]},(n=!1,s&&s.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:function(e,i,r,s){let o=r.createTracker(s),a=o.move("[^"),l=r.enter("footnoteDefinition"),c=r.enter("label");return a+=o.move(r.safe(r.associationId(e),{before:a,after:"]"})),c(),a+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),a+=o.move((n?"\n":" ")+r.indentLines(r.containerFlow(e,o.current()),n?rr:ri))),l(),a},footnoteReference:rt},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rn}],handlers:{delete:ra}},function(e){let i=e||{},r=i.tableCellPadding,n=i.tablePipeAlign,s=i.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,i,r){let n=rh(e,i,r);return r.stack.includes("tableCell")&&(n=n.replace(/\|/g,"\\$&")),n},table:function(e,i,r,n){return l(function(e,i,r){let n=e.children,s=-1,o=[],a=i.enter("table");for(;++s<n.length;)o[s]=c(n[s],i,r);return a(),o}(e,r,n),e.align)},tableCell:a,tableRow:function(e,i,r,n){let s=l([c(e,r,n)]);return s.slice(0,s.indexOf("\n"))}}};function a(e,i,r,n){let s=r.enter("tableCell"),a=r.enter("phrasing"),l=r.containerPhrasing(e,{...n,before:o,after:o});return a(),s(),l}function l(e,i){return function(e,i){let r=i||{},n=(r.align||[]).concat(),s=r.stringLength||rl,o=[],a=[],l=[],c=[],h=0,u=-1;for(;++u<e.length;){let i=[],n=[],o=-1;for(e[u].length>h&&(h=e[u].length);++o<e[u].length;){var d;let a=null==(d=e[u][o])?"":String(d);if(!1!==r.alignDelimiters){let e=s(a);n[o]=e,(void 0===c[o]||e>c[o])&&(c[o]=e)}i.push(a)}a[u]=i,l[u]=n}let f=-1;if("object"==typeof n&&"length"in n)for(;++f<h;)o[f]=rc(n[f]);else{let e=rc(n);for(;++f<h;)o[f]=e}f=-1;let p=[],g=[];for(;++f<h;){let e=o[f],i="",n="";99===e?(i=":",n=":"):108===e?i=":":114===e&&(n=":");let s=!1===r.alignDelimiters?1:Math.max(1,c[f]-i.length-n.length),a=i+"-".repeat(s)+n;!1!==r.alignDelimiters&&((s=i.length+s+n.length)>c[f]&&(c[f]=s),g[f]=s),p[f]=a}a.splice(1,0,p),l.splice(1,0,g),u=-1;let m=[];for(;++u<a.length;){let e=a[u],i=l[u];f=-1;let n=[];for(;++f<h;){let s=e[f]||"",a="",l="";if(!1!==r.alignDelimiters){let e=c[f]-(i[f]||0),r=o[f];114===r?a=" ".repeat(e):99===r?e%2?(a=" ".repeat(e/2+.5),l=" ".repeat(e/2-.5)):l=a=" ".repeat(e/2):l=" ".repeat(e)}!1===r.delimiterStart||f||n.push("|"),!1!==r.padding&&(!1!==r.alignDelimiters||""!==s)&&(!1!==r.delimiterStart||f)&&n.push(" "),!1!==r.alignDelimiters&&n.push(a),n.push(s),!1!==r.alignDelimiters&&n.push(l),!1!==r.padding&&n.push(" "),(!1!==r.delimiterEnd||f!==h-1)&&n.push("|")}m.push(!1===r.delimiterEnd?n.join("").replace(/ +$/,""):n.join(""))}return m.join("\n")}(e,{align:i,alignDelimiters:n,padding:r,stringLength:s})}function c(e,i,r){let n=e.children,s=-1,o=[],l=i.enter("tableRow");for(;++s<n.length;)o[s]=a(n[s],e,i,r);return l(),o}}(s),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rS}}]})}var r0=e.i(75254);let r1=(0,r0.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),r2=(0,r0.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r2],74886);var r5=e.i(43531),r3=e.i(85902);function r4({language:e,code:i,children:r}){let[n,s]=(0,m.useState)(!1),o=async()=>{try{await navigator.clipboard.writeText(i),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){console.error("Failed to copy code:",e)}};return(0,g.jsxs)("div",{className:"relative group",children:[(0,g.jsx)(r3.Button,{variant:"ghost",size:"icon-sm",onClick:o,className:"absolute top-2 right-2 opacity-80 hover:opacity-100",title:n?"Copied!":"Copy code","aria-label":n?"Copied to clipboard":"Copy code to clipboard",children:n?(0,g.jsx)(r5.Check,{className:"w-4 h-4 text-success"}):(0,g.jsx)(r2,{className:"w-4 h-4 text-foreground"})}),(0,g.jsx)("pre",{children:(0,g.jsx)("code",{className:e?`language-${e}`:"",children:r})})]})}var r6=e.i(44917),r9=e.i(60948),r8=e.i(3262);e.i(31360),e.i(9003),e.i(60884),e.i(88147),e.i(11338);var r7=e.i(9796),ne=e.i(29432),nt=e.i(96977),ni=e.i(71206),nr=e.i(40524);e.i(47716);var nn=e.i(23685),ns="comm",no="rule",na="decl",nl=Math.abs,nc=String.fromCharCode;function nh(e,i,r){return e.replace(i,r)}function nu(e,i){return 0|e.charCodeAt(i)}function nd(e,i,r){return e.slice(i,r)}function nf(e){return e.length}function np(e,i){return i.push(e),e}var ng=1,nm=1,n_=0,nv=0,ny=0,nb="";function nS(e,i,r,n,s,o,a,l){return{value:e,root:i,parent:r,type:n,props:s,children:o,line:ng,column:nm,length:a,return:"",siblings:l}}function nw(){return ny=nv<n_?nu(nb,nv++):0,nm++,10===ny&&(nm=1,ng++),ny}function nx(){return nu(nb,nv)}function nC(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function nk(e){var i,r;return(i=nv-1,r=function e(i){for(;nw();)switch(ny){case i:return nv;case 34:case 39:34!==i&&39!==i&&e(ny);break;case 40:41===i&&e(i);break;case 92:nw()}return nv}(91===e?e+2:40===e?e+1:e),nd(nb,i,r)).trim()}function nE(e,i,r,n,s,o,a,l,c,h,u,d){for(var f=s-1,p=0===s?o:[""],g=p.length,m=0,_=0,v=0;m<n;++m)for(var y=0,b=nd(e,f+1,f=nl(_=a[m])),S=e;y<g;++y)(S=(_>0?p[y]+" "+b:nh(b,/&\f/g,p[y])).trim())&&(c[v++]=S);return nS(e,i,r,0===s?no:l,c,h,u,d)}function nR(e,i,r,n,s){return nS(e,i,r,na,nd(e,0,n),nd(e,n+1,-1),n,s)}function nT(e,i){for(var r="",n=0;n<e.length;n++)r+=i(e[n],n,e,i)||"";return r}function nD(e,i,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case na:return e.return=e.return||e.value;case ns:return"";case"@keyframes":return e.return=e.value+"{"+nT(e.children,n)+"}";case no:if(!nf(e.value=e.props.join(",")))return""}return nf(r=nT(e.children,n))?e.return=e.value+"{"+r+"}":""}var nL=e.i(24154),nA=e.i(41241),nM={id:"c4",detector:(0,ni.__name)(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78997);return{id:"c4",diagram:i}},"loader")},nP="flowchart",nO=(0,ni.__name)((e,i)=>i?.flowchart?.defaultRenderer!=="dagre-wrapper"&&i?.flowchart?.defaultRenderer!=="elk"&&/^\s*graph/.test(e),"detector"),nB=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:nP,diagram:i}},"loader"),nN={id:nP,detector:nO,loader:nB},nI="flowchart-v2",nF=(0,ni.__name)((e,i)=>i?.flowchart?.defaultRenderer!=="dagre-d3"&&(i?.flowchart?.defaultRenderer==="elk"&&(i.layout="elk"),!!/^\s*graph/.test(e)&&i?.flowchart?.defaultRenderer==="dagre-wrapper"||/^\s*flowchart/.test(e)),"detector"),nz=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:nI,diagram:i}},"loader"),nH={id:nI,detector:nF,loader:nz},nj={id:"er",detector:(0,ni.__name)(e=>/^\s*erDiagram/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(80472);return{id:"er",diagram:i}},"loader")},nW="gitGraph",n$=(0,ni.__name)(e=>/^\s*gitGraph/.test(e),"detector"),nU=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(83305);return{id:nW,diagram:i}},"loader"),nq={id:nW,detector:n$,loader:nU},nV="gantt",nK=(0,ni.__name)(e=>/^\s*gantt/.test(e),"detector"),nY=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(34606);return{id:nV,diagram:i}},"loader"),nX={id:nV,detector:nK,loader:nY},nG="info",nJ=(0,ni.__name)(e=>/^\s*info/.test(e),"detector"),nZ=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(23526);return{id:nG,diagram:i}},"loader"),nQ={id:nG,detector:nJ,loader:nZ},n0={id:"pie",detector:(0,ni.__name)(e=>/^\s*pie/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(3931);return{id:"pie",diagram:i}},"loader")},n1="quadrantChart",n2=(0,ni.__name)(e=>/^\s*quadrantChart/.test(e),"detector"),n5=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(67051);return{id:n1,diagram:i}},"loader"),n3={id:n1,detector:n2,loader:n5},n4="xychart",n6=(0,ni.__name)(e=>/^\s*xychart(-beta)?/.test(e),"detector"),n9=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(36080);return{id:n4,diagram:i}},"loader"),n8={id:n4,detector:n6,loader:n9},n7="requirement",se=(0,ni.__name)(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),st=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(3156);return{id:n7,diagram:i}},"loader"),si={id:n7,detector:se,loader:st},sr="sequence",sn=(0,ni.__name)(e=>/^\s*sequenceDiagram/.test(e),"detector"),ss=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(71209);return{id:sr,diagram:i}},"loader"),so={id:sr,detector:sn,loader:ss},sa="class",sl=(0,ni.__name)((e,i)=>i?.class?.defaultRenderer!=="dagre-wrapper"&&/^\s*classDiagram/.test(e),"detector"),sc=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78922);return{id:sa,diagram:i}},"loader"),sh={id:sa,detector:sl,loader:sc},su="classDiagram",sd=(0,ni.__name)((e,i)=>!!/^\s*classDiagram/.test(e)&&i?.class?.defaultRenderer==="dagre-wrapper"||/^\s*classDiagram-v2/.test(e),"detector"),sf=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(10404);return{id:su,diagram:i}},"loader"),sp={id:su,detector:sd,loader:sf},sg="state",sm=(0,ni.__name)((e,i)=>i?.state?.defaultRenderer!=="dagre-wrapper"&&/^\s*stateDiagram/.test(e),"detector"),s_=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(81283);return{id:sg,diagram:i}},"loader"),sv={id:sg,detector:sm,loader:s_},sy="stateDiagram",sb=(0,ni.__name)((e,i)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&i?.state?.defaultRenderer==="dagre-wrapper"),"detector"),sS=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(41605);return{id:sy,diagram:i}},"loader"),sw={id:sy,detector:sb,loader:sS},sx="journey",sC=(0,ni.__name)(e=>/^\s*journey/.test(e),"detector"),sk=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78877);return{id:sx,diagram:i}},"loader"),sE={id:sx,detector:sC,loader:sk},sR={draw:(0,ni.__name)((e,i,r)=>{ni.log.debug("rendering svg for syntax error\n");let n=(0,r6.selectSvgElement)(i),s=n.append("g");n.attr("viewBox","0 0 2412 512"),(0,nt.configureSvgSize)(n,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},sT={db:{},renderer:sR,parser:{parse:(0,ni.__name)(()=>{},"parse")}},sD="flowchart-elk",sL=(0,ni.__name)((e,i={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&i?.flowchart?.defaultRenderer==="elk")&&(i.layout="elk",!0),"detector"),sA=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:sD,diagram:i}},"loader"),sM={id:sD,detector:sL,loader:sA},sP="timeline",sO=(0,ni.__name)(e=>/^\s*timeline/.test(e),"detector"),sB=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(27415);return{id:sP,diagram:i}},"loader"),sN={id:sP,detector:sO,loader:sB},sI="mindmap",sF=(0,ni.__name)(e=>/^\s*mindmap/.test(e),"detector"),sz=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(44319);return{id:sI,diagram:i}},"loader"),sH={id:sI,detector:sF,loader:sz},sj="kanban",sW=(0,ni.__name)(e=>/^\s*kanban/.test(e),"detector"),s$=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(31376);return{id:sj,diagram:i}},"loader"),sU={id:sj,detector:sW,loader:s$},sq="sankey",sV=(0,ni.__name)(e=>/^\s*sankey(-beta)?/.test(e),"detector"),sK=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(34215);return{id:sq,diagram:i}},"loader"),sY={id:sq,detector:sV,loader:sK},sX="packet",sG=(0,ni.__name)(e=>/^\s*packet(-beta)?/.test(e),"detector"),sJ=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(11980);return{id:sX,diagram:i}},"loader"),sZ={id:sX,detector:sG,loader:sJ},sQ="radar",s0=(0,ni.__name)(e=>/^\s*radar-beta/.test(e),"detector"),s1=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(70234);return{id:sQ,diagram:i}},"loader"),s2={id:sQ,detector:s0,loader:s1},s5="block",s3=(0,ni.__name)(e=>/^\s*block(-beta)?/.test(e),"detector"),s4=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(44243);return{id:s5,diagram:i}},"loader"),s6={id:s5,detector:s3,loader:s4},s9="treeView",s8=(0,ni.__name)(e=>/^\s*treeView-beta/.test(e),"detector"),s7=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(51365);return{id:s9,diagram:i}},"loader"),oe={id:s9,detector:s8,loader:s7},ot="architecture",oi=(0,ni.__name)(e=>/^\s*architecture/.test(e),"detector"),or=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(46201);return{id:ot,diagram:i}},"loader"),on={id:ot,detector:oi,loader:or},os="ishikawa",oo=(0,ni.__name)(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),oa=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(48926);return{id:os,diagram:i}},"loader"),ol={id:os,detector:oo,loader:oa},oc="venn",oh=(0,ni.__name)(e=>/^\s*venn-beta/.test(e),"detector"),ou=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(81291);return{id:oc,diagram:i}},"loader"),od={id:oc,detector:oh,loader:ou},of="treemap",op=(0,ni.__name)(e=>/^\s*treemap/.test(e),"detector"),og=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(31656);return{id:of,diagram:i}},"loader"),om={id:of,detector:op,loader:og},o_="wardley-beta",ov=(0,ni.__name)(e=>/^\s*wardley-beta/i.test(e),"detector"),oy=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(22654);return{id:o_,diagram:i}},"loader"),ob={id:o_,detector:ov,loader:oy},oS=!1,ow=(0,ni.__name)(()=>{oS||(oS=!0,(0,nt.registerDiagram)("error",sT,e=>"error"===e.toLowerCase().trim()),(0,nt.registerDiagram)("---",{db:{clear:(0,ni.__name)(()=>{},"clear")},styles:{},renderer:{draw:(0,ni.__name)(()=>{},"draw")},parser:{parse:(0,ni.__name)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,ni.__name)(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),(0,nt.registerLazyLoadedDiagrams)(sM,sH,on),(0,nt.registerLazyLoadedDiagrams)(nM,sU,sp,sh,nj,nX,nQ,n0,si,so,nH,nN,sN,nq,sw,sv,sE,n3,sY,sZ,n8,s6,oe,s2,ol,om,od,ob))},"addDiagrams"),ox=(0,ni.__name)(async()=>{ni.log.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(nt.detectors).map(async([e,{detector:i,loader:r}])=>{if(r)try{(0,nt.getDiagram)(e)}catch{try{let{diagram:e,id:n}=await r();(0,nt.registerDiagram)(n,e,i)}catch(i){throw ni.log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete nt.detectors[e],i}}}))).filter(e=>"rejected"===e.status);if(e.length>0){for(let i of(ni.log.error(`Failed to load ${e.length} external diagrams`),e))ni.log.error(i);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function oC(e,i){e.attr("role","graphics-document document"),""!==i&&e.attr("aria-roledescription",i)}function ok(e,i,r,n){if(void 0!==e.insert){if(r){let i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(i){let r=`chart-title-${n}`;e.attr("aria-labelledby",r),e.insert("title",":first-child").attr("id",r).text(i)}}}(0,ni.__name)(oC,"setA11yDiagramInfo"),(0,ni.__name)(ok,"addSVGa11yTitleDescription");var oE=class e{constructor(e,i,r,n,s){this.type=e,this.text=i,this.db=r,this.parser=n,this.renderer=s}static{(0,ni.__name)(this,"Diagram")}static async fromText(i,r={}){let n=(0,nt.getConfig)(),s=(0,nt.detectType)(i,n);i=(0,ne.encodeEntities)(i)+"\n";try{(0,nt.getDiagram)(s)}catch{let e=(0,nt.getDiagramLoader)(s);if(!e)throw new nt.UnknownDiagramError(`Diagram ${s} not found.`);let{id:i,diagram:r}=await e();(0,nt.registerDiagram)(i,r)}let{db:o,parser:a,renderer:l,init:c}=(0,nt.getDiagram)(s);return a.parser&&(a.parser.yy=o),o.clear?.(),c?.(n),r.title&&o.setDiagramTitle?.(r.title),await a.parse(i),new e(s,i,o,a,l)}async render(e,i){await this.renderer.draw(this.text,e,i,this)}getParser(){return this.parser}getType(){return this.type}},oR=[],oT=(0,ni.__name)(()=>{oR.forEach(e=>{e()}),oR=[]},"attachFunctions"),oD=(0,ni.__name)(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function oL(e){let i=e.match(nt.frontMatterRegex);if(!i)return{text:e,metadata:{}};let r=(0,r9.load)(i[1],{schema:r9.JSON_SCHEMA})??{};r="object"!=typeof r||Array.isArray(r)?{}:r;let n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:e.slice(i[0].length),metadata:n}}(0,ni.__name)(oL,"extractFrontMatter");var oA=(0,ni.__name)(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,i,r)=>"<"+i+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oM=(0,ni.__name)(e=>{let{text:i,metadata:r}=oL(e),{displayMode:n,title:s,config:o={}}=r;return n&&(o.gantt||(o.gantt={}),o.gantt.displayMode=n),{title:s,config:o,text:i}},"processFrontmatter"),oP=(0,ni.__name)(e=>{let i=ne.utils_default.detectInit(e)??{},r=ne.utils_default.detectDirective(e,"wrap");return Array.isArray(r)?i.wrap=r.some(({type:e})=>"wrap"===e):r?.type==="wrap"&&(i.wrap=!0),{text:(0,ne.removeDirectives)(e),directive:i}},"processDirectives");function oO(e){let i=oM(oA(e)),r=oP(i.text),n=(0,ne.cleanAndMerge)(i.config,r.directive);return{code:e=oD(r.text),title:i.title,config:n}}function oB(e){return btoa(Array.from(new TextEncoder().encode(e),e=>String.fromCodePoint(e)).join(""))}(0,ni.__name)(oO,"preprocessDiagram"),(0,ni.__name)(oB,"toBase64");var oN=["foreignobject"],oI=["dominant-baseline"];function oF(e){let i=oO(e);return(0,nt.reset)(),(0,nt.addDirective)(i.config??{}),i}async function oz(e,i){ow();try{let{code:i,config:r}=oF(e);return{diagramType:(await oG(i)).type,config:r}}catch(e){if(i?.suppressErrors)return!1;throw e}}(0,ni.__name)(oF,"processAndSetConfigs"),(0,ni.__name)(oz,"parse");var oH=(0,ni.__name)((e,i,r=[])=>`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68054,e=>{"use strict";let i=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,i],68054)},26568,(e,i,r)=>{"use strict";var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,s=/\n/g,o=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}i.exports=function(e,i){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];i=i||{};var r=1,u=1;function f(e){var i=e.match(s);i&&(r+=i.length);var n=e.lastIndexOf("\n");u=~n?e.length-n:u+e.length}function p(){var e={line:r,column:u};return function(i){return i.position=new g(e),_(o),i}}function g(e){this.start=e,this.end={line:r,column:u},this.source=i.source}function m(n){var s=Error(i.source+":"+r+":"+u+": "+n);if(s.reason=n,s.filename=i.source,s.line=r,s.column=u,s.source=e,i.silent);else throw s}function _(i){var r=i.exec(e);if(r){var n=r[0];return f(n),e=e.slice(n.length),r}}function v(e){var i;for(e=e||[];i=y();)!1!==i&&e.push(i);return e}function y(){var i=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return m("End of comment missing");var n=e.slice(2,r-2);return u+=2,f(n),e=e.slice(r),u+=2,i({type:"comment",comment:n})}}g.prototype.content=e,_(o);var b,S=[];for(v(S);b=function(){var e=p(),i=_(a);if(i){if(y(),!_(l))return m("property missing ':'");var r=_(c),s=e({type:"declaration",property:d(i[0].replace(n,"")),value:r?d(r[0].replace(n,"")):""});return _(h),s}}();)!1!==b&&(S.push(b),v(S));return S}},70454,(e,i,r)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,i){let r=null;if(!e||"string"!=typeof e)return r;let n=(0,s.default)(e),o="function"==typeof i;return n.forEach(e=>{if("declaration"!==e.type)return;let{property:n,value:s}=e;o?i(n,s,e):s&&((r=r||{})[n]=s)}),r};let s=n(e.r(26568))},65185,(e,i,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,s=/-([a-z])/g,o=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,c=function(e,i){return i.toUpperCase()},h=function(e,i){return"".concat(i,"-")};r.camelCase=function(e,i){var r;return(void 0===i&&(i={}),!(r=e)||o.test(r)||n.test(r))?e:(e=e.toLowerCase(),(e=i.reactCompat?e.replace(l,h):e.replace(a,h)).replace(s,c))}},15511,(e,i,r)=>{"use strict";var n=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),s=e.r(65185);function o(e,i){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,s.camelCase)(e,i)]=n)}),r}o.default=o,i.exports=o},4100,(e,i,r)=>{"use strict";var n=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===s.call(e)},c=function(e){if(!e||"[object Object]"!==s.call(e))return!1;var i,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||n.call(e,i)},h=function(e,i){o&&"__proto__"===i.name?o(e,i.name,{enumerable:!0,configurable:!0,value:i.newValue,writable:!0}):e[i.name]=i.newValue},u=function(e,i){if("__proto__"===i){if(!n.call(e,i))return;else if(a)return a(e,i).value}return e[i]};i.exports=function e(){var i,r,n,s,o,a,d=arguments[0],f=1,p=arguments.length,g=!1;for("boolean"==typeof d&&(g=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(i=arguments[f],null!=i)for(r in i)n=u(d,r),d!==(s=u(i,r))&&(g&&s&&(c(s)||(o=l(s)))?(o?(o=!1,a=n&&l(n)?n:[]):a=n&&c(n)?n:{},h(d,{name:r,newValue:e(g,a,s)})):void 0!==s&&h(d,{name:r,newValue:s}));return d}},10483,74886,76165,37287,97254,79144,67569,56590,18847,61896,60752,12666,54943,78784,e=>{"use strict";let i,r,n;var s,o,a,l,c,h,u,d,f,p,g=e.i(18050),m=e.i(71645),_=e.i(88784);function v(){}function y(){}let b=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w={};function x(e,i){return((i||w).jsx?S:b).test(e)}let C=/[ \t\n\f\r]/g;function k(e){return""===e.replace(C,"")}class E{constructor(e,i){this.attribute=i,this.property=e}}E.prototype.attribute="",E.prototype.booleanish=!1,E.prototype.boolean=!1,E.prototype.commaOrSpaceSeparated=!1,E.prototype.commaSeparated=!1,E.prototype.defined=!1,E.prototype.mustUseProperty=!1,E.prototype.number=!1,E.prototype.overloadedBoolean=!1,E.prototype.property="",E.prototype.spaceSeparated=!1,E.prototype.space=void 0;let R=0,T=B(),D=B(),L=B(),A=B(),M=B(),P=B(),O=B();function B(){return 2**++R}e.s(["boolean",0,T,"booleanish",0,D,"commaOrSpaceSeparated",0,O,"commaSeparated",0,P,"number",0,A,"overloadedBoolean",0,L,"spaceSeparated",0,M],744);var N=e.i(744);let I=Object.keys(N);class F extends E{constructor(e,i,r,n){let s=-1;if(super(e,i),function(e,i,r){r&&(e[i]=r)}(this,"space",n),"number"==typeof r)for(;++s<I.length;){const e=I[s];!function(e,i,r){r&&(e[i]=r)}(this,I[s],(r&N[e])===N[e])}}}function z(e){return e.toLowerCase()}F.prototype.defined=!0;let H=/[A-Z]/g,j=/-[a-z]/g,W=/^data[-\w.:]+$/i;function $(e){return"-"+e.toLowerCase()}function U(e){return e.charAt(1).toUpperCase()}let q={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"};class V{constructor(e,i,r){this.normal=i,this.property=e,r&&(this.space=r)}}function K(e,i){let r={},n={};for(let i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new V(r,n,i)}function Y(e){let i={},r={};for(let[n,s]of Object.entries(e.properties)){let o=new F(n,e.transform(e.attributes||{},n),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),i[n]=o,r[z(n)]=n,r[z(o.attribute)]=n}return new V(i,r,e.space)}V.prototype.normal={},V.prototype.property={},V.prototype.space=void 0;let X=Y({properties:{ariaActiveDescendant:null,ariaAtomic:D,ariaAutoComplete:null,ariaBusy:D,ariaChecked:D,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:M,ariaCurrent:null,ariaDescribedBy:M,ariaDetails:null,ariaDisabled:D,ariaDropEffect:M,ariaErrorMessage:null,ariaExpanded:D,ariaFlowTo:M,ariaGrabbed:D,ariaHasPopup:null,ariaHidden:D,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:M,ariaLevel:A,ariaLive:null,ariaModal:D,ariaMultiLine:D,ariaMultiSelectable:D,ariaOrientation:null,ariaOwns:M,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:D,ariaReadOnly:D,ariaRelevant:null,ariaRequired:D,ariaRoleDescription:M,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:D,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform:(e,i)=>"role"===i?i:"aria-"+i.slice(4).toLowerCase()});function G(e,i){return i in e?e[i]:i}function J(e,i){return G(e,i.toLowerCase())}let Z=Y({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:P,acceptCharset:M,accessKey:M,action:null,allow:null,allowFullScreen:T,allowPaymentRequest:T,allowUserMedia:T,alt:null,as:null,async:T,autoCapitalize:null,autoComplete:M,autoFocus:T,autoPlay:T,blocking:M,capture:null,charSet:null,checked:T,cite:null,className:M,cols:A,colSpan:null,content:null,contentEditable:D,controls:T,controlsList:M,coords:A|P,crossOrigin:null,data:null,dateTime:null,decoding:null,default:T,defer:T,dir:null,dirName:null,disabled:T,download:L,draggable:D,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:T,formTarget:null,headers:M,height:A,hidden:L,high:A,href:null,hrefLang:null,htmlFor:M,httpEquiv:M,id:null,imageSizes:null,imageSrcSet:null,inert:T,inputMode:null,integrity:null,is:null,isMap:T,itemId:null,itemProp:M,itemRef:M,itemScope:T,itemType:M,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:T,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:T,muted:T,name:null,nonce:null,noModule:T,noValidate:T,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:T,optimum:A,pattern:null,ping:M,placeholder:null,playsInline:T,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:T,referrerPolicy:null,rel:M,required:T,reversed:T,rows:A,rowSpan:A,sandbox:M,scope:null,scoped:T,seamless:T,selected:T,shadowRootClonable:T,shadowRootDelegatesFocus:T,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:D,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:T,useMap:null,value:D,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:M,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:T,declare:T,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:T,noHref:T,noShade:T,noWrap:T,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:D,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:T,disableRemotePlayback:T,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:J}),Q=Y({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:O,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:M,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:T,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:P,g2:P,glyphName:P,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:O,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,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:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:M,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:O,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:O,rev:O,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:O,requiredFeatures:O,requiredFonts:O,requiredFormats:O,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:O,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:O,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:O,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:G}),ee=Y({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,i)=>"xlink:"+i.slice(5).toLowerCase()}),et=Y({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:J}),ei=Y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,i)=>"xml:"+i.slice(3).toLowerCase()}),er=K([X,Z,ee,et,ei],"html"),en=K([X,Q,ee,et,ei],"svg");var es=e.i(15511);let eo=el("end"),ea=el("start");function el(e){return function(i){let r=i&&i.position&&i.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function ec(e){return e&&"object"==typeof e?"position"in e||"type"in e?eu(e.position):"start"in e||"end"in e?eu(e):"line"in e||"column"in e?eh(e):"":""}function eh(e){return ed(e&&e.line)+":"+ed(e&&e.column)}function eu(e){return eh(e&&e.start)+"-"+eh(e&&e.end)}function ed(e){return e&&"number"==typeof e?e:1}class ef extends Error{constructor(e,i,r){super(),"string"==typeof i&&(r=i,i=void 0);let n="",s={},o=!1;if(i&&(s="line"in i&&"column"in i||"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof e?n=e:!s.cause&&e&&(o=!0,n=e.message,s.cause=e),!s.ruleId&&!s.source&&"string"==typeof r){const e=r.indexOf(":");-1===e?s.ruleId=r:(s.source=r.slice(0,e),s.ruleId=r.slice(e+1))}if(!s.place&&s.ancestors&&s.ancestors){const e=s.ancestors[s.ancestors.length-1];e&&(s.place=e.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=a?a.line:void 0,this.name=ec(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&"string"==typeof s.cause.stack?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ef.prototype.file="",ef.prototype.name="",ef.prototype.reason="",ef.prototype.message="",ef.prototype.stack="",ef.prototype.column=void 0,ef.prototype.line=void 0,ef.prototype.ancestors=void 0,ef.prototype.cause=void 0,ef.prototype.fatal=void 0,ef.prototype.place=void 0,ef.prototype.ruleId=void 0,ef.prototype.source=void 0;let ep={}.hasOwnProperty,eg=new Map,em=/[A-Z]/g,e_=new Set(["table","tbody","thead","tfoot","tr"]),ev=new Set(["td","th"]),ey="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eb(e,i,r){var n,s,o,a,l,c,h,u,d;let f,p,g,m,_,y,b,S,w,x,C;return"element"===i.type?(n=e,s=i,o=r,p=f=n.schema,"svg"===s.tagName.toLowerCase()&&"html"===f.space&&(n.schema=en),n.ancestors.push(s),g=eC(n,s.tagName,!1),m=function(e,i){let r,n,s={};for(n in i.properties)if("children"!==n&&ep.call(i.properties,n)){let o=function(e,i,r){let n=function(e,i){let r=z(i),n=i,s=E;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&W.test(i)){if("-"===i.charAt(4)){let e=i.slice(5).replace(j,U);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=i.slice(4);if(!j.test(e)){let r=e.replace(H,$);"-"!==r.charAt(0)&&(r="-"+r),i="data"+r}}s=F}return new s(n,i)}(e.schema,i);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){var s;let i;if(Array.isArray(r)&&(r=n.commaSeparated?(i={},(""===(s=r)[s.length-1]?[...s,""]:s).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()):r.join(" ").trim()),"style"===n.property){let i="object"==typeof r?r:function(e,i){try{return(0,es.default)(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let i=new ef("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=ey+"#cannot-parse-style-attribute",i}}(e,String(r));return"css"===e.stylePropertyNameCase&&(i=function(e){let i,r={};for(i in e)ep.call(e,i)&&(r[function(e){let i=e.replace(em,eE);return"ms-"===i.slice(0,3)&&(i="-"+i),i}(i)]=e[i]);return r}(i)),["style",i]}return["react"===e.elementAttributeNameCase&&n.space?q[n.property]||n.property:n.attribute,r]}}(e,n,i.properties[n]);if(o){let[n,a]=o;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof a&&ev.has(i.tagName)?r=a:s[n]=a}}return r&&((s.style||(s.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),s}(n,s),_=ex(n,s),e_.has(s.tagName)&&(_=_.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&k(e.value):k(e))})),eS(n,m,g,s),ew(m,_),n.ancestors.pop(),n.schema=f,n.create(s,g,m,o)):"mdxFlowExpression"===i.type||"mdxTextExpression"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater){let r=i.data.estree.body[0];return v("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}ek(e,i.position)}(e,i):"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?(a=e,l=i,c=r,b=y=a.schema,"svg"===l.name&&"html"===y.space&&(a.schema=en),a.ancestors.push(l),S=null===l.name?a.Fragment:eC(a,l.name,!0),w=function(e,i){let r={};for(let n of i.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let i=n.data.estree.body[0];v("ExpressionStatement"===i.type);let s=i.expression;v("ObjectExpression"===s.type);let o=s.properties[0];v("SpreadElement"===o.type),Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else ek(e,i.position);else{let s,o=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let i=n.value.data.estree.body[0];v("ExpressionStatement"===i.type),s=e.evaluater.evaluateExpression(i.expression)}else ek(e,i.position);else s=null===n.value||n.value;r[o]=s}return r}(a,l),x=ex(a,l),eS(a,w,S,l),ew(w,x),a.ancestors.pop(),a.schema=y,a.create(l,S,w,c)):"mdxjsEsm"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);ek(e,i.position)}(e,i):"root"===i.type?(h=e,u=i,d=r,ew(C={},ex(h,u)),h.create(u,h.Fragment,C,d)):"text"===i.type?i.value:void 0}function eS(e,i,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(i.node=n)}function ew(e,i){if(i.length>0){let r=i.length>1?i:i[0];r&&(e.children=r)}}function ex(e,i){let r=[],n=-1,s=e.passKeys?new Map:eg;for(;++n<i.children.length;){let o,a=i.children[n];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let i=s.get(e)||0;o=e+"-"+i,s.set(e,i+1)}}let l=eb(e,a,o);void 0!==l&&r.push(l)}return r}function eC(e,i,r){let n;if(r)if(i.includes(".")){let e,r=i.split("."),s=-1;for(;++s<r.length;){let i=x(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};e=e?{type:"MemberExpression",object:e,property:i,computed:!!(s&&"Literal"===i.type),optional:!1}:i}v(e,"always a result"),n=e}else n=x(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};else n={type:"Literal",value:i};if("Literal"===n.type){let i=n.value;return ep.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);ek(e)}function ek(e,i){let r=new ef("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=ey+"#cannot-handle-mdx-estrees-without-createevaluater",r}function eE(e){return"-"+e.toLowerCase()}let eR={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"]},eT={};function eD(e,i){let r=i||eT;return eL(e,"boolean"!=typeof r.includeImageAlt||r.includeImageAlt,"boolean"!=typeof r.includeHtml||r.includeHtml)}function eL(e,i,r){var n;if((n=e)&&"object"==typeof n){if("value"in e)return"html"!==e.type||r?e.value:"";if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eA(e.children,i,r)}return Array.isArray(e)?eA(e,i,r):""}function eA(e,i,r){let n=[],s=-1;for(;++s<e.length;)n[s]=eL(e[s],i,r);return n.join("")}function eM(e,i,r,n){let s,o=e.length,a=0;if(i=i<0?-i>o?0:o+i:i>o?o:i,r=r>0?r:0,n.length<1e4)(s=Array.from(n)).unshift(i,r),e.splice(...s);else for(r&&e.splice(i,r);a<n.length;)(s=n.slice(a,a+1e4)).unshift(i,0),e.splice(...s),a+=1e4,i+=1e4}function eP(e,i){return e.length>0?(eM(e,e.length,0,i),e):i}let eO={}.hasOwnProperty;function eB(e){let i={},r=-1;for(;++r<e.length;)!function(e,i){let r;for(r in i){let n,s=(eO.call(e,r)?e[r]:void 0)||(e[r]={}),o=i[r];if(o)for(n in o){eO.call(s,n)||(s[n]=[]);let e=o[n];!function(e,i){let r=-1,n=[];for(;++r<i.length;)("after"===i[r].add?e:n).push(i[r]);eM(e,0,0,n)}(s[n],Array.isArray(e)?e:e?[e]:[])}}}(i,e[r]);return i}let eN=eY(/[A-Za-z]/),eI=eY(/[\dA-Za-z]/),eF=eY(/[#-'*+\--9=?A-Z^-~]/);function ez(e){return null!==e&&(e<32||127===e)}let eH=eY(/\d/),ej=eY(/[\dA-Fa-f]/),eW=eY(/[!-/:-@[-`{-~]/);function e$(e){return null!==e&&e<-2}function eU(e){return null!==e&&(e<0||32===e)}function eq(e){return -2===e||-1===e||32===e}let eV=eY(/\p{P}|\p{S}/u),eK=eY(/\s/);function eY(e){return function(i){return null!==i&&i>-1&&e.test(String.fromCharCode(i))}}function eX(e,i,r,n){let s=n?n-1:1/0,o=0;return function(n){return eq(n)?(e.enter(r),function n(a){return eq(a)&&o++<s?(e.consume(a),n):(e.exit(r),i(a))}(n)):i(n)}}let eG={tokenize:function(e){let i,r=e.attempt(this.parser.constructs.contentInitial,function(i){return null===i?void e.consume(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,r,"linePrefix"))},function(r){return e.enter("paragraph"),function r(n){let s=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=s),i=s,function i(n){if(null===n){e.exit("chunkText"),e.exit("paragraph"),e.consume(n);return}return e$(n)?(e.consume(n),e.exit("chunkText"),r):(e.consume(n),i)}(n)}(r)});return r}},eJ={tokenize:function(e){let i,r,n,s=this,o=[],a=0;return l;function l(i){if(a<o.length){let r=o[a];return s.containerState=r[1],e.attempt(r[0].continuation,c,h)(i)}return h(i)}function c(e){if(a++,s.containerState._closeFlow){let r;s.containerState._closeFlow=void 0,i&&v();let n=s.events.length,o=n;for(;o--;)if("exit"===s.events[o][0]&&"chunkFlow"===s.events[o][1].type){r=s.events[o][1].end;break}_(a);let l=n;for(;l<s.events.length;)s.events[l][1].end={...r},l++;return eM(s.events,o+1,0,s.events.slice(n)),s.events.length=l,h(e)}return l(e)}function h(r){if(a===o.length){if(!i)return f(r);if(i.currentConstruct&&i.currentConstruct.concrete)return g(r);s.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return s.containerState={},e.check(eZ,u,d)(r)}function u(e){return i&&v(),_(a),f(e)}function d(e){return s.parser.lazy[s.now().line]=a!==o.length,n=s.now().offset,g(e)}function f(i){return s.containerState={},e.attempt(eZ,p,g)(i)}function p(e){return a++,o.push([s.currentConstruct,s.containerState]),f(e)}function g(n){if(null===n){i&&v(),_(0),e.consume(n);return}return i=i||s.parser.flow(s.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),function i(r){if(null===r){m(e.exit("chunkFlow"),!0),_(0),e.consume(r);return}return e$(r)?(e.consume(r),m(e.exit("chunkFlow")),a=0,s.interrupt=void 0,l):(e.consume(r),i)}(n)}function m(e,o){let l=s.sliceStream(e);if(o&&l.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(l),s.parser.lazy[e.start.line]){let e,r,o=i.events.length;for(;o--;)if(i.events[o][1].start.offset<n&&(!i.events[o][1].end||i.events[o][1].end.offset>n))return;let l=s.events.length,c=l;for(;c--;)if("exit"===s.events[c][0]&&"chunkFlow"===s.events[c][1].type){if(e){r=s.events[c][1].end;break}e=!0}for(_(a),o=l;o<s.events.length;)s.events[o][1].end={...r},o++;eM(s.events,c+1,0,s.events.slice(l)),s.events.length=o}}function _(i){let r=o.length;for(;r-- >i;){let i=o[r];s.containerState=i[1],i[0].exit.call(s,e)}o.length=i}function v(){i.write([null]),r=void 0,i=void 0,s.containerState._closeFlow=void 0}}},eZ={tokenize:function(e,i,r){return eX(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},eQ={partial:!0,tokenize:function(e,i,r){return function(i){return eq(i)?eX(e,n,"linePrefix")(i):n(i)};function n(e){return null===e||e$(e)?i(e):r(e)}}};class e0{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){let r=null==i?1/0:i;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,i,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(i||0),1/0);return r&&e1(this.left,r),n.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),e1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),e1(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let i=this.left.splice(e,1/0);e1(this.right,i.reverse())}else{let i=this.right.splice(this.left.length+this.right.length-e,1/0);e1(this.left,i.reverse())}}}function e1(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function e2(e){let i,r,n,s,o,a,l,c={},h=-1,u=new e0(e);for(;++h<u.length;){for(;h in c;)h=c[h];if(i=u.get(h),h&&"chunkFlow"===i[1].type&&"listItemPrefix"===u.get(h-1)[1].type&&((n=0)<(a=i[1]._tokenizer.events).length&&"lineEndingBlank"===a[n][1].type&&(n+=2),n<a.length&&"content"===a[n][1].type))for(;++n<a.length&&"content"!==a[n][1].type;)"chunkText"===a[n][1].type&&(a[n][1]._isInFirstContentOfListItem=!0,n++);if("enter"===i[0])i[1].contentType&&(Object.assign(c,function(e,i){let r,n,s=e.get(i)[1],o=e.get(i)[2],a=i-1,l=[],c=s._tokenizer;!c&&(c=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));let h=c.events,u=[],d={},f=-1,p=s,g=0,m=0,_=[0];for(;p;){for(;e.get(++a)[1]!==p;);l.push(a),!p._tokenizer&&(r=o.sliceStream(p),p.next||r.push(null),n&&c.defineSkip(p.start),p._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(r),p._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),n=p,p=p.next}for(p=s;++f<h.length;)"exit"===h[f][0]&&"enter"===h[f-1][0]&&h[f][1].type===h[f-1][1].type&&h[f][1].start.line!==h[f][1].end.line&&(m=f+1,_.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(c.events=[],p?(p._tokenizer=void 0,p.previous=void 0):_.pop(),f=_.length;f--;){let i=h.slice(_[f],_[f+1]),r=l.pop();u.push([r,r+i.length-1]),e.splice(r,2,i)}for(u.reverse(),f=-1;++f<u.length;)d[g+u[f][0]]=g+u[f][1],g+=u[f][1]-u[f][0]-1;return d}(u,h)),h=c[h],l=!0);else if(i[1]._container){for(n=h,r=void 0;n--;)if("lineEnding"===(s=u.get(n))[1].type||"lineEndingBlank"===s[1].type)"enter"===s[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=n);else if("linePrefix"===s[1].type||"listItemIndent"===s[1].type);else break;r&&(i[1].end={...u.get(r)[1].start},(o=u.slice(r,h)).unshift(i),u.splice(r,h-r+1,o))}}return eM(e,0,1/0,u.slice(0)),!l}let e5={resolve:function(e){return e2(e),e},tokenize:function(e,i){let r;return function(i){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(i)};function n(i){return null===i?s(i):e$(i)?e.check(e3,o,s)(i):(e.consume(i),n)}function s(r){return e.exit("chunkContent"),e.exit("content"),i(r)}function o(i){return e.consume(i),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},e3={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,s,"linePrefix")};function s(s){if(null===s||e$(s))return r(s);let o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(s):e.interrupt(n.parser.constructs.flow,r,i)(s)}}},e4={tokenize:function(e){let i=this,r=e.attempt(eQ,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,eX(e,e.attempt(this.parser.constructs.flow,n,e.attempt(e5,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i.currentConstruct=void 0,r)}}},e6={resolveAll:te()},e9=e7("string"),e8=e7("text");function e7(e){return{resolveAll:te("text"===e?tt:void 0),tokenize:function(i){let r=this,n=this.parser.constructs[e],s=i.attempt(n,o,a);return o;function o(e){return c(e)?s(e):a(e)}function a(e){return null===e?void i.consume(e):(i.enter("data"),i.consume(e),l)}function l(e){return c(e)?(i.exit("data"),s(e)):(i.consume(e),l)}function c(e){if(null===e)return!0;let i=n[e],s=-1;if(i)for(;++s<i.length;){let e=i[s];if(!e.previous||e.previous.call(r,r.previous))return!0}return!1}}}}function te(e){return function(i,r){let n,s=-1;for(;++s<=i.length;)void 0===n?i[s]&&"data"===i[s][1].type&&(n=s,s++):i[s]&&"data"===i[s][1].type||(s!==n+2&&(i[n][1].end=i[s-1][1].end,i.splice(n+2,s-n-2),s=n+2),n=void 0);return e?e(i,r):i}}function tt(e,i){let r=0;for(;++r<=e.length;)if((r===e.length||"lineEnding"===e[r][1].type)&&"data"===e[r-1][1].type){let n,s=e[r-1][1],o=i.sliceStream(s),a=o.length,l=-1,c=0;for(;a--;){let e=o[a];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)c++,l--;if(l)break;l=-1}else if(-2===e)n=!0,c++;else if(-1===e);else{a++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(c=0),c){let o={type:r===e.length||n||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:s.start._bufferIndex+l,_index:s.start._index+a,line:s.end.line,column:s.end.column-c,offset:s.end.offset-c},end:{...s.end}};s.end={...o.start},s.start.offset===s.end.offset?Object.assign(s,o):(e.splice(r,0,["enter",o,i],["exit",o,i]),r+=2)}r++}return e}function ti(e){return null===e||eU(e)||eK(e)?1:eV(e)?2:void 0}function tr(e,i,r){let n=[],s=-1;for(;++s<e.length;){let o=e[s].resolveAll;o&&!n.includes(o)&&(i=o(i,r),n.push(o))}return i}let tn={name:"attention",resolveAll:function(e,i){let r,n,s,o,a,l,c,h,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(r=u;r--;)if("exit"===e[r][0]&&"attentionSequence"===e[r][1].type&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[r][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[u][1].start};ts(d,-l),ts(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[u][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=eP(c,[["enter",e[r][1],i],["exit",e[r][1],i]])),c=eP(c,[["enter",n,i],["enter",o,i],["exit",o,i],["enter",s,i]]),c=eP(c,tr(i.parser.constructs.insideSpan.null,e.slice(r+1,u),i)),c=eP(c,[["exit",s,i],["enter",a,i],["exit",a,i],["exit",n,i]]),e[u][1].end.offset-e[u][1].start.offset?(h=2,c=eP(c,[["enter",e[u][1],i],["exit",e[u][1],i]])):h=0,eM(e,r-1,u-r+3,c),u=r+c.length-h-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,i){let r,n=this.parser.constructs.attentionMarkers.null,s=this.previous,o=ti(s);return function(a){return r=a,e.enter("attentionSequence"),function a(l){if(l===r)return e.consume(l),a;let c=e.exit("attentionSequence"),h=ti(l),u=!h||2===h&&o||n.includes(l),d=!o||2===o&&h||n.includes(s);return c._open=!!(42===r?u:u&&(o||!d)),c._close=!!(42===r?d:d&&(h||!u)),i(l)}(a)}}};function ts(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}let to={continuation:{tokenize:function(e,i,r){let n=this;return function(i){return eq(i)?eX(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):s(i)};function s(n){return e.attempt(to,i,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,i,r){let n=this;return function(i){if(62===i){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),s}return r(i)};function s(r){return eq(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(r))}}},ta={name:"characterEscape",tokenize:function(e,i,r){return function(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),n};function n(n){return eW(n)?(e.enter("characterEscapeValue"),e.consume(n),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(n)}}},tl=document.createElement("i");function tc(e){let i="&"+e+";";tl.innerHTML=i;let r=tl.textContent;return(59!==r.charCodeAt(r.length-1)||"semi"===e)&&r!==i&&r}let th={name:"characterReference",tokenize:function(e,i,r){let n,s,o=this,a=0;return function(i){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),l};function l(i){return 35===i?(e.enter("characterReferenceMarkerNumeric"),e.consume(i),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),n=31,s=eI,h(i))}function c(i){return 88===i||120===i?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(i),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,s=ej,h):(e.enter("characterReferenceValue"),n=7,s=eH,h(i))}function h(l){if(59===l&&a){let n=e.exit("characterReferenceValue");return s!==eI||tc(o.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),i):r(l)}return s(l)&&a++<n?(e.consume(l),h):r(l)}}},tu={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return null===i?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s)};function s(e){return n.parser.lazy[n.now().line]?r(e):i(e)}}},td={concrete:!0,name:"codeFenced",tokenize:function(e,i,r){let n,s=this,o={partial:!0,tokenize:function(e,i,r){let o=0;return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a};function a(i){return e.enter("codeFencedFence"),eq(i)?eX(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):c(i)}function c(i){return i===n?(e.enter("codeFencedFenceSequence"),function i(s){return s===n?(o++,e.consume(s),i):o>=l?(e.exit("codeFencedFenceSequence"),eq(s)?eX(e,h,"whitespace")(s):h(s)):r(s)}(i)):r(i)}function h(n){return null===n||e$(n)?(e.exit("codeFencedFence"),i(n)):r(n)}}},a=0,l=0;return function(i){var o;let h;return o=i,a=(h=s.events[s.events.length-1])&&"linePrefix"===h[1].type?h[2].sliceSerialize(h[1],!0).length:0,n=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function i(s){return s===n?(l++,e.consume(s),i):l<3?r(s):(e.exit("codeFencedFenceSequence"),eq(s)?eX(e,c,"whitespace")(s):c(s))}(o)};function c(o){return null===o||e$(o)?(e.exit("codeFencedFence"),s.interrupt?i(o):e.check(tu,u,g)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function i(s){return null===s||e$(s)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(s)):eq(s)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eX(e,h,"whitespace")(s)):96===s&&s===n?r(s):(e.consume(s),i)}(o))}function h(i){return null===i||e$(i)?c(i):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function i(s){return null===s||e$(s)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(s)):96===s&&s===n?r(s):(e.consume(s),i)}(i))}function u(i){return e.attempt(o,g,d)(i)}function d(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),f}function f(i){return a>0&&eq(i)?eX(e,p,"linePrefix",a+1)(i):p(i)}function p(i){return null===i||e$(i)?e.check(tu,u,g)(i):(e.enter("codeFlowValue"),function i(r){return null===r||e$(r)?(e.exit("codeFlowValue"),p(r)):(e.consume(r),i)}(i))}function g(r){return e.exit("codeFenced"),i(r)}}},tf={name:"codeIndented",tokenize:function(e,i,r){let n=this;return function(i){return e.enter("codeIndented"),eX(e,s,"linePrefix",5)(i)};function s(i){let s=n.events[n.events.length-1];return s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?function i(r){return null===r?o(r):e$(r)?e.attempt(tp,i,o)(r):(e.enter("codeFlowValue"),function r(n){return null===n||e$(n)?(e.exit("codeFlowValue"),i(n)):(e.consume(n),r)}(r))}(i):r(i)}function o(r){return e.exit("codeIndented"),i(r)}}},tp={partial:!0,tokenize:function(e,i,r){let n=this;return s;function s(i){return n.parser.lazy[n.now().line]?r(i):e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):eX(e,o,"linePrefix",5)(i)}function o(e){let o=n.events[n.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(e):e$(e)?s(e):r(e)}}};function tg(e,i,r,n,s,o,a,l,c){let h=c||1/0,u=0;return function(i){return 60===i?(e.enter(n),e.enter(s),e.enter(o),e.consume(i),e.exit(o),d):null===i||32===i||41===i||ez(i)?r(i):(e.enter(n),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(i))};function d(r){return 62===r?(e.enter(o),e.consume(r),e.exit(o),e.exit(s),e.exit(n),i):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(r))}function f(i){return 62===i?(e.exit("chunkString"),e.exit(l),d(i)):null===i||60===i||e$(i)?r(i):(e.consume(i),92===i?p:f)}function p(i){return 60===i||62===i||92===i?(e.consume(i),f):f(i)}function g(s){return!u&&(null===s||41===s||eU(s))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(n),i(s)):u<h&&40===s?(e.consume(s),u++,g):41===s?(e.consume(s),u--,g):null===s||32===s||40===s||ez(s)?r(s):(e.consume(s),92===s?m:g)}function m(i){return 40===i||41===i||92===i?(e.consume(i),g):g(i)}}function tm(e,i,r,n,s,o){let a,l=this,c=0;return function(i){return e.enter(n),e.enter(s),e.consume(i),e.exit(s),e.enter(o),h};function h(d){return c>999||null===d||91===d||93===d&&!a||94===d&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):93===d?(e.exit(o),e.enter(s),e.consume(d),e.exit(s),e.exit(n),i):e$(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(i){return null===i||91===i||93===i||e$(i)||c++>999?(e.exit("chunkString"),h(i)):(e.consume(i),a||(a=!eq(i)),92===i?d:u)}function d(i){return 91===i||92===i||93===i?(e.consume(i),c++,u):u(i)}}function t_(e,i,r,n,s,o){let a;return function(i){return 34===i||39===i||40===i?(e.enter(n),e.enter(s),e.consume(i),e.exit(s),a=40===i?41:i,l):r(i)};function l(r){return r===a?(e.enter(s),e.consume(r),e.exit(s),e.exit(n),i):(e.enter(o),c(r))}function c(i){return i===a?(e.exit(o),l(a)):null===i?r(i):e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(i))}function h(i){return i===a||null===i||e$(i)?(e.exit("chunkString"),c(i)):(e.consume(i),92===i?u:h)}function u(i){return i===a||92===i?(e.consume(i),h):h(i)}}function tv(e,i){let r;return function n(s){return e$(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,n):eq(s)?eX(e,n,r?"linePrefix":"lineSuffix")(s):i(s)}}function ty(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tb={partial:!0,tokenize:function(e,i,r){return function(i){return eU(i)?tv(e,n)(i):r(i)};function n(i){return t_(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function s(i){return eq(i)?eX(e,o,"whitespace")(i):o(i)}function o(e){return null===e||e$(e)?i(e):r(e)}}},tS=["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"],tw=["pre","script","style","textarea"],tx={partial:!0,tokenize:function(e,i,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(eQ,i,r)}}},tC={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):r(i)};function s(e){return n.parser.lazy[n.now().line]?r(e):i(e)}}},tk={name:"labelEnd",resolveAll:function(e){let i=-1,r=[];for(;++i<e.length;){let n=e[i][1];if(r.push(e[i]),"labelImage"===n.type||"labelLink"===n.type||"labelEnd"===n.type){let e="labelImage"===n.type?4:2;n.type="data",i+=e}}return e.length!==r.length&&eM(e,0,e.length,r),e},resolveTo:function(e,i){let r,n,s,o,a=e.length,l=0;for(;a--;)if(r=e[a][1],n){if("link"===r.type||"labelLink"===r.type&&r._inactive)break;"enter"===e[a][0]&&"labelLink"===r.type&&(r._inactive=!0)}else if(s){if("enter"===e[a][0]&&("labelImage"===r.type||"labelLink"===r.type)&&!r._balanced&&(n=a,"labelLink"!==r.type)){l=2;break}}else"labelEnd"===r.type&&(s=a);let c={type:"labelLink"===e[n][1].type?"link":"image",start:{...e[n][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[n][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[n+l+2][1].end},end:{...e[s-2][1].start}};return o=eP(o=[["enter",c,i],["enter",h,i]],e.slice(n+1,n+l+3)),o=eP(o,[["enter",u,i]]),o=eP(o,tr(i.parser.constructs.insideSpan.null,e.slice(n+l+4,s-3),i)),o=eP(o,[["exit",u,i],e[s-2],e[s-1],["exit",h,i]]),o=eP(o,e.slice(s+1)),o=eP(o,[["exit",c,i]]),eM(e,n,e.length,o),e},tokenize:function(e,i,r){let n,s,o=this,a=o.events.length;for(;a--;)if(("labelImage"===o.events[a][1].type||"labelLink"===o.events[a][1].type)&&!o.events[a][1]._balanced){n=o.events[a][1];break}return function(i){return n?n._inactive?u(i):(s=o.parser.defined.includes(ty(o.sliceSerialize({start:n.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelEnd"),l):r(i)};function l(i){return 40===i?e.attempt(tE,h,s?h:u)(i):91===i?e.attempt(tR,h,s?c:u)(i):s?h(i):u(i)}function c(i){return e.attempt(tT,h,u)(i)}function h(e){return i(e)}function u(e){return n._balanced=!0,r(e)}}},tE={tokenize:function(e,i,r){return function(i){return e.enter("resource"),e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),n};function n(i){return eU(i)?tv(e,s)(i):s(i)}function s(i){return 41===i?h(i):tg(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(i)}function o(i){return eU(i)?tv(e,l)(i):h(i)}function a(e){return r(e)}function l(i){return 34===i||39===i||40===i?t_(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(i):h(i)}function c(i){return eU(i)?tv(e,h)(i):h(i)}function h(n){return 41===n?(e.enter("resourceMarker"),e.consume(n),e.exit("resourceMarker"),e.exit("resource"),i):r(n)}}},tR={tokenize:function(e,i,r){let n=this;return function(i){return tm.call(n,e,s,o,"reference","referenceMarker","referenceString")(i)};function s(e){return n.parser.defined.includes(ty(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?i(e):r(e)}function o(e){return r(e)}}},tT={tokenize:function(e,i,r){return function(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),n};function n(n){return 93===n?(e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),e.exit("reference"),i):r(n)}}},tD={name:"labelStartImage",resolveAll:tk.resolveAll,tokenize:function(e,i,r){let n=this;return function(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),s};function s(i){return 91===i?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),o):r(i)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):i(e)}}},tL={name:"labelStartLink",resolveAll:tk.resolveAll,tokenize:function(e,i,r){let n=this;return function(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),s};function s(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):i(e)}}},tA={name:"lineEnding",tokenize:function(e,i){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),eX(e,i,"linePrefix")}}},tM={name:"thematicBreak",tokenize:function(e,i,r){let n,s=0;return function(o){var a;return e.enter("thematicBreak"),n=a=o,function o(a){return a===n?(e.enter("thematicBreakSequence"),function i(r){return r===n?(e.consume(r),s++,i):(e.exit("thematicBreakSequence"),eq(r)?eX(e,o,"whitespace")(r):o(r))}(a)):s>=3&&(null===a||e$(a))?(e.exit("thematicBreak"),i(a)):r(a)}(a)}}},tP={continuation:{tokenize:function(e,i,r){let n=this;return n.containerState._closeFlow=void 0,e.check(eQ,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,eX(e,i,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!eq(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(tB,i,s)(r))});function s(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,eX(e,e.attempt(tP,i,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,i,r){let n=this,s=n.events[n.events.length-1],o=s&&"linePrefix"===s[1].type?s[2].sliceSerialize(s[1],!0).length:0,a=0;return function(i){let s=n.containerState.type||(42===i||43===i||45===i?"listUnordered":"listOrdered");if("listUnordered"===s?!n.containerState.marker||i===n.containerState.marker:eH(i)){if(n.containerState.type||(n.containerState.type=s,e.enter(s,{_container:!0})),"listUnordered"===s)return e.enter("listItemPrefix"),42===i||45===i?e.check(tM,r,l)(i):l(i);if(!n.interrupt||49===i)return e.enter("listItemPrefix"),e.enter("listItemValue"),function i(s){return eH(s)&&++a<10?(e.consume(s),i):(!n.interrupt||a<2)&&(n.containerState.marker?s===n.containerState.marker:41===s||46===s)?(e.exit("listItemValue"),l(s)):r(s)}(i)}return r(i)};function l(i){return e.enter("listItemMarker"),e.consume(i),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||i,e.check(eQ,n.interrupt?r:c,e.attempt(tO,u,h))}function c(e){return n.containerState.initialBlankLine=!0,o++,u(e)}function h(i){return eq(i)?(e.enter("listItemPrefixWhitespace"),e.consume(i),e.exit("listItemPrefixWhitespace"),u):r(i)}function u(r){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(r)}}},tO={partial:!0,tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return!eq(e)&&s&&"listItemPrefixWhitespace"===s[1].type?i(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tB={partial:!0,tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return s&&"listItemIndent"===s[1].type&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?i(e):r(e)},"listItemIndent",n.containerState.size+1)}},tN={name:"setextUnderline",resolveTo:function(e,i){let r,n,s,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(n=o)}else"content"===e[o][1].type&&e.splice(o,1),s||"definition"!==e[o][1].type||(s=o);let a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",s?(e.splice(n,0,["enter",a,i]),e.splice(s+1,0,["exit",e[r][1],i]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,i]),e},tokenize:function(e,i,r){let n,s=this;return function(i){var a;let l,c=s.events.length;for(;c--;)if("lineEnding"!==s.events[c][1].type&&"linePrefix"!==s.events[c][1].type&&"content"!==s.events[c][1].type){l="paragraph"===s.events[c][1].type;break}return!s.parser.lazy[s.now().line]&&(s.interrupt||l)?(e.enter("setextHeadingLine"),n=i,a=i,e.enter("setextHeadingLineSequence"),function i(r){return r===n?(e.consume(r),i):(e.exit("setextHeadingLineSequence"),eq(r)?eX(e,o,"lineSuffix")(r):o(r))}(a)):r(i)};function o(n){return null===n||e$(n)?(e.exit("setextHeadingLine"),i(n)):r(n)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,i,r){let n,s=this;return function(i){var n;return e.enter("definition"),n=i,tm.call(s,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(n)};function o(i){return(n=ty(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),58===i)?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),a):r(i)}function a(i){return eU(i)?tv(e,l)(i):l(i)}function l(i){return tg(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(i)}function c(i){return e.attempt(tb,h,h)(i)}function h(i){return eq(i)?eX(e,u,"whitespace")(i):u(i)}function u(o){return null===o||e$(o)?(e.exit("definition"),s.parser.defined.push(n),i(o)):r(o)}}}},"disable",0,{null:[]},"document",0,{42:tP,43:tP,45:tP,48:tP,49:tP,50:tP,51:tP,52:tP,53:tP,54:tP,55:tP,56:tP,57:tP,62:to},"flow",0,{35:{name:"headingAtx",resolve:function(e,i){let r,n,s=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),s-2>o&&"whitespace"===e[s][1].type&&(s-=2),"atxHeadingSequence"===e[s][1].type&&(o===s-1||s-4>o&&"whitespace"===e[s-2][1].type)&&(s-=o+1===s?2:4),s>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[s][1].end},n={type:"chunkText",start:e[o][1].start,end:e[s][1].end,contentType:"text"},eM(e,o,s-o+1,[["enter",r,i],["enter",n,i],["exit",n,i],["exit",r,i]])),e},tokenize:function(e,i,r){let n=0;return function(s){var o;return e.enter("atxHeading"),o=s,e.enter("atxHeadingSequence"),function s(o){return 35===o&&n++<6?(e.consume(o),s):null===o||eU(o)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function i(n){return 35===n?(e.consume(n),i):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||e$(n)?(e.exit("atxHeading"),i(n)):eq(n)?eX(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function i(n){return null===n||35===n||eU(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),i)}(n))}(o)):r(o)}(o)}}},42:tM,45:[tN,tM],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let i=e.length;for(;i--&&("enter"!==e[i][0]||"htmlFlow"!==e[i][1].type););return i>1&&"linePrefix"===e[i-2][1].type&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e},tokenize:function(e,i,r){let n,s,o,a,l,c=this;return function(i){var r;return r=i,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),h};function h(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),s=!0,p):63===a?(e.consume(a),n=3,c.interrupt?i:P):eN(a)?(e.consume(a),o=String.fromCharCode(a),g):r(a)}function u(s){return 45===s?(e.consume(s),n=2,d):91===s?(e.consume(s),n=5,a=0,f):eN(s)?(e.consume(s),n=4,c.interrupt?i:P):r(s)}function d(n){return 45===n?(e.consume(n),c.interrupt?i:P):r(n)}function f(n){let s="CDATA[";return n===s.charCodeAt(a++)?(e.consume(n),a===s.length)?c.interrupt?i:k:f:r(n)}function p(i){return eN(i)?(e.consume(i),o=String.fromCharCode(i),g):r(i)}function g(a){if(null===a||47===a||62===a||eU(a)){let l=47===a,h=o.toLowerCase();return!l&&!s&&tw.includes(h)?(n=1,c.interrupt?i(a):k(a)):tS.includes(o.toLowerCase())?(n=6,l)?(e.consume(a),m):c.interrupt?i(a):k(a):(n=7,c.interrupt&&!c.parser.lazy[c.now().line]?r(a):s?function i(r){return eq(r)?(e.consume(r),i):x(r)}(a):_(a))}return 45===a||eI(a)?(e.consume(a),o+=String.fromCharCode(a),g):r(a)}function m(n){return 62===n?(e.consume(n),c.interrupt?i:k):r(n)}function _(i){return 47===i?(e.consume(i),x):58===i||95===i||eN(i)?(e.consume(i),v):eq(i)?(e.consume(i),_):x(i)}function v(i){return 45===i||46===i||58===i||95===i||eI(i)?(e.consume(i),v):y(i)}function y(i){return 61===i?(e.consume(i),b):eq(i)?(e.consume(i),y):_(i)}function b(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),l=i,S):eq(i)?(e.consume(i),b):function i(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||eU(r)?y(r):(e.consume(r),i)}(i)}function S(i){return i===l?(e.consume(i),l=null,w):null===i||e$(i)?r(i):(e.consume(i),S)}function w(e){return 47===e||62===e||eq(e)?_(e):r(e)}function x(i){return 62===i?(e.consume(i),C):r(i)}function C(i){return null===i||e$(i)?k(i):eq(i)?(e.consume(i),C):r(i)}function k(i){return 45===i&&2===n?(e.consume(i),D):60===i&&1===n?(e.consume(i),L):62===i&&4===n?(e.consume(i),O):63===i&&3===n?(e.consume(i),P):93===i&&5===n?(e.consume(i),M):e$(i)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(tx,B,E)(i)):null===i||e$(i)?(e.exit("htmlFlowData"),E(i)):(e.consume(i),k)}function E(i){return e.check(tC,R,B)(i)}function R(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),T}function T(i){return null===i||e$(i)?E(i):(e.enter("htmlFlowData"),k(i))}function D(i){return 45===i?(e.consume(i),P):k(i)}function L(i){return 47===i?(e.consume(i),o="",A):k(i)}function A(i){if(62===i){let r=o.toLowerCase();return tw.includes(r)?(e.consume(i),O):k(i)}return eN(i)&&o.length<8?(e.consume(i),o+=String.fromCharCode(i),A):k(i)}function M(i){return 93===i?(e.consume(i),P):k(i)}function P(i){return 62===i?(e.consume(i),O):45===i&&2===n?(e.consume(i),P):k(i)}function O(i){return null===i||e$(i)?(e.exit("htmlFlowData"),B(i)):(e.consume(i),O)}function B(r){return e.exit("htmlFlow"),i(r)}}},61:tN,95:tM,96:td,126:td},"flowInitial",0,{[-2]:tf,[-1]:tf,32:tf},"insideSpan",0,{null:[tn,e6]},"string",0,{38:th,92:ta},"text",0,{[-5]:tA,[-4]:tA,[-3]:tA,33:tD,38:th,42:tn,60:[{name:"autolink",tokenize:function(e,i,r){let n=0;return function(i){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s};function s(i){return eN(i)?(e.consume(i),o):64===i?r(i):l(i)}function o(i){return 43===i||45===i||46===i||eI(i)?(n=1,function i(r){return 58===r?(e.consume(r),n=0,a):(43===r||45===r||46===r||eI(r))&&n++<32?(e.consume(r),i):(n=0,l(r))}(i)):l(i)}function a(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),i):null===n||32===n||60===n||ez(n)?r(n):(e.consume(n),a)}function l(i){return 64===i?(e.consume(i),c):eF(i)?(e.consume(i),l):r(i)}function c(s){return eI(s)?function s(o){return 46===o?(e.consume(o),n=0,c):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),i):function i(o){if((45===o||eI(o))&&n++<63){let r=45===o?i:s;return e.consume(o),r}return r(o)}(o)}(s):r(s)}}},{name:"htmlText",tokenize:function(e,i,r){let n,s,o,a=this;return function(i){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(i),l};function l(i){return 33===i?(e.consume(i),c):47===i?(e.consume(i),S):63===i?(e.consume(i),y):eN(i)?(e.consume(i),x):r(i)}function c(i){return 45===i?(e.consume(i),h):91===i?(e.consume(i),s=0,p):eN(i)?(e.consume(i),v):r(i)}function h(i){return 45===i?(e.consume(i),f):r(i)}function u(i){return null===i?r(i):45===i?(e.consume(i),d):e$(i)?(o=u,A(i)):(e.consume(i),u)}function d(i){return 45===i?(e.consume(i),f):u(i)}function f(e){return 62===e?L(e):45===e?d(e):u(e)}function p(i){let n="CDATA[";return i===n.charCodeAt(s++)?(e.consume(i),s===n.length?g:p):r(i)}function g(i){return null===i?r(i):93===i?(e.consume(i),m):e$(i)?(o=g,A(i)):(e.consume(i),g)}function m(i){return 93===i?(e.consume(i),_):g(i)}function _(i){return 62===i?L(i):93===i?(e.consume(i),_):g(i)}function v(i){return null===i||62===i?L(i):e$(i)?(o=v,A(i)):(e.consume(i),v)}function y(i){return null===i?r(i):63===i?(e.consume(i),b):e$(i)?(o=y,A(i)):(e.consume(i),y)}function b(e){return 62===e?L(e):y(e)}function S(i){return eN(i)?(e.consume(i),w):r(i)}function w(i){return 45===i||eI(i)?(e.consume(i),w):function i(r){return e$(r)?(o=i,A(r)):eq(r)?(e.consume(r),i):L(r)}(i)}function x(i){return 45===i||eI(i)?(e.consume(i),x):47===i||62===i||eU(i)?C(i):r(i)}function C(i){return 47===i?(e.consume(i),L):58===i||95===i||eN(i)?(e.consume(i),k):e$(i)?(o=C,A(i)):eq(i)?(e.consume(i),C):L(i)}function k(i){return 45===i||46===i||58===i||95===i||eI(i)?(e.consume(i),k):function i(r){return 61===r?(e.consume(r),E):e$(r)?(o=i,A(r)):eq(r)?(e.consume(r),i):C(r)}(i)}function E(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),n=i,R):e$(i)?(o=E,A(i)):eq(i)?(e.consume(i),E):(e.consume(i),T)}function R(i){return i===n?(e.consume(i),n=void 0,D):null===i?r(i):e$(i)?(o=R,A(i)):(e.consume(i),R)}function T(i){return null===i||34===i||39===i||60===i||61===i||96===i?r(i):47===i||62===i||eU(i)?C(i):(e.consume(i),T)}function D(e){return 47===e||62===e||eU(e)?C(e):r(e)}function L(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),i):r(n)}function A(i){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),M}function M(i){return eq(i)?eX(e,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):P(i)}function P(i){return e.enter("htmlTextData"),o(i)}}}],91:tL,92:[{name:"hardBreakEscape",tokenize:function(e,i,r){return function(i){return e.enter("hardBreakEscape"),e.consume(i),n};function n(n){return e$(n)?(e.exit("hardBreakEscape"),i(n)):r(n)}}},ta],93:tk,95:tn,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let i,r,n=e.length-4,s=3;if(("lineEnding"===e[3][1].type||"space"===e[s][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(i=s;++i<n;)if("codeTextData"===e[i][1].type){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(i=s-1,n++;++i<=n;)void 0===r?i!==n&&"lineEnding"!==e[i][1].type&&(r=i):(i===n||"lineEnding"===e[i][1].type)&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),n-=i-r-2,i=r+2),r=void 0);return e},tokenize:function(e,i,r){let n,s,o=0;return function(i){return e.enter("codeText"),e.enter("codeTextSequence"),function i(r){return 96===r?(e.consume(r),o++,i):(e.exit("codeTextSequence"),a(r))}(i)};function a(c){return null===c?r(c):32===c?(e.enter("space"),e.consume(c),e.exit("space"),a):96===c?(s=e.enter("codeTextSequence"),n=0,function r(a){return 96===a?(e.consume(a),n++,r):n===o?(e.exit("codeTextSequence"),e.exit("codeText"),i(a)):(s.type="codeTextData",l(a))}(c)):e$(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(c))}function l(i){return null===i||32===i||96===i||e$(i)?(e.exit("codeTextData"),a(i)):(e.consume(i),l)}}}}],4127);var tI=e.i(4127);let tF=/[\0\t\n\r]/g;function tz(e,i){let r=Number.parseInt(e,i);return r<9||11===r||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let tH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tj(e,i,r){if(i)return i;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),i=120===e||88===e;return tz(r.slice(i?2:1),i?16:10)}return tc(r)||e}let tW={}.hasOwnProperty;function t$(e){return{line:e.line,column:e.column,offset:e.offset}}function tU(e,i){if(e)throw Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+ec({start:i.start,end:i.end})+") is open");throw Error("Cannot close document, a token (`"+i.type+"`, "+ec({start:i.start,end:i.end})+") is still open")}function tq(e){let i=this;i.parser=function(r){var n,s;let o,a,l,c;return"object"==typeof(n={...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})&&(s=n,n=void 0),(function(e){let i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:h,autolinkEmail:h,atxHeading:n(g),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:h,characterReference:h,codeFenced:n(p),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:n(p,s),codeText:n(function(){return{type:"inlineCode",value:""}},s),codeTextData:h,data:h,codeFlowValue:h,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(m),hardBreakTrailing:n(m),htmlFlow:n(_,s),htmlFlowData:h,htmlText:n(_,s),htmlTextData:h,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:s,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(y),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:n(g),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let i=this.stack[this.stack.length-1];i.depth||(i.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let i,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(i=tz(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=tc(r);let s=this.stack[this.stack.length-1];s.value+=i},characterReference:function(e){this.stack.pop().position.end=t$(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=ty(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],i=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=i},labelText:function(e){let i=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=i.replace(tH,tj),r.identifier=ty(i).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=t$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(r.type)&&(h.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(i,r){let n=-1;for(;++n<r.length;){let s=r[n];Array.isArray(s)?e(i,s):function(e,i){let r;for(r in i)if(tW.call(i,r))switch(r){case"canContainEols":{let n=i[r];n&&e[r].push(...n);break}case"transforms":{let n=i[r];n&&e[r].push(...n);break}case"enter":case"exit":{let n=i[r];n&&Object.assign(e[r],n)}}}(i,s)}}(i,(e||{}).mdastExtensions||[]);let r={};return function(e){let n={type:"root",children:[]},a={stack:[n],tokenStack:[],config:i,enter:o,exit:l,buffer:s,resume:c,data:r},h=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?h.push(u):u=function(e,i,r){let n,s,o,a,l=i-1,c=-1,h=!1;for(;++l<=r;){let i=e[l];switch(i[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===i[0]?c++:c--,a=void 0;break;case"lineEndingBlank":"enter"===i[0]&&(!n||a||c||o||(o=l),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!c&&"enter"===i[0]&&"listItemPrefix"===i[1].type||-1===c&&"exit"===i[0]&&("listUnordered"===i[1].type||"listOrdered"===i[1].type)){if(n){let a=l;for(s=void 0;a--;){let i=e[a];if("lineEnding"===i[1].type||"lineEndingBlank"===i[1].type){if("exit"===i[0])continue;s&&(e[s][1].type="lineEndingBlank",h=!0),i[1].type="lineEnding",s=a}else if("linePrefix"===i[1].type||"blockQuotePrefix"===i[1].type||"blockQuotePrefixWhitespace"===i[1].type||"blockQuoteMarker"===i[1].type||"listItemIndent"===i[1].type);else break}o&&(!s||o<s)&&(n._spread=!0),n.end=Object.assign({},s?e[s][1].start:i[1].end),e.splice(s||l,0,["exit",n,i[2]]),l++,r++}if("listItemPrefix"===i[1].type){let s={type:"listItem",_spread:!1,start:Object.assign({},i[1].start),end:void 0};n=s,e.splice(l,0,["enter",s,i[2]]),l++,r++,o=void 0,a=!0}}}return e[i][1]._spread=h,r}(e,h.pop(),u));for(u=-1;++u<e.length;){let r=i[e[u][0]];tW.call(r,e[u][1].type)&&r[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tU).call(a,void 0,e[0])}for(n.position={start:t$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:t$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<i.transforms.length;)n=i.transforms[u](n)||n;return n};function n(e,i){return function(r){o.call(this,e(r),r),i&&i.call(this,r)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(e,i,r){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([i,r||void 0]),e.position={start:t$(i.start),end:void 0}}function a(e){return function(i){e&&e.call(this,i),l.call(this,i)}}function l(e,i){let r=this.stack.pop(),n=this.tokenStack.pop();if(n)n[0].type!==e.type&&(i?i.call(this,e,n[0]):(n[1]||tU).call(this,e,n[0]));else throw Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): it’s not open");r.position.end=t$(e.end)}function c(){return eD(this.stack.pop())}function h(e){let i=this.stack[this.stack.length-1].children,r=i[i.length-1];r&&"text"===r.type||((r={type:"text",value:""}).position={start:t$(e.start),end:void 0},i.push(r)),this.stack.push(r)}function u(e){let i=this.stack.pop();i.value+=this.sliceSerialize(e),i.position.end=t$(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function g(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function _(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(s)(function(e){for(;!e2(e););return e}((function(e){let i={constructs:eB([tI,...(e||{}).extensions||[]]),content:r(eG),defined:[],document:r(eJ),flow:r(e4),lazy:{},string:r(e9),text:r(e8)};return i;function r(e){return function(r){return function(e,i,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},s={},o=[],a=[],l=[],c={attempt:g(function(e,i){m(e,i.from)}),check:g(p),consume:function(e){e$(e)?(n.line++,n.column=1,n.offset+=-3===e?2:1,_()):-1!==e&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===a[n._index].length&&(n._bufferIndex=-1,n._index++)),h.previous=e},enter:function(e,i){let r=i||{};return r.type=e,r.start=f(),h.events.push(["enter",r,h]),l.push(r),r},exit:function(e){let i=l.pop();return i.end=f(),h.events.push(["exit",i,h]),i},interrupt:g(p,{interrupt:!0})},h={code:null,containerState:{},defineSkip:function(e){s[e.line]=e.column,_()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,i){return function(e,i){let r,n=-1,s=[];for(;++n<e.length;){let o,a=e[n];if("string"==typeof a)o=a;else switch(a){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=i?" ":" ";break;case -1:if(!i&&r)continue;o=" ";break;default:o=String.fromCharCode(a)}r=-2===a,s.push(o)}return s.join("")}(d(e),i)},sliceStream:d,write:function(e){return(a=eP(a,e),function(){let e;for(;n._index<a.length;){let r=a[n._index];if("string"==typeof r)for(e=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===e&&n._bufferIndex<r.length;){var i;i=r.charCodeAt(n._bufferIndex),u=u(i)}else u=u(r)}}(),null!==a[a.length-1])?[]:(m(i,0),h.events=tr(o,h.events,h),h.events)}},u=i.tokenize.call(h,c);return i.resolveAll&&o.push(i),h;function d(e){return function(e,i){let r,n=i.start._index,s=i.start._bufferIndex,o=i.end._index,a=i.end._bufferIndex;if(n===o)r=[e[n].slice(s,a)];else{if(r=e.slice(n,o),s>-1){let e=r[0];"string"==typeof e?r[0]=e.slice(s):r.shift()}a>0&&r.push(e[o].slice(0,a))}return r}(a,e)}function f(){let{_bufferIndex:e,_index:i,line:r,column:s,offset:o}=n;return{_bufferIndex:e,_index:i,line:r,column:s,offset:o}}function p(e,i){i.restore()}function g(e,i){return function(r,s,o){var a;let u,d,p,g;return Array.isArray(r)?m(r):"tokenize"in r?m([r]):(a=r,function(e){let i=null!==e&&a[e],r=null!==e&&a.null;return m([...Array.isArray(i)?i:i?[i]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?o:v(e[d])}function v(e){return function(r){let s,o,a,u,d;return(s=f(),o=h.previous,a=h.currentConstruct,u=h.events.length,d=Array.from(l),g={from:u,restore:function(){n=s,h.previous=o,h.currentConstruct=a,h.events.length=u,l=d,_()}},p=e,e.partial||(h.currentConstruct=e),e.name&&h.parser.constructs.disable.null.includes(e.name))?b(r):e.tokenize.call(i?Object.assign(Object.create(h),i):h,c,y,b)(r)}}function y(i){return e(p,g),s}function b(e){return(g.restore(),++d<u.length)?v(u[d]):o}}}function m(e,i){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&eM(h.events,i,h.events.length-i,e.resolve(h.events.slice(i),h)),e.resolveTo&&(h.events=e.resolveTo(h.events,h))}function _(){n.line in s&&n.column<2&&(n.column=s[n.line],n.offset+=s[n.line]-1)}}(i,e,r)}}})(s).document().write((a=1,l="",c=!0,function(e,i,r){let n,s,h,u,d,f=[];for(e=l+("string"==typeof e?e.toString():new TextDecoder(i||void 0).decode(e)),h=0,l="",c&&(65279===e.charCodeAt(0)&&h++,c=void 0);h<e.length;){if(tF.lastIndex=h,u=(n=tF.exec(e))&&void 0!==n.index?n.index:e.length,d=e.charCodeAt(u),!n){l=e.slice(h);break}if(10===d&&h===u&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),h<u&&(f.push(e.slice(h,u)),a+=u-h),d){case 0:f.push(65533),a++;break;case 9:for(s=4*Math.ceil(a/4),f.push(-2);a++<s;)f.push(-1);break;case 10:f.push(-4),a=1;break;default:o=!0,a=1}h=u+1}return r&&(o&&f.push(-5),l&&f.push(l),f.push(null)),f})(r,n,!0))))}}let tV="object"==typeof self?self:globalThis,tK=e=>{var i;let r,n;return(i=new Map,r=(e,r)=>(i.set(r,e),e),n=s=>{if(i.has(s))return i.get(s);let[o,a]=e[s];switch(o){case 0:case -1:return r(a,s);case 1:{let e=r([],s);for(let i of a)e.push(n(i));return e}case 2:{let e=r({},s);for(let[i,r]of a)e[n(i)]=n(r);return e}case 3:return r(new Date(a),s);case 4:{let{source:e,flags:i}=a;return r(new RegExp(e,i),s)}case 5:{let e=r(new Map,s);for(let[i,r]of a)e.set(n(i),n(r));return e}case 6:{let e=r(new Set,s);for(let i of a)e.add(n(i));return e}case 7:{let{name:e,message:i}=a;return r(new tV[e](i),s)}case 8:return r(BigInt(a),s);case"BigInt":return r(Object(BigInt(a)),s);case"ArrayBuffer":return r(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return r(new DataView(e),a)}}return r(new tV[o](a),s)})(0)},{toString:tY}={},{keys:tX}=Object,tG=e=>{let i=typeof e;if("object"!==i||!e)return[0,i];let r=tY.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},tJ=([e,i])=>0===e&&("function"===i||"symbol"===i),tZ=(e,{json:i,lossy:r}={})=>{var n,s,o;let a,l,c=[];return(n=!(i||r),s=!!i,o=new Map,a=(e,i)=>{let r=c.push(e)-1;return o.set(i,r),r},l=e=>{if(o.has(e))return o.get(e);let[i,r]=tG(e);switch(i){case 0:{let s=e;switch(r){case"bigint":i=8,s=e.toString();break;case"function":case"symbol":if(n)throw TypeError("unable to serialize "+r);s=null;break;case"undefined":return a([-1],e)}return a([i,s],e)}case 1:{if(r){let i=e;return"DataView"===r?i=new Uint8Array(e.buffer):"ArrayBuffer"===r&&(i=new Uint8Array(e)),a([r,[...i]],e)}let n=[],s=a([i,n],e);for(let i of e)n.push(l(i));return s}case 2:{if(r)switch(r){case"BigInt":return a([r,e.toString()],e);case"Boolean":case"Number":case"String":return a([r,e.valueOf()],e)}if(s&&"toJSON"in e)return l(e.toJSON());let o=[],c=a([i,o],e);for(let i of tX(e))(n||!tJ(tG(e[i])))&&o.push([l(i),l(e[i])]);return c}case 3:return a([i,e.toISOString()],e);case 4:{let{source:r,flags:n}=e;return a([i,{source:r,flags:n}],e)}case 5:{let r=[],s=a([i,r],e);for(let[i,s]of e)(n||!(tJ(tG(i))||tJ(tG(s))))&&r.push([l(i),l(s)]);return s}case 6:{let r=[],s=a([i,r],e);for(let i of e)(n||!tJ(tG(i)))&&r.push(l(i));return s}}let{message:c}=e;return a([i,{name:r,message:c}],e)})(e),c},tQ="function"==typeof structuredClone?(e,i)=>i&&("json"in i||"lossy"in i)?tK(tZ(e,i)):structuredClone(e):(e,i)=>tK(tZ(e,i));function t0(e){let i=[],r=-1,n=0,s=0;for(;++r<e.length;){let o=e.charCodeAt(r),a="";if(37===o&&eI(e.charCodeAt(r+1))&&eI(e.charCodeAt(r+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){let i=e.charCodeAt(r+1);o<56320&&i>56319&&i<57344?(a=String.fromCharCode(o,i),s=1):a="�"}else a=String.fromCharCode(o);a&&(i.push(e.slice(n,r),encodeURIComponent(a)),n=r+s+1,a=""),s&&(r+=s,s=0)}return i.join("")+e.slice(n)}function t1(e,i){let r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function t2(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}let t5=function(e){var i,r;if(null==e)return t4;if("function"==typeof e)return t3(e);if("object"==typeof e){return Array.isArray(e)?function(e){let i=[],r=-1;for(;++r<e.length;)i[r]=t5(e[r]);return t3(function(...e){let r=-1;for(;++r<i.length;)if(i[r].apply(this,e))return!0;return!1})}(e):(i=e,t3(function(e){let r;for(r in i)if(e[r]!==i[r])return!1;return!0}))}if("string"==typeof e){return r=e,t3(function(e){return e&&e.type===r})}throw Error("Expected function, string, or object as test")};function t3(e){return function(i,r,n){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(i)&&e.call(this,i,"number"==typeof r?r:void 0,n||void 0))}}function t4(){return!0}let t6=[];function t9(e,i,r,n){let s;"function"==typeof i&&"function"!=typeof r?(n=r,r=i):s=i;let o=t5(s),a=n?-1:1;(function e(s,l,c){let h=s&&"object"==typeof s?s:{};if("string"==typeof h.type){let e="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(u,"name",{value:"node ("+s.type+(e?"<"+e+">":"")+")"})}return u;function u(){var h;let u,d,f,p=t6;if((!i||o(s,l,c[c.length-1]||void 0))&&!1===(p=Array.isArray(h=r(s,c))?h:"number"==typeof h?[!0,h]:null==h?t6:[h])[0])return p;if("children"in s&&s.children&&s.children&&"skip"!==p[0])for(d=(n?s.children.length:-1)+a,f=c.concat(s);d>-1&&d<s.children.length;){if(!1===(u=e(s.children[d],d,f)())[0])return u;d="number"==typeof u[1]?u[1]:d+a}return p}})(e,void 0,[])()}function t8(e,i,r,n){let s,o,a;"function"==typeof i&&"function"!=typeof r?(o=void 0,a=i,s=r):(o=i,a=r,s=n),t9(e,o,function(e,i){let r=i[i.length-1],n=r?r.children.indexOf(e):void 0;return a(e,n,r)},s)}function t7(e,i){let r=i.referenceType,n="]";if("collapsed"===r?n+="[]":"full"===r&&(n+="["+(i.label||i.identifier)+"]"),"imageReference"===i.type)return[{type:"text",value:"!["+i.alt+n}];let s=e.all(i),o=s[0];o&&"text"===o.type?o.value="["+o.value:s.unshift({type:"text",value:"["});let a=s[s.length-1];return a&&"text"===a.type?a.value+=n:s.push({type:"text",value:n}),s}function ie(e){let i=e.spread;return null==i?e.children.length>1:i}function it(e,i,r){let n=0,s=e.length;if(i){let i=e.codePointAt(n);for(;9===i||32===i;)n++,i=e.codePointAt(n)}if(r){let i=e.codePointAt(s-1);for(;9===i||32===i;)s--,i=e.codePointAt(s-1)}return s>n?e.slice(n,s):""}let ii={blockquote:function(e,i){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)},break:function(e,i){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:"\n"}]},code:function(e,i){let r=i.value?i.value+"\n":"",n={},s=i.lang?i.lang.split(/\s+/):[];s.length>0&&(n.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return i.meta&&(o.data={meta:i.meta}),e.patch(i,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(i,o)]},e.patch(i,o),o},delete:function(e,i){let r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},emphasis:function(e,i){let r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},footnoteReference:function(e,i){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",s=String(i.identifier).toUpperCase(),o=t0(s.toLowerCase()),a=e.footnoteOrder.indexOf(s),l=e.footnoteCounts.get(s);void 0===l?(l=0,e.footnoteOrder.push(s),r=e.footnoteOrder.length):r=a+1,l+=1,e.footnoteCounts.set(s,l);let c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(i,c);let h={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(i,h),e.applyData(i,h)},heading:function(e,i){let r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},html:function(e,i){if(e.options.allowDangerousHtml){let r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}},imageReference:function(e,i){let r=String(i.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return t7(e,i);let s={src:t0(n.url||""),alt:i.alt};null!==n.title&&void 0!==n.title&&(s.title=n.title);let o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(i,o),e.applyData(i,o)},image:function(e,i){let r={src:t0(i.url)};null!==i.alt&&void 0!==i.alt&&(r.alt=i.alt),null!==i.title&&void 0!==i.title&&(r.title=i.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,n),e.applyData(i,n)},inlineCode:function(e,i){let r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,n),e.applyData(i,n)},linkReference:function(e,i){let r=String(i.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return t7(e,i);let s={href:t0(n.url||"")};null!==n.title&&void 0!==n.title&&(s.title=n.title);let o={type:"element",tagName:"a",properties:s,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)},link:function(e,i){let r={href:t0(i.url)};null!==i.title&&void 0!==i.title&&(r.title=i.title);let n={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,n),e.applyData(i,n)},listItem:function(e,i,r){let n=e.all(i),s=r?function(e){let i=!1;if("list"===e.type){i=e.spread||!1;let r=e.children,n=-1;for(;!i&&++n<r.length;)i=ie(r[n])}return i}(r):ie(i),o={},a=[];if("boolean"==typeof i.checked){let e,r=n[0];r&&"element"===r.type&&"p"===r.tagName?e=r:(e={type:"element",tagName:"p",properties:{},children:[]},n.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<n.length;){let e=n[l];(s||0!==l||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||s?a.push(e):a.push(...e.children)}let c=n[n.length-1];c&&(s||"element"!==c.type||"p"!==c.tagName)&&a.push({type:"text",value:"\n"});let h={type:"element",tagName:"li",properties:o,children:a};return e.patch(i,h),e.applyData(i,h)},list:function(e,i){let r={},n=e.all(i),s=-1;for("number"==typeof i.start&&1!==i.start&&(r.start=i.start);++s<n.length;){let e=n[s];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let o={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(i,o),e.applyData(i,o)},paragraph:function(e,i){let r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},root:function(e,i){let r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)},strong:function(e,i){let r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},table:function(e,i){let r=e.all(i),n=r.shift(),s=[];if(n){let r={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(i.children[0],r),s.push(r)}if(r.length>0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=ea(i.children[1]),a=eo(i.children[i.children.length-1]);o&&a&&(n.position={start:o,end:a}),s.push(n)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(i,o),e.applyData(i,o)},tableCell:function(e,i){let r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},tableRow:function(e,i,r){let n=r?r.children:void 0,s=0===(n?n.indexOf(i):1)?"th":"td",o=r&&"table"===r.type?r.align:void 0,a=o?o.length:i.children.length,l=-1,c=[];for(;++l<a;){let r=i.children[l],n={},a=o?o[l]:void 0;a&&(n.align=a);let h={type:"element",tagName:s,properties:n,children:[]};r&&(h.children=e.all(r),e.patch(r,h),h=e.applyData(r,h)),c.push(h)}let h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(i,h),e.applyData(i,h)},text:function(e,i){let r={type:"text",value:function(e){let i=String(e),r=/\r?\n|\r/g,n=r.exec(i),s=0,o=[];for(;n;)o.push(it(i.slice(s,n.index),s>0,!0),n[0]),s=n.index+n[0].length,n=r.exec(i);return o.push(it(i.slice(s),s>0,!1)),o.join("")}(String(i.value))};return e.patch(i,r),e.applyData(i,r)},thematicBreak:function(e,i){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)},toml:ir,yaml:ir,definition:ir,footnoteDefinition:ir};function ir(){}let is={}.hasOwnProperty,io={};function ia(e,i){e.position&&(i.position=function(e){let i=ea(e),r=eo(e);if(i&&r)return{start:i,end:r}}(e))}function il(e,i){let r=i;if(e&&e.data){let i=e.data.hName,n=e.data.hChildren,s=e.data.hProperties;"string"==typeof i&&("element"===r.type?r.tagName=i:r={type:"element",tagName:i,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&s&&Object.assign(r.properties,tQ(s)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function ic(e,i){let r=[],n=-1;for(i&&r.push({type:"text",value:"\n"});++n<e.length;)n&&r.push({type:"text",value:"\n"}),r.push(e[n]);return i&&e.length>0&&r.push({type:"text",value:"\n"}),r}function ih(e){let i=0,r=e.charCodeAt(i);for(;9===r||32===r;)i++,r=e.charCodeAt(i);return e.slice(i)}function iu(e,i){let r,n,s,o,a=(r=i||io,n=new Map,s=new Map,o={all:function(e){let i=[];if("children"in e){let r=e.children,n=-1;for(;++n<r.length;){let s=o.one(r[n],e);if(s){if(n&&"break"===r[n-1].type&&(Array.isArray(s)||"text"!==s.type||(s.value=ih(s.value)),!Array.isArray(s)&&"element"===s.type)){let e=s.children[0];e&&"text"===e.type&&(e.value=ih(e.value))}Array.isArray(s)?i.push(...s):i.push(s)}}}return i},applyData:il,definitionById:n,footnoteById:s,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ii,...r.handlers},one:function(e,i){let r=e.type,n=o.handlers[r];if(is.call(o.handlers,r)&&n)return n(o,e,i);if(o.options.passThrough&&o.options.passThrough.includes(r)){if("children"in e){let{children:i,...r}=e,n=tQ(r);return n.children=o.all(e),n}return tQ(e)}return(o.options.unknownHandler||function(e,i){let r=i.data||{},n="value"in i&&!(is.call(r,"hProperties")||is.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,n),e.applyData(i,n)})(o,e,i)},options:r,patch:ia,wrap:ic},t8(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let i="definition"===e.type?n:s,r=String(e.identifier).toUpperCase();i.has(r)||i.set(r,e)}}),o),l=a.one(e,void 0),c=function(e){let i="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||t1,n=e.options.footnoteBackLabel||t2,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],c=-1;for(;++c<e.footnoteOrder.length;){let s=e.footnoteById.get(e.footnoteOrder[c]);if(!s)continue;let o=e.all(s),a=String(s.identifier).toUpperCase(),h=t0(a.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(c,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+h+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(c,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);let g={type:"element",tagName:"li",properties:{id:i+"fn-"+h},children:e.wrap(o,!0)};e.patch(s,g),l.push(g)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...tQ(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(a),h=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return c&&(v("children"in h),h.children.push({type:"text",value:"\n"},c)),h}function id(e,i){return e&&"run"in e?async function(r,n){let s=iu(r,{file:n,...i});await e.run(s,n)}:function(r,n){return iu(r,{file:n,...e||i})}}function ip(e){if(e)throw e}var ig=e.i(4100);function im(e){if("object"!=typeof e||null===e)return!1;let i=Object.getPrototypeOf(e);return(null===i||i===Object.prototype||null===Object.getPrototypeOf(i))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let i_=function(e,i){let r;if(void 0!==i&&"string"!=typeof i)throw TypeError('"ext" argument must be a string');iS(e);let n=0,s=-1,o=e.length;if(void 0===i||0===i.length||i.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else s<0&&(r=!0,s=o+1);return s<0?"":e.slice(n,s)}if(i===e)return"";let a=-1,l=i.length-1;for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else a<0&&(r=!0,a=o+1),l>-1&&(e.codePointAt(o)===i.codePointAt(l--)?l<0&&(s=o):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)},iv=function(e){let i;if(iS(e),0===e.length)return".";let r=-1,n=e.length;for(;--n;)if(47===e.codePointAt(n)){if(i){r=n;break}}else i||(i=!0);return r<0?47===e.codePointAt(0)?"/":".":1===r&&47===e.codePointAt(0)?"//":e.slice(0,r)},iy=function(e){let i;iS(e);let r=e.length,n=-1,s=0,o=-1,a=0;for(;r--;){let l=e.codePointAt(r);if(47===l){if(i){s=r+1;break}continue}n<0&&(i=!0,n=r+1),46===l?o<0?o=r:1!==a&&(a=1):o>-1&&(a=-1)}return o<0||n<0||0===a||1===a&&o===n-1&&o===s+1?"":e.slice(o,n)},ib=function(...e){var i;let r,n,s,o=-1;for(;++o<e.length;)iS(e[o]),e[o]&&(s=void 0===s?e[o]:s+"/"+e[o]);return void 0===s?".":(iS(i=s),r=47===i.codePointAt(0),0!==(n=function(e,i){let r,n,s="",o=0,a=-1,l=0,c=-1;for(;++c<=e.length;){if(c<e.length)r=e.codePointAt(c);else if(47===r)break;else r=47;if(47===r){if(a===c-1||1===l);else if(a!==c-1&&2===l){if(s.length<2||2!==o||46!==s.codePointAt(s.length-1)||46!==s.codePointAt(s.length-2)){if(s.length>2){if((n=s.lastIndexOf("/"))!==s.length-1){n<0?(s="",o=0):o=(s=s.slice(0,n)).length-1-s.lastIndexOf("/"),a=c,l=0;continue}}else if(s.length>0){s="",o=0,a=c,l=0;continue}}i&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+e.slice(a+1,c):s=e.slice(a+1,c),o=c-a-1;a=c,l=0}else 46===r&&l>-1?l++:l=-1}return s}(i,!r)).length||r||(n="."),n.length>0&&47===i.codePointAt(i.length-1)&&(n+="/"),r?"/"+n:n)};function iS(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function iw(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let ix=["history","path","basename","stem","extname","dirname"];class iC{constructor(e){let i,r;i=e?iw(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in i?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ix.length;){const e=ix[n];e in i&&void 0!==i[e]&&null!==i[e]&&(this[e]="history"===e?[...i[e]]:i[e])}for(r in i)ix.includes(r)||(this[r]=i[r])}get basename(){return"string"==typeof this.path?i_(this.path):void 0}set basename(e){iE(e,"basename"),ik(e,"basename"),this.path=ib(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?iv(this.path):void 0}set dirname(e){iR(this.basename,"dirname"),this.path=ib(e||"",this.basename)}get extname(){return"string"==typeof this.path?iy(this.path):void 0}set extname(e){if(ik(e,"extname"),iR(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=ib(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){iw(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!iw(e)){let i=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let i=e.pathname,r=-1;for(;++r<i.length;)if(37===i.codePointAt(r)&&50===i.codePointAt(r+1)){let e=i.codePointAt(r+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(i)}(e)}(e)),iE(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?i_(this.path,this.extname):void 0}set stem(e){iE(e,"stem"),ik(e,"stem"),this.path=ib(this.dirname||"",e+(this.extname||""))}fail(e,i,r){let n=this.message(e,i,r);throw n.fatal=!0,n}info(e,i,r){let n=this.message(e,i,r);return n.fatal=void 0,n}message(e,i,r){let n=new ef(e,i,r);return this.path&&(n.name=this.path+":"+n.name,n.file=this.path),n.fatal=!1,this.messages.push(n),n}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ik(e,i){if(e&&e.includes("/"))throw Error("`"+i+"` cannot be a path: did not expect `/`")}function iE(e,i){if(!e)throw Error("`"+i+"` cannot be empty")}function iR(e,i){if(!e)throw Error("Setting `"+i+"` requires `path` to be set too")}let iT=function(e){let i=this.constructor.prototype,r=i[e],n=function(){return r.apply(n,arguments)};return Object.setPrototypeOf(n,i),n},iD={}.hasOwnProperty;class iL extends iT{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=function(){let e=[],i={run:function(...i){let r=-1,n=i.pop();if("function"!=typeof n)throw TypeError("Expected function as last argument, not "+n);!function s(o,...a){let l=e[++r],c=-1;if(o)return void n(o);for(;++c<i.length;)(null===a[c]||void 0===a[c])&&(a[c]=i[c]);i=a,l?(function(e,i){let r;return function(...i){let o,a=e.length>i.length;a&&i.push(n);try{o=e.apply(this,i)}catch(e){if(a&&r)throw e;return n(e)}a||(o&&o.then&&"function"==typeof o.then?o.then(s,n):o instanceof Error?n(o):s(o))};function n(e,...s){r||(r=!0,i(e,...s))}function s(e){n(null,e)}})(l,s)(...a):n(null,...a)}(null,...i)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),i}};return i}()}copy(){let e=new iL,i=-1;for(;++i<this.attachers.length;){let r=this.attachers[i];e.use(...r)}return e.data((0,ig.default)(!0,{},this.namespace)),e}data(e,i){return"string"==typeof e?2==arguments.length?(iO("data",this.frozen),this.namespace[e]=i,this):iD.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iO("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...i]=this.attachers[this.freezeIndex];if(!1===i[0])continue;!0===i[0]&&(i[0]=void 0);let r=e.call(this,...i);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let i=iI(e),r=this.parser||this.Parser;return iM("parse",r),r(String(i),i)}process(e,i){let r=this;return this.freeze(),iM("process",this.parser||this.Parser),iP("process",this.compiler||this.Compiler),i?n(void 0,i):new Promise(n);function n(n,s){let o=iI(e),a=r.parse(o);function l(e,r){e||!r?s(e):n?n(r):(v(i,"`done` is defined if `resolve` is not"),i(void 0,r))}r.run(a,o,function(e,i,n){var s,o;if(e||!i||!n)return l(e);let a=r.stringify(i,n);"string"==typeof(s=a)||(o=s)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?n.value=a:n.result=a,l(e,n)})}}processSync(e){let i,r=!1;return this.freeze(),iM("processSync",this.parser||this.Parser),iP("processSync",this.compiler||this.Compiler),this.process(e,function(e,n){r=!0,ip(e),i=n}),iN("processSync","process",r),v(i,"we either bailed on an error or have a tree"),i}run(e,i,r){iB(e),this.freeze();let n=this.transformers;return r||"function"!=typeof i||(r=i,i=void 0),r?s(void 0,r):new Promise(s);function s(s,o){v("function"!=typeof i,"`file` can’t be a `done` anymore, we checked");let a=iI(i);n.run(e,a,function(i,n,a){let l=n||e;i?o(i):s?s(l):(v(r,"`done` is defined if `resolve` is not"),r(void 0,l,a))})}}runSync(e,i){let r,n=!1;return this.run(e,i,function(e,i){ip(e),r=i,n=!0}),iN("runSync","run",n),v(r,"we either bailed on an error or have a tree"),r}stringify(e,i){this.freeze();let r=iI(i),n=this.compiler||this.Compiler;return iP("stringify",n),iB(e),n(e,r)}use(e,...i){let r=this.attachers,n=this.namespace;if(iO("use",this.frozen),null==e);else if("function"==typeof e)a(e,i);else if("object"==typeof e)Array.isArray(e)?o(e):s(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function s(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(n.settings=(0,ig.default)(!0,n.settings,e.settings))}function o(e){let i=-1;if(null==e);else if(Array.isArray(e))for(;++i<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[i,...r]=e;a(i,r)}else s(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[i]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,i){let n=-1,s=-1;for(;++n<r.length;)if(r[n][0]===e){s=n;break}if(-1===s)r.push([e,...i]);else if(i.length>0){let[n,...o]=i,a=r[s][1];im(a)&&im(n)&&(n=(0,ig.default)(!0,a,n)),r[s]=[e,n,...o]}}}}let iA=new iL().freeze();function iM(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `parser`")}function iP(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `compiler`")}function iO(e,i){if(i)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iB(e){if(!im(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function iN(e,i,r){if(!r)throw Error("`"+e+"` finished async. Use `"+i+"` instead")}function iI(e){var i;return(i=e)&&"object"==typeof i&&"message"in i&&"messages"in i?e:new iC(e)}let iF=[],iz={allowDangerousHtml:!0},iH=/^(https?|ircs?|mailto|xmpp)$/i,ij=[{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 iW(e){var i;let r,n,s,o,a,l=(r=(i=e).rehypePlugins||iF,n=i.remarkPlugins||iF,s=i.remarkRehypeOptions?{...i.remarkRehypeOptions,...iz}:iz,iA().use(tq).use(n).use(id,s).use(r)),c=(o=e.children||"",a=new iC,"string"==typeof o?a.value=o:y("Unexpected value `"+o+"` for `children` prop, expected `string`"),a);return function(e,i){let r=i.allowedElements,n=i.allowElement,s=i.components,o=i.disallowedElements,a=i.skipHtml,l=i.unwrapDisallowed,c=i.urlTransform||i$;for(let e of ij)Object.hasOwn(i,e.from)&&y("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&o&&y("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),t8(e,function(e,i,s){if("raw"===e.type&&s&&"number"==typeof i)return a?s.children.splice(i,1):s.children[i]={type:"text",value:e.value},i;if("element"===e.type){let i;for(i in eR)if(Object.hasOwn(eR,i)&&Object.hasOwn(e.properties,i)){let r=e.properties[i],n=eR[i];(null===n||n.includes(e.tagName))&&(e.properties[i]=c(String(r||""),i,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!a&&n&&"number"==typeof i&&(a=!n(e,i,s)),a&&s&&"number"==typeof i)return l&&e.children?s.children.splice(i,1,...e.children):s.children.splice(i,1),i}}),function(e,i){var r,n,s,o;let a;if(!i||void 0===i.Fragment)throw TypeError("Expected `Fragment` in options");let l=i.filePath||void 0;if(i.development){if("function"!=typeof i.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=i.jsxDEV,a=function(e,i,s,o){let a=Array.isArray(s.children),l=ea(e);return n(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:r,lineNumber:l?l.line:void 0},void 0)}}else{if("function"!=typeof i.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof i.jsxs)throw TypeError("Expected `jsxs` in production options");s=i.jsx,o=i.jsxs,a=function(e,i,r,n){let a=Array.isArray(r.children)?o:s;return n?a(i,r,n):a(i,r)}}let c={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:a,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:!1!==i.passKeys,passNode:i.passNode||!1,schema:"svg"===i.space?en:er,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==i.tableCellAlignToStyle},h=eb(c,e,void 0);return h&&"string"!=typeof h?h:c.create(e,c.Fragment,{children:h||void 0},void 0)}(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0})}(l.runSync(l.parse(c),c),e)}function i$(e){let i=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),s=e.indexOf("/");return -1===i||-1!==s&&i>s||-1!==r&&i>r||-1!==n&&i>n||iH.test(e.slice(0,i))?e:""}function iU(e,i){let r=String(e);if("string"!=typeof i)throw TypeError("Expected character");let n=0,s=r.indexOf(i);for(;-1!==s;)n++,s=r.indexOf(i,s+i.length);return n}let iq="phrasing",iV=["autolink","link","image","label"];function iK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function iY(e){this.config.enter.autolinkProtocol.call(this,e)}function iX(e){this.config.exit.autolinkProtocol.call(this,e)}function iG(e){this.config.exit.data.call(this,e);let i=this.stack[this.stack.length-1];v("link"===i.type),i.url="http://"+this.sliceSerialize(e)}function iJ(e){this.config.exit.autolinkEmail.call(this,e)}function iZ(e){this.exit(e)}function iQ(e){!function(e,i,r){let n=t5((r||{}).ignore||[]),s=function(e){let i=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let r=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<r.length;){var s;let e=r[n];i.push(["string"==typeof(s=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(s),"g"):s,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return i}(i),o=-1;for(;++o<s.length;)t9(e,"text",a);function a(e,i){let r,a=-1;for(;++a<i.length;){let e=i[a],s=r?r.children:void 0;if(n(e,s?s.indexOf(e):void 0,r))return;r=e}if(r)return function(e,i){let r=i[i.length-1],n=s[o][0],a=s[o][1],l=0,c=r.children.indexOf(e),h=!1,u=[];n.lastIndex=0;let d=n.exec(e.value);for(;d;){let r=d.index,s={index:d.index,input:d.input,stack:[...i,e]},o=a(...d,s);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?n.lastIndex=r+1:(l!==r&&u.push({type:"text",value:e.value.slice(l,r)}),Array.isArray(o)?u.push(...o):o&&u.push(o),l=r+d[0].length,h=!0),!n.global)break;d=n.exec(e.value)}return h?(l<e.value.length&&u.push({type:"text",value:e.value.slice(l)}),r.children.splice(c,1,...u)):u=[e],c+u.length}(e,i)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,i0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,i1]],{ignore:["link","linkReference"]})}function i0(e,i,r,n,s){let o,a="";if(!i2(s))return!1;if(/^w/i.test(i)&&(r=i+r,i="",a="http://"),(o=r.split(".")).length<2||o[o.length-1]&&(/_/.test(o[o.length-1])||!/[a-zA-Z\d]/.test(o[o.length-1]))||o[o.length-2]&&(/_/.test(o[o.length-2])||!/[a-zA-Z\d]/.test(o[o.length-2])))return!1;let l=function(e){let i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],n=r.indexOf(")"),s=iU(e,"("),o=iU(e,")");for(;-1!==n&&s>o;)e+=r.slice(0,n+1),n=(r=r.slice(n+1)).indexOf(")"),o++;return[e,r]}(r+n);if(!l[0])return!1;let c={type:"link",title:null,url:a+i+l[0],children:[{type:"text",value:i+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function i1(e,i,r,n){return!(!i2(n,!0)||/[-\d_]$/.test(r))&&{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function i2(e,i){let r=e.input.charCodeAt(e.index-1);return(0===e.index||eK(r)||eV(r))&&(!i||47!==r)}function i5(){this.buffer()}function i3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function i4(){this.buffer()}function i6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function i9(e){let i=this.resume(),r=this.stack[this.stack.length-1];v("footnoteReference"===r.type),r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),r.label=i}function i8(e){this.exit(e)}function i7(e){let i=this.resume(),r=this.stack[this.stack.length-1];v("footnoteDefinition"===r.type),r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),r.label=i}function re(e){this.exit(e)}function rt(e,i,r,n){let s=r.createTracker(n),o=s.move("[^"),a=r.enter("footnoteReference"),l=r.enter("reference");return o+=s.move(r.safe(r.associationId(e),{after:"]",before:o})),l(),a(),o+=s.move("]")}function ri(e,i,r){return 0===i?e:rr(e,i,r)}function rr(e,i,r){return(r?"":" ")+e}rt.peek=function(){return"["};let rn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function rs(e){this.enter({type:"delete",children:[]},e)}function ro(e){this.exit(e)}function ra(e,i,r,n){let s=r.createTracker(n),o=r.enter("strikethrough"),a=s.move("~~");return a+=r.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function rl(e){return e.length}function rc(e){let i="string"==typeof e?e.codePointAt(0):0;return 67===i||99===i?99:76===i||108===i?108:114*(82===i||114===i)}ra.peek=function(){return"~"};function rh(e,i,r){let n=e.value||"",s="`",o=-1;for(;RegExp("(^|[^`])"+s+"([^`]|$)").test(n);)s+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let e,i=r.unsafe[o],s=r.compilePattern(i);if(i.atBreak)for(;e=s.exec(n);){let i=e.index;10===n.charCodeAt(i)&&13===n.charCodeAt(i-1)&&i--,n=n.slice(0,i)+" "+n.slice(e.index+1)}}return s+n+s}rh.peek=function(){return"`"};t5(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let ru=function(e,i,r,n){let s=function(e){let i=e.options.listItemIndent||"one";if("tab"!==i&&"one"!==i&&"mixed"!==i)throw Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}(r),o=r.bulletCurrent||function(e){let i=e.options.bullet||"*";if("*"!==i&&"+"!==i&&"-"!==i)throw Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}(r);i&&"list"===i.type&&i.ordered&&(o=("number"==typeof i.start&&i.start>-1?i.start:1)+(!1===r.options.incrementListMarker?0:i.children.indexOf(e))+o);let a=o.length+1;("tab"===s||"mixed"===s&&(i&&"list"===i.type&&i.spread||e.spread))&&(a=4*Math.ceil(a/4));let l=r.createTracker(n);l.move(o+" ".repeat(a-o.length)),l.shift(a);let c=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,l.current()),function(e,i,r){return i?(r?"":" ".repeat(a))+e:(r?o:o+" ".repeat(a-o.length))+e});return c(),h};function rd(e){let i=e._align;v(i,"expected `_align` on table"),this.enter({type:"table",align:i.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function rf(e){this.exit(e),this.data.inTable=void 0}function rp(e){this.enter({type:"tableRow",children:[]},e)}function rg(e){this.exit(e)}function rm(e){this.enter({type:"tableCell",children:[]},e)}function r_(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,rv));let r=this.stack[this.stack.length-1];v("inlineCode"===r.type),r.value=i,this.exit(e)}function rv(e,i){return"|"===i?i:e}function ry(e){let i=this.stack[this.stack.length-2];v("listItem"===i.type),i.checked="taskListCheckValueChecked"===e.type}function rb(e){let i=this.stack[this.stack.length-2];if(i&&"listItem"===i.type&&"boolean"==typeof i.checked){let e=this.stack[this.stack.length-1];v("paragraph"===e.type);let r=e.children[0];if(r&&"text"===r.type){let n,s=i.children,o=-1;for(;++o<s.length;){let e=s[o];if("paragraph"===e.type){n=e;break}}n===e&&(r.value=r.value.slice(1),0===r.value.length?e.children.shift():e.position&&r.position&&"number"==typeof r.position.start.offset&&(r.position.start.column++,r.position.start.offset++,e.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function rS(e,i,r,n){let s=e.children[0],o="boolean"==typeof e.checked&&s&&"paragraph"===s.type,a="["+(e.checked?"x":" ")+"] ",l=r.createTracker(n);o&&l.move(a);let c=ru(e,i,r,{...n,...l.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),c}let rw={tokenize:function(e,i,r){let n=0;return function i(o){return(87===o||119===o)&&n<3?(n++,e.consume(o),i):46===o&&3===n?(e.consume(o),s):r(o)};function s(e){return null===e?r(e):i(e)}},partial:!0},rx={tokenize:function(e,i,r){let n,s,o;return a;function a(i){return 46===i||95===i?e.check(rk,c,l)(i):null===i||eU(i)||eK(i)||45!==i&&eV(i)?c(i):(o=!0,e.consume(i),a)}function l(i){return 95===i?n=!0:(s=n,n=void 0),e.consume(i),a}function c(e){return s||n||!o?r(e):i(e)}},partial:!0},rC={tokenize:function(e,i){let r=0,n=0;return s;function s(a){return 40===a?(r++,e.consume(a),s):41===a&&n<r?o(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(rk,i,o)(a):null===a||eU(a)||eK(a)?i(a):(e.consume(a),s)}function o(i){return 41===i&&n++,e.consume(i),s}},partial:!0},rk={tokenize:function(e,i,r){return n;function n(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),n):38===a?(e.consume(a),o):93===a?(e.consume(a),s):60===a||null===a||eU(a)||eK(a)?i(a):r(a)}function s(e){return null===e||40===e||91===e||eU(e)||eK(e)?i(e):n(e)}function o(i){return eN(i)?function i(s){return 59===s?(e.consume(s),n):eN(s)?(e.consume(s),i):r(s)}(i):r(i)}},partial:!0},rE={tokenize:function(e,i,r){return function(i){return e.consume(i),n};function n(e){return eI(e)?r(e):i(e)}},partial:!0},rR={name:"wwwAutolink",tokenize:function(e,i,r){let n=this;return function(i){return 87!==i&&119!==i||!rM.call(n,n.previous)||rN(n.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rw,e.attempt(rx,e.attempt(rC,s),r),r)(i))};function s(r){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(r)}},previous:rM},rT={name:"protocolAutolink",tokenize:function(e,i,r){let n=this,s="",o=!1;return function(i){return(72===i||104===i)&&rP.call(n,n.previous)&&!rN(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(i),e.consume(i),a):r(i)};function a(i){if(eN(i)&&s.length<5)return s+=String.fromCodePoint(i),e.consume(i),a;if(58===i){let r=s.toLowerCase();if("http"===r||"https"===r)return e.consume(i),l}return r(i)}function l(i){return 47===i?(e.consume(i),o)?c:(o=!0,l):r(i)}function c(i){return null===i||ez(i)||eU(i)||eK(i)||eV(i)?r(i):e.attempt(rx,e.attempt(rC,h),r)(i)}function h(r){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(r)}},previous:rP},rD={name:"emailAutolink",tokenize:function(e,i,r){let n,s,o=this;return function(i){return!rB(i)||!rO.call(o,o.previous)||rN(o.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function i(n){return rB(n)?(e.consume(n),i):64===n?(e.consume(n),a):r(n)}(i))};function a(i){return 46===i?e.check(rE,c,l)(i):45===i||95===i||eI(i)?(s=!0,e.consume(i),a):c(i)}function l(i){return e.consume(i),n=!0,a}function c(a){return s&&n&&eN(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(a)):r(a)}},previous:rO},rL={},rA=48;for(;rA<123;)rL[rA]=rD,58==++rA?rA=65:91===rA&&(rA=97);function rM(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||eU(e)}function rP(e){return!eN(e)}function rO(e){return!(47===e||rB(e))}function rB(e){return 43===e||45===e||46===e||95===e||eI(e)}function rN(e){let i=e.length,r=!1;for(;i--;){let n=e[i][1];if(("labelLink"===n.type||"labelImage"===n.type)&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}rL[43]=rD,rL[45]=rD,rL[46]=rD,rL[95]=rD,rL[72]=[rD,rT],rL[104]=[rD,rT],rL[87]=[rD,rR],rL[119]=[rD,rR];let rI={tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return s&&"gfmFootnoteDefinitionIndent"===s[1].type&&4===s[2].sliceSerialize(s[1],!0).length?i(e):r(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function rF(e,i,r){let n,s=this,o=s.events.length,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);for(;o--;){let e=s.events[o][1];if("labelImage"===e.type){n=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!n||!n._balanced)return r(o);let l=ty(s.sliceSerialize({start:n.end,end:s.now()}));return 94===l.codePointAt(0)&&a.includes(l.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),i(o)):r(o)}}function rz(e,i){let r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[r+1],e[r+2],["enter",n,i],e[r+3],e[r+4],["enter",s,i],["exit",s,i],["enter",o,i],["enter",a,i],["exit",a,i],["exit",o,i],e[e.length-2],e[e.length-1],["exit",n,i]];return e.splice(r,e.length-r+1,...l),e}function rH(e,i,r){let n,s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),a=0;return function(i){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),l};function l(i){return 94!==i?r(i):(e.enter("gfmFootnoteCallMarker"),e.consume(i),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(l){if(a>999||93===l&&!n||null===l||91===l||eU(l))return r(l);if(93===l){e.exit("chunkString");let n=e.exit("gfmFootnoteCallString");return o.includes(ty(s.sliceSerialize(n)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(l)}return eU(l)||(n=!0),a++,e.consume(l),92===l?h:c}function h(i){return 91===i||92===i||93===i?(e.consume(i),a++,c):c(i)}}function rj(e,i,r){let n,s,o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),l=0;return function(i){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionLabelMarker"),c};function c(i){return 94===i?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):r(i)}function h(i){if(l>999||93===i&&!s||null===i||91===i||eU(i))return r(i);if(93===i){e.exit("chunkString");let r=e.exit("gfmFootnoteDefinitionLabelString");return n=ty(o.sliceSerialize(r)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return eU(i)||(s=!0),l++,e.consume(i),92===i?u:h}function u(i){return 91===i||92===i||93===i?(e.consume(i),l++,h):h(i)}function d(i){return 58===i?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),a.includes(n)||a.push(n),eX(e,f,"gfmFootnoteDefinitionWhitespace")):r(i)}function f(e){return i(e)}}function rW(e,i,r){return e.check(eQ,i,e.attempt(rI,i,r))}function r$(e){e.exit("gfmFootnoteDefinition")}class rU{constructor(){this.map=[]}add(e,i,r){!function(e,i,r,n){let s=0;if(0!==r||0!==n.length){for(;s<e.map.length;){if(e.map[s][0]===i){e.map[s][1]+=r,e.map[s][2].push(...n);return}s+=1}e.map.push([i,r,n])}}(this,e,i,r)}consume(e){if(this.map.sort(function(e,i){return e[0]-i[0]}),0===this.map.length)return;let i=this.map.length,r=[];for(;i>0;)i-=1,r.push(e.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),e.length=this.map[i][0];r.push(e.slice()),e.length=0;let n=r.pop();for(;n;){for(let i of n)e.push(i);n=r.pop()}this.map.length=0}}function rq(e,i,r){let n,s=this,o=0,a=0;return function(e){let i=s.events.length-1;for(;i>-1;){let e=s.events[i][1].type;if("lineEnding"===e||"linePrefix"===e)i--;else break}let n=i>-1?s.events[i][1].type:null,o="tableHead"===n||"tableRow"===n?y:l;return o===y&&s.parser.lazy[s.now().line]?r(e):o(e)};function l(i){var r;return e.enter("tableHead"),e.enter("tableRow"),124===(r=i)||(n=!0,a+=1),c(r)}function c(i){return null===i?r(i):e$(i)?a>1?(a=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),d):r(i):eq(i)?eX(e,c,"whitespace")(i):(a+=1,n&&(n=!1,o+=1),124===i)?(e.enter("tableCellDivider"),e.consume(i),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),h(i))}function h(i){return null===i||124===i||eU(i)?(e.exit("data"),c(i)):(e.consume(i),92===i?u:h)}function u(i){return 92===i||124===i?(e.consume(i),h):h(i)}function d(i){return(s.interrupt=!1,s.parser.lazy[s.now().line])?r(i):(e.enter("tableDelimiterRow"),n=!1,eq(i))?eX(e,f,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):f(i)}function f(i){return 45===i||58===i?g(i):124===i?(n=!0,e.enter("tableCellDivider"),e.consume(i),e.exit("tableCellDivider"),p):r(i)}function p(i){return eq(i)?eX(e,g,"whitespace")(i):g(i)}function g(i){return 58===i?(a+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(i),e.exit("tableDelimiterMarker"),m):45===i?(a+=1,m(i)):null===i||e$(i)?v(i):r(i)}function m(i){return 45===i?(e.enter("tableDelimiterFiller"),function i(r){return 45===r?(e.consume(r),i):58===r?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(r),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(r))}(i)):r(i)}function _(i){return eq(i)?eX(e,v,"whitespace")(i):v(i)}function v(s){if(124===s)return f(s);if(null===s||e$(s))return n&&o===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(s)):r(s);return r(s)}function y(i){return e.enter("tableRow"),b(i)}function b(r){return 124===r?(e.enter("tableCellDivider"),e.consume(r),e.exit("tableCellDivider"),b):null===r||e$(r)?(e.exit("tableRow"),i(r)):eq(r)?eX(e,b,"whitespace")(r):(e.enter("data"),S(r))}function S(i){return null===i||124===i||eU(i)?(e.exit("data"),b(i)):(e.consume(i),92===i?w:S)}function w(i){return 92===i||124===i?(e.consume(i),S):S(i)}}function rV(e,i){let r,n,s,o=-1,a=!0,l=0,c=[0,0,0,0],h=[0,0,0,0],u=!1,d=0,f=new rU;for(;++o<e.length;){let p=e[o],g=p[1];"enter"===p[0]?"tableHead"===g.type?(u=!1,0!==d&&(rY(f,i,d,r,n),n=void 0,d=0),r={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",r,i]])):"tableRow"===g.type||"tableDelimiterRow"===g.type?(a=!0,s=void 0,c=[0,0,0,0],h=[0,o+1,0,0],u&&(u=!1,n={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",n,i]])),l="tableDelimiterRow"===g.type?2:n?3:1):l&&("data"===g.type||"tableDelimiterMarker"===g.type||"tableDelimiterFiller"===g.type)?(a=!1,0===h[2]&&(0!==c[1]&&(h[0]=h[1],s=rK(f,i,c,l,void 0,s),c=[0,0,0,0]),h[2]=o)):"tableCellDivider"===g.type&&(a?a=!1:(0!==c[1]&&(h[0]=h[1],s=rK(f,i,c,l,void 0,s)),h=[(c=h)[1],o,0,0])):"tableHead"===g.type?(u=!0,d=o):"tableRow"===g.type||"tableDelimiterRow"===g.type?(d=o,0!==c[1]?(h[0]=h[1],s=rK(f,i,c,l,o,s)):0!==h[1]&&(s=rK(f,i,h,l,o,s)),l=0):l&&("data"===g.type||"tableDelimiterMarker"===g.type||"tableDelimiterFiller"===g.type)&&(h[3]=o)}for(0!==d&&rY(f,i,d,r,n),f.consume(i.events),o=-1;++o<i.events.length;){let e=i.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,i){let r=!1,n=[];for(;i<e.length;){let s=e[i];if(r){if("enter"===s[0])"tableContent"===s[1].type&&n.push("tableDelimiterMarker"===e[i+1][1].type?"left":"none");else if("tableContent"===s[1].type){if("tableDelimiterMarker"===e[i-1][1].type){let e=n.length-1;n[e]="left"===n[e]?"center":"right"}}else if("tableDelimiterRow"===s[1].type)break}else"enter"===s[0]&&"tableDelimiterRow"===s[1].type&&(r=!0);i+=1}return n}(i.events,o))}return e}function rK(e,i,r,n,s,o){0!==r[0]&&(o.end=Object.assign({},rX(i.events,r[0])),e.add(r[0],0,[["exit",o,i]]));let a=rX(i.events,r[1]);if(o={type:1===n?"tableHeader":2===n?"tableDelimiter":"tableData",start:Object.assign({},a),end:Object.assign({},a)},e.add(r[1],0,[["enter",o,i]]),0!==r[2]){let s=rX(i.events,r[2]),o=rX(i.events,r[3]),a={type:"tableContent",start:Object.assign({},s),end:Object.assign({},o)};if(e.add(r[2],0,[["enter",a,i]]),2!==n){let n=i.events[r[2]],s=i.events[r[3]];if(n[1].end=Object.assign({},s[1].end),n[1].type="chunkText",n[1].contentType="text",r[3]>r[2]+1){let i=r[2]+1,n=r[3]-r[2]-1;e.add(i,n,[])}}e.add(r[3]+1,0,[["exit",a,i]])}return void 0!==s&&(o.end=Object.assign({},rX(i.events,s)),e.add(s,0,[["exit",o,i]]),o=void 0),o}function rY(e,i,r,n,s){let o=[],a=rX(i.events,r);s&&(s.end=Object.assign({},a),o.push(["exit",s,i])),n.end=Object.assign({},a),o.push(["exit",n,i]),e.add(r+1,0,o)}function rX(e,i){let r=e[i],n="enter"===r[0]?"start":"end";return r[1][n]}let rG={name:"tasklistCheck",tokenize:function(e,i,r){let n=this;return function(i){return null===n.previous&&n._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),s):r(i)};function s(i){return eU(i)?(e.enter("taskListCheckValueUnchecked"),e.consume(i),e.exit("taskListCheckValueUnchecked"),o):88===i||120===i?(e.enter("taskListCheckValueChecked"),e.consume(i),e.exit("taskListCheckValueChecked"),o):r(i)}function o(i){return 93===i?(e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(i)}function a(n){return e$(n)?i(n):eq(n)?e.check({tokenize:rJ},i,r)(n):r(n)}}};function rJ(e,i,r){return eX(e,function(e){return null===e?r(e):i(e)},"whitespace")}let rZ={};function rQ(e){let i,r,n,s=e||rZ,o=this.data(),a=o.micromarkExtensions||(o.micromarkExtensions=[]),l=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),c=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);a.push(eB([{text:rL},{document:{91:{name:"gfmFootnoteDefinition",tokenize:rj,continuation:{tokenize:rW},exit:r$}},text:{91:{name:"gfmFootnoteCall",tokenize:rH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rF,resolveTo:rz}}},(i=(s||{}).singleTilde,r={name:"strikethrough",tokenize:function(e,r,n){let s=this.previous,o=this.events,a=0;return function(l){return 126===s&&"characterEscape"!==o[o.length-1][1].type?n(l):(e.enter("strikethroughSequenceTemporary"),function o(l){let c=ti(s);if(126===l)return a>1?n(l):(e.consume(l),a++,o);if(a<2&&!i)return n(l);let h=e.exit("strikethroughSequenceTemporary"),u=ti(l);return h._open=!u||2===u&&!!c,h._close=!c||2===c&&!!u,r(l)}(l))}},resolveAll:function(e,i){let r=-1;for(;++r<e.length;)if("enter"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._close){let n=r;for(;n--;)if("exit"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._open&&e[r][1].end.offset-e[r][1].start.offset==e[n][1].end.offset-e[n][1].start.offset){e[r][1].type="strikethroughSequence",e[n][1].type="strikethroughSequence";let s={type:"strikethrough",start:Object.assign({},e[n][1].start),end:Object.assign({},e[r][1].end)},o={type:"strikethroughText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[r][1].start)},a=[["enter",s,i],["enter",e[n][1],i],["exit",e[n][1],i],["enter",o,i]],l=i.parser.constructs.insideSpan.null;l&&eM(a,a.length,0,tr(l,e.slice(n+1,r),i)),eM(a,a.length,0,[["exit",o,i],["enter",e[r][1],i],["exit",e[r][1],i],["exit",s,i]]),eM(e,n-1,r-n+3,a),r=n+a.length-2;break}}for(r=-1;++r<e.length;)"strikethroughSequenceTemporary"===e[r][1].type&&(e[r][1].type="data");return e}},null==i&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:rq,resolveAll:rV}}},{text:{91:rG}}])),l.push([{transforms:[iQ],enter:{literalAutolink:iK,literalAutolinkEmail:iY,literalAutolinkHttp:iY,literalAutolinkWww:iY},exit:{literalAutolink:iZ,literalAutolinkEmail:iJ,literalAutolinkHttp:iX,literalAutolinkWww:iG}},{enter:{gfmFootnoteCallString:i5,gfmFootnoteCall:i3,gfmFootnoteDefinitionLabelString:i4,gfmFootnoteDefinition:i6},exit:{gfmFootnoteCallString:i9,gfmFootnoteCall:i8,gfmFootnoteDefinitionLabelString:i7,gfmFootnoteDefinition:re}},{canContainEols:["delete"],enter:{strikethrough:rs},exit:{strikethrough:ro}},{enter:{table:rd,tableData:rm,tableHeader:rm,tableRow:rp},exit:{codeText:r_,table:rf,tableData:rg,tableHeader:rg,tableRow:rg}},{exit:{taskListCheckValueChecked:ry,taskListCheckValueUnchecked:ry,paragraph:rb}}]),c.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:iq,notInConstruct:iV},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:iq,notInConstruct:iV},{character:":",before:"[ps]",after:"\\/",inConstruct:iq,notInConstruct:iV}]},(n=!1,s&&s.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:function(e,i,r,s){let o=r.createTracker(s),a=o.move("[^"),l=r.enter("footnoteDefinition"),c=r.enter("label");return a+=o.move(r.safe(r.associationId(e),{before:a,after:"]"})),c(),a+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),a+=o.move((n?"\n":" ")+r.indentLines(r.containerFlow(e,o.current()),n?rr:ri))),l(),a},footnoteReference:rt},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rn}],handlers:{delete:ra}},function(e){let i=e||{},r=i.tableCellPadding,n=i.tablePipeAlign,s=i.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,i,r){let n=rh(e,i,r);return r.stack.includes("tableCell")&&(n=n.replace(/\|/g,"\\$&")),n},table:function(e,i,r,n){return l(function(e,i,r){let n=e.children,s=-1,o=[],a=i.enter("table");for(;++s<n.length;)o[s]=c(n[s],i,r);return a(),o}(e,r,n),e.align)},tableCell:a,tableRow:function(e,i,r,n){let s=l([c(e,r,n)]);return s.slice(0,s.indexOf("\n"))}}};function a(e,i,r,n){let s=r.enter("tableCell"),a=r.enter("phrasing"),l=r.containerPhrasing(e,{...n,before:o,after:o});return a(),s(),l}function l(e,i){return function(e,i){let r=i||{},n=(r.align||[]).concat(),s=r.stringLength||rl,o=[],a=[],l=[],c=[],h=0,u=-1;for(;++u<e.length;){let i=[],n=[],o=-1;for(e[u].length>h&&(h=e[u].length);++o<e[u].length;){var d;let a=null==(d=e[u][o])?"":String(d);if(!1!==r.alignDelimiters){let e=s(a);n[o]=e,(void 0===c[o]||e>c[o])&&(c[o]=e)}i.push(a)}a[u]=i,l[u]=n}let f=-1;if("object"==typeof n&&"length"in n)for(;++f<h;)o[f]=rc(n[f]);else{let e=rc(n);for(;++f<h;)o[f]=e}f=-1;let p=[],g=[];for(;++f<h;){let e=o[f],i="",n="";99===e?(i=":",n=":"):108===e?i=":":114===e&&(n=":");let s=!1===r.alignDelimiters?1:Math.max(1,c[f]-i.length-n.length),a=i+"-".repeat(s)+n;!1!==r.alignDelimiters&&((s=i.length+s+n.length)>c[f]&&(c[f]=s),g[f]=s),p[f]=a}a.splice(1,0,p),l.splice(1,0,g),u=-1;let m=[];for(;++u<a.length;){let e=a[u],i=l[u];f=-1;let n=[];for(;++f<h;){let s=e[f]||"",a="",l="";if(!1!==r.alignDelimiters){let e=c[f]-(i[f]||0),r=o[f];114===r?a=" ".repeat(e):99===r?e%2?(a=" ".repeat(e/2+.5),l=" ".repeat(e/2-.5)):l=a=" ".repeat(e/2):l=" ".repeat(e)}!1===r.delimiterStart||f||n.push("|"),!1!==r.padding&&(!1!==r.alignDelimiters||""!==s)&&(!1!==r.delimiterStart||f)&&n.push(" "),!1!==r.alignDelimiters&&n.push(a),n.push(s),!1!==r.alignDelimiters&&n.push(l),!1!==r.padding&&n.push(" "),(!1!==r.delimiterEnd||f!==h-1)&&n.push("|")}m.push(!1===r.delimiterEnd?n.join("").replace(/ +$/,""):n.join(""))}return m.join("\n")}(e,{align:i,alignDelimiters:n,padding:r,stringLength:s})}function c(e,i,r){let n=e.children,s=-1,o=[],l=i.enter("tableRow");for(;++s<n.length;)o[s]=a(n[s],e,i,r);return l(),o}}(s),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rS}}]})}var r0=e.i(75254);let r1=(0,r0.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),r2=(0,r0.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r2],74886);var r5=e.i(43531),r3=e.i(85902);function r4({language:e,code:i,children:r}){let[n,s]=(0,m.useState)(!1),o=async()=>{try{await navigator.clipboard.writeText(i),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){console.error("Failed to copy code:",e)}};return(0,g.jsxs)("div",{className:"relative group",children:[(0,g.jsx)(r3.Button,{variant:"ghost",size:"icon-sm",onClick:o,className:"absolute top-2 right-2 opacity-80 hover:opacity-100",title:n?"Copied!":"Copy code","aria-label":n?"Copied to clipboard":"Copy code to clipboard",children:n?(0,g.jsx)(r5.Check,{className:"w-4 h-4 text-success"}):(0,g.jsx)(r2,{className:"w-4 h-4 text-foreground"})}),(0,g.jsx)("pre",{children:(0,g.jsx)("code",{className:e?`language-${e}`:"",children:r})})]})}var r6=e.i(44917),r9=e.i(60948),r8=e.i(3262);e.i(31360),e.i(9003),e.i(60884),e.i(88147),e.i(11338);var r7=e.i(9796),ne=e.i(29432),nt=e.i(96977),ni=e.i(71206),nr=e.i(40524);e.i(47716);var nn=e.i(23685),ns="comm",no="rule",na="decl",nl=Math.abs,nc=String.fromCharCode;function nh(e,i,r){return e.replace(i,r)}function nu(e,i){return 0|e.charCodeAt(i)}function nd(e,i,r){return e.slice(i,r)}function nf(e){return e.length}function np(e,i){return i.push(e),e}var ng=1,nm=1,n_=0,nv=0,ny=0,nb="";function nS(e,i,r,n,s,o,a,l){return{value:e,root:i,parent:r,type:n,props:s,children:o,line:ng,column:nm,length:a,return:"",siblings:l}}function nw(){return ny=nv<n_?nu(nb,nv++):0,nm++,10===ny&&(nm=1,ng++),ny}function nx(){return nu(nb,nv)}function nC(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function nk(e){var i,r;return(i=nv-1,r=function e(i){for(;nw();)switch(ny){case i:return nv;case 34:case 39:34!==i&&39!==i&&e(ny);break;case 40:41===i&&e(i);break;case 92:nw()}return nv}(91===e?e+2:40===e?e+1:e),nd(nb,i,r)).trim()}function nE(e,i,r,n,s,o,a,l,c,h,u,d){for(var f=s-1,p=0===s?o:[""],g=p.length,m=0,_=0,v=0;m<n;++m)for(var y=0,b=nd(e,f+1,f=nl(_=a[m])),S=e;y<g;++y)(S=(_>0?p[y]+" "+b:nh(b,/&\f/g,p[y])).trim())&&(c[v++]=S);return nS(e,i,r,0===s?no:l,c,h,u,d)}function nR(e,i,r,n,s){return nS(e,i,r,na,nd(e,0,n),nd(e,n+1,-1),n,s)}function nT(e,i){for(var r="",n=0;n<e.length;n++)r+=i(e[n],n,e,i)||"";return r}function nD(e,i,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case na:return e.return=e.return||e.value;case ns:return"";case"@keyframes":return e.return=e.value+"{"+nT(e.children,n)+"}";case no:if(!nf(e.value=e.props.join(",")))return""}return nf(r=nT(e.children,n))?e.return=e.value+"{"+r+"}":""}var nL=e.i(24154),nA=e.i(41241),nM={id:"c4",detector:(0,ni.__name)(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78997);return{id:"c4",diagram:i}},"loader")},nP="flowchart",nO=(0,ni.__name)((e,i)=>i?.flowchart?.defaultRenderer!=="dagre-wrapper"&&i?.flowchart?.defaultRenderer!=="elk"&&/^\s*graph/.test(e),"detector"),nB=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:nP,diagram:i}},"loader"),nN={id:nP,detector:nO,loader:nB},nI="flowchart-v2",nF=(0,ni.__name)((e,i)=>i?.flowchart?.defaultRenderer!=="dagre-d3"&&(i?.flowchart?.defaultRenderer==="elk"&&(i.layout="elk"),!!/^\s*graph/.test(e)&&i?.flowchart?.defaultRenderer==="dagre-wrapper"||/^\s*flowchart/.test(e)),"detector"),nz=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:nI,diagram:i}},"loader"),nH={id:nI,detector:nF,loader:nz},nj={id:"er",detector:(0,ni.__name)(e=>/^\s*erDiagram/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(80472);return{id:"er",diagram:i}},"loader")},nW="gitGraph",n$=(0,ni.__name)(e=>/^\s*gitGraph/.test(e),"detector"),nU=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(83305);return{id:nW,diagram:i}},"loader"),nq={id:nW,detector:n$,loader:nU},nV="gantt",nK=(0,ni.__name)(e=>/^\s*gantt/.test(e),"detector"),nY=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(34606);return{id:nV,diagram:i}},"loader"),nX={id:nV,detector:nK,loader:nY},nG="info",nJ=(0,ni.__name)(e=>/^\s*info/.test(e),"detector"),nZ=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(23526);return{id:nG,diagram:i}},"loader"),nQ={id:nG,detector:nJ,loader:nZ},n0={id:"pie",detector:(0,ni.__name)(e=>/^\s*pie/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(3931);return{id:"pie",diagram:i}},"loader")},n1="quadrantChart",n2=(0,ni.__name)(e=>/^\s*quadrantChart/.test(e),"detector"),n5=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(67051);return{id:n1,diagram:i}},"loader"),n3={id:n1,detector:n2,loader:n5},n4="xychart",n6=(0,ni.__name)(e=>/^\s*xychart(-beta)?/.test(e),"detector"),n9=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(36080);return{id:n4,diagram:i}},"loader"),n8={id:n4,detector:n6,loader:n9},n7="requirement",se=(0,ni.__name)(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),st=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(3156);return{id:n7,diagram:i}},"loader"),si={id:n7,detector:se,loader:st},sr="sequence",sn=(0,ni.__name)(e=>/^\s*sequenceDiagram/.test(e),"detector"),ss=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(71209);return{id:sr,diagram:i}},"loader"),so={id:sr,detector:sn,loader:ss},sa="class",sl=(0,ni.__name)((e,i)=>i?.class?.defaultRenderer!=="dagre-wrapper"&&/^\s*classDiagram/.test(e),"detector"),sc=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78922);return{id:sa,diagram:i}},"loader"),sh={id:sa,detector:sl,loader:sc},su="classDiagram",sd=(0,ni.__name)((e,i)=>!!/^\s*classDiagram/.test(e)&&i?.class?.defaultRenderer==="dagre-wrapper"||/^\s*classDiagram-v2/.test(e),"detector"),sf=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(10404);return{id:su,diagram:i}},"loader"),sp={id:su,detector:sd,loader:sf},sg="state",sm=(0,ni.__name)((e,i)=>i?.state?.defaultRenderer!=="dagre-wrapper"&&/^\s*stateDiagram/.test(e),"detector"),s_=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(81283);return{id:sg,diagram:i}},"loader"),sv={id:sg,detector:sm,loader:s_},sy="stateDiagram",sb=(0,ni.__name)((e,i)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&i?.state?.defaultRenderer==="dagre-wrapper"),"detector"),sS=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(41605);return{id:sy,diagram:i}},"loader"),sw={id:sy,detector:sb,loader:sS},sx="journey",sC=(0,ni.__name)(e=>/^\s*journey/.test(e),"detector"),sk=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78877);return{id:sx,diagram:i}},"loader"),sE={id:sx,detector:sC,loader:sk},sR={draw:(0,ni.__name)((e,i,r)=>{ni.log.debug("rendering svg for syntax error\n");let n=(0,r6.selectSvgElement)(i),s=n.append("g");n.attr("viewBox","0 0 2412 512"),(0,nt.configureSvgSize)(n,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},sT={db:{},renderer:sR,parser:{parse:(0,ni.__name)(()=>{},"parse")}},sD="flowchart-elk",sL=(0,ni.__name)((e,i={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&i?.flowchart?.defaultRenderer==="elk")&&(i.layout="elk",!0),"detector"),sA=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:sD,diagram:i}},"loader"),sM={id:sD,detector:sL,loader:sA},sP="timeline",sO=(0,ni.__name)(e=>/^\s*timeline/.test(e),"detector"),sB=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(27415);return{id:sP,diagram:i}},"loader"),sN={id:sP,detector:sO,loader:sB},sI="mindmap",sF=(0,ni.__name)(e=>/^\s*mindmap/.test(e),"detector"),sz=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(44319);return{id:sI,diagram:i}},"loader"),sH={id:sI,detector:sF,loader:sz},sj="kanban",sW=(0,ni.__name)(e=>/^\s*kanban/.test(e),"detector"),s$=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(31376);return{id:sj,diagram:i}},"loader"),sU={id:sj,detector:sW,loader:s$},sq="sankey",sV=(0,ni.__name)(e=>/^\s*sankey(-beta)?/.test(e),"detector"),sK=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(34215);return{id:sq,diagram:i}},"loader"),sY={id:sq,detector:sV,loader:sK},sX="packet",sG=(0,ni.__name)(e=>/^\s*packet(-beta)?/.test(e),"detector"),sJ=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(11980);return{id:sX,diagram:i}},"loader"),sZ={id:sX,detector:sG,loader:sJ},sQ="radar",s0=(0,ni.__name)(e=>/^\s*radar-beta/.test(e),"detector"),s1=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(70234);return{id:sQ,diagram:i}},"loader"),s2={id:sQ,detector:s0,loader:s1},s5="block",s3=(0,ni.__name)(e=>/^\s*block(-beta)?/.test(e),"detector"),s4=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(44243);return{id:s5,diagram:i}},"loader"),s6={id:s5,detector:s3,loader:s4},s9="treeView",s8=(0,ni.__name)(e=>/^\s*treeView-beta/.test(e),"detector"),s7=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(51365);return{id:s9,diagram:i}},"loader"),oe={id:s9,detector:s8,loader:s7},ot="architecture",oi=(0,ni.__name)(e=>/^\s*architecture/.test(e),"detector"),or=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(46201);return{id:ot,diagram:i}},"loader"),on={id:ot,detector:oi,loader:or},os="ishikawa",oo=(0,ni.__name)(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),oa=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(48926);return{id:os,diagram:i}},"loader"),ol={id:os,detector:oo,loader:oa},oc="venn",oh=(0,ni.__name)(e=>/^\s*venn-beta/.test(e),"detector"),ou=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(81291);return{id:oc,diagram:i}},"loader"),od={id:oc,detector:oh,loader:ou},of="treemap",op=(0,ni.__name)(e=>/^\s*treemap/.test(e),"detector"),og=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(31656);return{id:of,diagram:i}},"loader"),om={id:of,detector:op,loader:og},o_="wardley-beta",ov=(0,ni.__name)(e=>/^\s*wardley-beta/i.test(e),"detector"),oy=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(22654);return{id:o_,diagram:i}},"loader"),ob={id:o_,detector:ov,loader:oy},oS=!1,ow=(0,ni.__name)(()=>{oS||(oS=!0,(0,nt.registerDiagram)("error",sT,e=>"error"===e.toLowerCase().trim()),(0,nt.registerDiagram)("---",{db:{clear:(0,ni.__name)(()=>{},"clear")},styles:{},renderer:{draw:(0,ni.__name)(()=>{},"draw")},parser:{parse:(0,ni.__name)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,ni.__name)(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),(0,nt.registerLazyLoadedDiagrams)(sM,sH,on),(0,nt.registerLazyLoadedDiagrams)(nM,sU,sp,sh,nj,nX,nQ,n0,si,so,nH,nN,sN,nq,sw,sv,sE,n3,sY,sZ,n8,s6,oe,s2,ol,om,od,ob))},"addDiagrams"),ox=(0,ni.__name)(async()=>{ni.log.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(nt.detectors).map(async([e,{detector:i,loader:r}])=>{if(r)try{(0,nt.getDiagram)(e)}catch{try{let{diagram:e,id:n}=await r();(0,nt.registerDiagram)(n,e,i)}catch(i){throw ni.log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete nt.detectors[e],i}}}))).filter(e=>"rejected"===e.status);if(e.length>0){for(let i of(ni.log.error(`Failed to load ${e.length} external diagrams`),e))ni.log.error(i);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function oC(e,i){e.attr("role","graphics-document document"),""!==i&&e.attr("aria-roledescription",i)}function ok(e,i,r,n){if(void 0!==e.insert){if(r){let i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(i){let r=`chart-title-${n}`;e.attr("aria-labelledby",r),e.insert("title",":first-child").attr("id",r).text(i)}}}(0,ni.__name)(oC,"setA11yDiagramInfo"),(0,ni.__name)(ok,"addSVGa11yTitleDescription");var oE=class e{constructor(e,i,r,n,s){this.type=e,this.text=i,this.db=r,this.parser=n,this.renderer=s}static{(0,ni.__name)(this,"Diagram")}static async fromText(i,r={}){let n=(0,nt.getConfig)(),s=(0,nt.detectType)(i,n);i=(0,ne.encodeEntities)(i)+"\n";try{(0,nt.getDiagram)(s)}catch{let e=(0,nt.getDiagramLoader)(s);if(!e)throw new nt.UnknownDiagramError(`Diagram ${s} not found.`);let{id:i,diagram:r}=await e();(0,nt.registerDiagram)(i,r)}let{db:o,parser:a,renderer:l,init:c}=(0,nt.getDiagram)(s);return a.parser&&(a.parser.yy=o),o.clear?.(),c?.(n),r.title&&o.setDiagramTitle?.(r.title),await a.parse(i),new e(s,i,o,a,l)}async render(e,i){await this.renderer.draw(this.text,e,i,this)}getParser(){return this.parser}getType(){return this.type}},oR=[],oT=(0,ni.__name)(()=>{oR.forEach(e=>{e()}),oR=[]},"attachFunctions"),oD=(0,ni.__name)(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function oL(e){let i=e.match(nt.frontMatterRegex);if(!i)return{text:e,metadata:{}};let r=(0,r9.load)(i[1],{schema:r9.JSON_SCHEMA})??{};r="object"!=typeof r||Array.isArray(r)?{}:r;let n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:e.slice(i[0].length),metadata:n}}(0,ni.__name)(oL,"extractFrontMatter");var oA=(0,ni.__name)(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,i,r)=>"<"+i+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oM=(0,ni.__name)(e=>{let{text:i,metadata:r}=oL(e),{displayMode:n,title:s,config:o={}}=r;return n&&(o.gantt||(o.gantt={}),o.gantt.displayMode=n),{title:s,config:o,text:i}},"processFrontmatter"),oP=(0,ni.__name)(e=>{let i=ne.utils_default.detectInit(e)??{},r=ne.utils_default.detectDirective(e,"wrap");return Array.isArray(r)?i.wrap=r.some(({type:e})=>"wrap"===e):r?.type==="wrap"&&(i.wrap=!0),{text:(0,ne.removeDirectives)(e),directive:i}},"processDirectives");function oO(e){let i=oM(oA(e)),r=oP(i.text),n=(0,ne.cleanAndMerge)(i.config,r.directive);return{code:e=oD(r.text),title:i.title,config:n}}function oB(e){return btoa(Array.from(new TextEncoder().encode(e),e=>String.fromCodePoint(e)).join(""))}(0,ni.__name)(oO,"preprocessDiagram"),(0,ni.__name)(oB,"toBase64");var oN=["foreignobject"],oI=["dominant-baseline"];function oF(e){let i=oO(e);return(0,nt.reset)(),(0,nt.addDirective)(i.config??{}),i}async function oz(e,i){ow();try{let{code:i,config:r}=oF(e);return{diagramType:(await oG(i)).type,config:r}}catch(e){if(i?.suppressErrors)return!1;throw e}}(0,ni.__name)(oF,"processAndSetConfigs"),(0,ni.__name)(oz,"parse");var oH=(0,ni.__name)((e,i,r=[])=>`
2
2
  .${e} ${i} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),oj=(0,ni.__name)((e,i=new Map)=>{let r="";if(void 0!==e.themeCSS&&(r+=`
3
3
  ${e.themeCSS}`),void 0!==e.fontFamily&&(r+=`
4
4
  :root { --mermaid-font-family: ${e.fontFamily}}`),void 0!==e.altFontFamily&&(r+=`
@@ -8,7 +8,7 @@ ${e.themeCSS}`),void 0!==e.fontFamily&&(r+=`
8
8
 
9
9
  If you want to hide the \`${i.titleName}\`, you can wrap it with our VisuallyHidden component.
10
10
 
11
- For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},96085,e=>{"use strict";let i,r,n,s=Object.create(null);s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";let o=Object.create(null);Object.keys(s).forEach(e=>{o[s[e]]=e});let a={type:"error",data:"parser error"},l="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),c="function"==typeof ArrayBuffer,h=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,u=({type:e,data:i},r,n)=>{if(l&&i instanceof Blob)if(r)return n(i);else return d(i,n);if(c&&(i instanceof ArrayBuffer||h(i)))if(r)return n(i);else return d(new Blob([i]),n);return n(s[e]+(i||""))},d=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<p.length;e++)g[p.charCodeAt(e)]=e;let m="function"==typeof ArrayBuffer,_=(e,i)=>{if("string"!=typeof e)return{type:"message",data:y(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:v(e.substring(1),i)}:o[r]?e.length>1?{type:o[r],data:e.substring(1)}:{type:o[r]}:a},v=(e,i)=>m?y((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=g[e.charCodeAt(n)],a=g[e.charCodeAt(n+1)],l=g[e.charCodeAt(n+2)],c=g[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},y=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function b(e){return e.reduce((e,i)=>e+i.length,0)}function S(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function w(e){if(e){var i=e;for(var r in w.prototype)i[r]=w.prototype[r];return i}}w.prototype.on=w.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},w.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};let x="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),C="u">typeof self?self:"u">typeof window?window:Function("return this")();function k(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let E=C.setTimeout,R=C.clearTimeout;function T(e,i){i.useNativeTimers?(e.setTimeoutFn=E.bind(C),e.clearTimeoutFn=R.bind(C)):(e.setTimeoutFn=C.setTimeout.bind(C),e.clearTimeoutFn=C.clearTimeout.bind(C))}function D(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class L extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class A extends w{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new L(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=_(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class M extends A{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=_(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{u(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let P=!1;try{P="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let O=P;function B(){}class N extends M{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class I extends w{constructor(e,i,r){super(),this.createRequest=e,T(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=k(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=I.requestsCount++,I.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=B,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete I.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function F(){for(let e in I.requests)I.requests.hasOwnProperty(e)&&I.requests[e].abort()}I.requestsCount=0,I.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",F):"function"==typeof addEventListener&&addEventListener("onpagehide"in C?"pagehide":"unload",F,!1));let z=(n=H({xdomain:!1}))&&null!==n.responseType;function H(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||O))return new XMLHttpRequest}catch(e){}if(!i)try{return new C[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let j="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends A{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=j?{}:k(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;u(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let $=C.WebSocket||C.MozWebSocket,U={websocket:class extends W{createSocket(e,i,r){return j?new $(e,i,r):i?new $(e,i):new $(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends A{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,d,p,g,m=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],d=0,p=-1,g=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===d){if(1>b(o))break;let e=S(o,1);g=(128&e[0])==128,d=(p=127&e[0])<126?3:126===p?1:2}else if(1===d){if(2>b(o))break;let e=S(o,2);p=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),d=3}else if(2===d){if(8>b(o))break;let e=S(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(a);break}p=0x100000000*n+r.getUint32(4),d=3}else{if(b(o)<p)break;let e=S(o,p);i.enqueue(_(g?e:r.decode(e),s)),d=0}if(0===p||p>n){i.enqueue(a);break}}}})),v=e.readable.pipeThrough(m).getReader(),y=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},l&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(n):c&&(e.data instanceof ArrayBuffer||h(e.data))?n(f(e.data)):u(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});y.readable.pipeTo(e.writable),this._writer=y.writable.getWriter();let w=()=>{v.read().then(({done:e,value:i})=>{e||(this.onPacket(i),w())}).catch(e=>{})};w();let x={type:"open"};this.query.sid&&(x.data=`{"sid":"${this.query.sid}"}`),this._writer.write(x).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends N{constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=z&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new I(H,this.uri(),e)}}},q=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=q.exec(e||""),h={},u=14;for(;u--;)h[V[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let Y="function"==typeof addEventListener&&"function"==typeof removeEventListener,X=[];Y&&addEventListener("offline",()=>{X.forEach(e=>e())},!1);class G extends w{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=K(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=K(i.host).host);T(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),Y&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},X.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&G.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",G.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(G.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Y&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=X.indexOf(this._offlineEventListener);-1!==e&&X.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}G.protocol=4;class J extends G{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;G.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;G.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class Z extends J{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>U[e]).filter(e=>!!e)),super(e,r)}}Z.protocol;let Q="function"==typeof ArrayBuffer,ee=Object.prototype.toString,et="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ei="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ee.call(File);function er(e){return Q&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||et&&e instanceof Blob||ei&&e instanceof File}let en=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(ed=ef||(ef={}))[ed.CONNECT=0]="CONNECT",ed[ed.DISCONNECT=1]="DISCONNECT",ed[ed.EVENT=2]="EVENT",ed[ed.ACK=3]="ACK",ed[ed.CONNECT_ERROR=4]="CONNECT_ERROR",ed[ed.BINARY_EVENT=5]="BINARY_EVENT",ed[ed.BINARY_ACK=6]="BINARY_ACK";class es extends w{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===ef.BINARY_EVENT;r||i.type===ef.BINARY_ACK?(i.type=r?ef.EVENT:ef.ACK,this.reconstructor=new eo(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(er(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===ef[r.type])throw Error("unknown packet type "+r.type);if(r.type===ef.BINARY_EVENT||r.type===ef.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!ea(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(es.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case ef.CONNECT:return el(i);case ef.DISCONNECT:return void 0===i;case ef.CONNECT_ERROR:return"string"==typeof i||el(i);case ef.EVENT:case ef.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:case ef.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ea=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function el(e){return"[object Object]"===Object.prototype.toString.call(e)}function ec(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,es,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===ef.EVENT||e.type===ef.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(er(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===ef.EVENT?ef.BINARY_EVENT:ef.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===ef.BINARY_EVENT||e.type===ef.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(er(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,ef,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||ea(i))&&function(e,i){switch(e){case ef.CONNECT:return void 0===i||el(i);case ef.DISCONNECT:return void 0===i;case ef.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:return Array.isArray(i);case ef.CONNECT_ERROR:return"string"==typeof i||el(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let eh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eu extends w{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[ec(e,"open",this.onopen.bind(this)),ec(e,"packet",this.onpacket.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(eh.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:ef.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ef.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ef.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ef.EVENT:case ef.BINARY_EVENT:this.onevent(e);break;case ef.ACK:case ef.BINARY_ACK:this.onack(e);break;case ef.DISCONNECT:this.ondisconnect();break;case ef.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:ef.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ef.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var ed,ef,ep=e.i(51890);function eg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},eg.prototype.reset=function(){this.attempts=0},eg.prototype.setMin=function(e){this.ms=e},eg.prototype.setMax=function(e){this.max=e},eg.prototype.setJitter=function(e){this.jitter=e};class em extends w{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,T(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new eg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||ep;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Z(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=ec(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=ec(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(ec(e,"ping",this.onping.bind(this)),ec(e,"data",this.ondata.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this)),ec(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){x(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eu(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let e_={};function ev(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=K(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=e_[o]&&a in e_[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new em(s,i):(e_[o]||(e_[o]=new em(s,i)),r=e_[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(ev,{Manager:em,Socket:eu,io:ev,connect:ev}),e.s(["io",0,ev],96085)},2576,e=>{"use strict";var i=e.i(71645),r=e.i(96085),n=e.i(70935);e.s(["useTaskEvents",0,function(e){let s=(0,i.useRef)(null),o=(0,i.useRef)(e);(0,i.useLayoutEffect)(()=>{o.current=e}),(0,i.useEffect)(()=>{let e=(0,r.io)((0,n.getServerUrl)(),{transports:["websocket"]});return s.current=e,e.on("task:created",({task:e})=>{o.current.onTaskCreated(e)}),e.on("task:updated",({task:e})=>{o.current.onTaskUpdated(e)}),e.on("task:deleted",({taskId:e})=>{o.current.onTaskDeleted(e)}),()=>{e.disconnect(),s.current=null}},[])}])},48214,31245,68054,57212,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,n],31245);let s=(0,i.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,s],68054);let o=(0,i.default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,o],57212)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],73884)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,i],86311)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902);function T({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,g.useRef)([]),[c,h]=(0,g.useState)({left:0,width:0}),[u,d]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
11
+ For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},96085,e=>{"use strict";let i,r,n,s=Object.create(null);s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";let o=Object.create(null);Object.keys(s).forEach(e=>{o[s[e]]=e});let a={type:"error",data:"parser error"},l="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),c="function"==typeof ArrayBuffer,h=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,u=({type:e,data:i},r,n)=>{if(l&&i instanceof Blob)if(r)return n(i);else return d(i,n);if(c&&(i instanceof ArrayBuffer||h(i)))if(r)return n(i);else return d(new Blob([i]),n);return n(s[e]+(i||""))},d=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<p.length;e++)g[p.charCodeAt(e)]=e;let m="function"==typeof ArrayBuffer,_=(e,i)=>{if("string"!=typeof e)return{type:"message",data:y(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:v(e.substring(1),i)}:o[r]?e.length>1?{type:o[r],data:e.substring(1)}:{type:o[r]}:a},v=(e,i)=>m?y((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=g[e.charCodeAt(n)],a=g[e.charCodeAt(n+1)],l=g[e.charCodeAt(n+2)],c=g[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},y=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function b(e){return e.reduce((e,i)=>e+i.length,0)}function S(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function w(e){if(e){var i=e;for(var r in w.prototype)i[r]=w.prototype[r];return i}}w.prototype.on=w.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},w.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};let x="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),C="u">typeof self?self:"u">typeof window?window:Function("return this")();function k(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let E=C.setTimeout,R=C.clearTimeout;function T(e,i){i.useNativeTimers?(e.setTimeoutFn=E.bind(C),e.clearTimeoutFn=R.bind(C)):(e.setTimeoutFn=C.setTimeout.bind(C),e.clearTimeoutFn=C.clearTimeout.bind(C))}function D(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class L extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class A extends w{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new L(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=_(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class M extends A{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=_(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{u(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let P=!1;try{P="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let O=P;function B(){}class N extends M{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class I extends w{constructor(e,i,r){super(),this.createRequest=e,T(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=k(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=I.requestsCount++,I.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=B,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete I.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function F(){for(let e in I.requests)I.requests.hasOwnProperty(e)&&I.requests[e].abort()}I.requestsCount=0,I.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",F):"function"==typeof addEventListener&&addEventListener("onpagehide"in C?"pagehide":"unload",F,!1));let z=(n=H({xdomain:!1}))&&null!==n.responseType;function H(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||O))return new XMLHttpRequest}catch(e){}if(!i)try{return new C[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let j="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends A{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=j?{}:k(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;u(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let $=C.WebSocket||C.MozWebSocket,U={websocket:class extends W{createSocket(e,i,r){return j?new $(e,i,r):i?new $(e,i):new $(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends A{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,d,p,g,m=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],d=0,p=-1,g=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===d){if(1>b(o))break;let e=S(o,1);g=(128&e[0])==128,d=(p=127&e[0])<126?3:126===p?1:2}else if(1===d){if(2>b(o))break;let e=S(o,2);p=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),d=3}else if(2===d){if(8>b(o))break;let e=S(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(a);break}p=0x100000000*n+r.getUint32(4),d=3}else{if(b(o)<p)break;let e=S(o,p);i.enqueue(_(g?e:r.decode(e),s)),d=0}if(0===p||p>n){i.enqueue(a);break}}}})),v=e.readable.pipeThrough(m).getReader(),y=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},l&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(n):c&&(e.data instanceof ArrayBuffer||h(e.data))?n(f(e.data)):u(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});y.readable.pipeTo(e.writable),this._writer=y.writable.getWriter();let w=()=>{v.read().then(({done:e,value:i})=>{e||(this.onPacket(i),w())}).catch(e=>{})};w();let x={type:"open"};this.query.sid&&(x.data=`{"sid":"${this.query.sid}"}`),this._writer.write(x).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends N{constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=z&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new I(H,this.uri(),e)}}},q=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=q.exec(e||""),h={},u=14;for(;u--;)h[V[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let Y="function"==typeof addEventListener&&"function"==typeof removeEventListener,X=[];Y&&addEventListener("offline",()=>{X.forEach(e=>e())},!1);class G extends w{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=K(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=K(i.host).host);T(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),Y&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},X.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&G.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",G.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(G.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Y&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=X.indexOf(this._offlineEventListener);-1!==e&&X.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}G.protocol=4;class J extends G{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;G.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;G.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class Z extends J{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>U[e]).filter(e=>!!e)),super(e,r)}}Z.protocol;let Q="function"==typeof ArrayBuffer,ee=Object.prototype.toString,et="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ei="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ee.call(File);function er(e){return Q&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||et&&e instanceof Blob||ei&&e instanceof File}let en=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(ed=ef||(ef={}))[ed.CONNECT=0]="CONNECT",ed[ed.DISCONNECT=1]="DISCONNECT",ed[ed.EVENT=2]="EVENT",ed[ed.ACK=3]="ACK",ed[ed.CONNECT_ERROR=4]="CONNECT_ERROR",ed[ed.BINARY_EVENT=5]="BINARY_EVENT",ed[ed.BINARY_ACK=6]="BINARY_ACK";class es extends w{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===ef.BINARY_EVENT;r||i.type===ef.BINARY_ACK?(i.type=r?ef.EVENT:ef.ACK,this.reconstructor=new eo(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(er(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===ef[r.type])throw Error("unknown packet type "+r.type);if(r.type===ef.BINARY_EVENT||r.type===ef.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!ea(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(es.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case ef.CONNECT:return el(i);case ef.DISCONNECT:return void 0===i;case ef.CONNECT_ERROR:return"string"==typeof i||el(i);case ef.EVENT:case ef.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:case ef.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ea=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function el(e){return"[object Object]"===Object.prototype.toString.call(e)}function ec(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,es,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===ef.EVENT||e.type===ef.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(er(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===ef.EVENT?ef.BINARY_EVENT:ef.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===ef.BINARY_EVENT||e.type===ef.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(er(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,ef,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||ea(i))&&function(e,i){switch(e){case ef.CONNECT:return void 0===i||el(i);case ef.DISCONNECT:return void 0===i;case ef.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:return Array.isArray(i);case ef.CONNECT_ERROR:return"string"==typeof i||el(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let eh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eu extends w{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[ec(e,"open",this.onopen.bind(this)),ec(e,"packet",this.onpacket.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(eh.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:ef.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ef.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ef.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ef.EVENT:case ef.BINARY_EVENT:this.onevent(e);break;case ef.ACK:case ef.BINARY_ACK:this.onack(e);break;case ef.DISCONNECT:this.ondisconnect();break;case ef.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:ef.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ef.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var ed,ef,ep=e.i(51890);function eg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},eg.prototype.reset=function(){this.attempts=0},eg.prototype.setMin=function(e){this.ms=e},eg.prototype.setMax=function(e){this.max=e},eg.prototype.setJitter=function(e){this.jitter=e};class em extends w{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,T(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new eg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||ep;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Z(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=ec(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=ec(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(ec(e,"ping",this.onping.bind(this)),ec(e,"data",this.ondata.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this)),ec(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){x(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eu(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let e_={};function ev(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=K(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=e_[o]&&a in e_[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new em(s,i):(e_[o]||(e_[o]=new em(s,i)),r=e_[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(ev,{Manager:em,Socket:eu,io:ev,connect:ev}),e.s(["io",0,ev],96085)},2576,e=>{"use strict";var i=e.i(71645),r=e.i(96085),n=e.i(70935);e.s(["useTaskEvents",0,function(e){let s=(0,i.useRef)(null),o=(0,i.useRef)(e);(0,i.useLayoutEffect)(()=>{o.current=e}),(0,i.useEffect)(()=>{let e=(0,r.io)((0,n.getServerUrl)(),{transports:["websocket"]});return s.current=e,e.on("task:created",({task:e})=>{o.current.onTaskCreated(e)}),e.on("task:updated",({task:e})=>{o.current.onTaskUpdated(e)}),e.on("task:deleted",({taskId:e})=>{o.current.onTaskDeleted(e)}),()=>{e.disconnect(),s.current=null}},[])}])},48214,31245,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,n],31245)},57212,e=>{"use strict";let i=(0,e.i(75254).default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,i],57212)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],73884)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,i],86311)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902);function T({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,g.useRef)([]),[c,h]=(0,g.useState)({left:0,width:0}),[u,d]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
12
12
  flex items-center gap-2 px-4 pt-1 pb-2 h-10 flex-shrink-0 transition-colors cursor-pointer
13
13
  ${o?"text-primary":h?"text-primary-light":"text-muted-foreground hover:text-foreground"}
14
14
  `,children:[(0,p.jsx)("div",{className:"font-medium flex items-center gap-2",children:(0,p.jsx)(T,{entry:c})}),e.length>1&&(0,p.jsx)(R.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),d({tabId:n.tab_id,isRunning:h})},children:(0,p.jsx)(m.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[(0,p.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,p.jsx)(R.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,p.jsx)(b.Terminal,{className:"w-4 h-4"})}),(0,p.jsx)(R.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,p.jsx)(y.Bot,{className:"w-4 h-4"})})]}),(0,p.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${c.left}px`,width:`${c.width}px`}})]})]})}],30939);var D=e.i(47167),L=Object.defineProperty,A=Object.getOwnPropertyDescriptor,M=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?A(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&L(i,r,o),o},P=(e,i)=>(r,n)=>i(r,n,e),O="Terminal input",B="Too much output to announce, navigate to rows manually to read";function N(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function I(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function F(e,i,r,n,s){I(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function z(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function H(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var j=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},W=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},$=class e{constructor(){this.fg=0,this.bg=0,this.extended=new U}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},U=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},q=class e extends ${constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new U,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?z(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},V="di$target",K="di$dependencies",Y=new Map;function X(e){if(Y.has(e))return Y.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[V]===o?o[K].push({id:s,index:a}):(o[K]=[{id:s,index:a}],o[V]=o)};return i._id=e,Y.set(e,i),i}var G=X("BufferService"),J=X("CoreMouseService"),Z=X("CoreService"),Q=X("CharsetService"),ee=X("InstantiationService"),et=X("LogService"),ei=X("OptionsService"),er=X("OscLinkService"),en=X("UnicodeService"),es=X("DecorationService"),eo=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new q,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
@@ -28,5 +28,5 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
28
28
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),rx&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!!r&&!!n&&!!i&&this._areCoordsInSelection(i,r,n)}isCellInSelection(e,i){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!!r&&!!n&&this._areCoordsInSelection([e,i],r,n)}_areCoordsInSelection(e,i,r){return e[1]>i[1]&&e[1]<r[1]||i[1]===r[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<r[0]||i[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||i[1]<r[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let r=this._linkifier.currentLink?.link?.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=rF(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,i),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=ro(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=r?0:(i>r&&(i-=r),(i=Math.min(Math.max(i,-50),50)/50)/Math.abs(i)+Math.round(14*i))}shouldForceSelection(e){return ry?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(2===e.button&&this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):1===e.detail?this._handleSingleClick(e):2===e.detail?this._handleDoubleClick(e):3===e.detail&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=3*!!this.shouldColumnSelect(e),this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&0===i.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(ry&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let e=r.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}i&&i[0]===this._model.selectionEnd[0]&&i[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&void 0!==i[0]&&void 0!==i[1]){let e=function(e,i,r,n){var s,o,a,l,c,h,u,d,f,p,g,m,_,v,y,b;let S,w=r.buffer.x,x=r.buffer.y;if(!r.buffer.hasScrollback){let b,S,C;return s=w,(0===rM(o=x,i,a=r,l=n).length?"":rN(rO(s,o,s,o-rP(o,a),!1,a).length,rB("D",l)))+rM(x,i,r,n)+(c=w,h=x,u=e,b=rM(h,d=i,f=r,p=n).length>0?d-rP(d,f):h,C=(g=c,m=h,S=rM(_=u,v=d,y=f,p).length>0?v-rP(v,y):m,g<_&&S<=v||g>=_&&S<v?"C":"D"),rN(rO(c,b,u,d,"C"===C,f).length,rB(C,p)))}if(x===i)return S=w>e?"D":"C",rN(Math.abs(w-e),rB(S,n));S=x>i?"D":"C";let C=Math.abs(x-i);return rN((b=x>i?e:w,r.cols-b+(C-1)*r.cols+1+((x>i?w:e)-1)),rB(S,n))}(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,r=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,i,r);return}!e||!i||this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&i[0]===this._oldSelectionEnd[0]&&i[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,i,r)}_fireOnSelectionChange(e,i,r){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,i){let r=i;for(let n=0;i>=n;n++){let s=e.loadCell(n,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:s>1&&i!==n&&(r+=s-1)}return r}setSelection(e,i,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,o=s.lines.get(e[1]);if(!o)return;let a=s.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(o,e[0]),c=l,h=e[0]-l,u=0,d=0,f=0,p=0;if(" "===a.charAt(l)){for(;l>0&&" "===a.charAt(l-1);)l--;for(;c<a.length&&" "===a.charAt(c+1);)c++}else{let i=e[0],r=e[0];0===o.getWidth(i)&&(u++,i--),2===o.getWidth(r)&&(d++,r++);let n=o.getString(r).length;for(n>1&&(p+=n-1,c+=n-1);i>0&&l>0&&!this._isCharWordSeparator(o.loadCell(i-1,this._workCell));){o.loadCell(i-1,this._workCell);let e=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,i--):e>1&&(f+=e-1,l-=e-1),l--,i--}for(;r<o.length&&c+1<a.length&&!this._isCharWordSeparator(o.loadCell(r+1,this._workCell));){o.loadCell(r+1,this._workCell);let e=this._workCell.getChars().length;2===this._workCell.getWidth()?(d++,r++):e>1&&(p+=e-1,c+=e-1),c++,r++}}c++;let g=l+h-u+f,m=Math.min(this._bufferService.cols,c-l+u+d-f-p);if(!(!i&&""===a.slice(l,c).trim())){if(r&&0===g&&32!==o.getCodePoint(0)){let i=s.lines.get(e[1]-1);if(i&&o.isWrapped&&32!==i.getCodePoint(this._bufferService.cols-1)){let i=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(i){let e=this._bufferService.cols-i.start;g-=e,m+=e}}}if(n&&g+m===this._bufferService.cols&&32!==o.getCodePoint(this._bufferService.cols-1)){let i=s.lines.get(e[1]+1);if(i?.isWrapped&&32!==i.getCodePoint(0)){let i=this._getWordAt([0,e[1]+1],!1,!1,!0);i&&(m+=i.length)}}return{start:g,length:m}}}_selectWordAt(e,i){let r=this._getWordAt(e,i);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let r=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,r]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=rF(r,this._bufferService.cols)}};rH=M([P(3,G),P(4,Z),P(5,ec),P(6,ei),P(7,eh),P(8,el)],rH);var rj=class{constructor(){this._data={}}set(e,i,r){this._data[e]||(this._data[e]={}),this._data[e][i]=r}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},rW=class{constructor(){this._color=new rj,this._css=new rj}setCss(e,i,r){this._css.set(e,i,r)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,r){this._color.set(e,i,r)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},r$=Object.freeze((()=>{let e=[ng.toColor("#2e3436"),ng.toColor("#cc0000"),ng.toColor("#4e9a06"),ng.toColor("#c4a000"),ng.toColor("#3465a4"),ng.toColor("#75507b"),ng.toColor("#06989a"),ng.toColor("#d3d7cf"),ng.toColor("#555753"),ng.toColor("#ef2929"),ng.toColor("#8ae234"),ng.toColor("#fce94f"),ng.toColor("#729fcf"),ng.toColor("#ad7fa8"),ng.toColor("#34e2e2"),ng.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=i[r/36%6|0],s=i[r/6%6|0],o=i[r%6];e.push({css:iP.toCss(n,s,o),rgba:iP.toRgba(n,s,o)})}for(let i=0;i<24;i++){let r=8+10*i;e.push({css:iP.toCss(r,r,r),rgba:iP.toRgba(r,r,r)})}return e})()),rU=ng.toColor("#ffffff"),rq=ng.toColor("#000000"),rV=ng.toColor("#ffffff"),rK={css:"rgba(255, 255, 255, 0.3)",rgba:0xffffff4d},rY=class extends eD{constructor(e){super(),this._optionsService=e,this._contrastCache=new rW,this._halfContrastCache=new rW,this._onChangeColors=this._register(new eY),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:rU,background:rq,cursor:rV,cursorAccent:rq,selectionForeground:void 0,selectionBackgroundTransparent:rK,selectionBackgroundOpaque:np.blend(rq,rK),selectionInactiveBackgroundTransparent:rK,selectionInactiveBackgroundOpaque:np.blend(rq,rK),scrollbarSliderBackground:np.opacity(rU,.2),scrollbarSliderHoverBackground:np.opacity(rU,.4),scrollbarSliderActiveBackground:np.opacity(rU,.5),overviewRulerBorder:rU,ansi:r$.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=rX(e.foreground,rU),i.background=rX(e.background,rq),i.cursor=np.blend(i.background,rX(e.cursor,rV)),i.cursorAccent=np.blend(i.background,rX(e.cursorAccent,rq)),i.selectionBackgroundTransparent=rX(e.selectionBackground,rK),i.selectionBackgroundOpaque=np.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=rX(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=np.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?rX(e.selectionForeground,iF):void 0,i.selectionForeground===iF&&(i.selectionForeground=void 0),np.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=np.opacity(i.selectionBackgroundTransparent,.3)),np.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=np.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=rX(e.scrollbarSliderBackground,np.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=rX(e.scrollbarSliderHoverBackground,np.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=rX(e.scrollbarSliderActiveBackground,np.opacity(i.foreground,.5)),i.overviewRulerBorder=rX(e.overviewRulerBorder,rU),i.ansi=r$.slice(),i.ansi[0]=rX(e.black,r$[0]),i.ansi[1]=rX(e.red,r$[1]),i.ansi[2]=rX(e.green,r$[2]),i.ansi[3]=rX(e.yellow,r$[3]),i.ansi[4]=rX(e.blue,r$[4]),i.ansi[5]=rX(e.magenta,r$[5]),i.ansi[6]=rX(e.cyan,r$[6]),i.ansi[7]=rX(e.white,r$[7]),i.ansi[8]=rX(e.brightBlack,r$[8]),i.ansi[9]=rX(e.brightRed,r$[9]),i.ansi[10]=rX(e.brightGreen,r$[10]),i.ansi[11]=rX(e.brightYellow,r$[11]),i.ansi[12]=rX(e.brightBlue,r$[12]),i.ansi[13]=rX(e.brightMagenta,r$[13]),i.ansi[14]=rX(e.brightCyan,r$[14]),i.ansi[15]=rX(e.brightWhite,r$[15]),e.extendedAnsi){let r=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)i.ansi[n+16]=rX(e.extendedAnsi[n],r$[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(void 0===e){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function rX(e,i){if(void 0!==e)try{return ng.toColor(e)}catch{}return i}rY=M([P(0,ei)],rY);var rG=class{constructor(...e){for(let[i,r]of(this._entries=new Map,e))this.set(i,r)}set(e,i){let r=this._entries.get(e);return this._entries.set(e,i),r}forEach(e){for(let[i,r]of this._entries.entries())e(i,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},rJ=class{constructor(){this._services=new rG,this._services.set(ee,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let r=(e[K]||[]).sort((e,i)=>e.index-i.index),n=[];for(let i of r){let r=this._services.get(i.id);if(!r)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${i.id._id}.`);n.push(r)}let s=r.length>0?r[0].index:i.length;if(i.length!==s)throw Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${i.length} static arguments`);return new e(...i,...n)}},rZ={trace:0,debug:1,info:2,warn:3,error:4,off:5},rQ=class extends eD{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=rZ[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)"function"==typeof e[i]&&(e[i]=e[i]())}_log(e,i,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...r)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};rQ=M([P(0,ei)],rQ);var r0=class extends eD{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new eY),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new eY),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new eY),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=Array(e);for(let r=0;r<Math.min(e,this.length);r++)i[r]=this._array[this._getCyclicIndex(r)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...r){if(i){for(let r=e;r<this._length-i;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,r){if(!(i<=0)){if(e<0||e>=this._length)throw Error("start argument out of range");if(e+r<0)throw Error("Cannot shift elements in list beyond index 0");if(r>0){for(let n=i-1;n>=0;n--)this.set(e+n+r,this.get(e+n));let n=e+i+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<i;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},r1=Object.freeze(new $),r2=0,r5=class e{constructor(e,i,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let n=i||q.fromCharData([0,"",1,0]);for(let i=0;i<e;++i)this.setCell(i,n);this.length=e}get(e){let i=this._data[3*e+0],r=2097151&i;return[this._data[3*e+1],2097152&i?this._combined[e]:r?z(r):"",i>>22,2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):r]}set(e,i){this._data[3*e+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[3*e+0]=2097152|e|i[2]<<22):this._data[3*e+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 0xc00000&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let i=this._data[3*e+0];return 2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&i}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let i=this._data[3*e+0];return 2097152&i?this._combined[e]:2097151&i?z(2097151&i):""}isProtected(e){return 0x20000000&this._data[3*e+2]}loadCell(e,i){return r2=3*e,i.content=this._data[r2+0],i.fg=this._data[r2+1],i.bg=this._data[r2+2],2097152&i.content&&(i.combinedData=this._combined[e]),0x10000000&i.bg&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){2097152&i.content&&(this._combined[e]=i.combinedData),0x10000000&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=i.content,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}setCellFromCodepoint(e,i,r,n){0x10000000&n.bg&&(this._extendedAttrs[e]=n.extended),this._data[3*e+0]=i|r<<22,this._data[3*e+1]=n.fg,this._data[3*e+2]=n.bg}addCodepointToCell(e,i,r){let n=this._data[3*e+0];2097152&n?this._combined[e]+=z(i):2097151&n?(this._combined[e]=z(2097151&n)+z(i),n&=-2097152,n|=2097152):n=4194304|i,r&&(n&=-0xc00001,n|=r<<22),this._data[3*e+0]=n}insertCells(e,i,r){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length-e){let n=new q;for(let r=this.length-e-i-1;r>=0;--r)this.setCell(e+i+r,this.loadCell(e+r,n));for(let n=0;n<i;++n)this.setCell(e+n,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);2===this.getWidth(this.length-1)&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(e,i,r){if(e%=this.length,i<this.length-e){let n=new q;for(let r=0;r<this.length-e-i;++r)this.setCell(e+r,this.loadCell(e+i+r,n));for(let e=this.length-i;e<this.length;++e)this.setCell(e,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,r)}replaceCells(e,i,r,n=!1){if(n){for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length&&2===this.getWidth(i-1)&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,r);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,r),e++;return}for(e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length&&2===this.getWidth(i-1)&&this.setCellFromCodepoint(i,0,1,r);e<i&&e<this.length;)this.setCell(e++,r)}resize(e,i){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let r=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*r)this._data=new Uint32Array(this._data.buffer,0,r);else{let e=new Uint32Array(r);e.set(this._data),this._data=e}for(let r=this.length;r<e;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let r=0;r<i.length;r++){let n=parseInt(i[r],10);n>=e&&delete this._combined[n]}let n=Object.keys(this._extendedAttrs);for(let i=0;i<n.length;i++){let r=parseInt(n[i],10);r>=e&&delete this._extendedAttrs[r]}}return this.length=e,4*r*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,e);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,e)}copyFrom(e){for(let i in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[i]=e._combined[i];for(let i in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let i=new e(0);for(let e in i._data=new Uint32Array(this._data),i.length=this.length,this._combined)i._combined[e]=this._combined[e];for(let e in this._extendedAttrs)i._extendedAttrs[e]=this._extendedAttrs[e];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||0x3000000&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,i,r,n,s){let o=e._data;if(s)for(let s=n-1;s>=0;s--){for(let e=0;e<3;e++)this._data[(r+s)*3+e]=o[(i+s)*3+e];0x10000000&o[(i+s)*3+2]&&(this._extendedAttrs[r+s]=e._extendedAttrs[i+s])}else for(let s=0;s<n;s++){for(let e=0;e<3;e++)this._data[(r+s)*3+e]=o[(i+s)*3+e];0x10000000&o[(i+s)*3+2]&&(this._extendedAttrs[r+s]=e._extendedAttrs[i+s])}let a=Object.keys(e._combined);for(let n=0;n<a.length;n++){let s=parseInt(a[n],10);s>=i&&(this._combined[s-i+r]=e._combined[s])}}translateToString(e,i,r,n){i=i??0,r=r??this.length,e&&(r=Math.min(r,this.getTrimmedLength())),n&&(n.length=0);let s="";for(;i<r;){let e=this._data[3*i+0],r=2097151&e,o=2097152&e?this._combined[i]:r?z(r):" ";if(s+=o,n)for(let e=0;e<o.length;++e)n.push(i);i+=e>>22||1}return n&&n.push(i),s}};function r3(e,i,r){if(i===e.length-1)return e[i].getTrimmedLength();let n=!e[i].hasContent(r-1)&&1===e[i].getWidth(r-1),s=2===e[i+1].getWidth(0);return n&&s?r-1:r}var r4=class e{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new eY),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ek(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};r4._nextId=1;var r6={},r9=r6.B;r6[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r6.A={"#":"£"},r6.B=void 0,r6[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r6.C=r6[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r6.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r6.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r6.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r6.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r6.E=r6[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r6.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r6.H=r6[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r6["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var r8=class{constructor(e,i,r){this._hasScrollback=e,this._optionsService=i,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=r1.clone(),this.savedCharset=r9,this.markers=[],this._nullCell=q.fromCharData([0,"",1,0]),this._whitespaceCell=q.fromCharData([0," ",1,32]),this._isClearing=!1,this._memoryCleanupQueue=new rT,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new U),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new U),this._whitespaceCell}getBlankLine(e,i){return new r5(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>0xffffffff?0xffffffff:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r1);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let r=this.getNullCell(r1),n=0,s=this._getCorrectBufferLength(i);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let i=0;i<this.lines.length;i++)n+=+this.lines.get(i).resize(e,r);let o=0;if(this._rows<i)for(let n=this._rows;n<i;n++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||void 0!==this._optionsService.rawOptions.windowsPty.backend||void 0!==this._optionsService.rawOptions.windowsPty.buildNumber?this.lines.push(new r5(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new r5(e,r)));else for(let e=this._rows;e>i;e--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let e=this.lines.length-s;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let i=0;i<this.lines.length;i++)n+=+this.lines.get(i).resize(e,r);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if((i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory())>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&"conpty"===e.backend&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let r=this._optionsService.rawOptions.reflowCursorLine,n=function(e,i,r,n,s,o){let a=[];for(let l=0;l<e.length-1;l++){let c=l,h=e.get(++c);if(!h.isWrapped)continue;let u=[e.get(l)];for(;c<e.length&&h.isWrapped;)u.push(h),h=e.get(++c);if(!o&&n>=l&&n<c){l+=u.length-1;continue}let d=0,f=r3(u,0,i),p=1,g=0;for(;p<u.length;){let e=r3(u,p,i),n=Math.min(e-g,r-f);u[d].copyCellsFrom(u[p],g,f,n,!1),(f+=n)===r&&(d++,f=0),(g+=n)===e&&(p++,g=0),0===f&&0!==d&&2===u[d-1].getWidth(r-1)&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,s))}u[d].replaceCells(f,r,s);let m=0;for(let e=u.length-1;e>0&&(e>d||0===u[e].getTrimmedLength());e--)m++;m>0&&(a.push(l+u.length-m),a.push(m)),l+=u.length-1}return a}(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r1),r);if(n.length>0){let r=function(e,i){let r=[],n=0,s=i[0],o=0;for(let a=0;a<e.length;a++)if(s===a){let r=i[++n];e.onDeleteEmitter.fire({index:a-o,amount:r}),a+=r-1,o+=r,s=i[++n]}else r.push(a);return{layout:r,countRemoved:o}}(this.lines,n);(function(e,i){let r=[];for(let n=0;n<i.length;n++)r.push(e.get(i[n]));for(let i=0;i<r.length;i++)e.set(i,r[i]);e.length=i.length})(this.lines,r.layout),this._reflowLargerAdjustViewport(e,i,r.countRemoved)}}_reflowLargerAdjustViewport(e,i,r){let n=this.getNullCell(r1),s=r;for(;s-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new r5(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,i){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(r1),s=[],o=0;for(let a=this.lines.length-1;a>=0;a--){let l=this.lines.get(a);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let c=[l];for(;l.isWrapped&&a>0;)l=this.lines.get(--a),c.unshift(l);if(!r){let e=this.ybase+this.y;if(e>=a&&e<a+c.length)continue}let h=c[c.length-1].getTrimmedLength(),u=function(e,i,r){let n=[],s=e.map((r,n)=>r3(e,n,i)).reduce((e,i)=>e+i),o=0,a=0,l=0;for(;l<s;){if(s-l<r){n.push(s-l);break}o+=r;let c=r3(e,a,i);o>c&&(o-=c,a++);let h=2===e[a].getWidth(o-1);h&&o--;let u=h?r-1:r;n.push(u),l+=u}return n}(c,this._cols,e),d=u.length-c.length,f;f=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(r1,!0);p.push(e)}p.length>0&&(s.push({start:a+c.length+o,newLines:p}),o+=p.length),c.push(...p);let g=u.length-1,m=u[g];0===m&&(m=u[--g]);let _=c.length-d-1,v=h;for(;_>=0;){let e=Math.min(v,m);if(void 0===c[g])break;c[g].copyCellsFrom(c[_],v-e,m-e,e,!0),0==(m-=e)&&(m=u[--g]),0==(v-=e)&&(v=r3(c,Math.max(--_,0),this._cols))}for(let i=0;i<c.length;i++)u[i]<e&&c[i].setCell(u[i],n);let y=d-f;for(;y-- >0;)0===this.ybase?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+i-1)}if(s.length>0){let e=[],i=[];for(let e=0;e<this.lines.length;e++)i.push(this.lines.get(e));let r=this.lines.length,n=r-1,a=0,l=s[0];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let c=0;for(let h=Math.min(this.lines.maxLength-1,r+o-1);h>=0;h--)if(l&&l.start>n+c){for(let e=l.newLines.length-1;e>=0;e--)this.lines.set(h--,l.newLines[e]);h++,e.push({index:n+1,amount:l.newLines.length}),c+=l.newLines.length,l=s[++a]}else this.lines.set(h,i[n--]);let h=0;for(let i=e.length-1;i>=0;i--)e[i].index+=h,this.lines.onInsertEmitter.fire(e[i]),h+=e[i].amount;let u=Math.max(0,r+o-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,i,r=0,n){let s=this.lines.get(e);return s?s.translateToString(i,r,n):""}getWrappedRangeForLine(e){let i=e,r=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:i,last:r}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let i=new r4(e);return this.markers.push(i),i.register(this.lines.onTrim(e=>{i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(e=>{i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(e=>{i.line>=e.index&&i.line<e.index+e.amount&&i.dispose(),i.line>e.index&&(i.line-=e.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},r7=class extends eD{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new eY),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new r8(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r8(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ne=class extends eD{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new eY),this.onResize=this._onResize.event,this._onScroll=this._register(new eY),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,2),this.rows=Math.max(e.rawOptions.rows||0,1),this.buffers=this._register(new r7(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let r=this.cols!==e,n=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let r=this.buffer,n;(n=this._cachedBlankLine)&&n.length===this.cols&&n.getFg(0)===e.fg&&n.getBg(0)===e.bg||(n=r.getBlankLine(e,i),this._cachedBlankLine=n),n.isWrapped=i;let s=r.ybase+r.scrollTop,o=r.ybase+r.scrollBottom;if(0===r.scrollTop){let e=r.lines.isFull;o===r.lines.length-1?e?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(o+1,0,n.clone()),e?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let e=o-s+1;r.lines.shiftElements(s+1,e-1,-1),r.lines.set(o,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,i){let r=this.buffer;if(e<0){if(0===r.ydisp)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(i||this._onScroll.fire(r.ydisp))}};ne=M([P(0,ei)],ne);var nt={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:ry,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},ni=["normal","bold","100","200","300","400","500","600","700","800","900"],nr=class extends eD{constructor(e){super(),this._onOptionChange=this._register(new eY),this.onOptionChange=this._onOptionChange.event;let i={...nt};for(let r in e)if(r in i)try{let n=e[r];i[r]=this._sanitizeAndValidateOption(r,n)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(eE(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(r=>{r===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(r=>{-1!==e.indexOf(r)&&i()})}_setupOptions(){let e=e=>{if(!(e in nt))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in nt))throw Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:i.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":var r;if(i||(i=nt[e]),"block"!==(r=i)&&"underline"!==r&&"bar"!==r)throw Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=nt[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=ni.includes(i)?i:nt[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,0xffffffff))<0)throw Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&0!==i)throw Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}};function nn(e,i=5){if("object"!=typeof e)return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=i<=1?e[n]:e[n]&&nn(e[n],i-1);return r}var ns=Object.freeze({insertMode:!1}),no=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),na=class extends eD{constructor(e,i,r){super(),this._bufferService=e,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new eY),this.onData=this._onData.event,this._onUserInput=this._register(new eY),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new eY),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new eY),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=nn(ns),this.decPrivateModes=nn(no)}reset(){this.modes=nn(ns),this.decPrivateModes=nn(no)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};na=M([P(0,G),P(1,et),P(2,ei)],na);var nl={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function nc(e,i){let r=16*!!e.ctrl|4*!!e.shift|8*!!e.alt;return 4===e.button?(r|=64,r|=e.action):(r|=3&e.button,4&e.button&&(r|=64),8&e.button&&(r|=128),32===e.action?r|=32:0!==e.action||i||(r|=3)),r}var nh=String.fromCharCode,nu={DEFAULT:e=>{let i=[nc(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1b[M${nh(i[0])}${nh(i[1])}${nh(i[2])}`},SGR:e=>{let i=0===e.action&&4!==e.button?"m":"M";return`\x1b[<${nc(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=0===e.action&&4!==e.button?"m":"M";return`\x1b[<${nc(e,!0)};${e.x};${e.y}${i}`}},nd=class extends eD{constructor(e,i,r){for(let n of(super(),this._bufferService=e,this._coreService=i,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new eY),this.onProtocolChange=this._onProtocolChange.event,Object.keys(nl)))this.addProtocol(n,nl[n]);for(let e of Object.keys(nu))this.addEncoding(e,nu[e]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,r){if(0===e.deltaY||e.shiftKey||void 0===i||void 0===r)return 0;let n=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=i/r+0,50>Math.abs(e.deltaY)&&(n*=.3),this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||4===e.button&&32===e.action||3===e.button&&32!==e.action||4!==e.button&&(2===e.action||3===e.action)||(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,i,r){if(r){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return e.button===i.button&&e.action===i.action&&e.ctrl===i.ctrl&&e.alt===i.alt&&e.shift===i.shift}};nd=M([P(0,G),P(1,Z),P(2,ei)],nd);var nf,np,ng,nm,n_,nv,ny=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],nb=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],nS=class{constructor(){if(this.version="6",!nv){(nv=new Uint8Array(65536)).fill(1),nv[0]=0,nv.fill(0,1,32),nv.fill(0,127,160),nv.fill(2,4352,4448),nv[9001]=2,nv[9002]=2,nv.fill(2,11904,42192),nv[12351]=1,nv.fill(2,44032,55204),nv.fill(2,63744,64256),nv.fill(2,65040,65050),nv.fill(2,65072,65136),nv.fill(2,65280,65377),nv.fill(2,65504,65511);for(let e=0;e<ny.length;++e)nv.fill(0,ny[e][0],ny[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?nv[e]:!function(e,i){let r=0,n=i.length-1,s;if(e<i[0][0]||e>i[n][1])return!1;for(;n>=r;)if(e>i[s=r+n>>1][1])r=s+1;else{if(!(e<i[s][0]))return!0;n=s-1}return!1}(e,nb)?e>=131072&&e<=196605||e>=196608&&e<=262141?2:1:0}charProperties(e,i){let r=this.wcwidth(e),n=0===r&&0!==i;if(n){let e=nw.extractWidth(i);0===e?n=!1:e>r&&(r=e)}return nw.createPropertyValue(0,r,n)}},nw=class e{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new eY,this.onChange=this._onChange.event;let e=new nS;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(1&e)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,r=!1){return(0xffffff&e)<<3|(3&i)<<1|!!r}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(i){let r=0,n=0,s=i.length;for(let o=0;o<s;++o){let a=i.charCodeAt(o);if(55296<=a&&a<=56319){if(++o>=s)return r+this.wcwidth(a);let e=i.charCodeAt(o);56320<=e&&e<=57343?a=(a-55296)*1024+e-56320+65536:r+=this.wcwidth(e)}let l=this.charProperties(a,n),c=e.extractWidth(l);e.extractShouldJoin(l)&&(c-=e.extractWidth(n)),r+=c,n=l}return r}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},nx=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function nC(e){let i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=0!==i[3]&&32!==i[3])}var nk=class e{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>256)throw Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let r=new e;if(!i.length)return r;for(let e=+!!Array.isArray(i[0]);e<i.length;++e){let n=i[e];if(Array.isArray(n))for(let e=0;e<n.length;++e)r.addSubParam(n[e]);else r.addParam(n)}return r}clone(){let i=new e(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let r=this._subParamsIdx[i]>>8,n=255&this._subParamsIdx[i];n-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,n))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>0x7fffffff?0x7fffffff:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>0x7fffffff?0x7fffffff:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];return r-i>0?this._subParams.subarray(i,r):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let r=this._subParamsIdx[i]>>8,n=255&this._subParamsIdx[i];n-r>0&&(e[i]=this._subParams.slice(r,n))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,n=r[i-1];r[i-1]=~n?Math.min(10*n+e,0x7fffffff):e}},nE=[],nR=class{constructor(){this._state=0,this._active=nE,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){void 0===this._handlers[e]&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(i),{dispose:()=>{let e=r.indexOf(i);-1!==e&&r.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nE}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=nE,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||nE,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,i,r){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,i,r);else this._handlerFb(this._id,"PUT",H(e,i,r))}start(){this.reset(),this._state=1}put(e,i,r){if(3!==this._state){if(1===this._state)for(;i<r;){let r=e[i++];if(59===r){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}-1===this._id&&(this._id=0),this._id=10*this._id+r-48}2===this._state&&r-i>0&&this._put(e,i,r)}}end(e,i=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let r=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&!1===r){for(;n>=0&&!0!==(r=this._active[n].end(e));n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if((r=this._active[n].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}else this._handlerFb(this._id,"END",e);this._active=nE,this._id=-1,this._state=0}}},nT=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,r){this._hitLimit||(this._data+=H(e,i,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data))instanceof Promise)return i.then(e=>(this._data="",this._hitLimit=!1,e));return this._data="",this._hitLimit=!1,i}},nD=[],nL=class{constructor(){this._handlers=Object.create(null),this._active=nD,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nD}registerHandler(e,i){void 0===this._handlers[e]&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(i),{dispose:()=>{let e=r.indexOf(i);-1!==e&&r.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=nD,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||nD,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(i);else this._handlerFb(this._ident,"HOOK",i)}put(e,i,r){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,i,r);else this._handlerFb(this._ident,"PUT",H(e,i,r))}unhook(e,i=!0){if(this._active.length){let r=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&!1===r){for(;n>=0&&!0!==(r=this._active[n].unhook(e));n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if((r=this._active[n].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",e);this._active=nD,this._ident=0}},nA=new nk;nA.addParam(0);var nM=class{constructor(e){this._handler=e,this._data="",this._params=nA,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():nA,this._data="",this._hitLimit=!1}put(e,i,r){this._hitLimit||(this._data+=H(e,i,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params))instanceof Promise)return i.then(e=>(this._params=nA,this._data="",this._hitLimit=!1,e));return this._params=nA,this._data="",this._hitLimit=!1,i}},nP=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,r,n){this.table[i<<8|e]=r<<4|n}addMany(e,i,r,n){for(let s=0;s<e.length;s++)this.table[i<<8|e[s]]=r<<4|n}},nO=function(){let e=new nP(4095),i=Array.apply(null,Array(256)).map((e,i)=>i),r=(e,r)=>i.slice(e,r),n=r(32,127),s=r(0,24);s.push(25),s.push.apply(s,r(28,32));let o=r(0,14),a;for(a in e.setDefault(1,0),e.addMany(n,0,2,0),o)e.addMany([24,26,153,154],a,3,0),e.addMany(r(128,144),a,3,0),e.addMany(r(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}(),nB=class extends eD{constructor(e=nO){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new nk,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,i,r)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(eE(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new nR),this._dcsParser=this._register(new nL),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw Error("only one byte as prefix supported");if((r=e.prefix.charCodeAt(0))&&60>r||r>63)throw Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw Error("only two bytes as intermediates are supported");for(let i=0;i<e.intermediates.length;++i){let n=e.intermediates.charCodeAt(i);if(32>n||n>47)throw Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=n}}if(1!==e.final.length)throw Error("final must be a single byte");let n=e.final.charCodeAt(0);if(i[0]>n||n>i[1])throw Error(`final must be in range ${i[0]} .. ${i[1]}`);return r<<=8,r|=n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(255&e)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let r=this._identifier(e,[48,126]);void 0===this._escHandlers[r]&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(i),{dispose:()=>{let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let r=this._identifier(e);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(i),{dispose:()=>{let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,r,n,s){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=s}parse(e,i,r){let n=0,s=0,o=0,a;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===r||1===this._parseStack.state)throw this._parseStack.state=1,Error("improper continuation due to previous async handler, giving up parsing");let i=this._parseStack.handlers,s=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===r&&s>-1){for(;s>=0&&!0!==(a=i[s](this._params));s--)if(a instanceof Promise)return this._parseStack.handlerPos=s,a}this._parseStack.handlers=[];break;case 4:if(!1===r&&s>-1){for(;s>=0&&!0!==(a=i[s]());s--)if(a instanceof Promise)return this._parseStack.handlerPos=s,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(24!==n&&26!==n,r))return a;27===n&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(24!==n&&26!==n,r))return a;27===n&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let r=o;r<i;++r){switch(n=e[r],(s=this._transitions.table[this.currentState<<8|(n<160?n:160)])>>4){case 2:for(let s=r+1;;++s)if(s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160){this._printHandler(e,r,s),r=s-1;break}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:r,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|n],l=o?o.length-1:-1;for(;l>=0&&!0!==(a=o[l](this._params));l--)if(a instanceof Promise)return this._preserveStack(3,o,l,s,r),a;l<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++r<i&&(n=e[r])>47&&n<60)r--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let c=this._escHandlers[this._collect<<8|n],h=c?c.length-1:-1;for(;h>=0&&!0!==(a=c[h]());h--)if(a instanceof Promise)return this._preserveStack(4,c,h,s,r),a;h<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let s=r+1;;++s)if(s>=i||24===(n=e[s])||26===n||27===n||n>127&&n<160){this._dcsParser.put(e,r,s),r=s-1;break}break;case 14:if(a=this._dcsParser.unhook(24!==n&&26!==n))return this._preserveStack(6,[],0,s,r),a;27===n&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let s=r+1;;s++)if(s>=i||(n=e[s])<32||n>127&&n<160){this._oscParser.put(e,r,s),r=s-1;break}break;case 6:if(a=this._oscParser.end(24!==n&&26!==n))return this._preserveStack(5,[],0,s,r),a;27===n&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&s}}},nN=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,nI=/^[\da-f]+$/;function nF(e){if(!e)return;let i=e.toLowerCase();if(0===i.indexOf("rgb:")){i=i.slice(4);let e=nN.exec(i);if(e){let i=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/i*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/i*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/i*255)]}}else if(0===i.indexOf("#")&&(i=i.slice(1),nI.exec(i)&&[3,6,9,12].includes(i.length))){let e=i.length/3,r=[0,0,0];for(let n=0;n<3;++n){let s=parseInt(i.slice(e*n,e*n+e),16);r[n]=1===e?s<<4:2===e?s:3===e?s>>4:s>>8}return r}}function nz(e,i){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(i){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}var nH={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function nj(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var nW=0,n$=class extends eD{constructor(e,i,r,n,s,o,a,l,c=new nB){for(let h in super(),this._bufferService=e,this._charsetService=i,this._coreService=r,this._logService=n,this._optionsService=s,this._oscLinkService=o,this._coreMouseService=a,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new j,this._utf8Decoder=new W,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r1.clone(),this._eraseAttrDataInternal=r1.clone(),this._onRequestBell=this._register(new eY),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new eY),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new eY),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new eY),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new eY),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new eY),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new eY),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new eY),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new eY),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new eY),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new eY),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new eY),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new eY),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new nU(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,i)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:i.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})}),this._parser.setOscHandlerFallback((e,i,r)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:i,data:r})}),this._parser.setDcsHandlerFallback((e,i,r)=>{"HOOK"===i&&(r=r.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:i,payload:r})}),this._parser.setPrintHandler((e,i,r)=>this.print(e,i,r)),this._parser.registerCsiHandler({final:"@"},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:"A"},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:"B"},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:"C"},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:"D"},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:"E"},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:"F"},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:"G"},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:"H"},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:"I"},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:"J"},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:"K"},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:"L"},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:"M"},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:"P"},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:"S"},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:"T"},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:"X"},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:"Z"},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:"a"},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:"b"},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:"c"},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:">",final:"c"},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:"d"},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:"e"},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:"f"},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:"g"},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:"h"},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"h"},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:"l"},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"l"},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:"m"},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:"n"},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:"?",final:"n"},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:"r"},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:"s"},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:"t"},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:"u"},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(iL.BEL,()=>this.bell()),this._parser.setExecuteHandler(iL.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(iL.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(iL.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(iL.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(iL.BS,()=>this.backspace()),this._parser.setExecuteHandler(iL.HT,()=>this.tab()),this._parser.setExecuteHandler(iL.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(iL.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(iA.IND,()=>this.index()),this._parser.setExecuteHandler(iA.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(iA.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new nT(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new nT(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new nT(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new nT(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new nT(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new nT(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new nT(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new nT(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new nT(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new nT(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new nT(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new nT(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset()),r6)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error("Parsing error: ",e),e)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new nM((e,i)=>this.requestStatusString(e,i)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),5e3))]).catch(e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let r,n=this._activeBuffer.x,s=this._activeBuffer.y,o=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>131072&&(o=this._parseStack.position+131072)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${"string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join("")}"`}`),0===this._logService.logLevel&&this._logService.trace("parsing data (codes)","string"==typeof e?e.split("").map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),a||this._dirtyRowTracker.clearRange(),e.length>131072)for(let i=o;i<e.length;i+=131072){let o=i+131072<e.length?i+131072:e.length,a="string"==typeof e?this._stringDecoder.decode(e.substring(i,o),this._parseBuffer):this._utf8Decoder.decode(e.subarray(i,o),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,a))return this._preserveStack(n,s,a,i),this._logSlowResolvingAsync(r),r}else if(!a){let i="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,i))return this._preserveStack(n,s,i,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,i,r){let n,s,o=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-i>0&&2===d.getWidth(this._activeBuffer.x-1)&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=i;p<r;++p){if((n=e[p])<127&&o){let e=o[String.fromCharCode(n)];e&&(n=e.charCodeAt(0))}let i=this._unicodeService.charProperties(n,f);s=nw.extractWidth(i);let r=nw.extractShouldJoin(i),g=r?nw.extractWidth(f):0;if(f=i,a&&this._onA11yChar.fire(z(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-g>l){if(c){let e=d,i=this._activeBuffer.x-g;for(this._activeBuffer.x=g,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),g>0&&d instanceof r5&&d.copyCellsFrom(e,i,0,g,!1);i<l;)e.setCellFromCodepoint(i++,0,1,u)}else if(this._activeBuffer.x=l-1,2===s)continue}if(r&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,n,s);for(let e=s-g;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(h&&(d.insertCells(this._activeBuffer.x,s-g,this._activeBuffer.getNullCell(u)),2===d.getWidth(l-1)&&d.setCellFromCodepoint(l-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,n,s,u),s>0)for(;--s;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<l&&r-i>0&&0===d.getWidth(this._activeBuffer.x)&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,i):this._parser.registerCsiHandler(e,e=>!nj(e.params[0],this._optionsService.rawOptions.windowOptions)||i(e))}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new nM(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new nT(i))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return 0===i?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===i&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return 1===i&&(this._curAttrData.bg|=0x20000000),(2===i||0===i)&&(this._curAttrData.bg&=-0x20000001),!0}_eraseInBufferLine(e,i,r,n=!1,s=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(i,r,this._activeBuffer.getNullCell(this._eraseAttrData()),s),n&&(o.isWrapped=!1)}_resetBufferLine(e,i=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,i=!1){let r;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,i);r<this._bufferService.rows;r++)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0))}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;i--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;i--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(r1));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i=this._parser.precedingJoinState;if(!i)return!0;let r=e.params[0]||1,n=nw.extractWidth(i),s=this._activeBuffer.x-n,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(o.length*r),l=0;for(let e=0;e<o.length;){let i=o.codePointAt(e)||0;a[l++]=i,e+=i>65535?2:1}let c=l;for(let e=1;e<r;++e)a.copyWithin(c,0,l),c+=l;return this.print(a,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(iL.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(iL.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(iL.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(iL.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(iL.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,r9),this._charsetService.setgCharset(1,r9),this._charsetService.setgCharset(2,r9),this._charsetService.setgCharset(3,r9);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[i]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,i){let r,n,s,o;(n=r||={})[n.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",n[n.SET=1]="SET",n[n.RESET=2]="RESET",n[n.PERMANENTLY_SET=3]="PERMANENTLY_SET",n[n.PERMANENTLY_RESET=4]="PERMANENTLY_RESET";let a=this._coreService.decPrivateModes,{activeProtocol:l,activeEncoding:c}=this._coreMouseService,h=this._coreService,{buffers:u,cols:d}=this._bufferService,{active:f,alt:p}=u,g=this._optionsService.rawOptions,m=e=>e?1:2,_=e.params[0];return s=_,o=i?2===_?4:4===_?m(h.modes.insertMode):12===_?3:20===_?m(g.convertEol):0:1===_?m(a.applicationCursorKeys):3===_?g.windowOptions.setWinLines?80===d?2:+(132===d):0:6===_?m(a.origin):7===_?m(a.wraparound):8===_?3:9===_?m("X10"===l):12===_?m(g.cursorBlink):25===_?m(!h.isCursorHidden):45===_?m(a.reverseWraparound):66===_?m(a.applicationKeypad):67===_?4:1e3===_?m("VT200"===l):1002===_?m("DRAG"===l):1003===_?m("ANY"===l):1004===_?m(a.sendFocus):1005===_?4:1006===_?m("SGR"===c):1015===_?4:1016===_?m("SGR_PIXELS"===c):1048===_?1:47===_||1047===_||1049===_?m(f===p):2004===_?m(a.bracketedPasteMode):2026===_?m(a.synchronizedOutput):0,h.triggerDataEvent(`${iL.ESC}[${i?"":"?"}${s};${o}$y`),!0}_updateAttrColor(e,i,r,n,s){return 2===i?(e|=0x3000000,e&=-0x1000000,e|=$.fromColorRGB([r,n,s])):5===i&&(e&=-0x3000100,e|=0x2000000|255&r),e}_extractColor(e,i,r){let n=[0,0,-1,0,0,0],s=0,o=0;do{if(n[o+s]=e.params[i+o],e.hasSubParams(i+o)){let r=e.getSubParams(i+o),a=0;do 5===n[1]&&(s=1),n[o+a+1+s]=r[a];while(++a<r.length&&a+o+1+s<n.length)break}if(5===n[1]&&o+s>=2||2===n[1]&&o+s>=5)break;n[1]&&(s=1)}while(++o+i<e.length&&o+s<n.length)for(let e=2;e<n.length;++e)-1===n[e]&&(n[e]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return o}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=0x10000000,0===e&&(i.fg&=-0x10000001),i.updateExtended()}_processSGR0(e){e.fg=r1.fg,e.bg=r1.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-0x4000000,e.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._processSGR0(this._curAttrData),!0;let i=e.length,r,n=this._curAttrData;for(let s=0;s<i;s++)(r=e.params[s])>=30&&r<=37?(n.fg&=-0x3000100,n.fg|=0x1000000|r-30):r>=40&&r<=47?(n.bg&=-0x3000100,n.bg|=0x1000000|r-40):r>=90&&r<=97?(n.fg&=-0x3000100,n.fg|=0x1000000|r-90|8):r>=100&&r<=107?(n.bg&=-0x3000100,n.bg|=0x1000000|r-100|8):0===r?this._processSGR0(n):1===r?n.fg|=0x8000000:3===r?n.bg|=0x4000000:4===r?(n.fg|=0x10000000,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,n)):5===r?n.fg|=0x20000000:7===r?n.fg|=0x4000000:8===r?n.fg|=0x40000000:9===r?n.fg|=0x80000000:2===r?n.bg|=0x8000000:21===r?this._processUnderline(2,n):22===r?(n.fg&=-0x8000001,n.bg&=-0x8000001):23===r?n.bg&=-0x4000001:24===r?(n.fg&=-0x10000001,this._processUnderline(0,n)):25===r?n.fg&=-0x20000001:27===r?n.fg&=-0x4000001:28===r?n.fg&=-0x40000001:29===r?n.fg&=0x7fffffff:39===r?(n.fg&=-0x4000000,n.fg|=0xffffff&r1.fg):49===r?(n.bg&=-0x4000000,n.bg|=0xffffff&r1.bg):38===r||48===r||58===r?s+=this._extractColor(e,s,n):53===r?n.bg|=0x40000000:55===r?n.bg&=-0x40000001:59===r?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):100===r?(n.fg&=-0x4000000,n.fg|=0xffffff&r1.fg,n.bg&=-0x4000000,n.bg|=0xffffff&r1.bg):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${iL.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${iL.ESC}[${i};${r}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${iL.ESC}[?${e};${i}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r1.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let i=0===e.length?1:e.params[0];if(0===i)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar"}this._coreService.decPrivateModes.cursorBlink=i%2==1}return!0}setScrollRegion(e){let i=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||0===r)&&(r=this._bufferService.rows),r>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!nj(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==i&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${iL.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(0===i||2===i)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),(0===i||1===i)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:(0===i||2===i)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(0===i||1===i)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],r=e.split(";");for(;r.length>1;){let e=r.shift(),n=r.shift();if(/^\d+$/.exec(e)){let r=parseInt(e);if(nq(r))if("?"===n)i.push({type:0,index:r});else{let e=nF(n);e&&i.push({type:1,index:r,color:e})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(-1===i)return!0;let r=e.slice(0,i).trim(),n=e.slice(i+1);return n?this._createHyperlink(r,n):!r.trim()&&this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,s=r.findIndex(e=>e.startsWith("id="));return -1!==s&&(n=r[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let r=e.split(";");for(let e=0;e<r.length&&!(i>=this._specialColors.length);++e,++i)if("?"===r[e])this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let n=nF(r[e]);n&&this._onColor.fire([{type:1,index:this._specialColors[i],color:n}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],r=e.split(";");for(let e=0;e<r.length;++e)if(/^\d+$/.exec(r[e])){let n=parseInt(r[e]);nq(n)&&i.push({type:2,index:n})}return i.length&&this._onColor.fire(i),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,r9),!0}selectCharset(e){return 2!==e.length?this.selectDefaultCharset():"/"===e[0]||this._charsetService.setgCharset(nH[e[0]],r6[e[1]]||r9),!0}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=r1.clone(),this._eraseAttrDataInternal=r1.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-0x4000000,this._eraseAttrDataInternal.bg|=0x3ffffff&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new q;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let r=this._activeBuffer.ybase+this._activeBuffer.y+i,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let r=e=>(this._coreService.triggerDataEvent(`${iL.ESC}${e}${iL.ESC}\\`),!0),n=this._bufferService.buffer,s=this._optionsService.rawOptions;return r('"q'===e?`P1$r${+!!this._curAttrData.isProtected()}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${({block:2,underline:4,bar:6})[s.cursorStyle]-!!s.cursorBlink} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},nU=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,i){e>i&&(nW=e,e=i,i=nW),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function nq(e){return 0<=e&&e<256}nU=M([P(0,G)],nU);var nV=class extends eD{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new eY),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){let r;if(void 0!==i&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=0x7fffffff,this._isSyncWriting=!1,this._syncCalls=0}}write(e,i){if(this._pendingData>5e7)throw Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],n=this._action(e,i);if(n){let e=e=>performance.now()-r>=12?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(r,e);n.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-r>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},nK=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(void 0===e.id){let r=i.addMarker(i.ybase+i.y),n={data:e,id:this._nextId++,lines:[r]};return r.onDispose(()=>this._removeMarkerFromLink(n,r)),this._dataByLinkId.set(n.id,n),n.id}let r=this._getEntryIdKey(e),n=this._entriesWithId.get(r);if(n)return this.addLineToLink(n.id,i.ybase+i.y),n.id;let s=i.addMarker(i.ybase+i.y),o={id:this._nextId++,key:this._getEntryIdKey(e),data:e,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,i){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(e=>e.line!==i)){let e=this._bufferService.buffer.addMarker(i);r.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(r,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let r=e.lines.indexOf(i);-1!==r&&(e.lines.splice(r,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};nK=M([P(0,G)],nK);var nY=!1,nX=class extends eD{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new eL),this._onBinary=this._register(new eY),this.onBinary=this._onBinary.event,this._onData=this._register(new eY),this.onData=this._onData.event,this._onLineFeed=this._register(new eY),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new eY),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new eY),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new eY),this._instantiationService=new rJ,this.optionsService=this._register(new nr(e)),this._instantiationService.setService(ei,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ne)),this._instantiationService.setService(G,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(rQ)),this._instantiationService.setService(et,this._logService),this.coreService=this._register(this._instantiationService.createInstance(na)),this._instantiationService.setService(Z,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(nd)),this._instantiationService.setService(J,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(nw)),this._instantiationService.setService(en,this.unicodeService),this._charsetService=this._instantiationService.createInstance(nx),this._instantiationService.setService(Q,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(nK),this._instantiationService.setService(er,this._oscLinkService),this._inputHandler=this._register(new n$(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ej.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ej.forward(this._bufferService.onResize,this._onResize)),this._register(ej.forward(this.coreService.onData,this._onData)),this._register(ej.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new nV((e,i)=>this._inputHandler.parse(e,i))),this._register(ej.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new eY),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!nY&&(this._logService.warn("writeSync is unreliable and will be removed soon."),nY=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,2),i=Math.max(i,1),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;0!==i&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&void 0!==i.buildNumber&&void 0!==i.buildNumber?e="conpty"===i.backend&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(nC.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(nC(this._bufferService),!1))),this._windowsWrappingHeuristics.value=eE(()=>{for(let i of e)i.dispose()})}}},nG={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']},nJ=0,nZ=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new rT,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new rT,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),0===this._insertedValues.length&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,i)=>this._getKey(e)-this._getKey(i)),i=0,r=0,n=Array(this._array.length+this._insertedValues.length);for(let s=0;s<n.length;s++)r>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[r])?(n[s]=e[i],i++):n[s]=this._array[r++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),0===this._array.length)return!1;let i=this._getKey(e);if(void 0===i||-1===(nJ=this._search(i))||this._getKey(this._array[nJ])!==i)return!1;do if(this._array[nJ]===e)return 0===this._deletedIndices.length&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(nJ),!0;while(++nJ<this._array.length&&this._getKey(this._array[nJ])===i)return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,i)=>e-i),i=0,r=Array(this._array.length-e.length),n=0;for(let s=0;s<this._array.length;s++)e[i]===s?i++:r[n++]=this._array[s];this._array=r,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&!((nJ=this._search(e))<0||nJ>=this._array.length)&&this._getKey(this._array[nJ])===e)do yield this._array[nJ];while(++nJ<this._array.length&&this._getKey(this._array[nJ])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&!((nJ=this._search(e))<0||nJ>=this._array.length)&&this._getKey(this._array[nJ])===e)do i(this._array[nJ]);while(++nJ<this._array.length&&this._getKey(this._array[nJ])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,r=this._array.length-1;for(;r>=i;){let n=i+r>>1,s=this._getKey(this._array[n]);if(s>e)r=n-1;else if(s<e)i=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return i}},nQ=0,n0=0,n1=class extends eD{constructor(){super(),this._decorations=new nZ(e=>e?.marker.line),this._onDecorationRegistered=this._register(new eY),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new eY),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(eE(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new n2(e);if(i){let e=i.marker.onDispose(()=>i.dispose()),r=i.onDispose(()=>{r.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),e.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,r){let n=0,s=0;for(let o of this._decorations.getKeyIterator(i))s=(n=o.options.x??0)+(o.options.width??1),e>=n&&e<s&&(!r||(o.options.layer??"bottom")===r)&&(yield o)}forEachDecorationAtCell(e,i,r,n){this._decorations.forEachByKey(i,i=>{n0=(nQ=i.options.x??0)+(i.options.width??1),e>=nQ&&e<n0&&(!r||(i.options.layer??"bottom")===r)&&n(i)})}},n2=class extends eT{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new eY),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new eY),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=ng.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=ng.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},n5=class{constructor(e,i=1e3){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,r){this._rowCount=r,e=void 0!==e?e:0,i=void 0!==i?i:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,i):i;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=n-this._lastRefreshMs,i=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},i)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},n3=class extends eD{constructor(e,i,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new n5(this._renderRows.bind(this))),!this._terminal.element)throw Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
29
29
  `))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(tZ(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(eE(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
30
30
  `&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=B)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let r=this._terminal.buffer,n=r.lines.length.toString();for(let s=e;s<=i;s++){let e=r.lines.get(r.ydisp+s),i=[],o=e?.translateToString(!0,void 0,void 0,i)||"",a=(r.ydisp+s+1).toString(),l=this._rowElements[s];l&&(0===o.length?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=o,this._rowColumns.set(l,i)),l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",n),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let r,n,s=e.target,o=this._rowElements[0===i?1:this._rowElements.length-2];if(s.getAttribute("aria-posinset")!==(0===i?"1":`${this._terminal.buffer.lines.length}`)&&e.relatedTarget===o){if(0===i?(r=s,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=s,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===i){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===i?-1:1),this._rowElements[0===i?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}}_handleSelectionChange(){if(0===this._rowElements.length)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===r.node&&i.offset>r.offset)&&([i,r]=[r,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let s=({node:e,offset:i})=>{let r=e instanceof Text?e.parentNode:e,n=parseInt(r?.getAttribute("aria-posinset"),10)-1;if(isNaN(n))return console.warn("row is invalid. Race condition?"),null;let s=this._rowColumns.get(r);if(!s)return console.warn("columns is null. Race condition?"),null;let o=i<s.length?s[i]:s.slice(-1)[0]+1;return o>=this._terminal.cols&&(++n,o=0),{row:n,column:o}},o=s(i),a=s(r);if(!(!o||!a)){if(o.row>a.row||o.row===a.row&&o.column>=a.column)throw Error("invalid range");this._terminal.select(o.column,o.row,(a.row-o.row)*this._terminal.cols-o.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let i=e.getBoundingClientRect().width,r=this._rowColumns.get(e)?.slice(-1)?.[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/i})`}};n3=M([P(1,ee),P(2,el),P(3,eh)],n3);var n4=class extends eD{constructor(e,i,r,n,s){super(),this._element=e,this._mouseService=i,this._renderService=r,this._bufferService=n,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new eY),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new eY),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(eE(()=>{ek(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(tZ(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(tZ(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(tZ(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(tZ(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let r=e.composedPath();for(let e=0;e<r.length;e++){let i=r[e];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){this._activeProviderReplies&&i||(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[n,s]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(n)&&(r=this._checkLinkProviderResult(n,e,r)):s.provideLinks(e.y,i=>{if(this._isMouseOut)return;let s=i?.map(e=>({link:e}));this._activeProviderReplies?.set(n,s),r=this._checkLinkProviderResult(n,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let r=new Set;for(let n=0;n<i.size;n++){let s=i.get(n);if(s)for(let i=0;i<s.length;i++){let n=s[i],o=n.link.range.start.y<e?0:n.link.range.start.x,a=n.link.range.end.y>e?this._bufferService.cols:n.link.range.end.x;for(let e=o;e<=a;e++){if(r.has(e)){s.splice(i--,1);break}r.add(e)}}}}_checkLinkProviderResult(e,i,r){if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),s=!1;for(let i=0;i<e;i++)(!this._activeProviderReplies.has(i)||this._activeProviderReplies.get(i))&&(s=!0);if(!s&&n){let e=n.find(e=>this._linkAtPosition(e.link,i));e&&(r=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let e=0;e<this._activeProviderReplies.size;e++){let n=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,i));if(n){r=!0,this._handleNewLink(n);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){var i,r;if(!this._currentLink)return;let n=this._positionFromMouseEvent(e,this._element,this._mouseService);n&&this._mouseDownLink&&(i=this._mouseDownLink.link,r=this._currentLink.link,i.text===r.text&&i.range.start.x===r.range.start.x&&i.range.start.y===r.range.start.y&&i.range.end.x===r.range.end.x&&i.range.end.y===r.range.end.y)&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){this._currentLink&&this._lastMouseEvent&&(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ek(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let i=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(i,r),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(r,i.text)}_fireUnderlineEvent(e,i){let r=e.range,n=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(r,i.text)}_linkAtPosition(e,i){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,s=i.y*this._bufferService.cols+i.x;return r<=s&&s<=n}_positionFromMouseEvent(e,i,r){let n=r.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,r,n,s){return{x1:e,y1:i,x2:r,y2:n,cols:this._bufferService.cols,fg:s}}};n4=M([P(1,ec),P(2,eh),P(3,G),P(4,ep)],n4);var n6=class extends nX{constructor(e={}){super(e),this._linkifier=this._register(new eL),this.browser=rc,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new eL),this._onCursorMove=this._register(new eY),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new eY),this.onKey=this._onKey.event,this._onRender=this._register(new eY),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new eY),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new eY),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new eY),this.onBell=this._onBell.event,this._onFocus=this._register(new eY),this._onBlur=this._register(new eY),this._onA11yCharEmitter=this._register(new eY),this._onA11yTabEmitter=this._register(new eY),this._onWillOpen=this._register(new eY),this._setup(),this._decorationService=this._instantiationService.createInstance(n1),this._instantiationService.setService(es,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(rs),this._instantiationService.setService(ep,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(eo)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(ej.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ej.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ej.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ej.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(eE(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let e,r="";switch(i.index){case 256:e="foreground",r="10";break;case 257:e="background",r="11";break;case 258:e="cursor",r="12";break;default:e="ansi",r="4;"+i.index}switch(i.type){case 0:let n=np.toColorRGB("ansi"===e?this._themeService.colors.ansi[i.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${iL.ESC}]${r};${function(e,i=16){let[r,n,s]=e;return`rgb:${nz(r,i)}/${nz(n,i)}/${nz(s,i)}`}(n)}${iM.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors(e=>e.ansi[i.index]=iP.toColor(...i.color));else{let r=e;this._themeService.modifyColors(e=>e[r]=iP.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(n3,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(iL.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(iL.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,s=i.getWidth(r),o=this._renderService.dimensions.css.cell.width*s,a=this.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=a+"px",this.textarea.style.width=o+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(tZ(this.element,"copy",e=>{var i;this.hasSelection()&&(i=this._selectionService,e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault())}));let e=e=>{var i,r,n;return i=this.textarea,r=this.coreService,n=this.optionsService,void(e.stopPropagation(),e.clipboardData&&N(e.clipboardData.getData("text/plain"),i,r,n))};this._register(tZ(this.textarea,"paste",e)),this._register(tZ(this.element,"paste",e)),rg?this._register(tZ(this.element,"mousedown",e=>{2===e.button&&F(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(tZ(this.element,"contextmenu",e=>{F(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),rx&&this._register(tZ(this.element,"auxclick",e=>{1===e.button&&I(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(tZ(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(tZ(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(tZ(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(tZ(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(tZ(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(tZ(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(tZ(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(tZ(this.screenElement,"mousemove",e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",O),rC||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(rr,this.textarea,e.ownerDocument.defaultView??window,this._document??"u">typeof window?window.document:null)),this._instantiationService.setService(el,this._coreBrowserService),this._register(tZ(this.textarea,"focus",e=>this._handleTextAreaFocus(e))),this._register(tZ(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i7,this._document,this._helperContainer),this._instantiationService.setService(ea,this._charSizeService),this._themeService=this._instantiationService.createInstance(rY),this._instantiationService.setService(ef,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(iX),this._instantiationService.setService(ed,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(rL,this.rows,this.screenElement)),this._instantiationService.setService(eh,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(iC,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ra),this._instantiationService.setService(ec,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(n4,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(i_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(rH,this.element,this.screenElement,n)),this._instantiationService.setService(eu,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(ej.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(iv,this.screenElement)),this._register(tZ(this.element,"mousedown",e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(n3,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ix,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ix,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i8,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function r(i){let r,n,s=e._mouseService.getMouseReportCoords(i,e.screenElement);if(!s)return!1;switch(i.overrideType||i.type){case"mousemove":n=32,void 0===i.buttons?(r=3,void 0!==i.button&&(r=i.button<3?i.button:3)):r=1&i.buttons?0:4&i.buttons?1:2&i.buttons?2:3;break;case"mouseup":n=0,r=i.button<3?i.button:3;break;case"mousedown":n=1,r=i.button<3?i.button:3;break;case"wheel":if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(i))return!1;let o=i.deltaY;if(0===o||0===e.coreMouseService.consumeWheelEvent(i,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return!1;n=o<0?0:1,r=4;break;default:return!1}return void 0!==n&&void 0!==r&&!(r>4)&&e.coreMouseService.triggerMouseEvent({col:s.col,row:s.row,x:s.x,y:s.y,button:r,action:n,ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s=e=>(r(e),e.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(e)),o=e=>(r(e),this.cancel(e,!0)),a=e=>{e.buttons&&r(e)},l=e=>{e.buttons||r(e)};this._register(this.coreMouseService.onProtocolChange(e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?n.mousemove||(i.addEventListener("mousemove",l),n.mousemove=l):(i.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&e?n.wheel||(i.addEventListener("wheel",o,{passive:!1}),n.wheel=o):(i.removeEventListener("wheel",n.wheel),n.wheel=null),2&e?n.mouseup||(n.mouseup=s):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&e?n.mousedrag||(n.mousedrag=a):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(tZ(i,"mousedown",e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return r(e),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(e)})),this._register(tZ(i,"wheel",i=>{if(!n.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(i))return!1;if(!this.buffer.hasScrollback){if(0===i.deltaY)return!1;if(0===e.coreMouseService.consumeWheelEvent(i,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return this.cancel(i,!0);let r=iL.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(i.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(r,!0),this.cancel(i,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;0!==i&&this.scrollLines(i)}paste(e){N(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,i,r){this._selectionService.setSelection(e,i,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;i||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);let r=function(e,i,r,n){let s={type:0,cancel:!1,key:void 0},o=!!e.shiftKey|2*!!e.altKey|4*!!e.ctrlKey|8*!!e.metaKey;switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?i?s.key=iL.ESC+"OA":s.key=iL.ESC+"[A":"UIKeyInputLeftArrow"===e.key?i?s.key=iL.ESC+"OD":s.key=iL.ESC+"[D":"UIKeyInputRightArrow"===e.key?i?s.key=iL.ESC+"OC":s.key=iL.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(i?s.key=iL.ESC+"OB":s.key=iL.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":iL.DEL,e.altKey&&(s.key=iL.ESC+s.key);break;case 9:if(e.shiftKey){s.key=iL.ESC+"[Z";break}s.key=iL.HT,s.cancel=!0;break;case 13:s.key=e.altKey?iL.ESC+iL.CR:iL.CR,s.cancel=!0;break;case 27:s.key=iL.ESC,e.altKey&&(s.key=iL.ESC+iL.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;o?s.key=iL.ESC+"[1;"+(o+1)+"D":i?s.key=iL.ESC+"OD":s.key=iL.ESC+"[D";break;case 39:if(e.metaKey)break;o?s.key=iL.ESC+"[1;"+(o+1)+"C":i?s.key=iL.ESC+"OC":s.key=iL.ESC+"[C";break;case 38:if(e.metaKey)break;o?s.key=iL.ESC+"[1;"+(o+1)+"A":i?s.key=iL.ESC+"OA":s.key=iL.ESC+"[A";break;case 40:if(e.metaKey)break;o?s.key=iL.ESC+"[1;"+(o+1)+"B":i?s.key=iL.ESC+"OB":s.key=iL.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=iL.ESC+"[2~");break;case 46:o?s.key=iL.ESC+"[3;"+(o+1)+"~":s.key=iL.ESC+"[3~";break;case 36:o?s.key=iL.ESC+"[1;"+(o+1)+"H":i?s.key=iL.ESC+"OH":s.key=iL.ESC+"[H";break;case 35:o?s.key=iL.ESC+"[1;"+(o+1)+"F":i?s.key=iL.ESC+"OF":s.key=iL.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=iL.ESC+"[5;"+(o+1)+"~":s.key=iL.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=iL.ESC+"[6;"+(o+1)+"~":s.key=iL.ESC+"[6~";break;case 112:o?s.key=iL.ESC+"[1;"+(o+1)+"P":s.key=iL.ESC+"OP";break;case 113:o?s.key=iL.ESC+"[1;"+(o+1)+"Q":s.key=iL.ESC+"OQ";break;case 114:o?s.key=iL.ESC+"[1;"+(o+1)+"R":s.key=iL.ESC+"OR";break;case 115:o?s.key=iL.ESC+"[1;"+(o+1)+"S":s.key=iL.ESC+"OS";break;case 116:o?s.key=iL.ESC+"[15;"+(o+1)+"~":s.key=iL.ESC+"[15~";break;case 117:o?s.key=iL.ESC+"[17;"+(o+1)+"~":s.key=iL.ESC+"[17~";break;case 118:o?s.key=iL.ESC+"[18;"+(o+1)+"~":s.key=iL.ESC+"[18~";break;case 119:o?s.key=iL.ESC+"[19;"+(o+1)+"~":s.key=iL.ESC+"[19~";break;case 120:o?s.key=iL.ESC+"[20;"+(o+1)+"~":s.key=iL.ESC+"[20~";break;case 121:o?s.key=iL.ESC+"[21;"+(o+1)+"~":s.key=iL.ESC+"[21~";break;case 122:o?s.key=iL.ESC+"[23;"+(o+1)+"~":s.key=iL.ESC+"[23~";break;case 123:o?s.key=iL.ESC+"[24;"+(o+1)+"~":s.key=iL.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if((!r||n)&&e.altKey&&!e.metaKey){let i=nG[e.keyCode]?.[+!!e.shiftKey];if(i)s.key=iL.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){let i=String.fromCharCode(e.ctrlKey?e.keyCode-64:e.keyCode+32);e.shiftKey&&(i=i.toUpperCase()),s.key=iL.ESC+i}else if(32===e.keyCode)s.key=iL.ESC+(e.ctrlKey?iL.NUL:" ");else if("Dead"===e.key&&e.code.startsWith("Key")){let i=e.code.slice(3,4);e.shiftKey||(i=i.toLowerCase()),s.key=iL.ESC+i,s.cancel=!0}}else!r||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?!e.key||e.ctrlKey||e.altKey||e.metaKey||!(e.keyCode>=48)||1!==e.key.length?e.key&&e.ctrlKey&&("_"===e.key&&(s.key=iL.US),"@"===e.key&&(s.key=iL.NUL)):s.key=e.key:65===e.keyCode&&(s.type=1);else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=iL.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=iL.DEL:219===e.keyCode?s.key=iL.ESC:220===e.keyCode?s.key=iL.FS:221===e.keyCode&&(s.key=iL.GS)}return s}(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===r.type||2===r.type){let i=this.rows-1;return this.scrollLines(2===r.type?-i:i),this.cancel(e,!0)}return 1===r.type&&this.selectAll(),!!(this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&90>=e.key.charCodeAt(0))||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):((r.key===iL.ETX||r.key===iL.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)?this.cancel(e,!0):void(this._keyDownHandled=!0))}_isThirdLevelShift(e,i){let r=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return"keypress"===i.type?r:r&&(!i.keyCode||i.keyCode>47)}_keyUp(e){var i;this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16===(i=e).keyCode||17===i.keyCode||18===i.keyCode||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(null===e.which||void 0===e.which)i=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;i=e.which}return!!i&&(!e.altKey&&!e.ctrlKey&&!e.metaKey||!!this._isThirdLevelShift(this.browser,e))&&(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(r1));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(iL.ESC+"[I"):this.coreService.triggerDataEvent(iL.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${iL.ESC}[4;${r};${i}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${iL.ESC}[6;${s};${n}t`)}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}},n9=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let r={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(r),i.dispose=()=>this._wrappedAddonDispose(r),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){i=r;break}if(-1===i)throw Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},n8=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new q)}translateToString(e,i,r){return this._line.translateToString(e,i,r)}},n7=class{constructor(e,i){this._buffer=e,this.type=i}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let i=this._buffer.lines.get(e);if(i)return new n8(i)}getNullCell(){return new q}},se=class extends eD{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new eY),this.onBufferChange=this._onBufferChange.event,this._normal=new n7(this._core.buffers.normal,"normal"),this._alternate=new n7(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},st=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,e=>i(e.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(e,r)=>i(e,r.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},si=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},sr=["cols","rows"],sn=0,ss=class extends eD{constructor(e){super(),this._core=this._register(new n6(e)),this._addonManager=this._register(new n9),this._publicOptions={...this._core.options};let i=e=>this._core.options[e],r=(e,i)=>{this._checkReadonlyOptions(e),this._core.options[e]=i};for(let e in this._core.options){let n={get:i.bind(this,e),set:r.bind(this,e)};Object.defineProperty(this._publicOptions,e,n)}}_checkReadonlyOptions(e){if(sr.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new st(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new si(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new se(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,i,r){this._verifyIntegers(e,i,r),this._core.select(e,i,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
31
- `,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return O},set promptLabel(t){O=t},get tooMuchOutput(){return B},set tooMuchOutput(t){B=t}}}_verifyIntegers(...e){for(sn of e)if(sn===1/0||isNaN(sn)||sn%1!=0)throw Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(sn of e)if(sn&&(sn===1/0||isNaN(sn)||sn%1!=0||sn<0))throw Error("This API only accepts positive integers")}};e.s(["Terminal",0,ss],99894);var so=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let i=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),a={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},l=a.top+a.bottom;return{cols:Math.max(2,Math.floor((s-(a.right+a.left)-i)/e.css.cell.width)),rows:Math.max(1,Math.floor((n-l)/e.css.cell.height))}}};e.s(["FitAddon",0,so],93309)},31343,10031,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,r],31343);let n=(0,i.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["SquarePen",0,n],10031)},77814,e=>{"use strict";var i,r=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var n=e.i(71645),s=e.i(231),o=e.i(62372);let a=new Map;function l(e,i,r){return null==e?"":(function(e,i){let r=JSON.stringify({locale:e,options:i}),n=a.get(r);if(n)return n;let s=new Intl.NumberFormat(e,i);return a.set(r,s),s})(i,r).format(e)}var c=e.i(27601),h=e.i(67805);let u=n.createContext(void 0);function d(){let e=n.useContext(u);if(void 0===e)throw Error((0,h.default)(51));return e}let f=((i={}).complete="data-complete",i.indeterminate="data-indeterminate",i.progressing="data-progressing",i),p={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function g(e,i){return null==i?"indeterminate progress":e||`${i}%`}let m=n.forwardRef(function(e,i){var a;let{format:h,getAriaValueText:d=g,locale:f,max:m=100,min:_=0,value:v,render:y,className:b,children:S,...w}=e,[x,C]=n.useState(),k=(0,s.useValueAsRef)(h),E="indeterminate";Number.isFinite(v)&&(E=v===m?"complete":"progressing");let R=(a=k.current,null==v?"":a?l(v,f,a):l(v/100,f,{style:"percent"})),T=n.useMemo(()=>({status:E}),[E]),D={"aria-labelledby":x,"aria-valuemax":m,"aria-valuemin":_,"aria-valuenow":v??void 0,"aria-valuetext":d(R,v),role:"progressbar",children:(0,r.jsxs)(n.Fragment,{children:[S,(0,r.jsx)("span",{role:"presentation",style:o.visuallyHidden,children:"x"})]})},L=n.useMemo(()=>({formattedValue:R,max:m,min:_,setLabelId:C,state:T,status:E,value:v}),[R,m,_,C,T,E,v]),A=(0,c.useRenderElement)("div",e,{state:T,ref:i,props:[D,w],stateAttributesMapping:p});return(0,r.jsx)(u.Provider,{value:L,children:A})}),_=n.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{state:o}=d();return(0,c.useRenderElement)("div",e,{state:o,ref:i,props:s,stateAttributesMapping:p})}),v=n.forwardRef(function(e,i){let{render:r,className:s,...o}=e,{max:a,min:l,value:h,state:u}=d(),f=Number.isFinite(h)&&null!==h?(h-l)*100/(a-l):null,g=n.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,c.useRenderElement)("div",e,{state:u,ref:i,props:[{style:g()},o],stateAttributesMapping:p})}),y=n.forwardRef(function(e,i){let{className:r,render:n,children:s,...o}=e,{value:a,formattedValue:l,state:h}=d(),u=null==a?"indeterminate":l,f=null==a?null:l;return(0,c.useRenderElement)("span",e,{state:h,ref:i,props:[{"aria-hidden":!0,children:"function"==typeof s?s(u,a):f},o],stateAttributesMapping:p})});var b=e.i(24564);let S=n.forwardRef(function(e,i){let{render:r,className:n,id:s,...o}=e,{setLabelId:a,state:l}=d(),h=(0,b.useRegisteredLabelId)(s,a);return(0,c.useRenderElement)("span",e,{state:l,ref:i,props:[{id:h,role:"presentation"},o],stateAttributesMapping:p})});e.s(["Indicator",0,v,"Label",0,S,"Root",0,m,"Track",0,_,"Value",0,y],45929);var w=e.i(45929),w=w,x=e.i(52088);function C({className:e,...i}){return(0,r.jsx)(w.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...i})}function k({className:e,...i}){return(0,r.jsx)(w.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary",e),style:{transition:"width 500ms ease-in-out"},...i})}e.s(["Progress",0,function({className:e,children:i,value:n,...s}){return(0,r.jsxs)(w.Root,{value:n,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...s,children:[i,(0,r.jsx)(C,{children:(0,r.jsx)(k,{})})]})}],77814)},67211,e=>{"use strict";var i=e.i(18050),r=e.i(71645),n=e.i(99894),s=e.i(93309),o=e.i(96085),a=e.i(627),l=e.i(31278),c=e.i(74886),h=e.i(31343),u=e.i(43531),d=e.i(10031),f=e.i(12382),p=e.i(85902),g=e.i(77814),m=e.i(70935);let _=(0,r.forwardRef)(function({tabId:e,cwd:_,env:v,worktreePath:y,command:b,className:S="",initialTodos:w,isActive:x,onTodosUpdated:C,onStatusChange:k},E){let R=(0,r.useRef)(null),T=(0,r.useRef)(null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),A=(0,r.useRef)(e),[M,P]=(0,r.useState)(!1),O=(0,r.useRef)(!1),B=(0,r.useRef)(x),N=(0,r.useRef)(!1),I=(0,r.useRef)(!1),[F,z]=(0,r.useState)("idle"),[H,j]=(0,r.useState)("idle"),[W,$]=(0,r.useState)(w??[]),[U,q]=(0,r.useState)(!1),{effectiveTheme:V}=(0,a.useTheme)(),K=(0,r.useRef)(k);K.current=k;let Y="dark"===V,X=Y?{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",selectionBackground:"#add6ff"};function G(){let e=L.current,i=T.current,r=A.current;e&&e.connected&&i&&r&&e.emit("resize",{sessionId:r,cols:i.cols,rows:i.rows})}function J(e){e.write("\x1b[2J\x1b[3J\x1b[H")}async function Z(i,r,n){z("connecting");try{var s,a,l,c;let h,u,d=await fetch((0,m.apiUrl)("/api/terminal/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:_,env:v,worktreePath:y,sessionId:i,command:b}),signal:n});if(!d.ok){let e=await d.text().catch(()=>"");throw Error(`Failed to create session: ${d.status} ${e}`)}let f=await d.json();if(n.aborted)return;A.current=f.sessionId,f.reused||J(r),s=f.sessionId,a=f.reused,l=r,c=n,L.current=h=(0,o.io)((0,m.getServerUrl)(),{transports:["websocket"]}),u=!1,h.on("connect",()=>{let e=N.current;N.current=!0,e?l.writeln("\x1b[90mReconnected.\x1b[0m"):a?(I.current=!0,J(l)):l.writeln("\x1b[90mConnected.\x1b[0m"),z("connected"),h.emit("join",{room:`tab:${s}`}),e&&B.current&&l.focus()}),h.on("output",({data:e})=>{a&&!u?(u=!0,l.write(e,()=>{I.current=!1,D.current?.fit(),G()})):l.write(e)}),h.on("exit",({exitCode:e})=>{console.log("[TerminalView] PTY exited with code:",e),z("exited"),A.current=null,L.current=null}),h.on("error",({message:e})=>{console.error("[TerminalView] Socket error message:",e),z("error")}),h.on("disconnect",()=>{c.aborted||z(e=>"exited"===e||"paused"===e||"idle"===e?e:"exited")}),h.on("status-changed",({status:e})=>{j(e)}),h.on("todos-updated",({todos:i})=>{$(i),C?.(e,i)}),h.on("editor:open",({sessionId:e,content:i})=>{window.dispatchEvent(new CustomEvent("editor-session-open-request",{detail:{sessionId:e,content:i}}))}),l.onData(e=>{h.connected&&A.current&&h.emit("input",{sessionId:A.current,data:e})})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("[TerminalView] connectSession error:",e instanceof Error?e.message:String(e)),z("error")}}async function Q(){let i=T.current;if(!i)return;let r=new AbortController;await Z(e,i,r.signal)}(0,r.useEffect)(()=>{K.current?.(e,F,H)},[e,F,H]),(0,r.useLayoutEffect)(()=>{B.current=x}),(0,r.useEffect)(()=>{x&&T.current?.focus()},[x]),(0,r.useEffect)(()=>{if(M)T.current?.blur();else if(x){let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}},[M,x]),(0,r.useEffect)(()=>{"connected"===F&&D.current&&(D.current.fit(),I.current||G())},[F]),(0,r.useEffect)(()=>{if(!R.current)return;let i=new n.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"Cascadia Code", "Fira Code", "Menlo", monospace',theme:X,allowProposedApi:!0}),r=new s.FitAddon;i.loadAddon(r),i.open(R.current),r.fit(),T.current=i,D.current=r,B.current&&i.focus(),i.attachCustomKeyEventHandler(()=>!O.current),i.buffer.onBufferChange(e=>{"normal"===e.type&&i.refresh(0,i.rows-1)});let o=new ResizeObserver(()=>{r.fit(),I.current||G()});o.observe(R.current);let a=new AbortController;return Z(e,i,a.signal),()=>{a.abort(),o.disconnect(),i.dispose(),T.current=null,D.current=null,L.current?.disconnect(),L.current=null}},[]),(0,r.useEffect)(()=>{T.current&&(T.current.options.theme=X)},[Y]),(0,r.useEffect)(()=>{function e(){O.current=!0,T.current?.blur()}function i(){if(O.current=!1,!B.current)return;let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}return window.addEventListener("editor-session-open",e),window.addEventListener("editor-session-done",i),()=>{window.removeEventListener("editor-session-open",e),window.removeEventListener("editor-session-done",i)}},[]),(0,r.useEffect)(()=>{function e(){if("visible"!==document.visibilityState)return;let e=L.current;if(!e||!e.connected)return;let i=setTimeout(()=>{e.off("health-check-ack",r),e.disconnect()},3e3);function r(){clearTimeout(i),B.current&&T.current?.focus()}e.once("health-check-ack",r),e.emit("health-check")}return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),(0,r.useImperativeHandle)(E,()=>({sendInput:e=>{let i=L.current,r=A.current;i?.connected&&r&&i.emit("input",{sessionId:r,data:e})},focus:()=>{T.current?.focus()}}));let ee=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{q(!0),setTimeout(()=>q(!1),2e3)})},[e]),et="connecting"===F,ei="paused"===F||"exited"===F||"error"===F,er="connected"===F,en=W.filter(e=>"deleted"!==e.status),es=en.filter(e=>"completed"===e.status).length,eo=en.length,ea=e.length>8?`${e.slice(0,8)}…`:e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`flex flex-col h-full min-h-0 ${S}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 border-b border-border flex-shrink-0 bg-card",children:[(0,i.jsx)("span",{className:"font-mono text-xs text-muted-foreground",title:e,children:ea}),(0,i.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground hover:text-foreground",title:"Copy tab ID",children:U?(0,i.jsx)(u.Check,{className:"w-3 h-3 text-success"}):(0,i.jsx)(c.Copy,{className:"w-3 h-3"})}),(0,i.jsxs)(p.Button,{size:"xs",onClick:function(){let e=L.current,i=A.current;if(!e||!e.connected||!i)return;let r=`claude --dangerously-skip-permissions --resume ${i} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${i}
31
+ `,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return O},set promptLabel(t){O=t},get tooMuchOutput(){return B},set tooMuchOutput(t){B=t}}}_verifyIntegers(...e){for(sn of e)if(sn===1/0||isNaN(sn)||sn%1!=0)throw Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(sn of e)if(sn&&(sn===1/0||isNaN(sn)||sn%1!=0||sn<0))throw Error("This API only accepts positive integers")}};e.s(["Terminal",0,ss],99894);var so=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let i=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),a={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},l=a.top+a.bottom;return{cols:Math.max(2,Math.floor((s-(a.right+a.left)-i)/e.css.cell.width)),rows:Math.max(1,Math.floor((n-l)/e.css.cell.height))}}};e.s(["FitAddon",0,so],93309)},31343,10031,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,r],31343);let n=(0,i.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["SquarePen",0,n],10031)},77814,e=>{"use strict";var i,r=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var n=e.i(71645),s=e.i(231),o=e.i(62372);let a=new Map;function l(e,i,r){return null==e?"":(function(e,i){let r=JSON.stringify({locale:e,options:i}),n=a.get(r);if(n)return n;let s=new Intl.NumberFormat(e,i);return a.set(r,s),s})(i,r).format(e)}var c=e.i(27601),h=e.i(67805);let u=n.createContext(void 0);function d(){let e=n.useContext(u);if(void 0===e)throw Error((0,h.default)(51));return e}let f=((i={}).complete="data-complete",i.indeterminate="data-indeterminate",i.progressing="data-progressing",i),p={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function g(e,i){return null==i?"indeterminate progress":e||`${i}%`}let m=n.forwardRef(function(e,i){var a;let{format:h,getAriaValueText:d=g,locale:f,max:m=100,min:_=0,value:v,render:y,className:b,children:S,...w}=e,[x,C]=n.useState(),k=(0,s.useValueAsRef)(h),E="indeterminate";Number.isFinite(v)&&(E=v===m?"complete":"progressing");let R=(a=k.current,null==v?"":a?l(v,f,a):l(v/100,f,{style:"percent"})),T=n.useMemo(()=>({status:E}),[E]),D={"aria-labelledby":x,"aria-valuemax":m,"aria-valuemin":_,"aria-valuenow":v??void 0,"aria-valuetext":d(R,v),role:"progressbar",children:(0,r.jsxs)(n.Fragment,{children:[S,(0,r.jsx)("span",{role:"presentation",style:o.visuallyHidden,children:"x"})]})},L=n.useMemo(()=>({formattedValue:R,max:m,min:_,setLabelId:C,state:T,status:E,value:v}),[R,m,_,C,T,E,v]),A=(0,c.useRenderElement)("div",e,{state:T,ref:i,props:[D,w],stateAttributesMapping:p});return(0,r.jsx)(u.Provider,{value:L,children:A})}),_=n.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{state:o}=d();return(0,c.useRenderElement)("div",e,{state:o,ref:i,props:s,stateAttributesMapping:p})}),v=n.forwardRef(function(e,i){let{render:r,className:s,...o}=e,{max:a,min:l,value:h,state:u}=d(),f=Number.isFinite(h)&&null!==h?(h-l)*100/(a-l):null,g=n.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,c.useRenderElement)("div",e,{state:u,ref:i,props:[{style:g()},o],stateAttributesMapping:p})}),y=n.forwardRef(function(e,i){let{className:r,render:n,children:s,...o}=e,{value:a,formattedValue:l,state:h}=d(),u=null==a?"indeterminate":l,f=null==a?null:l;return(0,c.useRenderElement)("span",e,{state:h,ref:i,props:[{"aria-hidden":!0,children:"function"==typeof s?s(u,a):f},o],stateAttributesMapping:p})});var b=e.i(24564);let S=n.forwardRef(function(e,i){let{render:r,className:n,id:s,...o}=e,{setLabelId:a,state:l}=d(),h=(0,b.useRegisteredLabelId)(s,a);return(0,c.useRenderElement)("span",e,{state:l,ref:i,props:[{id:h,role:"presentation"},o],stateAttributesMapping:p})});e.s(["Indicator",0,v,"Label",0,S,"Root",0,m,"Track",0,_,"Value",0,y],45929);var w=e.i(45929),w=w,x=e.i(52088);function C({className:e,...i}){return(0,r.jsx)(w.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...i})}function k({className:e,...i}){return(0,r.jsx)(w.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary",e),style:{transition:"width 500ms ease-in-out"},...i})}e.s(["Progress",0,function({className:e,children:i,value:n,...s}){return(0,r.jsxs)(w.Root,{value:n,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...s,children:[i,(0,r.jsx)(C,{children:(0,r.jsx)(k,{})})]})}],77814)},67211,e=>{"use strict";var i=e.i(18050),r=e.i(71645),n=e.i(99894),s=e.i(93309),o=e.i(96085),a=e.i(627),l=e.i(31278),c=e.i(74886),h=e.i(31343),u=e.i(43531),d=e.i(10031),f=e.i(12382),p=e.i(85902),g=e.i(77814),m=e.i(70935);let _=(0,r.forwardRef)(function({tabId:e,cwd:_,env:v,worktreePath:y,command:b,className:S="",initialTodos:w,isActive:x,onTodosUpdated:C,onStatusChange:k},E){let R=(0,r.useRef)(null),T=(0,r.useRef)(null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),A=(0,r.useRef)(e),[M,P]=(0,r.useState)(!1),O=(0,r.useRef)(!1),B=(0,r.useRef)(x),N=(0,r.useRef)(!1),I=(0,r.useRef)(!1),[F,z]=(0,r.useState)("idle"),[H,j]=(0,r.useState)("idle"),[W,$]=(0,r.useState)(w??[]),[U,q]=(0,r.useState)(!1),{effectiveTheme:V}=(0,a.useTheme)(),K=(0,r.useRef)(k);K.current=k;let Y="dark"===V,X=Y?{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",selectionBackground:"#add6ff"};function G(){let e=L.current,i=T.current,r=A.current;e&&e.connected&&i&&r&&e.emit("resize",{sessionId:r,cols:i.cols,rows:i.rows})}function J(e){e.write("\x1b[2J\x1b[3J\x1b[H")}async function Z(i,r,n){z("connecting");try{var s,a,l,c;let h,u,d=await fetch((0,m.apiUrl)("/api/terminal/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:_,env:v,worktreePath:y,sessionId:i,command:b}),signal:n});if(!d.ok){let e=await d.text().catch(()=>"");throw Error(`Failed to create session: ${d.status} ${e}`)}let f=await d.json();if(n.aborted)return;A.current=f.sessionId,f.reused||J(r),s=f.sessionId,a=f.reused,l=r,c=n,L.current=h=(0,o.io)((0,m.getServerUrl)(),{transports:["websocket"]}),u=!1,h.on("connect",()=>{let e=N.current;N.current=!0,e?l.writeln("\x1b[90mReconnected.\x1b[0m"):a?(I.current=!0,J(l)):l.writeln("\x1b[90mConnected.\x1b[0m"),z("connected"),h.emit("join",{room:`tab:${s}`}),e&&B.current&&l.focus()}),h.on("output",({data:e})=>{a&&!u?(u=!0,l.write(e,()=>{I.current=!1,D.current?.fit();let e=T.current;if(e){let i=64===e.cols?63:64;e.resize(i,e.rows),G(),setTimeout(()=>{D.current?.fit(),G()},50)}l.scrollToBottom()})):l.write(e)}),h.on("exit",({exitCode:e})=>{console.log("[TerminalView] PTY exited with code:",e),z("exited"),A.current=null,L.current=null}),h.on("error",({message:e})=>{console.error("[TerminalView] Socket error message:",e),z("error")}),h.on("disconnect",()=>{c.aborted||z(e=>"exited"===e||"paused"===e||"idle"===e?e:"exited")}),h.on("status-changed",({status:e})=>{j(e)}),h.on("todos-updated",({todos:i})=>{$(i),C?.(e,i)}),h.on("editor:open",({sessionId:e,content:i})=>{window.dispatchEvent(new CustomEvent("editor-session-open-request",{detail:{sessionId:e,content:i}}))}),l.onData(e=>{h.connected&&A.current&&h.emit("input",{sessionId:A.current,data:e})})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("[TerminalView] connectSession error:",e instanceof Error?e.message:String(e)),z("error")}}async function Q(){let i=T.current;if(!i)return;let r=new AbortController;await Z(e,i,r.signal)}(0,r.useEffect)(()=>{K.current?.(e,F,H)},[e,F,H]),(0,r.useLayoutEffect)(()=>{B.current=x}),(0,r.useEffect)(()=>{x&&T.current?.focus()},[x]),(0,r.useEffect)(()=>{if(M)T.current?.blur();else if(x){let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}},[M,x]),(0,r.useEffect)(()=>{"connected"===F&&D.current&&(D.current.fit(),I.current||G())},[F]),(0,r.useEffect)(()=>{if(!R.current)return;let i=new n.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"Cascadia Code", "Fira Code", "Menlo", monospace',theme:X,allowProposedApi:!0}),r=new s.FitAddon;i.loadAddon(r),i.open(R.current),r.fit(),T.current=i,D.current=r,B.current&&i.focus(),i.attachCustomKeyEventHandler(()=>!O.current),i.buffer.onBufferChange(e=>{"normal"===e.type&&i.refresh(0,i.rows-1)});let o=new ResizeObserver(()=>{!O.current&&(r.fit(),I.current||G())});o.observe(R.current);let a=new AbortController;return Z(e,i,a.signal),()=>{a.abort(),o.disconnect(),i.dispose(),T.current=null,D.current=null,L.current?.disconnect(),L.current=null}},[]),(0,r.useEffect)(()=>{T.current&&(T.current.options.theme=X)},[Y]),(0,r.useEffect)(()=>{function e(){O.current=!0,T.current?.blur()}function i(){if(setTimeout(()=>{let e=T.current;if(e){let i=64===e.cols?63:64;e.resize(i,e.rows),G(),setTimeout(()=>{O.current=!1,D.current?.fit(),G()},100)}else O.current=!1},300),!B.current)return;let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}return window.addEventListener("editor-session-open",e),window.addEventListener("editor-session-done",i),()=>{window.removeEventListener("editor-session-open",e),window.removeEventListener("editor-session-done",i)}},[]),(0,r.useEffect)(()=>{function e(){if("visible"!==document.visibilityState)return;let e=L.current;if(!e||!e.connected)return;let i=setTimeout(()=>{e.off("health-check-ack",r),e.disconnect()},3e3);function r(){clearTimeout(i),B.current&&T.current?.focus()}e.once("health-check-ack",r),e.emit("health-check")}return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),(0,r.useImperativeHandle)(E,()=>({sendInput:e=>{let i=L.current,r=A.current;i?.connected&&r&&i.emit("input",{sessionId:r,data:e})},focus:()=>{T.current?.focus()}}));let ee=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{q(!0),setTimeout(()=>q(!1),2e3)})},[e]),et="connecting"===F,ei="paused"===F||"exited"===F||"error"===F,er="connected"===F,en=W.filter(e=>"deleted"!==e.status),es=en.filter(e=>"completed"===e.status).length,eo=en.length,ea=e.length>8?`${e.slice(0,8)}…`:e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`flex flex-col h-full min-h-0 ${S}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 border-b border-border flex-shrink-0 bg-card",children:[(0,i.jsx)("span",{className:"font-mono text-xs text-muted-foreground",title:e,children:ea}),(0,i.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground hover:text-foreground",title:"Copy tab ID",children:U?(0,i.jsx)(u.Check,{className:"w-3 h-3 text-success"}):(0,i.jsx)(c.Copy,{className:"w-3 h-3"})}),(0,i.jsxs)(p.Button,{size:"xs",onClick:function(){let e=L.current,i=A.current;if(!e||!e.connected||!i)return;let r=`claude --dangerously-skip-permissions --resume ${i} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${i}
32
32
  `;e.emit("input",{sessionId:i,data:r})},disabled:!er,title:"Run Claude",children:[(0,i.jsx)(h.Play,{className:"w-3 h-3"}),"Run Claude"]}),(0,i.jsxs)(p.Button,{variant:"ghost",size:"xs",onClick:()=>P(!0),disabled:!er,className:"text-muted-foreground hover:text-foreground",title:"Open editor input",children:[(0,i.jsx)(d.SquarePen,{className:"w-3 h-3"}),"Open Editor"]}),eo>0&&(0,i.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",title:W.find(e=>"in_progress"===e.status)?.content??"",children:[(0,i.jsx)(g.Progress,{value:es,max:eo,className:"w-16 gap-0 [&_[data-slot=progress-track]]:h-[3px]"}),(0,i.jsxs)("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[es,"/",eo]})]})]}),(0,i.jsxs)("div",{className:"relative flex-1 min-h-0 overflow-hidden",children:[(0,i.jsx)("div",{ref:R,className:"w-full h-full",style:{padding:"4px"}}),et&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background",children:(0,i.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-xs",children:[(0,i.jsx)(l.Loader2,{className:"w-4 h-4 animate-spin"}),(0,i.jsx)("span",{children:"Connecting..."})]})}),ei&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/90",children:(0,i.jsxs)("div",{className:"text-center space-y-2",children:["error"===F&&(0,i.jsx)("p",{className:"text-xs text-destructive",children:"Connection failed"}),"exited"===F&&(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:"Session ended"}),"paused"===F&&(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paused"}),(0,i.jsx)(p.Button,{size:"xs",onClick:Q,children:"Reconnect"})]})})]})]}),(0,i.jsx)(f.MonacoEditorModal,{open:M,onOpenChange:e=>{e.open||P(!1)},onSubmit:e=>{T.current&&e&&T.current.paste(e),P(!1)},title:"Terminal Input",submitLabel:"Paste"})]})});e.s(["TerminalView",0,_])}]);